@intentic/sandbox-contract 1.390.0 → 1.392.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/README.md +6 -1
- package/dist/contracts/agents.contract.d.ts +69 -0
- package/dist/contracts/agents.contract.d.ts.map +1 -1
- package/dist/contracts/agents.contract.js +10 -0
- package/dist/contracts/agents.contract.js.map +1 -1
- package/dist/contracts/ci.contract.d.ts +18 -0
- package/dist/contracts/ci.contract.d.ts.map +1 -1
- package/dist/contracts/ci.contract.js +19 -1
- package/dist/contracts/ci.contract.js.map +1 -1
- package/dist/contracts/device.contract.d.ts +10 -0
- package/dist/contracts/device.contract.d.ts.map +1 -1
- package/dist/contracts/ports.contract.d.ts +5 -0
- package/dist/contracts/ports.contract.d.ts.map +1 -1
- package/dist/contracts/ports.contract.js +1 -1
- package/dist/contracts/ports.contract.js.map +1 -1
- package/dist/contracts/runner.contract.d.ts +12 -4
- package/dist/contracts/runner.contract.d.ts.map +1 -1
- package/dist/contracts/runs.contract.d.ts +16 -0
- package/dist/contracts/runs.contract.d.ts.map +1 -1
- package/dist/contracts/settings.contract.d.ts +16 -0
- package/dist/contracts/settings.contract.d.ts.map +1 -1
- package/dist/contracts/system.contract.d.ts +66 -0
- package/dist/contracts/system.contract.d.ts.map +1 -1
- package/dist/contracts/system.contract.js +10 -1
- package/dist/contracts/system.contract.js.map +1 -1
- package/dist/events/agent-events.d.ts +4 -0
- package/dist/events/agent-events.d.ts.map +1 -1
- package/dist/events/agent-events.js +1 -0
- package/dist/events/agent-events.js.map +1 -1
- package/dist/events/agent-transcript.d.ts +1 -0
- package/dist/events/agent-transcript.d.ts.map +1 -1
- package/dist/events/failure-rows.js +1 -1
- package/dist/events/failure-rows.js.map +1 -1
- package/dist/events/land-conflict.d.ts +1 -0
- package/dist/events/land-conflict.d.ts.map +1 -1
- package/dist/events/land-conflict.js +4 -3
- package/dist/events/land-conflict.js.map +1 -1
- package/dist/events/requests.d.ts +1 -0
- package/dist/events/requests.d.ts.map +1 -1
- package/dist/events/requests.js +1 -1
- package/dist/events/requests.js.map +1 -1
- package/dist/events/resume.d.ts +2 -0
- package/dist/events/resume.d.ts.map +1 -1
- package/dist/events/resume.js +2 -0
- package/dist/events/resume.js.map +1 -1
- package/dist/events/sandbox-notice.d.ts +1 -0
- package/dist/events/sandbox-notice.d.ts.map +1 -1
- package/dist/events/sandbox-notice.js +1 -0
- package/dist/events/sandbox-notice.js.map +1 -1
- package/dist/events/system-events.d.ts +12 -0
- package/dist/events/system-events.d.ts.map +1 -1
- package/dist/events/transcript.d.ts +1 -0
- package/dist/events/transcript.d.ts.map +1 -1
- package/dist/events/transcript.js +4 -0
- package/dist/events/transcript.js.map +1 -1
- package/dist/index.d.ts +190 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/models/agent-standing.d.ts +2 -0
- package/dist/models/agent-standing.d.ts.map +1 -1
- package/dist/models/agent-standing.js.map +1 -1
- package/dist/models/model-setups.d.ts.map +1 -1
- package/dist/models/model-setups.js +2 -1
- package/dist/models/model-setups.js.map +1 -1
- package/dist/policy/failure-codes.d.ts +158 -0
- package/dist/policy/failure-codes.d.ts.map +1 -0
- package/dist/policy/failure-codes.js +50 -0
- package/dist/policy/failure-codes.js.map +1 -0
- package/dist/protocol/raw/raw-routes.d.ts +12 -0
- package/dist/protocol/raw/raw-routes.d.ts.map +1 -1
- package/dist/protocol/raw/raw-routes.js +3 -0
- package/dist/protocol/raw/raw-routes.js.map +1 -1
- package/dist/schemas/agent-press.d.ts +13 -0
- package/dist/schemas/agent-press.d.ts.map +1 -0
- package/dist/schemas/agent-press.js +14 -0
- package/dist/schemas/agent-press.js.map +1 -0
- package/dist/schemas/agents-list.d.ts +6 -0
- package/dist/schemas/agents-list.d.ts.map +1 -1
- package/dist/schemas/agents.d.ts +11 -0
- package/dist/schemas/agents.d.ts.map +1 -1
- package/dist/schemas/agents.js +5 -6
- package/dist/schemas/agents.js.map +1 -1
- package/dist/schemas/ci.d.ts +21 -0
- package/dist/schemas/ci.d.ts.map +1 -1
- package/dist/schemas/ci.js +29 -0
- package/dist/schemas/ci.js.map +1 -1
- package/dist/schemas/device-resources.d.ts +54 -0
- package/dist/schemas/device-resources.d.ts.map +1 -0
- package/dist/schemas/device-resources.js +29 -0
- package/dist/schemas/device-resources.js.map +1 -0
- package/dist/schemas/devices.d.ts +2 -52
- package/dist/schemas/devices.d.ts.map +1 -1
- package/dist/schemas/devices.js +2 -27
- package/dist/schemas/devices.js.map +1 -1
- package/dist/schemas/git/clone.d.ts +12 -0
- package/dist/schemas/git/clone.d.ts.map +1 -0
- package/dist/schemas/git/clone.js +14 -0
- package/dist/schemas/git/clone.js.map +1 -0
- package/dist/schemas/hosts.d.ts +23 -0
- package/dist/schemas/hosts.d.ts.map +1 -1
- package/dist/schemas/hosts.js +14 -1
- package/dist/schemas/hosts.js.map +1 -1
- package/dist/schemas/metrics.d.ts +59 -0
- package/dist/schemas/metrics.d.ts.map +1 -1
- package/dist/schemas/metrics.js +19 -0
- package/dist/schemas/metrics.js.map +1 -1
- package/dist/schemas/ports.d.ts +10 -0
- package/dist/schemas/ports.d.ts.map +1 -1
- package/dist/schemas/ports.js +8 -0
- package/dist/schemas/ports.js.map +1 -1
- package/dist/schemas/providers/handoff.d.ts +1 -0
- package/dist/schemas/providers/handoff.d.ts.map +1 -1
- package/dist/schemas/providers/handoff.js +4 -1
- package/dist/schemas/providers/handoff.js.map +1 -1
- package/dist/schemas/providers/plan-limits.js +1 -1
- package/dist/schemas/providers/plan-limits.js.map +1 -1
- package/dist/schemas/run-targets.d.ts +31 -0
- package/dist/schemas/run-targets.d.ts.map +1 -1
- package/dist/schemas/run-targets.js +9 -0
- package/dist/schemas/run-targets.js.map +1 -1
- package/dist/schemas/settings.d.ts +29 -0
- package/dist/schemas/settings.d.ts.map +1 -1
- package/dist/schemas/settings.js +17 -0
- package/dist/schemas/settings.js.map +1 -1
- package/dist/schemas/stranded-clone.d.ts +9 -0
- package/dist/schemas/stranded-clone.d.ts.map +1 -0
- package/dist/schemas/stranded-clone.js +12 -0
- package/dist/schemas/stranded-clone.js.map +1 -0
- package/dist/state/definition.d.ts +20 -0
- package/dist/state/definition.d.ts.map +1 -1
- package/dist/state/fix-stance.js +1 -1
- package/dist/state/fix-stance.js.map +1 -1
- package/dist/state/runtime-state.d.ts +3 -0
- package/dist/state/runtime-state.d.ts.map +1 -1
- package/dist/state/runtime-state.js +1 -0
- package/dist/state/runtime-state.js.map +1 -1
- package/dist/state/workspace-state.d.ts.map +1 -1
- package/dist/state/workspace-state.js +1 -1
- package/dist/state/workspace-state.js.map +1 -1
- package/dist/text/transcript-fold.d.ts.map +1 -1
- package/dist/text/transcript-fold.js +6 -6
- package/dist/text/transcript-fold.js.map +1 -1
- package/dist/text/transcript-interruption.d.ts +4 -0
- package/dist/text/transcript-interruption.d.ts.map +1 -0
- package/dist/text/transcript-interruption.js +27 -0
- package/dist/text/transcript-interruption.js.map +1 -0
- package/package.json +5 -5
- package/src/contracts/agents.contract.ts +12 -0
- package/src/contracts/ci.contract.ts +21 -0
- package/src/contracts/ports.contract.ts +3 -2
- package/src/contracts/system.contract.ts +12 -1
- package/src/events/agent-events.ts +2 -0
- package/src/events/failure-rows.ts +1 -1
- package/src/events/land-conflict.test.ts +13 -1
- package/src/events/land-conflict.ts +8 -4
- package/src/events/requests.ts +1 -1
- package/src/events/resume.test.ts +7 -1
- package/src/events/resume.ts +3 -0
- package/src/events/sandbox-notice.ts +1 -0
- package/src/events/transcript.ts +6 -0
- package/src/models/agent-standing.ts +4 -0
- package/src/models/model-setups.test.ts +11 -0
- package/src/models/model-setups.ts +4 -1
- package/src/policy/failure-codes.ts +157 -0
- package/src/policy/tests/failure-codes.test.ts +141 -0
- package/src/protocol/raw/raw-routes.ts +5 -0
- package/src/schemas/agent-press.test.ts +46 -0
- package/src/schemas/agent-press.ts +34 -0
- package/src/schemas/agents.ts +8 -8
- package/src/schemas/ci.ts +45 -0
- package/src/schemas/device-resources.ts +58 -0
- package/src/schemas/devices.ts +20 -56
- package/src/schemas/git/clone.ts +22 -0
- package/src/schemas/hosts.ts +34 -3
- package/src/schemas/metrics.ts +28 -0
- package/src/schemas/ports.ts +12 -0
- package/src/schemas/providers/handoff.test.ts +7 -0
- package/src/schemas/providers/handoff.ts +4 -1
- package/src/schemas/providers/plan-limits.ts +1 -1
- package/src/schemas/run-targets.ts +23 -1
- package/src/schemas/settings.ts +32 -0
- package/src/schemas/stranded-clone.ts +15 -0
- package/src/state/fix-stance.ts +1 -1
- package/src/state/runtime-state.ts +4 -0
- package/src/state/workspace-state.ts +3 -2
- package/src/text/transcript-fold.test.ts +21 -7
- package/src/text/transcript-fold.ts +5 -6
- package/src/text/transcript-interruption.ts +30 -0
- package/dist/policy/turned-away.d.ts +0 -3
- package/dist/policy/turned-away.d.ts.map +0 -1
- package/dist/policy/turned-away.js +0 -33
- package/dist/policy/turned-away.js.map +0 -1
- package/src/policy/turned-away.ts +0 -52
|
@@ -32,7 +32,7 @@ describe("foldTurn", () => {
|
|
|
32
32
|
];
|
|
33
33
|
expect(foldOf("look", events).slice(1)).toEqual([
|
|
34
34
|
{ role: "assistant", text: "I'll look" },
|
|
35
|
-
{ role: "assistant", text: "found it", tools: [{ id: "t1", name: "Read", category: "read", status: "
|
|
35
|
+
{ role: "assistant", text: "found it", tools: [{ id: "t1", name: "Read", category: "read", status: "interrupted" }] },
|
|
36
36
|
{ role: "assistant", text: "and here's why" },
|
|
37
37
|
]);
|
|
38
38
|
});
|
|
@@ -100,9 +100,9 @@ describe("foldTurn", () => {
|
|
|
100
100
|
expect(Object.keys(bash ?? {})).not.toContain("input");
|
|
101
101
|
});
|
|
102
102
|
|
|
103
|
-
it("
|
|
103
|
+
it("marks an unanswered call interrupted when the turn ends", () => {
|
|
104
104
|
const events: AgentEvent[] = [{ kind: "tool_call", id: "t1", name: "Bash", category: "execute", status: "in_progress" }];
|
|
105
|
-
expect(foldOf("run", events).at(-1)?.tools?.[0]?.status).toBe("
|
|
105
|
+
expect(foldOf("run", events).at(-1)?.tools?.[0]?.status).toBe("interrupted");
|
|
106
106
|
});
|
|
107
107
|
|
|
108
108
|
it("nests a subagent's calls, thinking and live state under the card that spawned them", () => {
|
|
@@ -121,7 +121,7 @@ describe("foldTurn", () => {
|
|
|
121
121
|
id: "task-1",
|
|
122
122
|
name: "Agent",
|
|
123
123
|
category: "other",
|
|
124
|
-
status: "
|
|
124
|
+
status: "interrupted",
|
|
125
125
|
thinking: "hmm",
|
|
126
126
|
children: [{ id: "t2", name: "Read", category: "read", status: "completed" }],
|
|
127
127
|
subagent: { kind: "subagent", agentType: "Explore", background: true, status: "completed", toolUses: 1 },
|
|
@@ -294,7 +294,7 @@ describe("foldTurn", () => {
|
|
|
294
294
|
{ content: "step 2", status: "in_progress", activeForm: "Running step 2" },
|
|
295
295
|
{ content: "step 3", status: "pending" },
|
|
296
296
|
],
|
|
297
|
-
tools: [{ id: "t1", name: "Bash", category: "execute", status: "
|
|
297
|
+
tools: [{ id: "t1", name: "Bash", category: "execute", status: "interrupted" }],
|
|
298
298
|
},
|
|
299
299
|
]);
|
|
300
300
|
});
|
|
@@ -863,6 +863,7 @@ describe("patches", () => {
|
|
|
863
863
|
"replace",
|
|
864
864
|
"replace",
|
|
865
865
|
"replace",
|
|
866
|
+
"replace",
|
|
866
867
|
]);
|
|
867
868
|
});
|
|
868
869
|
|
|
@@ -892,9 +893,9 @@ describe("patches", () => {
|
|
|
892
893
|
{ op: "toolThinking", index: 1, id: "task-1", text: "in" },
|
|
893
894
|
{ op: "toolThinking", index: 1, id: "task-1", text: "ner" },
|
|
894
895
|
]);
|
|
895
|
-
const update = patches.
|
|
896
|
+
const update = patches.findLast((patch) => patch.op === "tool");
|
|
896
897
|
expect(update?.op === "tool" ? update.tool : undefined).toEqual({ id: "task-1", name: "Agent", category: "other", status: "completed" });
|
|
897
|
-
expect(applied[1]?.tools?.[0]).toMatchObject({ status: "completed", thinking: "inner", children: [{ id: "t2" }] });
|
|
898
|
+
expect(applied[1]?.tools?.[0]).toMatchObject({ status: "completed", thinking: "inner", children: [{ id: "t2", status: "interrupted" }] });
|
|
898
899
|
});
|
|
899
900
|
|
|
900
901
|
// The other half of the wake's delivery: a live turn takes it as a steer. It is the daemon's own words either way,
|
|
@@ -1453,3 +1454,16 @@ describe("transcriptIncidents", () => {
|
|
|
1453
1454
|
expect(sandboxNoticeOf(accountMovedRow({ why: "cold", from: "Work", to: "Home" }))).toEqual({ code: "accountMoved", params: { why: "cold", from: "Work", to: "Home" } });
|
|
1454
1455
|
});
|
|
1455
1456
|
});
|
|
1457
|
+
|
|
1458
|
+
|
|
1459
|
+
test.each(["settled", "stopped"] as const)("%s interrupts open top-level and nested calls and leaves completed calls intact", (ending) => {
|
|
1460
|
+
const fold = new TranscriptFold([], () => 123);
|
|
1461
|
+
fold.apply({ kind: "tool_call", id: "parent", name: "Agent", category: "execute", status: "in_progress" });
|
|
1462
|
+
fold.apply({ kind: "tool_call", id: "nested", name: "Bash", category: "execute", status: "pending", parentToolUseId: "parent" });
|
|
1463
|
+
fold.apply({ kind: "tool_call", id: "done", name: "Read", category: "read", status: "completed" });
|
|
1464
|
+
fold.finish(ending);
|
|
1465
|
+
expect(fold.rows[0]?.tools).toMatchObject([
|
|
1466
|
+
{ id: "parent", status: "interrupted", endedAt: 123, children: [{ id: "nested", status: "interrupted", endedAt: 123 }] },
|
|
1467
|
+
{ id: "done", status: "completed" },
|
|
1468
|
+
]);
|
|
1469
|
+
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { interruptAssistant } from "./transcript-interruption.js";
|
|
2
|
+
import { settledRequests } from "../policy/request-status.js";
|
|
2
3
|
import type { AgentEvent } from "../events/agent-events.js";
|
|
3
4
|
import { drawInline, type InlineEvent, supersedeEarlier } from "./transcript-inline.js";
|
|
4
5
|
import {
|
|
5
6
|
REQUEST_FIELDS,
|
|
6
7
|
holdsRequest,
|
|
7
|
-
isAwaitingDecision,
|
|
8
8
|
type TranscriptRequests,
|
|
9
9
|
type TranscriptPatch,
|
|
10
10
|
type TranscriptRow,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
import { keptWarmLine, keptWarmNotice } from "../schemas/keep-warm.js";
|
|
15
15
|
import { isStartingFrame, startingRow } from "./notice-rows.js";
|
|
16
16
|
import { isLandConflict } from "../events/land-conflict.js";
|
|
17
|
-
import { turnedAwayCode } from "../policy/
|
|
17
|
+
import { turnedAwayCode } from "../policy/failure-codes.js";
|
|
18
18
|
import { errorRow, RENEWAL_WITHDRAWN, RENEWING } from "../events/failure-rows.js";
|
|
19
19
|
import { mentionedPathTokens } from "./mentions.js";
|
|
20
20
|
import { unspokenPromptRow } from "../events/agent-words.js";
|
|
@@ -60,7 +60,7 @@ const resultWords = (tool: TranscriptTool): string =>
|
|
|
60
60
|
.join("\n");
|
|
61
61
|
|
|
62
62
|
// Whether a call's status is final: the moment it turns so is when its result arrived.
|
|
63
|
-
const ended = (status: TranscriptTool["status"]): boolean => status === "completed" || status === "failed";
|
|
63
|
+
const ended = (status: TranscriptTool["status"]): boolean => status === "completed" || status === "failed" || status === "interrupted";
|
|
64
64
|
|
|
65
65
|
// `at` is the fold's clock reading as the call is seen, absent for a fold without one; a call that arrives already
|
|
66
66
|
// finished started and ended in that same moment, as far as anyone here can tell.
|
|
@@ -493,8 +493,7 @@ export class TranscriptFold {
|
|
|
493
493
|
finish(ending: TurnEnding): TranscriptPatch[] {
|
|
494
494
|
const patches = this.closeBubble();
|
|
495
495
|
for (const [index, row] of this.rows.entries()) {
|
|
496
|
-
if (row.
|
|
497
|
-
Object.assign(row, cancelledRequests(row));
|
|
496
|
+
if (interruptAssistant(row, this.now?.())) {
|
|
498
497
|
patches.push(this.replace(index));
|
|
499
498
|
}
|
|
500
499
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { cancelledRequests } from "../policy/request-status.js";
|
|
2
|
+
import { isAwaitingDecision, type TranscriptRow, type TranscriptTool } from "../events/transcript.js";
|
|
3
|
+
|
|
4
|
+
// A turn cannot leave a call running, including a helper's nested calls.
|
|
5
|
+
export const interruptTools = (tools: readonly TranscriptTool[], at: number | undefined): boolean => {
|
|
6
|
+
let changed = false;
|
|
7
|
+
for (const tool of tools) {
|
|
8
|
+
if (tool.status === "pending" || tool.status === "in_progress") {
|
|
9
|
+
tool.status = "interrupted";
|
|
10
|
+
if (at !== undefined) {
|
|
11
|
+
tool.endedAt = at;
|
|
12
|
+
}
|
|
13
|
+
changed = true;
|
|
14
|
+
}
|
|
15
|
+
changed = interruptTools(tool.children ?? [], at) || changed;
|
|
16
|
+
}
|
|
17
|
+
return changed;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** Freeze decisions whose waiter ended, and calls whose result will no longer arrive. */
|
|
21
|
+
export const interruptAssistant = (row: TranscriptRow, at: number | undefined): boolean => {
|
|
22
|
+
if (row.role !== "assistant") {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
const awaiting = isAwaitingDecision(row);
|
|
26
|
+
if (awaiting) {
|
|
27
|
+
Object.assign(row, cancelledRequests(row));
|
|
28
|
+
}
|
|
29
|
+
return interruptTools(row.tools ?? [], at) || awaiting;
|
|
30
|
+
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"turned-away.d.ts","sourceRoot":"","sources":["../../src/policy/turned-away.ts"],"names":[],"mappings":"AAgDA,eAAO,MAAM,kBAAkB,SAAU,MAAM,GAAG,SAAS,KAAG,OAA+D,CAAC;AAG9H,eAAO,MAAM,cAAc,SAAU,MAAM,GAAG,SAAS,KAAG,OAAsD,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
const TURNED_AWAY = new Set([
|
|
2
|
-
"claude-reauth",
|
|
3
|
-
"claude-not-entitled",
|
|
4
|
-
"account-not-allowed",
|
|
5
|
-
"unknown-command",
|
|
6
|
-
"context-window-too-small",
|
|
7
|
-
"model-helper-only",
|
|
8
|
-
"privacy-unshielded",
|
|
9
|
-
"tools-unenforced",
|
|
10
|
-
"agent-domain-refused",
|
|
11
|
-
"privacy-instructions",
|
|
12
|
-
"sandbox-memory-low",
|
|
13
|
-
"workspace-setup",
|
|
14
|
-
"sandbox-disk-low",
|
|
15
|
-
"trial-unavailable",
|
|
16
|
-
"trial-model-unavailable",
|
|
17
|
-
"trial-exhausted",
|
|
18
|
-
"model-unavailable",
|
|
19
|
-
"engine-version-floor",
|
|
20
|
-
]);
|
|
21
|
-
const ANOTHER_MODEL_CLEARS = new Set([
|
|
22
|
-
"claude-not-entitled",
|
|
23
|
-
"account-not-allowed",
|
|
24
|
-
"context-window-too-small",
|
|
25
|
-
"model-helper-only",
|
|
26
|
-
"trial-unavailable",
|
|
27
|
-
"trial-model-unavailable",
|
|
28
|
-
"trial-exhausted",
|
|
29
|
-
"model-unavailable",
|
|
30
|
-
]);
|
|
31
|
-
export const anotherModelClears = (code) => code !== undefined && ANOTHER_MODEL_CLEARS.has(code);
|
|
32
|
-
export const turnedAwayCode = (code) => code !== undefined && TURNED_AWAY.has(code);
|
|
33
|
-
//# sourceMappingURL=turned-away.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"turned-away.js","sourceRoot":"","sources":["../../src/policy/turned-away.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,GAAwB,IAAI,GAAG,CAAC;IAC7C,eAAe;IAGf,qBAAqB;IAErB,qBAAqB;IACrB,iBAAiB;IACjB,0BAA0B;IAC1B,mBAAmB;IAEnB,oBAAoB;IAEpB,kBAAkB;IAElB,sBAAsB;IAEtB,sBAAsB;IACtB,oBAAoB;IAEpB,iBAAiB;IACjB,kBAAkB;IAClB,mBAAmB;IACnB,yBAAyB;IACzB,iBAAiB;IACjB,mBAAmB;IACnB,sBAAsB;CACzB,CAAC,CAAC;AAIH,MAAM,oBAAoB,GAAwB,IAAI,GAAG,CAAC;IACtD,qBAAqB;IACrB,qBAAqB;IACrB,0BAA0B;IAC1B,mBAAmB;IACnB,mBAAmB;IACnB,yBAAyB;IACzB,iBAAiB;IACjB,mBAAmB;CACtB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAwB,EAAW,EAAE,CAAC,IAAI,KAAK,SAAS,IAAI,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAG9H,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAAwB,EAAW,EAAE,CAAC,IAAI,KAAK,SAAS,IAAI,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/* THE REFUSALS THAT TURN A WHOLE TURN AWAY AT THE DOOR: refused before the model saw a word, so nothing ran and the
|
|
2
|
-
message is still owed to somebody — the conversation's queue, held, for words a person sent, or the sandbox that
|
|
3
|
-
started the turn itself. */
|
|
4
|
-
|
|
5
|
-
// A set rather than a run of case labels: what they share is a fact about the turn, not a shape.
|
|
6
|
-
const TURNED_AWAY: ReadonlySet<string> = new Set([
|
|
7
|
-
"claude-reauth",
|
|
8
|
-
// An organisation turned the account's Claude Code access off, or no account of the provider can serve: the next
|
|
9
|
-
// turn is routed off it (the daemon's blocked-account route), so the words wait for it rather than being spent.
|
|
10
|
-
"claude-not-entitled",
|
|
11
|
-
// The people this conversation works for may not spend the account the turn would run on.
|
|
12
|
-
"account-not-allowed",
|
|
13
|
-
"unknown-command",
|
|
14
|
-
"context-window-too-small",
|
|
15
|
-
"model-helper-only",
|
|
16
|
-
// The privacy shield refused an untrusted provider on a runtime it cannot read by content at all.
|
|
17
|
-
"privacy-unshielded",
|
|
18
|
-
// The turn carries a tool list its runtime cannot keep.
|
|
19
|
-
"tools-unenforced",
|
|
20
|
-
// The protected execution boundary refused admission, not an executed provider/runtime failure.
|
|
21
|
-
"agent-domain-refused",
|
|
22
|
-
// The privacy shield found personal data in instructions a runtime loads itself, where it could not mask them.
|
|
23
|
-
"privacy-instructions",
|
|
24
|
-
"sandbox-memory-low",
|
|
25
|
-
// The conversation's own view of the workspace could not be set up in time: nothing was started in it.
|
|
26
|
-
"workspace-setup",
|
|
27
|
-
"sandbox-disk-low",
|
|
28
|
-
"trial-unavailable",
|
|
29
|
-
"trial-model-unavailable",
|
|
30
|
-
"trial-exhausted",
|
|
31
|
-
"model-unavailable",
|
|
32
|
-
"engine-version-floor",
|
|
33
|
-
]);
|
|
34
|
-
|
|
35
|
-
// The refusals about the model itself (its allowance, its account, its catalogue, its window), which another model
|
|
36
|
-
// gets past: a turn one of these stops partway offers to carry on elsewhere rather than to wait.
|
|
37
|
-
const ANOTHER_MODEL_CLEARS: ReadonlySet<string> = new Set([
|
|
38
|
-
"claude-not-entitled",
|
|
39
|
-
"account-not-allowed",
|
|
40
|
-
"context-window-too-small",
|
|
41
|
-
"model-helper-only",
|
|
42
|
-
"trial-unavailable",
|
|
43
|
-
"trial-model-unavailable",
|
|
44
|
-
"trial-exhausted",
|
|
45
|
-
"model-unavailable",
|
|
46
|
-
]);
|
|
47
|
-
|
|
48
|
-
/** Whether another model would get past a refusal: the trial's, the model's, or the account's on it. */
|
|
49
|
-
export const anotherModelClears = (code: string | undefined): boolean => code !== undefined && ANOTHER_MODEL_CLEARS.has(code);
|
|
50
|
-
|
|
51
|
-
/** Whether a failure code refuses a turn before the model sees any of it. */
|
|
52
|
-
export const turnedAwayCode = (code: string | undefined): boolean => code !== undefined && TURNED_AWAY.has(code);
|