@sema-agent/client-core 0.93.0 → 0.94.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 +261 -0
- package/README.md +31 -18
- package/dist/adapt/arms.js +8 -5
- package/dist/adapter/downstream/terminalToSdkResult.js +2 -3
- package/dist/agentSession/engineSessionBackgroundStop.js +2 -1
- package/dist/agentsWireCaps.d.ts +15 -0
- package/dist/agentsWireCaps.js +111 -1
- package/dist/approvalReachWire.d.ts +18 -0
- package/dist/approvalReachWire.js +58 -0
- package/dist/approvalsStreamLiveCapability.js +16 -11
- package/dist/callerCwdCapability.d.ts +16 -0
- package/dist/callerCwdCapability.js +47 -0
- package/dist/controlRouter.js +3 -10
- package/dist/coreValuePorts.d.ts +64 -1
- package/dist/coreValuePorts.js +30 -0
- package/dist/detachWire.d.ts +1 -4
- package/dist/detachWire.js +1 -1
- package/dist/deviceExecutorManagementCapability.js +39 -34
- package/dist/deviceFlowPolling.d.ts +5 -0
- package/dist/deviceFlowPolling.js +28 -0
- package/dist/displayUntrusted.js +652 -21
- package/dist/engineErrorCodes.d.ts +5 -1
- package/dist/engineErrorCodes.js +9 -12
- package/dist/engineNoticeCodes.d.ts +22 -2
- package/dist/engineNoticeCodes.js +73 -6
- package/dist/engineRefusedToolName.d.ts +1 -0
- package/dist/engineRefusedToolName.js +8 -0
- package/dist/executionLaneCapability.js +14 -9
- package/dist/fileHistoryCaptureCapability.js +14 -9
- package/dist/fileHistoryLegNotice.d.ts +11 -0
- package/dist/fileHistoryLegNotice.js +50 -13
- package/dist/fleet/fleetLedger.js +5 -0
- package/dist/gateOutcome.d.ts +2 -1
- package/dist/gateOutcome.js +3 -0
- package/dist/gateVocabulary.js +1 -1
- package/dist/generated/engineAskFaceTables.d.ts +3 -0
- package/dist/generated/engineAskFaceTables.js +12 -0
- package/dist/generated/engineFactTables.d.ts +4 -2
- package/dist/generated/engineFactTables.js +13 -0
- package/dist/generated/engineNoticeTables.d.ts +5 -0
- package/dist/generated/engineNoticeTables.js +7 -0
- package/dist/generated/sdkFactTables.d.ts +3 -0
- package/dist/generated/sdkFactTables.js +17 -0
- package/dist/generated/settingsSchemaTables.d.ts +3 -0
- package/dist/generated/settingsSchemaTables.js +3 -0
- package/dist/headlessPermissionModeWire.d.ts +2 -2
- package/dist/headlessPermissionModeWire.js +11 -21
- package/dist/hitl/approvalHolds.d.ts +36 -0
- package/dist/hitl/approvalHolds.js +89 -0
- package/dist/hitl/approvalOutcomeNote.js +2 -1
- package/dist/hitl/approvalResolution.d.ts +3 -2
- package/dist/hitl/approvalResolution.js +21 -0
- package/dist/hitl/approvalsFeed.js +5 -0
- package/dist/hitl/askGateWire.js +3 -0
- package/dist/hitl/automaticAnswerVerdict.d.ts +8 -2
- package/dist/hitl/automaticAnswerVerdict.js +69 -21
- package/dist/hitl/decisionRefusal.d.ts +19 -0
- package/dist/hitl/decisionRefusal.js +63 -0
- package/dist/hitl/frameRouter.d.ts +10 -0
- package/dist/hitl/frameRouter.js +59 -3
- package/dist/hitl/gateLedger.d.ts +3 -0
- package/dist/hitl/gateLedger.js +17 -0
- package/dist/hitl/hitlBridge.d.ts +2 -2
- package/dist/hitl/hitlBridge.js +8 -10
- package/dist/hitl/hitlHostSurface.d.ts +6 -0
- package/dist/hitl/hitlHostSurface.js +25 -4
- package/dist/hitl/localAllowRule.js +2 -1
- package/dist/hitl/noAllowCause.d.ts +9 -0
- package/dist/hitl/noAllowCause.js +26 -0
- package/dist/hitl/parkResolver.js +6 -3
- package/dist/hitl/parkRowBirthWait.js +2 -1
- package/dist/hitl/persistedRulesWire.d.ts +6 -1
- package/dist/hitl/persistedRulesWire.js +12 -4
- package/dist/hitl/planReviewWire.d.ts +0 -1
- package/dist/hitl/planReviewWire.js +30 -9
- package/dist/hitl/sessionPolicyDeliverable.d.ts +1 -1
- package/dist/hitl/sessionPolicyDeliverable.js +3 -8
- package/dist/hitl/sessionPolicyWire.js +1 -1
- package/dist/hitl/toolApprovalWire.d.ts +37 -2
- package/dist/hitl/toolApprovalWire.js +392 -13
- package/dist/humanTurnRead.d.ts +15 -1
- package/dist/humanTurnRead.js +28 -2
- package/dist/index.d.ts +18 -6
- package/dist/index.js +14 -5
- package/dist/limitsWire.d.ts +0 -1
- package/dist/limitsWire.js +2 -10
- package/dist/liveModelCatalog.d.ts +14 -0
- package/dist/liveModelCatalog.js +61 -0
- package/dist/mcpProbeCapability.js +14 -9
- package/dist/mcpReconnect.js +13 -8
- package/dist/memoryComplianceCapability.js +15 -10
- package/dist/memoryOriginCapability.js +15 -10
- package/dist/modelIdentityResolvability.d.ts +4 -2
- package/dist/modelIdentityResolvability.js +31 -4
- package/dist/outputStyleSeatCapability.d.ts +16 -0
- package/dist/outputStyleSeatCapability.js +47 -0
- package/dist/ownKey.d.ts +1 -0
- package/dist/ownKey.js +10 -0
- package/dist/peerLaneCapability.js +16 -11
- package/dist/permissionRuleIssue.js +1 -1
- package/dist/permissionRulesWriteCapability.js +16 -11
- package/dist/permissionsAllowGrantCapability.d.ts +2 -0
- package/dist/permissionsAllowGrantCapability.js +38 -16
- package/dist/permissionsDeclaration.d.ts +10 -1
- package/dist/permissionsDeclaration.js +97 -15
- package/dist/protocolSegment.d.ts +1 -0
- package/dist/protocolSegment.js +13 -1
- package/dist/request/taskRequest.d.ts +11 -3
- package/dist/request/taskRequest.js +13 -1
- package/dist/resultFrameKeys.d.ts +4 -0
- package/dist/resultFrameKeys.js +13 -0
- package/dist/resumeRefusalCopy.js +6 -16
- package/dist/retryStatus.js +6 -4
- package/dist/rewindArchiveCapability.js +13 -8
- package/dist/{hitl/rosterMountedNames.d.ts → rosterMountedNames.d.ts} +1 -1
- package/dist/runCancelContext.js +2 -1
- package/dist/sealedKeyCapability.js +19 -14
- package/dist/seatContract.d.ts +33 -5
- package/dist/seatContract.js +143 -2
- package/dist/sessionPolicyCapability.js +15 -10
- package/dist/sessionReadRedactionCapability.d.ts +16 -0
- package/dist/sessionReadRedactionCapability.js +47 -0
- package/dist/sessionSyncFileHistoryCapability.js +14 -9
- package/dist/skillToolListsCapability.js +14 -9
- package/dist/sqlEngineCapability.js +18 -13
- package/dist/steerPriorityCapability.js +21 -16
- package/dist/subagent/agentStateDetail.d.ts +1 -0
- package/dist/subagent/agentStateDetail.js +41 -0
- package/dist/subagent/engineCompactWire.d.ts +15 -0
- package/dist/subagent/engineCompactWire.js +75 -13
- package/dist/supportFloor.js +1 -1
- package/dist/taskRequestWords.d.ts +2 -4
- package/dist/taskRequestWords.js +3 -2
- package/dist/types/engineState.d.ts +1 -1
- package/dist/userAttachmentEnvelope.d.ts +22 -1
- package/dist/userAttachmentEnvelope.js +90 -2
- package/dist/userInvokedSkillsCapability.js +14 -9
- package/dist/webSearchBackendCapability.js +21 -16
- package/dist/wireErrorTriage.d.ts +11 -0
- package/dist/wireErrorTriage.js +35 -0
- package/dist/wireFailureShape.d.ts +6 -0
- package/dist/wireFailureShape.js +30 -3
- package/dist/wireRefusalCopy.d.ts +6 -1
- package/dist/wireRefusalCopy.js +22 -8
- package/dist/wiringInstructionsAttribution.d.ts +10 -0
- package/dist/wiringInstructionsAttribution.js +67 -0
- package/dist/workflowClient.js +22 -1
- package/dist/workflowsJournalCapability.js +14 -9
- package/dist/writeProtectionCapability.js +28 -23
- package/docs/INTEGRATION-CLIENTS.md +817 -45
- package/package.json +5 -5
- package/dist/askSurvivesStandingAnswer.d.ts +0 -13
- package/dist/askSurvivesStandingAnswer.js +0 -53
- package/dist/hitl/askSurvivesPosture.d.ts +0 -20
- package/dist/hitl/askSurvivesPosture.js +0 -48
- /package/dist/{hitl/rosterMountedNames.js → rosterMountedNames.js} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/client-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.94.0",
|
|
4
4
|
"description": "Client-side session runtime shared by every sema human client (TUI / web / desktop): sema wire frames (AgentEvent) -> CC session vocabulary (SDKMessage) with dual-plane output (transcript/chrome), deterministic transcript ids, lane discipline as a type, and the notification/dedup ledgers. Every CC-skin shape is collected here so the wire itself stays neutral. Renamed from @sema-agent/wire-cc-adapter (0.1.x).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"@sema-agent/agent-types": ">=0.3.0",
|
|
38
|
-
"@sema-agent/sdk": ">=
|
|
38
|
+
"@sema-agent/sdk": ">=18.1.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@sema-agent/agent-types": "^0.3.0",
|
|
42
|
-
"@sema-agent/core": "~7.
|
|
43
|
-
"@sema-agent/sdk": "^
|
|
44
|
-
"@sema-agent/settings-schema": "^
|
|
42
|
+
"@sema-agent/core": "~7.47.0",
|
|
43
|
+
"@sema-agent/sdk": "^18.1.0",
|
|
44
|
+
"@sema-agent/settings-schema": "^10.0.0",
|
|
45
45
|
"esbuild": "^0.27.4",
|
|
46
46
|
"typescript": "^6.0.2"
|
|
47
47
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type AutomaticAnswerRoad, type AutomaticAnswerUnknownWhy } from './hitl/automaticAnswerVerdict.js';
|
|
2
|
-
export declare const MODE_ARBITRATION: Readonly<Record<"hook" | "write_protection" | "mode" | "rule_unreadable" | "content_question" | "ancestor" | "unverifiable_delete" | "transcript_write" | "org_rule" | "governance_unavailable" | "ask_rule" | "denial_limit_fallback" | "classifier_no_ruling" | "requires_user_interaction" | "operator_forced" | "shell_floor" | "write_protection_unresolved" | "probe" | "tool_marks_mcp" | "tool_marks_a2a" | "policy_rra" | "artifact_shared_read" | "unstated" | "ordinary", import("./generated/engineFactTables.js").CoreModeArbitrationRow>>;
|
|
3
|
-
export type StandingAnswerVerdict = {
|
|
4
|
-
readonly kind: 'must_ask';
|
|
5
|
-
readonly by: string;
|
|
6
|
-
readonly road?: AutomaticAnswerRoad;
|
|
7
|
-
} | {
|
|
8
|
-
readonly kind: 'may_answer';
|
|
9
|
-
} | {
|
|
10
|
-
readonly kind: 'unknown';
|
|
11
|
-
readonly why?: AutomaticAnswerUnknownWhy;
|
|
12
|
-
};
|
|
13
|
-
export declare function askSurvivesStandingAnswer(card: object | null | undefined): StandingAnswerVerdict;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { CORE_MODE_ARBITRATION } from './generated/engineFactTables.js';
|
|
2
|
-
import { automaticAnswerVerdict } from './hitl/automaticAnswerVerdict.js';
|
|
3
|
-
export const MODE_ARBITRATION = CORE_MODE_ARBITRATION;
|
|
4
|
-
const MUST_ASK_MANDATED = Object.freeze({ kind: 'must_ask', by: 'mandated' });
|
|
5
|
-
const MAY_ANSWER = Object.freeze({ kind: 'may_answer' });
|
|
6
|
-
const UNKNOWN = Object.freeze({ kind: 'unknown' });
|
|
7
|
-
export function askSurvivesStandingAnswer(card) {
|
|
8
|
-
const old = legacyStandingAnswerVerdict(card);
|
|
9
|
-
const neu = automaticAnswerVerdict(card, 'standing_rule');
|
|
10
|
-
if (old.kind === 'must_ask' || neu.kind === 'must_ask') {
|
|
11
|
-
const by = old.kind === 'must_ask' ? old.by : neu.kind === 'must_ask' ? (neu.askClass ?? neu.road) : 'mandated';
|
|
12
|
-
const road = neu.kind === 'must_ask' ? neu.road : by === 'mandated' ? 'mandated' : 'ask_class';
|
|
13
|
-
return Object.freeze({ kind: 'must_ask', by, road });
|
|
14
|
-
}
|
|
15
|
-
if (old.kind === 'unknown' || neu.kind === 'unknown')
|
|
16
|
-
return neu.kind === 'unknown' ? Object.freeze({ kind: 'unknown', why: neu.why }) : UNKNOWN;
|
|
17
|
-
return MAY_ANSWER;
|
|
18
|
-
}
|
|
19
|
-
function legacyStandingAnswerVerdict(card) {
|
|
20
|
-
try {
|
|
21
|
-
if (card === null || card === undefined || typeof card !== 'object')
|
|
22
|
-
return UNKNOWN;
|
|
23
|
-
if (Object.hasOwn(card, 'mandated') && card.mandated === true)
|
|
24
|
-
return MUST_ASK_MANDATED;
|
|
25
|
-
const classes = Object.hasOwn(card, 'classes') ? card.classes : undefined;
|
|
26
|
-
if (!Array.isArray(classes))
|
|
27
|
-
return UNKNOWN;
|
|
28
|
-
const length = classes.length;
|
|
29
|
-
if (typeof length !== 'number' || !Number.isSafeInteger(length) || length <= 0)
|
|
30
|
-
return UNKNOWN;
|
|
31
|
-
const names = [];
|
|
32
|
-
for (let i = 0; i < length; i += 1) {
|
|
33
|
-
if (!Object.hasOwn(classes, i))
|
|
34
|
-
return UNKNOWN;
|
|
35
|
-
const c = classes[i];
|
|
36
|
-
if (typeof c !== 'string')
|
|
37
|
-
return UNKNOWN;
|
|
38
|
-
names.push(c);
|
|
39
|
-
}
|
|
40
|
-
if (classes.length !== length)
|
|
41
|
-
return UNKNOWN;
|
|
42
|
-
for (const name of names) {
|
|
43
|
-
if (!Object.hasOwn(MODE_ARBITRATION, name))
|
|
44
|
-
return UNKNOWN;
|
|
45
|
-
if (MODE_ARBITRATION[name]?.ruleMayClear !== true)
|
|
46
|
-
return Object.freeze({ kind: 'must_ask', by: name });
|
|
47
|
-
}
|
|
48
|
-
return MAY_ANSWER;
|
|
49
|
-
}
|
|
50
|
-
catch {
|
|
51
|
-
return UNKNOWN;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { type AutomaticAnswerRoad, type AutomaticAnswerUnknownWhy } from './automaticAnswerVerdict.js';
|
|
2
|
-
export interface AskPostureFacts {
|
|
3
|
-
readonly settingsAskRuleMatched?: boolean;
|
|
4
|
-
}
|
|
5
|
-
export type AskPostureSurvivalRoad = 'origin' | 'settings_ask_rule';
|
|
6
|
-
export type AskPostureVerdict = {
|
|
7
|
-
readonly kind: 'must_ask';
|
|
8
|
-
readonly by: AskPostureSurvivalRoad;
|
|
9
|
-
readonly road?: AutomaticAnswerRoad;
|
|
10
|
-
readonly askClass?: string;
|
|
11
|
-
} | {
|
|
12
|
-
readonly kind: 'posture_may_answer';
|
|
13
|
-
readonly releaseReason?: string;
|
|
14
|
-
} | {
|
|
15
|
-
readonly kind: 'unknown';
|
|
16
|
-
readonly why?: AutomaticAnswerUnknownWhy;
|
|
17
|
-
};
|
|
18
|
-
export declare function askSurvivesPosture(req: {
|
|
19
|
-
readonly origin?: string;
|
|
20
|
-
} | null | undefined, facts?: AskPostureFacts | null): AskPostureVerdict;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { readOwnNonEmptyString } from '../ownKey.js';
|
|
2
|
-
import { automaticAnswerVerdict } from './automaticAnswerVerdict.js';
|
|
3
|
-
const ORIGIN_SURVIVES_POSTURE = Object.freeze({
|
|
4
|
-
content_question: true,
|
|
5
|
-
ancestor_marked: false,
|
|
6
|
-
org_unavailable: true,
|
|
7
|
-
org_rule: true,
|
|
8
|
-
rule_store_unavailable: true,
|
|
9
|
-
hook: true,
|
|
10
|
-
ask_rule: true,
|
|
11
|
-
denial_limit_fallback: true,
|
|
12
|
-
shell_gate_tighten: false,
|
|
13
|
-
safety_tighten: false,
|
|
14
|
-
policy: false,
|
|
15
|
-
});
|
|
16
|
-
const MUST_ASK_BY_ORIGIN = Object.freeze({ kind: 'must_ask', by: 'origin' });
|
|
17
|
-
const MUST_ASK_BY_SETTINGS = Object.freeze({ kind: 'must_ask', by: 'settings_ask_rule' });
|
|
18
|
-
const POSTURE_MAY_ANSWER = Object.freeze({ kind: 'posture_may_answer' });
|
|
19
|
-
const UNKNOWN = Object.freeze({ kind: 'unknown' });
|
|
20
|
-
export function askSurvivesPosture(req, facts) {
|
|
21
|
-
const old = legacyPostureVerdict(req, facts);
|
|
22
|
-
const neu = automaticAnswerVerdict(req, 'mode_posture', facts ?? undefined);
|
|
23
|
-
if (old.kind === 'must_ask' || neu.kind === 'must_ask') {
|
|
24
|
-
const by = old.kind === 'must_ask' ? old.by : neu.kind === 'must_ask' && neu.road === 'settings_ask_rule' ? 'settings_ask_rule' : 'origin';
|
|
25
|
-
const road = neu.kind === 'must_ask' ? neu.road : by === 'settings_ask_rule' ? 'settings_ask_rule' : 'origin';
|
|
26
|
-
const askClass = neu.kind === 'must_ask' ? neu.askClass : undefined;
|
|
27
|
-
return Object.freeze({ kind: 'must_ask', by, road, ...(askClass !== undefined ? { askClass } : {}) });
|
|
28
|
-
}
|
|
29
|
-
if (old.kind === 'unknown' || neu.kind === 'unknown') {
|
|
30
|
-
return neu.kind === 'unknown' ? Object.freeze({ kind: 'unknown', why: neu.why }) : UNKNOWN;
|
|
31
|
-
}
|
|
32
|
-
return neu.kind === 'may_answer' && neu.releaseReason !== undefined
|
|
33
|
-
? Object.freeze({ kind: 'posture_may_answer', releaseReason: neu.releaseReason })
|
|
34
|
-
: POSTURE_MAY_ANSWER;
|
|
35
|
-
}
|
|
36
|
-
function legacyPostureVerdict(req, facts) {
|
|
37
|
-
const origin = readOwnNonEmptyString(req, 'origin');
|
|
38
|
-
const rawMatched = typeof facts === 'object' && facts !== null ? facts.settingsAskRuleMatched : undefined;
|
|
39
|
-
const matched = typeof rawMatched === 'boolean' ? rawMatched : undefined;
|
|
40
|
-
const known = origin !== undefined && Object.hasOwn(ORIGIN_SURVIVES_POSTURE, origin);
|
|
41
|
-
if (known && ORIGIN_SURVIVES_POSTURE[origin] === true)
|
|
42
|
-
return MUST_ASK_BY_ORIGIN;
|
|
43
|
-
if (matched === true)
|
|
44
|
-
return MUST_ASK_BY_SETTINGS;
|
|
45
|
-
if (matched === false && (origin === undefined || known))
|
|
46
|
-
return POSTURE_MAY_ANSWER;
|
|
47
|
-
return UNKNOWN;
|
|
48
|
-
}
|
|
File without changes
|