The best way to control Claude Code, Codex and more from any computer or phone

main
ts 50 lines 1.38 KB
Raw
1 import type * as qapps from "@distilled.cloud/aws/qapps";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { QApp } from "./QApp.ts";
5
6 /**
7 * Request for {@link ImportDocument} — `instanceId` and `appId` are injected from the bound Q App.
8 */
9 export interface ImportDocumentRequest extends Omit<
10 qapps.ImportDocumentInput,
11 "instanceId" | "appId"
12 > {}
13
14 /**
15 * Runtime binding for `qapps:ImportDocument`.
16 *
17 * Uploads a base64-encoded file into a card of the bound Q App, at app or session scope. Provide the implementation with
18 * `Effect.provide(AWS.QApps.ImportDocumentHttp)`.
19 * ### Files
20 * **Example:** Import a Document
21 * ```typescript
22 * // init — bind the operation to the Q App
23 * const importDocument = yield* AWS.QApps.ImportDocument(app);
24 *
25 * // runtime
26 * const imported = yield* importDocument({
27 * cardId,
28 * fileContentsBase64,
29 * fileName: "notes.txt",
30 * scope: "SESSION",
31 * sessionId,
32 * });
33 * console.log(imported.fileId);
34 * ```
35 *
36 * @binding
37 */
38 export interface ImportDocument extends Binding.Service<
39 ImportDocument,
40 "AWS.QApps.ImportDocument",
41 (
42 app: QApp,
43 ) => Effect.Effect<
44 (
45 request: ImportDocumentRequest,
46 ) => Effect.Effect<qapps.ImportDocumentOutput, qapps.ImportDocumentError>
47 >
48 > {}
49
50 export const ImportDocument = Binding.Service<ImportDocument>("AWS.QApps.ImportDocument");