@capybara-hq/kernel 0.1.0-rc.64 → 0.1.0-rc.65

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.
@@ -518,8 +518,9 @@ export declare const HANDOFF_URL_MAX_CHARS = 2000;
518
518
  * `guard`: `Edit` / `Write` refused by the read-before-write check (`not_read`: the file was never
519
519
  * read in the conversation, `modified`: it changed since). The result stays `isError: true` for
520
520
  * the model; the web shows the refusal as a neutral outcome, not a failure.
521
- * `not_loaded`: a call to a tool the catalog holds but the step's request did not carry
522
- * (ToolSearch mode, spec 5.5): expected behaviour, the model is told to load it first. The result
521
+ * `not_loaded`: a call to a tool the catalog holds but the step's request did not carry, or to a
522
+ * name no tool has (ToolSearch mode, spec 5.5): expected behaviour, the model is told to load it
523
+ * (or search for it) first. The result
523
524
  * stays `isError: true` for the model; the web shows it as a neutral outcome too.
524
525
  * `handoff`: a `Platform` operation whose decision stays with a person on a web page (platform web
525
526
  * parity spec §4.4, §6): the card's title and either a relative web path (`link`, also in the
@@ -535,8 +535,9 @@ const HANDOFF_PATH = /^\/(?![/\\])[^\\\s]*$/;
535
535
  * `guard`: `Edit` / `Write` refused by the read-before-write check (`not_read`: the file was never
536
536
  * read in the conversation, `modified`: it changed since). The result stays `isError: true` for
537
537
  * the model; the web shows the refusal as a neutral outcome, not a failure.
538
- * `not_loaded`: a call to a tool the catalog holds but the step's request did not carry
539
- * (ToolSearch mode, spec 5.5): expected behaviour, the model is told to load it first. The result
538
+ * `not_loaded`: a call to a tool the catalog holds but the step's request did not carry, or to a
539
+ * name no tool has (ToolSearch mode, spec 5.5): expected behaviour, the model is told to load it
540
+ * (or search for it) first. The result
540
541
  * stays `isError: true` for the model; the web shows it as a neutral outcome too.
541
542
  * `handoff`: a `Platform` operation whose decision stays with a person on a web page (platform web
542
543
  * parity spec §4.4, §6): the card's title and either a relative web path (`link`, also in the
@@ -30,7 +30,7 @@ export type PermissionAvailability = {
30
30
  } | {
31
31
  state: "unsupported";
32
32
  reason: string;
33
- cause?: PermissionAvailabilityCause;
33
+ cause: PermissionAvailabilityCause;
34
34
  } | {
35
35
  state: "unprobed";
36
36
  reason: string;
@@ -623,6 +623,7 @@ let PermissionFacts = class PermissionFacts {
623
623
  availability: preview?.availability ?? {
624
624
  state: "unsupported",
625
625
  reason: unavailableReason,
626
+ cause: { kind: "runtime" },
626
627
  },
627
628
  outsideSandboxCeiling: preview?.outsideSandboxCeiling ?? false,
628
629
  broadProjectReach: preview?.broadProjectReach ?? false,
@@ -198,6 +198,7 @@ export async function readCurrentReport(db, deviceId, provider, version) {
198
198
  availability: {
199
199
  state: "unsupported",
200
200
  reason: report.unavailableReason ?? "This runtime cannot enforce permission operations",
201
+ cause: { kind: "runtime" },
201
202
  },
202
203
  identityHash: row.identity_hash,
203
204
  instanceGeneration: row.instance_generation,
@@ -744,7 +744,9 @@ let ToolPipeline = class ToolPipeline {
744
744
  keys = keys.filter((k) => isAlwaysLoaded(k) || sent.has(k));
745
745
  }
746
746
  keys.sort();
747
- return fail(unknownToolText(call.name, keys, keys.includes(TOOL_SEARCH)));
747
+ // In ToolSearch mode a name the model has not loaded (a catalog tool, or one it misspelled) is
748
+ // the protocol asking it to search, not a failure: the row reads neutral like `not_loaded`.
749
+ return fail(unknownToolText(call.name, keys, keys.includes(TOOL_SEARCH)), call.name, resolved.toolSearch === true ? { kind: "not_loaded" } : undefined);
748
750
  }
749
751
  const outKey = tool.key;
750
752
  // ToolSearch 模式下,模型只能调用请求里带了完整定义的工具:目录里有、但发出本次调用的请求没加载 →
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capybara-hq/kernel",
3
- "version": "0.1.0-rc.64",
3
+ "version": "0.1.0-rc.65",
4
4
  "description": "Capybara kernel: config, database, plugin host and HTTP API of the Capybara agent platform",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -75,8 +75,8 @@
75
75
  "@types/ws": "^8.18.2",
76
76
  "@types/yauzl": "3.4.0",
77
77
  "ws": "^8.22.0",
78
- "@capybara-hq/device": "0.1.0-rc.26",
79
- "@capybara-hq/testing": "0.1.0-rc.31"
78
+ "@capybara-hq/testing": "0.1.0-rc.31",
79
+ "@capybara-hq/device": "0.1.0-rc.26"
80
80
  },
81
81
  "scripts": {
82
82
  "build": "tsc -b"