@sema-agent/client-core 0.94.0 → 0.96.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 +521 -0
- package/README.md +104 -57
- package/dist/adapt/arms.js +12 -7
- package/dist/adapt/panelTasks.js +4 -10
- package/dist/adapt/toolCards.d.ts +1 -0
- package/dist/adapt/toolCards.js +18 -5
- package/dist/adapt/wireShapes.js +5 -24
- package/dist/adapter/activeRunSelfHeal.d.ts +12 -3
- package/dist/adapter/activeRunSelfHeal.js +50 -16
- package/dist/adapter/downstream/eventToSdkMessage.js +33 -18
- package/dist/adapter/downstream/terminalToSdkResult.js +19 -12
- package/dist/adapter/runStream.js +30 -46
- package/dist/adapter/types.d.ts +7 -0
- package/dist/adapter/types.js +15 -0
- package/dist/agentSession/backgroundView.js +5 -1
- package/dist/agentSession/engineAgentRegistryRead.js +7 -5
- package/dist/agentSession/engineSessionBackgroundStop.js +25 -17
- package/dist/agentsWireCaps.d.ts +2 -0
- package/dist/agentsWireCaps.js +13 -2
- package/dist/approvalDecidedByCapability.d.ts +0 -1
- package/dist/approvalDecidedByCapability.js +2 -7
- package/dist/approvalsStreamLiveCapability.d.ts +0 -1
- package/dist/approvalsStreamLiveCapability.js +2 -6
- package/dist/atMostOnce.d.ts +8 -0
- package/dist/atMostOnce.js +36 -0
- package/dist/attachmentSeatCapability.d.ts +0 -1
- package/dist/attachmentSeatCapability.js +0 -3
- package/dist/attachmentsWireCaps.js +11 -6
- package/dist/bashExitReading.d.ts +10 -0
- package/dist/bashExitReading.js +12 -0
- package/dist/callerCwdCapability.d.ts +0 -5
- package/dist/callerCwdCapability.js +2 -13
- package/dist/centerWiringCapability.d.ts +1 -7
- package/dist/centerWiringCapability.js +18 -27
- package/dist/classifierStatus.js +4 -4
- package/dist/classifierVerdictWire.js +4 -16
- package/dist/clientSlice.js +1 -1
- package/dist/cloudConfigWireCaps.d.ts +3 -3
- package/dist/cloudConfigWireCaps.js +85 -43
- package/dist/compensations.js +1 -1
- package/dist/coreValuePorts.d.ts +11 -7
- package/dist/coreValuePorts.js +5 -8
- package/dist/credentialProvenance.d.ts +28 -0
- package/dist/credentialProvenance.js +76 -0
- package/dist/cycleOrder.d.ts +15 -0
- package/dist/cycleOrder.js +45 -0
- package/dist/decideFailureNote.js +7 -2
- package/dist/decideReceipt.d.ts +2 -1
- package/dist/decideReceipt.js +39 -14
- package/dist/declared/supportFloorDeclared.d.ts +1 -0
- package/dist/declared/supportFloorDeclared.js +5 -0
- package/dist/deviceExecutorManagementCapability.d.ts +0 -1
- package/dist/deviceExecutorManagementCapability.js +7 -16
- package/dist/deviceRebind.d.ts +88 -0
- package/dist/deviceRebind.js +242 -0
- package/dist/displayUntrusted.d.ts +8 -3
- package/dist/displayUntrusted.js +661 -63
- package/dist/engineAgentAbsence.d.ts +2 -2
- package/dist/engineAgentPanelStore.d.ts +8 -18
- package/dist/engineAgentPanelStore.js +19 -537
- package/dist/engineCapReader.d.ts +6 -6
- package/dist/engineCapReader.js +30 -43
- package/dist/engineCapsCache.d.ts +13 -2
- package/dist/engineCapsCache.js +276 -44
- package/dist/engineCredentialRequirement.d.ts +9 -0
- package/dist/engineCredentialRequirement.js +23 -0
- package/dist/engineDirectory.d.ts +79 -0
- package/dist/engineDirectory.js +186 -0
- package/dist/engineEnvSourcing.d.ts +53 -0
- package/dist/engineEnvSourcing.js +81 -0
- package/dist/engineErrorCodes.d.ts +28 -4
- package/dist/engineErrorCodes.js +68 -25
- package/dist/engineIdentity.js +2 -0
- package/dist/engineNoticeCodes.d.ts +17 -0
- package/dist/engineNoticeCodes.js +57 -3
- package/dist/engineWireSdk.js +2 -2
- package/dist/engineWordRenames.d.ts +8 -0
- package/dist/engineWordRenames.js +13 -0
- package/dist/executionLaneCapability.d.ts +2 -3
- package/dist/executionLaneCapability.js +18 -23
- package/dist/fileHistoryCaptureCapability.d.ts +14 -1
- package/dist/fileHistoryCaptureCapability.js +72 -6
- package/dist/fileHistoryLegNotice.d.ts +3 -2
- package/dist/fileHistoryLegNotice.js +51 -2
- package/dist/fleet/bgSubagentRow.d.ts +15 -0
- package/dist/fleet/bgSubagentRow.js +67 -0
- package/dist/fleet/fleetLedger.d.ts +3 -0
- package/dist/fleet/fleetLedger.js +153 -122
- package/dist/fleet/fleetProjection.d.ts +1 -3
- package/dist/fleet/fleetProjection.js +19 -19
- package/dist/fleetAgentPanelProjection.d.ts +4 -17
- package/dist/fleetAgentPanelProjection.js +7 -197
- package/dist/fleetAgentRowLike.d.ts +16 -0
- package/dist/fleetAgentRowLike.js +1 -0
- package/dist/fleetTaskDesc.js +4 -17
- package/dist/gateOutcome.d.ts +12 -1
- package/dist/gateOutcome.js +87 -18
- package/dist/gateVocabulary.d.ts +7 -2
- package/dist/gateVocabulary.js +5 -1
- package/dist/generated/engineAskFaceTables.js +1 -1
- package/dist/generated/engineFactTables.d.ts +5 -3
- package/dist/generated/engineFactTables.js +17 -4
- package/dist/generated/engineNoticeTables.js +12 -3
- package/dist/generated/sdkFactTables.d.ts +2 -0
- package/dist/generated/sdkFactTables.js +17 -0
- package/dist/generated/settingsSchemaFns.d.ts +13 -0
- package/dist/generated/settingsSchemaFns.js +75 -0
- package/dist/generated/toolNameTables.d.ts +1 -0
- package/dist/generated/toolNameTables.js +1 -0
- package/dist/headlessPermissionModeWire.d.ts +1 -1
- package/dist/headlessPermissionModeWire.js +1 -1
- package/dist/headlessReconnectWire.js +49 -20
- package/dist/hitl/allowRuleShadow.d.ts +1 -1
- package/dist/hitl/allowRuleShadow.js +49 -8
- package/dist/hitl/approvalCompleteParked.d.ts +1 -0
- package/dist/hitl/approvalCompleteParked.js +14 -0
- package/dist/hitl/approvalEndingCause.d.ts +7 -0
- package/dist/hitl/approvalEndingCause.js +71 -0
- package/dist/hitl/approvalHolds.d.ts +12 -2
- package/dist/hitl/approvalHolds.js +53 -2
- package/dist/hitl/approvalsFeed.js +23 -11
- package/dist/hitl/askGateWire.d.ts +2 -1
- package/dist/hitl/askGateWire.js +26 -1
- package/dist/hitl/askParkRowRouting.js +1 -1
- package/dist/hitl/automaticAnswerVerdict.d.ts +1 -1
- package/dist/hitl/automaticAnswerVerdict.js +15 -10
- package/dist/hitl/crashConverged.js +2 -0
- package/dist/hitl/decisionConflict.d.ts +3 -0
- package/dist/hitl/decisionConflict.js +41 -0
- package/dist/hitl/decisionRefusal.d.ts +12 -0
- package/dist/hitl/decisionRefusal.js +63 -4
- package/dist/hitl/frameRouter.d.ts +0 -1
- package/dist/hitl/frameRouter.js +32 -57
- package/dist/hitl/gateLedger.d.ts +5 -0
- package/dist/hitl/gateLedger.js +21 -0
- package/dist/hitl/hitlBridge.d.ts +17 -2
- package/dist/hitl/hitlBridge.js +91 -55
- package/dist/hitl/hitlHostSurface.js +3 -11
- package/dist/hitl/livePendingAsk.d.ts +16 -6
- package/dist/hitl/livePendingAsk.js +36 -4
- package/dist/hitl/localAllowRule.d.ts +1 -0
- package/dist/hitl/localAllowRule.js +2 -2
- package/dist/hitl/noAllowCause.d.ts +2 -1
- package/dist/hitl/noAllowCause.js +3 -2
- package/dist/hitl/parkExpiryJudgements.d.ts +19 -0
- package/dist/hitl/parkExpiryJudgements.js +46 -0
- package/dist/hitl/parkResolver.d.ts +4 -7
- package/dist/hitl/parkResolver.js +12 -34
- package/dist/hitl/parkRowBirthWait.d.ts +1 -0
- package/dist/hitl/parkRowBirthWait.js +2 -2
- package/dist/hitl/persistedRulesWire.js +5 -1
- package/dist/hitl/planReviewWire.d.ts +3 -2
- package/dist/hitl/planReviewWire.js +154 -50
- package/dist/hitl/replayedApproval.d.ts +9 -0
- package/dist/hitl/replayedApproval.js +139 -10
- package/dist/hitl/resumeRunningCard.d.ts +2 -0
- package/dist/hitl/resumeRunningCard.js +15 -4
- package/dist/hitl/sessionPolicyDeliverable.js +8 -6
- package/dist/hitl/standingRows.d.ts +18 -0
- package/dist/hitl/standingRows.js +127 -0
- package/dist/hitl/toolApprovalWire.d.ts +39 -7
- package/dist/hitl/toolApprovalWire.js +351 -61
- package/dist/hookMatcherVerdict.d.ts +1 -9
- package/dist/hookMatcherVerdict.js +21 -61
- package/dist/hooksWireCaps.js +40 -8
- package/dist/host.d.ts +5 -0
- package/dist/host.js +3 -1
- package/dist/hostCallbackGuard.d.ts +2 -0
- package/dist/hostCallbackGuard.js +31 -0
- package/dist/index.d.ts +48 -17
- package/dist/index.js +36 -15
- package/dist/interactiveInterrupt.d.ts +8 -0
- package/dist/interactiveInterrupt.js +54 -0
- package/dist/limitsWire.d.ts +5 -0
- package/dist/limitsWire.js +49 -3
- package/dist/liveModelCatalog.d.ts +95 -0
- package/dist/liveModelCatalog.js +297 -32
- package/dist/mcpEngineLeg.d.ts +25 -0
- package/dist/mcpEngineLeg.js +71 -15
- package/dist/mcpPanel.js +2 -1
- package/dist/mcpProbeCapability.d.ts +0 -5
- package/dist/mcpProbeCapability.js +2 -12
- package/dist/mcpReconnect.d.ts +1 -3
- package/dist/mcpReconnect.js +10 -5
- package/dist/memoryComplianceCapability.d.ts +0 -5
- package/dist/memoryComplianceCapability.js +2 -12
- package/dist/memoryOriginCapability.d.ts +0 -5
- package/dist/memoryOriginCapability.js +2 -12
- package/dist/memorySpecWire.js +2 -2
- package/dist/memoryVerbsWire.d.ts +1 -1
- package/dist/memoryVerbsWire.js +4 -0
- package/dist/model/liveCatalogShape.d.ts +14 -0
- package/dist/model/liveCatalogShape.js +71 -0
- package/dist/model/modelSupplyRules.d.ts +1 -0
- package/dist/model/modelSupplyRules.js +30 -9
- package/dist/model/modelsPolicy.d.ts +21 -0
- package/dist/model/modelsPolicy.js +90 -0
- package/dist/modelIdentityResolvability.d.ts +2 -2
- package/dist/modelIdentityResolvability.js +14 -12
- package/dist/modelSwitchFallback.d.ts +69 -0
- package/dist/modelSwitchFallback.js +206 -0
- package/dist/noticePresentation.d.ts +68 -0
- package/dist/noticePresentation.js +247 -0
- package/dist/notifications.js +12 -11
- package/dist/outputStyleSeatCapability.d.ts +0 -2
- package/dist/outputStyleSeatCapability.js +2 -10
- package/dist/ownKey.d.ts +8 -0
- package/dist/ownKey.js +66 -0
- package/dist/panelReduce.d.ts +114 -0
- package/dist/panelReduce.js +1135 -0
- package/dist/panelStateHolder.d.ts +17 -0
- package/dist/panelStateHolder.js +201 -0
- package/dist/peerFrames.js +13 -9
- package/dist/peerLaneCapability.d.ts +0 -1
- package/dist/peerLaneCapability.js +2 -6
- package/dist/permissionModesCapability.d.ts +0 -5
- package/dist/permissionModesCapability.js +5 -16
- package/dist/permissionRuleIssue.js +0 -3
- package/dist/permissionRulesWriteCapability.d.ts +0 -1
- package/dist/permissionRulesWriteCapability.js +2 -6
- package/dist/permissionsAllowGrantCapability.d.ts +0 -1
- package/dist/permissionsAllowGrantCapability.js +3 -9
- package/dist/permissionsDeclaration.d.ts +8 -0
- package/dist/permissionsDeclaration.js +101 -41
- package/dist/printPermissionOutcome.d.ts +12 -0
- package/dist/printPermissionOutcome.js +50 -0
- package/dist/printToolResultFrame.d.ts +1 -0
- package/dist/printToolResultFrame.js +5 -17
- package/dist/promptBlockedCopy.d.ts +5 -0
- package/dist/promptBlockedCopy.js +35 -0
- package/dist/promptDelivery.js +0 -8
- package/dist/protocolSegment.d.ts +9 -6
- package/dist/protocolSegment.js +31 -21
- package/dist/providerRejection.d.ts +4 -0
- package/dist/providerRejection.js +75 -14
- package/dist/replayBody.d.ts +12 -0
- package/dist/replayBody.js +25 -0
- package/dist/resumeRefusalCopy.d.ts +18 -1
- package/dist/resumeRefusalCopy.js +127 -32
- package/dist/retryStatus.d.ts +9 -1
- package/dist/retryStatus.js +9 -2
- package/dist/rewindArchiveCapability.d.ts +5 -14
- package/dist/rewindArchiveCapability.js +18 -61
- package/dist/rewindArchiveReading.d.ts +15 -0
- package/dist/rewindArchiveReading.js +56 -0
- package/dist/rewindEngineAction.d.ts +21 -0
- package/dist/rewindEngineAction.js +36 -0
- package/dist/rewindWireCaps.d.ts +2 -1
- package/dist/rewindWireCaps.js +1 -0
- package/dist/ruleCompileVerdict.d.ts +9 -1
- package/dist/ruleCompileVerdict.js +29 -4
- package/dist/runTerminal.d.ts +15 -12
- package/dist/runTerminal.js +60 -35
- package/dist/sandboxWire.js +13 -0
- package/dist/sdkRegistryTransit.d.ts +2 -1
- package/dist/sdkRegistryTransit.js +1 -0
- package/dist/sealedKeyCapability.d.ts +0 -5
- package/dist/sealedKeyCapability.js +3 -15
- package/dist/seam.js +4 -2
- package/dist/seatContract.d.ts +125 -34
- package/dist/seatContract.js +583 -179
- package/dist/sessionIdSegment.d.ts +1 -0
- package/dist/sessionIdSegment.js +11 -0
- package/dist/sessionMemoryErase.d.ts +1 -1
- package/dist/sessionMemoryErase.js +6 -1
- package/dist/sessionMemoryStatus.js +3 -2
- package/dist/sessionPolicyCapability.d.ts +0 -1
- package/dist/sessionPolicyCapability.js +2 -6
- package/dist/sessionReadRedactionCapability.d.ts +0 -5
- package/dist/sessionReadRedactionCapability.js +2 -13
- package/dist/sessionSyncFileHistory.d.ts +4 -0
- package/dist/sessionSyncFileHistory.js +66 -0
- package/dist/sessionSyncFileHistoryCapability.d.ts +0 -2
- package/dist/sessionSyncFileHistoryCapability.js +2 -9
- package/dist/skillToolListsCapability.d.ts +0 -2
- package/dist/skillToolListsCapability.js +2 -9
- package/dist/skillsWireCaps.d.ts +4 -0
- package/dist/skillsWireCaps.js +66 -1
- package/dist/sqlEngineCapability.d.ts +0 -1
- package/dist/sqlEngineCapability.js +9 -14
- package/dist/steerPriorityCapability.d.ts +0 -2
- package/dist/steerPriorityCapability.js +3 -12
- package/dist/storePostureCapability.d.ts +1 -5
- package/dist/storePostureCapability.js +16 -22
- package/dist/streamDrainingLegs.d.ts +6 -0
- package/dist/streamDrainingLegs.js +23 -0
- package/dist/subagent/engineCompactWire.js +13 -38
- package/dist/subagent/engineDelegatedPrompt.js +10 -6
- package/dist/subagent/engineSubagentOutput.d.ts +0 -1
- package/dist/subagent/engineSubagentOutput.js +5 -20
- package/dist/subagent/engineSubagentSteer.js +7 -5
- package/dist/subagent/engineSubagentTail.d.ts +0 -1
- package/dist/subagent/engineSubagentTail.js +7 -32
- package/dist/subagentContentStore.js +7 -18
- package/dist/supportFloor.d.ts +1 -0
- package/dist/supportFloor.js +15 -14
- package/dist/systemReminderTag.d.ts +1 -0
- package/dist/systemReminderTag.js +8 -0
- package/dist/terminalStatuses.d.ts +30 -0
- package/dist/terminalStatuses.js +67 -0
- package/dist/toolHistoryMismatch.d.ts +0 -3
- package/dist/toolHistoryMismatch.js +3 -7
- package/dist/toolResult.d.ts +6 -1
- package/dist/toolResult.js +90 -37
- package/dist/toolResultContent.d.ts +2 -0
- package/dist/toolResultContent.js +63 -0
- package/dist/types/engineState.d.ts +2 -1
- package/dist/usageAnalytics.d.ts +146 -0
- package/dist/usageAnalytics.js +335 -0
- package/dist/userInvokedSkillsCapability.d.ts +0 -2
- package/dist/userInvokedSkillsCapability.js +2 -9
- package/dist/webSearchBackendCapability.d.ts +0 -1
- package/dist/webSearchBackendCapability.js +3 -7
- package/dist/webSearchWireCaps.js +3 -11
- package/dist/wireErrorTriage.d.ts +2 -0
- package/dist/wireErrorTriage.js +34 -5
- package/dist/wireFailureShape.d.ts +23 -2
- package/dist/wireFailureShape.js +88 -43
- package/dist/wireRefusalCopy.js +2 -18
- package/dist/workflowClient.js +7 -11
- package/dist/workflowsJournalCapability.d.ts +0 -1
- package/dist/workflowsJournalCapability.js +2 -6
- package/dist/writeProtectionCapability.d.ts +0 -1
- package/dist/writeProtectionCapability.js +5 -10
- package/docs/INTEGRATION-CLIENTS.md +2279 -27
- package/package.json +5 -5
- package/dist/engineCapsGenerationGuard.d.ts +0 -4
- package/dist/engineCapsGenerationGuard.js +0 -19
- package/dist/panelRunningHistory.d.ts +0 -22
- package/dist/panelRunningHistory.js +0 -82
- package/dist/registryConflict.d.ts +0 -3
- package/dist/registryConflict.js +0 -44
package/dist/runTerminal.d.ts
CHANGED
|
@@ -15,7 +15,16 @@ export interface RunTerminalFailureDetail {
|
|
|
15
15
|
kind: string;
|
|
16
16
|
status?: number;
|
|
17
17
|
code?: string;
|
|
18
|
+
providerCondition?: string;
|
|
19
|
+
providerConditionSource?: string;
|
|
18
20
|
}
|
|
21
|
+
export type RunTerminalCompletedDetail = {
|
|
22
|
+
kind: 'finish_reason_unknown';
|
|
23
|
+
finishReasonUnknown: string;
|
|
24
|
+
} | {
|
|
25
|
+
kind: 'unrecognized';
|
|
26
|
+
word: string;
|
|
27
|
+
};
|
|
19
28
|
export declare const PROMPT_BLOCK_CAUSES: readonly ["block", "crashed", "timeout", "cancelled"];
|
|
20
29
|
export type PromptBlockCause = (typeof PROMPT_BLOCK_CAUSES)[number];
|
|
21
30
|
export type RunTerminalBlockedDetail = {
|
|
@@ -31,9 +40,13 @@ export type RunTerminalBlockedDetail = {
|
|
|
31
40
|
kind: 'unrecognized';
|
|
32
41
|
word: string;
|
|
33
42
|
};
|
|
34
|
-
export type RunTerminalRead = {
|
|
43
|
+
export type RunTerminalRead = RunTerminalReadArm & {
|
|
44
|
+
readonly replay?: true;
|
|
45
|
+
};
|
|
46
|
+
type RunTerminalReadArm = {
|
|
35
47
|
kind: 'completed';
|
|
36
48
|
plane: RunTerminalPlane;
|
|
49
|
+
detail?: RunTerminalCompletedDetail;
|
|
37
50
|
} | {
|
|
38
51
|
kind: 'failed';
|
|
39
52
|
plane: RunTerminalPlane;
|
|
@@ -60,14 +73,4 @@ export declare function runTerminalGateKind(read: RunTerminalRead | null): strin
|
|
|
60
73
|
export declare function runTerminalGateToolName(read: RunTerminalRead | null): string | undefined;
|
|
61
74
|
export declare function runTerminalCode(read: RunTerminalRead | null): string | undefined;
|
|
62
75
|
export declare function isReviewPark(read: RunTerminalRead | null): boolean;
|
|
63
|
-
export
|
|
64
|
-
export type TerminalCauseKind = (typeof TERMINAL_CAUSE_KINDS)[number];
|
|
65
|
-
export declare function isTerminalCauseKind(kind: unknown): kind is TerminalCauseKind;
|
|
66
|
-
export declare const RUN_TERMINAL_NOT_SUCCESS_STATUSES: readonly ["failed", "killed", "blocked"];
|
|
67
|
-
export type RunTerminalNotSuccessStatus = (typeof RUN_TERMINAL_NOT_SUCCESS_STATUSES)[number];
|
|
68
|
-
export declare function isTerminalNotSuccess(status: unknown): status is RunTerminalNotSuccessStatus;
|
|
69
|
-
export declare const RUN_TERMINAL_STATUSES: readonly ["completed", "failed", "killed", "blocked"];
|
|
70
|
-
export type RunTerminalStatus = (typeof RUN_TERMINAL_STATUSES)[number];
|
|
71
|
-
export declare function isTerminalStatus(status: unknown): status is RunTerminalStatus;
|
|
72
|
-
export declare const TASK_NOTIFICATION_TERMINAL_STATUSES: readonly string[];
|
|
73
|
-
export declare function isTaskNotificationTerminalStatus(status: string | undefined): boolean;
|
|
76
|
+
export {};
|
package/dist/runTerminal.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { CORE_PROMPT_BLOCK_CAUSES
|
|
1
|
+
import { CORE_PROMPT_BLOCK_CAUSES } from './generated/engineFactTables.js';
|
|
2
|
+
import { isSdkRunParked } from './terminalStatuses.js';
|
|
3
|
+
import { readOwnDataNonEmptyString, readOwnDataValue } from './ownKey.js';
|
|
4
|
+
import { doneResultView } from './replayBody.js';
|
|
2
5
|
export const PROMPT_BLOCK_CAUSES = CORE_PROMPT_BLOCK_CAUSES;
|
|
3
6
|
const PROMPT_BLOCKED_BY_HOOK_DETAIL_KIND = 'prompt_blocked_by_hook';
|
|
4
7
|
function str(v) {
|
|
@@ -40,7 +43,42 @@ function failureDetailOf(cause) {
|
|
|
40
43
|
if (kind === PROVIDER_REJECTED_DETAIL_KIND && (status === undefined || status < 400))
|
|
41
44
|
return undefined;
|
|
42
45
|
const code = str(own(v, 'code'));
|
|
43
|
-
|
|
46
|
+
const isRejection = kind === PROVIDER_REJECTED_DETAIL_KIND;
|
|
47
|
+
const providerCondition = isRejection ? optionalDetailString(v, 'providerCondition') : undefined;
|
|
48
|
+
const providerConditionSource = isRejection ? optionalDetailString(v, 'providerConditionSource') : undefined;
|
|
49
|
+
return {
|
|
50
|
+
kind,
|
|
51
|
+
...(status !== undefined ? { status } : {}),
|
|
52
|
+
...(code !== undefined ? { code } : {}),
|
|
53
|
+
...(providerCondition !== undefined ? { providerCondition } : {}),
|
|
54
|
+
...(providerConditionSource !== undefined ? { providerConditionSource } : {}),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function optionalDetailString(d, key) {
|
|
62
|
+
try {
|
|
63
|
+
return readOwnDataNonEmptyString(d, key);
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
const FINISH_REASON_UNKNOWN_DETAIL_KIND = 'finish_reason_unknown';
|
|
70
|
+
function completedDetailOf(cause) {
|
|
71
|
+
try {
|
|
72
|
+
const v = readOwnDataValue(cause, 'detail');
|
|
73
|
+
if (typeof v !== 'object' || v === null || Array.isArray(v))
|
|
74
|
+
return undefined;
|
|
75
|
+
const kind = readOwnDataNonEmptyString(v, 'kind');
|
|
76
|
+
if (kind === undefined)
|
|
77
|
+
return undefined;
|
|
78
|
+
if (kind !== FINISH_REASON_UNKNOWN_DETAIL_KIND)
|
|
79
|
+
return { kind: 'unrecognized', word: kind };
|
|
80
|
+
const word = readOwnDataNonEmptyString(v, 'finishReasonUnknown');
|
|
81
|
+
return word === undefined ? undefined : { kind: FINISH_REASON_UNKNOWN_DETAIL_KIND, finishReasonUnknown: word };
|
|
44
82
|
}
|
|
45
83
|
catch {
|
|
46
84
|
return undefined;
|
|
@@ -69,8 +107,17 @@ function blockedDetailOf(cause) {
|
|
|
69
107
|
return undefined;
|
|
70
108
|
}
|
|
71
109
|
}
|
|
72
|
-
const FLAT_PAUSED_STATUSES = ['suspended', 'needs_review'];
|
|
73
110
|
export function readRunTerminal(result) {
|
|
111
|
+
if (typeof result !== 'object' || result === null || Array.isArray(result))
|
|
112
|
+
return null;
|
|
113
|
+
const view = doneResultView(result);
|
|
114
|
+
if (view.replay) {
|
|
115
|
+
const inner = readRunTerminalArm(view.engine) ?? readRunTerminalArm({ status: view.row?.status, errorCode: view.row?.errorCode, errorMessage: view.row?.error });
|
|
116
|
+
return inner === null ? null : { ...inner, replay: true };
|
|
117
|
+
}
|
|
118
|
+
return readRunTerminalArm(result);
|
|
119
|
+
}
|
|
120
|
+
function readRunTerminalArm(result) {
|
|
74
121
|
if (typeof result !== 'object' || result === null || Array.isArray(result))
|
|
75
122
|
return null;
|
|
76
123
|
const r = result;
|
|
@@ -83,12 +130,14 @@ export function readRunTerminal(result) {
|
|
|
83
130
|
if (kind === undefined)
|
|
84
131
|
return { kind: 'unknown', plane: 'cause' };
|
|
85
132
|
const parkWord = str(r.status);
|
|
86
|
-
if (
|
|
133
|
+
if (isSdkRunParked(parkWord)) {
|
|
87
134
|
return { kind: 'paused', plane: 'cause', flatStatus: parkWord, ...(kind === 'paused' ? (pauseOf(c) ?? {}) : {}) };
|
|
88
135
|
}
|
|
89
136
|
switch (kind) {
|
|
90
|
-
case 'completed':
|
|
91
|
-
|
|
137
|
+
case 'completed': {
|
|
138
|
+
const detail = completedDetailOf(c);
|
|
139
|
+
return { kind: 'completed', plane: 'cause', ...(detail !== undefined ? { detail } : {}) };
|
|
140
|
+
}
|
|
92
141
|
case 'failed': {
|
|
93
142
|
const code = str(c.code);
|
|
94
143
|
const message = str(c.message);
|
|
@@ -138,7 +187,7 @@ export function readRunTerminal(result) {
|
|
|
138
187
|
...(code !== undefined ? { code } : {}),
|
|
139
188
|
};
|
|
140
189
|
}
|
|
141
|
-
if (
|
|
190
|
+
if (isSdkRunParked(status)) {
|
|
142
191
|
const gate = gateOf(r.checkpointGate);
|
|
143
192
|
const checkpointId = str(r.checkpointId);
|
|
144
193
|
const restoreMode = str(r.workspaceRestoreMode);
|
|
@@ -160,11 +209,10 @@ export function readRunTerminal(result) {
|
|
|
160
209
|
...(message !== undefined ? { message } : {}),
|
|
161
210
|
};
|
|
162
211
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
]);
|
|
212
|
+
const REVIEW_PARK_GATE_KIND_TUPLE = ['plan_review', 'needs_review'];
|
|
213
|
+
const _reviewParkGateKindPins = [true, true];
|
|
214
|
+
void _reviewParkGateKindPins;
|
|
215
|
+
export const REVIEW_PARK_GATE_KINDS = Object.freeze([...REVIEW_PARK_GATE_KIND_TUPLE]);
|
|
168
216
|
export function runTerminalGateKind(read) {
|
|
169
217
|
return read !== null && read.kind === 'paused' ? str(read.gate?.kind) : undefined;
|
|
170
218
|
}
|
|
@@ -183,26 +231,3 @@ export function isReviewPark(read) {
|
|
|
183
231
|
return true;
|
|
184
232
|
return read !== null && read.kind === 'paused' && read.flatStatus === FLAT_REVIEW_STATUS;
|
|
185
233
|
}
|
|
186
|
-
export const TERMINAL_CAUSE_KINDS = CORE_TERMINAL_CAUSE_KINDS;
|
|
187
|
-
export function isTerminalCauseKind(kind) {
|
|
188
|
-
return typeof kind === 'string' && TERMINAL_CAUSE_KINDS.includes(kind);
|
|
189
|
-
}
|
|
190
|
-
export const RUN_TERMINAL_NOT_SUCCESS_STATUSES = Object.freeze([
|
|
191
|
-
'failed',
|
|
192
|
-
'killed',
|
|
193
|
-
'blocked',
|
|
194
|
-
]);
|
|
195
|
-
export function isTerminalNotSuccess(status) {
|
|
196
|
-
return typeof status === 'string' && RUN_TERMINAL_NOT_SUCCESS_STATUSES.includes(status);
|
|
197
|
-
}
|
|
198
|
-
export const RUN_TERMINAL_STATUSES = Object.freeze([
|
|
199
|
-
'completed',
|
|
200
|
-
...RUN_TERMINAL_NOT_SUCCESS_STATUSES,
|
|
201
|
-
]);
|
|
202
|
-
export function isTerminalStatus(status) {
|
|
203
|
-
return typeof status === 'string' && RUN_TERMINAL_STATUSES.includes(status);
|
|
204
|
-
}
|
|
205
|
-
export const TASK_NOTIFICATION_TERMINAL_STATUSES = Object.freeze(['completed', 'failed', 'killed', 'cancelled']);
|
|
206
|
-
export function isTaskNotificationTerminalStatus(status) {
|
|
207
|
-
return status !== undefined && TASK_NOTIFICATION_TERMINAL_STATUSES.includes(status);
|
|
208
|
-
}
|
package/dist/sandboxWire.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { lastFlagValue } from './argvFlagValue.js';
|
|
2
|
+
import { CAPABILITY_IMAGE_INDEX_REQUIRED } from './engineErrorCodes.js';
|
|
2
3
|
const MAX_PROFILE_LEN = 128;
|
|
3
4
|
const USAGE_HINT = "sema: --sandbox expects a profile name or 'auto'.\n" +
|
|
4
5
|
' --sandbox <profile> run on that sandbox image profile (k8s-lane workers; list: sema cloud images list)\n' +
|
|
@@ -45,8 +46,20 @@ export const SANDBOX_K8S_ONLY_400_ANCHOR = 'only supported on the k8s sandbox ba
|
|
|
45
46
|
export const SANDBOX_NO_IMAGE_INDEX_400_ANCHOR = 'requires the image index';
|
|
46
47
|
export const SANDBOX_NO_PUBLISHED_IMAGE_404_ANCHOR = 'no published sandbox image for profile';
|
|
47
48
|
export const SANDBOX_CASCADE_CONFLICT_400_ANCHOR = 'not supported together with cascade/verify';
|
|
49
|
+
const SANDBOX_IMAGE_INDEX_501_HINT = 'Cloud sandbox images are not available on this engine: its storage backend keeps no image index, so profiles cannot be listed or selected here.\n' +
|
|
50
|
+
'Use a worker backed by a SQL store (it has the image index), or re-run without --sandbox.';
|
|
51
|
+
function imageIndexRequiredCode(err) {
|
|
52
|
+
try {
|
|
53
|
+
return typeof err === 'object' && err !== null && err.errorCode === CAPABILITY_IMAGE_INDEX_REQUIRED;
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
48
59
|
export function sandboxDegradeHint(err) {
|
|
49
60
|
const e = err;
|
|
61
|
+
if (e?.status === 501 && imageIndexRequiredCode(err))
|
|
62
|
+
return SANDBOX_IMAGE_INDEX_501_HINT;
|
|
50
63
|
if (typeof e?.status !== 'number' || typeof e?.message !== 'string')
|
|
51
64
|
return undefined;
|
|
52
65
|
const msg = e.message;
|
|
@@ -3,5 +3,6 @@ export { getMeConfig, getScopeConfigDraft, getEffective } from '@sema-agent/sdk/
|
|
|
3
3
|
export { probeRegistryHealth, postFeedback } from '@sema-agent/sdk/registry';
|
|
4
4
|
export { REGISTRY_AUTH_PATHS, skillContentAddress } from '@sema-agent/sdk/registry';
|
|
5
5
|
export { requestDeviceCode, pollUntilApproved, refreshTokens, listScopes, switchScope } from '@sema-agent/sdk/registry';
|
|
6
|
+
export { classifyRegistryConflict } from '@sema-agent/sdk/registry';
|
|
6
7
|
export { RegistryApiError, OAuthFlowError } from '@sema-agent/sdk/registry';
|
|
7
|
-
export type { RegistryTokens, TokenProvider, } from '@sema-agent/sdk/registry';
|
|
8
|
+
export type { RegistryConflictClass, RegistryTokens, TokenProvider, } from '@sema-agent/sdk/registry';
|
|
@@ -3,4 +3,5 @@ export { getMeConfig, getScopeConfigDraft, getEffective } from '@sema-agent/sdk/
|
|
|
3
3
|
export { probeRegistryHealth, postFeedback } from '@sema-agent/sdk/registry';
|
|
4
4
|
export { REGISTRY_AUTH_PATHS, skillContentAddress } from '@sema-agent/sdk/registry';
|
|
5
5
|
export { requestDeviceCode, pollUntilApproved, refreshTokens, listScopes, switchScope } from '@sema-agent/sdk/registry';
|
|
6
|
+
export { classifyRegistryConflict } from '@sema-agent/sdk/registry';
|
|
6
7
|
export { RegistryApiError, OAuthFlowError } from '@sema-agent/sdk/registry';
|
|
@@ -9,9 +9,4 @@ export type SealedKeyReading = {
|
|
|
9
9
|
publicKey: string;
|
|
10
10
|
};
|
|
11
11
|
export declare function projectSealedKeyCapability(caps: unknown): SealedKeyReading | undefined;
|
|
12
|
-
export declare function noteEngineCapsForSealedKey(baseUrl: string, caps: unknown, opts?: {
|
|
13
|
-
generation?: number;
|
|
14
|
-
}): void;
|
|
15
12
|
export declare function observedSealedKey(baseUrl?: string | undefined): SealedKeyReading;
|
|
16
|
-
export declare function forgetSealedKeyReading(baseUrl: string | undefined): void;
|
|
17
|
-
export declare function __resetSealedKeyReadingsForTests(): void;
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import { engineWireTarget } from './engineWireTarget.js';
|
|
2
2
|
import { createEngineCapReader } from './engineCapReader.js';
|
|
3
|
+
import { ownDataField } from './ownKey.js';
|
|
3
4
|
function ownNonEmpty(seg, key) {
|
|
4
|
-
|
|
5
|
-
return undefined;
|
|
6
|
-
const v = seg[key];
|
|
5
|
+
const v = ownDataField(seg, key);
|
|
7
6
|
return typeof v === 'string' && v.length > 0 ? v : undefined;
|
|
8
7
|
}
|
|
9
8
|
export function projectSealedKeyCapability(caps) {
|
|
10
9
|
try {
|
|
11
10
|
if (caps === null || typeof caps !== 'object' || Array.isArray(caps))
|
|
12
11
|
return undefined;
|
|
13
|
-
|
|
14
|
-
return { kind: 'not_reported' };
|
|
15
|
-
const seg = caps.sealedKey;
|
|
12
|
+
const seg = ownDataField(caps, 'sealedKey');
|
|
16
13
|
if (seg === undefined)
|
|
17
14
|
return { kind: 'not_reported' };
|
|
18
15
|
if (seg === null || typeof seg !== 'object' || Array.isArray(seg))
|
|
@@ -33,15 +30,6 @@ const reader = createEngineCapReader({
|
|
|
33
30
|
project: projectSealedKeyCapability,
|
|
34
31
|
makeUnobserved: () => ({ kind: 'unobserved' }),
|
|
35
32
|
});
|
|
36
|
-
export function noteEngineCapsForSealedKey(baseUrl, caps, opts) {
|
|
37
|
-
reader.note(baseUrl, caps, opts);
|
|
38
|
-
}
|
|
39
33
|
export function observedSealedKey(baseUrl = engineWireTarget()?.baseUrl) {
|
|
40
34
|
return reader.observed(baseUrl);
|
|
41
35
|
}
|
|
42
|
-
export function forgetSealedKeyReading(baseUrl) {
|
|
43
|
-
reader.forget(baseUrl);
|
|
44
|
-
}
|
|
45
|
-
export function __resetSealedKeyReadingsForTests() {
|
|
46
|
-
reader.__resetForTests();
|
|
47
|
-
}
|
package/dist/seam.js
CHANGED
|
@@ -102,7 +102,8 @@ const CHROME_ARM_TABLE = {
|
|
|
102
102
|
required: true,
|
|
103
103
|
duty: '整段替换:①`diverged`(never false)在场 ⇒ 自己拼 thinking stream_delta 上屏的端按 content 重渲该块;' +
|
|
104
104
|
'②`committedPrefixDiverged`(never false)在场 ⇒ 所有端把 `committedUuids` 首行就地换成 content,其余行**删除或清空其推理正文**(宿主按自身转录结构选:有父链/压缩段依赖的转录清空优于删,保行身份;安全目标 = 未脱敏字节零留盘;整段换不切片;`committedUuid` = 末条兼容位;`committedPrefixLen` = 全部行全文长度之和,单位 UTF-16 代码单元);' +
|
|
105
|
-
'本包在这一形上一个字节都不再交;③三键全缺席 ⇒ 照旧只当对账/定界;④缺席 ≠
|
|
105
|
+
'本包在这一形上一个字节都不再交;③三键全缺席 ⇒ 照旧只当对账/定界;④缺席 ≠ 段没结束,按整条流判;' +
|
|
106
|
+
'⑤序:该段推理尾部的活体增量一律先于本事件到达,本事件之后不再有同段推理增量。',
|
|
106
107
|
},
|
|
107
108
|
wiring_manifest: {
|
|
108
109
|
required: false,
|
|
@@ -150,7 +151,8 @@ const CHROME_ARM_TABLE = {
|
|
|
150
151
|
'🔴 **单位 = JS 字符串长度(UTF-16 代码单元),不是 UTF-8 字节、也不是几条消息**' +
|
|
151
152
|
'(按 UTF-8 字节截会在非 ASCII 正文上截错位置把凭据留在屏上;按消息丢会连合并在同一条消息里的上一段定稿一起删掉),' +
|
|
152
153
|
'照抄 `已committed正文.slice(0, 长度 - committedPrefixLen) + content`;按**增量拼文**计长、不是 content 上的偏移;④三键全缺席 ⇒ 照旧只当对账/定界,拿 content 再渲一行 = 同一段上屏两遍;⑤`segmentId`(恒在场)= 段身份,与本段已过境的 committed 文本行顶层 `_sema_segment_id` 同值 —— 换掉已提交那截时认行的钥匙是**两把**:行 uuid ∧ 段身份(按字节相等找行会被同后缀的独立行冒充)。' +
|
|
153
|
-
'🔴 缺席只表示「没报」,绝不等于「段没结束」——要退回自家启发式必须按整条流判、不按单帧判;⑥`committedUuids[]`(0.71.0 起,在场 = 本窗口已提交行按序、`[]` = 零行、整键缺席 = 本包说不出):`committedPrefixDiverged` ⇒ **按 `committedRows[]` 逐行写回正文**(包已算好:首行 = 前段定稿前缀 + content、其余行空;别整行换首行,提交行可能带上一段定稿),端不再自己数窗口里过境的行,也不再对多行段整发放弃;`committedUuid` =
|
|
154
|
+
'🔴 缺席只表示「没报」,绝不等于「段没结束」——要退回自家启发式必须按整条流判、不按单帧判;⑥`committedUuids[]`(0.71.0 起,在场 = 本窗口已提交行按序、`[]` = 零行、整键缺席 = 本包说不出):`committedPrefixDiverged` ⇒ **按 `committedRows[]` 逐行写回正文**(包已算好:首行 = 前段定稿前缀 + content、其余行空;别整行换首行,提交行可能带上一段定稿),端不再自己数窗口里过境的行,也不再对多行段整发放弃;`committedUuid` = 末条兼容位;' +
|
|
155
|
+
'⑦序:该段尾部的活体增量(`stream_delta`)一律先于本事件到达,本事件之后不再有同段增量(下一条增量属于下一段)。',
|
|
154
156
|
},
|
|
155
157
|
};
|
|
156
158
|
export const CHROME_ARMS = Object.entries(CHROME_ARM_TABLE).map(([kind, d]) => ({ kind, required: d.required, duty: d.duty }));
|
package/dist/seatContract.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { ReasoningEffort } from "./effortWire.js";
|
|
2
2
|
import type { PermissionMode } from "./permissionWireCaps.js";
|
|
3
|
-
import type { LaneProof } from "./seam.js";
|
|
3
|
+
import type { ChromeArmKind, LaneProof } from "./seam.js";
|
|
4
4
|
import type { QuestionAnswer } from "./liveQuestionStore.js";
|
|
5
5
|
import type { ToolApprovalDelegation } from "./hitl/toolApprovalWire.js";
|
|
6
6
|
import type { ApprovalMandateWord } from "./gateVocabulary.js";
|
|
7
7
|
import type { ModelApiWord } from "./model/providerPresets.js";
|
|
8
|
+
import type { LiveModelCatalog } from "./liveModelCatalog.js";
|
|
9
|
+
import { type RewindMode } from "./rewindWireCaps.js";
|
|
8
10
|
export interface SeatValidationFailure {
|
|
9
11
|
reason: string;
|
|
10
12
|
field?: string;
|
|
@@ -38,6 +40,7 @@ export interface LocalSessionRecord {
|
|
|
38
40
|
text: string;
|
|
39
41
|
}>;
|
|
40
42
|
parked?: boolean;
|
|
43
|
+
pinned?: boolean;
|
|
41
44
|
}
|
|
42
45
|
export declare const TOOL_PERMISSION_REQUEST_ID_DOMAINS: readonly ["live:", "durable:", "question:", "elicit:", "plan:"];
|
|
43
46
|
export type ToolPermissionRequestIdDomain = (typeof TOOL_PERMISSION_REQUEST_ID_DOMAINS)[number];
|
|
@@ -65,12 +68,13 @@ export interface ToolPermissionRequest {
|
|
|
65
68
|
ruleOffersAbsence?: string;
|
|
66
69
|
askClass?: string;
|
|
67
70
|
classes?: readonly string[];
|
|
71
|
+
rememberRefused?: true;
|
|
68
72
|
}
|
|
69
73
|
declare const SEAT_EVENT_TYPE_TUPLE: readonly ["start", "close", "session_updated", "message", "stream_event", "chrome_event", "error", "tool_permission_resolved"];
|
|
70
74
|
export type SeatEventType = (typeof SEAT_EVENT_TYPE_TUPLE)[number];
|
|
71
75
|
export declare const SEAT_EVENT_TYPES: readonly SeatEventType[];
|
|
72
|
-
declare const CHROME_EVENT_KIND_TUPLE: readonly ["panel_task", "notification_terminal", "prompt_suggestions", "subagent_lifecycle"];
|
|
73
|
-
export type ChromeEventKind = (typeof CHROME_EVENT_KIND_TUPLE)[number]
|
|
76
|
+
declare const CHROME_EVENT_KIND_TUPLE: readonly ["panel_task", "notification_terminal", "prompt_suggestions", "subagent_lifecycle", "text_segment_end", "thinking_segment_end"];
|
|
77
|
+
export type ChromeEventKind = Extract<ChromeArmKind, (typeof CHROME_EVENT_KIND_TUPLE)[number]>;
|
|
74
78
|
export declare const CHROME_EVENT_KINDS: readonly ChromeEventKind[];
|
|
75
79
|
export interface SeatChromeEnvelopeBase {
|
|
76
80
|
kind: ChromeEventKind;
|
|
@@ -97,13 +101,17 @@ export interface LocalSessionEvent {
|
|
|
97
101
|
hasPreClearSession?: boolean;
|
|
98
102
|
requestId?: string;
|
|
99
103
|
outcome?: string;
|
|
104
|
+
parked?: true;
|
|
100
105
|
chrome?: SeatChromeEnvelope;
|
|
101
106
|
}
|
|
102
107
|
export declare const HITL_RESOLUTION_OUTCOMES: readonly string[];
|
|
103
|
-
export declare const SEAT_CAPABILITY_NAMES: readonly ["pickFolder"];
|
|
108
|
+
export declare const SEAT_CAPABILITY_NAMES: readonly ["pickFolder", "rewind", "recents", "patchSession"];
|
|
104
109
|
export type SeatCapabilityName = (typeof SEAT_CAPABILITY_NAMES)[number];
|
|
105
110
|
export interface SeatCapabilitiesState {
|
|
106
111
|
pickFolder?: boolean;
|
|
112
|
+
rewind?: boolean;
|
|
113
|
+
recents?: boolean;
|
|
114
|
+
patchSession?: boolean;
|
|
107
115
|
}
|
|
108
116
|
export type SeatCapabilityReading = {
|
|
109
117
|
readonly kind: "reported";
|
|
@@ -116,6 +124,28 @@ export type SeatCapabilityReading = {
|
|
|
116
124
|
export declare function seatCapability(state: unknown, name: SeatCapabilityName): SeatCapabilityReading;
|
|
117
125
|
export declare function watchSeatCapability(store: EipcStoreClient<SeatCapabilitiesState> | undefined, name: SeatCapabilityName, onReading: (reading: SeatCapabilityReading) => void): () => void;
|
|
118
126
|
export declare function seatCapabilityUnavailableDetail(name: SeatCapabilityName, reading: SeatCapabilityReading): string | undefined;
|
|
127
|
+
export interface RecentFolderSession {
|
|
128
|
+
readonly cwd?: string;
|
|
129
|
+
readonly lastActivityAt?: string;
|
|
130
|
+
readonly createdAt?: string;
|
|
131
|
+
}
|
|
132
|
+
export interface RecentFoldersInput {
|
|
133
|
+
readonly sessions?: readonly RecentFolderSession[] | null | undefined;
|
|
134
|
+
readonly registered?: readonly RecentFolderRow[] | null | undefined;
|
|
135
|
+
}
|
|
136
|
+
export declare function recentFoldersOf(input: RecentFoldersInput): string[] | null;
|
|
137
|
+
export type RecentFoldersHostReading = "listed" | "skipped" | "unreadable";
|
|
138
|
+
export interface RecentFoldersReading {
|
|
139
|
+
readonly folders: string[] | null;
|
|
140
|
+
readonly host: RecentFoldersHostReading;
|
|
141
|
+
readonly unreadableRows: number;
|
|
142
|
+
}
|
|
143
|
+
export interface ReadRecentFoldersInput {
|
|
144
|
+
readonly capability: SeatCapabilityReading;
|
|
145
|
+
readonly list: () => Promise<RecentFoldersResult>;
|
|
146
|
+
readonly sessions?: readonly RecentFolderSession[] | null | undefined;
|
|
147
|
+
}
|
|
148
|
+
export declare function readRecentFolders(input: ReadRecentFoldersInput): Promise<RecentFoldersReading>;
|
|
119
149
|
export interface StartSessionOptions {
|
|
120
150
|
model?: string;
|
|
121
151
|
title?: string;
|
|
@@ -130,6 +160,28 @@ export interface SeatTurnSettings {
|
|
|
130
160
|
ultracode?: boolean;
|
|
131
161
|
}
|
|
132
162
|
export declare const SEAT_TURN_SETTINGS_KEYS: readonly ["ultracode"];
|
|
163
|
+
export declare const SEAT_TURN_SETTINGS_ORIGINS: Readonly<{
|
|
164
|
+
ultracode: Readonly<{
|
|
165
|
+
carriedBy: "renderer";
|
|
166
|
+
}>;
|
|
167
|
+
webSearch: Readonly<{
|
|
168
|
+
hostSupplied: "联网检索的每请求配置来自宿主的设置源(可能带检索服务的凭据与私网地址);渲染端没有设置文件,也不该持有凭据";
|
|
169
|
+
}>;
|
|
170
|
+
hooks: Readonly<{
|
|
171
|
+
hostSupplied: "hooks 表来自宿主的设置文件(宿主经设置端口与 hooksForWire 投影);渲染端没有设置文件、也不执行本机 hook";
|
|
172
|
+
}>;
|
|
173
|
+
resolved: Readonly<{
|
|
174
|
+
hostSupplied: "设置解析器的生效快照(hooks / env / model / 已解析权限)由宿主跑解析器得出;渲染端没有设置源可解析";
|
|
175
|
+
}>;
|
|
176
|
+
outputStyle: Readonly<{
|
|
177
|
+
hostSupplied: "输出风格正文由宿主的兜底层随请求带(风格文件在宿主);渲染端只选名字,不持正文";
|
|
178
|
+
}>;
|
|
179
|
+
}>;
|
|
180
|
+
export interface SeatRewindIntent {
|
|
181
|
+
mode: RewindMode;
|
|
182
|
+
targetMessageUuid: string;
|
|
183
|
+
}
|
|
184
|
+
export declare const SEAT_REWIND_INTENT_KEYS: readonly ["mode", "targetMessageUuid"];
|
|
133
185
|
export interface SendMessageRequest {
|
|
134
186
|
sessionId: string;
|
|
135
187
|
text: string;
|
|
@@ -145,6 +197,7 @@ export interface SendMessageRequest {
|
|
|
145
197
|
max?: number;
|
|
146
198
|
};
|
|
147
199
|
settings?: SeatTurnSettings;
|
|
200
|
+
rewind?: SeatRewindIntent;
|
|
148
201
|
scenario?: string;
|
|
149
202
|
}
|
|
150
203
|
export interface AttachmentUploadRequest {
|
|
@@ -156,6 +209,12 @@ export declare const ATTACHMENT_UPLOAD_REQUEST_KEYS: readonly ["name", "mimeType
|
|
|
156
209
|
export interface SessionScopedRequest {
|
|
157
210
|
sessionId: string;
|
|
158
211
|
}
|
|
212
|
+
export interface SessionRowPatchRequest {
|
|
213
|
+
sessionId: string;
|
|
214
|
+
title?: string | null;
|
|
215
|
+
pinned?: boolean;
|
|
216
|
+
}
|
|
217
|
+
export declare const SESSION_ROW_PATCH_REQUEST_KEYS: readonly ["sessionId", "title", "pinned"];
|
|
159
218
|
export interface AttachmentUploadReceipt {
|
|
160
219
|
id: string;
|
|
161
220
|
name: string;
|
|
@@ -163,17 +222,6 @@ export interface AttachmentUploadReceipt {
|
|
|
163
222
|
sha256: string;
|
|
164
223
|
sizeBytes: number;
|
|
165
224
|
}
|
|
166
|
-
export interface SeatModelInfo {
|
|
167
|
-
id: string;
|
|
168
|
-
name?: string;
|
|
169
|
-
provider?: string;
|
|
170
|
-
contextWindow?: number;
|
|
171
|
-
maxOutputTokens?: number;
|
|
172
|
-
}
|
|
173
|
-
export interface SeatModelCatalog {
|
|
174
|
-
models: SeatModelInfo[];
|
|
175
|
-
defaultId?: string;
|
|
176
|
-
}
|
|
177
225
|
export interface SendMessageAck {
|
|
178
226
|
sessionId: string;
|
|
179
227
|
userMessageUuid: string;
|
|
@@ -193,7 +241,6 @@ export interface EipcStoreClient<T> {
|
|
|
193
241
|
onStateChange(cb: (state: T) => void): () => void;
|
|
194
242
|
}
|
|
195
243
|
export interface SettingsState {
|
|
196
|
-
defaultModel: string | null;
|
|
197
244
|
engineVersion?: string;
|
|
198
245
|
dataRoot?: string;
|
|
199
246
|
}
|
|
@@ -228,6 +275,13 @@ export interface SessionsState {
|
|
|
228
275
|
export interface FocusedSessionState {
|
|
229
276
|
sessionId: string | null;
|
|
230
277
|
}
|
|
278
|
+
export interface RecentFolderRow {
|
|
279
|
+
path: string;
|
|
280
|
+
lastUsedAt?: string;
|
|
281
|
+
}
|
|
282
|
+
export interface RecentFoldersResult {
|
|
283
|
+
folders: RecentFolderRow[];
|
|
284
|
+
}
|
|
231
285
|
export interface LocalSessionsApi {
|
|
232
286
|
start(opts?: StartSessionOptions): Promise<LocalSessionRecord>;
|
|
233
287
|
sendMessage(req: SendMessageRequest): Promise<SendMessageAck>;
|
|
@@ -242,9 +296,12 @@ export interface LocalSessionsApi {
|
|
|
242
296
|
getTranscript(sessionId: string): Promise<GetTranscriptResult>;
|
|
243
297
|
searchSessions(query: string): Promise<SessionSearchEnvelope>;
|
|
244
298
|
uploadAttachment(req: AttachmentUploadRequest): Promise<AttachmentUploadReceipt>;
|
|
245
|
-
listModels(): Promise<
|
|
299
|
+
listModels(): Promise<LiveModelCatalog>;
|
|
246
300
|
applyModelConfig(req: ApplyModelConfigRequest): Promise<ApplyModelConfigResult>;
|
|
247
301
|
pickFolder(): Promise<string | null>;
|
|
302
|
+
listRecentFolders(): Promise<RecentFoldersResult>;
|
|
303
|
+
noteRecentFolder(path: string): Promise<OkAck>;
|
|
304
|
+
patchSession(req: SessionRowPatchRequest): Promise<LocalSessionRecord>;
|
|
248
305
|
onEvent(cb: (ev: LocalSessionEvent) => void): () => void;
|
|
249
306
|
onToolPermissionRequest(cb: (req: ToolPermissionRequest) => void): () => void;
|
|
250
307
|
sessionsStateStore: EipcStoreClient<SessionsState>;
|
|
@@ -276,16 +333,19 @@ export interface ApplyModelConfigResult {
|
|
|
276
333
|
reason?: string;
|
|
277
334
|
requiresRestart: boolean;
|
|
278
335
|
}
|
|
279
|
-
export declare function
|
|
336
|
+
export declare function checkSendMessageRequest(v: unknown): SeatValidation;
|
|
337
|
+
export declare function isSendMessageRequest(v: unknown): v is SendMessageRequest;
|
|
338
|
+
export declare const checkSessionRowPatchRequest: (v: unknown) => SeatValidation;
|
|
339
|
+
export declare function isSessionRowPatchRequest(v: unknown): v is SessionRowPatchRequest;
|
|
280
340
|
export declare function isSendMessageAck(v: unknown): v is SendMessageAck;
|
|
281
341
|
export declare const LOCAL_SESSIONS_SPEC: EipcServiceSpec;
|
|
282
|
-
export declare const SEAT_METHOD_NAMES: readonly ["start", "sendMessage", "interrupt", "stop", "respondToToolPermission", "cancelQueuedMessage", "reorderQueuedMessage", "promoteQueuedMessage", "setFocusedSession", "setModel", "getTranscript", "searchSessions", "uploadAttachment", "listModels", "applyModelConfig", "pickFolder", "onEvent", "onToolPermissionRequest"];
|
|
342
|
+
export declare const SEAT_METHOD_NAMES: readonly ["start", "sendMessage", "interrupt", "stop", "respondToToolPermission", "cancelQueuedMessage", "reorderQueuedMessage", "promoteQueuedMessage", "setFocusedSession", "setModel", "getTranscript", "searchSessions", "uploadAttachment", "listModels", "applyModelConfig", "pickFolder", "listRecentFolders", "noteRecentFolder", "patchSession", "onEvent", "onToolPermissionRequest"];
|
|
283
343
|
export declare const SEAT_STORE_PROPS: readonly ["sessionsStateStore", "focusedSessionStateStore", "settingsStateStore", "seatCapabilitiesStateStore"];
|
|
284
344
|
export declare const SEAT_EVENT_METHOD_NAMES: readonly ["onEvent", "onToolPermissionRequest"];
|
|
285
|
-
export declare const LOCAL_SESSION_EVENT_KEYS: readonly ["type", "sessionId", "message", "messages", "error", "errorCategory", "code", "request", "data", "sources", "permissionMode", "session", "userMessageUuid", "hasPreClearSession", "requestId", "outcome", "chrome"];
|
|
286
|
-
export declare const TOOL_PERMISSION_REQUEST_KEYS: readonly ["requestId", "sessionId", "toolName", "toolCallId", "input", "message", "toctouBinding", "createdAtMs", "governanceForced", "delegation", "mandated", "mandate", "origin", "ruleOffersAbsence", "askClass", "classes"];
|
|
287
|
-
export declare const LOCAL_SESSION_RECORD_KEYS: readonly ["sessionId", "engineSessionId", "model", "title", "cwd", "isRunning", "createdAt", "lastActivityAt", "queuedMessages", "parked"];
|
|
288
|
-
export declare const SEND_MESSAGE_REQUEST_KEYS: readonly ["sessionId", "text", "model", "userMessageUuid", "permissionMode", "attachmentIds", "reasoningEffort", "retainBackgroundProcesses", "forwardSubagentEvents", "retainSubagentSessions", "settings", "scenario"];
|
|
345
|
+
export declare const LOCAL_SESSION_EVENT_KEYS: readonly ["type", "sessionId", "message", "messages", "error", "errorCategory", "code", "request", "data", "sources", "permissionMode", "session", "userMessageUuid", "hasPreClearSession", "requestId", "outcome", "parked", "chrome"];
|
|
346
|
+
export declare const TOOL_PERMISSION_REQUEST_KEYS: readonly ["requestId", "sessionId", "toolName", "toolCallId", "input", "message", "toctouBinding", "createdAtMs", "governanceForced", "delegation", "mandated", "mandate", "origin", "ruleOffersAbsence", "askClass", "classes", "rememberRefused"];
|
|
347
|
+
export declare const LOCAL_SESSION_RECORD_KEYS: readonly ["sessionId", "engineSessionId", "model", "title", "cwd", "isRunning", "createdAt", "lastActivityAt", "queuedMessages", "parked", "pinned"];
|
|
348
|
+
export declare const SEND_MESSAGE_REQUEST_KEYS: readonly ["sessionId", "text", "model", "userMessageUuid", "permissionMode", "attachmentIds", "reasoningEffort", "retainBackgroundProcesses", "forwardSubagentEvents", "retainSubagentSessions", "settings", "scenario", "rewind"];
|
|
289
349
|
export declare const SEAT_SEND_MESSAGE_KEY_ORIGINS: {
|
|
290
350
|
readonly sessionId: {
|
|
291
351
|
readonly seatOnly: "座位会话句柄(渲染端持有的本地 id);引擎会话 id 由座位记录的 `engineSessionId` 承载 —— 与引擎请求体上的同名位**同名不同义**,绝不直传";
|
|
@@ -323,19 +383,23 @@ export declare const SEAT_SEND_MESSAGE_KEY_ORIGINS: {
|
|
|
323
383
|
readonly scenario: {
|
|
324
384
|
readonly taskRequestKey: "scenario";
|
|
325
385
|
};
|
|
386
|
+
readonly rewind: {
|
|
387
|
+
readonly projectedBy: "rewindSpecForMode";
|
|
388
|
+
readonly taskRequestKeys: readonly ["resumeAt", "resumeAtMode", "restoreFiles", "rewindFilesTo"];
|
|
389
|
+
};
|
|
326
390
|
};
|
|
327
391
|
export declare const TOOL_PERMISSION_DECISION_KEYS: readonly ["sessionId", "requestId", "decision", "answer", "updatedInput", "remember"];
|
|
328
392
|
export declare const START_SESSION_OPTION_KEYS: readonly ["model", "title", "cwd", "excludeTools"];
|
|
329
393
|
export declare const SEAT_VALIDATOR_KEY_COVERAGE: {
|
|
330
394
|
readonly LocalSessionRecord: {
|
|
331
395
|
readonly guard: "isLocalSessionRecord";
|
|
332
|
-
readonly check: (
|
|
333
|
-
readonly validated: readonly ["sessionId", "engineSessionId", "model", "title", "cwd", "isRunning", "createdAt", "lastActivityAt", "queuedMessages", "parked"];
|
|
396
|
+
readonly check: (v: unknown) => SeatValidation;
|
|
397
|
+
readonly validated: readonly ["sessionId", "engineSessionId", "model", "title", "cwd", "isRunning", "createdAt", "lastActivityAt", "queuedMessages", "parked", "pinned"];
|
|
334
398
|
readonly unchecked: readonly [];
|
|
335
399
|
};
|
|
336
400
|
readonly ToolPermissionRequest: {
|
|
337
401
|
readonly guard: "isToolPermissionRequest";
|
|
338
|
-
readonly check: (
|
|
402
|
+
readonly check: (v: unknown) => SeatValidation;
|
|
339
403
|
readonly validated: readonly ["requestId", "sessionId", "toolName", "toolCallId", "message", "toctouBinding", "createdAtMs"];
|
|
340
404
|
readonly unchecked: readonly [{
|
|
341
405
|
readonly key: "input";
|
|
@@ -361,6 +425,9 @@ export declare const SEAT_VALIDATOR_KEY_COVERAGE: {
|
|
|
361
425
|
}, {
|
|
362
426
|
readonly key: "classes";
|
|
363
427
|
readonly why: "与 askClass 同一对(CC-284),同在同缺、同一只成对窄读(非空、每员非空串、无重复、首员等于 askClass;开集、原样顺序);座位门不设第二判官,理由同 askClass。";
|
|
428
|
+
}, {
|
|
429
|
+
readonly key: "rememberRefused";
|
|
430
|
+
readonly why: "展示增强位(CC-642),权威窄读在卡口两条腿与过境口 toolPermissionRequestAskBits(同一只 readApprovalRememberRefused:自有键 ∧ 严格 true 才上座,永不铸 false);座位门不设第二判官,理由同 mandated(为一个展示位拒掉整条 request = 把安全 ask 丢给引擎 TTL deny)。消费端 `=== true` 读,其余(缺席 / 坏形)一律当缺席 ⇒ 照旧渲「本会话放行」。缺席 = 服务端没说(记得住或老服务端),不是 false。不经过境口自铸座位请求的宿主要自己按同一把窄读。";
|
|
364
431
|
}, {
|
|
365
432
|
readonly key: "ruleOffersAbsence";
|
|
366
433
|
readonly why: "喂强制判据口 approvalIsMandated 的位(CC-203;寄存行那条腿的强制只以缺席词 mandated 表达),按开集读(非空串原文字节、词表不校);权威窄读在卡口与过境口,座位门不设第二判官,理由同 mandated。坏形读成缺席 ⇒ 这一路不判强制(放宽方向:寄存行上的强制就丢了;另两路 mandated / mandate 照判);表外串只是不等于 mandated。不经过境口自铸座位请求的宿主要自己按同一把窄读。";
|
|
@@ -369,7 +436,7 @@ export declare const SEAT_VALIDATOR_KEY_COVERAGE: {
|
|
|
369
436
|
readonly LocalSessionEvent: {
|
|
370
437
|
readonly guard: "isLocalSessionEvent";
|
|
371
438
|
readonly check: (v: unknown) => SeatValidation;
|
|
372
|
-
readonly validated: readonly ["type", "sessionId", "messages", "error", "errorCategory", "code", "request", "data", "sources", "permissionMode", "session", "userMessageUuid", "hasPreClearSession", "requestId", "outcome", "chrome"];
|
|
439
|
+
readonly validated: readonly ["type", "sessionId", "messages", "error", "errorCategory", "code", "request", "data", "sources", "permissionMode", "session", "userMessageUuid", "hasPreClearSession", "requestId", "outcome", "parked", "chrome"];
|
|
373
440
|
readonly unchecked: readonly [{
|
|
374
441
|
readonly key: "message";
|
|
375
442
|
readonly why: "transcript 面直通位(CC fQe 逐字姿态:SDKMessage 体不做 schema 校验)—— 校它 = 引擎加一种消息体的那天整条转录被门吃掉。";
|
|
@@ -381,10 +448,24 @@ export declare const SEAT_VALIDATOR_KEY_COVERAGE: {
|
|
|
381
448
|
readonly validated: readonly ["id", "name", "mime", "sha256", "sizeBytes"];
|
|
382
449
|
readonly unchecked: readonly [];
|
|
383
450
|
};
|
|
384
|
-
readonly
|
|
385
|
-
readonly
|
|
451
|
+
readonly LiveModelCatalog: {
|
|
452
|
+
readonly check: (v: unknown) => SeatValidation;
|
|
453
|
+
readonly validated: readonly ["models", "default", "defaultModel"];
|
|
454
|
+
readonly unchecked: readonly [{
|
|
455
|
+
readonly key: "droppedEntries";
|
|
456
|
+
readonly why: "诊断面(哪些目录条目没被引擎收下),三态读法归 droppedModelEntriesOf(含坏形 malformed);出站门为它拒掉整份目录 = 选单为一行诊断整个消失。";
|
|
457
|
+
}];
|
|
458
|
+
};
|
|
459
|
+
readonly SendMessageRequest: {
|
|
460
|
+
readonly guard: "isSendMessageRequest";
|
|
461
|
+
readonly check: typeof checkSendMessageRequest;
|
|
462
|
+
readonly validated: readonly ["sessionId", "text", "model", "userMessageUuid", "permissionMode", "attachmentIds", "reasoningEffort", "retainBackgroundProcesses", "forwardSubagentEvents", "retainSubagentSessions", "settings", "scenario", "rewind"];
|
|
463
|
+
readonly unchecked: readonly [];
|
|
464
|
+
};
|
|
465
|
+
readonly SessionRowPatchRequest: {
|
|
466
|
+
readonly guard: "isSessionRowPatchRequest";
|
|
386
467
|
readonly check: (v: unknown) => SeatValidation;
|
|
387
|
-
readonly validated: readonly ["
|
|
468
|
+
readonly validated: readonly ["sessionId", "title", "pinned"];
|
|
388
469
|
readonly unchecked: readonly [];
|
|
389
470
|
};
|
|
390
471
|
readonly ApplyModelConfigResult: {
|
|
@@ -435,17 +516,27 @@ export declare const SEAT_VALIDATOR_KEY_COVERAGE: {
|
|
|
435
516
|
};
|
|
436
517
|
readonly SettingsState: {
|
|
437
518
|
readonly check: (v: unknown) => SeatValidation;
|
|
438
|
-
readonly validated: readonly ["
|
|
519
|
+
readonly validated: readonly ["engineVersion", "dataRoot"];
|
|
439
520
|
readonly unchecked: readonly [];
|
|
440
521
|
};
|
|
441
522
|
readonly SeatCapabilitiesState: {
|
|
442
523
|
readonly check: (v: unknown) => SeatValidation;
|
|
443
|
-
readonly validated: readonly ["pickFolder"];
|
|
524
|
+
readonly validated: readonly ["pickFolder", "rewind", "recents", "patchSession"];
|
|
525
|
+
readonly unchecked: readonly [];
|
|
526
|
+
};
|
|
527
|
+
readonly RecentFoldersResult: {
|
|
528
|
+
readonly check: (v: unknown) => SeatValidation;
|
|
529
|
+
readonly validated: readonly ["folders"];
|
|
530
|
+
readonly unchecked: readonly [];
|
|
531
|
+
};
|
|
532
|
+
readonly RecentFolderRow: {
|
|
533
|
+
readonly check: (v: unknown) => SeatValidation;
|
|
534
|
+
readonly validated: readonly ["path", "lastUsedAt"];
|
|
444
535
|
readonly unchecked: readonly [];
|
|
445
536
|
};
|
|
446
|
-
readonly
|
|
537
|
+
readonly SeatRewindIntent: {
|
|
447
538
|
readonly check: (v: unknown) => SeatValidation;
|
|
448
|
-
readonly validated: readonly ["
|
|
539
|
+
readonly validated: readonly ["mode", "targetMessageUuid"];
|
|
449
540
|
readonly unchecked: readonly [];
|
|
450
541
|
};
|
|
451
542
|
readonly SessionSearchResult: {
|