@sema-agent/client-core 0.97.1 → 0.98.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 +408 -0
- package/README.md +74 -37
- package/dist/adapt/arms.d.ts +1 -0
- package/dist/adapt/arms.js +128 -34
- package/dist/adapt/ids.d.ts +12 -1
- package/dist/adapt/ids.js +59 -8
- package/dist/adapt/instanceLedger.d.ts +50 -0
- package/dist/adapt/instanceLedger.js +147 -0
- package/dist/adapt/textStream.d.ts +1 -0
- package/dist/adapt/textStream.js +24 -7
- package/dist/adapt/toolCards.d.ts +27 -5
- package/dist/adapt/toolCards.js +39 -6
- package/dist/adapt/wireShapes.js +6 -2
- package/dist/adapt.d.ts +2 -0
- package/dist/adapt.js +8 -3
- package/dist/adapter/activeRunSelfHeal.d.ts +5 -0
- package/dist/adapter/activeRunSelfHeal.js +51 -28
- package/dist/adapter/downstream/eventToSdkMessage.d.ts +2 -5
- package/dist/adapter/downstream/eventToSdkMessage.js +27 -34
- package/dist/adapter/downstream/terminalToSdkResult.js +11 -4
- package/dist/adapter/downstream/turnUsageToModelUsage.d.ts +5 -2
- package/dist/adapter/downstream/turnUsageToModelUsage.js +2 -0
- package/dist/adapter/runStream.js +29 -13
- package/dist/adapter/types.d.ts +4 -4
- package/dist/agentSession/backgroundView.js +2 -1
- package/dist/agentSession/engineAgentRegistryRead.d.ts +2 -2
- package/dist/agentSession/engineAgentRegistryRead.js +12 -13
- package/dist/agentsWireCaps.d.ts +8 -8
- package/dist/agentsWireCaps.js +168 -175
- package/dist/approvalDecidedByCapability.d.ts +0 -4
- package/dist/approvalDecidedByCapability.js +0 -6
- package/dist/approvalsStreamLiveCapability.d.ts +0 -4
- package/dist/approvalsStreamLiveCapability.js +0 -6
- package/dist/assistantInbox.d.ts +34 -0
- package/dist/assistantInbox.js +118 -0
- package/dist/centerWiringCapability.js +9 -1
- package/dist/clientSlice.d.ts +0 -9
- package/dist/clientSlice.js +0 -3
- package/dist/cloudConfigWireCaps.d.ts +4 -2
- package/dist/cloudConfigWireCaps.js +81 -61
- package/dist/compensations.js +1 -1
- package/dist/connectorStatus.d.ts +21 -0
- package/dist/connectorStatus.js +112 -0
- package/dist/controlRouter.d.ts +14 -1
- package/dist/controlRouter.js +68 -17
- package/dist/coreValuePorts.d.ts +3 -3
- package/dist/decideReceipt.d.ts +2 -2
- package/dist/decideReceipt.js +5 -2
- package/dist/declared/supportFloorDeclared.js +3 -3
- package/dist/deviceExecutorManagementCapability.d.ts +0 -4
- package/dist/deviceExecutorManagementCapability.js +0 -6
- package/dist/deviceRebind.d.ts +49 -1
- package/dist/deviceRebind.js +221 -3
- package/dist/displayUntrusted.d.ts +1 -0
- package/dist/displayUntrusted.js +250 -76
- package/dist/engineAgentAbsence.d.ts +1 -1
- package/dist/engineAgentPanelStore.d.ts +5 -4
- package/dist/engineAgentPanelStore.js +3 -12
- package/dist/engineCapReader.d.ts +0 -4
- package/dist/engineCapReader.js +1 -5
- package/dist/engineCapsCache.d.ts +4 -0
- package/dist/engineCapsCache.js +17 -12
- package/dist/engineClosedSets.d.ts +1 -0
- package/dist/engineClosedSets.js +4 -1
- package/dist/engineErrorCodes.d.ts +9 -2
- package/dist/engineErrorCodes.js +9 -1
- package/dist/engineIdentity.d.ts +1 -0
- package/dist/engineIdentity.js +8 -0
- package/dist/engineRowRef.d.ts +28 -0
- package/dist/engineRowRef.js +111 -0
- package/dist/engineSessionMessages.d.ts +67 -0
- package/dist/engineSessionMessages.js +364 -0
- package/dist/engineToolDirectory.d.ts +0 -9
- package/dist/engineToolDirectory.js +1 -94
- package/dist/engineUrl.d.ts +18 -0
- package/dist/engineUrl.js +52 -0
- package/dist/env/uiLanguage.d.ts +9 -0
- package/dist/env/uiLanguage.js +35 -0
- package/dist/eventLeg.d.ts +92 -0
- package/dist/eventLeg.js +285 -0
- package/dist/executionLaneCapability.d.ts +0 -4
- package/dist/executionLaneCapability.js +3 -16
- package/dist/fileHistoryCaptureCapability.d.ts +0 -4
- package/dist/fileHistoryCaptureCapability.js +5 -7
- package/dist/fleet/fleetLedger.d.ts +0 -3
- package/dist/fleet/fleetLedger.js +21 -36
- package/dist/fleet/fleetProjection.d.ts +2 -2
- package/dist/fleet/fleetProjection.js +10 -8
- package/dist/frameBinding.d.ts +5 -0
- package/dist/frameBinding.js +23 -0
- package/dist/gateFailureCodes.d.ts +2 -0
- package/dist/gateFailureCodes.js +15 -0
- package/dist/gateOutcome.d.ts +3 -1
- package/dist/gateOutcome.js +25 -6
- package/dist/gateVocabulary.d.ts +5 -0
- package/dist/gateVocabulary.js +64 -2
- package/dist/generated/engineAskFaceTables.js +2 -2
- package/dist/generated/engineFactTables.d.ts +6 -3
- package/dist/generated/engineFactTables.js +22 -4
- package/dist/generated/engineNoticeTables.js +9 -0
- package/dist/generated/toolNameTables.d.ts +1 -0
- package/dist/generated/toolNameTables.js +1 -0
- package/dist/hitl/allowRuleShadow.d.ts +6 -1
- package/dist/hitl/allowRuleShadow.js +21 -17
- package/dist/hitl/approvalCardReading.d.ts +15 -0
- package/dist/hitl/approvalCardReading.js +154 -0
- package/dist/hitl/approvalCardReasons.d.ts +13 -0
- package/dist/hitl/approvalCardReasons.js +120 -0
- package/dist/hitl/approvalHolds.d.ts +47 -15
- package/dist/hitl/approvalHolds.js +134 -28
- package/dist/hitl/approvalResolution.d.ts +51 -26
- package/dist/hitl/approvalResolution.js +86 -122
- package/dist/hitl/approvalsFeed.js +6 -18
- package/dist/hitl/askClassPair.d.ts +2 -0
- package/dist/hitl/askClassPair.js +1 -0
- package/dist/hitl/askGateWire.d.ts +20 -2
- package/dist/hitl/askGateWire.js +49 -1
- package/dist/hitl/askParkRowRouting.d.ts +5 -0
- package/dist/hitl/askParkRowRouting.js +32 -1
- package/dist/hitl/askSettlementLine.d.ts +18 -0
- package/dist/hitl/askSettlementLine.js +79 -0
- package/dist/hitl/automaticAnswerVerdict.d.ts +1 -1
- package/dist/hitl/automaticAnswerVerdict.js +21 -5
- package/dist/hitl/crashConverged.d.ts +11 -20
- package/dist/hitl/crashConverged.js +56 -0
- package/dist/hitl/crashConvergedNotice.d.ts +3 -1
- package/dist/hitl/crashConvergedNotice.js +48 -11
- package/dist/hitl/decisionConflict.js +3 -10
- package/dist/hitl/decisionRefusal.d.ts +40 -1
- package/dist/hitl/decisionRefusal.js +199 -42
- package/dist/hitl/frameRouter.d.ts +5 -2
- package/dist/hitl/frameRouter.js +20 -16
- package/dist/hitl/gateLedger.d.ts +2 -0
- package/dist/hitl/gateLedger.js +50 -13
- package/dist/hitl/hitlBridge.d.ts +1 -2
- package/dist/hitl/hitlBridge.js +10 -7
- package/dist/hitl/livePendingAsk.d.ts +3 -3
- package/dist/hitl/livePendingAsk.js +7 -18
- package/dist/hitl/parkResolver.d.ts +2 -24
- package/dist/hitl/parkResolver.js +61 -97
- package/dist/hitl/persistedRulesWire.d.ts +24 -0
- package/dist/hitl/persistedRulesWire.js +122 -2
- package/dist/hitl/planReviewWire.d.ts +26 -13
- package/dist/hitl/planReviewWire.js +112 -78
- package/dist/hitl/refusedToolNameProse.d.ts +0 -1
- package/dist/hitl/refusedToolNameProse.js +0 -3
- package/dist/hitl/replayedApproval.d.ts +4 -3
- package/dist/hitl/replayedApproval.js +7 -4
- package/dist/hitl/sessionPolicyDeliverable.js +2 -4
- package/dist/hitl/sessionPolicyWire.d.ts +32 -20
- package/dist/hitl/sessionPolicyWire.js +162 -52
- package/dist/hitl/standingRows.d.ts +20 -2
- package/dist/hitl/standingRows.js +69 -8
- package/dist/hitl/toolApprovalWire.d.ts +87 -152
- package/dist/hitl/toolApprovalWire.js +591 -380
- package/dist/hookMatcherVerdict.d.ts +6 -1
- package/dist/hookMatcherVerdict.js +14 -7
- package/dist/hooksWireCaps.d.ts +2 -2
- package/dist/hooksWireCaps.js +59 -55
- package/dist/i18n/messages.en.d.ts +121 -0
- package/dist/i18n/messages.en.js +119 -0
- package/dist/i18n/messages.zh.d.ts +3 -0
- package/dist/i18n/messages.zh.js +120 -0
- package/dist/i18n/translate.d.ts +25 -0
- package/dist/i18n/translate.js +127 -0
- package/dist/index.d.ts +53 -20
- package/dist/index.js +38 -11
- package/dist/inheritEnvCapability.d.ts +31 -0
- package/dist/inheritEnvCapability.js +104 -0
- package/dist/liveModelCatalog.d.ts +1 -2
- package/dist/liveModelCatalog.js +2 -6
- package/dist/liveQuestionStore.d.ts +2 -21
- package/dist/mcpLiveness.d.ts +2 -1
- package/dist/mcpProbeWire.d.ts +6 -1
- package/dist/mcpProbeWire.js +1 -1
- package/dist/mcpWireCaps.d.ts +13 -2
- package/dist/mcpWireCaps.js +48 -0
- package/dist/memoryEntriesWire.d.ts +4 -9
- package/dist/model/modelSupplyRules.d.ts +0 -2
- package/dist/model/modelSupplyRules.js +3 -12
- package/dist/model/modelsPolicy.d.ts +0 -5
- package/dist/model/modelsPolicy.js +6 -36
- package/dist/model/subagentModelWord.d.ts +31 -0
- package/dist/model/subagentModelWord.js +261 -0
- package/dist/notifications.d.ts +6 -0
- package/dist/notifications.js +71 -23
- package/dist/outputStyleSeatCapability.d.ts +0 -3
- package/dist/outputStyleSeatCapability.js +0 -3
- package/dist/ownKey.d.ts +15 -0
- package/dist/ownKey.js +60 -3
- package/dist/panelReduce.d.ts +15 -9
- package/dist/panelReduce.js +680 -549
- package/dist/panelStateHolder.d.ts +3 -7
- package/dist/panelStateHolder.js +14 -130
- package/dist/peerLaneCapability.d.ts +0 -4
- package/dist/peerLaneCapability.js +0 -6
- package/dist/permissionRulesWriteCapability.d.ts +0 -4
- package/dist/permissionRulesWriteCapability.js +0 -6
- package/dist/permissionWireCaps.d.ts +2 -2
- package/dist/permissionWireCaps.js +2 -0
- package/dist/permissionsAllowGrantCapability.d.ts +0 -4
- package/dist/permissionsAllowGrantCapability.js +0 -6
- package/dist/permissionsDeclaration.d.ts +0 -11
- package/dist/permissionsDeclaration.js +60 -53
- package/dist/pluginHooksWire.d.ts +1 -1
- package/dist/pluginHooksWire.js +3 -6
- package/dist/preemptWire.d.ts +44 -0
- package/dist/preemptWire.js +83 -0
- package/dist/printToolResultFrame.js +15 -4
- package/dist/replayBody.d.ts +3 -0
- package/dist/replayBody.js +14 -0
- package/dist/request/taskRequest.d.ts +0 -1
- package/dist/request/taskRequest.js +0 -3
- package/dist/resumeRefusalCopy.d.ts +2 -1
- package/dist/resumeRefusalCopy.js +38 -2
- package/dist/retryStatus.d.ts +8 -0
- package/dist/retryStatus.js +106 -1
- package/dist/rewindArchiveCapability.d.ts +0 -4
- package/dist/rewindArchiveCapability.js +2 -10
- package/dist/rewindArchiveReading.d.ts +0 -1
- package/dist/rewindArchiveReading.js +0 -3
- package/dist/runCancelContext.d.ts +2 -1
- package/dist/runCancelContext.js +4 -2
- package/dist/runReattachPolicy.d.ts +31 -0
- package/dist/runReattachPolicy.js +46 -0
- package/dist/runTerminal.d.ts +3 -6
- package/dist/runTerminal.js +8 -9
- package/dist/sandboxWire.d.ts +3 -1
- package/dist/sandboxWire.js +76 -27
- package/dist/scenarioWire.js +1 -1
- package/dist/seam.d.ts +24 -2
- package/dist/seam.js +15 -3
- package/dist/seatContract.d.ts +53 -10
- package/dist/seatContract.js +132 -81
- package/dist/sessionPolicyCapability.d.ts +0 -4
- package/dist/sessionPolicyCapability.js +0 -6
- package/dist/sessionSyncFileHistoryCapability.d.ts +0 -3
- package/dist/sessionSyncFileHistoryCapability.js +0 -3
- package/dist/skillToolListsCapability.d.ts +0 -3
- package/dist/skillToolListsCapability.js +0 -3
- package/dist/sqlEngineCapability.d.ts +0 -4
- package/dist/sqlEngineCapability.js +0 -6
- package/dist/steerPriorityCapability.d.ts +0 -3
- package/dist/steerPriorityCapability.js +0 -3
- package/dist/streamDrainingLegs.d.ts +4 -0
- package/dist/streamDrainingLegs.js +6 -1
- package/dist/subagent/engineCompactWire.d.ts +0 -1
- package/dist/subagent/engineCompactWire.js +7 -5
- package/dist/subagent/engineTaskHandleWire.js +4 -7
- package/dist/subagentContentStore.js +1 -11
- package/dist/submitReopen.d.ts +24 -0
- package/dist/submitReopen.js +75 -0
- package/dist/terminalStatuses.d.ts +3 -0
- package/dist/terminalStatuses.js +10 -2
- package/dist/toolResult.d.ts +10 -1
- package/dist/toolResult.js +34 -6
- package/dist/toolRoster.d.ts +0 -2
- package/dist/toolRoster.js +0 -2
- package/dist/turnFailurePresentation.d.ts +28 -0
- package/dist/turnFailurePresentation.js +205 -0
- package/dist/userInvokedSkillsCapability.d.ts +0 -3
- package/dist/userInvokedSkillsCapability.js +0 -3
- package/dist/webSearchBackendCapability.d.ts +0 -4
- package/dist/webSearchBackendCapability.js +0 -6
- package/dist/wireErrorTriage.js +5 -24
- package/dist/wireFailureShape.d.ts +62 -5
- package/dist/wireFailureShape.js +105 -5
- package/dist/wireRefusalCopy.d.ts +12 -2
- package/dist/wireRefusalCopy.js +50 -52
- package/dist/workflowsJournalCapability.d.ts +0 -4
- package/dist/workflowsJournalCapability.js +0 -6
- package/dist/writeProtectionCapability.d.ts +0 -4
- package/dist/writeProtectionCapability.js +0 -6
- package/docs/INTEGRATION-CLIENTS.md +1253 -46
- package/package.json +5 -4
- package/dist/attachmentSeatCapability.d.ts +0 -12
- package/dist/attachmentSeatCapability.js +0 -23
- package/dist/hitl/approvalOutcomeNote.d.ts +0 -10
- package/dist/hitl/approvalOutcomeNote.js +0 -29
- package/dist/sessionReadRedactionCapability.d.ts +0 -13
- package/dist/sessionReadRedactionCapability.js +0 -35
|
@@ -44,7 +44,7 @@ export function readEngineActiveBgTasksFor(sessionKey) {
|
|
|
44
44
|
for (const view of viewsFor(sessionKey)) {
|
|
45
45
|
try {
|
|
46
46
|
const r = view.read();
|
|
47
|
-
if (r.
|
|
47
|
+
if (r.fresh)
|
|
48
48
|
fresh = true;
|
|
49
49
|
for (const row of r.rows)
|
|
50
50
|
byId.set(row.id, row);
|
|
@@ -146,7 +146,6 @@ export function createFleetLedger(hooks = {}, opts = {}) {
|
|
|
146
146
|
let droppedUnknownFrame = 0;
|
|
147
147
|
let droppedForeignBgNotification = 0;
|
|
148
148
|
let droppedStaleIngress = 0;
|
|
149
|
-
let connected = false;
|
|
150
149
|
let version = null;
|
|
151
150
|
let scoped = null;
|
|
152
151
|
let sessionScopedMeta;
|
|
@@ -154,12 +153,12 @@ export function createFleetLedger(hooks = {}, opts = {}) {
|
|
|
154
153
|
let disposed = false;
|
|
155
154
|
let epochSeq = 0;
|
|
156
155
|
let liveStreamEpoch = 0;
|
|
156
|
+
let deliveredStreamEpoch = 0;
|
|
157
157
|
let liveSnapshotEpoch = 0;
|
|
158
158
|
let streamAnchor;
|
|
159
|
-
let everIssuedStream = false;
|
|
160
159
|
let contentAnchor;
|
|
161
160
|
let contentAnchorSet = false;
|
|
162
|
-
|
|
161
|
+
const streamDelivering = () => !disposed && liveStreamEpoch !== 0 && deliveredStreamEpoch === liveStreamEpoch;
|
|
163
162
|
const debug = (line) => {
|
|
164
163
|
if (engineWireDebugEnabled())
|
|
165
164
|
hostLog('debug', line);
|
|
@@ -242,7 +241,7 @@ export function createFleetLedger(hooks = {}, opts = {}) {
|
|
|
242
241
|
continue;
|
|
243
242
|
rows.push(toBgTask(r.row, true));
|
|
244
243
|
}
|
|
245
|
-
return {
|
|
244
|
+
return { fresh: streamDelivering(), rows };
|
|
246
245
|
},
|
|
247
246
|
sessionScoped: () => sessionScopedMeta,
|
|
248
247
|
clearRetained: () => {
|
|
@@ -259,7 +258,6 @@ export function createFleetLedger(hooks = {}, opts = {}) {
|
|
|
259
258
|
views.add(bgView);
|
|
260
259
|
}
|
|
261
260
|
function applyFrame(frame, ing) {
|
|
262
|
-
ledgerWrites++;
|
|
263
261
|
switch (frame.type) {
|
|
264
262
|
case 'meta': {
|
|
265
263
|
version = frame.version;
|
|
@@ -324,7 +322,7 @@ export function createFleetLedger(hooks = {}, opts = {}) {
|
|
|
324
322
|
if (parentOwned)
|
|
325
323
|
recordOwnEngineRun(childTid);
|
|
326
324
|
if (parentOwned || sessionScopedMeta === true) {
|
|
327
|
-
recordBgParentRun(childTid, parentTid, ing
|
|
325
|
+
recordBgParentRun(childTid, parentTid, ing.session, ing.sessionKey);
|
|
328
326
|
}
|
|
329
327
|
else {
|
|
330
328
|
debug(`[fleet-frame] task row parent-map SKIPPED foreign/unowned(row=${row.id} parent=${parentTid})`);
|
|
@@ -409,7 +407,7 @@ export function createFleetLedger(hooks = {}, opts = {}) {
|
|
|
409
407
|
return;
|
|
410
408
|
}
|
|
411
409
|
const serverFailClosed = bgNotifyFailClosedMeta && sessionScopedMeta === true;
|
|
412
|
-
const anchor = ing
|
|
410
|
+
const anchor = ing.session;
|
|
413
411
|
const ownByRoot = typeof n.rootSessionId === 'string' &&
|
|
414
412
|
n.rootSessionId.length > 0 &&
|
|
415
413
|
n.rootSessionId === anchor;
|
|
@@ -423,16 +421,14 @@ export function createFleetLedger(hooks = {}, opts = {}) {
|
|
|
423
421
|
return;
|
|
424
422
|
}
|
|
425
423
|
const defaultSlot = sessionKey === DEFAULT_SESSION_KEY;
|
|
426
|
-
const viaIngress = ing !== null;
|
|
427
|
-
const ownRootTrusted = defaultSlot || viaIngress;
|
|
428
424
|
const serverFailClosedTrusted = defaultSlot;
|
|
429
425
|
const trustedSessionArm = serverFailClosed && serverFailClosedTrusted
|
|
430
426
|
? 'server_fail_closed'
|
|
431
|
-
: ownByRoot
|
|
427
|
+
: ownByRoot
|
|
432
428
|
? 'own_root'
|
|
433
429
|
: undefined;
|
|
434
430
|
const evidence = trustedSessionArm ??
|
|
435
|
-
(serverFailClosed
|
|
431
|
+
(serverFailClosed
|
|
436
432
|
? 'session_anchor_untrusted'
|
|
437
433
|
: typeof n.parentTaskId === 'string' && n.parentTaskId.length > 0
|
|
438
434
|
? 'own_parent'
|
|
@@ -446,7 +442,7 @@ export function createFleetLedger(hooks = {}, opts = {}) {
|
|
|
446
442
|
}
|
|
447
443
|
if (isSdkFleetTaskTerminal(n.status)) {
|
|
448
444
|
if (typeof n.parentTaskId === 'string' && n.parentTaskId) {
|
|
449
|
-
recordBgParentRun(n.taskId, n.parentTaskId, ing
|
|
445
|
+
recordBgParentRun(n.taskId, n.parentTaskId, ing.session, ing.sessionKey);
|
|
450
446
|
}
|
|
451
447
|
if (typeof n.transcriptId === 'string' && n.transcriptId.length > 0) {
|
|
452
448
|
recordEngineTranscriptId(n.taskId, n.transcriptId);
|
|
@@ -629,9 +625,13 @@ export function createFleetLedger(hooks = {}, opts = {}) {
|
|
|
629
625
|
` type=${String(frame.type)})`);
|
|
630
626
|
return;
|
|
631
627
|
}
|
|
632
|
-
|
|
628
|
+
if (kind === 'stream')
|
|
629
|
+
deliveredStreamEpoch = epoch;
|
|
630
|
+
else
|
|
631
|
+
closed = true;
|
|
633
632
|
contentAnchor = session;
|
|
634
633
|
contentAnchorSet = true;
|
|
634
|
+
applyFrame(frame, { session, sessionKey });
|
|
635
635
|
},
|
|
636
636
|
close() {
|
|
637
637
|
closed = true;
|
|
@@ -649,8 +649,7 @@ export function createFleetLedger(hooks = {}, opts = {}) {
|
|
|
649
649
|
bgNotifyFailClosedMeta = false;
|
|
650
650
|
debug(`[fleet-frame] 连接级 meta 复位(${why})—— 新连接自报之前不许沿用上一条连接的让位/信任位`);
|
|
651
651
|
};
|
|
652
|
-
const
|
|
653
|
-
const shouldResetContentFor = (session) => contentAnchorSet ? contentAnchor !== session : hasLedgerContent();
|
|
652
|
+
const shouldResetContentFor = (session) => contentAnchorSet && contentAnchor !== session;
|
|
654
653
|
const resetLedgerContentOnSessionChange = (from, to) => {
|
|
655
654
|
taskMap.clear();
|
|
656
655
|
wfMap.clear();
|
|
@@ -664,21 +663,14 @@ export function createFleetLedger(hooks = {}, opts = {}) {
|
|
|
664
663
|
'(换会话不是重连:再渲上一会话的行就是跨会话残影)');
|
|
665
664
|
};
|
|
666
665
|
return {
|
|
667
|
-
applyFrame(frame) {
|
|
668
|
-
if (disposed)
|
|
669
|
-
return;
|
|
670
|
-
applyFrame(frame, null);
|
|
671
|
-
},
|
|
672
666
|
issueStream() {
|
|
673
667
|
const session = engineSessionParamFor(sessionKey);
|
|
674
|
-
if (shouldResetContentFor(session))
|
|
675
|
-
resetLedgerContentOnSessionChange(
|
|
676
|
-
}
|
|
668
|
+
if (shouldResetContentFor(session))
|
|
669
|
+
resetLedgerContentOnSessionChange(contentAnchor, session);
|
|
677
670
|
resetConnectionMeta('新 stream ingress');
|
|
678
671
|
const epoch = ++epochSeq;
|
|
679
672
|
liveStreamEpoch = epoch;
|
|
680
673
|
streamAnchor = session;
|
|
681
|
-
everIssuedStream = true;
|
|
682
674
|
liveSnapshotEpoch = 0;
|
|
683
675
|
debug(`[fleet-frame] ingress issued(kind=stream key=${sessionKey} epoch=${epoch} session=${session ?? '-'})`);
|
|
684
676
|
return {
|
|
@@ -688,13 +680,11 @@ export function createFleetLedger(hooks = {}, opts = {}) {
|
|
|
688
680
|
},
|
|
689
681
|
issueSnapshot(snapOpts) {
|
|
690
682
|
const inStreamMode = liveStreamEpoch !== 0;
|
|
691
|
-
const
|
|
692
|
-
const duringLiveStream = inStreamMode || compatStreamLive;
|
|
683
|
+
const duringLiveStream = inStreamMode;
|
|
693
684
|
const session = inStreamMode ? streamAnchor : engineSessionParamFor(sessionKey);
|
|
694
685
|
if (!duringLiveStream) {
|
|
695
|
-
if (shouldResetContentFor(session))
|
|
696
|
-
resetLedgerContentOnSessionChange(
|
|
697
|
-
}
|
|
686
|
+
if (shouldResetContentFor(session))
|
|
687
|
+
resetLedgerContentOnSessionChange(contentAnchor, session);
|
|
698
688
|
resetConnectionMeta('快照连接:SDK 封装吞掉了它自己的 meta,不许沿用别条连接的信任位');
|
|
699
689
|
}
|
|
700
690
|
if (inStreamMode) {
|
|
@@ -704,9 +694,8 @@ export function createFleetLedger(hooks = {}, opts = {}) {
|
|
|
704
694
|
const epoch = ++epochSeq;
|
|
705
695
|
liveSnapshotEpoch = epoch;
|
|
706
696
|
debug(`[fleet-frame] ingress issued(kind=snapshot key=${sessionKey} epoch=${epoch} session=${session ?? '-'})`);
|
|
707
|
-
const writesAtIssue = ledgerWrites;
|
|
708
697
|
const issuedDuringStream = duringLiveStream;
|
|
709
|
-
const base = makeIngress('snapshot', epoch, session, () => liveSnapshotEpoch === epoch && !issuedDuringStream
|
|
698
|
+
const base = makeIngress('snapshot', epoch, session, () => liveSnapshotEpoch === epoch && !issuedDuringStream);
|
|
710
699
|
return {
|
|
711
700
|
...base,
|
|
712
701
|
applySnapshot(snapshot) {
|
|
@@ -723,12 +712,8 @@ export function createFleetLedger(hooks = {}, opts = {}) {
|
|
|
723
712
|
},
|
|
724
713
|
};
|
|
725
714
|
},
|
|
726
|
-
setConnected(v) {
|
|
727
|
-
connected = v;
|
|
728
|
-
},
|
|
729
715
|
project,
|
|
730
716
|
status: () => ({
|
|
731
|
-
connected,
|
|
732
717
|
version,
|
|
733
718
|
scoped,
|
|
734
719
|
sessionScoped: sessionScopedMeta,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { FleetTaskRow, FleetWorkflowRow } from '@sema-agent/sdk';
|
|
2
|
-
export type FleetTaskStatus
|
|
1
|
+
import type { FleetTaskRow, FleetWorkflowRow, FleetTaskStatus } from '@sema-agent/sdk';
|
|
2
|
+
export type { FleetTaskStatus };
|
|
3
3
|
export interface FleetTaskView {
|
|
4
4
|
id: string;
|
|
5
5
|
name: string;
|
|
@@ -4,7 +4,10 @@ import { cycleSeqValue } from '../cycleOrder.js';
|
|
|
4
4
|
import { frozenSet } from '../frozenSet.js';
|
|
5
5
|
import { CORE_RESERVED_AGENT_NAMES } from '../generated/engineFactTables.js';
|
|
6
6
|
export function coerceTaskStatus(s) {
|
|
7
|
-
|
|
7
|
+
if (s === 'parked')
|
|
8
|
+
return 'awaiting approval';
|
|
9
|
+
const word = s;
|
|
10
|
+
switch (word) {
|
|
8
11
|
case 'queued':
|
|
9
12
|
case 'running':
|
|
10
13
|
case 'waiting':
|
|
@@ -14,11 +17,12 @@ export function coerceTaskStatus(s) {
|
|
|
14
17
|
case 'completed':
|
|
15
18
|
case 'failed':
|
|
16
19
|
case 'killed':
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
return word;
|
|
21
|
+
default: {
|
|
22
|
+
const unhandled = word;
|
|
23
|
+
void unhandled;
|
|
21
24
|
return 'idle';
|
|
25
|
+
}
|
|
22
26
|
}
|
|
23
27
|
}
|
|
24
28
|
export function coerceWorkflowStatus(s) {
|
|
@@ -49,11 +53,9 @@ function deriveAgentLabel(agentType, agentName, name, id) {
|
|
|
49
53
|
const tail = rowIdTail(id).slice(-8);
|
|
50
54
|
return tail ? `agent ${tail}` : 'agent';
|
|
51
55
|
}
|
|
52
|
-
const CONTROL_VERB_LEGACY_NAMES = ['Task', 'Fork'];
|
|
53
56
|
const CONTROL_VERB_GOAL_NAMES = ['DeclareDone'];
|
|
54
57
|
export const CONTROL_TOOL_VERBS = frozenSet([
|
|
55
58
|
...CORE_RESERVED_AGENT_NAMES,
|
|
56
|
-
...CONTROL_VERB_LEGACY_NAMES,
|
|
57
59
|
...CONTROL_VERB_GOAL_NAMES,
|
|
58
60
|
]);
|
|
59
61
|
export function projectDescription(description) {
|
|
@@ -350,5 +352,5 @@ export const FLEET_TASK_ROW_KEYS_NOT_PROJECTED = {
|
|
|
350
352
|
},
|
|
351
353
|
};
|
|
352
354
|
export const FLEET_WORKFLOW_ROW_KEYS_NOT_PROJECTED = {};
|
|
353
|
-
const _fleetViewKeyPins = [true, true, true, true, true, true, true, true
|
|
355
|
+
const _fleetViewKeyPins = [true, true, true, true, true, true, true, true];
|
|
354
356
|
void _fleetViewKeyPins;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { AgentEvent } from '@sema-agent/sdk';
|
|
2
|
+
import type { EngineBoundRun } from './engineRowRef.js';
|
|
3
|
+
export declare function registerFrameBinding(frame: AgentEvent, binding: EngineBoundRun): void;
|
|
4
|
+
export declare function frameBindingOf(frame: AgentEvent): EngineBoundRun | undefined;
|
|
5
|
+
export declare function inheritFrameBinding<T extends AgentEvent>(from: AgentEvent, to: T): T;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const frameBindings = new WeakMap();
|
|
2
|
+
export function registerFrameBinding(frame, binding) {
|
|
3
|
+
if (typeof frame !== 'object' || frame === null)
|
|
4
|
+
return;
|
|
5
|
+
if (binding.taskId === undefined && binding.sessionId === undefined)
|
|
6
|
+
return;
|
|
7
|
+
if (frameBindings.has(frame))
|
|
8
|
+
return;
|
|
9
|
+
frameBindings.set(frame, binding);
|
|
10
|
+
}
|
|
11
|
+
export function frameBindingOf(frame) {
|
|
12
|
+
if (typeof frame !== 'object' || frame === null)
|
|
13
|
+
return undefined;
|
|
14
|
+
return frameBindings.get(frame);
|
|
15
|
+
}
|
|
16
|
+
export function inheritFrameBinding(from, to) {
|
|
17
|
+
if (typeof from !== 'object' || from === null || typeof to !== 'object' || to === null || from === to)
|
|
18
|
+
return to;
|
|
19
|
+
const binding = frameBindings.get(from);
|
|
20
|
+
if (binding !== undefined && !frameBindings.has(to))
|
|
21
|
+
frameBindings.set(to, binding);
|
|
22
|
+
return to;
|
|
23
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DECIDE_WORKFLOW_PARK_FORKED, DECIDE_WORKFLOW_PARKS_UNREADABLE, PARKED_RESUME_STARTUP_FAILED, RESUME_POLICY_FOLD_CODE, RESUME_REOPEN_CODES, RESUME_RETRY_LATER_CODES, isRefusedParkCode } from './engineErrorCodes.js';
|
|
2
|
+
import { RESUME_REFUSAL_CODES } from './resumeRefusalCopy.js';
|
|
3
|
+
export function isGateStandingErrorCode(code, retriable) {
|
|
4
|
+
return (code === RESUME_POLICY_FOLD_CODE ||
|
|
5
|
+
code === 'corrupt' ||
|
|
6
|
+
(isRefusedParkCode(code) && retriable === true) ||
|
|
7
|
+
(typeof code === 'string' && RESUME_REOPEN_CODES.includes(code) && retriable === true) ||
|
|
8
|
+
code === DECIDE_WORKFLOW_PARKS_UNREADABLE ||
|
|
9
|
+
code === DECIDE_WORKFLOW_PARK_FORKED);
|
|
10
|
+
}
|
|
11
|
+
export function isCodeClassifiedGateFailure(code, retriable) {
|
|
12
|
+
return (isGateStandingErrorCode(code, retriable) ||
|
|
13
|
+
code === PARKED_RESUME_STARTUP_FAILED ||
|
|
14
|
+
(typeof code === 'string' && (RESUME_RETRY_LATER_CODES.includes(code) || RESUME_REFUSAL_CODES.includes(code))));
|
|
15
|
+
}
|
package/dist/gateOutcome.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export interface GateModeReleaseView {
|
|
|
32
32
|
mandate?: string;
|
|
33
33
|
reason?: string;
|
|
34
34
|
}
|
|
35
|
-
export declare const GATE_MODE_RELEASE_REASON_WORDS: readonly ["
|
|
35
|
+
export declare const GATE_MODE_RELEASE_REASON_WORDS: readonly ["target_unresolved"];
|
|
36
36
|
export type GateModeReleaseReasonWord = (typeof CORE_MODE_RELEASE_REASONS)[number];
|
|
37
37
|
export declare function isGateModeReleaseReasonWord(v: unknown): v is GateModeReleaseReasonWord;
|
|
38
38
|
export declare function modeReleaseReasonSentence(reason: string | null | undefined): string | undefined;
|
|
@@ -58,10 +58,12 @@ export interface SettlementView {
|
|
|
58
58
|
when?: number;
|
|
59
59
|
note?: string;
|
|
60
60
|
}
|
|
61
|
+
export type GateRecordSeat = 'settlement' | 'cause' | 'classifier';
|
|
61
62
|
export interface GateOutcomeView {
|
|
62
63
|
disposition: GateDispositionView;
|
|
63
64
|
settlement?: SettlementView;
|
|
64
65
|
origin?: string;
|
|
66
|
+
unreadable?: readonly GateRecordSeat[];
|
|
65
67
|
}
|
|
66
68
|
export declare function gateOutcomeOf(frame: unknown): GateOutcomeView | undefined;
|
|
67
69
|
export declare function isGateParkedToolEnd(frame: unknown): boolean;
|
package/dist/gateOutcome.js
CHANGED
|
@@ -10,7 +10,6 @@ export function isGateModeReleaseReasonWord(v) {
|
|
|
10
10
|
return typeof v === 'string' && CORE_MODE_RELEASE_REASONS.includes(v);
|
|
11
11
|
}
|
|
12
12
|
const MODE_RELEASE_SENTENCE_BY_REASON = Object.freeze({
|
|
13
|
-
rule_unreadable: 'The permission mode let this call run without asking, even though it could not be checked against your saved permission rules.',
|
|
14
13
|
target_unresolved: 'The permission mode let this call run without asking, even though it could not be determined where its write lands on disk, so whether it lands on a guarded location is unknown.',
|
|
15
14
|
});
|
|
16
15
|
const MODE_RELEASE_UNRECOGNISED_SENTENCE = 'The permission mode let this call run without asking, for a reason this client does not recognise.';
|
|
@@ -65,6 +64,9 @@ export function createReleaseDisclosureLedger() {
|
|
|
65
64
|
});
|
|
66
65
|
}
|
|
67
66
|
export const SETTLEMENT_KIND_WORDS = CORE_SETTLEMENT_KINDS;
|
|
67
|
+
function isGateRecordSeat(x) {
|
|
68
|
+
return x === 'settlement' || x === 'cause' || x === 'classifier';
|
|
69
|
+
}
|
|
68
70
|
function readWho(v) {
|
|
69
71
|
if (typeof v !== 'object' || v === null || Array.isArray(v))
|
|
70
72
|
return undefined;
|
|
@@ -151,6 +153,15 @@ function readClassifierRound(raw) {
|
|
|
151
153
|
}
|
|
152
154
|
return view;
|
|
153
155
|
}
|
|
156
|
+
function carriedUnreadableSeats(v) {
|
|
157
|
+
const out = new Set();
|
|
158
|
+
if (!Array.isArray(v))
|
|
159
|
+
return out;
|
|
160
|
+
for (const x of v)
|
|
161
|
+
if (isGateRecordSeat(x))
|
|
162
|
+
out.add(x);
|
|
163
|
+
return out;
|
|
164
|
+
}
|
|
154
165
|
function readGateRecord(frame) {
|
|
155
166
|
if (typeof frame !== 'object' || frame === null || Array.isArray(frame))
|
|
156
167
|
return undefined;
|
|
@@ -158,6 +169,7 @@ function readGateRecord(frame) {
|
|
|
158
169
|
if (typeof g !== 'object' || g === null || Array.isArray(g))
|
|
159
170
|
return undefined;
|
|
160
171
|
const raw = g;
|
|
172
|
+
const carried = carriedUnreadableSeats(raw.unreadable);
|
|
161
173
|
const d = raw.disposition;
|
|
162
174
|
if (typeof d !== 'object' || d === null || Array.isArray(d))
|
|
163
175
|
return undefined;
|
|
@@ -180,7 +192,7 @@ function readGateRecord(frame) {
|
|
|
180
192
|
if (deniedBy === undefined)
|
|
181
193
|
return undefined;
|
|
182
194
|
const causeRaw = dr.cause;
|
|
183
|
-
causePresent = causeRaw !== undefined;
|
|
195
|
+
causePresent = causeRaw !== undefined || carried.has('cause');
|
|
184
196
|
const cause = str(causeRaw);
|
|
185
197
|
const mode = str(dr.mode);
|
|
186
198
|
const askClass = str(dr.askClass);
|
|
@@ -201,15 +213,24 @@ function readGateRecord(frame) {
|
|
|
201
213
|
const settlementRaw = raw.settlement;
|
|
202
214
|
const settlement = readSettlement(settlementRaw);
|
|
203
215
|
const origin = readAskOrigin(raw);
|
|
216
|
+
const settlementPresent = settlementRaw !== undefined || carried.has('settlement');
|
|
217
|
+
const classifierPresent = classifierRaw !== undefined || carried.has('classifier');
|
|
218
|
+
const missing = {
|
|
219
|
+
settlement: settlementPresent && settlement === undefined,
|
|
220
|
+
cause: causePresent && disposition.kind === 'denied' && disposition.cause === undefined,
|
|
221
|
+
classifier: classifierPresent && disposition.classifier === undefined,
|
|
222
|
+
};
|
|
223
|
+
const unreadable = Object.keys(missing).filter((seat) => missing[seat]);
|
|
204
224
|
return {
|
|
205
225
|
view: {
|
|
206
226
|
disposition,
|
|
207
227
|
...(settlement !== undefined ? { settlement } : {}),
|
|
208
228
|
...(origin !== undefined ? { origin } : {}),
|
|
229
|
+
...(unreadable.length > 0 ? { unreadable: Object.freeze(unreadable) } : {}),
|
|
209
230
|
},
|
|
210
|
-
settlementPresent
|
|
231
|
+
settlementPresent,
|
|
211
232
|
causePresent,
|
|
212
|
-
classifierPresent
|
|
233
|
+
classifierPresent,
|
|
213
234
|
};
|
|
214
235
|
}
|
|
215
236
|
export function gateOutcomeOf(frame) {
|
|
@@ -257,8 +278,6 @@ export function ccToolDenialKindForToolEnd(frame) {
|
|
|
257
278
|
const stamped = frame._sema_denial_kind;
|
|
258
279
|
if (isCcToolDenialKind(stamped))
|
|
259
280
|
return stamped;
|
|
260
|
-
if (frame._sema_denial_unclassified === true)
|
|
261
|
-
return undefined;
|
|
262
281
|
const record = readGateRecord(frame);
|
|
263
282
|
const outcome = record?.view;
|
|
264
283
|
const kind = outcome?.settlement?.kind;
|
package/dist/gateVocabulary.d.ts
CHANGED
|
@@ -9,6 +9,11 @@ export declare const GATE_DENIED_BY_WORDS: readonly GateDeniedByWord[];
|
|
|
9
9
|
export declare function isGateDeniedByWord(v: unknown): v is GateDeniedByWord;
|
|
10
10
|
export declare function gateDeniedByDetail(deniedBy: unknown): string;
|
|
11
11
|
export declare function askOriginDetail(origin: unknown): string;
|
|
12
|
+
export declare function askOriginNoteOf(origin: string | undefined): string | undefined;
|
|
13
|
+
export declare function ruleOffersAbsenceDetail(reason: string | undefined, opts?: {
|
|
14
|
+
readonly deploymentListSessionRow?: boolean;
|
|
15
|
+
}): string | undefined;
|
|
16
|
+
export declare function ruleOfferUncoveredDetail(reason: string | undefined): string;
|
|
12
17
|
export declare function mandatedApprovalDetail(): string;
|
|
13
18
|
export declare const APPROVAL_MANDATE_WORDS: readonly (typeof CORE_PERSISTED_RULE_MANDATES)[number][];
|
|
14
19
|
export type ApprovalMandateWord = (typeof APPROVAL_MANDATE_WORDS)[number];
|
package/dist/gateVocabulary.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CORE_DENIED_BY_VALUES, CORE_PERSISTED_RULE_MANDATES } from './generated/engineFactTables.js';
|
|
2
|
+
import { guardedRead, readOwnDataValue } from './ownKey.js';
|
|
2
3
|
export const CC_TOOL_DENIAL_KINDS = Object.freeze([
|
|
3
4
|
'user-rejected',
|
|
4
5
|
'permission-rule',
|
|
@@ -48,6 +49,7 @@ export function gateDeniedByDetail(deniedBy) {
|
|
|
48
49
|
}
|
|
49
50
|
const ASK_ORIGIN_SENTENCES = Object.freeze({
|
|
50
51
|
content_question: 'the tool itself asked you a question',
|
|
52
|
+
plan_review: 'the model paused its run for your verdict on the plan it proposed',
|
|
51
53
|
ancestor_marked: 'an ancestor marked this call (an inherited approver-unavailable float, or a durable mandate; this client cannot tell which from the origin alone): it must reach the park with no synchronous decision-maker in between',
|
|
52
54
|
org_unavailable: 'the organization policy was unavailable, so this call asks',
|
|
53
55
|
org_rule: 'an organization rule asks about this call',
|
|
@@ -57,7 +59,7 @@ const ASK_ORIGIN_SENTENCES = Object.freeze({
|
|
|
57
59
|
denial_limit_fallback: 'the auto-mode classifier hit its denial limit and handed this call back to you',
|
|
58
60
|
shell_gate_tighten: 'the coarse shell check rates this command above the tier it lets through, so it asks',
|
|
59
61
|
safety_tighten: 'the gate tightened on this call’s own facts (network egress, irreversibility, or a protected write; this client cannot tell which from the origin alone)',
|
|
60
|
-
policy: 'this deployment’s permission policy asks about this call',
|
|
62
|
+
policy: 'this deployment’s permission policy, or the permission mode’s default, asks about this call',
|
|
61
63
|
});
|
|
62
64
|
export function askOriginDetail(origin) {
|
|
63
65
|
const known = typeof origin === 'string' && Object.hasOwn(ASK_ORIGIN_SENTENCES, origin)
|
|
@@ -66,7 +68,67 @@ export function askOriginDetail(origin) {
|
|
|
66
68
|
if (known !== undefined)
|
|
67
69
|
return known;
|
|
68
70
|
const word = typeof origin === 'string' && origin.length > 0 ? origin : '(none)';
|
|
69
|
-
return
|
|
71
|
+
return unknownAskOriginSentence(word);
|
|
72
|
+
}
|
|
73
|
+
function unknownAskOriginSentence(word) {
|
|
74
|
+
return `this call asks; its origin ${word === undefined ? '' : `${word} `}is a word newer than this client, so answer it as usual`;
|
|
75
|
+
}
|
|
76
|
+
const ASK_ORIGIN_QUIET = Object.freeze({
|
|
77
|
+
content_question: true,
|
|
78
|
+
plan_review: true,
|
|
79
|
+
ancestor_marked: false,
|
|
80
|
+
org_unavailable: false,
|
|
81
|
+
org_rule: false,
|
|
82
|
+
rule_store_unavailable: false,
|
|
83
|
+
hook: false,
|
|
84
|
+
ask_rule: true,
|
|
85
|
+
denial_limit_fallback: false,
|
|
86
|
+
shell_gate_tighten: false,
|
|
87
|
+
safety_tighten: false,
|
|
88
|
+
policy: true,
|
|
89
|
+
});
|
|
90
|
+
export function askOriginNoteOf(origin) {
|
|
91
|
+
if (typeof origin !== 'string' || origin === '')
|
|
92
|
+
return undefined;
|
|
93
|
+
if (Object.hasOwn(ASK_ORIGIN_QUIET, origin)) {
|
|
94
|
+
return ASK_ORIGIN_QUIET[origin] === true ? undefined : askOriginDetail(origin);
|
|
95
|
+
}
|
|
96
|
+
return unknownAskOriginSentence(undefined);
|
|
97
|
+
}
|
|
98
|
+
const NO_REMEMBER_HEAD = 'no "don\'t ask again" option here';
|
|
99
|
+
const RULE_OFFERS_ABSENCE_LINES = Object.freeze({
|
|
100
|
+
mandated: { line: null },
|
|
101
|
+
allow_outranked: {
|
|
102
|
+
line: `${NO_REMEMBER_HEAD}: an allow rule already matches this call, but this question outranks it — another allow rule would be outranked the same way`,
|
|
103
|
+
},
|
|
104
|
+
ask_rule_matched: {
|
|
105
|
+
line: `${NO_REMEMBER_HEAD}: an ask rule matches this call and keeps asking — an allow rule changes nothing while it stands; to stop being asked, review your ask rules`,
|
|
106
|
+
deploymentList: `${NO_REMEMBER_HEAD}: this deployment asks about every call to this tool and your own rules cannot switch that off — the "in this session" option stops it asking again until the session ends`,
|
|
107
|
+
},
|
|
108
|
+
lane_cannot_speak: { line: `${NO_REMEMBER_HEAD}: this approval lane cannot persist rules` },
|
|
109
|
+
});
|
|
110
|
+
export function ruleOffersAbsenceDetail(reason, opts) {
|
|
111
|
+
if (typeof reason !== 'string' || reason === '')
|
|
112
|
+
return undefined;
|
|
113
|
+
if (Object.hasOwn(RULE_OFFERS_ABSENCE_LINES, reason)) {
|
|
114
|
+
const entry = RULE_OFFERS_ABSENCE_LINES[reason];
|
|
115
|
+
if (entry.line === null)
|
|
116
|
+
return undefined;
|
|
117
|
+
const onList = guardedRead(() => readOwnDataValue(opts, 'deploymentListSessionRow')) === true;
|
|
118
|
+
return onList && entry.deploymentList !== undefined ? entry.deploymentList : entry.line;
|
|
119
|
+
}
|
|
120
|
+
return `${NO_REMEMBER_HEAD} (the reason is one this build does not know yet)`;
|
|
121
|
+
}
|
|
122
|
+
const RULE_OFFER_UNCOVERED_LINES = Object.freeze({
|
|
123
|
+
redirection: 'always asks (shell redirection)',
|
|
124
|
+
no_rule_form: 'no coverable rule form',
|
|
125
|
+
cap_overflow: 'trimmed by the offer cap',
|
|
126
|
+
});
|
|
127
|
+
export function ruleOfferUncoveredDetail(reason) {
|
|
128
|
+
if (typeof reason === 'string' && Object.hasOwn(RULE_OFFER_UNCOVERED_LINES, reason)) {
|
|
129
|
+
return RULE_OFFER_UNCOVERED_LINES[reason];
|
|
130
|
+
}
|
|
131
|
+
return 'a reason this build does not know yet';
|
|
70
132
|
}
|
|
71
133
|
export function mandatedApprovalDetail() {
|
|
72
134
|
return 'no saved allow rule and no remembered answer can retire this question; each call is settled on its own — by you here or by an automatic check the deployment runs — and an answer covers only that call';
|
|
@@ -7,6 +7,6 @@ export const CORE_SHELL_FACE_TOOL_NAMES = Object.freeze([
|
|
|
7
7
|
"Monitor",
|
|
8
8
|
]);
|
|
9
9
|
export const CORE_RELEASABLE_ASK_CLASSES_BY_FACE = Object.freeze({
|
|
10
|
-
"shell": Object.freeze(["transcript_write", "
|
|
11
|
-
"other": Object.freeze(["transcript_write", "
|
|
10
|
+
"shell": Object.freeze(["transcript_write", "target_unresolved", "probe", "write_protection", "tool_marks_mcp", "tool_marks_a2a", "artifact_shared_read", "mode", "unstated", "ordinary"]),
|
|
11
|
+
"other": Object.freeze(["transcript_write", "probe", "write_protection", "tool_marks_mcp", "tool_marks_a2a", "artifact_shared_read", "mode", "unstated", "ordinary"]),
|
|
12
12
|
});
|
|
@@ -8,7 +8,7 @@ export declare const CORE_DENIED_BY_VALUES: readonly ["policy", "hook", "org", "
|
|
|
8
8
|
export declare const CORE_PERMISSION_MODE_FOLD_REASONS: readonly string[];
|
|
9
9
|
export declare const CORE_ENGINE_CARD_TYPES: readonly string[];
|
|
10
10
|
export declare const CORE_TOOL_DECLARATION_CODES: readonly string[];
|
|
11
|
-
export declare const CORE_MODE_RELEASE_REASONS: readonly ["
|
|
11
|
+
export declare const CORE_MODE_RELEASE_REASONS: readonly ["target_unresolved"];
|
|
12
12
|
export declare const CORE_HOOK_TOOL_ALIASES: Readonly<Record<string, string>>;
|
|
13
13
|
export declare const CORE_ASK_EVIDENCE_ABSENCE_VALUES: readonly ["not_wired", "not_adjudicated", "unavailable", "no_match", "not_reported"];
|
|
14
14
|
export declare const CORE_SYSTEM_INJECTION_PRIORITIES: readonly ["now", "next", "later"];
|
|
@@ -21,9 +21,9 @@ export interface CoreModeArbitrationRow {
|
|
|
21
21
|
readonly ruleMayClear: boolean;
|
|
22
22
|
readonly hookAskFloor: boolean;
|
|
23
23
|
}
|
|
24
|
-
export declare const CORE_MODE_ARBITRATION: Readonly<Record<"content_question" | "hook" | "ancestor" | "dangerous_delete" | "unverifiable_delete" | "unverifiable_shell_text" | "transcript_write" | "org_rule" | "
|
|
24
|
+
export declare const CORE_MODE_ARBITRATION: Readonly<Record<"content_question" | "hook" | "ancestor" | "dangerous_delete" | "unverifiable_delete" | "unverifiable_shell_text" | "transcript_write" | "org_rule" | "rule_unreadable" | "ask_rule" | "denial_limit_fallback" | "classifier_no_ruling" | "requires_user_interaction" | "operator_forced" | "shell_floor" | "target_unresolved" | "probe" | "write_protection" | "tool_marks_mcp" | "tool_marks_a2a" | "policy_rra" | "artifact_shared_read" | "mode" | "unstated" | "ordinary", CoreModeArbitrationRow>>;
|
|
25
25
|
export declare const CORE_SKILL_GRANT_ORIGINS: readonly ["model", "user", "inherited"];
|
|
26
|
-
export declare const CORE_ALLOW_ENTRY_INERT_REASONS: readonly ["wildcard_all", "namespace_wildcard", "content_unsupported", "grammar", "tool_name", "near_miss"];
|
|
26
|
+
export declare const CORE_ALLOW_ENTRY_INERT_REASONS: readonly ["wildcard_all", "namespace_wildcard", "content_unsupported", "grammar", "tool_name", "near_miss", "earlier_grammar"];
|
|
27
27
|
export declare const CORE_ALLOW_RULE_MEMBERS: readonly ["hook", "deployment", "persisted", "skill", "request"];
|
|
28
28
|
export declare const CORE_RULE_TOOL_NAME_VERDICTS: readonly ["current", "retired", "unprefixed_namespace", "unmintable_segment"];
|
|
29
29
|
export declare const CORE_SETTLEMENT_KINDS: readonly ["human_allowed", "human_refused", "approval_window_expired", "denial_limit_window_expired", "park_sla_expired", "no_approver", "approver_unavailable", "approver_error", "approver_contract", "presentation_failed", "blanket_allow_refused", "policy_allowed", "policy_refused", "task_aborted"];
|
|
@@ -42,3 +42,6 @@ export declare const CORE_PROMPT_BLOCK_CAUSES: readonly ["block", "crashed", "ti
|
|
|
42
42
|
export declare const CORE_PERMISSION_MODES: readonly ["default", "acceptEdits", "plan", "auto", "bypassPermissions", "dontAsk"];
|
|
43
43
|
export declare const CORE_APPROVAL_REACH: readonly ["none"];
|
|
44
44
|
export declare const CORE_PERSISTED_RULE_MANDATES: readonly ["operator_always", "tool_marks", "probe_mandate", "probe_unanswered", "write_protection", "target_unresolved"];
|
|
45
|
+
export declare const CORE_TASK_NOTIFICATION_TERMINAL_STATUSES: readonly ["completed", "failed", "killed", "cancelled"];
|
|
46
|
+
export declare const CORE_RESUME_STARTUP_CAUSES: readonly ["environment", "session_gone", "tool_unavailable", "configuration", "decision_rejected"];
|
|
47
|
+
export declare const CORE_BUILTIN_SUBAGENT_TYPES: readonly ["Explore", "Plan", "fork", "general-purpose"];
|
|
@@ -112,7 +112,6 @@ export const CORE_TOOL_DECLARATION_CODES = Object.freeze([
|
|
|
112
112
|
"config.reserved_tool_name",
|
|
113
113
|
]);
|
|
114
114
|
export const CORE_MODE_RELEASE_REASONS = Object.freeze([
|
|
115
|
-
"rule_unreadable",
|
|
116
115
|
"target_unresolved",
|
|
117
116
|
]);
|
|
118
117
|
export const CORE_HOOK_TOOL_ALIASES = Object.freeze(Object.assign(Object.create(null), Object.fromEntries([
|
|
@@ -146,12 +145,11 @@ export const CORE_MODE_ARBITRATION = Object.freeze({
|
|
|
146
145
|
"hook": Object.freeze({ bypassImmune: true, classifierEligible: false, sandboxAdmission: false, ruleMayClear: false, hookAskFloor: false }),
|
|
147
146
|
"ancestor": Object.freeze({ bypassImmune: true, classifierEligible: false, sandboxAdmission: false, ruleMayClear: false, hookAskFloor: false }),
|
|
148
147
|
"dangerous_delete": Object.freeze({ bypassImmune: true, classifierEligible: false, sandboxAdmission: false, ruleMayClear: false, hookAskFloor: true }),
|
|
149
|
-
"unverifiable_delete": Object.freeze({ bypassImmune: true, classifierEligible:
|
|
148
|
+
"unverifiable_delete": Object.freeze({ bypassImmune: true, classifierEligible: false, sandboxAdmission: false, ruleMayClear: false, hookAskFloor: true }),
|
|
150
149
|
"unverifiable_shell_text": Object.freeze({ bypassImmune: true, classifierEligible: false, sandboxAdmission: false, ruleMayClear: false, hookAskFloor: true }),
|
|
151
150
|
"transcript_write": Object.freeze({ bypassImmune: false, classifierEligible: true, sandboxAdmission: false, ruleMayClear: false, hookAskFloor: true }),
|
|
152
151
|
"org_rule": Object.freeze({ bypassImmune: true, classifierEligible: false, sandboxAdmission: false, ruleMayClear: false, hookAskFloor: false }),
|
|
153
|
-
"
|
|
154
|
-
"rule_unreadable": Object.freeze({ bypassImmune: false, classifierEligible: false, sandboxAdmission: false, ruleMayClear: false, hookAskFloor: false }),
|
|
152
|
+
"rule_unreadable": Object.freeze({ bypassImmune: true, classifierEligible: false, sandboxAdmission: false, ruleMayClear: false, hookAskFloor: false }),
|
|
155
153
|
"ask_rule": Object.freeze({ bypassImmune: true, classifierEligible: false, sandboxAdmission: false, ruleMayClear: false, hookAskFloor: true }),
|
|
156
154
|
"denial_limit_fallback": Object.freeze({ bypassImmune: true, classifierEligible: false, sandboxAdmission: false, ruleMayClear: false, hookAskFloor: false }),
|
|
157
155
|
"classifier_no_ruling": Object.freeze({ bypassImmune: true, classifierEligible: false, sandboxAdmission: false, ruleMayClear: false, hookAskFloor: false }),
|
|
@@ -181,6 +179,7 @@ export const CORE_ALLOW_ENTRY_INERT_REASONS = Object.freeze([
|
|
|
181
179
|
"grammar",
|
|
182
180
|
"tool_name",
|
|
183
181
|
"near_miss",
|
|
182
|
+
"earlier_grammar",
|
|
184
183
|
]);
|
|
185
184
|
export const CORE_ALLOW_RULE_MEMBERS = Object.freeze([
|
|
186
185
|
"hook",
|
|
@@ -281,3 +280,22 @@ export const CORE_PERSISTED_RULE_MANDATES = Object.freeze([
|
|
|
281
280
|
"write_protection",
|
|
282
281
|
"target_unresolved",
|
|
283
282
|
]);
|
|
283
|
+
export const CORE_TASK_NOTIFICATION_TERMINAL_STATUSES = Object.freeze([
|
|
284
|
+
"completed",
|
|
285
|
+
"failed",
|
|
286
|
+
"killed",
|
|
287
|
+
"cancelled",
|
|
288
|
+
]);
|
|
289
|
+
export const CORE_RESUME_STARTUP_CAUSES = Object.freeze([
|
|
290
|
+
"environment",
|
|
291
|
+
"session_gone",
|
|
292
|
+
"tool_unavailable",
|
|
293
|
+
"configuration",
|
|
294
|
+
"decision_rejected",
|
|
295
|
+
]);
|
|
296
|
+
export const CORE_BUILTIN_SUBAGENT_TYPES = Object.freeze([
|
|
297
|
+
"Explore",
|
|
298
|
+
"Plan",
|
|
299
|
+
"fork",
|
|
300
|
+
"general-purpose",
|
|
301
|
+
]);
|