@sema-agent/client-core 0.99.0 → 0.100.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +177 -0
- package/README.md +32 -19
- package/dist/adapt/arms.js +60 -36
- package/dist/adapt/panelTasks.d.ts +2 -1
- package/dist/adapt/panelTasks.js +32 -9
- package/dist/adapt/textStream.d.ts +1 -1
- package/dist/adapt/textStream.js +51 -28
- package/dist/adapter/activeRunSelfHeal.d.ts +7 -0
- package/dist/adapter/activeRunSelfHeal.js +58 -11
- package/dist/adapter/downstream/eventToSdkMessage.d.ts +25 -6
- package/dist/adapter/downstream/eventToSdkMessage.js +125 -9
- package/dist/adapter/downstream/terminalToSdkResult.js +10 -0
- package/dist/adapter/downstream/wiringManifestView.d.ts +3 -1
- package/dist/adapter/downstream/wiringManifestView.js +1 -0
- package/dist/adapter/runStream.js +32 -5
- package/dist/adapter/types.d.ts +2 -0
- package/dist/agentsWireCaps.d.ts +7 -0
- package/dist/agentsWireCaps.js +100 -15
- package/dist/cloudConfigWireCaps.d.ts +10 -1
- package/dist/cloudConfigWireCaps.js +156 -62
- package/dist/compactionStatus.d.ts +34 -0
- package/dist/compactionStatus.js +196 -0
- package/dist/decideFailureNote.js +3 -3
- package/dist/displayUntrusted.js +150 -5
- package/dist/engineAgentPanelStore.d.ts +7 -4
- package/dist/engineErrorCodes.d.ts +9 -1
- package/dist/engineErrorCodes.js +9 -5
- package/dist/engineRowRef.js +1 -0
- package/dist/engineToolDirectory.d.ts +3 -0
- package/dist/engineToolDirectory.js +4 -2
- package/dist/eventLeg.d.ts +1 -7
- package/dist/eventLeg.js +7 -8
- package/dist/fileHistoryCaptureCapability.d.ts +0 -3
- package/dist/fileHistoryCaptureCapability.js +0 -4
- package/dist/generated/engineFactTables.d.ts +1 -0
- package/dist/generated/engineFactTables.js +27 -0
- package/dist/generated/engineNoticeTables.js +3 -0
- package/dist/generated/settingsSchemaFns.d.ts +12 -0
- package/dist/generated/settingsSchemaFns.js +13 -0
- package/dist/generated/settingsSchemaMcpRequestEntry.d.ts +1 -0
- package/dist/generated/settingsSchemaMcpRequestEntry.js +162 -0
- package/dist/generated/settingsSchemaTables.d.ts +1 -0
- package/dist/generated/settingsSchemaTables.js +5 -0
- package/dist/generated/settingsSchemaTypes.d.ts +28 -0
- package/dist/hitl/allowRuleShadow.js +2 -2
- package/dist/hitl/approvalCardReasons.js +2 -2
- package/dist/hitl/approvalHolds.d.ts +14 -0
- package/dist/hitl/approvalHolds.js +41 -0
- package/dist/hitl/askClassPair.d.ts +2 -2
- package/dist/hitl/askClassPair.js +2 -2
- package/dist/hitl/attributionLadder.d.ts +23 -0
- package/dist/hitl/attributionLadder.js +67 -0
- package/dist/hitl/decisionLedger.d.ts +55 -0
- package/dist/hitl/decisionLedger.js +156 -0
- package/dist/hitl/decisionRefusal.d.ts +1 -0
- package/dist/hitl/decisionRefusal.js +1 -1
- package/dist/hitl/decisionSend.d.ts +113 -0
- package/dist/hitl/decisionSend.js +579 -0
- package/dist/hitl/hitlBridge.js +18 -6
- package/dist/hitl/planReviewWire.js +45 -76
- package/dist/hitl/sessionPolicyDeliverable.js +3 -6
- package/dist/hitl/toolApprovalWire.js +43 -109
- package/dist/hostTurnSettings.d.ts +46 -7
- package/dist/hostTurnSettings.js +408 -7
- package/dist/humanTurn.d.ts +2 -1
- package/dist/humanTurn.js +3 -3
- package/dist/i18n/messages.en.d.ts +131 -0
- package/dist/i18n/messages.en.js +143 -12
- package/dist/i18n/messages.zh.js +148 -12
- package/dist/index.d.ts +18 -2
- package/dist/index.js +10 -1
- package/dist/inheritEnvCapability.d.ts +1 -0
- package/dist/inheritEnvCapability.js +9 -2
- package/dist/inheritEnvWire.js +2 -2
- package/dist/injectionLaneNotice.d.ts +5 -0
- package/dist/injectionLaneNotice.js +46 -0
- package/dist/mcpPanel.js +2 -0
- package/dist/mcpReconnect.js +2 -2
- package/dist/mcpToolToggles.d.ts +6 -0
- package/dist/mcpToolToggles.js +46 -0
- package/dist/mcpWireCaps.d.ts +10 -4
- package/dist/mcpWireCaps.js +106 -71
- package/dist/mcpWireTransport.d.ts +4 -0
- package/dist/mcpWireTransport.js +18 -0
- package/dist/modelCapabilityProbe.d.ts +2 -1
- package/dist/modelCapabilityProbe.js +10 -9
- package/dist/modelIdentityResolvability.d.ts +2 -0
- package/dist/modelIdentityResolvability.js +23 -5
- package/dist/ownKey.d.ts +26 -0
- package/dist/ownKey.js +75 -0
- package/dist/panelReduce.d.ts +5 -0
- package/dist/panelReduce.js +45 -13
- package/dist/panelStateHolder.d.ts +1 -0
- package/dist/panelStateHolder.js +10 -1
- package/dist/permissionRuleIssue.d.ts +2 -1
- package/dist/permissionRuleIssue.js +22 -21
- package/dist/pluginHooksWire.js +12 -10
- package/dist/prepareRefusal.d.ts +8 -0
- package/dist/prepareRefusal.js +72 -0
- package/dist/request/taskRequest.d.ts +10 -10
- package/dist/request/taskRequest.js +106 -65
- package/dist/resumeRefusalCopy.d.ts +3 -1
- package/dist/resumeRefusalCopy.js +22 -4
- package/dist/retryStatus.d.ts +18 -0
- package/dist/retryStatus.js +76 -19
- package/dist/ruleRefusalSentence.d.ts +4 -0
- package/dist/ruleRefusalSentence.js +58 -0
- package/dist/sandboxWire.d.ts +2 -1
- package/dist/sandboxWire.js +55 -21
- package/dist/scenarioRefusal.d.ts +2 -1
- package/dist/scenarioRefusal.js +5 -5
- package/dist/seam.d.ts +24 -9
- package/dist/seam.js +44 -4
- package/dist/seatContract.d.ts +16 -8
- package/dist/seatContract.js +21 -6
- package/dist/settingsCredentialKeyPaths.d.ts +8 -0
- package/dist/settingsCredentialKeyPaths.js +219 -0
- package/dist/skillsWireCaps.d.ts +0 -3
- package/dist/skillsWireCaps.js +1 -2
- package/dist/subagentContentStore.d.ts +1 -0
- package/dist/subagentContentStore.js +135 -27
- package/dist/toolsFlagNames.d.ts +8 -0
- package/dist/toolsFlagNames.js +110 -0
- package/dist/turnFailurePresentation.js +15 -7
- package/dist/wireRefusalCopy.d.ts +51 -17
- package/dist/wireRefusalCopy.js +298 -135
- package/docs/INTEGRATION-CLIENTS.md +423 -26
- package/package.json +4 -4
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { readOwnDataValue } from './ownKey.js';
|
|
2
|
+
import { snapshotIsSubFlow, snapshotSegmentIdentity } from './adapter/types.js';
|
|
3
|
+
const _printStatusFramePins = [true, true];
|
|
4
|
+
void _printStatusFramePins;
|
|
5
|
+
const CLOSED_PASS_MEMORY = 1024;
|
|
6
|
+
const nonEmpty = (v) => (typeof v === 'string' && v.length > 0 ? v : undefined);
|
|
7
|
+
const own = (o, key) => (typeof o === 'object' && o !== null ? readOwnDataValue(o, key) : undefined);
|
|
8
|
+
function chromeLane(ev) {
|
|
9
|
+
const lane = own(own(ev, 'laneProof'), 'lane');
|
|
10
|
+
if (typeof lane !== 'string' || lane.length === 0)
|
|
11
|
+
return 'unreadable';
|
|
12
|
+
return lane === 'main' ? 'main' : 'other';
|
|
13
|
+
}
|
|
14
|
+
function armLane(m) {
|
|
15
|
+
const snap = snapshotSegmentIdentity(m);
|
|
16
|
+
if (snap === null)
|
|
17
|
+
return 'unreadable';
|
|
18
|
+
return snapshotIsSubFlow(snap) ? 'other' : 'main';
|
|
19
|
+
}
|
|
20
|
+
function openOf(pass, lane, startedAt, trigger) {
|
|
21
|
+
if (lane === 'unreadable')
|
|
22
|
+
return null;
|
|
23
|
+
if (nonEmpty(trigger) === undefined)
|
|
24
|
+
return null;
|
|
25
|
+
return { kind: 'open', pass, main: lane === 'main', ...(typeof startedAt === 'number' && Number.isFinite(startedAt) ? { startedAt } : {}) };
|
|
26
|
+
}
|
|
27
|
+
function parse(input) {
|
|
28
|
+
const plane = own(input, 'plane');
|
|
29
|
+
if (plane === 'chrome') {
|
|
30
|
+
const ev = own(input, 'event');
|
|
31
|
+
return typeof ev === 'object' && ev !== null ? parseChrome(ev) : null;
|
|
32
|
+
}
|
|
33
|
+
if (plane === 'transcript') {
|
|
34
|
+
const msg = own(input, 'message');
|
|
35
|
+
return typeof msg === 'object' && msg !== null ? parseMessage(msg) : null;
|
|
36
|
+
}
|
|
37
|
+
if (own(input, 'kind') !== undefined)
|
|
38
|
+
return parseChrome(input);
|
|
39
|
+
return parseMessage(input);
|
|
40
|
+
}
|
|
41
|
+
function parseChrome(ev) {
|
|
42
|
+
const kind = own(ev, 'kind');
|
|
43
|
+
const pass = nonEmpty(own(ev, 'pass'));
|
|
44
|
+
if (pass === undefined)
|
|
45
|
+
return null;
|
|
46
|
+
if (kind === 'compaction_started')
|
|
47
|
+
return openOf(pass, chromeLane(ev), own(ev, 'startedAt'), own(ev, 'trigger'));
|
|
48
|
+
if (kind === 'compaction_outcome') {
|
|
49
|
+
const outcome = nonEmpty(own(ev, 'outcome'));
|
|
50
|
+
const reason = nonEmpty(own(ev, 'reason'));
|
|
51
|
+
return { kind: 'close-outcome', pass, ...(outcome !== undefined ? { outcome } : {}), ...(reason !== undefined ? { reason } : {}) };
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
function parseMessage(m) {
|
|
56
|
+
const type = own(m, 'type');
|
|
57
|
+
if (type === 'system') {
|
|
58
|
+
if (own(m, 'subtype') !== 'compact_boundary')
|
|
59
|
+
return null;
|
|
60
|
+
const pass = nonEmpty(own(own(m, 'compact_metadata'), '_sema_pass'));
|
|
61
|
+
return pass === undefined ? null : { kind: 'close-landed', pass };
|
|
62
|
+
}
|
|
63
|
+
const pass = nonEmpty(own(m, 'pass'));
|
|
64
|
+
if (pass === undefined)
|
|
65
|
+
return null;
|
|
66
|
+
if (type === 'compaction_started')
|
|
67
|
+
return openOf(pass, armLane(m), own(m, 'startedAt'), own(m, 'trigger'));
|
|
68
|
+
if (type === 'compaction_outcome') {
|
|
69
|
+
const outcome = nonEmpty(own(m, 'outcome'));
|
|
70
|
+
const reason = nonEmpty(own(m, 'reason'));
|
|
71
|
+
return { kind: 'close-outcome', pass, ...(outcome !== undefined ? { outcome } : {}), ...(reason !== undefined ? { reason } : {}) };
|
|
72
|
+
}
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
export function createCompactionStatusTracker() {
|
|
76
|
+
const open = new Map();
|
|
77
|
+
const closed = new Set();
|
|
78
|
+
const remember = (pass) => {
|
|
79
|
+
closed.add(pass);
|
|
80
|
+
if (closed.size > CLOSED_PASS_MEMORY) {
|
|
81
|
+
const oldest = closed.values().next().value;
|
|
82
|
+
if (oldest !== undefined)
|
|
83
|
+
closed.delete(oldest);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
const mainOpen = () => {
|
|
87
|
+
let n = 0;
|
|
88
|
+
for (const e of open.values())
|
|
89
|
+
if (e.main)
|
|
90
|
+
n++;
|
|
91
|
+
return n;
|
|
92
|
+
};
|
|
93
|
+
const since = () => {
|
|
94
|
+
let min;
|
|
95
|
+
for (const e of open.values())
|
|
96
|
+
if (e.main && e.startedAt !== undefined && (min === undefined || e.startedAt < min))
|
|
97
|
+
min = e.startedAt;
|
|
98
|
+
return min;
|
|
99
|
+
};
|
|
100
|
+
const reading = () => {
|
|
101
|
+
if (mainOpen() === 0)
|
|
102
|
+
return { compacting: false };
|
|
103
|
+
const s = since();
|
|
104
|
+
return { compacting: true, ...(s !== undefined ? { since: s } : {}) };
|
|
105
|
+
};
|
|
106
|
+
return {
|
|
107
|
+
take(input) {
|
|
108
|
+
try {
|
|
109
|
+
if (typeof input !== 'object' || input === null)
|
|
110
|
+
return null;
|
|
111
|
+
const p = parse(input);
|
|
112
|
+
if (p === null)
|
|
113
|
+
return null;
|
|
114
|
+
if (p.kind === 'open') {
|
|
115
|
+
if (open.has(p.pass) || closed.has(p.pass))
|
|
116
|
+
return null;
|
|
117
|
+
const before = mainOpen();
|
|
118
|
+
open.set(p.pass, { main: p.main === true, ...(p.startedAt !== undefined ? { startedAt: p.startedAt } : {}) });
|
|
119
|
+
if (before === 0 && p.main === true) {
|
|
120
|
+
const s = since();
|
|
121
|
+
return { kind: 'opened', pass: p.pass, ...(s !== undefined ? { since: s } : {}) };
|
|
122
|
+
}
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
const entry = open.get(p.pass);
|
|
126
|
+
remember(p.pass);
|
|
127
|
+
if (entry === undefined)
|
|
128
|
+
return null;
|
|
129
|
+
open.delete(p.pass);
|
|
130
|
+
if (!entry.main || mainOpen() > 0)
|
|
131
|
+
return null;
|
|
132
|
+
if (p.kind === 'close-landed')
|
|
133
|
+
return { kind: 'closed', pass: p.pass, result: 'success' };
|
|
134
|
+
if (p.outcome === 'failed')
|
|
135
|
+
return { kind: 'closed', pass: p.pass, result: 'failed', ...(p.reason !== undefined ? { error: p.reason } : {}) };
|
|
136
|
+
return { kind: 'closed', pass: p.pass };
|
|
137
|
+
}
|
|
138
|
+
catch {
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
streamEnded() {
|
|
143
|
+
try {
|
|
144
|
+
let lastMain;
|
|
145
|
+
for (const [pass, e] of open) {
|
|
146
|
+
if (e.main)
|
|
147
|
+
lastMain = pass;
|
|
148
|
+
remember(pass);
|
|
149
|
+
}
|
|
150
|
+
const wasCompacting = lastMain !== undefined;
|
|
151
|
+
open.clear();
|
|
152
|
+
return wasCompacting ? { kind: 'closed', pass: lastMain } : null;
|
|
153
|
+
}
|
|
154
|
+
catch {
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
reading() {
|
|
159
|
+
try {
|
|
160
|
+
return reading();
|
|
161
|
+
}
|
|
162
|
+
catch {
|
|
163
|
+
return { compacting: false };
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
export function compactionStatusFrameOf(change, ctx) {
|
|
169
|
+
try {
|
|
170
|
+
if (typeof change !== 'object' || change === null)
|
|
171
|
+
return null;
|
|
172
|
+
const sessionId = nonEmpty(own(ctx, 'sessionId'));
|
|
173
|
+
const mintUuid = own(ctx, 'mintUuid');
|
|
174
|
+
if (sessionId === undefined || typeof mintUuid !== 'function')
|
|
175
|
+
return null;
|
|
176
|
+
const kind = own(change, 'kind');
|
|
177
|
+
if (kind === 'opened')
|
|
178
|
+
return { type: 'system', subtype: 'status', status: 'compacting', uuid: String(mintUuid()), session_id: sessionId };
|
|
179
|
+
if (kind !== 'closed')
|
|
180
|
+
return null;
|
|
181
|
+
const result = own(change, 'result');
|
|
182
|
+
const error = result === 'failed' ? nonEmpty(own(change, 'error')) : undefined;
|
|
183
|
+
return {
|
|
184
|
+
type: 'system',
|
|
185
|
+
subtype: 'status',
|
|
186
|
+
status: null,
|
|
187
|
+
...(result === 'success' || result === 'failed' ? { compact_result: result } : {}),
|
|
188
|
+
...(error !== undefined ? { compact_error: error } : {}),
|
|
189
|
+
uuid: String(mintUuid()),
|
|
190
|
+
session_id: sessionId,
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
catch {
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { corruptStoredRowContent, corruptStoredRowWhere, scenarioDenyFromError, scenarioNotAllowedContent } from './wireErrorTriage.js';
|
|
2
2
|
import { checkpointUnsupportedVersionContent, checkpointUnsupportedVersionFromError, parkedResumeStartupContent, parkedResumeStartupFromError, resumePolicyBlockContent, resumePolicyBlockFromError, } from './resumeRefusalCopy.js';
|
|
3
3
|
import { askGoneContent, askGoneFromError, decideParkMovedContent, decideParkMovedFromError } from './decideReceipt.js';
|
|
4
|
-
import {
|
|
4
|
+
import { fieldLimitRefusalContent, fieldLimitRefusalFromError } from './wireRefusalCopy.js';
|
|
5
5
|
import { DECISION_ANSWER_INVALID_CONTENT, decisionConflictOf } from './hitl/decisionConflict.js';
|
|
6
6
|
export function decideFailureNote(err, decision) {
|
|
7
7
|
const where = corruptStoredRowWhere(err);
|
|
8
8
|
const fold = resumePolicyBlockFromError(err);
|
|
9
9
|
const startup = parkedResumeStartupFromError(err, decision);
|
|
10
10
|
const moved = decideParkMovedFromError(err);
|
|
11
|
-
const bucket =
|
|
11
|
+
const bucket = fieldLimitRefusalFromError(err);
|
|
12
12
|
const scenario = scenarioDenyFromError(err);
|
|
13
13
|
const unsupported = checkpointUnsupportedVersionFromError(err);
|
|
14
14
|
const gone = askGoneFromError(err);
|
|
15
15
|
const answerInvalid = decisionConflictOf(err) === 'answer_invalid';
|
|
16
16
|
return ((where === undefined ? '' : ` — ${corruptStoredRowContent(where)}`) +
|
|
17
17
|
(fold === null ? '' : ` — ${resumePolicyBlockContent(fold)}`) +
|
|
18
|
-
(bucket === null ? '' : ` — ${
|
|
18
|
+
(bucket === null ? '' : ` — ${fieldLimitRefusalContent(bucket)}`) +
|
|
19
19
|
(scenario === null ? '' : ` — ${scenarioNotAllowedContent(scenario, undefined, 'resumed_work')}`) +
|
|
20
20
|
(startup === null ? '' : ` — ${parkedResumeStartupContent(startup)}`) +
|
|
21
21
|
(moved === null ? '' : ` — ${decideParkMovedContent(moved)}`) +
|
package/dist/displayUntrusted.js
CHANGED
|
@@ -43,6 +43,9 @@ export function looksLikeKnownSecret(s) {
|
|
|
43
43
|
for (let layer = 0; layer < 4; layer++) {
|
|
44
44
|
if (scanForSecretLiteral(cur))
|
|
45
45
|
return true;
|
|
46
|
+
const wide = percentBoundaryDecode(cur);
|
|
47
|
+
if (wide !== null && scanForSecretLiteral(wide.decoded))
|
|
48
|
+
return true;
|
|
46
49
|
const next = percentDecodeForMatching(cur).decoded;
|
|
47
50
|
if (next === cur)
|
|
48
51
|
break;
|
|
@@ -301,7 +304,7 @@ function pathCandidates(src, base, path, opaqueSegments, edits, soft) {
|
|
|
301
304
|
if (opaqueSegments) {
|
|
302
305
|
let a = 0;
|
|
303
306
|
let b = head.length;
|
|
304
|
-
while (a < b && !isKeyWordChar(head.charCodeAt(a)))
|
|
307
|
+
while (a < b && !isKeyWordChar(head.charCodeAt(a)) && !(head.charCodeAt(a) === 0x25 && hasNonAsciiPercentEscape(head.slice(a, a + 3))))
|
|
305
308
|
a++;
|
|
306
309
|
while (b > a && !isKeyWordChar(head.charCodeAt(b - 1)))
|
|
307
310
|
b--;
|
|
@@ -1321,10 +1324,93 @@ function percentDecodeForMatching(text) {
|
|
|
1321
1324
|
return { decoded: chars.join(''), offsets };
|
|
1322
1325
|
}
|
|
1323
1326
|
const PERCENT_ESCAPE_ASCII = /%[0-7][0-9A-Fa-f]/;
|
|
1327
|
+
function hasNonAsciiPercentEscape(text) {
|
|
1328
|
+
return /%[89A-Fa-f][0-9A-Fa-f]/.test(text);
|
|
1329
|
+
}
|
|
1330
|
+
function isWellFormedUtf8(bytes) {
|
|
1331
|
+
for (let i = 0; i < bytes.length;) {
|
|
1332
|
+
const lead = bytes[i] ?? 0;
|
|
1333
|
+
if (lead < 0x80) {
|
|
1334
|
+
i += 1;
|
|
1335
|
+
continue;
|
|
1336
|
+
}
|
|
1337
|
+
const need = utf8TailLength(lead);
|
|
1338
|
+
if (need === 0)
|
|
1339
|
+
return false;
|
|
1340
|
+
for (let k = 1; k <= need; k++) {
|
|
1341
|
+
const c = bytes[i + k];
|
|
1342
|
+
const lo = k === 1 ? (lead === 0xe0 ? 0xa0 : lead === 0xf0 ? 0x90 : 0x80) : 0x80;
|
|
1343
|
+
const hi = k === 1 ? (lead === 0xed ? 0x9f : lead === 0xf4 ? 0x8f : 0xbf) : 0xbf;
|
|
1344
|
+
if (c === undefined || c < lo || c > hi)
|
|
1345
|
+
return false;
|
|
1346
|
+
}
|
|
1347
|
+
i += need + 1;
|
|
1348
|
+
}
|
|
1349
|
+
return true;
|
|
1350
|
+
}
|
|
1351
|
+
function utf8TailLength(lead) {
|
|
1352
|
+
if (lead >= 0xc2 && lead <= 0xdf)
|
|
1353
|
+
return 1;
|
|
1354
|
+
if (lead >= 0xe0 && lead <= 0xef)
|
|
1355
|
+
return 2;
|
|
1356
|
+
if (lead >= 0xf0 && lead <= 0xf4)
|
|
1357
|
+
return 3;
|
|
1358
|
+
return 0;
|
|
1359
|
+
}
|
|
1360
|
+
function percentBoundaryDecode(text) {
|
|
1361
|
+
if (!hasNonAsciiPercentEscape(text))
|
|
1362
|
+
return null;
|
|
1363
|
+
const chars = [];
|
|
1364
|
+
const from = [];
|
|
1365
|
+
const to = [];
|
|
1366
|
+
const escapeAt = (k) => text.charCodeAt(k) === 0x25 && isHexDigit(text.charAt(k + 1)) && isHexDigit(text.charAt(k + 2));
|
|
1367
|
+
let i = 0;
|
|
1368
|
+
while (i < text.length) {
|
|
1369
|
+
if (!escapeAt(i)) {
|
|
1370
|
+
chars.push(text.charAt(i));
|
|
1371
|
+
from.push(i);
|
|
1372
|
+
to.push(i + 1);
|
|
1373
|
+
i += 1;
|
|
1374
|
+
continue;
|
|
1375
|
+
}
|
|
1376
|
+
const bytes = [];
|
|
1377
|
+
let j = i;
|
|
1378
|
+
while (escapeAt(j)) {
|
|
1379
|
+
bytes.push(Number.parseInt(text.slice(j + 1, j + 3), 16));
|
|
1380
|
+
j += 3;
|
|
1381
|
+
}
|
|
1382
|
+
if (isWellFormedUtf8(bytes)) {
|
|
1383
|
+
for (let k = 0; k < bytes.length;) {
|
|
1384
|
+
const lead = bytes[k] ?? 0;
|
|
1385
|
+
const len = lead < 0x80 ? 1 : utf8TailLength(lead) + 1;
|
|
1386
|
+
let cp = len === 1 ? lead : lead & (0xff >> (len + 1));
|
|
1387
|
+
for (let t = 1; t < len; t++)
|
|
1388
|
+
cp = (cp << 6) | ((bytes[k + t] ?? 0) & 0x3f);
|
|
1389
|
+
const ch = String.fromCodePoint(cp);
|
|
1390
|
+
for (let u = 0; u < ch.length; u++) {
|
|
1391
|
+
chars.push(ch.charAt(u));
|
|
1392
|
+
from.push(i + k * 3);
|
|
1393
|
+
to.push(i + (k + len) * 3);
|
|
1394
|
+
}
|
|
1395
|
+
k += len;
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1398
|
+
else {
|
|
1399
|
+
for (let k = 0; k < bytes.length; k++) {
|
|
1400
|
+
const b = bytes[k] ?? 0;
|
|
1401
|
+
chars.push(b < 0x80 ? String.fromCharCode(b) : ' ');
|
|
1402
|
+
from.push(i + k * 3);
|
|
1403
|
+
to.push(i + k * 3 + 3);
|
|
1404
|
+
}
|
|
1405
|
+
}
|
|
1406
|
+
i = j;
|
|
1407
|
+
}
|
|
1408
|
+
return { decoded: chars.join(''), from, to };
|
|
1409
|
+
}
|
|
1324
1410
|
const MAX_PERCENT_VIEW_LAYERS = 3;
|
|
1325
1411
|
function percentLayers(text) {
|
|
1326
1412
|
const out = [];
|
|
1327
|
-
if (!PERCENT_ESCAPE_ASCII.test(text))
|
|
1413
|
+
if (!PERCENT_ESCAPE_ASCII.test(text) && !hasNonAsciiPercentEscape(text))
|
|
1328
1414
|
return out;
|
|
1329
1415
|
let cur = text;
|
|
1330
1416
|
let ps = null;
|
|
@@ -1347,6 +1433,22 @@ function percentLayers(text) {
|
|
|
1347
1433
|
ps = nps;
|
|
1348
1434
|
pe = npe;
|
|
1349
1435
|
}
|
|
1436
|
+
const bases = [[text, null, null], ...out.map((l) => [l.text, l.ps, l.pe])];
|
|
1437
|
+
for (const [base, bps, bpe] of bases) {
|
|
1438
|
+
const wide = percentBoundaryDecode(base);
|
|
1439
|
+
if (wide === null)
|
|
1440
|
+
continue;
|
|
1441
|
+
const n = wide.decoded.length;
|
|
1442
|
+
const nps = new Int32Array(n);
|
|
1443
|
+
const npe = new Int32Array(n);
|
|
1444
|
+
for (let k = 0; k < n; k++) {
|
|
1445
|
+
const a = wide.from[k] ?? 0;
|
|
1446
|
+
const b = wide.to[k] ?? base.length;
|
|
1447
|
+
nps[k] = bps === null ? a : (bps[a] ?? 0);
|
|
1448
|
+
npe[k] = bpe === null ? b : (bpe[b - 1] ?? 0);
|
|
1449
|
+
}
|
|
1450
|
+
out.push({ text: wide.decoded, ps: nps, pe: npe });
|
|
1451
|
+
}
|
|
1350
1452
|
return out;
|
|
1351
1453
|
}
|
|
1352
1454
|
function firstLabelCutInPath(path, outer = false) {
|
|
@@ -3312,7 +3414,7 @@ function proseLiteralEdits(text) {
|
|
|
3312
3414
|
let end = i;
|
|
3313
3415
|
while (end < text.length && isKeyWordChar(text.charCodeAt(end)))
|
|
3314
3416
|
end++;
|
|
3315
|
-
const escHead = i > 0 && text.charCodeAt(i - 1) === 0x25 && PERCENT_ESCAPE_ASCII.test(text.slice(i - 1, i + 2)) && i + 2 < end ? 2 : 0;
|
|
3417
|
+
const escHead = i > 0 && text.charCodeAt(i - 1) === 0x25 && (PERCENT_ESCAPE_ASCII.test(text.slice(i - 1, i + 2)) || hasNonAsciiPercentEscape(text.slice(i - 1, i + 2))) && i + 2 < end ? 2 : 0;
|
|
3316
3418
|
const word = text.slice(i, end);
|
|
3317
3419
|
if (word.startsWith('eyJ')) {
|
|
3318
3420
|
let segEnd = end;
|
|
@@ -4134,11 +4236,19 @@ function collectCandidates(text, o, nested) {
|
|
|
4134
4236
|
for (const S of surfaces) {
|
|
4135
4237
|
const cands = [];
|
|
4136
4238
|
const regions = [];
|
|
4239
|
+
const unitPos = (k) => S.dropped(k) || V.rawUnit[S.rawStart(k)] === 1;
|
|
4137
4240
|
if (o.urls) {
|
|
4138
|
-
const unitPos = (k) => S.dropped(k) || V.rawUnit[S.rawStart(k)] === 1;
|
|
4139
4241
|
urlCandidates(S.text, cands, regions, unitPos, (k) => unitPos(k) || S.painted(k), o.queryByShape ?? false, o.wholeAddress === true, o.wholeAddress === true && S.decoded !== true);
|
|
4140
4242
|
userinfoCandidates(S, cands, o.words);
|
|
4141
4243
|
}
|
|
4244
|
+
else if (o.words && o.wholeAddress === true) {
|
|
4245
|
+
const scratch = [];
|
|
4246
|
+
const hostOnly = [];
|
|
4247
|
+
urlCandidates(S.text, scratch, hostOnly, unitPos, (k) => unitPos(k) || S.painted(k), false, true, S.decoded !== true);
|
|
4248
|
+
for (const r of hostOnly)
|
|
4249
|
+
if (r[2] === 'host')
|
|
4250
|
+
regions.push(r);
|
|
4251
|
+
}
|
|
4142
4252
|
if (o.words) {
|
|
4143
4253
|
editsToCandidates(pemEdits(S, (blk) => { if (S === regionSurface)
|
|
4144
4254
|
pemBlocksSeen.push(pemBlockToRaw(S, blk)); }), 'pem', cands);
|
|
@@ -4778,7 +4888,42 @@ function isHighEntropyQueryValue(value) {
|
|
|
4778
4888
|
}
|
|
4779
4889
|
function isOpaqueSecretValue(value) {
|
|
4780
4890
|
const core = valueCoreForJudging(value);
|
|
4781
|
-
|
|
4891
|
+
if (core.length === 0)
|
|
4892
|
+
return false;
|
|
4893
|
+
if (looksLikeKnownSecret(core) || isHighEntropyQueryValue(core))
|
|
4894
|
+
return true;
|
|
4895
|
+
if (hasNonAsciiPercentEscape(core)) {
|
|
4896
|
+
for (const chunk of percentByteChunks(core))
|
|
4897
|
+
if (chunk.length > 0 && isHighEntropyQueryValue(chunk))
|
|
4898
|
+
return true;
|
|
4899
|
+
}
|
|
4900
|
+
return false;
|
|
4901
|
+
}
|
|
4902
|
+
function percentByteChunks(text) {
|
|
4903
|
+
const escapeAt = (k) => text.charCodeAt(k) === 0x25 && isHexDigit(text.charAt(k + 1)) && isHexDigit(text.charAt(k + 2));
|
|
4904
|
+
const chunks = [];
|
|
4905
|
+
let start = 0;
|
|
4906
|
+
let i = 0;
|
|
4907
|
+
while (i < text.length) {
|
|
4908
|
+
if (!escapeAt(i)) {
|
|
4909
|
+
i += 1;
|
|
4910
|
+
continue;
|
|
4911
|
+
}
|
|
4912
|
+
let j = i;
|
|
4913
|
+
let wide = false;
|
|
4914
|
+
while (escapeAt(j)) {
|
|
4915
|
+
if (text.charCodeAt(j + 1) >= 0x38)
|
|
4916
|
+
wide = true;
|
|
4917
|
+
j += 3;
|
|
4918
|
+
}
|
|
4919
|
+
if (wide) {
|
|
4920
|
+
chunks.push(text.slice(start, i));
|
|
4921
|
+
start = j;
|
|
4922
|
+
}
|
|
4923
|
+
i = j;
|
|
4924
|
+
}
|
|
4925
|
+
chunks.push(text.slice(start));
|
|
4926
|
+
return chunks;
|
|
4782
4927
|
}
|
|
4783
4928
|
const VALUE_PIECE_SEPARATORS = new Set(['/', '\\', '?', '#', '&', '=', ';', ':', '@', ',', '+']);
|
|
4784
4929
|
function hasOpaquePiece(text) {
|
|
@@ -2,6 +2,10 @@ import { isNewEngineAgentPanelCycle, isStaleEngineAgentPanelEnd, MAX_HELD_WIRE_T
|
|
|
2
2
|
import type { EngineAgentPanelCycleIdentity } from './cycleOrder.js';
|
|
3
3
|
export { isNewEngineAgentPanelCycle, isStaleEngineAgentPanelEnd, MAX_HELD_WIRE_TICK_BEATS };
|
|
4
4
|
export type { EngineAgentPanelCycleIdentity, EnginePanelTaskIdentity };
|
|
5
|
+
type PanelFinalityFlags = {
|
|
6
|
+
totalTokens?: true;
|
|
7
|
+
toolUses?: true;
|
|
8
|
+
};
|
|
5
9
|
export type EngineAgentPanelEvent = {
|
|
6
10
|
kind: 'tick';
|
|
7
11
|
taskId: string;
|
|
@@ -16,6 +20,8 @@ export type EngineAgentPanelEvent = {
|
|
|
16
20
|
cardBound?: true;
|
|
17
21
|
wireTaskId?: string;
|
|
18
22
|
taskIdOrigin?: 'fleet-row' | 'wire';
|
|
23
|
+
cycleSeq?: number;
|
|
24
|
+
final?: PanelFinalityFlags;
|
|
19
25
|
} | {
|
|
20
26
|
kind: 'fleet-row';
|
|
21
27
|
taskId: string;
|
|
@@ -33,10 +39,7 @@ export type EngineAgentPanelEvent = {
|
|
|
33
39
|
parentToolCallId?: string;
|
|
34
40
|
wireTaskId?: string;
|
|
35
41
|
taskIdOrigin?: 'wire';
|
|
36
|
-
final?:
|
|
37
|
-
totalTokens?: true;
|
|
38
|
-
toolUses?: true;
|
|
39
|
-
};
|
|
42
|
+
final?: PanelFinalityFlags;
|
|
40
43
|
} | {
|
|
41
44
|
kind: 'end';
|
|
42
45
|
taskId: string;
|
|
@@ -16,8 +16,9 @@ export declare const CONFIG_MEMORY_PROJECT_KEY_SPELLING = "config.memory_project
|
|
|
16
16
|
export declare const CONFIG_MEMORY_WRITE_SCOPE_MISMATCH = "config.memory_write_scope_mismatch";
|
|
17
17
|
export declare const CONFIG_LEGACY_TOOL_NAME = "config.legacy_tool_name";
|
|
18
18
|
export declare const CONFIG_IMAGE_INVALID = "config.image_invalid";
|
|
19
|
-
export declare function imageInvalidFailureNoteOf(code: string | undefined): string | undefined;
|
|
20
19
|
export declare const CONFIG_AGENT_UNKNOWN_TOOL = "config.agent.unknown_tool";
|
|
20
|
+
export declare const CONFIG_TOOL_FACE_CONTROL = "config.tool_face_control";
|
|
21
|
+
export declare const PROMPT_ASSEMBLED_ROLE_REFUSED = "prompt.assembled_role_refused";
|
|
21
22
|
export declare const CONFIG_OUTPUT_STYLE_INVALID = "config.output_style_invalid";
|
|
22
23
|
export declare const RULES_INERT_ENTRY = "rules.inert_entry";
|
|
23
24
|
export declare const RULES_INVALID_SHAPE = "rules.invalid_shape";
|
|
@@ -35,6 +36,9 @@ export declare const TOOL_END_INTERRUPTED_OUTCOME_UNKNOWN = "interrupted_outcome
|
|
|
35
36
|
export declare function isInterruptedToolEndCode(code: string | undefined): boolean;
|
|
36
37
|
export declare const CAPABILITY_SELF_ORCHESTRATION_REQUIRED = "capability.self_orchestration_required";
|
|
37
38
|
export declare const CAPABILITY_IMAGE_INDEX_REQUIRED = "capability.image_index_required";
|
|
39
|
+
export declare const CAPABILITY_K8S_LANE_REQUIRED = "capability.k8s_lane_required";
|
|
40
|
+
export declare const NOT_FOUND_IMAGE = "not_found.image";
|
|
41
|
+
export declare const REQUEST_PRECONDITION_UNMET = "request.precondition_unmet";
|
|
38
42
|
export declare const GATE_PARKED_ERROR_CODE = "gate.parked";
|
|
39
43
|
export declare const ACTIVE_RUN_BUSY_ERROR_CODE = "conflict.session_active_run";
|
|
40
44
|
export declare const CONFLICT_IDEMPOTENCY_PAYLOAD_MISMATCH = "conflict.idempotency_payload_mismatch";
|
|
@@ -110,6 +114,10 @@ export declare const DECIDE_ALREADY_RESOLVED_CODES: readonly string[];
|
|
|
110
114
|
export declare function isDecideAlreadyResolvedCode(code: string | null | undefined): boolean;
|
|
111
115
|
export declare const ASK_GONE = "gone.ask";
|
|
112
116
|
export declare const ASK_GONE_PARKED = "gone.ask_parked";
|
|
117
|
+
export declare const ASK_NOT_FOUND = "not_found.ask";
|
|
118
|
+
export declare const ASK_IDEMPOTENCY_CONFLICT = "conflict.ask_idempotency";
|
|
119
|
+
export declare const ASK_PARKING_RETRY = "parking.ask_retry";
|
|
120
|
+
export declare const ASK_DECISION_LANE_DISABLED = "feature.approval_ask_disabled";
|
|
113
121
|
export declare const ASK_GONE_DENIED_WORD: "routing_failure_fail_closed";
|
|
114
122
|
export declare const RUN_DEATH_VERDICT_CODES: readonly ["run.stalled", "run.orphaned", "approval.expired"];
|
|
115
123
|
export type { RunDeathVerdictCode };
|
package/dist/engineErrorCodes.js
CHANGED
|
@@ -21,12 +21,9 @@ export const CONFIG_MEMORY_PROJECT_KEY_SPELLING = 'config.memory_project_key_spe
|
|
|
21
21
|
export const CONFIG_MEMORY_WRITE_SCOPE_MISMATCH = 'config.memory_write_scope_mismatch';
|
|
22
22
|
export const CONFIG_LEGACY_TOOL_NAME = 'config.legacy_tool_name';
|
|
23
23
|
export const CONFIG_IMAGE_INVALID = 'config.image_invalid';
|
|
24
|
-
const IMAGE_INVALID_FAILURE_NOTE = 'This run did not start: an image sent with the message was refused before the model was called — the engine’s own error text says which image and what is wrong with it. ' +
|
|
25
|
-
'Nothing was sent to the model; remove or replace that image, then send the message again.';
|
|
26
|
-
export function imageInvalidFailureNoteOf(code) {
|
|
27
|
-
return code === CONFIG_IMAGE_INVALID ? IMAGE_INVALID_FAILURE_NOTE : undefined;
|
|
28
|
-
}
|
|
29
24
|
export const CONFIG_AGENT_UNKNOWN_TOOL = 'config.agent.unknown_tool';
|
|
25
|
+
export const CONFIG_TOOL_FACE_CONTROL = 'config.tool_face_control';
|
|
26
|
+
export const PROMPT_ASSEMBLED_ROLE_REFUSED = 'prompt.assembled_role_refused';
|
|
30
27
|
export const CONFIG_OUTPUT_STYLE_INVALID = 'config.output_style_invalid';
|
|
31
28
|
export const RULES_INERT_ENTRY = 'rules.inert_entry';
|
|
32
29
|
export const RULES_INVALID_SHAPE = 'rules.invalid_shape';
|
|
@@ -65,6 +62,9 @@ export function isInterruptedToolEndCode(code) {
|
|
|
65
62
|
}
|
|
66
63
|
export const CAPABILITY_SELF_ORCHESTRATION_REQUIRED = 'capability.self_orchestration_required';
|
|
67
64
|
export const CAPABILITY_IMAGE_INDEX_REQUIRED = 'capability.image_index_required';
|
|
65
|
+
export const CAPABILITY_K8S_LANE_REQUIRED = 'capability.k8s_lane_required';
|
|
66
|
+
export const NOT_FOUND_IMAGE = 'not_found.image';
|
|
67
|
+
export const REQUEST_PRECONDITION_UNMET = 'request.precondition_unmet';
|
|
68
68
|
export const GATE_PARKED_ERROR_CODE = 'gate.parked';
|
|
69
69
|
export const ACTIVE_RUN_BUSY_ERROR_CODE = 'conflict.session_active_run';
|
|
70
70
|
export const CONFLICT_IDEMPOTENCY_PAYLOAD_MISMATCH = 'conflict.idempotency_payload_mismatch';
|
|
@@ -208,6 +208,10 @@ export function isDecideAlreadyResolvedCode(code) {
|
|
|
208
208
|
}
|
|
209
209
|
export const ASK_GONE = 'gone.ask';
|
|
210
210
|
export const ASK_GONE_PARKED = 'gone.ask_parked';
|
|
211
|
+
export const ASK_NOT_FOUND = 'not_found.ask';
|
|
212
|
+
export const ASK_IDEMPOTENCY_CONFLICT = 'conflict.ask_idempotency';
|
|
213
|
+
export const ASK_PARKING_RETRY = 'parking.ask_retry';
|
|
214
|
+
export const ASK_DECISION_LANE_DISABLED = 'feature.approval_ask_disabled';
|
|
211
215
|
export const ASK_GONE_DENIED_WORD = SDK_DENY_REASON_ROUTING_FAILURE;
|
|
212
216
|
export const RUN_DEATH_VERDICT_CODES = SDK_RUN_DEATH_VERDICT_CODES;
|
|
213
217
|
const _runDeathVerdictCodePin = true;
|
package/dist/engineRowRef.js
CHANGED
|
@@ -96,6 +96,7 @@ export const TRANSCRIPT_ROW_SIDECAR_KEYS = Object.freeze([
|
|
|
96
96
|
'_sema_api_error_status',
|
|
97
97
|
'_sema_api_error_code',
|
|
98
98
|
'_sema_provider_condition',
|
|
99
|
+
'_sema_terminal_owner',
|
|
99
100
|
]);
|
|
100
101
|
export function parkHeldCallIdOf(carrier) {
|
|
101
102
|
return readFrameStringKey(carrier, 'toolCallId');
|
|
@@ -10,6 +10,9 @@ export type EngineToolDirectory = {
|
|
|
10
10
|
readonly state: 'not_landed';
|
|
11
11
|
} | {
|
|
12
12
|
readonly state: 'unreadable';
|
|
13
|
+
} | {
|
|
14
|
+
readonly state: 'request_only';
|
|
15
|
+
readonly requestMcpServerPrefixes: ReadonlySet<string>;
|
|
13
16
|
} | {
|
|
14
17
|
readonly state: 'directory';
|
|
15
18
|
readonly mcpServerPrefixes: ReadonlySet<string>;
|
|
@@ -35,18 +35,20 @@ export function engineToolDirectoryOf(source) {
|
|
|
35
35
|
const deployment = readHalf(ownDataField(source, 'deploymentMcpServers'));
|
|
36
36
|
if (request === 'unreadable' || deployment === 'unreadable')
|
|
37
37
|
return unreadable();
|
|
38
|
-
if (request === 'absent'
|
|
38
|
+
if (request === 'absent')
|
|
39
39
|
return notLanded();
|
|
40
40
|
const ns = namingPorts();
|
|
41
41
|
if (ns === undefined)
|
|
42
42
|
return unreadable();
|
|
43
43
|
const prefixes = [];
|
|
44
|
-
for (const name of [...request, ...deployment]) {
|
|
44
|
+
for (const name of deployment === 'absent' ? request : [...request, ...deployment]) {
|
|
45
45
|
const prefix = mintNamespacePrefix(ns, name);
|
|
46
46
|
if (typeof prefix !== 'string' || prefix.length === 0)
|
|
47
47
|
return unreadable();
|
|
48
48
|
prefixes.push(prefix);
|
|
49
49
|
}
|
|
50
|
+
if (deployment === 'absent')
|
|
51
|
+
return Object.freeze({ state: 'request_only', requestMcpServerPrefixes: frozenSet(prefixes) });
|
|
50
52
|
return Object.freeze({ state: 'directory', mcpServerPrefixes: frozenSet(prefixes) });
|
|
51
53
|
}
|
|
52
54
|
catch {
|
package/dist/eventLeg.d.ts
CHANGED
|
@@ -65,11 +65,6 @@ export interface EventLegIdleTriagePorts {
|
|
|
65
65
|
readonly baseUrl: string;
|
|
66
66
|
}
|
|
67
67
|
export type EventLegTap = (frame: AgentEvent) => void;
|
|
68
|
-
export type EventLegStreamDecorator = (stream: AsyncGenerator<AgentEvent>, ctx: EventLegStreamContext) => AsyncGenerator<AgentEvent>;
|
|
69
|
-
export interface EventLegStreamContext {
|
|
70
|
-
readonly leg: EventLegKind;
|
|
71
|
-
readonly runId: string | undefined;
|
|
72
|
-
}
|
|
73
68
|
export interface ApprovalFrameContext {
|
|
74
69
|
readonly leg: EventLegKind;
|
|
75
70
|
readonly windowIsCurrent: boolean;
|
|
@@ -85,9 +80,8 @@ export interface EventLegPorts {
|
|
|
85
80
|
readonly idleTriage?: EventLegIdleTriagePorts;
|
|
86
81
|
readonly signal?: AbortSignal;
|
|
87
82
|
readonly taps?: readonly EventLegTap[];
|
|
88
|
-
readonly perStream?: readonly EventLegStreamDecorator[];
|
|
89
83
|
}
|
|
90
|
-
export type EventLegPortName = 'run.headerRunId' | 'run.onBound' | 'run.onRefused' | 'run.onTerminal' | 'run.isCurrent' | 'hitl.question' | 'hitl.elicitation' | 'hitl.toolApproval' | 'askBridge.respondToolApproval' | 'taps'
|
|
84
|
+
export type EventLegPortName = 'run.headerRunId' | 'run.onBound' | 'run.onRefused' | 'run.onTerminal' | 'run.isCurrent' | 'hitl.question' | 'hitl.elicitation' | 'hitl.toolApproval' | 'askBridge.respondToolApproval' | 'taps';
|
|
91
85
|
export interface EventLegReport {
|
|
92
86
|
readonly missingPorts: readonly EventLegPortName[];
|
|
93
87
|
readonly portFaults: Readonly<Partial<Record<EventLegPortName, number>>>;
|
package/dist/eventLeg.js
CHANGED
|
@@ -22,6 +22,12 @@ const FRAME_STAGE_DOMAINS = makeFrameStageDomains({
|
|
|
22
22
|
stampOwner: Object.freeze(['task_progress']),
|
|
23
23
|
hitlFrames: Object.freeze(['question', 'question_complete', 'elicitation', 'elicitation_complete', 'tool_approval', 'tool_approval_complete', 'approval_request', 'approval_revoke']),
|
|
24
24
|
});
|
|
25
|
+
const HITL_FRAMES_PROJECTED = Object.freeze(['human_input']);
|
|
26
|
+
const _hitlFrameTypesPin = [true, true];
|
|
27
|
+
const _hitlProjectedDisjointPin = true;
|
|
28
|
+
void _hitlFrameTypesPin;
|
|
29
|
+
void _hitlProjectedDisjointPin;
|
|
30
|
+
void HITL_FRAMES_PROJECTED;
|
|
25
31
|
const HITL_PORT_OF = Object.freeze({
|
|
26
32
|
question: 'question',
|
|
27
33
|
question_complete: 'question',
|
|
@@ -130,7 +136,6 @@ export function composeEventLeg(source, leg, ports) {
|
|
|
130
136
|
};
|
|
131
137
|
const sessionKey = typeof ports.owner?.sessionKey === 'string' && ports.owner.sessionKey !== '' ? ports.owner.sessionKey : undefined;
|
|
132
138
|
const taps = (ports.taps ?? []).filter((t) => typeof t === 'function');
|
|
133
|
-
const decorators = (ports.perStream ?? []).filter((d) => typeof d === 'function');
|
|
134
139
|
const info = Object.freeze({ leg: kind });
|
|
135
140
|
const runSessions = new Map();
|
|
136
141
|
let lastBound;
|
|
@@ -218,13 +223,7 @@ export function composeEventLeg(source, leg, ports) {
|
|
|
218
223
|
ended.abort();
|
|
219
224
|
}
|
|
220
225
|
}
|
|
221
|
-
const streamOf = (raw, streamKind, streamRunId) =>
|
|
222
|
-
let s = generatorOf(raw);
|
|
223
|
-
const ctx = Object.freeze({ leg: streamKind, runId: streamRunId });
|
|
224
|
-
for (const d of decorators)
|
|
225
|
-
s = d(s, ctx);
|
|
226
|
-
return frameLevel(s, streamKind, streamRunId);
|
|
227
|
-
};
|
|
226
|
+
const streamOf = (raw, streamKind, streamRunId) => frameLevel(generatorOf(raw), streamKind, streamRunId);
|
|
228
227
|
let inner = streamOf(source, kind, legRunId);
|
|
229
228
|
if (hostBridge !== undefined) {
|
|
230
229
|
let windowOpen = row.windowIsCurrent;
|
|
@@ -13,9 +13,6 @@ export type FileHistoryCaptureMode = 'off' | 'on-optional' | 'unknown';
|
|
|
13
13
|
export declare function projectFileHistoryCaptureCapability(caps: unknown): FileHistoryCaptureReading | undefined;
|
|
14
14
|
export declare function observedFileHistoryCapture(baseUrl?: string | undefined): FileHistoryCaptureReading;
|
|
15
15
|
export declare function fileHistoryCaptureMode(reading: FileHistoryCaptureReading): FileHistoryCaptureMode;
|
|
16
|
-
export declare function fileHistoryDeclarationField(reading: FileHistoryCaptureReading, captureOff: boolean): {
|
|
17
|
-
fileHistory: 'disabled';
|
|
18
|
-
} | Record<string, never>;
|
|
19
16
|
export declare const FILE_HISTORY_TIGHTEN_VERDICTS: readonly ["not_requested", "declare", "already_off", "unjudged"];
|
|
20
17
|
export type FileHistoryTightenVerdict = (typeof FILE_HISTORY_TIGHTEN_VERDICTS)[number];
|
|
21
18
|
export declare function fileHistoryTightenVerdict(reading: FileHistoryCaptureReading, captureOffByUser: boolean): FileHistoryTightenVerdict;
|
|
@@ -4,7 +4,6 @@ import { engineWireTarget } from './engineWireTarget.js';
|
|
|
4
4
|
import { createEngineCapReader, unreadableReadingDetail } from './engineCapReader.js';
|
|
5
5
|
import { refreshEngineCapsOnce } from './engineCapsCache.js';
|
|
6
6
|
import { ownDataField } from './ownKey.js';
|
|
7
|
-
import { FILE_HISTORY_DISABLED } from './request/taskRequest.js';
|
|
8
7
|
export function projectFileHistoryCaptureCapability(caps) {
|
|
9
8
|
try {
|
|
10
9
|
if (caps === null || typeof caps !== 'object' || Array.isArray(caps))
|
|
@@ -47,9 +46,6 @@ export function fileHistoryCaptureMode(reading) {
|
|
|
47
46
|
return 'on-optional';
|
|
48
47
|
return 'unknown';
|
|
49
48
|
}
|
|
50
|
-
export function fileHistoryDeclarationField(reading, captureOff) {
|
|
51
|
-
return captureOff === true && fileHistoryCaptureMode(reading) === 'on-optional' ? { fileHistory: FILE_HISTORY_DISABLED } : {};
|
|
52
|
-
}
|
|
53
49
|
export const FILE_HISTORY_TIGHTEN_VERDICTS = Object.freeze(['not_requested', 'declare', 'already_off', 'unjudged']);
|
|
54
50
|
export function fileHistoryTightenVerdict(reading, captureOffByUser) {
|
|
55
51
|
if (captureOffByUser !== true)
|