@theokit/tauri 1.0.0-next.2 → 1.1.0
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/CHANGELOG.md +54 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,59 @@
|
|
|
1
1
|
# Changelog — @theokit/tauri
|
|
2
2
|
|
|
3
|
+
## 1.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 966a3d4: `createTauriChannelSource` and `createTauriAgentClient` take an optional `cancelCommand`. When it is set, aborting a desktop turn invokes that Tauri command (the desktop template's `cancel_turn`), so a stop button stops the turn instead of waiting for the next message. A rejected cancel command reaches the turn's `onError`; the abort itself never throws. Without the option the abort does nothing, as before. (B-376)
|
|
8
|
+
|
|
9
|
+
The `create-theokit` desktop template ships a `cancel_turn` command that kills the in-flight sidecar, registers it beside `run_turn` and `approve`, and its webview passes `cancelCommand: 'cancel_turn'`. (B-376) A scaffolded desktop app now depends on `@theokit/tauri` `^1.1.0`, the release that carries `cancelCommand`; it was `^0.1.1`, which never resolved to 1.x.
|
|
10
|
+
|
|
11
|
+
## 1.0.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- ecda4ae: The agent-module parameter names what it accepts, so a wrong shape fails at compile time
|
|
16
|
+
|
|
17
|
+
`streamAgentTurnInProcess` and `compileAgentModule` took `mod: unknown`, so the contract lived only
|
|
18
|
+
in the runtime guard. A consumer whose producer became `async` handed a `Promise` straight through
|
|
19
|
+
and shipped two releases in which no turn could run — with typecheck, 1213 tests, lint and twelve CI
|
|
20
|
+
checks green. The runtime was never wrong: it refused the Promise and threw a typed error. What
|
|
21
|
+
failed was the moment.
|
|
22
|
+
|
|
23
|
+
Both now take `AgentModule`, exported alongside them and re-exported from `theokit/server/agent`.
|
|
24
|
+
The type mirrors the runtime guard rather than the fuller `CompiledAgentOptions` — an array under
|
|
25
|
+
`tools`, an object under `agents` — so it refuses nothing that compiled before.
|
|
26
|
+
|
|
27
|
+
`@theokit/tauri/sidecar`'s `runTurnToJsonl` is narrowed too: a desktop sidecar imports its agent
|
|
28
|
+
module statically, which is exactly where a type catches the mistake.
|
|
29
|
+
|
|
30
|
+
Entry points that receive a module from a path discovered at runtime keep taking `unknown`, and now
|
|
31
|
+
say so by calling the new `compileLoadedAgentModule`. Their `unknown` has a reason; before this, the
|
|
32
|
+
boundary that had one was indistinguishable from the one that did not.
|
|
33
|
+
|
|
34
|
+
Closes usetheokit/theokit#663.
|
|
35
|
+
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- 3162888: **Released because its peer requirement moved, not because this package changed.**
|
|
39
|
+
|
|
40
|
+
Nothing inside `@theokit/tauri` changed in this release. It ships because `theokit` moved and this
|
|
41
|
+
package peers it, so the peer range it declares moved with it — from the 0.64 line to
|
|
42
|
+
`>=0.65.0-next.0`. For a consumer that is a real, breaking difference even though no code here
|
|
43
|
+
differs: a project pinned to `theokit@0.64.x` cannot install this version.
|
|
44
|
+
|
|
45
|
+
The version number says the same thing less clearly. A peer range that excludes versions it used to
|
|
46
|
+
admit is a breaking change to whoever installs it, which is why the bump is a major rather than a
|
|
47
|
+
patch — the code is untouched and the contract is not.
|
|
48
|
+
|
|
49
|
+
**What to do:** upgrade `theokit` to `>=0.65.0` alongside this package, or stay on the previous
|
|
50
|
+
`@theokit/tauri` while you stay on the 0.64 line. Nothing else about the Tauri glue — the
|
|
51
|
+
Channel/invoke transport, the JSONL sidecar — behaves differently.
|
|
52
|
+
|
|
53
|
+
This entry exists because the release would otherwise carry an empty section
|
|
54
|
+
([#653](https://github.com/usetheokit/theokit/issues/653)), and an empty section is
|
|
55
|
+
indistinguishable from "nothing user-visible changed" — a claim nobody made about a major bump.
|
|
56
|
+
|
|
3
57
|
## 1.0.0-next.2
|
|
4
58
|
|
|
5
59
|
### Minor Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -23,6 +23,12 @@ interface TauriChannelSourceOptions {
|
|
|
23
23
|
runCommand?: string;
|
|
24
24
|
/** The Rust `#[tauri::command]` that settles a HITL approval (default `approve`). */
|
|
25
25
|
approveCommand?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The Rust `#[tauri::command]` the abort invokes to stop the in-flight turn (the desktop template's
|
|
28
|
+
* `cancel_turn` kills the sidecar). Unset, the abort does nothing and the shell kills the prior
|
|
29
|
+
* sidecar on the next run.
|
|
30
|
+
*/
|
|
31
|
+
cancelCommand?: string;
|
|
26
32
|
}
|
|
27
33
|
/**
|
|
28
34
|
* Build a {@link ChannelPushSource} bridging a Tauri `run_turn` `Channel` + `approve` `invoke` (ADR-0045 D3).
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
function createTauriChannelSource(core, options = {}) {
|
|
7
7
|
const runCommand = options.runCommand ?? "run_turn";
|
|
8
8
|
const approveCommand = options.approveCommand ?? "approve";
|
|
9
|
+
const { cancelCommand } = options;
|
|
9
10
|
return {
|
|
10
11
|
start(turn, { onLine, onClose, onError }) {
|
|
11
12
|
const channel = new core.Channel();
|
|
@@ -18,7 +19,12 @@ function createTauriChannelSource(core, options = {}) {
|
|
|
18
19
|
void core.invoke(runCommand, { message: turn.message, context: turn.context, onChunk: channel }).then(onClose, (err) => {
|
|
19
20
|
onError?.(err instanceof Error ? err : new Error(String(err)));
|
|
20
21
|
});
|
|
21
|
-
return () => void 0;
|
|
22
|
+
if (cancelCommand === void 0) return () => void 0;
|
|
23
|
+
return () => {
|
|
24
|
+
core.invoke(cancelCommand).catch((err) => {
|
|
25
|
+
onError?.(err instanceof Error ? err : new Error(String(err)));
|
|
26
|
+
});
|
|
27
|
+
};
|
|
22
28
|
},
|
|
23
29
|
settle: async (approvalId, decision) => {
|
|
24
30
|
await core.invoke(approveCommand, { approvalId, approved: decision.approved });
|
|
@@ -26,8 +32,8 @@ function createTauriChannelSource(core, options = {}) {
|
|
|
26
32
|
};
|
|
27
33
|
}
|
|
28
34
|
function createTauriAgentClient(core, options = {}) {
|
|
29
|
-
const { runCommand, approveCommand, ...clientOptions } = options;
|
|
30
|
-
const source = createTauriChannelSource(core, { runCommand, approveCommand });
|
|
35
|
+
const { runCommand, approveCommand, cancelCommand, ...clientOptions } = options;
|
|
36
|
+
const source = createTauriChannelSource(core, { runCommand, approveCommand, cancelCommand });
|
|
31
37
|
return createAgentClient(new ChannelTransport({ source }), clientOptions);
|
|
32
38
|
}
|
|
33
39
|
export {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,OAKK;
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,OAKK;AAyCA,SAAS,yBACd,MACA,UAAqC,CAAC,GACnB;AACnB,QAAM,aAAa,QAAQ,cAAc;AACzC,QAAM,iBAAiB,QAAQ,kBAAkB;AACjD,QAAM,EAAE,cAAc,IAAI;AAE1B,SAAO;AAAA,IACL,MAAM,MAAM,EAAE,QAAQ,SAAS,QAAQ,GAAG;AACxC,YAAM,UAAU,IAAI,KAAK,QAAQ;AACjC,cAAQ,YAAY,CAAC,SAAiB;AAEpC,mBAAW,QAAQ,KAAK,MAAM,IAAI,GAAG;AACnC,gBAAM,UAAU,KAAK,KAAK;AAC1B,cAAI,QAAS,QAAO,OAAO;AAAA,QAC7B;AAAA,MACF;AAGA,WAAK,KACF,OAAO,YAAY,EAAE,SAAS,KAAK,SAAS,SAAS,KAAK,SAAS,SAAS,QAAQ,CAAC,EACrF,KAAK,SAAS,CAAC,QAAiB;AAE/B,kBAAU,eAAe,QAAQ,MAAM,IAAI,MAAM,OAAO,GAAG,CAAC,CAAC;AAAA,MAC/D,CAAC;AAEH,UAAI,kBAAkB,OAAW,QAAO,MAAM;AAE9C,aAAO,MAAM;AACX,aAAK,OAAO,aAAa,EAAE,MAAM,CAAC,QAAiB;AACjD,oBAAU,eAAe,QAAQ,MAAM,IAAI,MAAM,OAAO,GAAG,CAAC,CAAC;AAAA,QAC/D,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA,QAAQ,OAAO,YAAoB,aAA+B;AAChE,YAAM,KAAK,OAAO,gBAAgB,EAAE,YAAY,UAAU,SAAS,SAAS,CAAC;AAAA,IAC/E;AAAA,EACF;AACF;AAQO,SAAS,uBACd,MACA,UAAgE,CAAC,GACtC;AAC3B,QAAM,EAAE,YAAY,gBAAgB,eAAe,GAAG,cAAc,IAAI;AACxE,QAAM,SAAS,yBAAyB,MAAM,EAAE,YAAY,gBAAgB,cAAc,CAAC;AAC3F,SAAO,kBAA0B,IAAI,iBAAiB,EAAE,OAAO,CAAC,GAAG,aAAa;AAClF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theokit/tauri",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
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
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@theokit/presenter": "0.
|
|
43
|
-
"theokit": "0.
|
|
42
|
+
"@theokit/presenter": "0.11.0",
|
|
43
|
+
"theokit": "0.80.0"
|
|
44
44
|
},
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"provenance": true,
|