@theokit/tauri 0.1.1 → 0.1.2
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.
- package/dist/sidecar.d.ts +1 -1
- package/dist/sidecar.js +1 -1
- package/dist/sidecar.js.map +1 -1
- package/package.json +2 -2
package/dist/sidecar.d.ts
CHANGED
package/dist/sidecar.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/sidecar.ts
|
|
2
2
|
import { randomUUID } from "crypto";
|
|
3
|
-
import { streamAgentTurnInProcess } from "theokit/server";
|
|
3
|
+
import { streamAgentTurnInProcess } from "theokit/server/agent";
|
|
4
4
|
async function runTurnToJsonl(mod, apiKey, message, write, awaitApproval) {
|
|
5
5
|
try {
|
|
6
6
|
for await (const chunk of streamAgentTurnInProcess(mod, apiKey, {
|
package/dist/sidecar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/sidecar.ts"],"sourcesContent":["import { randomUUID } from 'node:crypto'\n\nimport { streamAgentTurnInProcess, type InProcessAwaitApproval } from 'theokit/server'\n\n/** Writes one JSONL line (the sidecar's stdout `write`). */\nexport type WriteLine = (line: string) => void\n\n/**\n * Resolve one gated-tool approval inline (the Rust shell forwards the webview's decision over stdin).\n * Aliases the seam's {@link InProcessAwaitApproval} so a sidecar can return the full `boolean | HitlDecision`\n * the SDK supports — never a narrower shape (the desktop stdin protocol carries `approved` today, but the\n * type stays forward-compatible with structured decisions).\n */\nexport type SidecarAwaitApproval = InProcessAwaitApproval\n\n/**\n * `@theokit/tauri/sidecar` (ADR-0055 D2) — the NODE side of the desktop app. Run ONE agent turn via the\n * in-process seam (`streamAgentTurnInProcess`, M35/M36) and emit each `UIMessageChunk` as a single JSONL\n * line to `write`; the Rust shell streams these to the webview over a Tauri `Channel`. A thrown error is\n * surfaced as a trailing `{type:'error'}` line, never swallowed (Rule 8). HITL: a gated tool pauses; the\n * caller resolves `awaitApproval` (typically after the Rust shell forwards the webview's decision on stdin).\n */\nexport async function runTurnToJsonl(\n mod: unknown,\n apiKey: string,\n message: string,\n write: WriteLine,\n awaitApproval?: SidecarAwaitApproval,\n): Promise<void> {\n try {\n for await (const chunk of streamAgentTurnInProcess(mod, apiKey, {\n message,\n sessionId: `desktop-${randomUUID()}`,\n awaitApproval,\n })) {\n write(`${JSON.stringify(chunk)}\\n`)\n }\n } catch (err) {\n const errorText = err instanceof Error ? err.message : String(err)\n write(`${JSON.stringify({ type: 'error', errorText })}\\n`)\n }\n}\n"],"mappings":";AAAA,SAAS,kBAAkB;AAE3B,SAAS,gCAA6D;AAoBtE,eAAsB,eACpB,KACA,QACA,SACA,OACA,eACe;AACf,MAAI;AACF,qBAAiB,SAAS,yBAAyB,KAAK,QAAQ;AAAA,MAC9D;AAAA,MACA,WAAW,WAAW,WAAW,CAAC;AAAA,MAClC;AAAA,IACF,CAAC,GAAG;AACF,YAAM,GAAG,KAAK,UAAU,KAAK,CAAC;AAAA,CAAI;AAAA,IACpC;AAAA,EACF,SAAS,KAAK;AACZ,UAAM,YAAY,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG;AACjE,UAAM,GAAG,KAAK,UAAU,EAAE,MAAM,SAAS,UAAU,CAAC,CAAC;AAAA,CAAI;AAAA,EAC3D;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/sidecar.ts"],"sourcesContent":["import { randomUUID } from 'node:crypto'\n\nimport { streamAgentTurnInProcess, type InProcessAwaitApproval } from 'theokit/server/agent'\n\n/** Writes one JSONL line (the sidecar's stdout `write`). */\nexport type WriteLine = (line: string) => void\n\n/**\n * Resolve one gated-tool approval inline (the Rust shell forwards the webview's decision over stdin).\n * Aliases the seam's {@link InProcessAwaitApproval} so a sidecar can return the full `boolean | HitlDecision`\n * the SDK supports — never a narrower shape (the desktop stdin protocol carries `approved` today, but the\n * type stays forward-compatible with structured decisions).\n */\nexport type SidecarAwaitApproval = InProcessAwaitApproval\n\n/**\n * `@theokit/tauri/sidecar` (ADR-0055 D2) — the NODE side of the desktop app. Run ONE agent turn via the\n * in-process seam (`streamAgentTurnInProcess`, M35/M36) and emit each `UIMessageChunk` as a single JSONL\n * line to `write`; the Rust shell streams these to the webview over a Tauri `Channel`. A thrown error is\n * surfaced as a trailing `{type:'error'}` line, never swallowed (Rule 8). HITL: a gated tool pauses; the\n * caller resolves `awaitApproval` (typically after the Rust shell forwards the webview's decision on stdin).\n */\nexport async function runTurnToJsonl(\n mod: unknown,\n apiKey: string,\n message: string,\n write: WriteLine,\n awaitApproval?: SidecarAwaitApproval,\n): Promise<void> {\n try {\n for await (const chunk of streamAgentTurnInProcess(mod, apiKey, {\n message,\n sessionId: `desktop-${randomUUID()}`,\n awaitApproval,\n })) {\n write(`${JSON.stringify(chunk)}\\n`)\n }\n } catch (err) {\n const errorText = err instanceof Error ? err.message : String(err)\n write(`${JSON.stringify({ type: 'error', errorText })}\\n`)\n }\n}\n"],"mappings":";AAAA,SAAS,kBAAkB;AAE3B,SAAS,gCAA6D;AAoBtE,eAAsB,eACpB,KACA,QACA,SACA,OACA,eACe;AACf,MAAI;AACF,qBAAiB,SAAS,yBAAyB,KAAK,QAAQ;AAAA,MAC9D;AAAA,MACA,WAAW,WAAW,WAAW,CAAC;AAAA,MAClC;AAAA,IACF,CAAC,GAAG;AACF,YAAM,GAAG,KAAK,UAAU,KAAK,CAAC;AAAA,CAAI;AAAA,IACpC;AAAA,EACF,SAAS,KAAK;AACZ,UAAM,YAAY,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG;AACjE,UAAM,GAAG,KAAK,UAAU,EAAE,MAAM,SAAS,UAAU,CAAC,CAAC;AAAA,CAAI;AAAA,EAC3D;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theokit/tauri",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Tauri desktop glue for TheoKit agents — the Channel/invoke transport source (webview) + the JSONL sidecar (node), over the unified client. UI is @theokit/ui; the runtime is @theokit/sdk.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"theokit": "0.30.
|
|
32
|
+
"theokit": "0.30.2"
|
|
33
33
|
},
|
|
34
34
|
"publishConfig": {
|
|
35
35
|
"access": "public"
|