@tangle-network/agent-app 0.60.225 → 0.60.227
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/DesignCanvas-SNE3H3TH.js +13 -0
- package/dist/DesignCanvasEditor-G5O75CUT.js +16 -0
- package/dist/agent-enrollment/drizzle.js +3 -3
- package/dist/agent-enrollment/index.js +3 -3
- package/dist/app-auth/index.js +3 -3
- package/dist/chat-routes/index.js +8 -8
- package/dist/chat-routes/turn-routes.d.ts +2 -0
- package/dist/{chunk-DKHM4B4A.js → chunk-3KXYYAY4.js} +3 -3
- package/dist/{chunk-3NCPXNBZ.js → chunk-7HZCFG2A.js} +5 -3
- package/dist/chunk-7HZCFG2A.js.map +1 -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-UTAIRVOK.js → chunk-FENBDSIW.js} +2 -2
- package/dist/{chunk-EOPFHXEA.js → chunk-I57SNMX4.js} +3 -3
- package/dist/{chunk-OHWQUKBP.js → chunk-JK7R7BZQ.js} +2 -2
- package/dist/{chunk-2TJWEFFM.js → chunk-LHGYK5I3.js} +4 -2
- package/dist/chunk-LHGYK5I3.js.map +1 -0
- package/dist/{chunk-6RWQ4VW5.js → chunk-MY3EJJ6Y.js} +2 -2
- package/dist/{chunk-OGLTKK72.js → chunk-NMSAZFRL.js} +2 -2
- package/dist/{chunk-LZBEAWHY.js → chunk-P2NJIDLE.js} +5 -5
- package/dist/{chunk-K72AOZX2.js → chunk-PTB2B2OO.js} +23 -5
- package/dist/chunk-PTB2B2OO.js.map +1 -0
- package/dist/{chunk-Q7WEEN7P.js → chunk-TCGZFSN5.js} +2 -2
- 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/{chunk-6NYVAURR.js → chunk-VBKP2NLI.js} +2 -2
- package/dist/{chunk-CFGA7PXM.js → chunk-X556WVBG.js} +2 -2
- package/dist/{chunk-C3JSO2CB.js → chunk-Y4W6GK5X.js} +2 -2
- package/dist/design-canvas/index.js +3 -3
- package/dist/design-canvas-react/engine.js +5 -5
- package/dist/design-canvas-react/index.js +8 -8
- package/dist/design-canvas-react/lazy.js +1 -1
- package/dist/hosted-agent/application.js +2 -2
- package/dist/interactions/index.js +2 -2
- package/dist/openui/index.js +1 -1
- package/dist/platform/index.js +3 -3
- package/dist/public-consultation/index.js +6 -6
- 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/sequences/index.js +2 -2
- 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/dist/web/index.js +2 -2
- package/dist/web/rate-limit.d.ts +6 -1
- package/package.json +1 -1
- package/dist/DesignCanvas-TW45DTK7.js +0 -13
- package/dist/DesignCanvasEditor-EZ7LNKNQ.js +0 -16
- package/dist/chunk-2TJWEFFM.js.map +0 -1
- package/dist/chunk-3NCPXNBZ.js.map +0 -1
- package/dist/chunk-6XF3T6YD.js.map +0 -1
- package/dist/chunk-EKV6T4YU.js.map +0 -1
- package/dist/chunk-K72AOZX2.js.map +0 -1
- /package/dist/{DesignCanvas-TW45DTK7.js.map → DesignCanvas-SNE3H3TH.js.map} +0 -0
- /package/dist/{DesignCanvasEditor-EZ7LNKNQ.js.map → DesignCanvasEditor-G5O75CUT.js.map} +0 -0
- /package/dist/{chunk-DKHM4B4A.js.map → chunk-3KXYYAY4.js.map} +0 -0
- /package/dist/{chunk-ILAQQYVL.js.map → chunk-BKVDPMFD.js.map} +0 -0
- /package/dist/{chunk-UTAIRVOK.js.map → chunk-FENBDSIW.js.map} +0 -0
- /package/dist/{chunk-EOPFHXEA.js.map → chunk-I57SNMX4.js.map} +0 -0
- /package/dist/{chunk-OHWQUKBP.js.map → chunk-JK7R7BZQ.js.map} +0 -0
- /package/dist/{chunk-6RWQ4VW5.js.map → chunk-MY3EJJ6Y.js.map} +0 -0
- /package/dist/{chunk-OGLTKK72.js.map → chunk-NMSAZFRL.js.map} +0 -0
- /package/dist/{chunk-LZBEAWHY.js.map → chunk-P2NJIDLE.js.map} +0 -0
- /package/dist/{chunk-Q7WEEN7P.js.map → chunk-TCGZFSN5.js.map} +0 -0
- /package/dist/{chunk-XAD4VTP4.js.map → chunk-TEIKC276.js.map} +0 -0
- /package/dist/{chunk-6NYVAURR.js.map → chunk-VBKP2NLI.js.map} +0 -0
- /package/dist/{chunk-CFGA7PXM.js.map → chunk-X556WVBG.js.map} +0 -0
- /package/dist/{chunk-C3JSO2CB.js.map → chunk-Y4W6GK5X.js.map} +0 -0
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
applySceneOperations,
|
|
4
4
|
requireElement,
|
|
5
5
|
requirePage
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JK7R7BZQ.js";
|
|
7
7
|
|
|
8
8
|
// src/design-canvas-react/engine/command-stack.ts
|
|
9
9
|
var SCENE_COMMAND_HISTORY_LIMIT = 200;
|
|
@@ -601,4 +601,4 @@ export {
|
|
|
601
601
|
bindSlotCommand,
|
|
602
602
|
setDocumentTitleCommand
|
|
603
603
|
};
|
|
604
|
-
//# sourceMappingURL=chunk-
|
|
604
|
+
//# sourceMappingURL=chunk-VBKP2NLI.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
boundsIntersect,
|
|
5
5
|
elementAabb,
|
|
6
6
|
scaleForPreset
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-JK7R7BZQ.js";
|
|
8
8
|
|
|
9
9
|
// src/design-canvas-react/engine/snap.ts
|
|
10
10
|
var KIND_PRIORITY = {
|
|
@@ -447,4 +447,4 @@ export {
|
|
|
447
447
|
buildInsertImageOp,
|
|
448
448
|
DEFAULT_INSERT_TEMPLATES
|
|
449
449
|
};
|
|
450
|
-
//# sourceMappingURL=chunk-
|
|
450
|
+
//# sourceMappingURL=chunk-X556WVBG.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createApplicationLineHandler
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MY3EJJ6Y.js";
|
|
4
4
|
|
|
5
5
|
// src/agent-enrollment/application.ts
|
|
6
6
|
function forbidden() {
|
|
@@ -229,4 +229,4 @@ export {
|
|
|
229
229
|
EnrollmentTargetError,
|
|
230
230
|
createAgentEnrollment
|
|
231
231
|
};
|
|
232
|
-
//# sourceMappingURL=chunk-
|
|
232
|
+
//# sourceMappingURL=chunk-Y4W6GK5X.js.map
|
|
@@ -30,14 +30,14 @@ import {
|
|
|
30
30
|
validateSceneOperation,
|
|
31
31
|
validateSceneOperations,
|
|
32
32
|
validateSlotValue
|
|
33
|
-
} from "../chunk-
|
|
33
|
+
} from "../chunk-JK7R7BZQ.js";
|
|
34
34
|
import {
|
|
35
35
|
buildScopedMcpServerEntry,
|
|
36
36
|
createMcpToolHandler
|
|
37
37
|
} from "../chunk-6A7MYOUI.js";
|
|
38
|
-
import "../chunk-
|
|
38
|
+
import "../chunk-FENBDSIW.js";
|
|
39
39
|
import "../chunk-RN4WPTBH.js";
|
|
40
|
-
import "../chunk-
|
|
40
|
+
import "../chunk-7HZCFG2A.js";
|
|
41
41
|
import "../chunk-TXD5HXLE.js";
|
|
42
42
|
|
|
43
43
|
// src/design-canvas/operations.ts
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
nudgeDelta,
|
|
21
21
|
resolveExportParams,
|
|
22
22
|
resolveNodeCachePixelRatio
|
|
23
|
-
} from "../chunk-
|
|
23
|
+
} from "../chunk-X556WVBG.js";
|
|
24
24
|
import {
|
|
25
25
|
SCENE_COMMAND_HISTORY_LIMIT,
|
|
26
26
|
addElementCommand,
|
|
@@ -39,14 +39,14 @@ import {
|
|
|
39
39
|
setPageGuidesCommand,
|
|
40
40
|
setPagePropsCommand,
|
|
41
41
|
ungroupElementCommand
|
|
42
|
-
} from "../chunk-
|
|
42
|
+
} from "../chunk-VBKP2NLI.js";
|
|
43
43
|
import {
|
|
44
44
|
bleedAwareExportBounds,
|
|
45
45
|
scaleForPreset
|
|
46
|
-
} from "../chunk-
|
|
47
|
-
import "../chunk-
|
|
46
|
+
} from "../chunk-JK7R7BZQ.js";
|
|
47
|
+
import "../chunk-FENBDSIW.js";
|
|
48
48
|
import "../chunk-RN4WPTBH.js";
|
|
49
|
-
import "../chunk-
|
|
49
|
+
import "../chunk-7HZCFG2A.js";
|
|
50
50
|
import "../chunk-TXD5HXLE.js";
|
|
51
51
|
export {
|
|
52
52
|
DEFAULT_INSERT_TEMPLATES,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
bakeTextTransform,
|
|
12
12
|
exportDocumentJson,
|
|
13
13
|
exportPageDataUrl
|
|
14
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-P2NJIDLE.js";
|
|
15
15
|
import {
|
|
16
16
|
BTN,
|
|
17
17
|
BTN_ACTIVE,
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
buildRulerTicks,
|
|
41
41
|
formatRulerLabel,
|
|
42
42
|
selectTickStep
|
|
43
|
-
} from "../chunk-
|
|
43
|
+
} from "../chunk-3KXYYAY4.js";
|
|
44
44
|
import "../chunk-UTF7H6BK.js";
|
|
45
45
|
import "../chunk-ZN5J47UX.js";
|
|
46
46
|
import {
|
|
@@ -64,7 +64,7 @@ import {
|
|
|
64
64
|
nudgeDelta,
|
|
65
65
|
resolveExportParams,
|
|
66
66
|
resolveNodeCachePixelRatio
|
|
67
|
-
} from "../chunk-
|
|
67
|
+
} from "../chunk-X556WVBG.js";
|
|
68
68
|
import {
|
|
69
69
|
SCENE_COMMAND_HISTORY_LIMIT,
|
|
70
70
|
addElementCommand,
|
|
@@ -83,19 +83,19 @@ import {
|
|
|
83
83
|
setPageGuidesCommand,
|
|
84
84
|
setPagePropsCommand,
|
|
85
85
|
ungroupElementCommand
|
|
86
|
-
} from "../chunk-
|
|
86
|
+
} from "../chunk-VBKP2NLI.js";
|
|
87
87
|
import {
|
|
88
88
|
assertSceneMediaSrc,
|
|
89
89
|
bleedAwareExportBounds,
|
|
90
90
|
scaleForPreset
|
|
91
|
-
} from "../chunk-
|
|
91
|
+
} from "../chunk-JK7R7BZQ.js";
|
|
92
92
|
import {
|
|
93
93
|
DesignCanvasChromeLazy,
|
|
94
94
|
DesignCanvasLazy
|
|
95
|
-
} from "../chunk-
|
|
96
|
-
import "../chunk-
|
|
95
|
+
} from "../chunk-I57SNMX4.js";
|
|
96
|
+
import "../chunk-FENBDSIW.js";
|
|
97
97
|
import "../chunk-RN4WPTBH.js";
|
|
98
|
-
import "../chunk-
|
|
98
|
+
import "../chunk-7HZCFG2A.js";
|
|
99
99
|
import "../chunk-TXD5HXLE.js";
|
|
100
100
|
|
|
101
101
|
// src/design-canvas-react/components/CanvasInsertPanel.tsx
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
attachWorkspaceLine,
|
|
3
3
|
createApplicationLineHandler,
|
|
4
4
|
publicApplicationSenderVerification
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-MY3EJJ6Y.js";
|
|
6
|
+
import "../chunk-7HZCFG2A.js";
|
|
7
7
|
import "../chunk-TXD5HXLE.js";
|
|
8
8
|
export {
|
|
9
9
|
attachWorkspaceLine,
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
mapInteractionRespondFailure,
|
|
8
8
|
respondToSessionInteraction,
|
|
9
9
|
validateInteractionAnswerBody
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-
|
|
10
|
+
} from "../chunk-TCGZFSN5.js";
|
|
11
|
+
import "../chunk-7HZCFG2A.js";
|
|
12
12
|
import "../chunk-TXD5HXLE.js";
|
|
13
13
|
import {
|
|
14
14
|
INTERACTION_CANCEL_EVENT,
|
package/dist/openui/index.js
CHANGED
package/dist/platform/index.js
CHANGED
|
@@ -21,15 +21,15 @@ import {
|
|
|
21
21
|
resolveTangleSsoAccount,
|
|
22
22
|
signSessionCookieValue,
|
|
23
23
|
verifySignedSsoState
|
|
24
|
-
} from "../chunk-
|
|
24
|
+
} from "../chunk-NMSAZFRL.js";
|
|
25
25
|
import {
|
|
26
26
|
resolveTangleExecutionEnvironment
|
|
27
27
|
} from "../chunk-D6UJEOZQ.js";
|
|
28
|
-
import "../chunk-
|
|
28
|
+
import "../chunk-FENBDSIW.js";
|
|
29
29
|
import "../chunk-RN4WPTBH.js";
|
|
30
30
|
import {
|
|
31
31
|
parseJsonObjectBody
|
|
32
|
-
} from "../chunk-
|
|
32
|
+
} from "../chunk-7HZCFG2A.js";
|
|
33
33
|
import "../chunk-TXD5HXLE.js";
|
|
34
34
|
|
|
35
35
|
// src/platform/sso-identity-store.ts
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createChatTurnRoutes,
|
|
3
3
|
streamChatRouteAsSandboxEvents
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-PTB2B2OO.js";
|
|
5
|
+
import "../chunk-LHGYK5I3.js";
|
|
6
|
+
import "../chunk-TCGZFSN5.js";
|
|
7
|
+
import "../chunk-FENBDSIW.js";
|
|
8
8
|
import "../chunk-RN4WPTBH.js";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-7HZCFG2A.js";
|
|
10
10
|
import "../chunk-Z4RD5UF7.js";
|
|
11
11
|
import "../chunk-YG66IHDU.js";
|
|
12
12
|
import "../chunk-ISP6ZH3G.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,
|
package/dist/sequences/index.js
CHANGED
|
@@ -15,11 +15,11 @@ import {
|
|
|
15
15
|
buildScopedMcpServerEntry,
|
|
16
16
|
createMcpToolHandler
|
|
17
17
|
} from "../chunk-6A7MYOUI.js";
|
|
18
|
-
import "../chunk-
|
|
18
|
+
import "../chunk-FENBDSIW.js";
|
|
19
19
|
import "../chunk-RN4WPTBH.js";
|
|
20
20
|
import {
|
|
21
21
|
assertMediaUrl
|
|
22
|
-
} from "../chunk-
|
|
22
|
+
} from "../chunk-7HZCFG2A.js";
|
|
23
23
|
import "../chunk-TXD5HXLE.js";
|
|
24
24
|
|
|
25
25
|
// src/sequences/operations.ts
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* It is a report: it fails only on an explicit opt-out that gives no reason, so a gap stays visible without
|
|
7
7
|
* blocking a merge, and an exemption is a line in the app's `signoff.config.mjs` with the reason beside it.
|
|
8
8
|
*
|
|
9
|
-
* The rows are the outcomes Drew named on 2026-10-19: the turn trace on every turn with
|
|
9
|
+
* The rows are the outcomes Drew named on 2026-10-19: the turn trace on every turn with first-visible and answer-text timing (a turn handed
|
|
10
10
|
* to a completion owner included), the shared
|
|
11
11
|
* prewarm route, Worker placement beside the D1 primary, limit alarms wired in the server entry, and the Worker
|
|
12
12
|
* upload size against Cloudflare's limit. A row is read from the source, the Wrangler config and the lockfile; it
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
/** The name the built-in step reports under; a repo cannot declare a step with it. */
|
|
16
16
|
export declare const APP_DEFAULTS_STEP = "agent-app defaults";
|
|
17
17
|
/** Defaults an app may turn off with a reason. */
|
|
18
|
-
export declare const EXEMPTIBLE_DEFAULTS: readonly ['turn-trace', 'first-text', 'prewarm', 'placement', 'limit-alarms'];
|
|
18
|
+
export declare const EXEMPTIBLE_DEFAULTS: readonly ['turn-trace', 'first-visible', 'first-text', 'prewarm', 'placement', 'limit-alarms'];
|
|
19
19
|
type ExemptibleDefault = (typeof EXEMPTIBLE_DEFAULTS)[number];
|
|
20
20
|
/** An app's declared opt-outs: the default and why. An empty reason is a configuration error. */
|
|
21
21
|
export type AppDefaultsExemptions = Readonly<Partial<Record<ExemptibleDefault, string>>>;
|
|
22
22
|
type DefaultStatus = 'ok' | 'gap' | 'unknown' | 'exempt' | 'opted-out' | 'na';
|
|
23
23
|
interface DefaultRow {
|
|
24
|
-
readonly id: 'pin' | 'turn-trace' | 'first-text' | 'prewarm' | 'placement' | 'tool-count' | 'limit-alarms' | 'worker-bundle';
|
|
24
|
+
readonly id: 'pin' | 'turn-trace' | 'first-visible' | 'first-text' | 'prewarm' | 'placement' | 'tool-count' | 'limit-alarms' | 'worker-bundle';
|
|
25
25
|
readonly label: string;
|
|
26
26
|
readonly status: DefaultStatus;
|
|
27
27
|
readonly detail: string;
|
|
@@ -53,6 +53,7 @@ export interface AppDefaultsOptions {
|
|
|
53
53
|
interface LastTurnExport {
|
|
54
54
|
readonly at: number;
|
|
55
55
|
readonly traceId: string;
|
|
56
|
+
readonly firstVisibleMs?: number;
|
|
56
57
|
readonly firstTextMs?: number;
|
|
57
58
|
}
|
|
58
59
|
/** Report each agent app in the checkout against the defaults. Reads only tracked files; measures the Worker upload with the app's own Wrangler. */
|
package/dist/signoff/cli.js
CHANGED
package/dist/signoff/index.js
CHANGED
package/dist/turn-trace/index.js
CHANGED
|
@@ -7,14 +7,14 @@ import {
|
|
|
7
7
|
createIntelligenceTurnTraceSink,
|
|
8
8
|
otlpTraceId,
|
|
9
9
|
resolveIngestKey
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-LHGYK5I3.js";
|
|
11
11
|
import {
|
|
12
12
|
TURN_SPAN_KINDS,
|
|
13
13
|
createTurnTrace,
|
|
14
14
|
isTraceId,
|
|
15
15
|
summarizeTurnSpans,
|
|
16
16
|
turnTraceId
|
|
17
|
-
} from "../chunk-
|
|
17
|
+
} from "../chunk-7QZNHBQT.js";
|
|
18
18
|
import {
|
|
19
19
|
formatServerTiming,
|
|
20
20
|
parseServerTiming,
|
|
@@ -63,6 +63,8 @@ export interface TurnTraceSummary {
|
|
|
63
63
|
dropped: number;
|
|
64
64
|
/** From the request to the first visible text the member could read (see {@link TurnTrace.markFirstText}); absent when none streamed. */
|
|
65
65
|
firstTextMs?: number;
|
|
66
|
+
/** Headline latency: request to first reasoning, tool activity or answer output. */
|
|
67
|
+
firstVisibleMs?: number;
|
|
66
68
|
/** D1 round trips in the turn scope, when its binding is instrumented. */
|
|
67
69
|
d1Queries?: number;
|
|
68
70
|
}
|
|
@@ -100,6 +102,8 @@ export interface TurnTrace {
|
|
|
100
102
|
* `firstTextMs` then reads from the request, so it holds admission, the box or the Router, and the model.
|
|
101
103
|
*/
|
|
102
104
|
markFirstText(at?: number): void;
|
|
105
|
+
/** Mark the first reasoning, tool activity or answer output. Only the first call counts. */
|
|
106
|
+
markFirstVisible(at?: number): void;
|
|
103
107
|
/** Read the current numbers without ending the trace. */
|
|
104
108
|
summary(now?: number): TurnTraceSummary;
|
|
105
109
|
/** Read the spans recorded so far without ending the trace; an open span reads as ending at `now`. */
|
package/dist/web/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
firstTouchAcquisitionCookie,
|
|
4
4
|
groupConversationMessages,
|
|
5
5
|
readFirstTouchAcquisition
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-FENBDSIW.js";
|
|
7
7
|
import {
|
|
8
8
|
createApiKeyFetch
|
|
9
9
|
} from "../chunk-RN4WPTBH.js";
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
requireString,
|
|
25
25
|
serializeCookie,
|
|
26
26
|
withFreeRouteLimit
|
|
27
|
-
} from "../chunk-
|
|
27
|
+
} from "../chunk-7HZCFG2A.js";
|
|
28
28
|
import {
|
|
29
29
|
isWorkspaceFileExportable
|
|
30
30
|
} from "../chunk-TXD5HXLE.js";
|
package/dist/web/rate-limit.d.ts
CHANGED
|
@@ -17,6 +17,11 @@ export interface RateLimitResult {
|
|
|
17
17
|
remaining: number;
|
|
18
18
|
resetAt: number;
|
|
19
19
|
}
|
|
20
|
+
/** Request-lifetime persistence for a coarse limiter. Callers must retain the
|
|
21
|
+
* promise until it settles and observe write failures; hard quotas must await. */
|
|
22
|
+
export interface RateLimitOptions {
|
|
23
|
+
waitUntil?: (persist: Promise<void>) => void;
|
|
24
|
+
}
|
|
20
25
|
/** KV-backed sliding-window rate limit. Stores recent timestamps per key,
|
|
21
26
|
* prunes the window, allows until `limit` is hit.
|
|
22
27
|
*
|
|
@@ -30,4 +35,4 @@ export interface RateLimitResult {
|
|
|
30
35
|
* truncated value) is treated as a full window, so a tampered key cannot reset
|
|
31
36
|
* the count and bypass the limiter. A bare `JSON.parse` here would throw and
|
|
32
37
|
* abort the request handler, silently disabling the limit (fail-open). */
|
|
33
|
-
export declare function checkRateLimit(kv: KvLike, key: string, limit: number, windowSeconds: number): Promise<RateLimitResult>;
|
|
38
|
+
export declare function checkRateLimit(kv: KvLike, key: string, limit: number, windowSeconds: number, options?: RateLimitOptions): Promise<RateLimitResult>;
|
package/package.json
CHANGED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DesignCanvas
|
|
3
|
-
} from "./chunk-DKHM4B4A.js";
|
|
4
|
-
import "./chunk-6NYVAURR.js";
|
|
5
|
-
import "./chunk-OHWQUKBP.js";
|
|
6
|
-
import "./chunk-UTAIRVOK.js";
|
|
7
|
-
import "./chunk-RN4WPTBH.js";
|
|
8
|
-
import "./chunk-3NCPXNBZ.js";
|
|
9
|
-
import "./chunk-TXD5HXLE.js";
|
|
10
|
-
export {
|
|
11
|
-
DesignCanvas
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=DesignCanvas-TW45DTK7.js.map
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DesignCanvasEditor
|
|
3
|
-
} from "./chunk-LZBEAWHY.js";
|
|
4
|
-
import "./chunk-DKHM4B4A.js";
|
|
5
|
-
import "./chunk-UTF7H6BK.js";
|
|
6
|
-
import "./chunk-CFGA7PXM.js";
|
|
7
|
-
import "./chunk-6NYVAURR.js";
|
|
8
|
-
import "./chunk-OHWQUKBP.js";
|
|
9
|
-
import "./chunk-UTAIRVOK.js";
|
|
10
|
-
import "./chunk-RN4WPTBH.js";
|
|
11
|
-
import "./chunk-3NCPXNBZ.js";
|
|
12
|
-
import "./chunk-TXD5HXLE.js";
|
|
13
|
-
export {
|
|
14
|
-
DesignCanvasEditor
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=DesignCanvasEditor-EZ7LNKNQ.js.map
|