@tangle-network/agent-app 0.60.226 → 0.60.228
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 -0
- package/dist/chat-routes/index.js +6 -6
- package/dist/chat-routes/turn-routes.d.ts +2 -0
- package/dist/{chunk-EKV6T4YU.js → chunk-7QZNHBQT.js} +8 -1
- package/dist/chunk-7QZNHBQT.js.map +1 -0
- package/dist/{chunk-ILAQQYVL.js → chunk-BKVDPMFD.js} +2 -2
- package/dist/{chunk-YS2RYZQG.js → chunk-JILHXHJE.js} +789 -745
- package/dist/chunk-JILHXHJE.js.map +1 -0
- package/dist/{chunk-2TJWEFFM.js → chunk-LHGYK5I3.js} +4 -2
- package/dist/chunk-LHGYK5I3.js.map +1 -0
- package/dist/{chunk-EGIVLTLQ.js → chunk-PTB2B2OO.js} +21 -3
- package/dist/chunk-PTB2B2OO.js.map +1 -0
- package/dist/{chunk-XAD4VTP4.js → chunk-TEIKC276.js} +2 -2
- package/dist/{chunk-6XF3T6YD.js → chunk-TVPH5T4F.js} +26 -14
- package/dist/chunk-TVPH5T4F.js.map +1 -0
- package/dist/public-consultation/index.js +3 -3
- package/dist/rollout/d1.d.ts +9 -3
- package/dist/rollout/d1.js +11 -4
- package/dist/rollout/d1.js.map +1 -1
- package/dist/runtime/index.js +3 -3
- package/dist/runtime/router-turn.js +2 -2
- package/dist/sandbox/access.d.ts +46 -0
- package/dist/sandbox/app-tools.d.ts +129 -0
- package/dist/sandbox/box-health.d.ts +8 -0
- package/dist/sandbox/configuration.d.ts +280 -0
- package/dist/sandbox/credentials.d.ts +55 -0
- package/dist/sandbox/exec-failure.d.ts +9 -0
- package/dist/sandbox/existing-box.d.ts +43 -0
- package/dist/sandbox/index.d.ts +32 -950
- package/dist/sandbox/index.js +1 -1
- package/dist/sandbox/lifecycle-errors.d.ts +51 -0
- package/dist/sandbox/payload-limits.d.ts +55 -0
- package/dist/sandbox/product-egress.d.ts +4 -0
- package/dist/sandbox/profile-corpus.d.ts +16 -0
- package/dist/sandbox/profile-files.d.ts +16 -0
- package/dist/sandbox/prompt-dispatch.d.ts +14 -0
- package/dist/sandbox/prompt-events.d.ts +71 -0
- package/dist/sandbox/prompt-options.d.ts +79 -0
- package/dist/sandbox/prompt-profile.d.ts +61 -0
- package/dist/sandbox/prompt-result.d.ts +57 -0
- package/dist/sandbox/runtime-cache.d.ts +43 -0
- package/dist/sandbox/runtime-connection.d.ts +9 -0
- package/dist/sandbox/shell-path.d.ts +2 -0
- package/dist/sandbox/workspace-boxes.d.ts +76 -0
- package/dist/sandbox/workspace-claim.d.ts +13 -0
- package/dist/sandbox/workspace-provision.d.ts +9 -0
- package/dist/signoff/app-defaults.d.ts +4 -3
- package/dist/signoff/cli.js +1 -1
- package/dist/signoff/index.js +1 -1
- package/dist/turn-trace/index.js +2 -2
- package/dist/turn-trace/recorder.d.ts +4 -0
- package/package.json +1 -1
- package/dist/chunk-2TJWEFFM.js.map +0 -1
- package/dist/chunk-6XF3T6YD.js.map +0 -1
- package/dist/chunk-EGIVLTLQ.js.map +0 -1
- package/dist/chunk-EKV6T4YU.js.map +0 -1
- package/dist/chunk-YS2RYZQG.js.map +0 -1
- /package/dist/{chunk-ILAQQYVL.js.map → chunk-BKVDPMFD.js.map} +0 -0
- /package/dist/{chunk-XAD4VTP4.js.map → chunk-TEIKC276.js.map} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createChatTurnRoutes,
|
|
3
3
|
streamChatRouteAsSandboxEvents
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-PTB2B2OO.js";
|
|
5
|
+
import "../chunk-LHGYK5I3.js";
|
|
6
6
|
import "../chunk-TCGZFSN5.js";
|
|
7
7
|
import "../chunk-FENBDSIW.js";
|
|
8
8
|
import "../chunk-RN4WPTBH.js";
|
|
@@ -19,7 +19,7 @@ import "../chunk-ZGUXI5SI.js";
|
|
|
19
19
|
import "../chunk-6VQCFJWP.js";
|
|
20
20
|
import "../chunk-LQYIBL3G.js";
|
|
21
21
|
import "../chunk-XELWWXJJ.js";
|
|
22
|
-
import "../chunk-
|
|
22
|
+
import "../chunk-7QZNHBQT.js";
|
|
23
23
|
import "../chunk-PIUYJTTK.js";
|
|
24
24
|
|
|
25
25
|
// src/public-consultation/index.ts
|
package/dist/rollout/d1.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* from those rows.
|
|
5
5
|
*
|
|
6
6
|
* Record from the chat route's lifecycle (`onTurnComplete` / `onTurnError`
|
|
7
|
-
* carry `firstTextMs` and `durationMs`), then serve `measureStage` behind an
|
|
7
|
+
* carry `firstVisibleMs`, `firstTextMs` and `durationMs`), then serve `measureStage` behind an
|
|
8
8
|
* operator endpoint that the deploy's `rollout.config.mjs` calls. A stage is
|
|
9
9
|
* measured on the turns of the workspaces it admits, in the lane being rolled
|
|
10
10
|
* out, since the time it went live.
|
|
@@ -21,7 +21,9 @@ export interface D1LikeForRollout {
|
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
export declare const ROLLOUT_TURN_TIMING_SCHEMA_SQL = "\nCREATE TABLE IF NOT EXISTS rollout_turn_timing (\n turn_id TEXT PRIMARY KEY,\n rollout TEXT NOT NULL,\n workspace_id TEXT NOT NULL,\n lane TEXT NOT NULL,\n first_text_ms INTEGER,\n settled_ms INTEGER NOT NULL,\n failed INTEGER NOT NULL CHECK (failed IN (0, 1)),\n failure_code TEXT,\n at INTEGER NOT NULL\n);\nCREATE INDEX IF NOT EXISTS rollout_turn_timing_by_lane ON rollout_turn_timing (rollout, lane, at);\n";
|
|
24
|
+
export declare const ROLLOUT_TURN_TIMING_SCHEMA_SQL = "\nCREATE TABLE IF NOT EXISTS rollout_turn_timing (\n turn_id TEXT PRIMARY KEY,\n rollout TEXT NOT NULL,\n workspace_id TEXT NOT NULL,\n lane TEXT NOT NULL,\n first_visible_ms INTEGER,\n first_text_ms INTEGER,\n settled_ms INTEGER NOT NULL,\n failed INTEGER NOT NULL CHECK (failed IN (0, 1)),\n failure_code TEXT,\n at INTEGER NOT NULL\n);\nCREATE INDEX IF NOT EXISTS rollout_turn_timing_by_lane ON rollout_turn_timing (rollout, lane, at);\n";
|
|
25
|
+
/** Apply once through the product migration runner to existing tables; historical rows stay NULL. */
|
|
26
|
+
export declare const ROLLOUT_TURN_TIMING_FIRST_VISIBLE_MIGRATION_SQL = "ALTER TABLE rollout_turn_timing ADD COLUMN first_visible_ms INTEGER;";
|
|
25
27
|
export interface TurnTimingRow {
|
|
26
28
|
turnId: string;
|
|
27
29
|
/** The plan this turn counts toward, e.g. `hospitality-routed-chat`. */
|
|
@@ -31,6 +33,8 @@ export interface TurnTimingRow {
|
|
|
31
33
|
lane: string;
|
|
32
34
|
/** From the lifecycle's `firstTextMs`; absent when no word streamed. */
|
|
33
35
|
firstTextMs?: number;
|
|
36
|
+
/** From the lifecycle firstVisibleMs; absent when no reasoning, tool or answer streamed. */
|
|
37
|
+
firstVisibleMs?: number;
|
|
34
38
|
settledMs: number;
|
|
35
39
|
failed: boolean;
|
|
36
40
|
failureCode?: string;
|
|
@@ -38,7 +42,9 @@ export interface TurnTimingRow {
|
|
|
38
42
|
at?: number;
|
|
39
43
|
}
|
|
40
44
|
/** Stage metrics from turn rows: first-words and settled percentiles in ms, and the failure rate. */
|
|
41
|
-
export declare function stageMetrics(rows: ReadonlyArray<Pick<TurnTimingRow, 'firstTextMs' | 'settledMs' | 'failed'>>): {
|
|
45
|
+
export declare function stageMetrics(rows: ReadonlyArray<Pick<TurnTimingRow, 'firstVisibleMs' | 'firstTextMs' | 'settledMs' | 'failed'>>): {
|
|
46
|
+
first_visible_p50_ms: number | null;
|
|
47
|
+
first_visible_p90_ms: number | null;
|
|
42
48
|
first_words_p50_ms: number | null;
|
|
43
49
|
first_words_p90_ms: number | null;
|
|
44
50
|
settled_p50_ms: number | null;
|
package/dist/rollout/d1.js
CHANGED
|
@@ -9,6 +9,7 @@ CREATE TABLE IF NOT EXISTS rollout_turn_timing (
|
|
|
9
9
|
rollout TEXT NOT NULL,
|
|
10
10
|
workspace_id TEXT NOT NULL,
|
|
11
11
|
lane TEXT NOT NULL,
|
|
12
|
+
first_visible_ms INTEGER,
|
|
12
13
|
first_text_ms INTEGER,
|
|
13
14
|
settled_ms INTEGER NOT NULL,
|
|
14
15
|
failed INTEGER NOT NULL CHECK (failed IN (0, 1)),
|
|
@@ -17,15 +18,19 @@ CREATE TABLE IF NOT EXISTS rollout_turn_timing (
|
|
|
17
18
|
);
|
|
18
19
|
CREATE INDEX IF NOT EXISTS rollout_turn_timing_by_lane ON rollout_turn_timing (rollout, lane, at);
|
|
19
20
|
`;
|
|
21
|
+
var ROLLOUT_TURN_TIMING_FIRST_VISIBLE_MIGRATION_SQL = `ALTER TABLE rollout_turn_timing ADD COLUMN first_visible_ms INTEGER;`;
|
|
20
22
|
var MEASURE_ROW_LIMIT = 2e4;
|
|
21
23
|
function percentile(sorted, p) {
|
|
22
24
|
if (!sorted.length) return null;
|
|
23
25
|
return sorted[Math.min(sorted.length - 1, Math.ceil(p / 100 * sorted.length) - 1)];
|
|
24
26
|
}
|
|
25
27
|
function stageMetrics(rows) {
|
|
28
|
+
const firstVisible = rows.flatMap((row) => row.firstVisibleMs == null ? [] : [row.firstVisibleMs]).sort((a, b) => a - b);
|
|
26
29
|
const firstWords = rows.flatMap((row) => row.firstTextMs === void 0 || row.firstTextMs === null ? [] : [row.firstTextMs]).sort((a, b) => a - b);
|
|
27
30
|
const settled = rows.filter((row) => !row.failed).map((row) => row.settledMs).sort((a, b) => a - b);
|
|
28
31
|
return {
|
|
32
|
+
first_visible_p50_ms: percentile(firstVisible, 50),
|
|
33
|
+
first_visible_p90_ms: percentile(firstVisible, 90),
|
|
29
34
|
first_words_p50_ms: percentile(firstWords, 50),
|
|
30
35
|
first_words_p90_ms: percentile(firstWords, 90),
|
|
31
36
|
settled_p50_ms: percentile(settled, 50),
|
|
@@ -42,13 +47,14 @@ function createD1TurnTimingStore(options) {
|
|
|
42
47
|
try {
|
|
43
48
|
await options.db.prepare(
|
|
44
49
|
`INSERT OR IGNORE INTO rollout_turn_timing
|
|
45
|
-
(turn_id, rollout, workspace_id, lane, first_text_ms, settled_ms, failed, failure_code, at)
|
|
46
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`
|
|
50
|
+
(turn_id, rollout, workspace_id, lane, first_visible_ms, first_text_ms, settled_ms, failed, failure_code, at)
|
|
51
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`
|
|
47
52
|
).bind(
|
|
48
53
|
row.turnId,
|
|
49
54
|
row.rollout,
|
|
50
55
|
row.workspaceId,
|
|
51
56
|
row.lane,
|
|
57
|
+
row.firstVisibleMs === void 0 ? null : Math.round(row.firstVisibleMs),
|
|
52
58
|
row.firstTextMs === void 0 ? null : Math.round(row.firstTextMs),
|
|
53
59
|
Math.round(row.settledMs),
|
|
54
60
|
row.failed ? 1 : 0,
|
|
@@ -67,10 +73,10 @@ function createD1TurnTimingStore(options) {
|
|
|
67
73
|
* workspace creation time, so a workspace admitted only by a `new-since:` entry is not counted. */
|
|
68
74
|
async measureStage(input) {
|
|
69
75
|
const { results = [] } = await options.db.prepare(
|
|
70
|
-
`SELECT workspace_id, first_text_ms, settled_ms, failed FROM rollout_turn_timing
|
|
76
|
+
`SELECT workspace_id, first_visible_ms, first_text_ms, settled_ms, failed FROM rollout_turn_timing
|
|
71
77
|
WHERE rollout = ? AND lane = ? AND at >= ? ORDER BY at DESC LIMIT ?`
|
|
72
78
|
).bind(input.rollout, input.lane, input.since, MEASURE_ROW_LIMIT).all();
|
|
73
|
-
const rows = results.filter((row) => rolloutAdmits(input.stage.value, { id: row.workspace_id })).map((row) => ({ firstTextMs: row.first_text_ms ?? void 0, settledMs: row.settled_ms, failed: row.failed === 1 }));
|
|
79
|
+
const rows = results.filter((row) => rolloutAdmits(input.stage.value, { id: row.workspace_id })).map((row) => ({ firstVisibleMs: row.first_visible_ms ?? void 0, firstTextMs: row.first_text_ms ?? void 0, settledMs: row.settled_ms, failed: row.failed === 1 }));
|
|
74
80
|
return {
|
|
75
81
|
stage: input.stage.name,
|
|
76
82
|
samples: rows.length,
|
|
@@ -82,6 +88,7 @@ function createD1TurnTimingStore(options) {
|
|
|
82
88
|
};
|
|
83
89
|
}
|
|
84
90
|
export {
|
|
91
|
+
ROLLOUT_TURN_TIMING_FIRST_VISIBLE_MIGRATION_SQL,
|
|
85
92
|
ROLLOUT_TURN_TIMING_SCHEMA_SQL,
|
|
86
93
|
createD1TurnTimingStore,
|
|
87
94
|
stageMetrics
|
package/dist/rollout/d1.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/rollout/d1.ts"],"sourcesContent":["/**\n * The measurement a rollout guard reads: one row per turn with its lane, its\n * first visible word and whether it failed, and the stage numbers computed\n * from those rows.\n *\n * Record from the chat route's lifecycle (`onTurnComplete` / `onTurnError`\n * carry `firstTextMs` and `durationMs`), then serve `measureStage` behind an\n * operator endpoint that the deploy's `rollout.config.mjs` calls. A stage is\n * measured on the turns of the workspaces it admits, in the lane being rolled\n * out, since the time it went live.\n */\nimport { rolloutAdmits, type RolloutStage, type StageMeasurement } from './index'\n\n/** Minimal D1 surface (Cloudflare's `D1Database` satisfies it). */\nexport interface D1LikeForRollout {\n prepare(sql: string): {\n bind(...values: unknown[]): {\n run(): Promise<unknown>\n all<T = Record<string, unknown>>(): Promise<{ results?: T[] }>\n }\n }\n}\n\nexport const ROLLOUT_TURN_TIMING_SCHEMA_SQL = `\nCREATE TABLE IF NOT EXISTS rollout_turn_timing (\n turn_id TEXT PRIMARY KEY,\n rollout TEXT NOT NULL,\n workspace_id TEXT NOT NULL,\n lane TEXT NOT NULL,\n first_text_ms INTEGER,\n settled_ms INTEGER NOT NULL,\n failed INTEGER NOT NULL CHECK (failed IN (0, 1)),\n failure_code TEXT,\n at INTEGER NOT NULL\n);\nCREATE INDEX IF NOT EXISTS rollout_turn_timing_by_lane ON rollout_turn_timing (rollout, lane, at);\n`\n\nexport interface TurnTimingRow {\n turnId: string\n /** The plan this turn counts toward, e.g. `hospitality-routed-chat`. */\n rollout: string\n workspaceId: string\n /** The lane that served the turn, e.g. `routed` or `sandbox`. Only the rolled-out lane is measured. */\n lane: string\n /** From the lifecycle's `firstTextMs`; absent when no word streamed. */\n firstTextMs?: number\n settledMs: number\n failed: boolean\n failureCode?: string\n /** Epoch ms; defaults to now. */\n at?: number\n}\n\n/** Rows read for one measurement; a stage needing more than this would be measured on its newest rows. */\nconst MEASURE_ROW_LIMIT = 20_000\n\nfunction percentile(sorted: readonly number[], p: number): number | null {\n if (!sorted.length) return null\n return sorted[Math.min(sorted.length - 1, Math.ceil((p / 100) * sorted.length) - 1)]!\n}\n\n/** Stage metrics from turn rows: first-words and settled percentiles in ms, and the failure rate. */\nexport function stageMetrics(rows: ReadonlyArray<Pick<TurnTimingRow, 'firstTextMs' | 'settledMs' | 'failed'>>) {\n const firstWords = rows.flatMap(row => row.firstTextMs === undefined || row.firstTextMs === null ? [] : [row.firstTextMs]).sort((a, b) => a - b)\n const settled = rows.filter(row => !row.failed).map(row => row.settledMs).sort((a, b) => a - b)\n return {\n first_words_p50_ms: percentile(firstWords, 50),\n first_words_p90_ms: percentile(firstWords, 90),\n settled_p50_ms: percentile(settled, 50),\n settled_p90_ms: percentile(settled, 90),\n // A turn that streamed no word failed the user whatever its envelope said.\n failure_rate: rows.length ? rows.filter(row => row.failed || row.firstTextMs === undefined || row.firstTextMs === null).length / rows.length : null,\n }\n}\n\nexport function createD1TurnTimingStore(options: { db: D1LikeForRollout; now?: () => number }) {\n const now = options.now ?? Date.now\n return {\n /** Record one settled turn. Idempotent on `turnId`. Never throws: telemetry must not fail a turn. */\n async record(row: TurnTimingRow): Promise<void> {\n try {\n await options.db.prepare(\n `INSERT OR IGNORE INTO rollout_turn_timing\n (turn_id, rollout, workspace_id, lane, first_text_ms, settled_ms, failed, failure_code, at)\n VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`,\n ).bind(row.turnId, row.rollout, row.workspaceId, row.lane,\n row.firstTextMs === undefined ? null : Math.round(row.firstTextMs), Math.round(row.settledMs),\n row.failed ? 1 : 0, row.failureCode ?? null, row.at ?? now()).run()\n } catch (error) {\n console.error(JSON.stringify({ event: 'rollout_turn_timing_record_failed', turnId: row.turnId,\n error: error instanceof Error ? error.message.slice(0, 200) : String(error).slice(0, 200) }))\n }\n },\n\n /** The stage's numbers: its admitted workspaces' turns in `lane` since `since` (epoch ms). A row carries no\n * workspace creation time, so a workspace admitted only by a `new-since:` entry is not counted. */\n async measureStage(input: { rollout: string; stage: RolloutStage; lane: string; since: number }): Promise<StageMeasurement> {\n const { results = [] } = await options.db.prepare(\n `SELECT workspace_id, first_text_ms, settled_ms, failed FROM rollout_turn_timing\n WHERE rollout = ? AND lane = ? AND at >= ? ORDER BY at DESC LIMIT ?`,\n ).bind(input.rollout, input.lane, input.since, MEASURE_ROW_LIMIT).all<{\n workspace_id: string; first_text_ms: number | null; settled_ms: number; failed: number\n }>()\n const rows = results\n .filter(row => rolloutAdmits(input.stage.value, { id: row.workspace_id }))\n .map(row => ({ firstTextMs: row.first_text_ms ?? undefined, settledMs: row.settled_ms, failed: row.failed === 1 }))\n return {\n stage: input.stage.name,\n samples: rows.length,\n metrics: stageMetrics(rows),\n source: `rollout_turn_timing lane=${input.lane}`,\n window: { from: new Date(input.since).toISOString(), to: new Date(now()).toISOString() },\n }\n },\n }\n}\n"],"mappings":";;;;;AAuBO,IAAM,iCAAiC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
1
|
+
{"version":3,"sources":["../../src/rollout/d1.ts"],"sourcesContent":["/**\n * The measurement a rollout guard reads: one row per turn with its lane, its\n * first visible word and whether it failed, and the stage numbers computed\n * from those rows.\n *\n * Record from the chat route's lifecycle (`onTurnComplete` / `onTurnError`\n * carry `firstVisibleMs`, `firstTextMs` and `durationMs`), then serve `measureStage` behind an\n * operator endpoint that the deploy's `rollout.config.mjs` calls. A stage is\n * measured on the turns of the workspaces it admits, in the lane being rolled\n * out, since the time it went live.\n */\nimport { rolloutAdmits, type RolloutStage, type StageMeasurement } from './index'\n\n/** Minimal D1 surface (Cloudflare's `D1Database` satisfies it). */\nexport interface D1LikeForRollout {\n prepare(sql: string): {\n bind(...values: unknown[]): {\n run(): Promise<unknown>\n all<T = Record<string, unknown>>(): Promise<{ results?: T[] }>\n }\n }\n}\n\nexport const ROLLOUT_TURN_TIMING_SCHEMA_SQL = `\nCREATE TABLE IF NOT EXISTS rollout_turn_timing (\n turn_id TEXT PRIMARY KEY,\n rollout TEXT NOT NULL,\n workspace_id TEXT NOT NULL,\n lane TEXT NOT NULL,\n first_visible_ms INTEGER,\n first_text_ms INTEGER,\n settled_ms INTEGER NOT NULL,\n failed INTEGER NOT NULL CHECK (failed IN (0, 1)),\n failure_code TEXT,\n at INTEGER NOT NULL\n);\nCREATE INDEX IF NOT EXISTS rollout_turn_timing_by_lane ON rollout_turn_timing (rollout, lane, at);\n`\n\n/** Apply once through the product migration runner to existing tables; historical rows stay NULL. */\nexport const ROLLOUT_TURN_TIMING_FIRST_VISIBLE_MIGRATION_SQL =\n `ALTER TABLE rollout_turn_timing ADD COLUMN first_visible_ms INTEGER;`\n\nexport interface TurnTimingRow {\n turnId: string\n /** The plan this turn counts toward, e.g. `hospitality-routed-chat`. */\n rollout: string\n workspaceId: string\n /** The lane that served the turn, e.g. `routed` or `sandbox`. Only the rolled-out lane is measured. */\n lane: string\n /** From the lifecycle's `firstTextMs`; absent when no word streamed. */\n firstTextMs?: number\n /** From the lifecycle firstVisibleMs; absent when no reasoning, tool or answer streamed. */\n firstVisibleMs?: number\n settledMs: number\n failed: boolean\n failureCode?: string\n /** Epoch ms; defaults to now. */\n at?: number\n}\n\n/** Rows read for one measurement; a stage needing more than this would be measured on its newest rows. */\nconst MEASURE_ROW_LIMIT = 20_000\n\nfunction percentile(sorted: readonly number[], p: number): number | null {\n if (!sorted.length) return null\n return sorted[Math.min(sorted.length - 1, Math.ceil((p / 100) * sorted.length) - 1)]!\n}\n\n/** Stage metrics from turn rows: first-words and settled percentiles in ms, and the failure rate. */\nexport function stageMetrics(rows: ReadonlyArray<Pick<TurnTimingRow, 'firstVisibleMs' | 'firstTextMs' | 'settledMs' | 'failed'>>) {\n const firstVisible = rows.flatMap(row => row.firstVisibleMs == null ? [] : [row.firstVisibleMs]).sort((a, b) => a - b)\n const firstWords = rows.flatMap(row => row.firstTextMs === undefined || row.firstTextMs === null ? [] : [row.firstTextMs]).sort((a, b) => a - b)\n const settled = rows.filter(row => !row.failed).map(row => row.settledMs).sort((a, b) => a - b)\n return {\n first_visible_p50_ms: percentile(firstVisible, 50),\n first_visible_p90_ms: percentile(firstVisible, 90),\n first_words_p50_ms: percentile(firstWords, 50),\n first_words_p90_ms: percentile(firstWords, 90),\n settled_p50_ms: percentile(settled, 50),\n settled_p90_ms: percentile(settled, 90),\n // A turn that streamed no word failed the user whatever its envelope said.\n failure_rate: rows.length ? rows.filter(row => row.failed || row.firstTextMs === undefined || row.firstTextMs === null).length / rows.length : null,\n }\n}\n\nexport function createD1TurnTimingStore(options: { db: D1LikeForRollout; now?: () => number }) {\n const now = options.now ?? Date.now\n return {\n /** Record one settled turn. Idempotent on `turnId`. Never throws: telemetry must not fail a turn. */\n async record(row: TurnTimingRow): Promise<void> {\n try {\n await options.db.prepare(\n `INSERT OR IGNORE INTO rollout_turn_timing\n (turn_id, rollout, workspace_id, lane, first_visible_ms, first_text_ms, settled_ms, failed, failure_code, at)\n VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,\n ).bind(row.turnId, row.rollout, row.workspaceId, row.lane,\n row.firstVisibleMs === undefined ? null : Math.round(row.firstVisibleMs),\n row.firstTextMs === undefined ? null : Math.round(row.firstTextMs), Math.round(row.settledMs),\n row.failed ? 1 : 0, row.failureCode ?? null, row.at ?? now()).run()\n } catch (error) {\n console.error(JSON.stringify({ event: 'rollout_turn_timing_record_failed', turnId: row.turnId,\n error: error instanceof Error ? error.message.slice(0, 200) : String(error).slice(0, 200) }))\n }\n },\n\n /** The stage's numbers: its admitted workspaces' turns in `lane` since `since` (epoch ms). A row carries no\n * workspace creation time, so a workspace admitted only by a `new-since:` entry is not counted. */\n async measureStage(input: { rollout: string; stage: RolloutStage; lane: string; since: number }): Promise<StageMeasurement> {\n const { results = [] } = await options.db.prepare(\n `SELECT workspace_id, first_visible_ms, first_text_ms, settled_ms, failed FROM rollout_turn_timing\n WHERE rollout = ? AND lane = ? AND at >= ? ORDER BY at DESC LIMIT ?`,\n ).bind(input.rollout, input.lane, input.since, MEASURE_ROW_LIMIT).all<{\n workspace_id: string; first_visible_ms: number | null; first_text_ms: number | null; settled_ms: number; failed: number\n }>()\n const rows = results\n .filter(row => rolloutAdmits(input.stage.value, { id: row.workspace_id }))\n .map(row => ({ firstVisibleMs: row.first_visible_ms ?? undefined, firstTextMs: row.first_text_ms ?? undefined, settledMs: row.settled_ms, failed: row.failed === 1 }))\n return {\n stage: input.stage.name,\n samples: rows.length,\n metrics: stageMetrics(rows),\n source: `rollout_turn_timing lane=${input.lane}`,\n window: { from: new Date(input.since).toISOString(), to: new Date(now()).toISOString() },\n }\n },\n }\n}\n"],"mappings":"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","names":[]}
|
package/dist/runtime/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
ProtectedModelSettlementError,
|
|
3
3
|
createRouterProtectedModelPort,
|
|
4
4
|
runProtectedRouterTurn
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-BKVDPMFD.js";
|
|
6
6
|
import {
|
|
7
7
|
DURABLE_HOP_BUDGET_MS,
|
|
8
8
|
asksForLanguage,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
turnKnowledgeInstructions,
|
|
25
25
|
workspaceKnowledgeForTurn,
|
|
26
26
|
workspaceTurnCheckpoints
|
|
27
|
-
} from "../chunk-
|
|
27
|
+
} from "../chunk-TEIKC276.js";
|
|
28
28
|
import "../chunk-J63KUZBE.js";
|
|
29
29
|
import {
|
|
30
30
|
DEFAULT_TANGLE_BILLING_ENFORCEMENT_ENV_VAR,
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
resolveCatalogModelId,
|
|
53
53
|
sortModelsByFreshness
|
|
54
54
|
} from "../chunk-AMUXRAUO.js";
|
|
55
|
-
import "../chunk-
|
|
55
|
+
import "../chunk-7QZNHBQT.js";
|
|
56
56
|
import "../chunk-PIUYJTTK.js";
|
|
57
57
|
|
|
58
58
|
// src/runtime/certified-delivery.ts
|
|
@@ -11,11 +11,11 @@ import {
|
|
|
11
11
|
turnKnowledgeInstructions,
|
|
12
12
|
workspaceKnowledgeForTurn,
|
|
13
13
|
workspaceTurnCheckpoints
|
|
14
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-TEIKC276.js";
|
|
15
15
|
import "../chunk-J63KUZBE.js";
|
|
16
16
|
import "../chunk-D6UJEOZQ.js";
|
|
17
17
|
import "../chunk-AMUXRAUO.js";
|
|
18
|
-
import "../chunk-
|
|
18
|
+
import "../chunk-7QZNHBQT.js";
|
|
19
19
|
import "../chunk-PIUYJTTK.js";
|
|
20
20
|
export {
|
|
21
21
|
DURABLE_HOP_BUDGET_MS,
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { SandboxInstance, ScopedTokenScope, MintScopedTokenOptions } from '@tangle-network/sandbox';
|
|
2
|
+
import { type Outcome } from './outcome';
|
|
3
|
+
import type { SandboxRuntimeConfig } from './configuration';
|
|
4
|
+
/** Define permission levels for sandbox access and control */
|
|
5
|
+
export type SandboxPermissionLevel = 'owner' | 'admin' | 'developer' | 'viewer';
|
|
6
|
+
/** Map workspace roles to corresponding sandbox permission levels */
|
|
7
|
+
export interface MemberSyncSeam {
|
|
8
|
+
roleToSandboxRole: (workspaceRole: string) => SandboxPermissionLevel;
|
|
9
|
+
}
|
|
10
|
+
/** Resolve adding a user with a specific role to a sandbox and return the operation outcome */
|
|
11
|
+
export declare function syncSandboxMemberAdd(box: SandboxInstance, seam: MemberSyncSeam, userId: string, role: string): Promise<Outcome<void>>;
|
|
12
|
+
/** Remove a member from the sandbox while preserving their home directory and handle the outcome */
|
|
13
|
+
export declare function syncSandboxMemberRemove(box: SandboxInstance, userId: string): Promise<Outcome<void>>;
|
|
14
|
+
/** Synchronize a sandbox member's role by updating permissions based on the provided role mapping */
|
|
15
|
+
export declare function syncSandboxMemberRole(box: SandboxInstance, seam: MemberSyncSeam, userId: string, role: string): Promise<Outcome<void>>;
|
|
16
|
+
/**
|
|
17
|
+
* Write-only secret port: create, replace, and delete a secret by name.
|
|
18
|
+
*
|
|
19
|
+
* There is no read method. The platform's secrets API returns names and
|
|
20
|
+
* timestamps only — a stored value is never served back, it is injected into
|
|
21
|
+
* the sandbox as an environment variable. A `get` here could only ever return
|
|
22
|
+
* a value this process already held, so the port does not offer one.
|
|
23
|
+
*/
|
|
24
|
+
export interface SecretStore {
|
|
25
|
+
create: (name: string, value: string) => Promise<void>;
|
|
26
|
+
update: (name: string, value: string) => Promise<void>;
|
|
27
|
+
delete: (name: string) => Promise<void>;
|
|
28
|
+
}
|
|
29
|
+
/** Resolve a SecretStore interface using the provided SandboxRuntimeConfig shell */
|
|
30
|
+
export declare function secretStoreFromClient(shell: SandboxRuntimeConfig): SecretStore;
|
|
31
|
+
/** Resolve storing a secret by creating it, or replacing it when it exists */
|
|
32
|
+
export declare function storeSecret(store: SecretStore, name: string, value: string): Promise<Outcome<void>>;
|
|
33
|
+
/** Delete a secret by name from the given secret store and return the operation outcome */
|
|
34
|
+
export declare function deleteSecret(store: SecretStore, name: string): Promise<Outcome<void>>;
|
|
35
|
+
/** Represent a token with its expiration date and associated scope */
|
|
36
|
+
export interface ScopedTokenResult {
|
|
37
|
+
token: string;
|
|
38
|
+
expiresAt: Date;
|
|
39
|
+
scope: ScopedTokenScope;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Mint a scoped token for an already-provisioned box (e.g. to hand a terminal
|
|
43
|
+
* proxy a narrowed credential). Uses the SDK's native `box.mintScopedToken`,
|
|
44
|
+
* which normalizes `expiresAt` to a Date — no hand-rolled wire call.
|
|
45
|
+
*/
|
|
46
|
+
export declare function mintSandboxScopedToken(box: SandboxInstance, options: MintScopedTokenOptions): Promise<Outcome<ScopedTokenResult>>;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { type AppToolName, type AppToolContext, type ToolHeaderNames } from '../tools/index';
|
|
2
|
+
import type { AgentProfileMcpServer, AgentProfileFileMount } from '@tangle-network/agent-interface';
|
|
3
|
+
import type { SandboxInstance } from '@tangle-network/sandbox';
|
|
4
|
+
import { type Outcome } from './outcome';
|
|
5
|
+
/** Describe an application tool with its name, unique key, and description */
|
|
6
|
+
export interface AppToolDescriptor {
|
|
7
|
+
tool: AppToolName;
|
|
8
|
+
key: string;
|
|
9
|
+
description: string;
|
|
10
|
+
}
|
|
11
|
+
/** Define options for building MCP server configurations in the app tool environment */
|
|
12
|
+
export interface BuildAppToolMcpServersOptions {
|
|
13
|
+
tools: AppToolDescriptor[];
|
|
14
|
+
baseUrl: string;
|
|
15
|
+
/**
|
|
16
|
+
* NAME of the box-environment variable holding the capability token — never
|
|
17
|
+
* the token itself. Every emitted `Authorization` header is a `secret-ref` to
|
|
18
|
+
* this key, which the sandbox resolves privately; see
|
|
19
|
+
* `BuildHttpMcpServerOptions.tokenEnvKey` in `../tools/mcp`.
|
|
20
|
+
*
|
|
21
|
+
* The key must name a variable the box carries — placed by
|
|
22
|
+
* {@link SandboxRuntimeConfig.env} at creation, refreshed by
|
|
23
|
+
* {@link SandboxRuntimeConfig.runtimeEnv} before retained-box bootstrap, or
|
|
24
|
+
* injected from the platform secret store via
|
|
25
|
+
* {@link SandboxRuntimeConfig.secrets}.
|
|
26
|
+
*/
|
|
27
|
+
tokenEnvKey: string;
|
|
28
|
+
ctx: AppToolContext;
|
|
29
|
+
headerNames?: ToolHeaderNames;
|
|
30
|
+
}
|
|
31
|
+
/** Build a mapping of MCP server profiles keyed by tool identifiers from provided options */
|
|
32
|
+
export declare function buildAppToolMcpServers(options: BuildAppToolMcpServersOptions): Record<string, AgentProfileMcpServer>;
|
|
33
|
+
/** Define the specification for a sandbox tool including its name, content, and optional executability */
|
|
34
|
+
export interface SandboxToolSpec {
|
|
35
|
+
name: string;
|
|
36
|
+
content: string;
|
|
37
|
+
executable?: boolean;
|
|
38
|
+
}
|
|
39
|
+
/** Define options for resolving sandbox tool paths including appName, baseDir, and binDir */
|
|
40
|
+
export interface SandboxToolPathOptions {
|
|
41
|
+
appName: string;
|
|
42
|
+
baseDir?: string;
|
|
43
|
+
binDir?: string;
|
|
44
|
+
}
|
|
45
|
+
/** Define options for building sandbox tool file mounts including tool specifications and paths */
|
|
46
|
+
export interface BuildSandboxToolFileMountsOptions extends SandboxToolPathOptions {
|
|
47
|
+
tools: readonly SandboxToolSpec[];
|
|
48
|
+
}
|
|
49
|
+
/** Resolve the root directory path for a sandbox tool based on provided options */
|
|
50
|
+
export declare function sandboxToolRootDir(options: SandboxToolPathOptions): string;
|
|
51
|
+
/** Resolve the binary directory path for a sandbox tool based on provided options */
|
|
52
|
+
export declare function sandboxToolBinDir(options: SandboxToolPathOptions): string;
|
|
53
|
+
/** Resolve the file system path to a specified sandbox tool based on given options */
|
|
54
|
+
export declare function sandboxToolPath(options: SandboxToolPathOptions & {
|
|
55
|
+
toolName: string;
|
|
56
|
+
}): string;
|
|
57
|
+
/** Build file mounts for sandbox tools based on provided options and tool configurations */
|
|
58
|
+
export declare function buildSandboxToolFileMounts(options: BuildSandboxToolFileMountsOptions): AgentProfileFileMount[];
|
|
59
|
+
/**
|
|
60
|
+
* Build the `SANDBOX_TOOL_BIN_DIRS` entry that puts these apps' tool bin dirs on
|
|
61
|
+
* a sandbox PATH. Declare it in the same box env as the mounts from
|
|
62
|
+
* {@link buildSandboxToolFileMounts}: the mounts place the executables, this
|
|
63
|
+
* places the directory that makes a bare tool name resolve.
|
|
64
|
+
*
|
|
65
|
+
* Every sandbox PATH builder appends these directories at the TAIL, after the
|
|
66
|
+
* Nix, npm, and image entries, so a tool never shadows a platform or system
|
|
67
|
+
* binary of the same name. That placement is identical for a non-interactive
|
|
68
|
+
* exec, a sidecar-spawned CLI, and an SSH shell, which is why this variable and
|
|
69
|
+
* not a shell rc file is the mechanism: an exec reads no rc file, and the SSH
|
|
70
|
+
* shell environment assigns PATH absolutely.
|
|
71
|
+
*
|
|
72
|
+
* Entries come from {@link sandboxToolBinDir}, so the value can never name a
|
|
73
|
+
* directory the mounts did not use — a caller that hand-writes the literal
|
|
74
|
+
* instead drifts silently the moment a base dir changes. Order is preserved,
|
|
75
|
+
* and two apps that resolve to one directory collapse to the FIRST position it
|
|
76
|
+
* appeared in.
|
|
77
|
+
*
|
|
78
|
+
* A `:` in a resolved bin dir throws here. The character separates entries both
|
|
79
|
+
* in this variable and in PATH itself, so such a directory is unrepresentable
|
|
80
|
+
* rather than merely awkward: joining it would split one absolute path into a
|
|
81
|
+
* leading path and a relative remainder, and the runtime rejects a relative
|
|
82
|
+
* segment by failing the whole box. Throwing names the offending directory
|
|
83
|
+
* instead.
|
|
84
|
+
*
|
|
85
|
+
* The consuming half lives in agent-container: `resolveSandboxToolBinDirs`
|
|
86
|
+
* parses this value and every PATH builder appends it at the tail — sidecar
|
|
87
|
+
* exec and PTY through `packages/shared/src/cache-env.ts`, an SSH session
|
|
88
|
+
* through `packages/shared/src/ssh-bootstrap.ts`, and a spawned CLI through
|
|
89
|
+
* `packages/sdk-cli-runner/src/cli-process.ts`, each with its own tests. This
|
|
90
|
+
* package has no sandbox runtime, so tail placement is pinned there, not here.
|
|
91
|
+
*/
|
|
92
|
+
export declare function buildSandboxToolBinDirsEnv(apps: readonly SandboxToolPathOptions[]): {
|
|
93
|
+
SANDBOX_TOOL_BIN_DIRS: string;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Build a shell script that creates the sandbox tool binary directory.
|
|
97
|
+
* {@link buildSandboxToolBinDirsEnv}, not this script, puts that directory on a
|
|
98
|
+
* sandbox PATH.
|
|
99
|
+
*
|
|
100
|
+
* The `mkdir -p` makes the directory exist before a tool mount lands in it.
|
|
101
|
+
*/
|
|
102
|
+
export declare function buildSandboxToolBinDirScript(options: SandboxToolPathOptions): string;
|
|
103
|
+
/** Build a shell script that creates the sandbox tool binary directory.
|
|
104
|
+
*
|
|
105
|
+
* @deprecated Renamed to {@link buildSandboxToolBinDirScript}, and the script
|
|
106
|
+
* no longer appends the bin dir to PATH in `~/.profile`, `~/.bashrc` and
|
|
107
|
+
* `~/.zshrc`. Those edits never reached the contexts that run a tool: an exec
|
|
108
|
+
* and a spawned CLI read no rc file, and the SSH shell assigns PATH
|
|
109
|
+
* absolutely, which discards an appended entry. Put the directory on PATH with
|
|
110
|
+
* {@link buildSandboxToolBinDirsEnv} instead. This name forwards to the new
|
|
111
|
+
* one so an existing import keeps resolving; removal is a major.
|
|
112
|
+
*/
|
|
113
|
+
export declare function buildSandboxToolPathSetupScript(options: SandboxToolPathOptions): string;
|
|
114
|
+
/**
|
|
115
|
+
* Create the sandbox tool binary directory in a running box.
|
|
116
|
+
* {@link buildSandboxToolBinDirsEnv}, not this call, puts it on a sandbox PATH.
|
|
117
|
+
*/
|
|
118
|
+
export declare function ensureSandboxToolBinDir(box: SandboxInstance, options: SandboxToolPathOptions): Promise<Outcome<void>>;
|
|
119
|
+
/** Create the sandbox tool binary directory in a running box.
|
|
120
|
+
*
|
|
121
|
+
* @deprecated Renamed to {@link ensureSandboxToolBinDir}, and the call no
|
|
122
|
+
* longer appends the bin dir to PATH in `~/.profile`, `~/.bashrc` and
|
|
123
|
+
* `~/.zshrc`. Those edits never reached the contexts that run a tool: an exec
|
|
124
|
+
* and a spawned CLI read no rc file, and the SSH shell assigns PATH
|
|
125
|
+
* absolutely, which discards an appended entry. Put the directory on PATH with
|
|
126
|
+
* {@link buildSandboxToolBinDirsEnv} instead. This name forwards to the new
|
|
127
|
+
* one so an existing import keeps resolving; removal is a major.
|
|
128
|
+
*/
|
|
129
|
+
export declare function runSandboxToolPathSetup(box: SandboxInstance, options: SandboxToolPathOptions): Promise<Outcome<void>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SandboxInstance, ProvisionEvent } from '@tangle-network/sandbox';
|
|
2
|
+
import type { LivenessProbeConfig } from './configuration';
|
|
3
|
+
import { type Outcome } from './outcome';
|
|
4
|
+
import { Sandbox } from '@tangle-network/sandbox/core';
|
|
5
|
+
import { type SandboxExistingBoxStage } from './lifecycle-errors';
|
|
6
|
+
export declare function isReusableBox(box: SandboxInstance, probe: LivenessProbeConfig | undefined): Promise<Outcome<void>>;
|
|
7
|
+
export declare function resumeStoppedBox(box: SandboxInstance, timeoutMs: number, runtimeEnv: Record<string, string>, onProgress?: (event: ProvisionEvent) => void): Promise<Outcome<SandboxInstance>>;
|
|
8
|
+
export declare function recoverUnresponsiveBox(client: Sandbox, box: SandboxInstance, probe: LivenessProbeConfig | undefined, stage: SandboxExistingBoxStage, name: string, resumeTimeout: number, runtimeEnv: Record<string, string>, onProgress?: (event: ProvisionEvent) => void): Promise<SandboxInstance>;
|