@sema-agent/client-core 0.111.0 → 0.112.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 +75 -0
- package/README.md +15 -6
- package/dist/agentSession/engineSessionBackgroundStop.js +2 -2
- package/dist/checkpointRowVerdict.d.ts +3 -0
- package/dist/checkpointRowVerdict.js +14 -1
- package/dist/consoleCaPin.d.ts +136 -0
- package/dist/consoleCaPin.js +827 -0
- package/dist/decideReceipt.d.ts +2 -1
- package/dist/deviceRebind.js +3 -3
- package/dist/effectiveFacts.d.ts +9 -0
- package/dist/effectiveFacts.js +33 -0
- package/dist/engineAddress.d.ts +1 -0
- package/dist/engineAddress.js +4 -1
- package/dist/engineCredentialRelease.d.ts +54 -0
- package/dist/engineCredentialRelease.js +146 -0
- package/dist/engineErrorCodes.d.ts +1 -0
- package/dist/engineErrorCodes.js +1 -0
- package/dist/engineHealthFacts.d.ts +0 -11
- package/dist/engineHealthFacts.js +0 -21
- package/dist/engineHealthProbeVerdict.d.ts +1 -0
- package/dist/engineHealthProbeVerdict.js +21 -13
- package/dist/engineUnavailable.d.ts +3 -2
- package/dist/engineUnavailable.js +16 -12
- package/dist/engineUrl.js +4 -2
- package/dist/gateFailureCodes.js +2 -2
- package/dist/generated/sdkFactTables.d.ts +1 -0
- package/dist/generated/sdkFactTables.js +13 -0
- package/dist/generated/settingsSchemaFns.d.ts +1 -0
- package/dist/generated/settingsSchemaFns.js +3 -0
- package/dist/generated/settingsSchemaHooksClassifier.js +38 -9
- package/dist/generated/settingsSchemaTables.d.ts +52 -0
- package/dist/generated/settingsSchemaTables.js +18 -0
- package/dist/generated/settingsSchemaTypes.d.ts +23 -13
- package/dist/generated/settingsSchemaUrlShape.d.ts +1 -0
- package/dist/generated/settingsSchemaUrlShape.js +17 -0
- package/dist/hitl/decisionRefusal.d.ts +4 -0
- package/dist/hitl/decisionRefusal.js +12 -2
- package/dist/hitl/localAllowRedemption.d.ts +9 -6
- package/dist/hitl/localAllowRedemption.js +20 -0
- package/dist/hitl/parkOwnership.js +2 -1
- package/dist/hitl/parkResolver.js +7 -0
- package/dist/hitl/screenDecisionCards.js +3 -2
- package/dist/hitl/sessionPolicyWire.js +2 -2
- package/dist/hitl/standingRows.d.ts +4 -2
- package/dist/hitl/standingRows.js +10 -3
- package/dist/hooksReaderGenerations.js +1 -1
- package/dist/i18n/messages.en.d.ts +163 -0
- package/dist/i18n/messages.en.js +163 -0
- package/dist/i18n/messages.zh.js +174 -0
- package/dist/index.d.ts +30 -5
- package/dist/index.js +15 -2
- package/dist/liveModelCatalog.d.ts +4 -0
- package/dist/liveModelCatalog.js +10 -1
- package/dist/localConfig/documents.d.ts +61 -0
- package/dist/localConfig/documents.js +51 -0
- package/dist/localConfig/kernel.d.ts +149 -0
- package/dist/localConfig/kernel.js +597 -0
- package/dist/localConfig/mcp/edit.d.ts +161 -0
- package/dist/localConfig/mcp/edit.js +846 -0
- package/dist/localConfig/mcp/servers.d.ts +165 -0
- package/dist/localConfig/mcp/servers.js +776 -0
- package/dist/localConfig/mcp/views.d.ts +170 -0
- package/dist/localConfig/mcp/views.js +429 -0
- package/dist/localConfig/modelPool.d.ts +262 -0
- package/dist/localConfig/modelPool.js +1489 -0
- package/dist/localConfig/modelPoolWords.d.ts +13 -0
- package/dist/localConfig/modelPoolWords.js +20 -0
- package/dist/localConfig/receiptShape.d.ts +7 -0
- package/dist/localConfig/receiptShape.js +135 -0
- package/dist/localConfig/settingsWrite.d.ts +127 -0
- package/dist/localConfig/settingsWrite.js +237 -0
- package/dist/localConfig/skills.d.ts +124 -0
- package/dist/localConfig/skills.js +397 -0
- package/dist/localConfig/skillsWords.d.ts +10 -0
- package/dist/localConfig/skillsWords.js +5 -0
- package/dist/mcpProbeWire.js +2 -1
- package/dist/mcpWireCaps.js +1 -1
- package/dist/memoryVerbsWire.js +3 -2
- package/dist/model/onboardJudgement.d.ts +14 -4
- package/dist/model/onboardJudgement.js +91 -139
- package/dist/modelConfigGapNotice.d.ts +20 -0
- package/dist/modelConfigGapNotice.js +102 -0
- package/dist/modsKernelIdentity.js +2 -47
- package/dist/ownKey.d.ts +1 -0
- package/dist/ownKey.js +40 -8
- package/dist/permissionsDeclaration.d.ts +2 -1
- package/dist/permissionsDeclaration.js +31 -17
- package/dist/promptBlockedCopy.js +2 -2
- package/dist/resumeRefusalCopy.d.ts +3 -1
- package/dist/resumeRefusalCopy.js +12 -4
- package/dist/runLedgerSnapshot.js +3 -3
- package/dist/runPermissionModeSwitch.js +2 -3
- package/dist/seatContract.d.ts +154 -4
- package/dist/seatContract.js +228 -2
- package/dist/sessionIdSegment.d.ts +1 -0
- package/dist/sessionIdSegment.js +4 -1
- package/dist/sessionMemoryErase.js +2 -1
- package/dist/sha256Bytes.d.ts +1 -0
- package/dist/sha256Bytes.js +46 -0
- package/dist/skillOverrideChain.d.ts +83 -0
- package/dist/skillOverrideChain.js +378 -0
- package/dist/skillsWireCaps.d.ts +3 -0
- package/dist/skillsWireCaps.js +16 -1
- package/dist/turnFailurePresentation.js +4 -10
- package/docs/INTEGRATION-CLIENTS.md +614 -14
- package/package.json +3 -3
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import type { McpServerSpec } from '@sema-agent/sdk';
|
|
2
|
+
import type { SettingsDocument } from '../../host.js';
|
|
3
|
+
import type { SampledRecord } from '../../ownKey.js';
|
|
4
|
+
import { type LocalConfigHostFacts, type LocalConfigPreview, type LocalConfigReceipt, type LocalConfigRefusal, type LocalConfigStorePort, type LocalConfigUnavailableCause } from '../kernel.js';
|
|
5
|
+
import { type McpServerNameUnusableReason } from '../../mcpWireCaps.js';
|
|
6
|
+
import { type HostSettingsSource } from '../../hostSettingsSource.js';
|
|
7
|
+
import type { UiLanguage } from '../../env/uiLanguage.js';
|
|
8
|
+
import { type McpServerFileReading, type McpServerHostFacts, type McpServerProblem, type McpServerRowScope, type McpServerScope } from './servers.js';
|
|
9
|
+
export interface McpSecretMapEdit {
|
|
10
|
+
readonly set?: Readonly<Record<string, string>>;
|
|
11
|
+
readonly delete?: readonly string[];
|
|
12
|
+
}
|
|
13
|
+
export interface McpSecretKeep {
|
|
14
|
+
readonly base: string;
|
|
15
|
+
readonly members: readonly string[];
|
|
16
|
+
}
|
|
17
|
+
export type McpServerEdit = {
|
|
18
|
+
readonly op: 'add';
|
|
19
|
+
readonly name: string;
|
|
20
|
+
readonly entry: SampledRecord;
|
|
21
|
+
readonly scope: McpServerScope;
|
|
22
|
+
readonly onNameTaken?: 'refuse' | 'replace' | 'rename';
|
|
23
|
+
} | {
|
|
24
|
+
readonly op: 'update';
|
|
25
|
+
readonly name: string;
|
|
26
|
+
readonly scope: McpServerScope;
|
|
27
|
+
readonly base: string;
|
|
28
|
+
readonly set?: SampledRecord;
|
|
29
|
+
readonly unset?: readonly string[];
|
|
30
|
+
readonly env?: McpSecretMapEdit;
|
|
31
|
+
readonly headers?: McpSecretMapEdit;
|
|
32
|
+
readonly keep?: McpSecretKeep;
|
|
33
|
+
} | {
|
|
34
|
+
readonly op: 'remove';
|
|
35
|
+
readonly name: string;
|
|
36
|
+
readonly scope?: McpServerScope;
|
|
37
|
+
} | {
|
|
38
|
+
readonly op: 'setEnabled';
|
|
39
|
+
readonly name: string;
|
|
40
|
+
readonly enabled: boolean;
|
|
41
|
+
} | {
|
|
42
|
+
readonly op: 'setProjectApproval';
|
|
43
|
+
readonly name: string;
|
|
44
|
+
readonly approval: 'approve' | 'reject' | 'clear';
|
|
45
|
+
} | {
|
|
46
|
+
readonly op: 'importFromSibling';
|
|
47
|
+
readonly entries: Readonly<Record<string, SampledRecord>>;
|
|
48
|
+
readonly scope: McpServerScope;
|
|
49
|
+
};
|
|
50
|
+
export declare const MCP_SERVER_EDIT_OPS: readonly ["add", "update", "remove", "setEnabled", "setProjectApproval", "importFromSibling"];
|
|
51
|
+
export type McpServerEditOp = (typeof MCP_SERVER_EDIT_OPS)[number];
|
|
52
|
+
export interface McpServerEditContext {
|
|
53
|
+
readonly lane: LocalConfigHostFacts;
|
|
54
|
+
readonly host?: McpServerHostFacts;
|
|
55
|
+
readonly projectKey?: string;
|
|
56
|
+
readonly enterprise?: McpServerFileReading;
|
|
57
|
+
readonly settings?: HostSettingsSource | 'none';
|
|
58
|
+
readonly lang?: UiLanguage;
|
|
59
|
+
}
|
|
60
|
+
export type McpServerRefusalDetail = {
|
|
61
|
+
readonly refusal: 'edit_malformed';
|
|
62
|
+
readonly path: string | null;
|
|
63
|
+
} | {
|
|
64
|
+
readonly refusal: 'name_unusable';
|
|
65
|
+
readonly nameReason: McpServerNameUnusableReason;
|
|
66
|
+
} | {
|
|
67
|
+
readonly refusal: 'name_reserved';
|
|
68
|
+
readonly by: 'package' | 'host';
|
|
69
|
+
} | {
|
|
70
|
+
readonly refusal: 'mcp_entry_invalid';
|
|
71
|
+
readonly problems: readonly McpServerProblem[];
|
|
72
|
+
} | {
|
|
73
|
+
readonly refusal: 'name_taken';
|
|
74
|
+
readonly scope: McpServerScope;
|
|
75
|
+
readonly exhausted: boolean;
|
|
76
|
+
} | {
|
|
77
|
+
readonly refusal: 'not_found';
|
|
78
|
+
} | {
|
|
79
|
+
readonly refusal: 'ambiguous_scope';
|
|
80
|
+
readonly scopes: readonly McpServerScope[];
|
|
81
|
+
} | {
|
|
82
|
+
readonly refusal: 'scope_not_offered';
|
|
83
|
+
readonly scope: McpServerScope;
|
|
84
|
+
readonly why: 'project_config_root' | 'no_project_key' | 'layer_not_admitted';
|
|
85
|
+
} | {
|
|
86
|
+
readonly refusal: 'scope_unreadable';
|
|
87
|
+
} | {
|
|
88
|
+
readonly refusal: 'policy_locked';
|
|
89
|
+
readonly by: 'enterprise_config' | 'plugin_only';
|
|
90
|
+
} | {
|
|
91
|
+
readonly refusal: 'base_conflict';
|
|
92
|
+
} | {
|
|
93
|
+
readonly refusal: 'credentials_need_reentry';
|
|
94
|
+
readonly env: readonly string[];
|
|
95
|
+
readonly headers: readonly string[];
|
|
96
|
+
readonly args: readonly number[];
|
|
97
|
+
} | {
|
|
98
|
+
readonly refusal: 'untrusted_folder';
|
|
99
|
+
};
|
|
100
|
+
export type McpServerRefusalWord = McpServerRefusalDetail['refusal'];
|
|
101
|
+
export declare const refusalReasonOf: (w: McpServerRefusalWord) => LocalConfigRefusal;
|
|
102
|
+
export interface McpServerEditPlan {
|
|
103
|
+
readonly op: McpServerEditOp;
|
|
104
|
+
readonly name: string;
|
|
105
|
+
readonly scope?: McpServerScope;
|
|
106
|
+
readonly renamedFrom?: string;
|
|
107
|
+
readonly replaced?: true;
|
|
108
|
+
readonly imported?: readonly {
|
|
109
|
+
readonly name: string;
|
|
110
|
+
readonly renamedFrom?: string;
|
|
111
|
+
}[];
|
|
112
|
+
readonly skipped?: readonly {
|
|
113
|
+
readonly name: string;
|
|
114
|
+
readonly reason: McpServerRefusalWord;
|
|
115
|
+
}[];
|
|
116
|
+
}
|
|
117
|
+
export type McpServerEditNotice = {
|
|
118
|
+
readonly kind: 'shadowed_by';
|
|
119
|
+
readonly scope: McpServerRowScope;
|
|
120
|
+
} | {
|
|
121
|
+
readonly kind: 'endpoint_differs';
|
|
122
|
+
readonly scope: McpServerRowScope;
|
|
123
|
+
} | {
|
|
124
|
+
readonly kind: 'deployment_wins';
|
|
125
|
+
} | {
|
|
126
|
+
readonly kind: 'env_missing';
|
|
127
|
+
readonly names: readonly string[];
|
|
128
|
+
};
|
|
129
|
+
export type McpServerProbeTarget = {
|
|
130
|
+
readonly kind: 'spec';
|
|
131
|
+
readonly spec: McpServerSpec;
|
|
132
|
+
} | {
|
|
133
|
+
readonly kind: 'none';
|
|
134
|
+
readonly why: 'removed' | 'not_active' | 'env_missing' | 'edit_refused';
|
|
135
|
+
};
|
|
136
|
+
export interface McpServerEditOutcome {
|
|
137
|
+
readonly receipt: LocalConfigReceipt | LocalConfigPreview;
|
|
138
|
+
readonly refusal?: McpServerRefusalDetail;
|
|
139
|
+
readonly plan?: McpServerEditPlan;
|
|
140
|
+
readonly notices: readonly McpServerEditNotice[];
|
|
141
|
+
readonly probe?: McpServerProbeTarget;
|
|
142
|
+
}
|
|
143
|
+
export declare function withPath(doc: {} | null | undefined, path: readonly string[], value: {} | null | undefined): SettingsDocument | undefined;
|
|
144
|
+
export declare const mcpRowBaseOf: (revision: string | null) => string | null;
|
|
145
|
+
export declare function shapeMcpServerEdit(v: {} | null | undefined): {
|
|
146
|
+
readonly ok: true;
|
|
147
|
+
readonly edit: McpServerEdit;
|
|
148
|
+
} | {
|
|
149
|
+
readonly ok: false;
|
|
150
|
+
readonly path: string | null;
|
|
151
|
+
};
|
|
152
|
+
export declare function applyMcpServerEdit(edit: McpServerEdit, store: LocalConfigStorePort, ctx: McpServerEditContext, opts?: {
|
|
153
|
+
readonly dryRun?: true;
|
|
154
|
+
}): Promise<McpServerEditOutcome>;
|
|
155
|
+
export type McpServerProbeTargetReading = {
|
|
156
|
+
readonly kind: 'unavailable';
|
|
157
|
+
readonly cause: LocalConfigUnavailableCause;
|
|
158
|
+
} | {
|
|
159
|
+
readonly kind: 'refused';
|
|
160
|
+
} | McpServerProbeTarget;
|
|
161
|
+
export declare function mcpServerProbeTargetOf(edit: McpServerEdit, store: LocalConfigStorePort, ctx: McpServerEditContext): Promise<McpServerProbeTargetReading>;
|