@sema-agent/client-core 0.104.1 → 0.106.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 +310 -0
- package/README.md +36 -14
- package/dist/adapt/arms.js +23 -6
- package/dist/adapter/activeRunSelfHeal.d.ts +14 -2
- package/dist/adapter/activeRunSelfHeal.js +90 -12
- package/dist/adapter/downstream/eventToSdkMessage.d.ts +0 -5
- package/dist/adapter/downstream/eventToSdkMessage.js +24 -23
- package/dist/adapter/downstream/terminalToSdkResult.js +2 -3
- package/dist/adapter/downstream/wiringManifestView.d.ts +7 -3
- package/dist/adapter/downstream/wiringManifestView.js +25 -1
- package/dist/adapter/runStream.js +8 -5
- package/dist/approvalReachWire.d.ts +1 -0
- package/dist/approvalReachWire.js +4 -1
- package/dist/approvalSeat.d.ts +21 -0
- package/dist/approvalSeat.js +73 -0
- package/dist/assistantInbox.d.ts +2 -0
- package/dist/assistantInbox.js +3 -0
- package/dist/checkpointRowVerdict.d.ts +23 -0
- package/dist/checkpointRowVerdict.js +89 -0
- package/dist/cloudConfigWireCaps.js +3 -0
- package/dist/compensations.js +6 -6
- package/dist/coreValuePorts.d.ts +14 -1
- package/dist/coreValuePorts.js +14 -0
- package/dist/decideFailureNote.js +3 -1
- package/dist/decideReceipt.d.ts +9 -0
- package/dist/decideReceipt.js +29 -1
- package/dist/declared/supportFloorDeclared.js +2 -2
- package/dist/deviceRebind.d.ts +7 -0
- package/dist/deviceRebind.js +39 -5
- package/dist/displayUntrusted.d.ts +4 -2
- package/dist/displayUntrusted.js +45 -22
- package/dist/engineAddress.d.ts +3 -0
- package/dist/engineAddress.js +25 -0
- package/dist/engineDirectory.js +9 -17
- package/dist/engineErrorCodes.d.ts +8 -0
- package/dist/engineErrorCodes.js +8 -0
- package/dist/engineGenerationPort.d.ts +11 -2
- package/dist/engineGenerationPort.js +63 -9
- package/dist/engineHealthFacts.d.ts +5 -0
- package/dist/engineHealthFacts.js +11 -0
- package/dist/engineNoticeCodes.d.ts +26 -3
- package/dist/engineNoticeCodes.js +52 -7
- package/dist/engineRowRef.js +1 -1
- package/dist/errorSupplementRoles.js +2 -0
- package/dist/eventLeg.d.ts +3 -3
- package/dist/eventLeg.js +25 -4
- package/dist/fleet/fleetProjection.js +26 -5
- package/dist/generated/engineFactTables.d.ts +3 -1
- package/dist/generated/engineFactTables.js +4 -1
- package/dist/generated/engineNoticeTables.js +19 -4
- package/dist/generated/sdkFactTables.d.ts +5 -0
- package/dist/generated/sdkFactTables.js +24 -0
- package/dist/generated/settingsSchemaFns.d.ts +11 -0
- package/dist/generated/settingsSchemaFns.js +2 -1
- package/dist/generated/settingsSchemaSafetyMergeSpec.js +1 -1
- package/dist/generated/settingsSchemaSettingsSources.d.ts +1 -1
- package/dist/generated/settingsSchemaSettingsSources.js +22 -2
- package/dist/headlessReconnectWire.js +31 -4
- package/dist/hitl/approvalLiveFace.d.ts +17 -0
- package/dist/hitl/approvalLiveFace.js +35 -0
- package/dist/hitl/approvalQueueRow.d.ts +21 -0
- package/dist/hitl/approvalQueueRow.js +69 -0
- package/dist/hitl/approvalsFeed.d.ts +5 -4
- package/dist/hitl/approvalsFeed.js +38 -6
- package/dist/hitl/askGateWire.js +26 -2
- package/dist/hitl/askParkRowRouting.d.ts +4 -3
- package/dist/hitl/askParkRowRouting.js +15 -3
- package/dist/hitl/automaticAnswerVerdict.js +13 -10
- package/dist/hitl/crashConverged.d.ts +5 -1
- package/dist/hitl/decisionConflict.js +2 -1
- package/dist/hitl/decisionRefusal.js +1 -1
- package/dist/hitl/decisionSend.d.ts +1 -0
- package/dist/hitl/decisionSend.js +14 -2
- package/dist/hitl/frameRouter.d.ts +4 -0
- package/dist/hitl/frameRouter.js +18 -5
- package/dist/hitl/gateIdentity.d.ts +1 -0
- package/dist/hitl/gateIdentity.js +3 -0
- package/dist/hitl/hitlBridge.d.ts +1 -1
- package/dist/hitl/hitlBridge.js +26 -5
- package/dist/hitl/livePendingAsk.d.ts +5 -0
- package/dist/hitl/livePendingAsk.js +6 -1
- package/dist/hitl/planReviewCard.d.ts +23 -0
- package/dist/hitl/planReviewCard.js +250 -0
- package/dist/hitl/planReviewWire.d.ts +39 -14
- package/dist/hitl/planReviewWire.js +450 -163
- package/dist/hitl/sessionAllowRoute.d.ts +2 -0
- package/dist/hitl/sessionAllowRoute.js +7 -0
- package/dist/hitl/sessionPolicyWire.d.ts +1 -7
- package/dist/hitl/sessionPolicyWire.js +3 -43
- package/dist/hitl/subagentSource.d.ts +1 -0
- package/dist/hitl/subagentSource.js +13 -0
- package/dist/hitl/toolApprovalWire.d.ts +3 -2
- package/dist/hitl/toolApprovalWire.js +79 -37
- package/dist/hostSettingsSource.d.ts +5 -2
- package/dist/hostSettingsSource.js +19 -10
- package/dist/hostTurnSettings.d.ts +5 -6
- package/dist/hostTurnSettings.js +106 -26
- package/dist/i18n/messages.en.d.ts +85 -12
- package/dist/i18n/messages.en.js +85 -12
- package/dist/i18n/messages.zh.js +88 -12
- package/dist/index.d.ts +35 -4
- package/dist/index.js +19 -2
- package/dist/liveInitToolFace.js +0 -1
- package/dist/liveModelCatalog.d.ts +15 -0
- package/dist/liveModelCatalog.js +40 -0
- package/dist/mcpTransportKindsCapability.d.ts +18 -0
- package/dist/mcpTransportKindsCapability.js +75 -0
- package/dist/mcpWireCaps.d.ts +4 -1
- package/dist/mcpWireCaps.js +25 -14
- package/dist/modelCapabilityProbe.js +66 -33
- package/dist/notifications.d.ts +9 -0
- package/dist/notifications.js +11 -2
- package/dist/ownKey.d.ts +4 -1
- package/dist/ownKey.js +8 -2
- package/dist/permissionModeWriteCapability.d.ts +13 -0
- package/dist/permissionModeWriteCapability.js +35 -0
- package/dist/permissionsAllowGrantCapability.d.ts +3 -0
- package/dist/permissionsAllowGrantCapability.js +26 -3
- package/dist/permissionsDeclaration.d.ts +25 -3
- package/dist/permissionsDeclaration.js +69 -41
- package/dist/planReviewCardFacts.d.ts +116 -0
- package/dist/planReviewCardFacts.js +469 -0
- package/dist/projectSeed.d.ts +39 -0
- package/dist/projectSeed.js +80 -0
- package/dist/promptDelivery.js +1 -1
- package/dist/reattachWindow.d.ts +8 -1
- package/dist/reattachWindow.js +44 -12
- package/dist/replayBody.d.ts +7 -6
- package/dist/replayBody.js +62 -7
- package/dist/request/taskRequest.js +3 -4
- package/dist/ruleCompileVerdict.d.ts +0 -2
- package/dist/ruleCompileVerdict.js +0 -31
- package/dist/ruleRefusalSentence.js +0 -3
- package/dist/runFollow.d.ts +30 -0
- package/dist/runFollow.js +117 -0
- package/dist/runLedgerSnapshot.d.ts +20 -0
- package/dist/runLedgerSnapshot.js +272 -0
- package/dist/runPermissionModeSwitch.d.ts +57 -0
- package/dist/runPermissionModeSwitch.js +135 -0
- package/dist/runReattachPolicy.d.ts +16 -5
- package/dist/runReattachPolicy.js +72 -24
- package/dist/runTerminal.js +30 -8
- package/dist/sandboxWire.d.ts +0 -3
- package/dist/sandboxWire.js +0 -9
- package/dist/seam.d.ts +17 -7
- package/dist/seam.js +13 -1
- package/dist/seatContract.d.ts +57 -7
- package/dist/seatContract.js +133 -3
- package/dist/serverSupportRange.d.ts +18 -0
- package/dist/serverSupportRange.js +25 -0
- package/dist/sessionEngine.d.ts +156 -0
- package/dist/sessionEngine.js +464 -0
- package/dist/sessionMap.d.ts +11 -1
- package/dist/sessionMap.js +35 -9
- package/dist/sessionMemoryErase.d.ts +1 -1
- package/dist/sessionMemoryErase.js +5 -0
- package/dist/sessionMemoryStatus.d.ts +27 -1
- package/dist/sessionMemoryStatus.js +117 -0
- package/dist/sessionMemorySync.d.ts +31 -0
- package/dist/sessionMemorySync.js +95 -0
- package/dist/sessionRowTag.d.ts +4 -0
- package/dist/sessionRowTag.js +18 -0
- package/dist/settingsLayerAdmission.d.ts +1 -0
- package/dist/settingsLayerAdmission.js +4 -1
- package/dist/sseIdleTriage.d.ts +3 -1
- package/dist/sseIdleTriage.js +19 -4
- package/dist/subagent/engineSubagentTail.js +2 -0
- package/dist/subagentContentStore.d.ts +3 -0
- package/dist/subagentContentStore.js +10 -1
- package/dist/toolResult.js +1 -1
- package/dist/turnFailurePresentation.d.ts +5 -2
- package/dist/turnFailurePresentation.js +12 -4
- package/dist/wireRefusalCopy.js +2 -6
- package/docs/INTEGRATION-CLIENTS.md +1507 -18
- package/package.json +5 -5
package/dist/ownKey.d.ts
CHANGED
|
@@ -43,7 +43,6 @@ export interface PromptManifestSectionRow {
|
|
|
43
43
|
locale?: string;
|
|
44
44
|
variant?: string;
|
|
45
45
|
contentHash?: string;
|
|
46
|
-
slot?: string;
|
|
47
46
|
}
|
|
48
47
|
export interface PromptManifestIdentityRow {
|
|
49
48
|
readonly artifact: string;
|
|
@@ -71,3 +70,7 @@ export interface SampledRecord {
|
|
|
71
70
|
export declare function ownSnapshotWhenTyped<V>(value: V, word: string): SampledJson;
|
|
72
71
|
export declare function ownSnapshotTyped<T extends object>(value: T): T | undefined;
|
|
73
72
|
export declare function ownSnapshotRecord<V>(value: V): SampledRecord | undefined;
|
|
73
|
+
export declare function workflowCompletionExtrasOf(c: object): {
|
|
74
|
+
completionId?: string;
|
|
75
|
+
diagnostics?: string;
|
|
76
|
+
};
|
package/dist/ownKey.js
CHANGED
|
@@ -221,7 +221,6 @@ export function promptManifestSectionViewOf(row) {
|
|
|
221
221
|
const locale = str(o.locale);
|
|
222
222
|
const variant = str(o.variant);
|
|
223
223
|
const contentHash = band !== undefined ? str(o.contentHash) : undefined;
|
|
224
|
-
const slot = str(o.slot);
|
|
225
224
|
return {
|
|
226
225
|
id,
|
|
227
226
|
chars,
|
|
@@ -229,7 +228,6 @@ export function promptManifestSectionViewOf(row) {
|
|
|
229
228
|
...(locale !== undefined ? { locale } : {}),
|
|
230
229
|
...(variant !== undefined ? { variant } : {}),
|
|
231
230
|
...(contentHash !== undefined ? { contentHash } : {}),
|
|
232
|
-
...(slot !== undefined ? { slot } : {}),
|
|
233
231
|
};
|
|
234
232
|
}
|
|
235
233
|
export function promptManifestIdentityOfFrame(frame) {
|
|
@@ -440,3 +438,11 @@ function sampleObject(src, depth, run) {
|
|
|
440
438
|
run.path.delete(src);
|
|
441
439
|
}
|
|
442
440
|
}
|
|
441
|
+
export function workflowCompletionExtrasOf(c) {
|
|
442
|
+
const completionId = guardedRead(() => readOwnDataNonEmptyString(c, 'completionId'));
|
|
443
|
+
const diagnostics = guardedRead(() => readOwnDataNonEmptyString(c, 'diagnostics'));
|
|
444
|
+
return {
|
|
445
|
+
...(completionId !== undefined ? { completionId } : {}),
|
|
446
|
+
...(diagnostics !== undefined ? { diagnostics } : {}),
|
|
447
|
+
};
|
|
448
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type PermissionModeWriteReading = {
|
|
2
|
+
kind: 'unobserved';
|
|
3
|
+
} | {
|
|
4
|
+
kind: 'unreadable';
|
|
5
|
+
} | {
|
|
6
|
+
kind: 'not_reported';
|
|
7
|
+
} | {
|
|
8
|
+
kind: 'present';
|
|
9
|
+
value: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare function projectPermissionModeWriteCapability(caps: unknown): PermissionModeWriteReading | undefined;
|
|
12
|
+
export declare function observedPermissionModeWrite(baseUrl?: string | undefined): PermissionModeWriteReading;
|
|
13
|
+
export declare function permissionModeWriteAvailable(reading: PermissionModeWriteReading | undefined): boolean;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { engineWireTargetBaseUrl } from './engineWireTarget.js';
|
|
2
|
+
import { createEngineCapReader } from './engineCapReader.js';
|
|
3
|
+
import { ownDataField, readOwnDataValue } from './ownKey.js';
|
|
4
|
+
export function projectPermissionModeWriteCapability(caps) {
|
|
5
|
+
try {
|
|
6
|
+
if (caps === null || typeof caps !== 'object' || Array.isArray(caps))
|
|
7
|
+
return undefined;
|
|
8
|
+
const v = ownDataField(caps, 'permissionModeWrite');
|
|
9
|
+
if (v === undefined)
|
|
10
|
+
return { kind: 'not_reported' };
|
|
11
|
+
return typeof v === 'boolean' ? { kind: 'present', value: v } : undefined;
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const reader = createEngineCapReader({
|
|
18
|
+
name: 'permissionModeWrite',
|
|
19
|
+
project: projectPermissionModeWriteCapability,
|
|
20
|
+
});
|
|
21
|
+
export function observedPermissionModeWrite(baseUrl = engineWireTargetBaseUrl()) {
|
|
22
|
+
return reader.observed(baseUrl);
|
|
23
|
+
}
|
|
24
|
+
export function permissionModeWriteAvailable(reading) {
|
|
25
|
+
try {
|
|
26
|
+
if (reading === null || reading === undefined || typeof reading !== 'object' || Array.isArray(reading))
|
|
27
|
+
return false;
|
|
28
|
+
if (readOwnDataValue(reading, 'kind') !== 'present')
|
|
29
|
+
return false;
|
|
30
|
+
return readOwnDataValue(reading, 'value') === true;
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare const RULE_LAYERS_CAP_LEAF: "layers";
|
|
1
2
|
export type PermissionsAllowGrantReading = {
|
|
2
3
|
kind: 'unobserved';
|
|
3
4
|
} | {
|
|
@@ -8,10 +9,12 @@ export type PermissionsAllowGrantReading = {
|
|
|
8
9
|
kind: 'present';
|
|
9
10
|
grants: boolean;
|
|
10
11
|
layer?: boolean;
|
|
12
|
+
layers?: boolean;
|
|
11
13
|
};
|
|
12
14
|
export declare function projectPermissionsAllowGrantCapability(caps: unknown): PermissionsAllowGrantReading | undefined;
|
|
13
15
|
export declare function observedPermissionsAllowGrant(baseUrl?: string | undefined): PermissionsAllowGrantReading;
|
|
14
16
|
export declare function permissionsAllowGrantAvailable(reading: PermissionsAllowGrantReading): boolean;
|
|
15
17
|
export declare function allowWireForm(reading: PermissionsAllowGrantReading): 'layer' | 'grant' | 'off';
|
|
16
18
|
export declare function allowRulesGate(reading: PermissionsAllowGrantReading, settingsRead: 'clean' | 'partial' | 'unreadable' | undefined): 'open' | 'capability_off' | 'settings_read_not_clean';
|
|
19
|
+
export declare function permissionRuleLayersOn(reading: PermissionsAllowGrantReading | undefined): boolean;
|
|
17
20
|
export declare function permissionsAllowGrantDoctorDetail(reading: PermissionsAllowGrantReading, settingsRead?: 'clean' | 'partial' | 'unreadable'): string;
|
|
@@ -4,6 +4,7 @@ import { ownDataField } from './ownKey.js';
|
|
|
4
4
|
import { hasCoreValuePort } from './coreValuePorts.js';
|
|
5
5
|
const ALLOW_GRANT_CAP_PATH = ['settings', 'permissions', 'allowGrant'];
|
|
6
6
|
const ALLOW_LAYER_CAP_LEAF = 'allowLayer';
|
|
7
|
+
export const RULE_LAYERS_CAP_LEAF = 'layers';
|
|
7
8
|
export function projectPermissionsAllowGrantCapability(caps) {
|
|
8
9
|
try {
|
|
9
10
|
if (caps === null || typeof caps !== 'object' || Array.isArray(caps))
|
|
@@ -18,9 +19,21 @@ export function projectPermissionsAllowGrantCapability(caps) {
|
|
|
18
19
|
if (typeof v !== 'boolean')
|
|
19
20
|
return undefined;
|
|
20
21
|
const layer = ownDataField(node, ALLOW_LAYER_CAP_LEAF);
|
|
21
|
-
if (layer
|
|
22
|
-
return
|
|
23
|
-
|
|
22
|
+
if (layer !== undefined && typeof layer !== 'boolean')
|
|
23
|
+
return undefined;
|
|
24
|
+
let layers;
|
|
25
|
+
try {
|
|
26
|
+
layers = ownDataField(node, RULE_LAYERS_CAP_LEAF);
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
layers = undefined;
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
kind: 'present',
|
|
33
|
+
grants: v,
|
|
34
|
+
...(layer !== undefined ? { layer } : {}),
|
|
35
|
+
...(typeof layers === 'boolean' ? { layers } : {}),
|
|
36
|
+
};
|
|
24
37
|
}
|
|
25
38
|
if (v === null || typeof v !== 'object' || Array.isArray(v))
|
|
26
39
|
return undefined;
|
|
@@ -61,6 +74,16 @@ export function allowRulesGate(reading, settingsRead) {
|
|
|
61
74
|
return 'capability_off';
|
|
62
75
|
return settingsRead === 'clean' ? 'open' : 'settings_read_not_clean';
|
|
63
76
|
}
|
|
77
|
+
export function permissionRuleLayersOn(reading) {
|
|
78
|
+
try {
|
|
79
|
+
if (reading === null || typeof reading !== 'object' || Array.isArray(reading))
|
|
80
|
+
return false;
|
|
81
|
+
return ownDataField(reading, 'kind') === 'present' && ownDataField(reading, RULE_LAYERS_CAP_LEAF) === true;
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
64
87
|
function ownReadingField(reading, key) {
|
|
65
88
|
try {
|
|
66
89
|
if (reading === null || typeof reading !== 'object' || Array.isArray(reading))
|
|
@@ -6,6 +6,7 @@ declare const SETTINGS_SOURCE_TIERS: Readonly<{
|
|
|
6
6
|
readonly userSettings: "global";
|
|
7
7
|
readonly localSettings: "project";
|
|
8
8
|
readonly projectSettings: "project";
|
|
9
|
+
readonly foreignProjectSettings: "project";
|
|
9
10
|
}>;
|
|
10
11
|
declare const OFF_LADDER_ROWS: readonly [{
|
|
11
12
|
readonly origin: "cliArg";
|
|
@@ -29,7 +30,6 @@ export interface PermissionsDeclarationInput {
|
|
|
29
30
|
readonly cliDeny?: readonly string[];
|
|
30
31
|
readonly settingsRead: 'clean' | 'partial' | 'unreadable';
|
|
31
32
|
readonly clientOwnedServers?: readonly string[];
|
|
32
|
-
readonly serverVersion?: string;
|
|
33
33
|
}
|
|
34
34
|
export interface PermissionsDeclarationBuckets {
|
|
35
35
|
deny?: string[];
|
|
@@ -39,7 +39,25 @@ export interface PermissionsDeclarationBuckets {
|
|
|
39
39
|
export interface PermissionsDeclaration {
|
|
40
40
|
permissions?: PermissionsDeclarationBuckets;
|
|
41
41
|
}
|
|
42
|
-
export
|
|
42
|
+
export type SettingsRuleLayerOrigin = keyof typeof SETTINGS_SOURCE_TIERS;
|
|
43
|
+
export interface TightenRuleContribution {
|
|
44
|
+
readonly rule: string;
|
|
45
|
+
readonly origin: WireRuleOrigin;
|
|
46
|
+
}
|
|
47
|
+
export interface LayeredTightenEntry {
|
|
48
|
+
readonly rule: string;
|
|
49
|
+
readonly layer: SettingsRuleLayerOrigin;
|
|
50
|
+
}
|
|
51
|
+
export type TightenWireEntry = string | LayeredTightenEntry;
|
|
52
|
+
export interface HostPermissionsBuckets {
|
|
53
|
+
deny?: TightenWireEntry[];
|
|
54
|
+
ask?: TightenWireEntry[];
|
|
55
|
+
allow?: string[];
|
|
56
|
+
}
|
|
57
|
+
export interface HostPermissionsDeclaration {
|
|
58
|
+
permissions?: HostPermissionsBuckets;
|
|
59
|
+
}
|
|
60
|
+
export declare const PERMISSIONS_KEPT_REASONS: readonly ["allow_capability_off", "settings_read_not_clean", "empty_rule", "paren_in_tool_name", "retired_tool_name", "unprefixed_namespaced_name", "incomplete_protocol_name", "unminted_protocol_segment", "home_relative_path", "compile_refused", "content_form_not_grantable", "judge_failed", "duplicate", "voids_allow_list"];
|
|
43
61
|
export type PermissionsKeptReason = (typeof PERMISSIONS_KEPT_REASONS)[number];
|
|
44
62
|
export interface PermissionsKeptRule {
|
|
45
63
|
rule: string;
|
|
@@ -86,8 +104,12 @@ export interface AssembledRuleRow {
|
|
|
86
104
|
readonly origin?: WireRuleOrigin;
|
|
87
105
|
readonly fate: AssembledRuleFate;
|
|
88
106
|
}
|
|
107
|
+
export interface LayeredTightenSources {
|
|
108
|
+
readonly deny: readonly TightenRuleContribution[];
|
|
109
|
+
readonly ask: readonly TightenRuleContribution[];
|
|
110
|
+
}
|
|
89
111
|
export declare function permissionsDeclaration(input: PermissionsDeclarationInput, caps: PermissionsAllowGrantReading): PermissionsDeclaration;
|
|
90
|
-
export declare function projectPermissionsDeclaration(input: PermissionsDeclarationInput, caps: PermissionsAllowGrantReading, projection: RulePortsProjection):
|
|
112
|
+
export declare function projectPermissionsDeclaration(input: PermissionsDeclarationInput, caps: PermissionsAllowGrantReading, projection: RulePortsProjection, layered?: LayeredTightenSources): HostPermissionsDeclaration;
|
|
91
113
|
export declare function permissionsDeclarationReport(input: PermissionsDeclarationInput, caps: PermissionsAllowGrantReading): PermissionsDeclarationReport;
|
|
92
114
|
export declare function assembledRuleRows(input: PermissionsDeclarationInput, caps: PermissionsAllowGrantReading): readonly AssembledRuleRow[];
|
|
93
115
|
export interface PermissionsAllowKeptFacts {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { compileAllowList, hasCoreValuePort, protocolOf, ruleToolGrammarOf } from './coreValuePorts.js';
|
|
2
2
|
import { clientOwnedServerPrefix, ruleToolNameVerdictOf } from './protocolSegment.js';
|
|
3
|
-
import { ruleCompileVerdict
|
|
3
|
+
import { ruleCompileVerdict } from './ruleCompileVerdict.js';
|
|
4
4
|
import { allowRulesGate, allowWireForm } from './permissionsAllowGrantCapability.js';
|
|
5
5
|
import { SETTINGS_IS_AT_LEAST } from './generated/settingsSchemaFns.js';
|
|
6
6
|
import { THROWN_SLOT_UNREADABLE, asAssemblyRefusal, assemblyRefusalOf, isSlotCarrier, readThrownSlot, withAssemblyRefusal } from './wireFailureShape.js';
|
|
@@ -11,8 +11,9 @@ const SETTINGS_SOURCE_TIERS = Object.freeze({
|
|
|
11
11
|
userSettings: 'global',
|
|
12
12
|
localSettings: 'project',
|
|
13
13
|
projectSettings: 'project',
|
|
14
|
+
foreignProjectSettings: 'project',
|
|
14
15
|
});
|
|
15
|
-
const SAME_TIER_ORDER = ['flagSettings', 'userSettings', 'localSettings', 'projectSettings'];
|
|
16
|
+
const SAME_TIER_ORDER = ['flagSettings', 'userSettings', 'localSettings', 'projectSettings', 'foreignProjectSettings'];
|
|
16
17
|
const OFF_LADDER_ROWS = Object.freeze([
|
|
17
18
|
{ origin: 'cliArg', after: 'policySettings' },
|
|
18
19
|
{ origin: 'session', after: 'flagSettings' },
|
|
@@ -47,7 +48,6 @@ export const PERMISSIONS_KEPT_REASONS = Object.freeze([
|
|
|
47
48
|
'home_relative_path',
|
|
48
49
|
'compile_refused',
|
|
49
50
|
'content_form_not_grantable',
|
|
50
|
-
'content_form_never_matches',
|
|
51
51
|
'judge_failed',
|
|
52
52
|
'duplicate',
|
|
53
53
|
'voids_allow_list',
|
|
@@ -154,7 +154,7 @@ function tighteningWholeName(name, check) {
|
|
|
154
154
|
const next = nameCheck(successor);
|
|
155
155
|
return 'retired' in next || 'issue' in next ? name : successor;
|
|
156
156
|
}
|
|
157
|
-
function judgeList(rules, behavior, allowForm = 'grant'
|
|
157
|
+
function judgeList(rules, behavior, allowForm = 'grant') {
|
|
158
158
|
let portsChecked = false;
|
|
159
159
|
return rules.map((rule) => {
|
|
160
160
|
if (rule === '')
|
|
@@ -184,7 +184,7 @@ function judgeList(rules, behavior, allowForm = 'grant', serverVersion) {
|
|
|
184
184
|
}
|
|
185
185
|
const check = nameCheck(parsed.toolName);
|
|
186
186
|
if (behavior !== 'allow')
|
|
187
|
-
return
|
|
187
|
+
return { sent: true, wire: rule };
|
|
188
188
|
if ('retired' in check)
|
|
189
189
|
return kept('retired_tool_name');
|
|
190
190
|
if ('issue' in check)
|
|
@@ -244,45 +244,60 @@ function allowListVoiders(sent) {
|
|
|
244
244
|
return 'unknown';
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
|
-
function judgeBucket(raw, behavior, originOf, cli, settingsGate, allowForm = 'grant', dropWire, owned = [],
|
|
247
|
+
function judgeBucket(raw, behavior, originOf, cli, settingsGate, allowForm = 'grant', dropWire, owned = [], layeredFrom) {
|
|
248
248
|
const firstSlot = new Map();
|
|
249
249
|
for (const s of raw)
|
|
250
250
|
if (!firstSlot.has(s.rule))
|
|
251
251
|
firstSlot.set(s.rule, s);
|
|
252
252
|
const groups = WIRE_RULE_TRUST_ORDER.map(() => []);
|
|
253
253
|
const rankOf = (origin) => WIRE_RULE_TRUST_ORDER.indexOf(origin);
|
|
254
|
-
|
|
255
|
-
|
|
254
|
+
const pairs = layeredFrom !== undefined ? layeredFrom.map((c) => [c.rule, c.origin]) : originOf;
|
|
255
|
+
const known = new Set();
|
|
256
|
+
if (pairs !== undefined) {
|
|
257
|
+
for (const [r, origin] of pairs) {
|
|
256
258
|
const rank = rankOf(origin);
|
|
257
|
-
if (rank >= 0 && typeof r === 'string' && firstSlot.has(r))
|
|
259
|
+
if (rank >= 0 && typeof r === 'string' && firstSlot.has(r)) {
|
|
258
260
|
appendOwnElement(groups[rank], r);
|
|
261
|
+
known.add(r);
|
|
262
|
+
}
|
|
259
263
|
}
|
|
260
264
|
}
|
|
261
|
-
const unknownOrigin = [...firstSlot.keys()].filter((r) =>
|
|
265
|
+
const unknownOrigin = [...firstSlot.keys()].filter((r) => !known.has(r));
|
|
262
266
|
const fateOfRule = new Map();
|
|
263
267
|
const sent = [];
|
|
268
|
+
const sentLayers = [];
|
|
269
|
+
const sentIds = [];
|
|
264
270
|
const winnerOf = new Map();
|
|
265
271
|
const cliFates = cli === undefined ? [] : [...cli.fates];
|
|
266
|
-
const
|
|
272
|
+
const layerOf = (origin) => layeredFrom !== undefined && origin !== undefined && Object.hasOwn(SETTINGS_SOURCE_TIERS, origin) ? origin : undefined;
|
|
273
|
+
const place = (slot, fate, origin) => {
|
|
267
274
|
if (!fate.sent)
|
|
268
275
|
return fate;
|
|
269
276
|
const dropped = dropWire?.(fate.wire);
|
|
270
277
|
if (dropped !== undefined)
|
|
271
278
|
return kept(dropped);
|
|
272
|
-
|
|
279
|
+
const layer = layerOf(origin);
|
|
280
|
+
const id = layeredFrom === undefined ? fate.wire : JSON.stringify([layer ?? null, fate.wire]);
|
|
281
|
+
if (winnerOf.has(id))
|
|
273
282
|
return kept('duplicate');
|
|
274
|
-
winnerOf.set(
|
|
283
|
+
winnerOf.set(id, slot);
|
|
275
284
|
appendOwnElement(sent, fate.wire);
|
|
285
|
+
appendOwnElement(sentLayers, layer);
|
|
286
|
+
appendOwnElement(sentIds, id);
|
|
276
287
|
return fate;
|
|
277
288
|
};
|
|
278
289
|
const appendGroup = (group, origin) => {
|
|
279
290
|
const held = settingsGate !== undefined && !outsideSettingsFiles(origin);
|
|
280
|
-
const fates = held ? group.map(() => kept(settingsGate)) : judgeList(group, behavior, allowForm
|
|
281
|
-
group.forEach((r, k) =>
|
|
291
|
+
const fates = held ? group.map(() => kept(settingsGate)) : judgeList(group, behavior, allowForm);
|
|
292
|
+
group.forEach((r, k) => {
|
|
293
|
+
const f = place(firstSlot.get(r), fates[k], origin);
|
|
294
|
+
if (!fateOfRule.has(r))
|
|
295
|
+
fateOfRule.set(r, f);
|
|
296
|
+
});
|
|
282
297
|
};
|
|
283
298
|
WIRE_RULE_TRUST_ORDER.forEach((origin, rank) => {
|
|
284
299
|
if (origin === 'cliArg' && cli !== undefined)
|
|
285
|
-
cli.slots.forEach((s, k) => (cliFates[k] = place(s, cliFates[k])));
|
|
300
|
+
cli.slots.forEach((s, k) => (cliFates[k] = place(s, cliFates[k], 'cliArg')));
|
|
286
301
|
appendGroup(groups[rank], origin);
|
|
287
302
|
});
|
|
288
303
|
const ownedFates = owned.map((fate, k) => place({ rule: fate.sent ? fate.wire : '', list: 'allow', at: -1 - k }, fate));
|
|
@@ -293,7 +308,7 @@ function judgeBucket(raw, behavior, originOf, cli, settingsGate, allowForm = 'gr
|
|
|
293
308
|
return f;
|
|
294
309
|
return f.sent || f.reason === 'duplicate' ? kept('duplicate') : f;
|
|
295
310
|
});
|
|
296
|
-
return { sent, fates: [...fates, ...cliFates], winnerOf, ownedFates };
|
|
311
|
+
return { sent, sentLayers, sentIds, fates: [...fates, ...cliFates], winnerOf, ownedFates };
|
|
297
312
|
}
|
|
298
313
|
function clientOwnedFate(server) {
|
|
299
314
|
if (server.length === 0)
|
|
@@ -312,7 +327,7 @@ function ownField(obj, key, where) {
|
|
|
312
327
|
throw malformed(`${WHO}: ${where}${key} 只在原型链上,不是自有字段 —— 拒绝读取(请交普通对象)。`);
|
|
313
328
|
return undefined;
|
|
314
329
|
}
|
|
315
|
-
function ruleList(v, key) {
|
|
330
|
+
function ruleList(v, key, tighten = false) {
|
|
316
331
|
if (v === undefined || v === null)
|
|
317
332
|
return undefined;
|
|
318
333
|
if (!Array.isArray(v))
|
|
@@ -326,6 +341,9 @@ function ruleList(v, key) {
|
|
|
326
341
|
continue;
|
|
327
342
|
}
|
|
328
343
|
const r = v[i];
|
|
344
|
+
if (tighten && r !== null && typeof r === 'object') {
|
|
345
|
+
throw malformed(`${WHO}: ${key}[${i}] 是对象(带出处层的条目形)—— 本口只收规则串:收紧方向的条目不静默丢,拒绝装配(带层条目由宿主设置入口在能力位恰真时铸)。`);
|
|
346
|
+
}
|
|
329
347
|
if (typeof r === 'string')
|
|
330
348
|
appendOwnElement(out, r);
|
|
331
349
|
}
|
|
@@ -348,17 +366,17 @@ function originMap(v, key) {
|
|
|
348
366
|
return snap;
|
|
349
367
|
}
|
|
350
368
|
const slotsOf = (list, name) => (list ?? []).map((rule, at) => ({ rule, list: name, at }));
|
|
351
|
-
function assemble(input, caps, projection) {
|
|
369
|
+
function assemble(input, caps, projection, layered) {
|
|
352
370
|
const outer = activeRulePortsProjection;
|
|
353
371
|
activeRulePortsProjection = projection;
|
|
354
372
|
try {
|
|
355
|
-
return assembleNow(input, caps);
|
|
373
|
+
return assembleNow(input, caps, layered);
|
|
356
374
|
}
|
|
357
375
|
finally {
|
|
358
376
|
activeRulePortsProjection = outer;
|
|
359
377
|
}
|
|
360
378
|
}
|
|
361
|
-
function assembleNow(input, caps) {
|
|
379
|
+
function assembleNow(input, caps, layered) {
|
|
362
380
|
let read;
|
|
363
381
|
try {
|
|
364
382
|
read = readAssemblyInput(input, caps);
|
|
@@ -367,7 +385,7 @@ function assembleNow(input, caps) {
|
|
|
367
385
|
throw asAssemblyRefusal(e, 'input_malformed', WHO);
|
|
368
386
|
}
|
|
369
387
|
try {
|
|
370
|
-
return judgeAssembly(read, caps);
|
|
388
|
+
return judgeAssembly(read, caps, layered);
|
|
371
389
|
}
|
|
372
390
|
catch (e) {
|
|
373
391
|
throw asAssemblyRefusal(e, 'judge_unanswerable', WHO);
|
|
@@ -377,10 +395,10 @@ function readAssemblyInput(input, caps) {
|
|
|
377
395
|
if (input === null || typeof input !== 'object' || Array.isArray(input)) {
|
|
378
396
|
throw malformed(`${WHO}: 入参必须是对象 —— 收到 ${input === null ? 'null' : Array.isArray(input) ? 'array' : `typeof=${typeof input}`}。`);
|
|
379
397
|
}
|
|
380
|
-
const deny = ruleList(ownField(input, 'deny', ''), 'deny');
|
|
381
|
-
const ask = ruleList(ownField(input, 'ask', ''), 'ask');
|
|
398
|
+
const deny = ruleList(ownField(input, 'deny', ''), 'deny', true);
|
|
399
|
+
const ask = ruleList(ownField(input, 'ask', ''), 'ask', true);
|
|
382
400
|
const allow = ruleList(ownField(input, 'allow', ''), 'allow');
|
|
383
|
-
const cliDeny = ruleList(ownField(input, 'cliDeny', ''), 'cliDeny');
|
|
401
|
+
const cliDeny = ruleList(ownField(input, 'cliDeny', ''), 'cliDeny', true);
|
|
384
402
|
const ownedServers = [...new Set(ruleList(ownField(input, 'clientOwnedServers', ''), 'clientOwnedServers') ?? [])];
|
|
385
403
|
const originsRaw = ownField(input, 'origins', '');
|
|
386
404
|
let origins = {};
|
|
@@ -394,23 +412,21 @@ function readAssemblyInput(input, caps) {
|
|
|
394
412
|
origins = { ...(od ? { deny: od } : {}), ...(oa ? { ask: oa } : {}), ...(ol ? { allow: ol } : {}) };
|
|
395
413
|
}
|
|
396
414
|
const gate = allowRulesGate(caps, ownField(input, 'settingsRead', ''));
|
|
397
|
-
|
|
398
|
-
const serverVersion = typeof versionRaw === 'string' ? versionRaw : undefined;
|
|
399
|
-
return { deny, ask, allow, cliDeny, ownedServers, origins, gate, serverVersion };
|
|
415
|
+
return { deny, ask, allow, cliDeny, ownedServers, origins, gate };
|
|
400
416
|
}
|
|
401
|
-
function judgeAssembly(read, caps) {
|
|
402
|
-
const { deny, ask, allow, cliDeny, ownedServers, origins, gate
|
|
417
|
+
function judgeAssembly(read, caps, layered) {
|
|
418
|
+
const { deny, ask, allow, cliDeny, ownedServers, origins, gate } = read;
|
|
403
419
|
const cliSlots = slotsOf(cliDeny, 'cliDeny');
|
|
404
|
-
const cli = cliDeny === undefined ? undefined : { slots: cliSlots, fates: judgeList(cliDeny, 'deny', 'grant'
|
|
420
|
+
const cli = cliDeny === undefined ? undefined : { slots: cliSlots, fates: judgeList(cliDeny, 'deny', 'grant') };
|
|
405
421
|
const denySlots = slotsOf(deny, 'deny');
|
|
406
422
|
const askSlots = slotsOf(ask, 'ask');
|
|
407
423
|
const allowSlots = slotsOf(allow, 'allow');
|
|
408
|
-
const denyJ = judgeBucket(denySlots, 'deny', origins.deny, cli, undefined, 'grant', undefined, [],
|
|
409
|
-
const askJ = judgeBucket(askSlots, 'ask', origins.ask, undefined, undefined, 'grant', undefined, [],
|
|
424
|
+
const denyJ = judgeBucket(denySlots, 'deny', origins.deny, cli, undefined, 'grant', undefined, [], layered?.deny);
|
|
425
|
+
const askJ = judgeBucket(askSlots, 'ask', origins.ask, undefined, undefined, 'grant', undefined, [], layered?.ask);
|
|
410
426
|
const allowForm = allowWireForm(caps) === 'layer' ? 'layer' : 'grant';
|
|
411
427
|
const settingsGate = gate === 'settings_read_not_clean' ? 'settings_read_not_clean' : undefined;
|
|
412
428
|
let allowJ = gate === 'capability_off'
|
|
413
|
-
? { sent: [], fates: allowSlots.map(() => kept('allow_capability_off')), winnerOf: new Map(), ownedFates: ownedServers.map(() => kept('allow_capability_off')) }
|
|
429
|
+
? { sent: [], sentLayers: [], sentIds: [], fates: allowSlots.map(() => kept('allow_capability_off')), winnerOf: new Map(), ownedFates: ownedServers.map(() => kept('allow_capability_off')) }
|
|
414
430
|
: judgeBucket(allowSlots, 'allow', origins.allow, undefined, settingsGate, allowForm, undefined, ownedServers.map(clientOwnedFate));
|
|
415
431
|
if (gate !== 'capability_off' && allowForm === 'layer' && allowJ.sent.length > 0) {
|
|
416
432
|
const voiders = allowListVoiders(allowJ.sent);
|
|
@@ -426,6 +442,17 @@ function judgeAssembly(read, caps) {
|
|
|
426
442
|
buckets.ask = [...askJ.sent];
|
|
427
443
|
if (allowJ.sent.length > 0)
|
|
428
444
|
buckets.allow = [...allowJ.sent];
|
|
445
|
+
const entriesOf = (j) => j.sent.map((wire, i) => {
|
|
446
|
+
const layer = j.sentLayers[i];
|
|
447
|
+
return layer === undefined ? wire : Object.freeze({ rule: wire, layer });
|
|
448
|
+
});
|
|
449
|
+
const wireBuckets = {};
|
|
450
|
+
if (denyJ.sent.length > 0)
|
|
451
|
+
wireBuckets.deny = entriesOf(denyJ);
|
|
452
|
+
if (askJ.sent.length > 0)
|
|
453
|
+
wireBuckets.ask = entriesOf(askJ);
|
|
454
|
+
if (allowJ.sent.length > 0)
|
|
455
|
+
wireBuckets.allow = [...allowJ.sent];
|
|
429
456
|
const keptRows = [];
|
|
430
457
|
const rewritten = [];
|
|
431
458
|
const ruleRows = [];
|
|
@@ -458,21 +485,22 @@ function judgeAssembly(read, caps) {
|
|
|
458
485
|
});
|
|
459
486
|
}
|
|
460
487
|
});
|
|
461
|
-
|
|
462
|
-
const winner = j.winnerOf.get(
|
|
488
|
+
j.sent.forEach((wire, i) => {
|
|
489
|
+
const winner = j.winnerOf.get(j.sentIds[i]);
|
|
463
490
|
if (winner.at < 0)
|
|
464
|
-
|
|
491
|
+
return;
|
|
465
492
|
if (winner.rule !== wire)
|
|
466
493
|
appendOwnElement(rewritten, { from: winner.rule, to: wire, bucket });
|
|
467
|
-
}
|
|
494
|
+
});
|
|
468
495
|
}
|
|
469
|
-
return { buckets, report: { kept: keptRows, rewritten, ...(clientOwned.length > 0 ? { clientOwned } : {}) }, rows: ruleRows };
|
|
496
|
+
return { buckets, wireBuckets, report: { kept: keptRows, rewritten, ...(clientOwned.length > 0 ? { clientOwned } : {}) }, rows: ruleRows };
|
|
470
497
|
}
|
|
471
498
|
export function permissionsDeclaration(input, caps) {
|
|
472
499
|
return declarationOf(assemble(input, caps));
|
|
473
500
|
}
|
|
474
|
-
export function projectPermissionsDeclaration(input, caps, projection) {
|
|
475
|
-
|
|
501
|
+
export function projectPermissionsDeclaration(input, caps, projection, layered) {
|
|
502
|
+
const { wireBuckets } = assemble(input, caps, projection, layered);
|
|
503
|
+
return Object.keys(wireBuckets).length > 0 ? { permissions: wireBuckets } : {};
|
|
476
504
|
}
|
|
477
505
|
function declarationOf({ buckets }) {
|
|
478
506
|
return Object.keys(buckets).length > 0 ? { permissions: buckets } : {};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
export type PlanBodyUnknownCause = 'not_observed' | 'gate_unidentified' | 'gate_moved' | 'unreadable' | 'ambiguous_call' | 'malformed_frame' | 'conflicting_claims' | 'not_presented' | 'not_carried';
|
|
2
|
+
export type PlanReviewBody = {
|
|
3
|
+
readonly kind: 'shown';
|
|
4
|
+
readonly markdown: string;
|
|
5
|
+
} | {
|
|
6
|
+
readonly kind: 'marked';
|
|
7
|
+
readonly literal: string;
|
|
8
|
+
} | {
|
|
9
|
+
readonly kind: 'too_large';
|
|
10
|
+
readonly length: number;
|
|
11
|
+
} | {
|
|
12
|
+
readonly kind: 'unknown';
|
|
13
|
+
readonly cause: PlanBodyUnknownCause;
|
|
14
|
+
};
|
|
15
|
+
export interface PlanReviewCardFacts {
|
|
16
|
+
readonly taskId: string;
|
|
17
|
+
readonly checkpointId?: string;
|
|
18
|
+
readonly body: PlanReviewBody;
|
|
19
|
+
}
|
|
20
|
+
export declare function planReviewBodyOf(text: string): Exclude<PlanReviewBody, {
|
|
21
|
+
kind: 'unknown';
|
|
22
|
+
}>;
|
|
23
|
+
export declare function mintPlanReviewCardFacts(taskId: string, checkpointId: string | undefined, body: PlanReviewBody): PlanReviewCardFacts;
|
|
24
|
+
export declare function unknownBody(cause: PlanBodyUnknownCause): PlanReviewBody;
|
|
25
|
+
export declare function planReviewCardFactsFrom(v: {} | null | undefined): PlanReviewCardFacts | undefined;
|
|
26
|
+
export declare function samePlanReviewCardFacts(a: PlanReviewCardFacts, b: PlanReviewCardFacts): boolean;
|
|
27
|
+
export declare function isPlanReviewPark(result: unknown): result is {
|
|
28
|
+
taskId: string;
|
|
29
|
+
sessionId?: string;
|
|
30
|
+
};
|
|
31
|
+
export declare function pausedCheckpointIdOf(carrier: {} | null | undefined): string | undefined;
|
|
32
|
+
export type PlanClaim = {
|
|
33
|
+
readonly kind: 'text';
|
|
34
|
+
readonly text: string;
|
|
35
|
+
} | {
|
|
36
|
+
readonly kind: 'cause';
|
|
37
|
+
readonly cause: PlanBodyUnknownCause;
|
|
38
|
+
};
|
|
39
|
+
interface PresentedCall {
|
|
40
|
+
readonly plan?: string;
|
|
41
|
+
}
|
|
42
|
+
interface ClaimWindow {
|
|
43
|
+
presented: PresentedCall[];
|
|
44
|
+
malformed: boolean;
|
|
45
|
+
ambiguous: boolean;
|
|
46
|
+
unreadable: boolean;
|
|
47
|
+
}
|
|
48
|
+
interface PlanReviewGateEntry {
|
|
49
|
+
readonly checkpointId: string;
|
|
50
|
+
readonly facts: PlanReviewCardFacts;
|
|
51
|
+
readonly claim: PlanClaim;
|
|
52
|
+
readonly highWater?: string;
|
|
53
|
+
readonly generation: number;
|
|
54
|
+
}
|
|
55
|
+
interface PlanReviewRunRecord {
|
|
56
|
+
readonly open: Set<string>;
|
|
57
|
+
readonly settled: Set<string>;
|
|
58
|
+
window: ClaimWindow;
|
|
59
|
+
sawPlanFrame: boolean;
|
|
60
|
+
claimAtMarker?: PlanClaim | undefined;
|
|
61
|
+
claimGate?: string | undefined;
|
|
62
|
+
dirty: boolean;
|
|
63
|
+
gate?: PlanReviewGateEntry;
|
|
64
|
+
generation: number;
|
|
65
|
+
cardIssued: boolean;
|
|
66
|
+
}
|
|
67
|
+
export declare function _resetPlanReviewRunsForTest(): void;
|
|
68
|
+
export interface PlanReviewFactsTicket {
|
|
69
|
+
readonly sessionKey: string;
|
|
70
|
+
readonly taskId: string;
|
|
71
|
+
readonly generation: number;
|
|
72
|
+
}
|
|
73
|
+
export declare function beginPlanReviewFactsRead(sessionKey: string, taskId: string): PlanReviewFactsTicket;
|
|
74
|
+
export declare function commitPlanReviewFacts(ticket: PlanReviewFactsTicket, facts: PlanReviewCardFacts, claim: PlanClaim, highWater?: string): PlanReviewCardFacts | undefined;
|
|
75
|
+
export declare function samePlanClaim(a: PlanClaim, b: PlanClaim): boolean;
|
|
76
|
+
export declare function registeredPlanReviewCardFacts(sessionKey: string, taskId: string, checkpointId: string): PlanReviewCardFacts | undefined;
|
|
77
|
+
export interface PlanReviewCurrentGate {
|
|
78
|
+
readonly checkpointId: string;
|
|
79
|
+
readonly facts: PlanReviewCardFacts;
|
|
80
|
+
readonly generation: number;
|
|
81
|
+
}
|
|
82
|
+
export declare function currentPlanReviewGateOf(sessionKey: string, taskId: string): PlanReviewCurrentGate | undefined;
|
|
83
|
+
export declare function planReviewRunGeneration(sessionKey: string, taskId: string): number;
|
|
84
|
+
export declare function notePlanReviewCardIssued(sessionKey: string, taskId: string): boolean;
|
|
85
|
+
export declare function planReviewGateHighWaterOf(sessionKey: string, taskId: string, checkpointId: string): string | undefined;
|
|
86
|
+
export interface PlanBodyClaimLeg {
|
|
87
|
+
taskId?: string;
|
|
88
|
+
readonly buffer: Array<{
|
|
89
|
+
readonly frame: object;
|
|
90
|
+
readonly subFlow: boolean;
|
|
91
|
+
}>;
|
|
92
|
+
overflow: boolean;
|
|
93
|
+
unreadable: boolean;
|
|
94
|
+
}
|
|
95
|
+
export declare function openPlanBodyClaimLeg(): PlanBodyClaimLeg;
|
|
96
|
+
export declare function stepPlanBodyClaim(leg: PlanBodyClaimLeg, frame: object, subFlow: boolean): void;
|
|
97
|
+
export declare function planReviewParkFacts(leg: PlanBodyClaimLeg, result: {} | null | undefined): PlanReviewCardFacts | undefined;
|
|
98
|
+
export interface PlanReviewFactsTaken {
|
|
99
|
+
readonly sessionKey: string;
|
|
100
|
+
readonly taskId: string;
|
|
101
|
+
readonly facts: PlanReviewCardFacts;
|
|
102
|
+
readonly generation: number;
|
|
103
|
+
}
|
|
104
|
+
export declare function planReviewFactsCurrent(taken: PlanReviewFactsTaken): boolean;
|
|
105
|
+
export interface PlanGateRowRead {
|
|
106
|
+
readonly ok: boolean;
|
|
107
|
+
readonly atPlanGate: boolean;
|
|
108
|
+
readonly checkpointId?: string;
|
|
109
|
+
}
|
|
110
|
+
export declare function planGateRowReadOf(row: {} | null | undefined): PlanGateRowRead;
|
|
111
|
+
export type PlanReviewLedgerFold = PlanReviewRunRecord;
|
|
112
|
+
export declare function openPlanReviewLedgerFold(): PlanReviewLedgerFold;
|
|
113
|
+
export declare function stepPlanReviewLedgerFold(fold: PlanReviewLedgerFold, frame: object, subFlow: boolean): PlanReviewLedgerFold;
|
|
114
|
+
export declare function planReviewLedgerClaimOf(fold: PlanReviewLedgerFold): PlanClaim | undefined;
|
|
115
|
+
export declare function isPlanReviewClaimFrame(frame: object): boolean;
|
|
116
|
+
export {};
|