@scotthuang/agent-knock-knock 0.13.3 → 0.13.4
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 +14 -0
- package/README.md +13 -5
- package/dist/src/callback-outbox-policy.js +27 -6
- package/dist/src/callback-outbox-policy.js.map +1 -1
- package/dist/src/callback-outbox-service.d.ts +4 -30
- package/dist/src/callback-outbox-service.js +21 -154
- package/dist/src/callback-outbox-service.js.map +1 -1
- package/dist/src/callback-outbox-settlement.js +13 -8
- package/dist/src/callback-outbox-settlement.js.map +1 -1
- package/dist/src/callback-route-service.d.ts +46 -0
- package/dist/src/callback-route-service.js +155 -0
- package/dist/src/callback-route-service.js.map +1 -0
- package/dist/src/codex-process-incarnation.d.ts +8 -0
- package/dist/src/codex-process-incarnation.js +36 -0
- package/dist/src/codex-process-incarnation.js.map +1 -0
- package/dist/src/deferred-foreground-conflict-policy.d.ts +22 -0
- package/dist/src/deferred-foreground-conflict-policy.js +52 -0
- package/dist/src/deferred-foreground-conflict-policy.js.map +1 -0
- package/dist/src/durable-notification-kernel.d.ts +94 -0
- package/dist/src/durable-notification-kernel.js +68 -0
- package/dist/src/durable-notification-kernel.js.map +1 -0
- package/dist/src/herdr-socket-transport.d.ts +43 -0
- package/dist/src/herdr-socket-transport.js +170 -0
- package/dist/src/herdr-socket-transport.js.map +1 -0
- package/dist/src/herdr-terminal-control-provider.d.ts +2 -45
- package/dist/src/herdr-terminal-control-provider.js +2 -172
- package/dist/src/herdr-terminal-control-provider.js.map +1 -1
- package/dist/src/host-adapter-capabilities.d.ts +35 -0
- package/dist/src/host-adapter-capabilities.js +146 -0
- package/dist/src/host-adapter-capabilities.js.map +1 -0
- package/dist/src/host-adapter.d.ts +9 -3
- package/dist/src/host-adapter.js +33 -9
- package/dist/src/host-adapter.js.map +1 -1
- package/dist/src/host-bridge-tools.d.ts +3 -4
- package/dist/src/host-bridge-tools.js +49 -92
- package/dist/src/host-bridge-tools.js.map +1 -1
- package/dist/src/host-bridge.js +5 -5
- package/dist/src/host-bridge.js.map +1 -1
- package/dist/src/host-monitor-reconciliation.d.ts +6 -0
- package/dist/src/host-monitor-reconciliation.js +96 -0
- package/dist/src/host-monitor-reconciliation.js.map +1 -0
- package/dist/src/native-thread-lifecycle-cli-adapter.js +116 -60
- package/dist/src/native-thread-lifecycle-cli-adapter.js.map +1 -1
- package/dist/src/openclaw-list-projection.d.ts +2 -0
- package/dist/src/openclaw-list-projection.js +3 -0
- package/dist/src/openclaw-list-projection.js.map +1 -0
- package/dist/src/openclaw-model-facing-field-policy.d.ts +2 -0
- package/dist/src/openclaw-model-facing-field-policy.js +3 -0
- package/dist/src/openclaw-model-facing-field-policy.js.map +1 -0
- package/dist/src/openclaw-plugin-command-adapter.d.ts +6 -29
- package/dist/src/openclaw-plugin-command-adapter.js +7 -2660
- package/dist/src/openclaw-plugin-command-adapter.js.map +1 -1
- package/dist/src/openclaw-plugin-helpers.d.ts +2 -148
- package/dist/src/openclaw-plugin-helpers.js +2 -1844
- package/dist/src/openclaw-plugin-helpers.js.map +1 -1
- package/dist/src/openclaw-plugin-schemas.d.ts +2 -563
- package/dist/src/openclaw-plugin-schemas.js +2 -572
- package/dist/src/openclaw-plugin-schemas.js.map +1 -1
- package/dist/src/openclaw-plugin-supervisor.d.ts +4 -5
- package/dist/src/openclaw-plugin-supervisor.js +5 -94
- package/dist/src/openclaw-plugin-supervisor.js.map +1 -1
- package/dist/src/openclaw-plugin-value-helpers.d.ts +2 -0
- package/dist/src/openclaw-plugin-value-helpers.js +3 -0
- package/dist/src/openclaw-plugin-value-helpers.js.map +1 -0
- package/dist/src/openclaw-private-authority-offers.d.ts +4 -39
- package/dist/src/openclaw-private-authority-offers.js +3 -258
- package/dist/src/openclaw-private-authority-offers.js.map +1 -1
- package/dist/src/semantic-private-authority-offers.d.ts +41 -0
- package/dist/src/semantic-private-authority-offers.js +261 -0
- package/dist/src/semantic-private-authority-offers.js.map +1 -0
- package/dist/src/semantic-tool-arguments.d.ts +9 -0
- package/dist/src/semantic-tool-arguments.js +64 -0
- package/dist/src/semantic-tool-arguments.js.map +1 -0
- package/dist/src/semantic-tool-catalog.d.ts +48 -0
- package/dist/src/semantic-tool-catalog.js +105 -0
- package/dist/src/semantic-tool-catalog.js.map +1 -0
- package/dist/src/semantic-tool-command-helpers.d.ts +145 -0
- package/dist/src/semantic-tool-command-helpers.js +1272 -0
- package/dist/src/semantic-tool-command-helpers.js.map +1 -0
- package/dist/src/semantic-tool-list-projection.d.ts +10 -0
- package/dist/src/semantic-tool-list-projection.js +497 -0
- package/dist/src/semantic-tool-list-projection.js.map +1 -0
- package/dist/src/semantic-tool-model-facing-field-policy.d.ts +3 -0
- package/dist/src/semantic-tool-model-facing-field-policy.js +66 -0
- package/dist/src/semantic-tool-model-facing-field-policy.js.map +1 -0
- package/dist/src/semantic-tool-presentation.d.ts +37 -0
- package/dist/src/semantic-tool-presentation.js +680 -0
- package/dist/src/semantic-tool-presentation.js.map +1 -0
- package/dist/src/semantic-tool-private-authority.d.ts +39 -0
- package/dist/src/semantic-tool-private-authority.js +602 -0
- package/dist/src/semantic-tool-private-authority.js.map +1 -0
- package/dist/src/semantic-tool-relay.d.ts +16 -0
- package/dist/src/semantic-tool-relay.js +175 -0
- package/dist/src/semantic-tool-relay.js.map +1 -0
- package/dist/src/semantic-tool-runtime.d.ts +10 -0
- package/dist/src/semantic-tool-runtime.js +1157 -0
- package/dist/src/semantic-tool-runtime.js.map +1 -0
- package/dist/src/semantic-tool-schemas.d.ts +563 -0
- package/dist/src/semantic-tool-schemas.js +573 -0
- package/dist/src/semantic-tool-schemas.js.map +1 -0
- package/dist/src/semantic-tool-value-helpers.d.ts +5 -0
- package/dist/src/semantic-tool-value-helpers.js +27 -0
- package/dist/src/semantic-tool-value-helpers.js.map +1 -0
- package/dist/src/store-event-presentation.d.ts +17 -0
- package/dist/src/store-event-presentation.js +33 -0
- package/dist/src/store-event-presentation.js.map +1 -0
- package/dist/src/store.d.ts +3 -16
- package/dist/src/store.js +2 -30
- package/dist/src/store.js.map +1 -1
- package/dist/src/terminal-action-projection.d.ts +2 -98
- package/dist/src/terminal-action-projection.js +13 -215
- package/dist/src/terminal-action-projection.js.map +1 -1
- package/dist/src/terminal-agent-bridge.d.ts +14 -340
- package/dist/src/terminal-agent-bridge.js +155 -3226
- package/dist/src/terminal-agent-bridge.js.map +1 -1
- package/dist/src/terminal-approval-cli-adapter.d.ts +17 -0
- package/dist/src/terminal-approval-cli-adapter.js +921 -0
- package/dist/src/terminal-approval-cli-adapter.js.map +1 -0
- package/dist/src/terminal-command-cli-adapter.d.ts +2 -429
- package/dist/src/terminal-command-cli-adapter.js +344 -6061
- package/dist/src/terminal-command-cli-adapter.js.map +1 -1
- package/dist/src/terminal-command-cli-ports.d.ts +443 -0
- package/dist/src/terminal-command-cli-ports.js +2 -0
- package/dist/src/terminal-command-cli-ports.js.map +1 -0
- package/dist/src/terminal-command-dispatch-preparation.d.ts +81 -0
- package/dist/src/terminal-command-dispatch-preparation.js +209 -0
- package/dist/src/terminal-command-dispatch-preparation.js.map +1 -0
- package/dist/src/terminal-command-dispatch-transport.d.ts +35 -0
- package/dist/src/terminal-command-dispatch-transport.js +859 -0
- package/dist/src/terminal-command-dispatch-transport.js.map +1 -0
- package/dist/src/terminal-command-foreground-proof.d.ts +32 -0
- package/dist/src/terminal-command-foreground-proof.js +72 -0
- package/dist/src/terminal-command-foreground-proof.js.map +1 -0
- package/dist/src/terminal-command-send-preflight.d.ts +41 -0
- package/dist/src/terminal-command-send-preflight.js +86 -0
- package/dist/src/terminal-command-send-preflight.js.map +1 -0
- package/dist/src/terminal-composer-classifier.d.ts +55 -0
- package/dist/src/terminal-composer-classifier.js +638 -0
- package/dist/src/terminal-composer-classifier.js.map +1 -0
- package/dist/src/terminal-dispatch-recovery-authority.d.ts +56 -0
- package/dist/src/terminal-dispatch-recovery-authority.js +251 -0
- package/dist/src/terminal-dispatch-recovery-authority.js.map +1 -0
- package/dist/src/terminal-dispatch-recovery-cli-adapter.d.ts +1 -9
- package/dist/src/terminal-dispatch-recovery-cli-adapter.js +5 -240
- package/dist/src/terminal-dispatch-recovery-cli-adapter.js.map +1 -1
- package/dist/src/terminal-handoff-cli-adapter.d.ts +1 -11
- package/dist/src/terminal-handoff-cli-adapter.js +2 -39
- package/dist/src/terminal-handoff-cli-adapter.js.map +1 -1
- package/dist/src/terminal-human-explicit-send-cli-adapter.d.ts +25 -0
- package/dist/src/terminal-human-explicit-send-cli-adapter.js +903 -0
- package/dist/src/terminal-human-explicit-send-cli-adapter.js.map +1 -0
- package/dist/src/terminal-identity-authority-cli-adapter.d.ts +1 -6
- package/dist/src/terminal-identity-authority-cli-adapter.js +3 -33
- package/dist/src/terminal-identity-authority-cli-adapter.js.map +1 -1
- package/dist/src/terminal-interaction-cli-adapter.js +209 -210
- package/dist/src/terminal-interaction-cli-adapter.js.map +1 -1
- package/dist/src/terminal-interaction-core.d.ts +0 -2
- package/dist/src/terminal-interaction-core.js +4 -3
- package/dist/src/terminal-interaction-core.js.map +1 -1
- package/dist/src/terminal-interaction-protocol.d.ts +21 -0
- package/dist/src/terminal-interaction-protocol.js +74 -0
- package/dist/src/terminal-interaction-protocol.js.map +1 -1
- package/dist/src/terminal-interaction-response-bridge.d.ts +126 -0
- package/dist/src/terminal-interaction-response-bridge.js +579 -0
- package/dist/src/terminal-interaction-response-bridge.js.map +1 -0
- package/dist/src/terminal-interaction-response-transaction.d.ts +44 -0
- package/dist/src/terminal-interaction-response-transaction.js +56 -0
- package/dist/src/terminal-interaction-response-transaction.js.map +1 -0
- package/dist/src/terminal-list-action-policy.d.ts +43 -0
- package/dist/src/terminal-list-action-policy.js +164 -0
- package/dist/src/terminal-list-action-policy.js.map +1 -0
- package/dist/src/terminal-list-cli-adapter.d.ts +6 -36
- package/dist/src/terminal-list-cli-adapter.js +241 -1946
- package/dist/src/terminal-list-cli-adapter.js.map +1 -1
- package/dist/src/terminal-list-facts.d.ts +129 -0
- package/dist/src/terminal-list-facts.js +179 -0
- package/dist/src/terminal-list-facts.js.map +1 -0
- package/dist/src/terminal-list-inventory.d.ts +59 -0
- package/dist/src/terminal-list-inventory.js +194 -0
- package/dist/src/terminal-list-inventory.js.map +1 -0
- package/dist/src/terminal-list-ownership-service.d.ts +118 -0
- package/dist/src/terminal-list-ownership-service.js +1003 -0
- package/dist/src/terminal-list-ownership-service.js.map +1 -0
- package/dist/src/terminal-list-projection-service.d.ts +49 -0
- package/dist/src/terminal-list-projection-service.js +407 -0
- package/dist/src/terminal-list-projection-service.js.map +1 -0
- package/dist/src/terminal-list-renderer.d.ts +11 -11
- package/dist/src/terminal-list-renderer.js +168 -119
- package/dist/src/terminal-list-renderer.js.map +1 -1
- package/dist/src/terminal-managed-send-cli-adapter.d.ts +33 -0
- package/dist/src/terminal-managed-send-cli-adapter.js +994 -0
- package/dist/src/terminal-managed-send-cli-adapter.js.map +1 -0
- package/dist/src/terminal-managed-turn-list-action-policy.d.ts +47 -0
- package/dist/src/terminal-managed-turn-list-action-policy.js +64 -0
- package/dist/src/terminal-managed-turn-list-action-policy.js.map +1 -0
- package/dist/src/terminal-model-control-action-policy.d.ts +60 -0
- package/dist/src/terminal-model-control-action-policy.js +96 -0
- package/dist/src/terminal-model-control-action-policy.js.map +1 -0
- package/dist/src/terminal-model-control-availability.d.ts +68 -0
- package/dist/src/terminal-model-control-availability.js +157 -0
- package/dist/src/terminal-model-control-availability.js.map +1 -0
- package/dist/src/terminal-model-control-bridge.d.ts +48 -0
- package/dist/src/terminal-model-control-bridge.js +259 -0
- package/dist/src/terminal-model-control-bridge.js.map +1 -0
- package/dist/src/terminal-model-control-profile.d.ts +55 -0
- package/dist/src/terminal-model-control-profile.js +137 -0
- package/dist/src/terminal-model-control-profile.js.map +1 -0
- package/dist/src/terminal-model-control-subject.d.ts +34 -0
- package/dist/src/terminal-model-control-subject.js +58 -0
- package/dist/src/terminal-model-control-subject.js.map +1 -0
- package/dist/src/terminal-model-control-transaction.d.ts +19 -0
- package/dist/src/terminal-model-control-transaction.js +39 -0
- package/dist/src/terminal-model-control-transaction.js.map +1 -0
- package/dist/src/terminal-model-control.d.ts +37 -18
- package/dist/src/terminal-model-control.js +285 -194
- package/dist/src/terminal-model-control.js.map +1 -1
- package/dist/src/terminal-monitor-application-service.js +50 -17
- package/dist/src/terminal-monitor-application-service.js.map +1 -1
- package/dist/src/terminal-native-inspection-bridge.d.ts +211 -0
- package/dist/src/terminal-native-inspection-bridge.js +1127 -0
- package/dist/src/terminal-native-inspection-bridge.js.map +1 -0
- package/dist/src/terminal-runtime-cli-adapter.d.ts +2 -2
- package/dist/src/terminal-runtime-cli-adapter.js.map +1 -1
- package/dist/src/terminal-submission-retry-application.d.ts +24 -0
- package/dist/src/terminal-submission-retry-application.js +402 -0
- package/dist/src/terminal-submission-retry-application.js.map +1 -0
- package/dist/src/terminal-submission-retry-ports.d.ts +30 -0
- package/dist/src/terminal-submission-retry-ports.js +2 -0
- package/dist/src/terminal-submission-retry-ports.js.map +1 -0
- package/dist/src/terminal-submission-retry-reconciliation.d.ts +236 -0
- package/dist/src/terminal-submission-retry-reconciliation.js +1130 -0
- package/dist/src/terminal-submission-retry-reconciliation.js.map +1 -0
- package/dist/src/terminal-submission-retry-transport.d.ts +58 -0
- package/dist/src/terminal-submission-retry-transport.js +675 -0
- package/dist/src/terminal-submission-retry-transport.js.map +1 -0
- package/dist/src/terminal-text-submission-bridge.d.ts +200 -0
- package/dist/src/terminal-text-submission-bridge.js +632 -0
- package/dist/src/terminal-text-submission-bridge.js.map +1 -0
- package/dist/src/terminal-user-explicit-send-policy.d.ts +29 -0
- package/dist/src/terminal-user-explicit-send-policy.js +46 -0
- package/dist/src/terminal-user-explicit-send-policy.js.map +1 -0
- package/dist/src/terminal-watch-cli-adapter.js +91 -143
- package/dist/src/terminal-watch-cli-adapter.js.map +1 -1
- package/dist/src/terminal-watch-codec.d.ts +9 -0
- package/dist/src/terminal-watch-codec.js +1051 -0
- package/dist/src/terminal-watch-codec.js.map +1 -0
- package/dist/src/terminal-watch-interaction-response-store.d.ts +19 -0
- package/dist/src/terminal-watch-interaction-response-store.js +87 -0
- package/dist/src/terminal-watch-interaction-response-store.js.map +1 -0
- package/dist/src/terminal-watch-record.d.ts +319 -0
- package/dist/src/terminal-watch-record.js +742 -0
- package/dist/src/terminal-watch-record.js.map +1 -0
- package/dist/src/terminal-watch-service.js +48 -27
- package/dist/src/terminal-watch-service.js.map +1 -1
- package/dist/src/terminal-watch-store.d.ts +3 -279
- package/dist/src/terminal-watch-store.js +5 -1779
- package/dist/src/terminal-watch-store.js.map +1 -1
- package/package.json +7 -2
- package/templates/openclaw-skills/agent-knock-knock/SKILL.md +1 -1
|
@@ -1,95 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export const
|
|
6
|
-
const MANAGED_MONITOR_PHASE = "managed_turn_monitors";
|
|
7
|
-
const TERMINAL_WATCH_PHASE = "terminal_watches";
|
|
8
|
-
const scheduleUnref = (callback, delayMs) => {
|
|
9
|
-
const timer = setTimeout(callback, delayMs);
|
|
10
|
-
timer.unref?.();
|
|
11
|
-
return () => clearTimeout(timer);
|
|
12
|
-
};
|
|
13
|
-
export function createMonitorReconciliationService(api, configuredIntervalMs) {
|
|
14
|
-
const reconciliationArgs = (reason) => {
|
|
15
|
-
const config = isRecord(api.pluginConfig) ? api.pluginConfig : {};
|
|
16
|
-
const args = ["reconcile-monitors", "--reason", reason];
|
|
17
|
-
if (reason === "monitor_supervision") {
|
|
18
|
-
args.push("--terminal-monitors-only");
|
|
19
|
-
}
|
|
20
|
-
pushOptional(args, "--store-dir", resolvePluginStoreDir(config));
|
|
21
|
-
return args;
|
|
22
|
-
};
|
|
23
|
-
const watchReconciliationArgs = () => {
|
|
24
|
-
const config = isRecord(api.pluginConfig) ? api.pluginConfig : {};
|
|
25
|
-
const args = ["reconcile-watches"];
|
|
26
|
-
pushOptional(args, "--store-dir", resolvePluginStoreDir(config));
|
|
27
|
-
return args;
|
|
28
|
-
};
|
|
29
|
-
const report = (result, reason) => {
|
|
30
|
-
if (reason === "startup_reconciliation" ||
|
|
31
|
-
Number(result.launched ?? 0) > 0 ||
|
|
32
|
-
Number(result.errors ?? 0) > 0) {
|
|
33
|
-
const label = reason === "startup_reconciliation"
|
|
34
|
-
? "monitor reconciliation"
|
|
35
|
-
: `monitor ${reason}`;
|
|
36
|
-
api.logger.info?.(`agent-knock-knock ${label}: ` +
|
|
37
|
-
`checked=${result.checked ?? 0} launched=${result.launched ?? 0} ` +
|
|
38
|
-
`already_running=${result.already_running ?? 0} skipped=${result.skipped ?? 0} ` +
|
|
39
|
-
`errors=${result.errors ?? 0}`);
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
const reportWatches = (result, reason) => {
|
|
43
|
-
if (reason === "startup_reconciliation" ||
|
|
44
|
-
Number(result.changed ?? 0) > 0 ||
|
|
45
|
-
Number(result.callbacks_delivered ?? 0) > 0 ||
|
|
46
|
-
Number(result.errors ?? 0) > 0) {
|
|
47
|
-
api.logger.info?.(`agent-knock-knock Terminal Watch ${reason}: ` +
|
|
48
|
-
`checked=${result.checked ?? 0} changed=${result.changed ?? 0} ` +
|
|
49
|
-
`callbacks_delivered=${result.callbacks_delivered ?? 0} ` +
|
|
50
|
-
`errors=${result.errors ?? 0}`);
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
const managedReason = (reason) => reason === "startup" ? "startup_reconciliation" : "monitor_supervision";
|
|
54
|
-
const watchReason = (reason) => reason === "startup" ? "startup_reconciliation" : "watch_supervision";
|
|
55
|
-
const onPhaseError = ({ phase, reason, error }) => {
|
|
56
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
57
|
-
if (phase === MANAGED_MONITOR_PHASE) {
|
|
58
|
-
api.logger.warn?.(reason === "startup"
|
|
59
|
-
? `agent-knock-knock monitor reconciliation skipped after startup error: ${message}`
|
|
60
|
-
: `agent-knock-knock monitor supervision deferred after error: ${message}`);
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
api.logger.warn?.(reason === "startup"
|
|
64
|
-
? `agent-knock-knock Terminal Watch reconciliation skipped after startup error: ${message}`
|
|
65
|
-
: `agent-knock-knock Terminal Watch supervision deferred after error: ${message}`);
|
|
66
|
-
};
|
|
67
|
-
const lifecycle = createHostLifecycleService({
|
|
68
|
-
intervalMs: configuredIntervalMs,
|
|
69
|
-
schedule: scheduleUnref,
|
|
70
|
-
onPhaseError,
|
|
71
|
-
phases: [
|
|
72
|
-
{
|
|
73
|
-
name: MANAGED_MONITOR_PHASE,
|
|
74
|
-
async run({ reason }) {
|
|
75
|
-
const reconciliationReason = managedReason(reason);
|
|
76
|
-
const result = await runCliAsync(api, reconciliationArgs(reconciliationReason));
|
|
77
|
-
report(result, reconciliationReason);
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
name: TERMINAL_WATCH_PHASE,
|
|
82
|
-
async run({ reason }) {
|
|
83
|
-
const reconciliationReason = watchReason(reason);
|
|
84
|
-
const result = await runCliAsync(api, watchReconciliationArgs());
|
|
85
|
-
reportWatches(result, reconciliationReason);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
]
|
|
89
|
-
});
|
|
90
|
-
return {
|
|
91
|
-
id: "agent-knock-knock-monitor-reconciliation",
|
|
92
|
-
...lifecycle
|
|
93
|
-
};
|
|
94
|
-
}
|
|
1
|
+
import { createHostMonitorReconciliationService, HOST_MONITOR_RECONCILIATION_INTERVAL_MS } from "./host-monitor-reconciliation.js";
|
|
2
|
+
/** OpenClaw adapter name retained as a compatibility boundary. */
|
|
3
|
+
export const MONITOR_SUPERVISOR_INTERVAL_MS = HOST_MONITOR_RECONCILIATION_INTERVAL_MS;
|
|
4
|
+
/** OpenClaw adapter for the shared Host lifecycle implementation. */
|
|
5
|
+
export const createMonitorReconciliationService = createHostMonitorReconciliationService;
|
|
95
6
|
//# sourceMappingURL=openclaw-plugin-supervisor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openclaw-plugin-supervisor.js","sourceRoot":"","sources":["../../src/openclaw-plugin-supervisor.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"openclaw-plugin-supervisor.js","sourceRoot":"","sources":["../../src/openclaw-plugin-supervisor.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sCAAsC,EACtC,uCAAuC,EACxC,MAAM,kCAAkC,CAAC;AAE1C,kEAAkE;AAClE,MAAM,CAAC,MAAM,8BAA8B,GACzC,uCAAuC,CAAC;AAE1C,qEAAqE;AACrE,MAAM,CAAC,MAAM,kCAAkC,GAC7C,sCAAsC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openclaw-plugin-value-helpers.js","sourceRoot":"","sources":["../../src/openclaw-plugin-value-helpers.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,cAAc,kCAAkC,CAAC"}
|
|
@@ -1,41 +1,6 @@
|
|
|
1
|
-
export declare const OPENCLAW_PRIVATE_AUTHORITY_OFFER_TTL_MS: number;
|
|
2
|
-
export declare const OPENCLAW_PRIVATE_AUTHORITY_OFFER_LIMIT = 512;
|
|
3
|
-
export declare const OPENCLAW_APPROVAL_AUTHORITY_KIND = "approval";
|
|
4
|
-
export declare const OPENCLAW_INTERACTION_AUTHORITY_KIND = "interaction";
|
|
5
|
-
export declare const OPENCLAW_INTERACTION_AUTHORITY_SUBJECT_KINDS: readonly ["managed_turn", "terminal_watch"];
|
|
6
|
-
export type OpenClawInteractionAuthoritySubjectKind = typeof OPENCLAW_INTERACTION_AUTHORITY_SUBJECT_KINDS[number];
|
|
7
|
-
export interface OpenClawPrivateAuthorityTarget {
|
|
8
|
-
type: string;
|
|
9
|
-
id: string;
|
|
10
|
-
}
|
|
11
|
-
export interface OpenClawPrivateAuthorityOfferKey {
|
|
12
|
-
sessionKey: string;
|
|
13
|
-
sessionId: string;
|
|
14
|
-
kind: string;
|
|
15
|
-
target: OpenClawPrivateAuthorityTarget;
|
|
16
|
-
}
|
|
17
|
-
export interface OpenClawPrivateAuthorityOfferPayload extends Readonly<Record<string, unknown>> {
|
|
18
|
-
readonly args?: Readonly<Record<string, unknown>>;
|
|
19
|
-
readonly fingerprint?: string;
|
|
20
|
-
readonly invalidated?: boolean;
|
|
21
|
-
}
|
|
22
|
-
export declare function openClawApprovalAuthorityOfferKey(sessionKey: string, sessionId: string, target: OpenClawPrivateAuthorityTarget): OpenClawPrivateAuthorityOfferKey;
|
|
23
1
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
2
|
+
* OpenClaw compatibility names for the Host-neutral private authority store.
|
|
3
|
+
* New core code must import semantic-private-authority-offers directly.
|
|
26
4
|
*/
|
|
27
|
-
export
|
|
28
|
-
export
|
|
29
|
-
export declare function openClawManagedTurnInteractionAuthorityOfferKey(sessionKey: string, sessionId: string, turnId: string, interactionId: string): OpenClawPrivateAuthorityOfferKey;
|
|
30
|
-
export declare function openClawTerminalWatchInteractionAuthorityOfferKey(sessionKey: string, sessionId: string, watchId: string, interactionId: string): OpenClawPrivateAuthorityOfferKey;
|
|
31
|
-
/**
|
|
32
|
-
* Invalidates every interaction response offer previously displayed for one
|
|
33
|
-
* exact subject in one exact controller conversation. Status uses this as a
|
|
34
|
-
* refresh boundary before it publishes at most one offer from the new
|
|
35
|
-
* snapshot, so an old interaction id cannot remain actionable for the rest of
|
|
36
|
-
* its TTL after the terminal UI disappears or changes.
|
|
37
|
-
*/
|
|
38
|
-
export declare function invalidateOpenClawInteractionAuthorityOffersForSubject(api: object, sessionKey: string, sessionId: string, subjectKind: OpenClawInteractionAuthoritySubjectKind, subjectId: string, nowMs?: number): number;
|
|
39
|
-
export declare function rememberOpenClawPrivateAuthorityOffer(api: object, key: OpenClawPrivateAuthorityOfferKey, payload: Record<string, unknown>, nowMs?: number): void;
|
|
40
|
-
export declare function peekOpenClawPrivateAuthorityOffer<Payload extends OpenClawPrivateAuthorityOfferPayload = OpenClawPrivateAuthorityOfferPayload>(api: object, key: OpenClawPrivateAuthorityOfferKey, nowMs?: number): Payload | undefined;
|
|
41
|
-
export declare function consumeOpenClawPrivateAuthorityOffer<Payload extends OpenClawPrivateAuthorityOfferPayload = OpenClawPrivateAuthorityOfferPayload>(api: object, key: OpenClawPrivateAuthorityOfferKey, nowMs?: number): Payload | undefined;
|
|
5
|
+
export { SEMANTIC_APPROVAL_AUTHORITY_KIND as OPENCLAW_APPROVAL_AUTHORITY_KIND, SEMANTIC_INTERACTION_AUTHORITY_KIND as OPENCLAW_INTERACTION_AUTHORITY_KIND, SEMANTIC_INTERACTION_AUTHORITY_SUBJECT_KINDS as OPENCLAW_INTERACTION_AUTHORITY_SUBJECT_KINDS, SEMANTIC_PRIVATE_AUTHORITY_OFFER_LIMIT as OPENCLAW_PRIVATE_AUTHORITY_OFFER_LIMIT, SEMANTIC_PRIVATE_AUTHORITY_OFFER_TTL_MS as OPENCLAW_PRIVATE_AUTHORITY_OFFER_TTL_MS, consumeSemanticPrivateAuthorityOffer as consumeOpenClawPrivateAuthorityOffer, invalidateSemanticInteractionAuthorityOffersForSubject as invalidateOpenClawInteractionAuthorityOffersForSubject, peekSemanticPrivateAuthorityOffer as peekOpenClawPrivateAuthorityOffer, rememberSemanticPrivateAuthorityOffer as rememberOpenClawPrivateAuthorityOffer, semanticApprovalAuthorityOfferKey as openClawApprovalAuthorityOfferKey, semanticInteractionAuthorityOfferKey as openClawInteractionAuthorityOfferKey, semanticManagedTurnInteractionAuthorityOfferKey as openClawManagedTurnInteractionAuthorityOfferKey, semanticTerminalWatchInteractionAuthorityOfferKey as openClawTerminalWatchInteractionAuthorityOfferKey } from "./semantic-private-authority-offers.js";
|
|
6
|
+
export type { SemanticInteractionAuthoritySubjectKind as OpenClawInteractionAuthoritySubjectKind, SemanticPrivateAuthorityOfferKey as OpenClawPrivateAuthorityOfferKey, SemanticPrivateAuthorityOfferPayload as OpenClawPrivateAuthorityOfferPayload, SemanticPrivateAuthorityTarget as OpenClawPrivateAuthorityTarget } from "./semantic-private-authority-offers.js";
|
|
@@ -1,261 +1,6 @@
|
|
|
1
|
-
export const OPENCLAW_PRIVATE_AUTHORITY_OFFER_TTL_MS = 10 * 60 * 1000;
|
|
2
|
-
export const OPENCLAW_PRIVATE_AUTHORITY_OFFER_LIMIT = 512;
|
|
3
|
-
export const OPENCLAW_APPROVAL_AUTHORITY_KIND = "approval";
|
|
4
|
-
export const OPENCLAW_INTERACTION_AUTHORITY_KIND = "interaction";
|
|
5
|
-
export const OPENCLAW_INTERACTION_AUTHORITY_SUBJECT_KINDS = [
|
|
6
|
-
"managed_turn",
|
|
7
|
-
"terminal_watch"
|
|
8
|
-
];
|
|
9
|
-
const storesByApi = new WeakMap();
|
|
10
|
-
export function openClawApprovalAuthorityOfferKey(sessionKey, sessionId, target) {
|
|
11
|
-
return {
|
|
12
|
-
sessionKey,
|
|
13
|
-
sessionId,
|
|
14
|
-
kind: OPENCLAW_APPROVAL_AUTHORITY_KIND,
|
|
15
|
-
target
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
export function openClawInteractionAuthorityOfferKey(sessionKey, sessionId, subjectKindOrTurnId, subjectIdOrInteractionId, explicitInteractionId) {
|
|
19
|
-
const legacyManagedTurn = explicitInteractionId === undefined;
|
|
20
|
-
const subjectKind = legacyManagedTurn
|
|
21
|
-
? "managed_turn"
|
|
22
|
-
: interactionAuthoritySubjectKind(subjectKindOrTurnId);
|
|
23
|
-
const subjectId = exactNonBlank(legacyManagedTurn ? subjectKindOrTurnId : subjectIdOrInteractionId, "interaction subject id");
|
|
24
|
-
const interactionId = exactNonBlank(legacyManagedTurn ? subjectIdOrInteractionId : explicitInteractionId, "interaction id");
|
|
25
|
-
return {
|
|
26
|
-
sessionKey,
|
|
27
|
-
sessionId,
|
|
28
|
-
kind: OPENCLAW_INTERACTION_AUTHORITY_KIND,
|
|
29
|
-
target: {
|
|
30
|
-
type: "interaction_subject",
|
|
31
|
-
id: JSON.stringify([subjectKind, subjectId, interactionId])
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
export function openClawManagedTurnInteractionAuthorityOfferKey(sessionKey, sessionId, turnId, interactionId) {
|
|
36
|
-
return openClawInteractionAuthorityOfferKey(sessionKey, sessionId, "managed_turn", turnId, interactionId);
|
|
37
|
-
}
|
|
38
|
-
export function openClawTerminalWatchInteractionAuthorityOfferKey(sessionKey, sessionId, watchId, interactionId) {
|
|
39
|
-
return openClawInteractionAuthorityOfferKey(sessionKey, sessionId, "terminal_watch", watchId, interactionId);
|
|
40
|
-
}
|
|
41
1
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* refresh boundary before it publishes at most one offer from the new
|
|
45
|
-
* snapshot, so an old interaction id cannot remain actionable for the rest of
|
|
46
|
-
* its TTL after the terminal UI disappears or changes.
|
|
2
|
+
* OpenClaw compatibility names for the Host-neutral private authority store.
|
|
3
|
+
* New core code must import semantic-private-authority-offers directly.
|
|
47
4
|
*/
|
|
48
|
-
export
|
|
49
|
-
const exactApi = assertApi(api);
|
|
50
|
-
const exactSessionKey = exactNonBlank(sessionKey, "sessionKey");
|
|
51
|
-
const exactSessionId = exactNonBlank(sessionId, "sessionId");
|
|
52
|
-
const exactSubjectKind = interactionAuthoritySubjectKind(subjectKind);
|
|
53
|
-
const exactSubjectId = exactNonBlank(subjectId, "interaction subject id");
|
|
54
|
-
assertNow(nowMs);
|
|
55
|
-
const store = storesByApi.get(exactApi);
|
|
56
|
-
if (!store)
|
|
57
|
-
return 0;
|
|
58
|
-
pruneExpiredOffers(store, nowMs);
|
|
59
|
-
let invalidated = 0;
|
|
60
|
-
for (const normalizedKey of store.entries.keys()) {
|
|
61
|
-
if (normalizedInteractionOfferMatchesSubject(normalizedKey, exactSessionKey, exactSessionId, exactSubjectKind, exactSubjectId)) {
|
|
62
|
-
store.entries.delete(normalizedKey);
|
|
63
|
-
invalidated += 1;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return invalidated;
|
|
67
|
-
}
|
|
68
|
-
export function rememberOpenClawPrivateAuthorityOffer(api, key, payload, nowMs = Date.now()) {
|
|
69
|
-
const normalizedKey = privateAuthorityOfferKey(key);
|
|
70
|
-
const store = privateAuthorityOfferStore(api);
|
|
71
|
-
assertNow(nowMs);
|
|
72
|
-
pruneExpiredOffers(store, nowMs);
|
|
73
|
-
const previous = store.entries.get(normalizedKey)?.payload;
|
|
74
|
-
const authorityChanged = privateAuthorityPayloadChanged(previous, payload);
|
|
75
|
-
const merged = mergePrivateAuthorityPayload(previous, payload);
|
|
76
|
-
const invalidated = authorityChanged || (previous?.invalidated === true);
|
|
77
|
-
const storedPayload = {
|
|
78
|
-
...merged,
|
|
79
|
-
...(invalidated ? { invalidated: true } : {})
|
|
80
|
-
};
|
|
81
|
-
if (!invalidated)
|
|
82
|
-
delete storedPayload.invalidated;
|
|
83
|
-
store.entries.delete(normalizedKey);
|
|
84
|
-
while (store.entries.size >= OPENCLAW_PRIVATE_AUTHORITY_OFFER_LIMIT) {
|
|
85
|
-
const oldest = store.entries.keys().next().value;
|
|
86
|
-
if (typeof oldest !== "string")
|
|
87
|
-
break;
|
|
88
|
-
store.entries.delete(oldest);
|
|
89
|
-
}
|
|
90
|
-
store.entries.set(normalizedKey, {
|
|
91
|
-
expiresAtMs: nowMs + OPENCLAW_PRIVATE_AUTHORITY_OFFER_TTL_MS,
|
|
92
|
-
payload: cloneAndFreezePayload(storedPayload)
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
export function peekOpenClawPrivateAuthorityOffer(api, key, nowMs = Date.now()) {
|
|
96
|
-
return readPrivateAuthorityOffer(api, key, false, nowMs);
|
|
97
|
-
}
|
|
98
|
-
export function consumeOpenClawPrivateAuthorityOffer(api, key, nowMs = Date.now()) {
|
|
99
|
-
return readPrivateAuthorityOffer(api, key, true, nowMs);
|
|
100
|
-
}
|
|
101
|
-
function readPrivateAuthorityOffer(api, key, consume, nowMs) {
|
|
102
|
-
assertNow(nowMs);
|
|
103
|
-
const store = storesByApi.get(assertApi(api));
|
|
104
|
-
if (!store)
|
|
105
|
-
return undefined;
|
|
106
|
-
const normalizedKey = privateAuthorityOfferKey(key);
|
|
107
|
-
const offer = store.entries.get(normalizedKey);
|
|
108
|
-
if (!offer) {
|
|
109
|
-
pruneExpiredOffers(store, nowMs);
|
|
110
|
-
return undefined;
|
|
111
|
-
}
|
|
112
|
-
if (offer.expiresAtMs <= nowMs) {
|
|
113
|
-
store.entries.delete(normalizedKey);
|
|
114
|
-
pruneExpiredOffers(store, nowMs);
|
|
115
|
-
return undefined;
|
|
116
|
-
}
|
|
117
|
-
if (offer.payload.invalidated === true) {
|
|
118
|
-
if (consume)
|
|
119
|
-
store.entries.delete(normalizedKey);
|
|
120
|
-
return undefined;
|
|
121
|
-
}
|
|
122
|
-
if (consume)
|
|
123
|
-
store.entries.delete(normalizedKey);
|
|
124
|
-
return offer.payload;
|
|
125
|
-
}
|
|
126
|
-
function privateAuthorityOfferStore(api) {
|
|
127
|
-
const exactApi = assertApi(api);
|
|
128
|
-
const existing = storesByApi.get(exactApi);
|
|
129
|
-
if (existing)
|
|
130
|
-
return existing;
|
|
131
|
-
const created = { entries: new Map() };
|
|
132
|
-
storesByApi.set(exactApi, created);
|
|
133
|
-
return created;
|
|
134
|
-
}
|
|
135
|
-
function privateAuthorityOfferKey(key) {
|
|
136
|
-
const sessionKey = exactNonBlank(key?.sessionKey, "sessionKey");
|
|
137
|
-
const sessionId = exactNonBlank(key?.sessionId, "sessionId");
|
|
138
|
-
const kind = exactIdentifier(key?.kind, "kind");
|
|
139
|
-
const targetType = exactIdentifier(key?.target?.type, "target.type");
|
|
140
|
-
const targetId = exactNonBlank(key?.target?.id, "target.id");
|
|
141
|
-
return JSON.stringify([sessionKey, sessionId, kind, targetType, targetId]);
|
|
142
|
-
}
|
|
143
|
-
function normalizedInteractionOfferMatchesSubject(normalizedKey, sessionKey, sessionId, subjectKind, subjectId) {
|
|
144
|
-
try {
|
|
145
|
-
const key = JSON.parse(normalizedKey);
|
|
146
|
-
if (!Array.isArray(key) ||
|
|
147
|
-
key.length !== 5 ||
|
|
148
|
-
key[0] !== sessionKey ||
|
|
149
|
-
key[1] !== sessionId ||
|
|
150
|
-
key[2] !== OPENCLAW_INTERACTION_AUTHORITY_KIND ||
|
|
151
|
-
key[3] !== "interaction_subject" ||
|
|
152
|
-
typeof key[4] !== "string") {
|
|
153
|
-
return false;
|
|
154
|
-
}
|
|
155
|
-
const target = JSON.parse(key[4]);
|
|
156
|
-
return Array.isArray(target) &&
|
|
157
|
-
target.length === 3 &&
|
|
158
|
-
target[0] === subjectKind &&
|
|
159
|
-
target[1] === subjectId &&
|
|
160
|
-
typeof target[2] === "string";
|
|
161
|
-
}
|
|
162
|
-
catch {
|
|
163
|
-
return false;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
function exactIdentifier(value, label) {
|
|
167
|
-
const text = exactNonBlank(value, label);
|
|
168
|
-
if (!/^[a-z][a-z0-9_.-]{0,63}$/u.test(text)) {
|
|
169
|
-
throw new Error(`private authority offer ${label} is invalid`);
|
|
170
|
-
}
|
|
171
|
-
return text;
|
|
172
|
-
}
|
|
173
|
-
function interactionAuthoritySubjectKind(value) {
|
|
174
|
-
if (!OPENCLAW_INTERACTION_AUTHORITY_SUBJECT_KINDS.includes(value)) {
|
|
175
|
-
throw new Error("private authority offer interaction subject kind is invalid");
|
|
176
|
-
}
|
|
177
|
-
return value;
|
|
178
|
-
}
|
|
179
|
-
function exactNonBlank(value, label) {
|
|
180
|
-
if (typeof value !== "string" ||
|
|
181
|
-
value.length === 0 ||
|
|
182
|
-
value.trim() !== value) {
|
|
183
|
-
throw new Error(`private authority offer ${label} must be exact and non-empty`);
|
|
184
|
-
}
|
|
185
|
-
return value;
|
|
186
|
-
}
|
|
187
|
-
function assertApi(api) {
|
|
188
|
-
if ((typeof api !== "object" || api === null) && typeof api !== "function") {
|
|
189
|
-
throw new Error("private authority offer api must be an object");
|
|
190
|
-
}
|
|
191
|
-
return api;
|
|
192
|
-
}
|
|
193
|
-
function assertNow(nowMs) {
|
|
194
|
-
if (!Number.isFinite(nowMs)) {
|
|
195
|
-
throw new Error("private authority offer clock must be finite");
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
function pruneExpiredOffers(store, nowMs) {
|
|
199
|
-
for (const [key, offer] of store.entries) {
|
|
200
|
-
if (offer.expiresAtMs <= nowMs)
|
|
201
|
-
store.entries.delete(key);
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
function cloneAndFreezePayload(payload) {
|
|
205
|
-
if (typeof payload !== "object" || payload === null || Array.isArray(payload)) {
|
|
206
|
-
throw new Error("private authority offer payload must be an object");
|
|
207
|
-
}
|
|
208
|
-
let cloned;
|
|
209
|
-
try {
|
|
210
|
-
cloned = structuredClone(payload);
|
|
211
|
-
}
|
|
212
|
-
catch {
|
|
213
|
-
throw new Error("private authority offer payload must be structured-cloneable");
|
|
214
|
-
}
|
|
215
|
-
return deepFreeze(cloned, new WeakSet());
|
|
216
|
-
}
|
|
217
|
-
function mergePrivateAuthorityPayload(previous, update) {
|
|
218
|
-
const definedUpdate = Object.fromEntries(Object.entries(update).filter(([, value]) => value !== undefined));
|
|
219
|
-
const previousArgs = isPlainRecord(previous?.args) ? previous.args : {};
|
|
220
|
-
const updateArgs = isPlainRecord(definedUpdate.args)
|
|
221
|
-
? definedUpdate.args
|
|
222
|
-
: undefined;
|
|
223
|
-
return {
|
|
224
|
-
...(previous ?? {}),
|
|
225
|
-
...definedUpdate,
|
|
226
|
-
...(updateArgs
|
|
227
|
-
? { args: { ...previousArgs, ...updateArgs } }
|
|
228
|
-
: Object.keys(previousArgs).length > 0
|
|
229
|
-
? { args: previousArgs }
|
|
230
|
-
: {})
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
function privateAuthorityPayloadChanged(previous, update) {
|
|
234
|
-
if (!previous)
|
|
235
|
-
return false;
|
|
236
|
-
const nextFingerprint = update.fingerprint;
|
|
237
|
-
if (nextFingerprint !== undefined &&
|
|
238
|
-
previous.fingerprint !== undefined &&
|
|
239
|
-
nextFingerprint !== previous.fingerprint) {
|
|
240
|
-
return true;
|
|
241
|
-
}
|
|
242
|
-
const previousArgs = isPlainRecord(previous.args) ? previous.args : {};
|
|
243
|
-
const updateArgs = isPlainRecord(update.args) ? update.args : undefined;
|
|
244
|
-
if (!updateArgs)
|
|
245
|
-
return false;
|
|
246
|
-
return Object.keys(previousArgs).length > 0 &&
|
|
247
|
-
JSON.stringify(previousArgs) !== JSON.stringify(updateArgs);
|
|
248
|
-
}
|
|
249
|
-
function isPlainRecord(value) {
|
|
250
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
251
|
-
}
|
|
252
|
-
function deepFreeze(value, seen) {
|
|
253
|
-
if (typeof value !== "object" || value === null || seen.has(value)) {
|
|
254
|
-
return value;
|
|
255
|
-
}
|
|
256
|
-
seen.add(value);
|
|
257
|
-
for (const nested of Object.values(value))
|
|
258
|
-
deepFreeze(nested, seen);
|
|
259
|
-
return Object.freeze(value);
|
|
260
|
-
}
|
|
5
|
+
export { SEMANTIC_APPROVAL_AUTHORITY_KIND as OPENCLAW_APPROVAL_AUTHORITY_KIND, SEMANTIC_INTERACTION_AUTHORITY_KIND as OPENCLAW_INTERACTION_AUTHORITY_KIND, SEMANTIC_INTERACTION_AUTHORITY_SUBJECT_KINDS as OPENCLAW_INTERACTION_AUTHORITY_SUBJECT_KINDS, SEMANTIC_PRIVATE_AUTHORITY_OFFER_LIMIT as OPENCLAW_PRIVATE_AUTHORITY_OFFER_LIMIT, SEMANTIC_PRIVATE_AUTHORITY_OFFER_TTL_MS as OPENCLAW_PRIVATE_AUTHORITY_OFFER_TTL_MS, consumeSemanticPrivateAuthorityOffer as consumeOpenClawPrivateAuthorityOffer, invalidateSemanticInteractionAuthorityOffersForSubject as invalidateOpenClawInteractionAuthorityOffersForSubject, peekSemanticPrivateAuthorityOffer as peekOpenClawPrivateAuthorityOffer, rememberSemanticPrivateAuthorityOffer as rememberOpenClawPrivateAuthorityOffer, semanticApprovalAuthorityOfferKey as openClawApprovalAuthorityOfferKey, semanticInteractionAuthorityOfferKey as openClawInteractionAuthorityOfferKey, semanticManagedTurnInteractionAuthorityOfferKey as openClawManagedTurnInteractionAuthorityOfferKey, semanticTerminalWatchInteractionAuthorityOfferKey as openClawTerminalWatchInteractionAuthorityOfferKey } from "./semantic-private-authority-offers.js";
|
|
261
6
|
//# sourceMappingURL=openclaw-private-authority-offers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openclaw-private-authority-offers.js","sourceRoot":"","sources":["../../src/openclaw-private-authority-offers.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"openclaw-private-authority-offers.js","sourceRoot":"","sources":["../../src/openclaw-private-authority-offers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,gCAAgC,IAAI,gCAAgC,EACpE,mCAAmC,IAAI,mCAAmC,EAC1E,4CAA4C,IAAI,4CAA4C,EAC5F,sCAAsC,IAAI,sCAAsC,EAChF,uCAAuC,IAAI,uCAAuC,EAClF,oCAAoC,IAAI,oCAAoC,EAC5E,sDAAsD,IAAI,sDAAsD,EAChH,iCAAiC,IAAI,iCAAiC,EACtE,qCAAqC,IAAI,qCAAqC,EAC9E,iCAAiC,IAAI,iCAAiC,EACtE,oCAAoC,IAAI,oCAAoC,EAC5E,+CAA+C,IAAI,+CAA+C,EAClG,iDAAiD,IAAI,iDAAiD,EACvG,MAAM,wCAAwC,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export declare const SEMANTIC_PRIVATE_AUTHORITY_OFFER_TTL_MS: number;
|
|
2
|
+
export declare const SEMANTIC_PRIVATE_AUTHORITY_OFFER_LIMIT = 512;
|
|
3
|
+
export declare const SEMANTIC_APPROVAL_AUTHORITY_KIND = "approval";
|
|
4
|
+
export declare const SEMANTIC_INTERACTION_AUTHORITY_KIND = "interaction";
|
|
5
|
+
export declare const SEMANTIC_INTERACTION_AUTHORITY_SUBJECT_KINDS: readonly ["managed_turn", "terminal_watch"];
|
|
6
|
+
export type SemanticInteractionAuthoritySubjectKind = typeof SEMANTIC_INTERACTION_AUTHORITY_SUBJECT_KINDS[number];
|
|
7
|
+
export interface SemanticPrivateAuthorityTarget {
|
|
8
|
+
type: string;
|
|
9
|
+
id: string;
|
|
10
|
+
}
|
|
11
|
+
export interface SemanticPrivateAuthorityOfferKey {
|
|
12
|
+
sessionKey: string;
|
|
13
|
+
sessionId: string;
|
|
14
|
+
kind: string;
|
|
15
|
+
target: SemanticPrivateAuthorityTarget;
|
|
16
|
+
}
|
|
17
|
+
export interface SemanticPrivateAuthorityOfferPayload extends Readonly<Record<string, unknown>> {
|
|
18
|
+
readonly args?: Readonly<Record<string, unknown>>;
|
|
19
|
+
readonly fingerprint?: string;
|
|
20
|
+
readonly invalidated?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare function semanticApprovalAuthorityOfferKey(sessionKey: string, sessionId: string, target: SemanticPrivateAuthorityTarget): SemanticPrivateAuthorityOfferKey;
|
|
23
|
+
/**
|
|
24
|
+
* Legacy managed-Turn overload retained while callers migrate to the explicit
|
|
25
|
+
* subject-aware form below.
|
|
26
|
+
*/
|
|
27
|
+
export declare function semanticInteractionAuthorityOfferKey(sessionKey: string, sessionId: string, turnId: string, interactionId: string): SemanticPrivateAuthorityOfferKey;
|
|
28
|
+
export declare function semanticInteractionAuthorityOfferKey(sessionKey: string, sessionId: string, subjectKind: SemanticInteractionAuthoritySubjectKind, subjectId: string, interactionId: string): SemanticPrivateAuthorityOfferKey;
|
|
29
|
+
export declare function semanticManagedTurnInteractionAuthorityOfferKey(sessionKey: string, sessionId: string, turnId: string, interactionId: string): SemanticPrivateAuthorityOfferKey;
|
|
30
|
+
export declare function semanticTerminalWatchInteractionAuthorityOfferKey(sessionKey: string, sessionId: string, watchId: string, interactionId: string): SemanticPrivateAuthorityOfferKey;
|
|
31
|
+
/**
|
|
32
|
+
* Invalidates every interaction response offer previously displayed for one
|
|
33
|
+
* exact subject in one exact controller conversation. Status uses this as a
|
|
34
|
+
* refresh boundary before it publishes at most one offer from the new
|
|
35
|
+
* snapshot, so an old interaction id cannot remain actionable for the rest of
|
|
36
|
+
* its TTL after the terminal UI disappears or changes.
|
|
37
|
+
*/
|
|
38
|
+
export declare function invalidateSemanticInteractionAuthorityOffersForSubject(api: object, sessionKey: string, sessionId: string, subjectKind: SemanticInteractionAuthoritySubjectKind, subjectId: string, nowMs?: number): number;
|
|
39
|
+
export declare function rememberSemanticPrivateAuthorityOffer(api: object, key: SemanticPrivateAuthorityOfferKey, payload: Record<string, unknown>, nowMs?: number): void;
|
|
40
|
+
export declare function peekSemanticPrivateAuthorityOffer<Payload extends SemanticPrivateAuthorityOfferPayload = SemanticPrivateAuthorityOfferPayload>(api: object, key: SemanticPrivateAuthorityOfferKey, nowMs?: number): Payload | undefined;
|
|
41
|
+
export declare function consumeSemanticPrivateAuthorityOffer<Payload extends SemanticPrivateAuthorityOfferPayload = SemanticPrivateAuthorityOfferPayload>(api: object, key: SemanticPrivateAuthorityOfferKey, nowMs?: number): Payload | undefined;
|