@sema-agent/client-core 0.90.0 → 0.92.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 +365 -0
- package/README.md +48 -32
- package/dist/adapt/arms.js +13 -12
- package/dist/adapt/panelTasks.d.ts +0 -2
- package/dist/adapt/panelTasks.js +6 -26
- package/dist/adapt.js +2 -2
- package/dist/adapter/activeRunSelfHeal.d.ts +0 -2
- package/dist/adapter/activeRunSelfHeal.js +5 -27
- package/dist/adapter/downstream/eventToSdkMessage.js +4 -2
- package/dist/adapter/downstream/terminalToSdkResult.js +16 -7
- package/dist/adapter/downstream/wiringManifestView.d.ts +6 -0
- package/dist/adapter/downstream/wiringManifestView.js +16 -0
- package/dist/adapter/runStream.js +39 -20
- package/dist/askSurvivesStandingAnswer.d.ts +13 -0
- package/dist/askSurvivesStandingAnswer.js +53 -0
- package/dist/attachmentSeatCapability.d.ts +11 -0
- package/dist/attachmentSeatCapability.js +27 -0
- package/dist/attachmentsWireCaps.d.ts +9 -0
- package/dist/attachmentsWireCaps.js +74 -21
- package/dist/autoModeUnavailable.js +3 -2
- package/dist/cloudConfigWireCaps.js +5 -4
- package/dist/compensations.js +13 -17
- package/dist/controlRouter.d.ts +32 -25
- package/dist/controlRouter.js +166 -63
- package/dist/coreValuePorts.d.ts +4 -2
- package/dist/coreValuePorts.js +5 -0
- package/dist/decideFailureNote.js +7 -3
- package/dist/decideReceipt.d.ts +9 -0
- package/dist/decideReceipt.js +62 -1
- package/dist/disableSkillsWire.d.ts +1 -0
- package/dist/disableSkillsWire.js +8 -1
- package/dist/displayUntrusted.js +155 -5
- package/dist/effectiveFacts.d.ts +14 -4
- package/dist/effectiveFacts.js +45 -5
- package/dist/engineAgentAbsence.js +2 -1
- package/dist/engineCapReader.js +16 -10
- package/dist/engineCapsCache.d.ts +5 -1
- package/dist/engineCapsCache.js +69 -8
- package/dist/engineClosedSets.d.ts +2 -0
- package/dist/engineClosedSets.js +3 -0
- package/dist/engineErrorCodes.d.ts +17 -0
- package/dist/engineErrorCodes.js +47 -0
- package/dist/engineNoticeCodes.d.ts +14 -0
- package/dist/engineNoticeCodes.js +71 -0
- package/dist/executionLaneCapability.js +2 -0
- package/dist/gateOutcome.js +2 -17
- package/dist/gateVocabulary.d.ts +2 -4
- package/dist/gateVocabulary.js +3 -11
- package/dist/generated/engineFactTables.d.ts +27 -0
- package/dist/generated/engineFactTables.js +128 -0
- package/dist/generated/engineNoticeTables.js +3 -0
- package/dist/generated/settingsSchemaTables.d.ts +8 -0
- package/dist/generated/settingsSchemaTables.js +40 -0
- package/dist/hitl/allowRuleShadow.d.ts +21 -0
- package/dist/hitl/allowRuleShadow.js +167 -0
- package/dist/hitl/askClassPair.d.ts +14 -0
- package/dist/hitl/askClassPair.js +42 -0
- package/dist/hitl/askGateWire.d.ts +1 -1
- package/dist/hitl/askGateWire.js +2 -1
- package/dist/hitl/askSurvivesPosture.d.ts +5 -0
- package/dist/hitl/askSurvivesPosture.js +17 -0
- package/dist/hitl/automaticAnswerVerdict.d.ts +21 -0
- package/dist/hitl/automaticAnswerVerdict.js +143 -0
- package/dist/hitl/crashConverged.d.ts +8 -0
- package/dist/hitl/crashConverged.js +58 -1
- package/dist/hitl/crashConvergedNotice.d.ts +4 -0
- package/dist/hitl/crashConvergedNotice.js +57 -0
- package/dist/hitl/frameRouter.d.ts +2 -0
- package/dist/hitl/frameRouter.js +66 -14
- package/dist/hitl/gateLedger.d.ts +6 -0
- package/dist/hitl/gateLedger.js +34 -5
- package/dist/hitl/hitlBridge.d.ts +7 -4
- package/dist/hitl/hitlHostSurface.d.ts +2 -0
- package/dist/hitl/hitlHostSurface.js +7 -0
- package/dist/hitl/livePendingAsk.js +24 -5
- package/dist/hitl/parkResolver.d.ts +7 -2
- package/dist/hitl/parkResolver.js +21 -7
- package/dist/hitl/persistedRulesWire.d.ts +4 -1
- package/dist/hitl/persistedRulesWire.js +9 -2
- package/dist/hitl/planReviewWire.d.ts +1 -1
- package/dist/hitl/planReviewWire.js +19 -5
- package/dist/hitl/replayedApproval.d.ts +21 -0
- package/dist/hitl/replayedApproval.js +89 -0
- package/dist/hitl/sessionPolicyDeliverable.js +20 -2
- package/dist/hitl/sessionPolicyWire.d.ts +13 -0
- package/dist/hitl/sessionPolicyWire.js +75 -2
- package/dist/hitl/suspendedReopen.js +2 -2
- package/dist/hitl/toolApprovalWire.d.ts +9 -1
- package/dist/hitl/toolApprovalWire.js +40 -40
- package/dist/hookMatcherVerdict.d.ts +29 -0
- package/dist/hookMatcherVerdict.js +266 -0
- package/dist/humanTurn.d.ts +91 -0
- package/dist/humanTurn.js +252 -0
- package/dist/humanTurnRead.d.ts +105 -0
- package/dist/humanTurnRead.js +331 -0
- package/dist/index.d.ts +38 -11
- package/dist/index.js +27 -8
- package/dist/inheritEnvWire.js +4 -5
- package/dist/liveModelCatalog.d.ts +2 -0
- package/dist/liveModelCatalog.js +51 -3
- package/dist/mcpLiveness.js +2 -1
- package/dist/memoryVerbsWire.d.ts +1 -1
- package/dist/memoryVerbsWire.js +3 -0
- package/dist/model/catalog.js +2 -1
- package/dist/model/providerPresets.d.ts +3 -1
- package/dist/model/tierVocabulary.d.ts +2 -1
- package/dist/model/tierVocabulary.js +3 -8
- package/dist/peerFrames.js +2 -2
- package/dist/permissionRuleIssue.d.ts +1 -1
- package/dist/permissionRuleIssue.js +31 -9
- package/dist/permissionsAllowGrantCapability.d.ts +2 -1
- package/dist/permissionsAllowGrantCapability.js +11 -2
- package/dist/permissionsDeclaration.d.ts +29 -0
- package/dist/permissionsDeclaration.js +155 -66
- package/dist/pluginHooksWire.js +2 -11
- package/dist/promptDelivery.d.ts +11 -3
- package/dist/promptDelivery.js +164 -29
- package/dist/promptProfileWireCaps.d.ts +2 -1
- package/dist/protocolSegment.d.ts +9 -0
- package/dist/protocolSegment.js +28 -0
- package/dist/providerRejection.d.ts +1 -0
- package/dist/providerRejection.js +20 -0
- package/dist/readDenyTiers.d.ts +10 -0
- package/dist/readDenyTiers.js +29 -0
- package/dist/request/taskRequest.js +3 -17
- package/dist/resumeRefusalCopy.d.ts +11 -0
- package/dist/resumeRefusalCopy.js +61 -4
- package/dist/rewindArchiveCapability.js +4 -4
- package/dist/rewindWireCaps.d.ts +2 -1
- package/dist/rewindWireCaps.js +19 -2
- package/dist/ruleCompileVerdict.d.ts +2 -0
- package/dist/ruleCompileVerdict.js +13 -0
- package/dist/ruleRemovalConsequence.d.ts +2 -1
- package/dist/runCancelContext.d.ts +12 -0
- package/dist/runCancelContext.js +83 -1
- package/dist/seam.d.ts +2 -0
- package/dist/seam.js +1 -1
- package/dist/seatContract.d.ts +2 -1
- package/dist/sessionMemoryStatus.d.ts +2 -4
- package/dist/sessionSyncFileHistoryCapability.d.ts +18 -0
- package/dist/sessionSyncFileHistoryCapability.js +50 -0
- package/dist/skillToolListsCapability.d.ts +18 -0
- package/dist/skillToolListsCapability.js +50 -0
- package/dist/sqlEngineCapability.js +1 -8
- package/dist/steerPriorityCapability.d.ts +18 -0
- package/dist/steerPriorityCapability.js +80 -0
- package/dist/steerReceipt.d.ts +9 -0
- package/dist/steerReceipt.js +25 -0
- package/dist/subagent/engineSubagentSteer.js +2 -9
- package/dist/supportFloor.js +2 -2
- package/dist/taskRequestWords.d.ts +7 -1
- package/dist/taskRequestWords.js +18 -8
- package/dist/toolHistoryBadTurn.d.ts +1 -0
- package/dist/toolHistoryBadTurn.js +89 -0
- package/dist/toolHistoryMismatch.d.ts +2 -1
- package/dist/toolHistoryMismatch.js +19 -6
- package/dist/toolResult.d.ts +8 -0
- package/dist/toolResult.js +47 -3
- package/dist/types/engineState.d.ts +2 -12
- package/dist/userAttachmentEnvelope.d.ts +61 -0
- package/dist/userAttachmentEnvelope.js +204 -0
- package/dist/userInvokedSkillsCapability.d.ts +18 -0
- package/dist/userInvokedSkillsCapability.js +50 -0
- package/dist/wireFailureShape.d.ts +3 -0
- package/dist/wireFailureShape.js +8 -0
- package/dist/wireRefusalCopy.d.ts +6 -0
- package/dist/wireRefusalCopy.js +26 -3
- package/dist/workflowsJournalCapability.d.ts +18 -0
- package/dist/workflowsJournalCapability.js +50 -0
- package/dist/writeProtectionCapability.d.ts +2 -4
- package/docs/INTEGRATION-CLIENTS.md +1489 -16
- package/package.json +3 -3
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
const descriptorKindsAligned = true;
|
|
2
|
+
void descriptorKindsAligned;
|
|
3
|
+
const MALFORMED = Object.freeze({});
|
|
4
|
+
const bad = () => {
|
|
5
|
+
throw MALFORMED;
|
|
6
|
+
};
|
|
7
|
+
function isPlainObject(x) {
|
|
8
|
+
if (x === null || typeof x !== 'object' || Array.isArray(x))
|
|
9
|
+
return false;
|
|
10
|
+
const p = Object.getPrototypeOf(x);
|
|
11
|
+
return p === Object.prototype || p === null;
|
|
12
|
+
}
|
|
13
|
+
function ownData(o, key) {
|
|
14
|
+
const d = Object.getOwnPropertyDescriptor(o, key);
|
|
15
|
+
if (d === undefined)
|
|
16
|
+
return undefined;
|
|
17
|
+
if (!('value' in d))
|
|
18
|
+
bad();
|
|
19
|
+
return d.value;
|
|
20
|
+
}
|
|
21
|
+
function ownArray(x) {
|
|
22
|
+
if (!Array.isArray(x))
|
|
23
|
+
bad();
|
|
24
|
+
const arr = x;
|
|
25
|
+
const n = ownData(arr, 'length');
|
|
26
|
+
if (typeof n !== 'number' || !Number.isSafeInteger(n) || n < 0)
|
|
27
|
+
bad();
|
|
28
|
+
const out = [];
|
|
29
|
+
for (let i = 0; i < n; i += 1) {
|
|
30
|
+
const d = Object.getOwnPropertyDescriptor(arr, i);
|
|
31
|
+
if (d === undefined || !('value' in d))
|
|
32
|
+
bad();
|
|
33
|
+
out.push(d.value);
|
|
34
|
+
}
|
|
35
|
+
return out;
|
|
36
|
+
}
|
|
37
|
+
const str = (v) => (typeof v === 'string' ? v : bad());
|
|
38
|
+
const optStr = (v) => (v === undefined ? undefined : str(v));
|
|
39
|
+
const strArray = (v) => ownArray(v).map(str);
|
|
40
|
+
const sizeOf = (v) => (v === null ? null : typeof v === 'number' ? v : bad());
|
|
41
|
+
const posInt = (v) => (typeof v === 'number' && Number.isSafeInteger(v) && v >= 1 ? v : bad());
|
|
42
|
+
const natInt = (v) => (typeof v === 'number' && Number.isSafeInteger(v) && v >= 0 ? v : bad());
|
|
43
|
+
function sourceOf(v) {
|
|
44
|
+
return v === 'at-mention' || v === 'compact-restore' ? v : bad();
|
|
45
|
+
}
|
|
46
|
+
function readCell(x) {
|
|
47
|
+
if (!isPlainObject(x))
|
|
48
|
+
bad();
|
|
49
|
+
const c = x;
|
|
50
|
+
const outputsRaw = ownData(c, 'outputs');
|
|
51
|
+
const outputs = outputsRaw === undefined
|
|
52
|
+
? []
|
|
53
|
+
: ownArray(outputsRaw).map((o) => {
|
|
54
|
+
if (!isPlainObject(o))
|
|
55
|
+
bad();
|
|
56
|
+
const hasImage = ownData(o, 'hasImage');
|
|
57
|
+
if (hasImage !== undefined && typeof hasImage !== 'boolean')
|
|
58
|
+
bad();
|
|
59
|
+
return { text: optStr(ownData(o, 'text')), hasImage: hasImage === true };
|
|
60
|
+
});
|
|
61
|
+
const tooLarge = ownData(c, 'outputsTooLarge');
|
|
62
|
+
if (tooLarge !== undefined && typeof tooLarge !== 'boolean')
|
|
63
|
+
bad();
|
|
64
|
+
return {
|
|
65
|
+
cellType: optStr(ownData(c, 'cellType')),
|
|
66
|
+
source: optStr(ownData(c, 'source')),
|
|
67
|
+
cellId: optStr(ownData(c, 'cellId')),
|
|
68
|
+
language: optStr(ownData(c, 'language')),
|
|
69
|
+
outputs,
|
|
70
|
+
outputsTooLarge: tooLarge === true,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function readDescriptorAny(x, imageDelivery) {
|
|
74
|
+
try {
|
|
75
|
+
if (!isPlainObject(x))
|
|
76
|
+
return undefined;
|
|
77
|
+
const o = x;
|
|
78
|
+
const kind = ownData(o, 'kind');
|
|
79
|
+
const name = () => str(ownData(o, 'name'));
|
|
80
|
+
const path = () => str(ownData(o, 'path'));
|
|
81
|
+
switch (kind) {
|
|
82
|
+
case 'text': {
|
|
83
|
+
const complete = ownData(o, 'complete');
|
|
84
|
+
if (typeof complete !== 'boolean')
|
|
85
|
+
bad();
|
|
86
|
+
return {
|
|
87
|
+
kind,
|
|
88
|
+
source: sourceOf(ownData(o, 'source')),
|
|
89
|
+
name: name(),
|
|
90
|
+
path: path(),
|
|
91
|
+
lines: strArray(ownData(o, 'lines')),
|
|
92
|
+
startLine: posInt(ownData(o, 'startLine')),
|
|
93
|
+
totalLines: natInt(ownData(o, 'totalLines')),
|
|
94
|
+
complete: complete,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
case 'notebook':
|
|
98
|
+
return { kind, source: sourceOf(ownData(o, 'source')), name: name(), path: path(), cells: ownArray(ownData(o, 'cells')).map(readCell) };
|
|
99
|
+
case 'image': {
|
|
100
|
+
let delivery;
|
|
101
|
+
if (imageDelivery === 'required') {
|
|
102
|
+
const d = ownData(o, 'delivery');
|
|
103
|
+
delivery = d === 'attached' || d === 'not-attached' ? d : bad();
|
|
104
|
+
}
|
|
105
|
+
return { kind, source: sourceOf(ownData(o, 'source')), name: name(), path: path(), sizeBytes: sizeOf(ownData(o, 'sizeBytes')), delivery };
|
|
106
|
+
}
|
|
107
|
+
case 'pdf': {
|
|
108
|
+
const pc = ownData(o, 'pageCount');
|
|
109
|
+
return {
|
|
110
|
+
kind,
|
|
111
|
+
source: sourceOf(ownData(o, 'source')),
|
|
112
|
+
name: name(),
|
|
113
|
+
path: path(),
|
|
114
|
+
sizeBytes: sizeOf(ownData(o, 'sizeBytes')),
|
|
115
|
+
pageCount: pc === null ? null : typeof pc === 'number' ? pc : bad(),
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
case 'directory':
|
|
119
|
+
return { kind, name: name(), path: path(), entries: strArray(ownData(o, 'entries')), totalEntries: natInt(ownData(o, 'totalEntries')) };
|
|
120
|
+
case 'not-included': {
|
|
121
|
+
const target = ownData(o, 'target');
|
|
122
|
+
const reason = ownData(o, 'reason');
|
|
123
|
+
if (target !== 'file' && target !== 'directory' && target !== 'path')
|
|
124
|
+
bad();
|
|
125
|
+
if (reason !== 'too-large' && reason !== 'unreadable' && reason !== 'read-denied')
|
|
126
|
+
bad();
|
|
127
|
+
return {
|
|
128
|
+
kind,
|
|
129
|
+
target: target,
|
|
130
|
+
name: name(),
|
|
131
|
+
path: path(),
|
|
132
|
+
sizeBytes: sizeOf(ownData(o, 'sizeBytes')),
|
|
133
|
+
reason: reason,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
default:
|
|
137
|
+
return undefined;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
catch {
|
|
141
|
+
return undefined;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
export function readDescriptor(x, imageDelivery) {
|
|
145
|
+
return readDescriptorAny(x, imageDelivery);
|
|
146
|
+
}
|
|
147
|
+
const REASON_LIST = ['empty', 'malformed_input', 'malformed_item', 'duplicate_uuid', 'rider_collides_primary'];
|
|
148
|
+
const reasonListExhaustive = true;
|
|
149
|
+
void reasonListExhaustive;
|
|
150
|
+
const REJECT_SENTINELS = new Map(REASON_LIST.map((r) => [Object.freeze({}), r]));
|
|
151
|
+
const sentinelOf = (reason) => {
|
|
152
|
+
for (const [s, r] of REJECT_SENTINELS)
|
|
153
|
+
if (r === reason)
|
|
154
|
+
return s;
|
|
155
|
+
return MALFORMED;
|
|
156
|
+
};
|
|
157
|
+
const reject = (reason) => {
|
|
158
|
+
throw sentinelOf(reason);
|
|
159
|
+
};
|
|
160
|
+
const rejectReasonOf = (e) => (typeof e === 'object' && e !== null ? REJECT_SENTINELS.get(e) : undefined);
|
|
161
|
+
const nonEmpty = (v) => (typeof v === 'string' && v.length > 0 ? v : reject('malformed_item'));
|
|
162
|
+
const optArray = (v) => (v === undefined ? [] : ownArray(v));
|
|
163
|
+
function readImage(x) {
|
|
164
|
+
if (!isPlainObject(x))
|
|
165
|
+
reject('malformed_item');
|
|
166
|
+
const o = x;
|
|
167
|
+
const data = ownData(o, 'data');
|
|
168
|
+
const mimeType = ownData(o, 'mimeType');
|
|
169
|
+
const url = ownData(o, 'url');
|
|
170
|
+
if (url === undefined && data !== undefined)
|
|
171
|
+
return { data: nonEmpty(data), mimeType: nonEmpty(mimeType) };
|
|
172
|
+
if (data === undefined && mimeType === undefined)
|
|
173
|
+
return { url: nonEmpty(url) };
|
|
174
|
+
return reject('malformed_item');
|
|
175
|
+
}
|
|
176
|
+
const MISSING_KIND_LIST = ['rider_text', 'image', 'attachment_ref', 'non_text'];
|
|
177
|
+
const MISSING_REASON_LIST = ['not_persisted', 'not_found', 'non_text_filtered', 'projection_failed'];
|
|
178
|
+
const missingListsExhaustive = true;
|
|
179
|
+
void missingListsExhaustive;
|
|
180
|
+
const MISSING_KINDS = new Set(MISSING_KIND_LIST);
|
|
181
|
+
const MISSING_REASONS = new Set(MISSING_REASON_LIST);
|
|
182
|
+
function readItem(x) {
|
|
183
|
+
if (!isPlainObject(x))
|
|
184
|
+
reject('malformed_item');
|
|
185
|
+
const o = x;
|
|
186
|
+
const text = ownData(o, 'text');
|
|
187
|
+
if (typeof text !== 'string')
|
|
188
|
+
reject('malformed_item');
|
|
189
|
+
const attachments = optArray(ownData(o, 'attachments')).map((a) => {
|
|
190
|
+
if (!isPlainObject(a))
|
|
191
|
+
reject('malformed_item');
|
|
192
|
+
const ao = a;
|
|
193
|
+
const d = readDescriptorAny(ownData(ao, 'descriptor'), 'ignored');
|
|
194
|
+
if (d === undefined)
|
|
195
|
+
reject('malformed_item');
|
|
196
|
+
const px = ownData(ao, 'pixels');
|
|
197
|
+
let pixels;
|
|
198
|
+
if (px !== undefined) {
|
|
199
|
+
if (d.kind !== 'image' || !isPlainObject(px))
|
|
200
|
+
reject('malformed_item');
|
|
201
|
+
pixels = { data: nonEmpty(ownData(px, 'data')), mimeType: nonEmpty(ownData(px, 'mimeType')) };
|
|
202
|
+
}
|
|
203
|
+
return { uuid: nonEmpty(ownData(ao, 'uuid')), d: d, pixels };
|
|
204
|
+
});
|
|
205
|
+
return {
|
|
206
|
+
uuid: nonEmpty(ownData(o, 'uuid')),
|
|
207
|
+
text: text,
|
|
208
|
+
images: optArray(ownData(o, 'images')).map(readImage),
|
|
209
|
+
attachments,
|
|
210
|
+
attachmentIds: optArray(ownData(o, 'attachmentIds')).map(nonEmpty),
|
|
211
|
+
riders: optArray(ownData(o, 'riders')).map((r) => {
|
|
212
|
+
if (!isPlainObject(r))
|
|
213
|
+
reject('malformed_item');
|
|
214
|
+
const ti = ownData(r, 'textIncluded');
|
|
215
|
+
if (typeof ti !== 'boolean')
|
|
216
|
+
reject('malformed_item');
|
|
217
|
+
return { uuid: nonEmpty(ownData(r, 'uuid')), role: nonEmpty(ownData(r, 'role')), textIncluded: ti };
|
|
218
|
+
}),
|
|
219
|
+
missing: optArray(ownData(o, 'missing')).map((m) => {
|
|
220
|
+
if (!isPlainObject(m))
|
|
221
|
+
reject('malformed_item');
|
|
222
|
+
const kind = ownData(m, 'kind');
|
|
223
|
+
const reason = ownData(m, 'reason');
|
|
224
|
+
const ref = ownData(m, 'ref');
|
|
225
|
+
if (typeof kind !== 'string' || !MISSING_KINDS.has(kind))
|
|
226
|
+
reject('malformed_item');
|
|
227
|
+
if (typeof reason !== 'string' || !MISSING_REASONS.has(reason))
|
|
228
|
+
reject('malformed_item');
|
|
229
|
+
if (ref !== undefined && typeof ref !== 'string')
|
|
230
|
+
reject('malformed_item');
|
|
231
|
+
return { kind: kind, ref: ref, reason: reason };
|
|
232
|
+
}),
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
function readInputAny(x) {
|
|
236
|
+
if (!isPlainObject(x))
|
|
237
|
+
reject('malformed_input');
|
|
238
|
+
const o = x;
|
|
239
|
+
const lane = ownData(o, 'lane');
|
|
240
|
+
if (lane !== 'objective' && lane !== 'steer')
|
|
241
|
+
reject('malformed_input');
|
|
242
|
+
const caps = ownData(o, 'caps');
|
|
243
|
+
if (!isPlainObject(caps))
|
|
244
|
+
reject('malformed_input');
|
|
245
|
+
const vision = ownData(caps, 'vision');
|
|
246
|
+
if (vision !== undefined && vision !== 'yes' && vision !== 'no' && vision !== 'unknown')
|
|
247
|
+
reject('malformed_input');
|
|
248
|
+
let otherBodyBytes = 0;
|
|
249
|
+
if (lane === 'objective') {
|
|
250
|
+
const ob = ownData(o, 'otherBodyBytes');
|
|
251
|
+
if (typeof ob !== 'number' || !Number.isSafeInteger(ob) || ob < 2)
|
|
252
|
+
reject('malformed_input');
|
|
253
|
+
otherBodyBytes = ob;
|
|
254
|
+
}
|
|
255
|
+
const raw = ownData(o, 'items');
|
|
256
|
+
if (!Array.isArray(raw))
|
|
257
|
+
reject('malformed_input');
|
|
258
|
+
let rawItems;
|
|
259
|
+
try {
|
|
260
|
+
rawItems = ownArray(raw);
|
|
261
|
+
}
|
|
262
|
+
catch {
|
|
263
|
+
return reject('malformed_input');
|
|
264
|
+
}
|
|
265
|
+
if (rawItems.length === 0)
|
|
266
|
+
reject('empty');
|
|
267
|
+
const items = rawItems.map((x) => {
|
|
268
|
+
try {
|
|
269
|
+
return readItem(x);
|
|
270
|
+
}
|
|
271
|
+
catch (e) {
|
|
272
|
+
return reject(rejectReasonOf(e) ?? 'malformed_item');
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
const primaries = new Set();
|
|
276
|
+
for (const it of items) {
|
|
277
|
+
if (primaries.has(it.uuid))
|
|
278
|
+
reject('duplicate_uuid');
|
|
279
|
+
primaries.add(it.uuid);
|
|
280
|
+
}
|
|
281
|
+
const secondaries = new Set();
|
|
282
|
+
for (const it of items) {
|
|
283
|
+
for (const u of [...it.riders.map((r) => r.uuid), ...it.attachments.map((a) => a.uuid)]) {
|
|
284
|
+
if (primaries.has(u))
|
|
285
|
+
reject('rider_collides_primary');
|
|
286
|
+
if (secondaries.has(u))
|
|
287
|
+
reject('malformed_item');
|
|
288
|
+
secondaries.add(u);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
if (items.every((it) => it.text.length === 0 && it.images.length === 0 && it.attachments.length === 0 && it.attachmentIds.length === 0))
|
|
292
|
+
reject('empty');
|
|
293
|
+
return { lane: lane, vision: vision ?? 'unknown', otherBodyBytes, items };
|
|
294
|
+
}
|
|
295
|
+
export function readHumanTurnInput(input) {
|
|
296
|
+
try {
|
|
297
|
+
return readInputAny(input);
|
|
298
|
+
}
|
|
299
|
+
catch (e) {
|
|
300
|
+
return { reject: rejectReasonOf(e) ?? 'malformed_input' };
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
export function readEncodingShares(encoding) {
|
|
304
|
+
try {
|
|
305
|
+
if (!isPlainObject(encoding) || ownData(encoding, 'ok') !== true)
|
|
306
|
+
return undefined;
|
|
307
|
+
const out = [];
|
|
308
|
+
for (const s of ownArray(ownData(encoding, 'shares'))) {
|
|
309
|
+
if (!isPlainObject(s))
|
|
310
|
+
return undefined;
|
|
311
|
+
const level = ownData(s, 'level');
|
|
312
|
+
const uuid = ownData(s, 'uuid');
|
|
313
|
+
const riders = ownArray(ownData(s, 'riderUuids'));
|
|
314
|
+
if (typeof uuid !== 'string' || uuid.length === 0)
|
|
315
|
+
return undefined;
|
|
316
|
+
if (level !== 'full' && level !== 'partial' && level !== 'none')
|
|
317
|
+
return undefined;
|
|
318
|
+
const riderUuids = [];
|
|
319
|
+
for (const r of riders) {
|
|
320
|
+
if (typeof r !== 'string' || r.length === 0)
|
|
321
|
+
return undefined;
|
|
322
|
+
riderUuids.push(r);
|
|
323
|
+
}
|
|
324
|
+
out.push({ uuid, level, riderUuids });
|
|
325
|
+
}
|
|
326
|
+
return out;
|
|
327
|
+
}
|
|
328
|
+
catch {
|
|
329
|
+
return undefined;
|
|
330
|
+
}
|
|
331
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -31,7 +31,8 @@ export * from './executionLaneCapability.js';
|
|
|
31
31
|
export * from './approvalsStreamLiveCapability.js';
|
|
32
32
|
export * from './peerLaneCapability.js';
|
|
33
33
|
export * from './permissionRulesWriteCapability.js';
|
|
34
|
-
export
|
|
34
|
+
export { __resetPermissionsAllowGrantReadingsForTests, forgetPermissionsAllowGrantReading, noteEngineCapsForPermissionsAllowGrant, observedPermissionsAllowGrant, permissionsAllowGrantAvailable, permissionsAllowGrantDoctorDetail, projectPermissionsAllowGrantCapability, } from './permissionsAllowGrantCapability.js';
|
|
35
|
+
export type { PermissionsAllowGrantReading } from './permissionsAllowGrantCapability.js';
|
|
35
36
|
export * from './sessionPolicyCapability.js';
|
|
36
37
|
export * from './memoryComplianceCapability.js';
|
|
37
38
|
export * from './memoryOriginCapability.js';
|
|
@@ -49,6 +50,11 @@ export * from './mcpPanel.js';
|
|
|
49
50
|
export * from './mcpLiveness.js';
|
|
50
51
|
export * from './mcpEngineLeg.js';
|
|
51
52
|
export * from './mcpProbeCapability.js';
|
|
53
|
+
export * from './sessionSyncFileHistoryCapability.js';
|
|
54
|
+
export * from './workflowsJournalCapability.js';
|
|
55
|
+
export * from './userInvokedSkillsCapability.js';
|
|
56
|
+
export * from './skillToolListsCapability.js';
|
|
57
|
+
export * from './steerPriorityCapability.js';
|
|
52
58
|
export * from './mcpProbeWire.js';
|
|
53
59
|
export * from './effectiveFacts.js';
|
|
54
60
|
export * from './gateOutcome.js';
|
|
@@ -68,14 +74,15 @@ export type { DisplayUntrustedOptions, DisplayMark, DisplayMarkSpan, DisplayUntr
|
|
|
68
74
|
export type * from './types/engineState.js';
|
|
69
75
|
export * from './hostEnv.js';
|
|
70
76
|
export * from './unrefTimer.js';
|
|
71
|
-
export { ControlRouter, ControlSafetyError, errCodes, type ControlClientLike, type ControlRouterOptions, type ControlSafetyCode, type ErrCodes, type
|
|
77
|
+
export { ControlRouter, ControlSafetyError, errCodes, steerBodyOf, steerRefusalAdviceOf, steeringRefusedBeforeEngine, type ControlClientLike, type ControlRouterOptions, type ControlRouterSteerOptions, type ControlSafetyCode, type ErrCodes, type RunsResourceLike, type SteerBody, type SteerBodyInput, type SteerRefusalAdvice, type SteeringRefusedBeforeEngine, } from './controlRouter.js';
|
|
78
|
+
export { readSteerReceipt, type SteerReceiptReading } from './steerReceipt.js';
|
|
72
79
|
export * from './sseIdleTriage.js';
|
|
73
80
|
export * from './engineWireSdk.js';
|
|
74
81
|
export * from './classifierVerdictWire.js';
|
|
75
82
|
export { stripSystemReminderBlocks, unwrapSystemReminder } from './systemReminderTag.js';
|
|
76
83
|
export { findSystemReminderOpenTag, type SystemReminderOpenTagSpan } from './systemReminderTag.js';
|
|
77
|
-
export { ACTIVE_RUN_BUSY_ERROR_CODE, asModelFallbackReason, CAPABILITY_SELF_ORCHESTRATION_REQUIRED, CONFIG_DELEGATION_ENTRY_CAPS, CONFIG_LEGACY_TOOL_NAME, CONFIG_LIMIT_INVALID, CONFIG_LIMIT_UNKNOWN_KEY, CONFIG_MEMORY_PROJECT_KEY_SPELLING, CONFIG_MEMORY_WRITE_SCOPE_MISMATCH, CONFIG_REFUSAL_CODES, CONFIG_STRATEGY_FIND_LIMIT_INVALID, CONFIG_STRATEGY_MAX_SIZE_INVALID, CORRUPT_SESSION_ERROR_CODE, DECIDE_CLAIM_LOST, DECIDE_GATE_MOVED, DECIDE_NOT_PARKED, DECIDE_PARK_MOVED_CODES, DECIDE_WORKFLOW_HOST_UNKNOWN, DECIDE_WORKFLOW_LANE_CODES, DECIDE_WORKFLOW_REMEMBER_UNSUPPORTED, DELEGATION_CAP_CODES, DELEGATION_CONCURRENCY_CAP, DELEGATION_SESSION_CAP, delegationCapDispositionOf, DRAINING_ERROR_CODE, ENGINE_STOP_REASONS, engineStopReasonToCc, ENV_LIFETIME_EXPIRED, FLEET_LEASE_UNAVAILABLE, GATE_PARKED_ERROR_CODE, isConfigRefusalCode, isCorruptSessionCode, isDecideParkMovedCode, isDelegationCapCode, isInterruptedToolEndCode, isLimitsExceededCode, isRewindFamilyCode, isRulesRefusalCode, isStatusDerivedCoarseCode, isWorkflowParkRefusalCode, LIMITS_MAX_COST_EXCEEDED, LIMITS_MAX_TOKENS_EXCEEDED, LIMITS_MAX_TURNS_EXCEEDED, LIMITS_MAX_WALLTIME_EXCEEDED, MCP_SERVER_REVOKED, MODEL_FALLBACK_INHERIT_NO_TIER_BINDING, OUTPUT_INVALID, PARKED_RESUME_STARTUP_FAILED, RESUME_AT_ERROR_CODE_PREFIX, RESUME_CONTEXT_UNAVAILABLE, RESUME_ENV_FAILED, RESUME_PLACEMENT_MISMATCH, RESUME_POLICY_FOLD_CODE, RESUME_PREFLIGHT_REJECTED, RESUME_REOPEN_CODES, RESUME_RETRY_LATER_CODES, RESUME_TOOL_CONTRACT_MISMATCH, RESUME_TOOL_UNAVAILABLE, RESUME_USAGE_WINDOW_EXHAUSTED, REWIND_ERROR_CODE_PREFIXES, RULES_LEGACY_TOOL_NAME, SCENARIO_NOT_ALLOWED_ERROR_CODE, STATUS_DERIVED_COARSE_CODES, STOP_CONFLICT_CODES, STREAM_MAX_DURATION, TOOL_END_INTERRUPTED_NEVER_STARTED, TOOL_END_INTERRUPTED_OUTCOME_UNKNOWN, USAGE_WINDOW_EXHAUSTED, WORKFLOW_PARK_REFUSAL_CODES, } from './engineErrorCodes.js';
|
|
78
|
-
export type { DelegationCapDisposition, ModelFallbackReason, } from './engineErrorCodes.js';
|
|
84
|
+
export { ACTIVE_RUN_BUSY_ERROR_CODE, APPROVAL_EXPIRED, ASK_GONE, asModelFallbackReason, CAPABILITY_OPERATOR_PRINCIPALS_REQUIRED, CAPABILITY_SELF_ORCHESTRATION_REQUIRED, CONFIG_DELEGATION_ENTRY_CAPS, CONFIG_IMAGE_INVALID, CONFIG_LEGACY_TOOL_NAME, CONFIG_LIMIT_INVALID, CONFIG_LIMIT_UNKNOWN_KEY, CONFIG_MEMORY_PROJECT_KEY_SPELLING, CONFIG_MEMORY_WRITE_SCOPE_MISMATCH, CONFIG_REFUSAL_CODES, CONFIG_STRATEGY_FIND_LIMIT_INVALID, CONFIG_STRATEGY_MAX_SIZE_INVALID, CORRUPT_SESSION_ERROR_CODE, DECIDE_CLAIM_LOST, DECIDE_GATE_MOVED, DECIDE_NOT_PARKED, DECIDE_PARK_MOVED_CODES, DECIDE_WORKFLOW_HOST_UNKNOWN, DECIDE_WORKFLOW_LANE_CODES, DECIDE_WORKFLOW_REMEMBER_UNSUPPORTED, DELEGATION_CAP_CODES, DELEGATION_CONCURRENCY_CAP, DELEGATION_SESSION_CAP, delegationCapDispositionOf, DRAINING_ERROR_CODE, ENGINE_STOP_REASONS, engineStopReasonToCc, ENV_LIFETIME_EXPIRED, FLEET_LEASE_UNAVAILABLE, GATE_PARKED_ERROR_CODE, imageInvalidFailureNoteOf, isConfigRefusalCode, isCorruptSessionCode, isDecideParkMovedCode, isDelegationCapCode, isInterruptedToolEndCode, isLimitsExceededCode, isRewindFamilyCode, isRulesRefusalCode, isStatusDerivedCoarseCode, isWorkflowParkRefusalCode, LIMITS_MAX_COST_EXCEEDED, LIMITS_MAX_TOKENS_EXCEEDED, LIMITS_MAX_TURNS_EXCEEDED, LIMITS_MAX_WALLTIME_EXCEEDED, MCP_SERVER_REVOKED, MODEL_FALLBACK_INHERIT_NO_TIER_BINDING, operatorGateRefusalContent, OUTPUT_INVALID, PARKED_RESUME_STARTUP_FAILED, RESUME_AT_ERROR_CODE_PREFIX, RESUME_CONTEXT_UNAVAILABLE, RESUME_ENV_FAILED, RESUME_PLACEMENT_MISMATCH, RESUME_POLICY_FOLD_CODE, RESUME_PREFLIGHT_REJECTED, RESUME_REOPEN_CODES, RESUME_RETRY_LATER_CODES, RESUME_TOOL_CONTRACT_MISMATCH, RESUME_TOOL_UNAVAILABLE, RESUME_USAGE_WINDOW_EXHAUSTED, REWIND_ERROR_CODE_PREFIXES, RULES_LEGACY_TOOL_NAME, RUN_DEATH_VERDICT_CODES, RUN_ORPHANED, RUN_STALLED, runDeathVerdictNoteOf, SCENARIO_NOT_ALLOWED_ERROR_CODE, STATUS_DERIVED_COARSE_CODES, STOP_CONFLICT_CODES, STREAM_MAX_DURATION, TOOL_END_INTERRUPTED_NEVER_STARTED, TOOL_END_INTERRUPTED_OUTCOME_UNKNOWN, USAGE_WINDOW_EXHAUSTED, WORKFLOW_PARK_REFUSAL_CODES, } from './engineErrorCodes.js';
|
|
85
|
+
export type { DelegationCapDisposition, ModelFallbackReason, OperatorGateRefusal, RunDeathVerdictCode, } from './engineErrorCodes.js';
|
|
79
86
|
export * from './agentsWireCaps.js';
|
|
80
87
|
export * from './attachmentsWireCaps.js';
|
|
81
88
|
export * from './clientContextWireCaps.js';
|
|
@@ -110,17 +117,18 @@ export * from './effortWire.js';
|
|
|
110
117
|
export * from './adapter/types.js';
|
|
111
118
|
export * from './adapter/downstream/turnUsageToModelUsage.js';
|
|
112
119
|
export * from './adapter/downstream/eventToSdkMessage.js';
|
|
113
|
-
export type { WiringManifestView, WiringManifestSections } from './adapter/downstream/wiringManifestView.js';
|
|
120
|
+
export type { WiringManifestView, WiringManifestSections, WiringManifestFleetView } from './adapter/downstream/wiringManifestView.js';
|
|
114
121
|
export * from './adapter/downstream/terminalToSdkResult.js';
|
|
115
122
|
export * from './adapter/runStream.js';
|
|
116
123
|
export * from './adapter/activeRunSelfHeal.js';
|
|
117
124
|
export * from './request/taskRequest.js';
|
|
118
|
-
export { disableSkillsDeclaration } from './disableSkillsWire.js';
|
|
125
|
+
export { disableSkillsDeclaration, disableSkillsDeclarationSettled } from './disableSkillsWire.js';
|
|
119
126
|
export type { DisableSkillsDeclaration } from './disableSkillsWire.js';
|
|
120
|
-
export { permissionsDeclaration } from './permissionsDeclaration.js';
|
|
121
|
-
export type { PermissionsDeclaration, PermissionsDeclarationBuckets, PermissionsDeclarationInput, WireRuleOrigin, WireRuleOrigins } from './permissionsDeclaration.js';
|
|
127
|
+
export { PERMISSIONS_KEPT_REASONS, permissionsDeclaration, permissionsDeclarationReport } from './permissionsDeclaration.js';
|
|
128
|
+
export type { PermissionsDeclaration, PermissionsDeclarationBuckets, PermissionsDeclarationInput, PermissionsDeclarationReport, PermissionsKeptReason, PermissionsKeptRule, PermissionsRewrittenRule, PermissionsUncheckedRule, PermissionsUnreachableRule, WireRuleOrigin, WireRuleOrigins, } from './permissionsDeclaration.js';
|
|
122
129
|
export * from './clientSlice.js';
|
|
123
130
|
export * from './host.js';
|
|
131
|
+
export { abortableSleep } from './abortableSleep.js';
|
|
124
132
|
export { DEFAULT_SESSION_KEY } from './sessionSlot.js';
|
|
125
133
|
export * from './scratchpadWireCaps.js';
|
|
126
134
|
export * from './toolResult.js';
|
|
@@ -153,11 +161,19 @@ export * from './principalWire.js';
|
|
|
153
161
|
export * from './wireErrorTriage.js';
|
|
154
162
|
export * from './corruptSession.js';
|
|
155
163
|
export * from './corruptSessionCopy.js';
|
|
156
|
-
export { classifyToolHistoryMismatch, resolveToolHistoryRewindTarget } from './toolHistoryMismatch.js';
|
|
164
|
+
export { classifyToolHistoryMismatch, readToolHistoryMismatchKey, resolveToolHistoryRewindTarget } from './toolHistoryMismatch.js';
|
|
165
|
+
export type { ToolHistoryMismatchRowKey } from './toolHistoryMismatch.js';
|
|
166
|
+
export { toolHistoryBadTurnSentence } from './toolHistoryBadTurn.js';
|
|
157
167
|
export { classifyRegistryConflict, isScopeGoneError } from './registryConflict.js';
|
|
158
168
|
export type { RegistryConflictClass } from './registryConflict.js';
|
|
159
169
|
export { createPromptDeliveryLedger, promptKnownUndelivered, withoutUndeliveredPrompts } from './promptDelivery.js';
|
|
160
170
|
export type { PromptDeliveryLedger, PromptDeliveryRecord } from './promptDelivery.js';
|
|
171
|
+
export { mintUserAttachmentEnvelope } from './userAttachmentEnvelope.js';
|
|
172
|
+
export type { UserAttachmentDescriptor, UserAttachmentNotebookCell } from './userAttachmentEnvelope.js';
|
|
173
|
+
export { encodeHumanTurn, deliveredUuidsOf } from './humanTurn.js';
|
|
174
|
+
export type { HumanTurnInput, HumanTurnItem, HumanTurnAttachment, HumanTurnRider, HumanTurnMissing, HumanTurnCaps, HumanTurnEncoding, HumanTurnShare, HumanTurnSharePart, HumanTurnDegraded, HumanTurnDelivered, } from './humanTurn.js';
|
|
175
|
+
export { noteEngineCapsForAttachmentSeat, observedAttachmentSeat, forgetAttachmentSeatReading, __resetAttachmentSeatReadingsForTests, } from './attachmentSeatCapability.js';
|
|
176
|
+
export type { AttachmentSeatReading } from './attachmentSeatCapability.js';
|
|
161
177
|
export * from './resumeRefusalCopy.js';
|
|
162
178
|
export * from './wireRefusalCopy.js';
|
|
163
179
|
export * from './inheritEnvWire.js';
|
|
@@ -171,6 +187,11 @@ export * from './workflowClient.js';
|
|
|
171
187
|
export * from './hooksWireCaps.js';
|
|
172
188
|
export { ENGINE_FIRED_HOOK_EVENTS, PLUGIN_HOOK_DISPOSITIONS, PLUGIN_HOOK_REASONS, PLUGIN_HOOK_EXCLUSION_REASONS, SETTINGS_HOOK_DROP_REASONS, isEngineFiredHookEvent, pluginHookVerdictOf, pluginHookReasonText, settingsHookDropText, pluginHookExecutorLabel, hooksNotRunNotice, settingsHooksKeptLocally, type EngineFiredHookEvent, type PluginHookDisposition, type PluginHookReason, type PluginHookExclusionReason, type SettingsHookDropReason, type HookSettingsSource, type PluginHookKey, type PluginHookVerdict, type PluginHookExclusion, type SettingsHookDrop, type SettingsHookVerdict, type SettingsHookExclusion, type HooksWireEngineFacts, type PluginHookReaderState, type HooksWirePlan, type HooksWirePlanOptions, } from './pluginHooksWire.js';
|
|
173
189
|
export { hookToolAliasesOf, canonicalHookToolName } from './hookToolAliases.js';
|
|
190
|
+
export { hookMatcherVerdict } from './hookMatcherVerdict.js';
|
|
191
|
+
export type { HookMatcherVerdict, HookMatcherUnjudgedReason } from './hookMatcherVerdict.js';
|
|
192
|
+
export { ASK_EVIDENCE_ABSENCE_VALUES, SYSTEM_INJECTION_PRIORITIES } from './engineClosedSets.js';
|
|
193
|
+
export { READ_DENY_BUILTIN_TIERS, READ_DENY_DEFAULT_TIERS, parseReadDenyBuiltinTiers, type ReadDenyBuiltinTiersParse } from './readDenyTiers.js';
|
|
194
|
+
export { MODE_ARBITRATION, askSurvivesStandingAnswer, type StandingAnswerVerdict } from './askSurvivesStandingAnswer.js';
|
|
174
195
|
export * from './liveInitToolFace.js';
|
|
175
196
|
export * from './printInitToolFace.js';
|
|
176
197
|
export * from './model/providerPresets.js';
|
|
@@ -180,7 +201,7 @@ export * from './hitl/suspendedReopen.js';
|
|
|
180
201
|
export * from './hitl/approvalOutcomeNote.js';
|
|
181
202
|
export * from './hitl/approvalResolution.js';
|
|
182
203
|
export { toolEndOutputText, ENGINE_ABORT_TOOL_RESULT } from './hitl/frameRouter.js';
|
|
183
|
-
export { _resetHitlHostSurfaceForTest, CANCEL_DENY_BUDGET_MS, CANCEL_DENY_WARN_TEXT, EDIT_NOT_FORWARDED_WARN_TEXT, EDIT_REFUSED_ON_BLIND_ASK_WARN_TEXT, hitlHostSurfaceFor, hitlHostSurfaceMisses, hitlHostSurfaceMissesFor, installHitlHostSurface, installHitlHostSurfaceFor, observeCancelByDeny, REMEMBER_NOT_APPLIED_WARN_TEXT, RULE_NOT_SENT_REJECTED_WARN_TEXT, RULE_NOT_SENT_WARN_TEXT, surfaceEditRefusedOnBlindAsk, surfaceForCurrentSession, surfaceRememberNotApplied, } from './hitl/hitlHostSurface.js';
|
|
204
|
+
export { _resetHitlHostSurfaceForTest, CANCEL_DENY_BUDGET_MS, CANCEL_DENY_WARN_TEXT, EDIT_NOT_FORWARDED_WARN_TEXT, EDIT_REFUSED_ON_BLIND_ASK_WARN_TEXT, hitlHostSurfaceFor, hitlHostSurfaceMisses, hitlHostSurfaceMissesFor, installHitlHostSurface, installHitlHostSurfaceFor, observeCancelByDeny, REMEMBER_NOT_APPLIED_WARN_TEXT, REPLAYED_APPROVAL_LIST_UNREADABLE_WARN_TEXT, RULE_NOT_SENT_REJECTED_WARN_TEXT, RULE_NOT_SENT_WARN_TEXT, surfaceEditRefusedOnBlindAsk, surfaceForCurrentSession, surfaceRememberNotApplied, } from './hitl/hitlHostSurface.js';
|
|
184
205
|
export type { ClassifierDenyContext, HitlHostSurface, HitlNotice, } from './hitl/hitlHostSurface.js';
|
|
185
206
|
export * from './hitl/toolApprovalWire.js';
|
|
186
207
|
export * from './hitl/editedRuleTextPrecheck.js';
|
|
@@ -200,8 +221,14 @@ export * from './hitl/sessionPolicyWire.js';
|
|
|
200
221
|
export * from './hitl/sessionPolicyDeliverable.js';
|
|
201
222
|
export * from './hitl/approvalsFeed.js';
|
|
202
223
|
export * from './hitl/livePendingAsk.js';
|
|
224
|
+
export { replayedApprovalDisposition } from './hitl/replayedApproval.js';
|
|
225
|
+
export type { ReplayedApprovalDisposition, ReplayPendingBasis } from './hitl/replayedApproval.js';
|
|
203
226
|
export * from './hitl/askSurvivesPosture.js';
|
|
204
|
-
export
|
|
227
|
+
export { automaticAnswerVerdict, type AutomaticAnswerLane, type AutomaticAnswerFacts, type AutomaticAnswerRoad, type AutomaticAnswerUnknownWhy, type AutomaticAnswerVerdict, } from './hitl/automaticAnswerVerdict.js';
|
|
228
|
+
export { readApprovalAllowRuleShadow, approvalAllowRuleShadowed, type ApprovalAllowRuleShadow, type ApprovalAllowRuleShadowMember, type AllowRuleShadowedWireMember, } from './hitl/allowRuleShadow.js';
|
|
229
|
+
export { projectCrashConverged } from './hitl/crashConverged.js';
|
|
230
|
+
export type { ApprovalsListEnvelope, CrashConvergedOrphanState, CrashConvergedProjection, CrashConvergedRow } from './hitl/crashConverged.js';
|
|
231
|
+
export * from './hitl/crashConvergedNotice.js';
|
|
205
232
|
export * from './interactiveHalt.js';
|
|
206
233
|
export * from './compensations.js';
|
|
207
234
|
export * from './request/printNotification.js';
|
package/dist/index.js
CHANGED
|
@@ -26,7 +26,7 @@ export * from './executionLaneCapability.js';
|
|
|
26
26
|
export * from './approvalsStreamLiveCapability.js';
|
|
27
27
|
export * from './peerLaneCapability.js';
|
|
28
28
|
export * from './permissionRulesWriteCapability.js';
|
|
29
|
-
export
|
|
29
|
+
export { __resetPermissionsAllowGrantReadingsForTests, forgetPermissionsAllowGrantReading, noteEngineCapsForPermissionsAllowGrant, observedPermissionsAllowGrant, permissionsAllowGrantAvailable, permissionsAllowGrantDoctorDetail, projectPermissionsAllowGrantCapability, } from './permissionsAllowGrantCapability.js';
|
|
30
30
|
export * from './sessionPolicyCapability.js';
|
|
31
31
|
export * from './memoryComplianceCapability.js';
|
|
32
32
|
export * from './memoryOriginCapability.js';
|
|
@@ -44,6 +44,11 @@ export * from './mcpPanel.js';
|
|
|
44
44
|
export * from './mcpLiveness.js';
|
|
45
45
|
export * from './mcpEngineLeg.js';
|
|
46
46
|
export * from './mcpProbeCapability.js';
|
|
47
|
+
export * from './sessionSyncFileHistoryCapability.js';
|
|
48
|
+
export * from './workflowsJournalCapability.js';
|
|
49
|
+
export * from './userInvokedSkillsCapability.js';
|
|
50
|
+
export * from './skillToolListsCapability.js';
|
|
51
|
+
export * from './steerPriorityCapability.js';
|
|
47
52
|
export * from './mcpProbeWire.js';
|
|
48
53
|
export * from './effectiveFacts.js';
|
|
49
54
|
export * from './gateOutcome.js';
|
|
@@ -61,13 +66,14 @@ export * from './fleetTaskDesc.js';
|
|
|
61
66
|
export { displayUntrusted, displayUntrustedMarks } from './displayUntrusted.js';
|
|
62
67
|
export * from './hostEnv.js';
|
|
63
68
|
export * from './unrefTimer.js';
|
|
64
|
-
export { ControlRouter, ControlSafetyError, errCodes, } from './controlRouter.js';
|
|
69
|
+
export { ControlRouter, ControlSafetyError, errCodes, steerBodyOf, steerRefusalAdviceOf, steeringRefusedBeforeEngine, } from './controlRouter.js';
|
|
70
|
+
export { readSteerReceipt } from './steerReceipt.js';
|
|
65
71
|
export * from './sseIdleTriage.js';
|
|
66
72
|
export * from './engineWireSdk.js';
|
|
67
73
|
export * from './classifierVerdictWire.js';
|
|
68
74
|
export { stripSystemReminderBlocks, unwrapSystemReminder } from './systemReminderTag.js';
|
|
69
75
|
export { findSystemReminderOpenTag } from './systemReminderTag.js';
|
|
70
|
-
export { ACTIVE_RUN_BUSY_ERROR_CODE, asModelFallbackReason, CAPABILITY_SELF_ORCHESTRATION_REQUIRED, CONFIG_DELEGATION_ENTRY_CAPS, CONFIG_LEGACY_TOOL_NAME, CONFIG_LIMIT_INVALID, CONFIG_LIMIT_UNKNOWN_KEY, CONFIG_MEMORY_PROJECT_KEY_SPELLING, CONFIG_MEMORY_WRITE_SCOPE_MISMATCH, CONFIG_REFUSAL_CODES, CONFIG_STRATEGY_FIND_LIMIT_INVALID, CONFIG_STRATEGY_MAX_SIZE_INVALID, CORRUPT_SESSION_ERROR_CODE, DECIDE_CLAIM_LOST, DECIDE_GATE_MOVED, DECIDE_NOT_PARKED, DECIDE_PARK_MOVED_CODES, DECIDE_WORKFLOW_HOST_UNKNOWN, DECIDE_WORKFLOW_LANE_CODES, DECIDE_WORKFLOW_REMEMBER_UNSUPPORTED, DELEGATION_CAP_CODES, DELEGATION_CONCURRENCY_CAP, DELEGATION_SESSION_CAP, delegationCapDispositionOf, DRAINING_ERROR_CODE, ENGINE_STOP_REASONS, engineStopReasonToCc, ENV_LIFETIME_EXPIRED, FLEET_LEASE_UNAVAILABLE, GATE_PARKED_ERROR_CODE, isConfigRefusalCode, isCorruptSessionCode, isDecideParkMovedCode, isDelegationCapCode, isInterruptedToolEndCode, isLimitsExceededCode, isRewindFamilyCode, isRulesRefusalCode, isStatusDerivedCoarseCode, isWorkflowParkRefusalCode, LIMITS_MAX_COST_EXCEEDED, LIMITS_MAX_TOKENS_EXCEEDED, LIMITS_MAX_TURNS_EXCEEDED, LIMITS_MAX_WALLTIME_EXCEEDED, MCP_SERVER_REVOKED, MODEL_FALLBACK_INHERIT_NO_TIER_BINDING, OUTPUT_INVALID, PARKED_RESUME_STARTUP_FAILED, RESUME_AT_ERROR_CODE_PREFIX, RESUME_CONTEXT_UNAVAILABLE, RESUME_ENV_FAILED, RESUME_PLACEMENT_MISMATCH, RESUME_POLICY_FOLD_CODE, RESUME_PREFLIGHT_REJECTED, RESUME_REOPEN_CODES, RESUME_RETRY_LATER_CODES, RESUME_TOOL_CONTRACT_MISMATCH, RESUME_TOOL_UNAVAILABLE, RESUME_USAGE_WINDOW_EXHAUSTED, REWIND_ERROR_CODE_PREFIXES, RULES_LEGACY_TOOL_NAME, SCENARIO_NOT_ALLOWED_ERROR_CODE, STATUS_DERIVED_COARSE_CODES, STOP_CONFLICT_CODES, STREAM_MAX_DURATION, TOOL_END_INTERRUPTED_NEVER_STARTED, TOOL_END_INTERRUPTED_OUTCOME_UNKNOWN, USAGE_WINDOW_EXHAUSTED, WORKFLOW_PARK_REFUSAL_CODES, } from './engineErrorCodes.js';
|
|
76
|
+
export { ACTIVE_RUN_BUSY_ERROR_CODE, APPROVAL_EXPIRED, ASK_GONE, asModelFallbackReason, CAPABILITY_OPERATOR_PRINCIPALS_REQUIRED, CAPABILITY_SELF_ORCHESTRATION_REQUIRED, CONFIG_DELEGATION_ENTRY_CAPS, CONFIG_IMAGE_INVALID, CONFIG_LEGACY_TOOL_NAME, CONFIG_LIMIT_INVALID, CONFIG_LIMIT_UNKNOWN_KEY, CONFIG_MEMORY_PROJECT_KEY_SPELLING, CONFIG_MEMORY_WRITE_SCOPE_MISMATCH, CONFIG_REFUSAL_CODES, CONFIG_STRATEGY_FIND_LIMIT_INVALID, CONFIG_STRATEGY_MAX_SIZE_INVALID, CORRUPT_SESSION_ERROR_CODE, DECIDE_CLAIM_LOST, DECIDE_GATE_MOVED, DECIDE_NOT_PARKED, DECIDE_PARK_MOVED_CODES, DECIDE_WORKFLOW_HOST_UNKNOWN, DECIDE_WORKFLOW_LANE_CODES, DECIDE_WORKFLOW_REMEMBER_UNSUPPORTED, DELEGATION_CAP_CODES, DELEGATION_CONCURRENCY_CAP, DELEGATION_SESSION_CAP, delegationCapDispositionOf, DRAINING_ERROR_CODE, ENGINE_STOP_REASONS, engineStopReasonToCc, ENV_LIFETIME_EXPIRED, FLEET_LEASE_UNAVAILABLE, GATE_PARKED_ERROR_CODE, imageInvalidFailureNoteOf, isConfigRefusalCode, isCorruptSessionCode, isDecideParkMovedCode, isDelegationCapCode, isInterruptedToolEndCode, isLimitsExceededCode, isRewindFamilyCode, isRulesRefusalCode, isStatusDerivedCoarseCode, isWorkflowParkRefusalCode, LIMITS_MAX_COST_EXCEEDED, LIMITS_MAX_TOKENS_EXCEEDED, LIMITS_MAX_TURNS_EXCEEDED, LIMITS_MAX_WALLTIME_EXCEEDED, MCP_SERVER_REVOKED, MODEL_FALLBACK_INHERIT_NO_TIER_BINDING, operatorGateRefusalContent, OUTPUT_INVALID, PARKED_RESUME_STARTUP_FAILED, RESUME_AT_ERROR_CODE_PREFIX, RESUME_CONTEXT_UNAVAILABLE, RESUME_ENV_FAILED, RESUME_PLACEMENT_MISMATCH, RESUME_POLICY_FOLD_CODE, RESUME_PREFLIGHT_REJECTED, RESUME_REOPEN_CODES, RESUME_RETRY_LATER_CODES, RESUME_TOOL_CONTRACT_MISMATCH, RESUME_TOOL_UNAVAILABLE, RESUME_USAGE_WINDOW_EXHAUSTED, REWIND_ERROR_CODE_PREFIXES, RULES_LEGACY_TOOL_NAME, RUN_DEATH_VERDICT_CODES, RUN_ORPHANED, RUN_STALLED, runDeathVerdictNoteOf, SCENARIO_NOT_ALLOWED_ERROR_CODE, STATUS_DERIVED_COARSE_CODES, STOP_CONFLICT_CODES, STREAM_MAX_DURATION, TOOL_END_INTERRUPTED_NEVER_STARTED, TOOL_END_INTERRUPTED_OUTCOME_UNKNOWN, USAGE_WINDOW_EXHAUSTED, WORKFLOW_PARK_REFUSAL_CODES, } from './engineErrorCodes.js';
|
|
71
77
|
export * from './agentsWireCaps.js';
|
|
72
78
|
export * from './attachmentsWireCaps.js';
|
|
73
79
|
export * from './clientContextWireCaps.js';
|
|
@@ -105,10 +111,11 @@ export * from './adapter/downstream/terminalToSdkResult.js';
|
|
|
105
111
|
export * from './adapter/runStream.js';
|
|
106
112
|
export * from './adapter/activeRunSelfHeal.js';
|
|
107
113
|
export * from './request/taskRequest.js';
|
|
108
|
-
export { disableSkillsDeclaration } from './disableSkillsWire.js';
|
|
109
|
-
export { permissionsDeclaration } from './permissionsDeclaration.js';
|
|
114
|
+
export { disableSkillsDeclaration, disableSkillsDeclarationSettled } from './disableSkillsWire.js';
|
|
115
|
+
export { PERMISSIONS_KEPT_REASONS, permissionsDeclaration, permissionsDeclarationReport } from './permissionsDeclaration.js';
|
|
110
116
|
export * from './clientSlice.js';
|
|
111
117
|
export * from './host.js';
|
|
118
|
+
export { abortableSleep } from './abortableSleep.js';
|
|
112
119
|
export { DEFAULT_SESSION_KEY } from './sessionSlot.js';
|
|
113
120
|
export * from './scratchpadWireCaps.js';
|
|
114
121
|
export * from './toolResult.js';
|
|
@@ -138,9 +145,13 @@ export * from './principalWire.js';
|
|
|
138
145
|
export * from './wireErrorTriage.js';
|
|
139
146
|
export * from './corruptSession.js';
|
|
140
147
|
export * from './corruptSessionCopy.js';
|
|
141
|
-
export { classifyToolHistoryMismatch, resolveToolHistoryRewindTarget } from './toolHistoryMismatch.js';
|
|
148
|
+
export { classifyToolHistoryMismatch, readToolHistoryMismatchKey, resolveToolHistoryRewindTarget } from './toolHistoryMismatch.js';
|
|
149
|
+
export { toolHistoryBadTurnSentence } from './toolHistoryBadTurn.js';
|
|
142
150
|
export { classifyRegistryConflict, isScopeGoneError } from './registryConflict.js';
|
|
143
151
|
export { createPromptDeliveryLedger, promptKnownUndelivered, withoutUndeliveredPrompts } from './promptDelivery.js';
|
|
152
|
+
export { mintUserAttachmentEnvelope } from './userAttachmentEnvelope.js';
|
|
153
|
+
export { encodeHumanTurn, deliveredUuidsOf } from './humanTurn.js';
|
|
154
|
+
export { noteEngineCapsForAttachmentSeat, observedAttachmentSeat, forgetAttachmentSeatReading, __resetAttachmentSeatReadingsForTests, } from './attachmentSeatCapability.js';
|
|
144
155
|
export * from './resumeRefusalCopy.js';
|
|
145
156
|
export * from './wireRefusalCopy.js';
|
|
146
157
|
export * from './inheritEnvWire.js';
|
|
@@ -153,6 +164,10 @@ export * from './workflowClient.js';
|
|
|
153
164
|
export * from './hooksWireCaps.js';
|
|
154
165
|
export { ENGINE_FIRED_HOOK_EVENTS, PLUGIN_HOOK_DISPOSITIONS, PLUGIN_HOOK_REASONS, PLUGIN_HOOK_EXCLUSION_REASONS, SETTINGS_HOOK_DROP_REASONS, isEngineFiredHookEvent, pluginHookVerdictOf, pluginHookReasonText, settingsHookDropText, pluginHookExecutorLabel, hooksNotRunNotice, settingsHooksKeptLocally, } from './pluginHooksWire.js';
|
|
155
166
|
export { hookToolAliasesOf, canonicalHookToolName } from './hookToolAliases.js';
|
|
167
|
+
export { hookMatcherVerdict } from './hookMatcherVerdict.js';
|
|
168
|
+
export { ASK_EVIDENCE_ABSENCE_VALUES, SYSTEM_INJECTION_PRIORITIES } from './engineClosedSets.js';
|
|
169
|
+
export { READ_DENY_BUILTIN_TIERS, READ_DENY_DEFAULT_TIERS, parseReadDenyBuiltinTiers } from './readDenyTiers.js';
|
|
170
|
+
export { MODE_ARBITRATION, askSurvivesStandingAnswer } from './askSurvivesStandingAnswer.js';
|
|
156
171
|
export * from './liveInitToolFace.js';
|
|
157
172
|
export * from './printInitToolFace.js';
|
|
158
173
|
export * from './model/providerPresets.js';
|
|
@@ -161,7 +176,7 @@ export * from './hitl/suspendedReopen.js';
|
|
|
161
176
|
export * from './hitl/approvalOutcomeNote.js';
|
|
162
177
|
export * from './hitl/approvalResolution.js';
|
|
163
178
|
export { toolEndOutputText, ENGINE_ABORT_TOOL_RESULT } from './hitl/frameRouter.js';
|
|
164
|
-
export { _resetHitlHostSurfaceForTest, CANCEL_DENY_BUDGET_MS, CANCEL_DENY_WARN_TEXT, EDIT_NOT_FORWARDED_WARN_TEXT, EDIT_REFUSED_ON_BLIND_ASK_WARN_TEXT, hitlHostSurfaceFor, hitlHostSurfaceMisses, hitlHostSurfaceMissesFor, installHitlHostSurface, installHitlHostSurfaceFor, observeCancelByDeny, REMEMBER_NOT_APPLIED_WARN_TEXT, RULE_NOT_SENT_REJECTED_WARN_TEXT, RULE_NOT_SENT_WARN_TEXT, surfaceEditRefusedOnBlindAsk, surfaceForCurrentSession, surfaceRememberNotApplied, } from './hitl/hitlHostSurface.js';
|
|
179
|
+
export { _resetHitlHostSurfaceForTest, CANCEL_DENY_BUDGET_MS, CANCEL_DENY_WARN_TEXT, EDIT_NOT_FORWARDED_WARN_TEXT, EDIT_REFUSED_ON_BLIND_ASK_WARN_TEXT, hitlHostSurfaceFor, hitlHostSurfaceMisses, hitlHostSurfaceMissesFor, installHitlHostSurface, installHitlHostSurfaceFor, observeCancelByDeny, REMEMBER_NOT_APPLIED_WARN_TEXT, REPLAYED_APPROVAL_LIST_UNREADABLE_WARN_TEXT, RULE_NOT_SENT_REJECTED_WARN_TEXT, RULE_NOT_SENT_WARN_TEXT, surfaceEditRefusedOnBlindAsk, surfaceForCurrentSession, surfaceRememberNotApplied, } from './hitl/hitlHostSurface.js';
|
|
165
180
|
export * from './hitl/toolApprovalWire.js';
|
|
166
181
|
export * from './hitl/editedRuleTextPrecheck.js';
|
|
167
182
|
export * from './coreValuePorts.js';
|
|
@@ -180,8 +195,12 @@ export * from './hitl/sessionPolicyWire.js';
|
|
|
180
195
|
export * from './hitl/sessionPolicyDeliverable.js';
|
|
181
196
|
export * from './hitl/approvalsFeed.js';
|
|
182
197
|
export * from './hitl/livePendingAsk.js';
|
|
198
|
+
export { replayedApprovalDisposition } from './hitl/replayedApproval.js';
|
|
183
199
|
export * from './hitl/askSurvivesPosture.js';
|
|
184
|
-
export
|
|
200
|
+
export { automaticAnswerVerdict, } from './hitl/automaticAnswerVerdict.js';
|
|
201
|
+
export { readApprovalAllowRuleShadow, approvalAllowRuleShadowed, } from './hitl/allowRuleShadow.js';
|
|
202
|
+
export { projectCrashConverged } from './hitl/crashConverged.js';
|
|
203
|
+
export * from './hitl/crashConvergedNotice.js';
|
|
185
204
|
export * from './interactiveHalt.js';
|
|
186
205
|
export * from './compensations.js';
|
|
187
206
|
export * from './request/printNotification.js';
|
package/dist/inheritEnvWire.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { INHERIT_ENV_WORDS, isInheritEnvWord } from './request/taskRequest.js';
|
|
2
2
|
import { settingsPermissionBucketRefusalFromError } from './wireRefusalCopy.js';
|
|
3
|
+
import { engineVersionTier } from './supportFloor.js';
|
|
3
4
|
export const INHERIT_ENV_MIN_SERVER = Object.freeze([7, 106, 0]);
|
|
4
5
|
export function inheritEnvServerSupport(version) {
|
|
5
6
|
const mm = typeof version === 'string' ? /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/.exec(version) : null;
|
|
@@ -21,11 +22,9 @@ export function inheritEnvDeclaration(word, serverVersion) {
|
|
|
21
22
|
if (!isInheritEnvWord(word)) {
|
|
22
23
|
throw new TypeError(`inheritEnvDeclaration: inheritEnv 只接受 ${INHERIT_ENV_WORDS.map((w) => `'${w}'`).join(' / ')} 或缺席 —— 收到 ${Array.isArray(word) ? 'typeof=object / array' : `typeof=${typeof word}`}。坏词在版本判定之前就拒:「这一次不发」不许顺手吞掉一个打错字的声明。错误文本只报形状,不回显值。`);
|
|
23
24
|
}
|
|
24
|
-
|
|
25
|
-
if (support === 'supported')
|
|
25
|
+
if (engineVersionTier(serverVersion) !== 'unknown')
|
|
26
26
|
return Object.freeze({ field: Object.freeze({ inheritEnv: word }) });
|
|
27
|
-
|
|
28
|
-
return Object.freeze({ field: Object.freeze({}), withheld: Object.freeze({ cause, word }) });
|
|
27
|
+
return Object.freeze({ field: Object.freeze({}), withheld: Object.freeze({ cause: 'server_version_unknown', word }) });
|
|
29
28
|
}
|
|
30
29
|
const WITHHELD_NOTICES = Object.freeze({
|
|
31
30
|
server_too_old: Object.freeze({
|
|
@@ -77,7 +76,7 @@ export function inheritEnvRefusalFromError(err, sentRequest) {
|
|
|
77
76
|
return null;
|
|
78
77
|
}
|
|
79
78
|
}
|
|
80
|
-
const REFUSAL_NOT_ACCEPTED = 'The engine refused this request as invalid
|
|
79
|
+
const REFUSAL_NOT_ACCEPTED = 'The engine refused this request as invalid, under a refusal code that many different request fields share · ' +
|
|
81
80
|
"This request asked for the shell to inherit this machine's whole environment, which the engine accepts only when tools run directly on its own machine and the request belongs to a session; if that is what it refused, send it again without that setting (or with the default)";
|
|
82
81
|
export function inheritEnvRefusalContent(_detail) {
|
|
83
82
|
return REFUSAL_NOT_ACCEPTED;
|
|
@@ -16,6 +16,8 @@ export declare function setLiveModelCatalogRefresher(fn: (() => Promise<LiveMode
|
|
|
16
16
|
export declare function refreshLiveModelCatalog(): Promise<boolean>;
|
|
17
17
|
export declare function getLiveModelCatalog(): LiveModelCatalog | null;
|
|
18
18
|
export declare function normalizeLiveModelRef(ref: string): string;
|
|
19
|
+
export type ImageVision = 'yes' | 'no' | 'unknown';
|
|
20
|
+
export declare function imageVisionOf(model: string | undefined, catalog?: LiveModelCatalog | null): ImageVision;
|
|
19
21
|
export declare function liveDefaultModelName(): string | null;
|
|
20
22
|
export interface RoutePairingVerdict {
|
|
21
23
|
verdict: 'ok' | 'broken' | 'unknown';
|