@sentropic/h2a-cli 0.75.0 → 0.78.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/dist/index.d.ts +1 -37
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -41
- package/dist/index.js.map +1 -1
- package/package.json +4 -15
- package/dist/bin.d.ts +0 -3
- package/dist/bin.d.ts.map +0 -1
- package/dist/bin.js +0 -83
- package/dist/bin.js.map +0 -1
- package/dist/cli-contract.d.ts +0 -62
- package/dist/cli-contract.d.ts.map +0 -1
- package/dist/cli-contract.js +0 -794
- package/dist/cli-contract.js.map +0 -1
- package/dist/cli.d.ts +0 -254
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -4672
- package/dist/cli.js.map +0 -1
- package/dist/hosts/agy.d.ts +0 -14
- package/dist/hosts/agy.d.ts.map +0 -1
- package/dist/hosts/agy.js +0 -47
- package/dist/hosts/agy.js.map +0 -1
- package/dist/hosts/claude.d.ts +0 -12
- package/dist/hosts/claude.d.ts.map +0 -1
- package/dist/hosts/claude.js +0 -46
- package/dist/hosts/claude.js.map +0 -1
- package/dist/hosts/codex.d.ts +0 -65
- package/dist/hosts/codex.d.ts.map +0 -1
- package/dist/hosts/codex.js +0 -45
- package/dist/hosts/codex.js.map +0 -1
- package/dist/hosts/gemini.d.ts +0 -12
- package/dist/hosts/gemini.d.ts.map +0 -1
- package/dist/hosts/gemini.js +0 -46
- package/dist/hosts/gemini.js.map +0 -1
- package/dist/hosts/plugin.d.ts +0 -151
- package/dist/hosts/plugin.d.ts.map +0 -1
- package/dist/hosts/plugin.js +0 -188
- package/dist/hosts/plugin.js.map +0 -1
- package/dist/mcp.d.ts +0 -2
- package/dist/mcp.d.ts.map +0 -1
- package/dist/mcp.js +0 -32
- package/dist/mcp.js.map +0 -1
- package/dist/runtime/blockage/index.d.ts +0 -3
- package/dist/runtime/blockage/index.d.ts.map +0 -1
- package/dist/runtime/blockage/index.js +0 -3
- package/dist/runtime/blockage/index.js.map +0 -1
- package/dist/runtime/blockage/notifiers.d.ts +0 -52
- package/dist/runtime/blockage/notifiers.d.ts.map +0 -1
- package/dist/runtime/blockage/notifiers.js +0 -74
- package/dist/runtime/blockage/notifiers.js.map +0 -1
- package/dist/runtime/blockage/registry.d.ts +0 -30
- package/dist/runtime/blockage/registry.d.ts.map +0 -1
- package/dist/runtime/blockage/registry.js +0 -86
- package/dist/runtime/blockage/registry.js.map +0 -1
- package/dist/runtime/deploy/k8s-sidecar.d.ts +0 -92
- package/dist/runtime/deploy/k8s-sidecar.d.ts.map +0 -1
- package/dist/runtime/deploy/k8s-sidecar.js +0 -166
- package/dist/runtime/deploy/k8s-sidecar.js.map +0 -1
- package/dist/runtime/deploy/k8s-tenant.d.ts +0 -86
- package/dist/runtime/deploy/k8s-tenant.d.ts.map +0 -1
- package/dist/runtime/deploy/k8s-tenant.js +0 -255
- package/dist/runtime/deploy/k8s-tenant.js.map +0 -1
- package/dist/runtime/drive/inbox-wake.d.ts +0 -36
- package/dist/runtime/drive/inbox-wake.d.ts.map +0 -1
- package/dist/runtime/drive/inbox-wake.js +0 -50
- package/dist/runtime/drive/inbox-wake.js.map +0 -1
- package/dist/runtime/drive/index.d.ts +0 -173
- package/dist/runtime/drive/index.d.ts.map +0 -1
- package/dist/runtime/drive/index.js +0 -503
- package/dist/runtime/drive/index.js.map +0 -1
- package/dist/runtime/drumbeat/deciders.d.ts +0 -32
- package/dist/runtime/drumbeat/deciders.d.ts.map +0 -1
- package/dist/runtime/drumbeat/deciders.js +0 -65
- package/dist/runtime/drumbeat/deciders.js.map +0 -1
- package/dist/runtime/drumbeat/decisions.d.ts +0 -19
- package/dist/runtime/drumbeat/decisions.d.ts.map +0 -1
- package/dist/runtime/drumbeat/decisions.js +0 -34
- package/dist/runtime/drumbeat/decisions.js.map +0 -1
- package/dist/runtime/drumbeat/inbox-relance.d.ts +0 -29
- package/dist/runtime/drumbeat/inbox-relance.d.ts.map +0 -1
- package/dist/runtime/drumbeat/inbox-relance.js +0 -101
- package/dist/runtime/drumbeat/inbox-relance.js.map +0 -1
- package/dist/runtime/drumbeat/index.d.ts +0 -8
- package/dist/runtime/drumbeat/index.d.ts.map +0 -1
- package/dist/runtime/drumbeat/index.js +0 -8
- package/dist/runtime/drumbeat/index.js.map +0 -1
- package/dist/runtime/drumbeat/registry.d.ts +0 -60
- package/dist/runtime/drumbeat/registry.d.ts.map +0 -1
- package/dist/runtime/drumbeat/registry.js +0 -115
- package/dist/runtime/drumbeat/registry.js.map +0 -1
- package/dist/runtime/drumbeat/relaunchers.d.ts +0 -111
- package/dist/runtime/drumbeat/relaunchers.d.ts.map +0 -1
- package/dist/runtime/drumbeat/relaunchers.js +0 -260
- package/dist/runtime/drumbeat/relaunchers.js.map +0 -1
- package/dist/runtime/drumbeat/scan.d.ts +0 -36
- package/dist/runtime/drumbeat/scan.d.ts.map +0 -1
- package/dist/runtime/drumbeat/scan.js +0 -41
- package/dist/runtime/drumbeat/scan.js.map +0 -1
- package/dist/runtime/drumbeat/watch.d.ts +0 -74
- package/dist/runtime/drumbeat/watch.d.ts.map +0 -1
- package/dist/runtime/drumbeat/watch.js +0 -216
- package/dist/runtime/drumbeat/watch.js.map +0 -1
- package/dist/runtime/escalation/index.d.ts +0 -2
- package/dist/runtime/escalation/index.d.ts.map +0 -1
- package/dist/runtime/escalation/index.js +0 -2
- package/dist/runtime/escalation/index.js.map +0 -1
- package/dist/runtime/escalation/registry.d.ts +0 -44
- package/dist/runtime/escalation/registry.d.ts.map +0 -1
- package/dist/runtime/escalation/registry.js +0 -79
- package/dist/runtime/escalation/registry.js.map +0 -1
- package/dist/runtime/governance/claims.d.ts +0 -43
- package/dist/runtime/governance/claims.d.ts.map +0 -1
- package/dist/runtime/governance/claims.js +0 -93
- package/dist/runtime/governance/claims.js.map +0 -1
- package/dist/runtime/governance/conductor.d.ts +0 -79
- package/dist/runtime/governance/conductor.d.ts.map +0 -1
- package/dist/runtime/governance/conductor.js +0 -106
- package/dist/runtime/governance/conductor.js.map +0 -1
- package/dist/runtime/governance/index.d.ts +0 -5
- package/dist/runtime/governance/index.d.ts.map +0 -1
- package/dist/runtime/governance/index.js +0 -5
- package/dist/runtime/governance/index.js.map +0 -1
- package/dist/runtime/governance/launch-check.d.ts +0 -93
- package/dist/runtime/governance/launch-check.d.ts.map +0 -1
- package/dist/runtime/governance/launch-check.js +0 -113
- package/dist/runtime/governance/launch-check.js.map +0 -1
- package/dist/runtime/governance/spawns.d.ts +0 -50
- package/dist/runtime/governance/spawns.d.ts.map +0 -1
- package/dist/runtime/governance/spawns.js +0 -91
- package/dist/runtime/governance/spawns.js.map +0 -1
- package/dist/runtime/identity/bindings.d.ts +0 -84
- package/dist/runtime/identity/bindings.d.ts.map +0 -1
- package/dist/runtime/identity/bindings.js +0 -112
- package/dist/runtime/identity/bindings.js.map +0 -1
- package/dist/runtime/identity/index.d.ts +0 -11
- package/dist/runtime/identity/index.d.ts.map +0 -1
- package/dist/runtime/identity/index.js +0 -6
- package/dist/runtime/identity/index.js.map +0 -1
- package/dist/runtime/identity/live.d.ts +0 -26
- package/dist/runtime/identity/live.d.ts.map +0 -1
- package/dist/runtime/identity/live.js +0 -232
- package/dist/runtime/identity/live.js.map +0 -1
- package/dist/runtime/identity/migration.d.ts +0 -55
- package/dist/runtime/identity/migration.d.ts.map +0 -1
- package/dist/runtime/identity/migration.js +0 -100
- package/dist/runtime/identity/migration.js.map +0 -1
- package/dist/runtime/identity/readers.d.ts +0 -42
- package/dist/runtime/identity/readers.d.ts.map +0 -1
- package/dist/runtime/identity/readers.js +0 -248
- package/dist/runtime/identity/readers.js.map +0 -1
- package/dist/runtime/identity/resolver.d.ts +0 -50
- package/dist/runtime/identity/resolver.d.ts.map +0 -1
- package/dist/runtime/identity/resolver.js +0 -61
- package/dist/runtime/identity/resolver.js.map +0 -1
- package/dist/runtime/identity/workspace-id.d.ts +0 -43
- package/dist/runtime/identity/workspace-id.d.ts.map +0 -1
- package/dist/runtime/identity/workspace-id.js +0 -138
- package/dist/runtime/identity/workspace-id.js.map +0 -1
- package/dist/runtime/local-files/index.d.ts +0 -8
- package/dist/runtime/local-files/index.d.ts.map +0 -1
- package/dist/runtime/local-files/index.js +0 -8
- package/dist/runtime/local-files/index.js.map +0 -1
- package/dist/runtime/local-files/lease.d.ts +0 -62
- package/dist/runtime/local-files/lease.d.ts.map +0 -1
- package/dist/runtime/local-files/lease.js +0 -249
- package/dist/runtime/local-files/lease.js.map +0 -1
- package/dist/runtime/local-files/locks.d.ts +0 -43
- package/dist/runtime/local-files/locks.d.ts.map +0 -1
- package/dist/runtime/local-files/locks.js +0 -197
- package/dist/runtime/local-files/locks.js.map +0 -1
- package/dist/runtime/local-files/migrate.d.ts +0 -31
- package/dist/runtime/local-files/migrate.d.ts.map +0 -1
- package/dist/runtime/local-files/migrate.js +0 -104
- package/dist/runtime/local-files/migrate.js.map +0 -1
- package/dist/runtime/local-files/paths.d.ts +0 -146
- package/dist/runtime/local-files/paths.d.ts.map +0 -1
- package/dist/runtime/local-files/paths.js +0 -233
- package/dist/runtime/local-files/paths.js.map +0 -1
- package/dist/runtime/local-files/presence.d.ts +0 -80
- package/dist/runtime/local-files/presence.d.ts.map +0 -1
- package/dist/runtime/local-files/presence.js +0 -250
- package/dist/runtime/local-files/presence.js.map +0 -1
- package/dist/runtime/local-files/schema.d.ts +0 -47
- package/dist/runtime/local-files/schema.d.ts.map +0 -1
- package/dist/runtime/local-files/schema.js +0 -77
- package/dist/runtime/local-files/schema.js.map +0 -1
- package/dist/runtime/local-files/store.d.ts +0 -132
- package/dist/runtime/local-files/store.d.ts.map +0 -1
- package/dist/runtime/local-files/store.js +0 -997
- package/dist/runtime/local-files/store.js.map +0 -1
- package/dist/runtime/loop/index.d.ts +0 -73
- package/dist/runtime/loop/index.d.ts.map +0 -1
- package/dist/runtime/loop/index.js +0 -107
- package/dist/runtime/loop/index.js.map +0 -1
- package/dist/runtime/mcp/handlers.d.ts +0 -196
- package/dist/runtime/mcp/handlers.d.ts.map +0 -1
- package/dist/runtime/mcp/handlers.js +0 -1025
- package/dist/runtime/mcp/handlers.js.map +0 -1
- package/dist/runtime/mcp/index.d.ts +0 -7
- package/dist/runtime/mcp/index.d.ts.map +0 -1
- package/dist/runtime/mcp/index.js +0 -7
- package/dist/runtime/mcp/index.js.map +0 -1
- package/dist/runtime/mcp/notifications.d.ts +0 -47
- package/dist/runtime/mcp/notifications.d.ts.map +0 -1
- package/dist/runtime/mcp/notifications.js +0 -204
- package/dist/runtime/mcp/notifications.js.map +0 -1
- package/dist/runtime/mcp/server.d.ts +0 -45
- package/dist/runtime/mcp/server.d.ts.map +0 -1
- package/dist/runtime/mcp/server.js +0 -94
- package/dist/runtime/mcp/server.js.map +0 -1
- package/dist/runtime/mcp/sessions.d.ts +0 -68
- package/dist/runtime/mcp/sessions.d.ts.map +0 -1
- package/dist/runtime/mcp/sessions.js +0 -152
- package/dist/runtime/mcp/sessions.js.map +0 -1
- package/dist/runtime/mcp/stdio.d.ts +0 -72
- package/dist/runtime/mcp/stdio.d.ts.map +0 -1
- package/dist/runtime/mcp/stdio.js +0 -274
- package/dist/runtime/mcp/stdio.js.map +0 -1
- package/dist/runtime/mcp/tools.d.ts +0 -19
- package/dist/runtime/mcp/tools.d.ts.map +0 -1
- package/dist/runtime/mcp/tools.js +0 -525
- package/dist/runtime/mcp/tools.js.map +0 -1
- package/dist/runtime/mcp-http/app.d.ts +0 -33
- package/dist/runtime/mcp-http/app.d.ts.map +0 -1
- package/dist/runtime/mcp-http/app.js +0 -162
- package/dist/runtime/mcp-http/app.js.map +0 -1
- package/dist/runtime/mcp-http/hosted-mcp-server.d.ts +0 -14
- package/dist/runtime/mcp-http/hosted-mcp-server.d.ts.map +0 -1
- package/dist/runtime/mcp-http/hosted-mcp-server.js +0 -38
- package/dist/runtime/mcp-http/hosted-mcp-server.js.map +0 -1
- package/dist/runtime/mcp-http/index.d.ts +0 -18
- package/dist/runtime/mcp-http/index.d.ts.map +0 -1
- package/dist/runtime/mcp-http/index.js +0 -18
- package/dist/runtime/mcp-http/index.js.map +0 -1
- package/dist/runtime/mcp-http/main.d.ts +0 -2
- package/dist/runtime/mcp-http/main.d.ts.map +0 -1
- package/dist/runtime/mcp-http/main.js +0 -14
- package/dist/runtime/mcp-http/main.js.map +0 -1
- package/dist/runtime/mcp-http/oauth/broker-login.d.ts +0 -50
- package/dist/runtime/mcp-http/oauth/broker-login.d.ts.map +0 -1
- package/dist/runtime/mcp-http/oauth/broker-login.js +0 -41
- package/dist/runtime/mcp-http/oauth/broker-login.js.map +0 -1
- package/dist/runtime/mcp-http/oauth/broker-routes.d.ts +0 -45
- package/dist/runtime/mcp-http/oauth/broker-routes.d.ts.map +0 -1
- package/dist/runtime/mcp-http/oauth/broker-routes.js +0 -54
- package/dist/runtime/mcp-http/oauth/broker-routes.js.map +0 -1
- package/dist/runtime/mcp-http/oauth/config.d.ts +0 -49
- package/dist/runtime/mcp-http/oauth/config.d.ts.map +0 -1
- package/dist/runtime/mcp-http/oauth/config.js +0 -69
- package/dist/runtime/mcp-http/oauth/config.js.map +0 -1
- package/dist/runtime/mcp-http/oauth/crypto.d.ts +0 -14
- package/dist/runtime/mcp-http/oauth/crypto.d.ts.map +0 -1
- package/dist/runtime/mcp-http/oauth/crypto.js +0 -29
- package/dist/runtime/mcp-http/oauth/crypto.js.map +0 -1
- package/dist/runtime/mcp-http/oauth/file-store.d.ts +0 -48
- package/dist/runtime/mcp-http/oauth/file-store.d.ts.map +0 -1
- package/dist/runtime/mcp-http/oauth/file-store.js +0 -101
- package/dist/runtime/mcp-http/oauth/file-store.js.map +0 -1
- package/dist/runtime/mcp-http/oauth/hono-oauth-router.d.ts +0 -5
- package/dist/runtime/mcp-http/oauth/hono-oauth-router.d.ts.map +0 -1
- package/dist/runtime/mcp-http/oauth/hono-oauth-router.js +0 -92
- package/dist/runtime/mcp-http/oauth/hono-oauth-router.js.map +0 -1
- package/dist/runtime/mcp-http/oauth/oidc-rp.d.ts +0 -56
- package/dist/runtime/mcp-http/oauth/oidc-rp.d.ts.map +0 -1
- package/dist/runtime/mcp-http/oauth/oidc-rp.js +0 -63
- package/dist/runtime/mcp-http/oauth/oidc-rp.js.map +0 -1
- package/dist/runtime/mcp-http/oauth/redirect-uri.d.ts +0 -11
- package/dist/runtime/mcp-http/oauth/redirect-uri.d.ts.map +0 -1
- package/dist/runtime/mcp-http/oauth/redirect-uri.js +0 -29
- package/dist/runtime/mcp-http/oauth/redirect-uri.js.map +0 -1
- package/dist/runtime/mcp-http/oauth/single-tenant-provider.d.ts +0 -70
- package/dist/runtime/mcp-http/oauth/single-tenant-provider.d.ts.map +0 -1
- package/dist/runtime/mcp-http/oauth/single-tenant-provider.js +0 -247
- package/dist/runtime/mcp-http/oauth/single-tenant-provider.js.map +0 -1
- package/dist/runtime/mcp-http/oauth/tenancy.d.ts +0 -3
- package/dist/runtime/mcp-http/oauth/tenancy.d.ts.map +0 -1
- package/dist/runtime/mcp-http/oauth/tenancy.js +0 -18
- package/dist/runtime/mcp-http/oauth/tenancy.js.map +0 -1
- package/dist/runtime/mcp-http/readonly-allowlist.d.ts +0 -24
- package/dist/runtime/mcp-http/readonly-allowlist.d.ts.map +0 -1
- package/dist/runtime/mcp-http/readonly-allowlist.js +0 -43
- package/dist/runtime/mcp-http/readonly-allowlist.js.map +0 -1
- package/dist/runtime/mcp-http/serve.d.ts +0 -39
- package/dist/runtime/mcp-http/serve.d.ts.map +0 -1
- package/dist/runtime/mcp-http/serve.js +0 -100
- package/dist/runtime/mcp-http/serve.js.map +0 -1
- package/dist/runtime/mirror/accept.d.ts +0 -57
- package/dist/runtime/mirror/accept.d.ts.map +0 -1
- package/dist/runtime/mirror/accept.js +0 -70
- package/dist/runtime/mirror/accept.js.map +0 -1
- package/dist/runtime/mirror/build.d.ts +0 -44
- package/dist/runtime/mirror/build.d.ts.map +0 -1
- package/dist/runtime/mirror/build.js +0 -37
- package/dist/runtime/mirror/build.js.map +0 -1
- package/dist/runtime/mirror/index.d.ts +0 -9
- package/dist/runtime/mirror/index.d.ts.map +0 -1
- package/dist/runtime/mirror/index.js +0 -9
- package/dist/runtime/mirror/index.js.map +0 -1
- package/dist/runtime/mirror/serve.d.ts +0 -21
- package/dist/runtime/mirror/serve.d.ts.map +0 -1
- package/dist/runtime/mirror/serve.js +0 -141
- package/dist/runtime/mirror/serve.js.map +0 -1
- package/dist/runtime/nhi.d.ts +0 -15
- package/dist/runtime/nhi.d.ts.map +0 -1
- package/dist/runtime/nhi.js +0 -26
- package/dist/runtime/nhi.js.map +0 -1
- package/dist/runtime/remote/accept.d.ts +0 -50
- package/dist/runtime/remote/accept.d.ts.map +0 -1
- package/dist/runtime/remote/accept.js +0 -54
- package/dist/runtime/remote/accept.js.map +0 -1
- package/dist/runtime/remote/client.d.ts +0 -27
- package/dist/runtime/remote/client.d.ts.map +0 -1
- package/dist/runtime/remote/client.js +0 -34
- package/dist/runtime/remote/client.js.map +0 -1
- package/dist/runtime/remote/index.d.ts +0 -5
- package/dist/runtime/remote/index.d.ts.map +0 -1
- package/dist/runtime/remote/index.js +0 -5
- package/dist/runtime/remote/index.js.map +0 -1
- package/dist/runtime/remote/serve.d.ts +0 -27
- package/dist/runtime/remote/serve.d.ts.map +0 -1
- package/dist/runtime/remote/serve.js +0 -26
- package/dist/runtime/remote/serve.js.map +0 -1
- package/dist/runtime/remote/server.d.ts +0 -36
- package/dist/runtime/remote/server.d.ts.map +0 -1
- package/dist/runtime/remote/server.js +0 -100
- package/dist/runtime/remote/server.js.map +0 -1
- package/dist/runtime/sysml/client.d.ts +0 -44
- package/dist/runtime/sysml/client.d.ts.map +0 -1
- package/dist/runtime/sysml/client.js +0 -52
- package/dist/runtime/sysml/client.js.map +0 -1
- package/dist/runtime/sysml/disclosure.d.ts +0 -23
- package/dist/runtime/sysml/disclosure.d.ts.map +0 -1
- package/dist/runtime/sysml/disclosure.js +0 -53
- package/dist/runtime/sysml/disclosure.js.map +0 -1
- package/dist/runtime/sysml/index.d.ts +0 -4
- package/dist/runtime/sysml/index.d.ts.map +0 -1
- package/dist/runtime/sysml/index.js +0 -4
- package/dist/runtime/sysml/index.js.map +0 -1
- package/dist/runtime/sysml/verify.d.ts +0 -32
- package/dist/runtime/sysml/verify.d.ts.map +0 -1
- package/dist/runtime/sysml/verify.js +0 -67
- package/dist/runtime/sysml/verify.js.map +0 -1
- package/dist/runtime/upgrade/index.d.ts +0 -96
- package/dist/runtime/upgrade/index.d.ts.map +0 -1
- package/dist/runtime/upgrade/index.js +0 -185
- package/dist/runtime/upgrade/index.js.map +0 -1
- package/dist/runtime/version/agent-version.d.ts +0 -15
- package/dist/runtime/version/agent-version.d.ts.map +0 -1
- package/dist/runtime/version/agent-version.js +0 -53
- package/dist/runtime/version/agent-version.js.map +0 -1
- package/skills/h2a/SKILL.md +0 -345
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
import { closeSync, mkdirSync, openSync, readFileSync, readdirSync, renameSync, unlinkSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { join } from "node:path";
|
|
3
|
-
import { H2A_SESSION_DEFAULT_EXPIRY_MS, H2A_SESSION_STATES, H2A_WORK_STATUSES, isH2ASession, isSessionExpired, pickFreshSessions } from "@sentropic/h2a";
|
|
4
|
-
import { localStorePaths, presenceFile } from "./paths.js";
|
|
5
|
-
function ensurePresenceDir(paths) {
|
|
6
|
-
mkdirSync(paths.presence, { recursive: true });
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Atomically write a session's presence file under `<root>/.h2a/presence/`.
|
|
10
|
-
* Uses a temp file + rename so concurrent readers always see a complete
|
|
11
|
-
* JSON document (the session owns its own file, so writer contention is
|
|
12
|
-
* not expected, but we keep the rename anyway for partial-write safety).
|
|
13
|
-
*/
|
|
14
|
-
export function writePresence(root, session) {
|
|
15
|
-
if (!isH2ASession(session)) {
|
|
16
|
-
throw new TypeError("writePresence: argument is not a valid H2ASession");
|
|
17
|
-
}
|
|
18
|
-
const paths = localStorePaths(root);
|
|
19
|
-
ensurePresenceDir(paths);
|
|
20
|
-
const finalPath = presenceFile(paths, session.sessionId);
|
|
21
|
-
const tmpPath = `${finalPath}.tmp-${process.pid}-${Date.now()}`;
|
|
22
|
-
const fd = openSync(tmpPath, "wx");
|
|
23
|
-
try {
|
|
24
|
-
writeFileSync(fd, `${JSON.stringify(session, null, 2)}\n`, "utf8");
|
|
25
|
-
}
|
|
26
|
-
finally {
|
|
27
|
-
closeSync(fd);
|
|
28
|
-
}
|
|
29
|
-
renameSync(tmpPath, finalPath);
|
|
30
|
-
return { path: finalPath };
|
|
31
|
-
}
|
|
32
|
-
/** Read a presence file by session id. Returns undefined if absent or malformed. */
|
|
33
|
-
export function readPresence(root, sessionId) {
|
|
34
|
-
const paths = localStorePaths(root);
|
|
35
|
-
const file = presenceFile(paths, sessionId);
|
|
36
|
-
let raw;
|
|
37
|
-
try {
|
|
38
|
-
raw = readFileSync(file, "utf8");
|
|
39
|
-
}
|
|
40
|
-
catch {
|
|
41
|
-
return undefined;
|
|
42
|
-
}
|
|
43
|
-
if (raw.trim().length === 0)
|
|
44
|
-
return undefined;
|
|
45
|
-
try {
|
|
46
|
-
const parsed = JSON.parse(raw);
|
|
47
|
-
if (!isH2ASession(parsed))
|
|
48
|
-
return undefined;
|
|
49
|
-
return parsed;
|
|
50
|
-
}
|
|
51
|
-
catch {
|
|
52
|
-
return undefined;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Delete a presence file. Idempotent: missing file is not an error.
|
|
57
|
-
*/
|
|
58
|
-
export function deletePresence(root, sessionId) {
|
|
59
|
-
const paths = localStorePaths(root);
|
|
60
|
-
const file = presenceFile(paths, sessionId);
|
|
61
|
-
try {
|
|
62
|
-
unlinkSync(file);
|
|
63
|
-
}
|
|
64
|
-
catch (err) {
|
|
65
|
-
if (err.code === "ENOENT")
|
|
66
|
-
return;
|
|
67
|
-
throw err;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Read all presence files under `<root>/.h2a/presence/`, filter out malformed
|
|
72
|
-
* files, and (by default) drop sessions whose heartbeat is older than
|
|
73
|
-
* `expiryMs`. Sweep expired files from disk as a side-effect.
|
|
74
|
-
*/
|
|
75
|
-
export function listPresence(root, options = {}) {
|
|
76
|
-
const paths = localStorePaths(root);
|
|
77
|
-
let entries;
|
|
78
|
-
try {
|
|
79
|
-
entries = readdirSync(paths.presence);
|
|
80
|
-
}
|
|
81
|
-
catch (err) {
|
|
82
|
-
if (err.code === "ENOENT")
|
|
83
|
-
return [];
|
|
84
|
-
throw err;
|
|
85
|
-
}
|
|
86
|
-
const now = options.now ?? Date.now();
|
|
87
|
-
const expiryMs = options.expiryMs ?? H2A_SESSION_DEFAULT_EXPIRY_MS;
|
|
88
|
-
const all = [];
|
|
89
|
-
for (const entry of entries) {
|
|
90
|
-
if (!entry.endsWith(".json"))
|
|
91
|
-
continue;
|
|
92
|
-
const sid = entry.slice(0, -".json".length);
|
|
93
|
-
const session = readPresence(root, sid);
|
|
94
|
-
if (!session) {
|
|
95
|
-
// Stale or malformed — best-effort cleanup
|
|
96
|
-
try {
|
|
97
|
-
unlinkSync(join(paths.presence, entry));
|
|
98
|
-
}
|
|
99
|
-
catch {
|
|
100
|
-
// ignore
|
|
101
|
-
}
|
|
102
|
-
continue;
|
|
103
|
-
}
|
|
104
|
-
all.push(session);
|
|
105
|
-
}
|
|
106
|
-
if (options.includeExpired)
|
|
107
|
-
return all;
|
|
108
|
-
const fresh = pickFreshSessions(all, { now, expiryMs });
|
|
109
|
-
// Sweep newly-expired files
|
|
110
|
-
for (const session of all) {
|
|
111
|
-
if (!isSessionExpired(session, { now, expiryMs }))
|
|
112
|
-
continue;
|
|
113
|
-
try {
|
|
114
|
-
unlinkSync(presenceFile(paths, session.sessionId));
|
|
115
|
-
}
|
|
116
|
-
catch {
|
|
117
|
-
// ignore
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
return fresh;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Mutate a session's `heartbeatAt` (or `state`) on disk by reading,
|
|
124
|
-
* patching, and re-writing. The session owns its file so this is safe
|
|
125
|
-
* without a lock for V1 (DEC-051 acknowledges this constraint).
|
|
126
|
-
*/
|
|
127
|
-
export function updatePresence(root, sessionId, patch) {
|
|
128
|
-
const existing = readPresence(root, sessionId);
|
|
129
|
-
if (!existing)
|
|
130
|
-
return undefined;
|
|
131
|
-
if (patch.state !== undefined &&
|
|
132
|
-
!H2A_SESSION_STATES.includes(patch.state)) {
|
|
133
|
-
throw new TypeError(`updatePresence: unknown session state "${patch.state}"`);
|
|
134
|
-
}
|
|
135
|
-
if (patch.workStatus !== undefined &&
|
|
136
|
-
!H2A_WORK_STATUSES.includes(patch.workStatus)) {
|
|
137
|
-
throw new TypeError(`updatePresence: unknown work status "${patch.workStatus}"`);
|
|
138
|
-
}
|
|
139
|
-
const next = {
|
|
140
|
-
...existing,
|
|
141
|
-
...(patch.heartbeatAt ? { heartbeatAt: patch.heartbeatAt } : {}),
|
|
142
|
-
...(patch.state ? { state: patch.state } : {}),
|
|
143
|
-
...(patch.workStatus ? { workStatus: patch.workStatus } : {}),
|
|
144
|
-
...(patch.launchContext ? { launchContext: patch.launchContext } : {}),
|
|
145
|
-
...(patch.lastMcpActivityAt
|
|
146
|
-
? { lastMcpActivityAt: patch.lastMcpActivityAt }
|
|
147
|
-
: {})
|
|
148
|
-
};
|
|
149
|
-
writePresence(root, next);
|
|
150
|
-
return next;
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* Default liveness probe: signal-0 to `pid`. `EPERM` means the process exists
|
|
154
|
-
* but we lack permission (alive); `ESRCH` means no such process (dead).
|
|
155
|
-
*/
|
|
156
|
-
function defaultPidAlive(pid) {
|
|
157
|
-
if (!Number.isInteger(pid) || pid <= 0)
|
|
158
|
-
return false;
|
|
159
|
-
try {
|
|
160
|
-
process.kill(pid, 0);
|
|
161
|
-
return true;
|
|
162
|
-
}
|
|
163
|
-
catch (err) {
|
|
164
|
-
return err.code === "EPERM";
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Reap presence files for the SAME `instance` whose owning process is provably
|
|
169
|
-
* dead — the "false-live" left behind when a host (Claude Code / Codex) drops
|
|
170
|
-
* the MCP stdio connection WITHOUT signalling the child: the process lingered
|
|
171
|
-
* and its blind heartbeat kept the presence "live", so peers kept routing to an
|
|
172
|
-
* agent that could no longer answer. A fresh `mcp-serve` boot calls this at
|
|
173
|
-
* auto-open to clear the stale presence of a previous connection of the SAME
|
|
174
|
-
* agent.
|
|
175
|
-
*
|
|
176
|
-
* Reaps an entry iff ALL hold:
|
|
177
|
-
* - same `instance` (an instance never migrates machines — it is keyed on the
|
|
178
|
-
* provider conversation — so the local pid probe is valid);
|
|
179
|
-
* - a DIFFERENT `sessionId` than `keepSessionId` (never reap the caller);
|
|
180
|
-
* - a numeric `pid` that `isAlive` reports dead.
|
|
181
|
-
*
|
|
182
|
-
* Best-effort: never throws. `isAlive` is injectable for deterministic tests.
|
|
183
|
-
*
|
|
184
|
-
* @returns the sessionIds that were reaped.
|
|
185
|
-
*/
|
|
186
|
-
export function reapDeadInstancePresence(root, instance, keepSessionId, isAlive = defaultPidAlive) {
|
|
187
|
-
let all;
|
|
188
|
-
try {
|
|
189
|
-
all = listPresence(root, { includeExpired: true });
|
|
190
|
-
}
|
|
191
|
-
catch {
|
|
192
|
-
return [];
|
|
193
|
-
}
|
|
194
|
-
const reaped = [];
|
|
195
|
-
for (const session of all) {
|
|
196
|
-
if (session.instance !== instance)
|
|
197
|
-
continue;
|
|
198
|
-
if (session.sessionId === keepSessionId)
|
|
199
|
-
continue;
|
|
200
|
-
const pid = session.pid;
|
|
201
|
-
if (typeof pid !== "number")
|
|
202
|
-
continue;
|
|
203
|
-
if (isAlive(pid))
|
|
204
|
-
continue;
|
|
205
|
-
try {
|
|
206
|
-
deletePresence(root, session.sessionId);
|
|
207
|
-
reaped.push(session.sessionId);
|
|
208
|
-
}
|
|
209
|
-
catch {
|
|
210
|
-
// best-effort: a delete race is harmless (another booter reaped it)
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
return reaped;
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* Host-wide janitor: reap EVERY presence file whose owning process is provably
|
|
217
|
-
* dead, regardless of instance. The safest possible reap — a dead process
|
|
218
|
-
* cannot own a live session — but it assumes presence pids are local to this
|
|
219
|
-
* machine (true for a single-host bus). On a bus shared across machines, scope
|
|
220
|
-
* with `reapDeadInstancePresence` instead, since a remote pid would read as
|
|
221
|
-
* dead here. Best-effort: never throws. `isAlive` is injectable for tests.
|
|
222
|
-
*
|
|
223
|
-
* @returns the reaped sessionIds (and, for reporting, their instances).
|
|
224
|
-
*/
|
|
225
|
-
export function reapAllDeadPresence(root, isAlive = defaultPidAlive) {
|
|
226
|
-
let all;
|
|
227
|
-
try {
|
|
228
|
-
all = listPresence(root, { includeExpired: true });
|
|
229
|
-
}
|
|
230
|
-
catch {
|
|
231
|
-
return [];
|
|
232
|
-
}
|
|
233
|
-
const reaped = [];
|
|
234
|
-
for (const session of all) {
|
|
235
|
-
const pid = session.pid;
|
|
236
|
-
if (typeof pid !== "number")
|
|
237
|
-
continue;
|
|
238
|
-
if (isAlive(pid))
|
|
239
|
-
continue;
|
|
240
|
-
try {
|
|
241
|
-
deletePresence(root, session.sessionId);
|
|
242
|
-
reaped.push({ sessionId: session.sessionId, instance: session.instance, pid });
|
|
243
|
-
}
|
|
244
|
-
catch {
|
|
245
|
-
// best-effort
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
return reaped;
|
|
249
|
-
}
|
|
250
|
-
//# sourceMappingURL=presence.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"presence.js","sourceRoot":"","sources":["../../../src/runtime/local-files/presence.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,SAAS,EACT,QAAQ,EACR,Y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M,CAAC;AAChB,CAAC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Local-files store schema versioning (DEC-036).
|
|
3
|
-
*
|
|
4
|
-
* Every initialized store carries a `<root>/.h2a-schema.json` sentinel:
|
|
5
|
-
*
|
|
6
|
-
* ```json
|
|
7
|
-
* {
|
|
8
|
-
* "version": "1",
|
|
9
|
-
* "createdAt": "2026-05-20T08:12:34.567Z",
|
|
10
|
-
* "createdBy": "@sentropic/h2a-cli@0.1.1"
|
|
11
|
-
* }
|
|
12
|
-
* ```
|
|
13
|
-
*
|
|
14
|
-
* The version string is opaque and strictly compared against
|
|
15
|
-
* `H2A_STORE_SCHEMA_VERSION`. A future schema bump requires:
|
|
16
|
-
*
|
|
17
|
-
* - a new DEC documenting the layout change,
|
|
18
|
-
* - a migration ramp (`h2a store migrate --from <old> --to <new>`),
|
|
19
|
-
* - a `H2A_STORE_SCHEMA_VERSION` bump in this file.
|
|
20
|
-
*
|
|
21
|
-
* The escape hatch `createLocalStore({ allowVersionMismatch: true })` is
|
|
22
|
-
* intentionally narrow: it logs a stderr warning, skips the version check,
|
|
23
|
-
* and **never** rewrites the sentinel. It exists so a read-only inspection
|
|
24
|
-
* tool (e.g., a debugger) can open a store written by a newer CLI.
|
|
25
|
-
*/
|
|
26
|
-
export declare const H2A_STORE_SCHEMA_VERSION: "1";
|
|
27
|
-
export declare const H2A_STORE_SCHEMA_FILE: ".h2a-schema.json";
|
|
28
|
-
export interface H2AStoreSchemaSentinel {
|
|
29
|
-
readonly version: string;
|
|
30
|
-
readonly createdAt: string;
|
|
31
|
-
readonly createdBy: string;
|
|
32
|
-
}
|
|
33
|
-
export declare class StoreSchemaMismatchError extends Error {
|
|
34
|
-
readonly foundVersion: string;
|
|
35
|
-
readonly expectedVersion: string;
|
|
36
|
-
constructor(foundVersion: string, expectedVersion: string, root: string);
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Best-effort lookup of `@sentropic/h2a-cli`'s own package version. We walk
|
|
40
|
-
* up from the current module file (`dist/runtime/local-files/schema.js` at
|
|
41
|
-
* runtime, or the TS source under tests) until we find a `package.json`
|
|
42
|
-
* whose `name` matches. Falls back to `0.0.0-unknown` if the search fails,
|
|
43
|
-
* which only affects the `createdBy` metadata field — it never aborts a
|
|
44
|
-
* store init.
|
|
45
|
-
*/
|
|
46
|
-
export declare function readCliPackageVersion(): string;
|
|
47
|
-
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/runtime/local-files/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAMH,eAAO,MAAM,wBAAwB,EAAG,GAAY,CAAC;AAErD,eAAO,MAAM,qBAAqB,EAAG,kBAA2B,CAAC;AAEjE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,qBAAa,wBAAyB,SAAQ,KAAK;IACjD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;gBAErB,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;CAQxE;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAwB9C"}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Local-files store schema versioning (DEC-036).
|
|
3
|
-
*
|
|
4
|
-
* Every initialized store carries a `<root>/.h2a-schema.json` sentinel:
|
|
5
|
-
*
|
|
6
|
-
* ```json
|
|
7
|
-
* {
|
|
8
|
-
* "version": "1",
|
|
9
|
-
* "createdAt": "2026-05-20T08:12:34.567Z",
|
|
10
|
-
* "createdBy": "@sentropic/h2a-cli@0.1.1"
|
|
11
|
-
* }
|
|
12
|
-
* ```
|
|
13
|
-
*
|
|
14
|
-
* The version string is opaque and strictly compared against
|
|
15
|
-
* `H2A_STORE_SCHEMA_VERSION`. A future schema bump requires:
|
|
16
|
-
*
|
|
17
|
-
* - a new DEC documenting the layout change,
|
|
18
|
-
* - a migration ramp (`h2a store migrate --from <old> --to <new>`),
|
|
19
|
-
* - a `H2A_STORE_SCHEMA_VERSION` bump in this file.
|
|
20
|
-
*
|
|
21
|
-
* The escape hatch `createLocalStore({ allowVersionMismatch: true })` is
|
|
22
|
-
* intentionally narrow: it logs a stderr warning, skips the version check,
|
|
23
|
-
* and **never** rewrites the sentinel. It exists so a read-only inspection
|
|
24
|
-
* tool (e.g., a debugger) can open a store written by a newer CLI.
|
|
25
|
-
*/
|
|
26
|
-
import { readFileSync } from "node:fs";
|
|
27
|
-
import { dirname } from "node:path";
|
|
28
|
-
import { fileURLToPath } from "node:url";
|
|
29
|
-
export const H2A_STORE_SCHEMA_VERSION = "1";
|
|
30
|
-
export const H2A_STORE_SCHEMA_FILE = ".h2a-schema.json";
|
|
31
|
-
export class StoreSchemaMismatchError extends Error {
|
|
32
|
-
foundVersion;
|
|
33
|
-
expectedVersion;
|
|
34
|
-
constructor(foundVersion, expectedVersion, root) {
|
|
35
|
-
super(`StoreSchemaMismatchError: store at ${root} declares schema version "${foundVersion}" but this CLI expects "${expectedVersion}". Run \`h2a store migrate --from ${foundVersion} --to ${expectedVersion}\` or pass \`allowVersionMismatch: true\` for read-only inspection (DEC-036).`);
|
|
36
|
-
this.name = "StoreSchemaMismatchError";
|
|
37
|
-
this.foundVersion = foundVersion;
|
|
38
|
-
this.expectedVersion = expectedVersion;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Best-effort lookup of `@sentropic/h2a-cli`'s own package version. We walk
|
|
43
|
-
* up from the current module file (`dist/runtime/local-files/schema.js` at
|
|
44
|
-
* runtime, or the TS source under tests) until we find a `package.json`
|
|
45
|
-
* whose `name` matches. Falls back to `0.0.0-unknown` if the search fails,
|
|
46
|
-
* which only affects the `createdBy` metadata field — it never aborts a
|
|
47
|
-
* store init.
|
|
48
|
-
*/
|
|
49
|
-
export function readCliPackageVersion() {
|
|
50
|
-
try {
|
|
51
|
-
const here = fileURLToPath(import.meta.url);
|
|
52
|
-
let dir = dirname(here);
|
|
53
|
-
// Walk up at most 8 levels (dist/runtime/local-files → package root is
|
|
54
|
-
// typically 3, but allow some slack for the source-mode test runner).
|
|
55
|
-
for (let i = 0; i < 8; i++) {
|
|
56
|
-
try {
|
|
57
|
-
const raw = readFileSync(`${dir}/package.json`, "utf8");
|
|
58
|
-
const parsed = JSON.parse(raw);
|
|
59
|
-
if (parsed.name === "@sentropic/h2a-cli" && typeof parsed.version === "string") {
|
|
60
|
-
return `@sentropic/h2a-cli@${parsed.version}`;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
catch {
|
|
64
|
-
/* keep walking */
|
|
65
|
-
}
|
|
66
|
-
const next = dirname(dir);
|
|
67
|
-
if (next === dir)
|
|
68
|
-
break;
|
|
69
|
-
dir = next;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
catch {
|
|
73
|
-
/* fall through */
|
|
74
|
-
}
|
|
75
|
-
return "@sentropic/h2a-cli@0.0.0-unknown";
|
|
76
|
-
}
|
|
77
|
-
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/runtime/local-files/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,CAAC,MAAM,wBAAwB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gBAAE,MAAM;YACxB,GAAG,GAAG,IAAI,CAAC;QACb,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,kBAAkB;IACpB,CAAC;IACD,OAAO,kCAAkC,CAAC;AAC5C,CAAC"}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import { type H2AActorRegistration, type H2AOrgMembershipGrant, type H2ASubagentBinding, type H2AEnvelope, type H2AJournalEntry, type H2AJournalPayload, type H2ANegotiationRecord, type H2ADecisionDossier, type H2ADeclarationInteret, type H2APostureConfianceResult, type H2APostureConflitResult, type H2APresenterBias } from "@sentropic/h2a";
|
|
2
|
-
import { type LocalStorePaths } from "./paths.js";
|
|
3
|
-
export interface CreateLocalStoreOptions {
|
|
4
|
-
root: string;
|
|
5
|
-
/**
|
|
6
|
-
* Timeout (ms) for acquiring any per-store advisory file lock. Defaults to
|
|
7
|
-
* 5000. Tests use a much smaller value to exercise the timeout path
|
|
8
|
-
* without slowing the suite. DEC-036.
|
|
9
|
-
*/
|
|
10
|
-
lockTimeoutMs?: number;
|
|
11
|
-
/**
|
|
12
|
-
* Read-only escape hatch: if the on-disk `.h2a-schema.json` declares a
|
|
13
|
-
* version we don't recognize, proceed anyway with a stderr warning. Never
|
|
14
|
-
* rewrites the sentinel. Intended for inspection tooling. DEC-036.
|
|
15
|
-
*/
|
|
16
|
-
allowVersionMismatch?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Locking strategy for critical sections (DEC-066):
|
|
19
|
-
* - `"pid"` (default) — same-machine advisory lock with PID-staleness
|
|
20
|
-
* recovery (DEC-036). Zero-config, correct for the common single-machine
|
|
21
|
-
* case.
|
|
22
|
-
* - `"lease"` — time-based lease lock (DEC-065) safe across hosts/Pods on a
|
|
23
|
-
* shared ReadWriteMany store (Scenario B of DEC-056). No PID assumption.
|
|
24
|
-
*/
|
|
25
|
-
lockMode?: "pid" | "lease";
|
|
26
|
-
/**
|
|
27
|
-
* Lease duration (ms) when `lockMode === "lease"`. Must exceed the longest
|
|
28
|
-
* critical section plus inter-host clock skew. Default 30000.
|
|
29
|
-
*/
|
|
30
|
-
leaseMs?: number;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* An append-only audit event for a subagent (DEC-071). Distinct from the
|
|
34
|
-
* parent fan-in (DEC-070), which reflects *current* inbox state: the audit log
|
|
35
|
-
* is the permanent history of what happened to a subagent and survives an
|
|
36
|
-
* inbox pop.
|
|
37
|
-
*/
|
|
38
|
-
export interface H2ASubagentAuditEvent {
|
|
39
|
-
subagent: string;
|
|
40
|
-
type: "registered" | "routed" | "revoked";
|
|
41
|
-
at: string;
|
|
42
|
-
envelopeId?: string;
|
|
43
|
-
mailbox?: "inbox" | "outbox";
|
|
44
|
-
reason?: string;
|
|
45
|
-
}
|
|
46
|
-
export type H2ASubagentStatus = "active" | "revoked";
|
|
47
|
-
/**
|
|
48
|
-
* An append-only keyring event for an instance (DEC-078). Keys can be added
|
|
49
|
-
* (and, from DEC-079, revoked) without rewriting the append-only instance
|
|
50
|
-
* registration, enabling key rotation: add a new key, both verify during the
|
|
51
|
-
* overlap, then revoke the old one.
|
|
52
|
-
*/
|
|
53
|
-
export interface H2AKeyEvent {
|
|
54
|
-
instance: string;
|
|
55
|
-
publicKey: string;
|
|
56
|
-
type: "added" | "revoked";
|
|
57
|
-
at: string;
|
|
58
|
-
}
|
|
59
|
-
export interface H2AOffboardTombstone {
|
|
60
|
-
instance: string;
|
|
61
|
-
reason?: string;
|
|
62
|
-
revokedKeys: number;
|
|
63
|
-
revokedSubagents: string[];
|
|
64
|
-
at: string;
|
|
65
|
-
}
|
|
66
|
-
export interface H2ADerivedDecisionDossier {
|
|
67
|
-
negotiationId: string;
|
|
68
|
-
dossier: H2ADecisionDossier;
|
|
69
|
-
dossierHash: string;
|
|
70
|
-
presenterBias?: H2APresenterBias;
|
|
71
|
-
advisoryEvent?: H2AJournalEntry<unknown>;
|
|
72
|
-
}
|
|
73
|
-
export interface LocalStore {
|
|
74
|
-
paths: LocalStorePaths;
|
|
75
|
-
registerInstance(reg: H2AActorRegistration): void;
|
|
76
|
-
listInstances(): H2AActorRegistration[];
|
|
77
|
-
findInstance(id: string): H2AActorRegistration | undefined;
|
|
78
|
-
addInstanceKey(instanceId: string, publicKeyPem: string): void;
|
|
79
|
-
listInstanceKeys(instanceId: string): string[];
|
|
80
|
-
listKeyEvents(): H2AKeyEvent[];
|
|
81
|
-
revokeInstanceKey(instanceId: string, publicKeyPem: string): void;
|
|
82
|
-
/** DEC-109 org provisioning: append a role/scope membership grant (keyed-only). */
|
|
83
|
-
grantOrgMembership(grant: H2AOrgMembershipGrant): void;
|
|
84
|
-
listOrgMembership(): H2AOrgMembershipGrant[];
|
|
85
|
-
offboardInstance(instanceId: string, reason?: string): H2AOffboardTombstone;
|
|
86
|
-
listOffboards(): H2AOffboardTombstone[];
|
|
87
|
-
registerSubagent(binding: H2ASubagentBinding): void;
|
|
88
|
-
listSubagents(): H2ASubagentBinding[];
|
|
89
|
-
findSubagent(id: string): H2ASubagentBinding | undefined;
|
|
90
|
-
listSubagentsOf(parentInstance: string): H2ASubagentBinding[];
|
|
91
|
-
openNegotiation(record: H2ANegotiationRecord): H2ANegotiationRecord;
|
|
92
|
-
readNegotiation(id: string): H2ANegotiationRecord | undefined;
|
|
93
|
-
updateNegotiationStatus(id: string, status: H2ANegotiationRecord["status"]): H2ANegotiationRecord;
|
|
94
|
-
appendNegotiationEvent<TBody = unknown>(negotiationId: string, payload: H2AJournalPayload<TBody>): H2AJournalEntry<TBody>;
|
|
95
|
-
readNegotiationJournal(negotiationId: string): H2AJournalEntry<unknown>[];
|
|
96
|
-
declareConflitInteret(negotiationId: string, declaration: H2ADeclarationInteret, options?: {
|
|
97
|
-
eventId?: string;
|
|
98
|
-
}): H2AJournalEntry<H2ADeclarationInteret>;
|
|
99
|
-
derivePosturesConflit(negotiationId: string): H2APostureConflitResult[];
|
|
100
|
-
deriveDecisionDossier(negotiationId: string, options?: {
|
|
101
|
-
presenter?: string;
|
|
102
|
-
advisoryGate?: boolean;
|
|
103
|
-
eventId?: string;
|
|
104
|
-
}): H2ADerivedDecisionDossier;
|
|
105
|
-
derivePostureConfiance(negotiationId: string): H2APostureConfianceResult;
|
|
106
|
-
stabilizeNegotiation(negotiationId: string, options?: {
|
|
107
|
-
eventId?: string;
|
|
108
|
-
}): {
|
|
109
|
-
record: H2ANegotiationRecord;
|
|
110
|
-
artifactHash: string;
|
|
111
|
-
signers: string[];
|
|
112
|
-
finalEvent: H2AJournalEntry<unknown>;
|
|
113
|
-
advisoryEvents: H2AJournalEntry<unknown>[];
|
|
114
|
-
artifactPath: string;
|
|
115
|
-
};
|
|
116
|
-
putInboxMessage(actor: string, envelope: H2AEnvelope): void;
|
|
117
|
-
readInbox(actor: string): H2AEnvelope[];
|
|
118
|
-
popInboxMessage(actor: string, envelopeId: string): H2AEnvelope | undefined;
|
|
119
|
-
putOutboxMessage(actor: string, envelope: H2AEnvelope): void;
|
|
120
|
-
readOutbox(actor: string): H2AEnvelope[];
|
|
121
|
-
routeToSubagent(subagentId: string, envelope: H2AEnvelope, mailbox?: "inbox" | "outbox"): void;
|
|
122
|
-
readSubagentInboxes(parentInstance: string): Array<{
|
|
123
|
-
subagent: string;
|
|
124
|
-
envelopes: H2AEnvelope[];
|
|
125
|
-
}>;
|
|
126
|
-
readSubagentAudit(subagentId: string): H2ASubagentAuditEvent[];
|
|
127
|
-
readSubagentAuditOf(parentInstance: string): H2ASubagentAuditEvent[];
|
|
128
|
-
subagentStatus(subagentId: string): H2ASubagentStatus;
|
|
129
|
-
revokeSubagent(subagentId: string, reason?: string): void;
|
|
130
|
-
}
|
|
131
|
-
export declare function createLocalStore(options: CreateLocalStoreOptions): LocalStore;
|
|
132
|
-
//# sourceMappingURL=store.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/runtime/local-files/store.ts"],"names":[],"mappings":"AAWA,OAAO,EAmBL,KAAK,oBAA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