@chanto/web 0.0.0-stage → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,75 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ /**
5
+ * One conversation with the agent, over one project.
6
+ */
7
+ export class Session {
8
+ free(): void;
9
+ [Symbol.dispose](): void;
10
+ /**
11
+ * Every file in the project (`.gitignore` honoured), sorted.
12
+ */
13
+ files(): string[];
14
+ /**
15
+ * The conversation so far, as the model sees it (JSON); empty while a
16
+ * turn runs.
17
+ */
18
+ messages_json(): string;
19
+ constructor(base_url: string, model: string, api_key: string | null | undefined, system_prompt: string, text_tools: boolean, cwd: string);
20
+ read_file(path: string): string | undefined;
21
+ /**
22
+ * Answer `input`. `on_event` gets each event as a JSON string (see
23
+ * `chanto_core::agent::Event`); resolves to the final reply.
24
+ */
25
+ run(input: string, transport: Function, on_event: Function): Promise<any>;
26
+ /**
27
+ * Model requests one turn may make (default 50).
28
+ */
29
+ set_max_steps(n: number): void;
30
+ write_file(path: string, text: string): void;
31
+ }
32
+
33
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
34
+
35
+ export interface InitOutput {
36
+ readonly memory: WebAssembly.Memory;
37
+ readonly __wbg_session_free: (a: number, b: number) => void;
38
+ readonly session_files: (a: number, b: number) => void;
39
+ readonly session_messages_json: (a: number, b: number) => void;
40
+ readonly session_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => number;
41
+ readonly session_read_file: (a: number, b: number, c: number, d: number) => void;
42
+ readonly session_run: (a: number, b: number, c: number, d: number, e: number) => number;
43
+ readonly session_set_max_steps: (a: number, b: number) => void;
44
+ readonly session_write_file: (a: number, b: number, c: number, d: number, e: number) => void;
45
+ readonly __wasm_bindgen_func_elem_265: (a: number, b: number, c: number, d: number) => void;
46
+ readonly __wasm_bindgen_func_elem_267: (a: number, b: number, c: number, d: number) => void;
47
+ readonly __wbindgen_export: (a: number, b: number) => number;
48
+ readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
49
+ readonly __wbindgen_export3: (a: number) => void;
50
+ readonly __wbindgen_export4: (a: number, b: number) => void;
51
+ readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
52
+ readonly __wbindgen_export5: (a: number, b: number, c: number) => void;
53
+ }
54
+
55
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
56
+
57
+ /**
58
+ * Instantiates the given `module`, which can either be bytes or
59
+ * a precompiled `WebAssembly.Module`.
60
+ *
61
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
62
+ *
63
+ * @returns {InitOutput}
64
+ */
65
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
66
+
67
+ /**
68
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
69
+ * for everything else, calls `WebAssembly.instantiate` directly.
70
+ *
71
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
72
+ *
73
+ * @returns {Promise<InitOutput>}
74
+ */
75
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;