···1818 "title": "Resolve",
1919 "description": "Potentially translates a track uri with a matching scheme into a URL pointing at the audio bytes. If it can be resolved that is, otherwise you'll get `undefined`.",
2020 "params_schema": {
2121- "type": "string",
2222- "description": "The uri to resolve"
2121+ "type": "object",
2222+ "properties": {
2323+ "method": {
2424+ "type": "string",
2525+ "description": "The HTTP method that is going to be used on the resolved URI."
2626+ },
2727+ "uri": { "type": "string", "description": "The URI to resolve." }
2828+ },
2929+ "required": ["method", "uri"]
2330 }
2431 }
2532 }
···1616</main>
17171818<script>
1919- import * as IDB from "idb-keyval";
2020-2119 import { applets } from "@web-applets/sdk";
2220 import { computed, effect, Signal, signal } from "spellcaster";
2321 import { repeat, tags, text } from "spellcaster/hyperscript.js";
2422 import { type FileSystemDirectoryHandle, showDirectoryPicker } from "native-file-system-adapter";
2323+ import * as IDB from "idb-keyval";
2524 import * as URI from "uri-js";
2625 import QS from "query-string";
2726···163162 return data;
164163 };
165164166166- const resolve = async (fileUri: string) => {
165165+ const resolve = async (args: { uri: string }) => {
166166+ const fileUri = args.uri;
167167+167168 if (!isSupported()) {
168169 return undefined;
169170 }
+9-2
src/pages/input/native-fs/_manifest.json
···2929 "title": "Resolve",
3030 "description": "Potentially translates a track uri with a matching scheme into a URL pointing at the audio bytes. If it can be resolved that is, otherwise you'll get `undefined`. Use the `consult` action to get a more detailed answer.",
3131 "params_schema": {
3232- "type": "string",
3333- "description": "The uri to resolve"
3232+ "type": "object",
3333+ "properties": {
3434+ "method": {
3535+ "type": "string",
3636+ "description": "The HTTP method that is going to be used on the resolved URI."
3737+ },
3838+ "uri": { "type": "string", "description": "The URI to resolve." }
3939+ },
4040+ "required": ["method", "uri"]
3441 }
3542 },
3643 "mount": {
···11+{
22+ "name": "diffuse/input/s3",
33+ "title": "Diffuse Input | S3",
44+ "entrypoint": "index.html",
55+ "input_properties": {
66+ "scheme": "s3"
77+ },
88+ "actions": {
99+ "consult": {
1010+ "title": "Consult",
1111+ "params_schema": {
1212+ "type": "string",
1313+ "description": "The uri to check the availability of."
1414+ }
1515+ },
1616+ "list": {
1717+ "title": "List",
1818+ "description": "List tracks.",
1919+ "params_schema": {
2020+ "type": "array",
2121+ "description": "A list of (cached) tracks with an uri matching the scheme",
2222+ "items": {
2323+ "type": "object"
2424+ }
2525+ }
2626+ },
2727+ "resolve": {
2828+ "title": "Resolve",
2929+ "description": "Potentially translates a track uri with a matching scheme into a URL pointing at the audio bytes. If it can be resolved that is, otherwise you'll get `undefined`. Use the `consult` action to get a more detailed answer.",
3030+ "params_schema": {
3131+ "type": "object",
3232+ "properties": {
3333+ "method": {
3434+ "type": "string",
3535+ "description": "The HTTP method that is going to be used on the resolved URI."
3636+ },
3737+ "uri": { "type": "string", "description": "The URI to resolve." }
3838+ },
3939+ "required": ["method", "uri"]
4040+ }
4141+ },
4242+ "mount": {
4343+ "title": "Mount",
4444+ "description": "Prepare for usage."
4545+ },
4646+ "unmount": {
4747+ "title": "Unmount",
4848+ "description": "Callback after usage.",
4949+ "params_schema": {
5050+ "type": "string",
5151+ "description": "The handle id to unmount"
5252+ }
5353+ }
5454+ }
5555+}
+9
src/pages/input/s3/index.astro
···11+---
22+import Layout from "@layouts/applet-pico-ui.astro";
33+import Applet from "./_applet.astro";
44+import { title } from "./_manifest.json";
55+---
66+77+<Layout title={title}>
88+ <Applet />
99+</Layout>
···5050 throw new Error("iframe does not have a contentWindow");
5151 }
52525353- const applet = await applets.connect<D>(frame.contentWindow, {
5454- context: opts.context,
5555- });
5353+ const applet = await applets
5454+ .connect<D>(frame.contentWindow, {
5555+ context: opts.context,
5656+ })
5757+ .catch((err) => {
5858+ console.error("Error connecting to " + src, err);
5959+ throw err;
6060+ });
56615762 if (opts.setHeight) {
5863 applet.onresize = () => {
+7-3
src/scripts/themes/webamp/index.ts
···5454 // TODO: Ideally the URL should only be resolved when needed,
5555 // but webamp doesn't allow for that.
5656 // Maybe you could work around it with a service worker.
5757- const url = await configurator.input.sendAction<string | undefined>("resolve", track.uri, {
5858- timeoutDuration: 60000,
5959- });
5757+ const url = await configurator.input.sendAction<string | undefined>(
5858+ "resolve",
5959+ { method: "GET", uri: track.uri },
6060+ {
6161+ timeoutDuration: 60000,
6262+ },
6363+ );
60646165 if (!url) return acc;
6266