@sentropic/h2a-cli 0.75.0 → 0.79.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,74 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Blockage delivery adapters (DEC-092, EVO-3 Phase B). Connected peers already
|
|
3
|
-
* get the `peer.blocked`/`peer.unblocked` MCP push (DEC-052) — these adapters
|
|
4
|
-
* are for waking **disconnected** peers, mirroring the drumbeat relauncher
|
|
5
|
-
* adapters (DEC-091). The real per-host wake command is install-time config
|
|
6
|
-
* (D6 / EVO-1); here is the in-repo abstraction + the agy polling fallback,
|
|
7
|
-
* behind an injectable runtime so it is unit-testable with no host.
|
|
8
|
-
*/
|
|
9
|
-
import { spawnSync } from "node:child_process";
|
|
10
|
-
export const defaultNotifierRuntime = {
|
|
11
|
-
run(file, args) {
|
|
12
|
-
const res = spawnSync(file, [...args], { stdio: "ignore" });
|
|
13
|
-
return res.status === 0;
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
/** Dry-run default: only logs what it would deliver. */
|
|
17
|
-
export function loggingNotifier(write) {
|
|
18
|
-
return {
|
|
19
|
-
notify(blockage, peer) {
|
|
20
|
-
write(`blockage: would notify ${peer.instance}${peer.host ? ` (${peer.host})` : ""} of ${blockage.instance} blocked: ${blockage.reason}`);
|
|
21
|
-
return true;
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Wake a disconnected peer by running a configured per-host command. The
|
|
27
|
-
* template substitutes `{instance}` (the blocked agent), `{reason}` and
|
|
28
|
-
* `{peer}` (the peer being woken). The actual command per host (claude wake /
|
|
29
|
-
* codex remote-control / gemini hooks) is supplied at install time (D6).
|
|
30
|
-
*/
|
|
31
|
-
export function commandNotifier(options) {
|
|
32
|
-
const runtime = options.runtime ?? defaultNotifierRuntime;
|
|
33
|
-
return {
|
|
34
|
-
notify(blockage, peer) {
|
|
35
|
-
if (options.command.length === 0)
|
|
36
|
-
return false;
|
|
37
|
-
const subst = (s) => s
|
|
38
|
-
.replaceAll("{instance}", blockage.instance)
|
|
39
|
-
.replaceAll("{reason}", blockage.reason)
|
|
40
|
-
.replaceAll("{peer}", peer.instance);
|
|
41
|
-
const [file, ...args] = options.command.map(subst);
|
|
42
|
-
const ok = runtime.run(file, args);
|
|
43
|
-
options.log?.(`blockage[command]: notify ${peer.instance} of ${blockage.instance} → ${file} (${ok ? "ok" : "failed"})`);
|
|
44
|
-
return ok;
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* The agy fallback: agy has no background daemon (capability matrix), so it
|
|
50
|
-
* cannot be woken — its imported plugin polls `h2a blockage list` instead. This
|
|
51
|
-
* adapter therefore declines (push is a no-op); it exists so a chain can mark a
|
|
52
|
-
* peer as "poll-only" explicitly rather than silently dropping it.
|
|
53
|
-
*/
|
|
54
|
-
export function pollingNotifier(options = {}) {
|
|
55
|
-
return {
|
|
56
|
-
notify(blockage, peer) {
|
|
57
|
-
options.log?.(`blockage[polling]: ${peer.instance} is poll-only (no daemon) — will see ${blockage.instance} via 'h2a blockage list'`);
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
/** Try each adapter in order; the first to deliver wins. */
|
|
63
|
-
export function chainNotifier(...notifiers) {
|
|
64
|
-
return {
|
|
65
|
-
async notify(blockage, peer) {
|
|
66
|
-
for (const n of notifiers) {
|
|
67
|
-
if (await n.notify(blockage, peer))
|
|
68
|
-
return true;
|
|
69
|
-
}
|
|
70
|
-
return false;
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
//# sourceMappingURL=notifiers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notifiers.js","sourceRoot":"","sources":["../../../src/runtime/blockage/notifiers.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAsB/C,MAAM,CAAC,MAAM,sBAAsB,GAAoB;IACrD,GAAG,CAAC,IAAI,EAAE,IAAI;QACZ,MAAM,GAAG,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC5D,OAAO,GAAG,CAAC,MAAM,KAAK,CAAC,CAAC;IAC1B,CAAC;CACF,CAAC;AAMF,wDAAwD;AACxD,MAAM,UAAU,eAAe,CAAC,KAA6B;IAC3D,OAAO;QACL,MAAM,CAAC,QAAQ,EAAE,IAAI;YACnB,KAAK,CACH,0BAA0B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,OAAO,QAAQ,CAAC,QAAQ,aAAa,QAAQ,CAAC,MAAM,EAAE,CACnI,CAAC;YACF,OAAO,IAAI,CAAC;QACd,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,OAI/B;IACC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,sBAAsB,CAAC;IAC1D,OAAO;QACL,MAAM,CAAC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AAC,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC;oBAAE,OAAO,IAAI,CAAC;YAClD,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Durable blockage registry (DEC-092, EVO-3). Parallel to the drumbeat
|
|
3
|
-
* registry: a peer's blockage must outlive the ~15s presence sweep so other
|
|
4
|
-
* agents can see it and help. Stored at `<root>/.h2a/blockage/<safe-instance>.json`.
|
|
5
|
-
* The `NotificationDispatcher` diffs this directory to push `peer.blocked` /
|
|
6
|
-
* `peer.unblocked` to subscribed peers (DEC-052).
|
|
7
|
-
*/
|
|
8
|
-
import type { H2ABlockage } from "@sentropic/h2a";
|
|
9
|
-
export interface RaiseBlockageInput {
|
|
10
|
-
readonly instance: string;
|
|
11
|
-
readonly scope: string;
|
|
12
|
-
readonly reason: string;
|
|
13
|
-
readonly needs?: string;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Raise (upsert) a blockage. A fresh raise clears any prior resolution — the
|
|
17
|
-
* agent is blocked again, on possibly a new reason.
|
|
18
|
-
*/
|
|
19
|
-
export declare function raiseBlockage(root: string, input: RaiseBlockageInput, now?: number): H2ABlockage;
|
|
20
|
-
export declare function readBlockage(root: string, instance: string): H2ABlockage | undefined;
|
|
21
|
-
export declare function listBlockages(root: string): H2ABlockage[];
|
|
22
|
-
/**
|
|
23
|
-
* Resolve a blockage (idempotent). Returns the resolved blockage, or undefined
|
|
24
|
-
* if the instance has none recorded. Re-resolving keeps the first resolution.
|
|
25
|
-
*/
|
|
26
|
-
export declare function resolveBlockage(root: string, instance: string, options?: {
|
|
27
|
-
by?: string;
|
|
28
|
-
now?: number;
|
|
29
|
-
}): H2ABlockage | undefined;
|
|
30
|
-
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/runtime/blockage/registry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAYlD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,kBAAkB,EACzB,GAAG,GAAE,MAAmB,GACvB,WAAW,CAWb;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAQpF;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,EAAE,CAmBzD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE;IAAE,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAO,GAC1C,WAAW,GAAG,SAAS,CAWzB"}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Durable blockage registry (DEC-092, EVO-3). Parallel to the drumbeat
|
|
3
|
-
* registry: a peer's blockage must outlive the ~15s presence sweep so other
|
|
4
|
-
* agents can see it and help. Stored at `<root>/.h2a/blockage/<safe-instance>.json`.
|
|
5
|
-
* The `NotificationDispatcher` diffs this directory to push `peer.blocked` /
|
|
6
|
-
* `peer.unblocked` to subscribed peers (DEC-052).
|
|
7
|
-
*/
|
|
8
|
-
import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
|
|
9
|
-
import { join } from "node:path";
|
|
10
|
-
import { localStorePaths, safePathSegment } from "../local-files/paths.js";
|
|
11
|
-
function entryFile(root, instance) {
|
|
12
|
-
return join(localStorePaths(root).blockage, `${safePathSegment(instance)}.json`);
|
|
13
|
-
}
|
|
14
|
-
function ensureDir(root) {
|
|
15
|
-
mkdirSync(localStorePaths(root).blockage, { recursive: true });
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Raise (upsert) a blockage. A fresh raise clears any prior resolution — the
|
|
19
|
-
* agent is blocked again, on possibly a new reason.
|
|
20
|
-
*/
|
|
21
|
-
export function raiseBlockage(root, input, now = Date.now()) {
|
|
22
|
-
ensureDir(root);
|
|
23
|
-
const blockage = {
|
|
24
|
-
instance: input.instance,
|
|
25
|
-
scope: input.scope,
|
|
26
|
-
reason: input.reason,
|
|
27
|
-
...(input.needs ? { needs: input.needs } : {}),
|
|
28
|
-
raisedAt: new Date(now).toISOString()
|
|
29
|
-
};
|
|
30
|
-
writeFileSync(entryFile(root, input.instance), `${JSON.stringify(blockage, null, 2)}\n`, "utf8");
|
|
31
|
-
return blockage;
|
|
32
|
-
}
|
|
33
|
-
export function readBlockage(root, instance) {
|
|
34
|
-
const file = entryFile(root, instance);
|
|
35
|
-
if (!existsSync(file))
|
|
36
|
-
return undefined;
|
|
37
|
-
try {
|
|
38
|
-
return JSON.parse(readFileSync(file, "utf8"));
|
|
39
|
-
}
|
|
40
|
-
catch {
|
|
41
|
-
return undefined;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
export function listBlockages(root) {
|
|
45
|
-
const dir = localStorePaths(root).blockage;
|
|
46
|
-
let names;
|
|
47
|
-
try {
|
|
48
|
-
names = readdirSync(dir);
|
|
49
|
-
}
|
|
50
|
-
catch (err) {
|
|
51
|
-
if (err.code === "ENOENT")
|
|
52
|
-
return [];
|
|
53
|
-
throw err;
|
|
54
|
-
}
|
|
55
|
-
const out = [];
|
|
56
|
-
for (const name of names) {
|
|
57
|
-
if (!name.endsWith(".json"))
|
|
58
|
-
continue;
|
|
59
|
-
try {
|
|
60
|
-
out.push(JSON.parse(readFileSync(join(dir, name), "utf8")));
|
|
61
|
-
}
|
|
62
|
-
catch {
|
|
63
|
-
// skip malformed
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return out;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Resolve a blockage (idempotent). Returns the resolved blockage, or undefined
|
|
70
|
-
* if the instance has none recorded. Re-resolving keeps the first resolution.
|
|
71
|
-
*/
|
|
72
|
-
export function resolveBlockage(root, instance, options = {}) {
|
|
73
|
-
const current = readBlockage(root, instance);
|
|
74
|
-
if (!current)
|
|
75
|
-
return undefined;
|
|
76
|
-
if (current.resolvedAt !== undefined)
|
|
77
|
-
return current;
|
|
78
|
-
const resolved = {
|
|
79
|
-
...current,
|
|
80
|
-
resolvedAt: new Date(options.now ?? Date.now()).toISOString(),
|
|
81
|
-
...(options.by ? { resolvedBy: options.by } : {})
|
|
82
|
-
};
|
|
83
|
-
writeFileSync(entryFile(root, instance), `${JSON.stringify(resolved, null, 2)}\n`, "utf8");
|
|
84
|
-
return resolved;
|
|
85
|
-
}
|
|
86
|
-
//# sourceMappingURL=registry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/runtime/blockage/registry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC1F,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAIjC,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE3E,SAAS,SAAS,CAAC,IAAY,EAAE,QAAgB;IAC/C,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,GAAG,eAAe,CAAC,QAAQ,C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,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAClD,CAAC;IACF,aAAa,CAAC,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC3F,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Kubernetes sidecar manifest renderer (DEC-058 / Scenario A of DEC-056).
|
|
3
|
-
*
|
|
4
|
-
* Produces a `containers` + `volumes` fragment that can be merged into an
|
|
5
|
-
* existing Pod spec (typically a `remote` session Pod) so the
|
|
6
|
-
* runtime CLI container and an `h2a mcp-serve` sidecar share the same
|
|
7
|
-
* `<root>/.h2a/` directory through an `emptyDir`.
|
|
8
|
-
*
|
|
9
|
-
* Two image modes:
|
|
10
|
-
*
|
|
11
|
-
* - `npm-runtime` (default) — uses a generic `node:22-alpine` image and
|
|
12
|
-
* `npm i -g @sentropic/h2a-cli@<version>` at Pod start. No custom image
|
|
13
|
-
* to build. Trade-off: ~10s install latency on Pod start. Suitable for
|
|
14
|
-
* PoC and demos.
|
|
15
|
-
*
|
|
16
|
-
* - explicit image reference (e.g. `ghcr.io/rhanka/h2a-cli:0.1.20`) — uses
|
|
17
|
-
* the given image which is expected to provide `h2a` on PATH. No install
|
|
18
|
-
* at runtime. Suitable for production once a real image is published.
|
|
19
|
-
*
|
|
20
|
-
* The renderer is pure: no I/O, no filesystem access. The caller decides
|
|
21
|
-
* whether to print the YAML or merge it into an existing manifest.
|
|
22
|
-
*/
|
|
23
|
-
export interface K8sSidecarOptions {
|
|
24
|
-
/**
|
|
25
|
-
* Instance id to declare to h2a at session open. Defaults to a placeholder
|
|
26
|
-
* of `remote:${SESSION_ID}` if running inside the
|
|
27
|
-
* `@sentropic/remote` context — that env var is expected to be
|
|
28
|
-
* injected by the parent control plane.
|
|
29
|
-
*/
|
|
30
|
-
readonly instance?: string;
|
|
31
|
-
/**
|
|
32
|
-
* Host hint passed to `h2a_session_open`. Defaults to "remote".
|
|
33
|
-
*/
|
|
34
|
-
readonly host?: string;
|
|
35
|
-
/**
|
|
36
|
-
* Filesystem path where `<root>/.h2a/` lives inside the session Pod.
|
|
37
|
-
* Default `/workspace/.h2a`, matching `remote`'s PVC mount.
|
|
38
|
-
*/
|
|
39
|
-
readonly root?: string;
|
|
40
|
-
/**
|
|
41
|
-
* Image strategy: `"npm-runtime"` (default) or a concrete OCI image
|
|
42
|
-
* reference (e.g. `"ghcr.io/rhanka/h2a-cli:0.1.20"`).
|
|
43
|
-
*/
|
|
44
|
-
readonly image?: string;
|
|
45
|
-
/**
|
|
46
|
-
* Version pinned for the `npm i -g` line when `image = "npm-runtime"`.
|
|
47
|
-
* Defaults to `latest`. Pin to a known X.Y.Z for reproducible Pods.
|
|
48
|
-
*/
|
|
49
|
-
readonly cliVersion?: string;
|
|
50
|
-
/**
|
|
51
|
-
* Sidecar container name. Default `h2a-mcp`.
|
|
52
|
-
*/
|
|
53
|
-
readonly containerName?: string;
|
|
54
|
-
/**
|
|
55
|
-
* Shared volume name. Default `h2a-workspace`. The caller is responsible
|
|
56
|
-
* for ensuring the main runtime container mounts the same volume at the
|
|
57
|
-
* same path.
|
|
58
|
-
*/
|
|
59
|
-
readonly volumeName?: string;
|
|
60
|
-
/**
|
|
61
|
-
* Resource requests/limits. Conservative defaults aligned with the
|
|
62
|
-
* `sentropic-remote` tenant contract (DEC-056).
|
|
63
|
-
*/
|
|
64
|
-
readonly resources?: {
|
|
65
|
-
readonly requests?: {
|
|
66
|
-
cpu?: string;
|
|
67
|
-
memory?: string;
|
|
68
|
-
};
|
|
69
|
-
readonly limits?: {
|
|
70
|
-
cpu?: string;
|
|
71
|
-
memory?: string;
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
export interface K8sSidecarFragment {
|
|
76
|
-
/** Container spec to append to `spec.containers[]`. */
|
|
77
|
-
readonly container: Record<string, unknown>;
|
|
78
|
-
/** Volume spec to append to `spec.volumes[]`. */
|
|
79
|
-
readonly volume: Record<string, unknown>;
|
|
80
|
-
/** Volume mount the caller must also append to the main runtime container. */
|
|
81
|
-
readonly mainContainerVolumeMount: Record<string, unknown>;
|
|
82
|
-
/** Convenience: the rendered YAML of the full fragment. */
|
|
83
|
-
readonly yaml: string;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Render a sidecar fragment suitable for merging into a `remote`
|
|
87
|
-
* session Pod (or any host Pod that runs an interactive CLI and wants to
|
|
88
|
-
* coordinate via h2a). Returns both the structured pieces (for programmatic
|
|
89
|
-
* merging) and a YAML rendering (for `--print` style CLI use).
|
|
90
|
-
*/
|
|
91
|
-
export declare function renderK8sSidecar(options?: K8sSidecarOptions): K8sSidecarFragment;
|
|
92
|
-
//# sourceMappingURL=k8s-sidecar.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"k8s-sidecar.d.ts","sourceRoot":"","sources":["../../../src/runtime/deploy/k8s-sidecar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,MAAM,WAAW,iBAAiB;IAChC;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE;QACnB,QAAQ,CAAC,QAAQ,CAAC,EAAE;YAAE,GAAG,CAAC,EAAE,MAAM,CAAC;YAAC,MAAM,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QACtD,QAAQ,CAAC,MAAM,CAAC,EAAE;YAAE,GAAG,CAAC,EAAE,MAAM,CAAC;YAAC,MAAM,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;KACrD,CAAC;CACH;AAED,MAAM,WAAW,kBAAkB;IACjC,uDAAuD;IACvD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,iDAAiD;IACjD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,8EAA8E;IAC9E,QAAQ,CAAC,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3D,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AA8GD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,GAAE,iBAAsB,GAC9B,kBAAkB,CA+CpB"}
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Kubernetes sidecar manifest renderer (DEC-058 / Scenario A of DEC-056).
|
|
3
|
-
*
|
|
4
|
-
* Produces a `containers` + `volumes` fragment that can be merged into an
|
|
5
|
-
* existing Pod spec (typically a `remote` session Pod) so the
|
|
6
|
-
* runtime CLI container and an `h2a mcp-serve` sidecar share the same
|
|
7
|
-
* `<root>/.h2a/` directory through an `emptyDir`.
|
|
8
|
-
*
|
|
9
|
-
* Two image modes:
|
|
10
|
-
*
|
|
11
|
-
* - `npm-runtime` (default) — uses a generic `node:22-alpine` image and
|
|
12
|
-
* `npm i -g @sentropic/h2a-cli@<version>` at Pod start. No custom image
|
|
13
|
-
* to build. Trade-off: ~10s install latency on Pod start. Suitable for
|
|
14
|
-
* PoC and demos.
|
|
15
|
-
*
|
|
16
|
-
* - explicit image reference (e.g. `ghcr.io/rhanka/h2a-cli:0.1.20`) — uses
|
|
17
|
-
* the given image which is expected to provide `h2a` on PATH. No install
|
|
18
|
-
* at runtime. Suitable for production once a real image is published.
|
|
19
|
-
*
|
|
20
|
-
* The renderer is pure: no I/O, no filesystem access. The caller decides
|
|
21
|
-
* whether to print the YAML or merge it into an existing manifest.
|
|
22
|
-
*/
|
|
23
|
-
function defaultResources() {
|
|
24
|
-
return {
|
|
25
|
-
requests: { cpu: "50m", memory: "64Mi" },
|
|
26
|
-
limits: { cpu: "200m", memory: "256Mi" }
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
function buildCommand(imageStrategy, cliVersion, root) {
|
|
30
|
-
if (imageStrategy === "npm-runtime") {
|
|
31
|
-
return {
|
|
32
|
-
command: ["sh", "-c"],
|
|
33
|
-
args: [
|
|
34
|
-
[
|
|
35
|
-
"set -euo pipefail",
|
|
36
|
-
`npm i -g @sentropic/h2a-cli@${cliVersion}`,
|
|
37
|
-
`mkdir -p ${root}`,
|
|
38
|
-
`h2a init --root ${root} || true`,
|
|
39
|
-
`exec h2a mcp-serve --root ${root}`
|
|
40
|
-
].join(" && ")
|
|
41
|
-
]
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
// Pre-built image case: assume `h2a` is on PATH.
|
|
45
|
-
return {
|
|
46
|
-
command: ["sh", "-c"],
|
|
47
|
-
args: [
|
|
48
|
-
[
|
|
49
|
-
"set -euo pipefail",
|
|
50
|
-
`mkdir -p ${root}`,
|
|
51
|
-
`h2a init --root ${root} || true`,
|
|
52
|
-
`exec h2a mcp-serve --root ${root}`
|
|
53
|
-
].join(" && ")
|
|
54
|
-
]
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
function renderYamlFragment(container, volume, mount) {
|
|
58
|
-
// A small hand-rolled YAML renderer keeps us dependency-free (no js-yaml).
|
|
59
|
-
// Format is intentionally vertical and indent-stable so a `kubectl apply`
|
|
60
|
-
// diff stays readable.
|
|
61
|
-
const lines = [];
|
|
62
|
-
lines.push("# h2a sidecar fragment — append to your session Pod spec");
|
|
63
|
-
lines.push("# (Scenario A of DEC-056 / DEC-058)");
|
|
64
|
-
lines.push("");
|
|
65
|
-
lines.push("spec:");
|
|
66
|
-
lines.push(" containers:");
|
|
67
|
-
lines.push(` - name: ${container.name}`);
|
|
68
|
-
lines.push(` image: ${container.image}`);
|
|
69
|
-
const cmd = container.command;
|
|
70
|
-
lines.push(` command: ${JSON.stringify(cmd)}`);
|
|
71
|
-
const args = container.args;
|
|
72
|
-
lines.push(` args:`);
|
|
73
|
-
for (const arg of args) {
|
|
74
|
-
lines.push(` - ${JSON.stringify(arg)}`);
|
|
75
|
-
}
|
|
76
|
-
const env = container.env;
|
|
77
|
-
if (env.length > 0) {
|
|
78
|
-
lines.push(" env:");
|
|
79
|
-
for (const e of env) {
|
|
80
|
-
lines.push(` - name: ${e.name}`);
|
|
81
|
-
lines.push(` value: ${JSON.stringify(e.value)}`);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
const mounts = container.volumeMounts;
|
|
85
|
-
lines.push(" volumeMounts:");
|
|
86
|
-
for (const m of mounts) {
|
|
87
|
-
lines.push(` - name: ${m.name}`);
|
|
88
|
-
lines.push(` mountPath: ${m.mountPath}`);
|
|
89
|
-
}
|
|
90
|
-
const res = container.resources;
|
|
91
|
-
if (res) {
|
|
92
|
-
lines.push(" resources:");
|
|
93
|
-
if (res.requests) {
|
|
94
|
-
lines.push(" requests:");
|
|
95
|
-
if (res.requests.cpu)
|
|
96
|
-
lines.push(` cpu: ${res.requests.cpu}`);
|
|
97
|
-
if (res.requests.memory)
|
|
98
|
-
lines.push(` memory: ${res.requests.memory}`);
|
|
99
|
-
}
|
|
100
|
-
if (res.limits) {
|
|
101
|
-
lines.push(" limits:");
|
|
102
|
-
if (res.limits.cpu)
|
|
103
|
-
lines.push(` cpu: ${res.limits.cpu}`);
|
|
104
|
-
if (res.limits.memory)
|
|
105
|
-
lines.push(` memory: ${res.limits.memory}`);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
lines.push("");
|
|
109
|
-
lines.push(" # Also append this volume mount to the runtime CLI container:");
|
|
110
|
-
lines.push(` # - name: ${mount.name}`);
|
|
111
|
-
lines.push(` # mountPath: ${mount.mountPath}`);
|
|
112
|
-
lines.push("");
|
|
113
|
-
lines.push(" volumes:");
|
|
114
|
-
lines.push(` - name: ${volume.name}`);
|
|
115
|
-
lines.push(" emptyDir: {}");
|
|
116
|
-
lines.push("");
|
|
117
|
-
return lines.join("\n");
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Render a sidecar fragment suitable for merging into a `remote`
|
|
121
|
-
* session Pod (or any host Pod that runs an interactive CLI and wants to
|
|
122
|
-
* coordinate via h2a). Returns both the structured pieces (for programmatic
|
|
123
|
-
* merging) and a YAML rendering (for `--print` style CLI use).
|
|
124
|
-
*/
|
|
125
|
-
export function renderK8sSidecar(options = {}) {
|
|
126
|
-
const containerName = options.containerName ?? "h2a-mcp";
|
|
127
|
-
const volumeName = options.volumeName ?? "h2a-workspace";
|
|
128
|
-
const root = options.root ?? "/workspace/.h2a";
|
|
129
|
-
const image = options.image && options.image !== "npm-runtime"
|
|
130
|
-
? options.image
|
|
131
|
-
: "node:22-alpine";
|
|
132
|
-
const imageStrategy = options.image ?? "npm-runtime";
|
|
133
|
-
const cliVersion = options.cliVersion ?? "latest";
|
|
134
|
-
const host = options.host ?? "remote";
|
|
135
|
-
const instance = options.instance ?? "remote:${SESSION_ID:-unknown}";
|
|
136
|
-
const resources = options.resources ?? defaultResources();
|
|
137
|
-
const { command, args } = buildCommand(imageStrategy, cliVersion, root);
|
|
138
|
-
const container = {
|
|
139
|
-
name: containerName,
|
|
140
|
-
image,
|
|
141
|
-
command,
|
|
142
|
-
args,
|
|
143
|
-
env: [
|
|
144
|
-
{ name: "H2A_INSTANCE", value: instance },
|
|
145
|
-
{ name: "H2A_HOST", value: host },
|
|
146
|
-
{ name: "H2A_ROOT", value: root }
|
|
147
|
-
],
|
|
148
|
-
volumeMounts: [{ name: volumeName, mountPath: root }],
|
|
149
|
-
resources
|
|
150
|
-
};
|
|
151
|
-
const volume = {
|
|
152
|
-
name: volumeName,
|
|
153
|
-
emptyDir: {}
|
|
154
|
-
};
|
|
155
|
-
const mainContainerVolumeMount = {
|
|
156
|
-
name: volumeName,
|
|
157
|
-
mountPath: root
|
|
158
|
-
};
|
|
159
|
-
return {
|
|
160
|
-
container,
|
|
161
|
-
volume,
|
|
162
|
-
mainContainerVolumeMount,
|
|
163
|
-
yaml: renderYamlFragment(container, volume, mainContainerVolumeMount)
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
//# sourceMappingURL=k8s-sidecar.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"k8s-sidecar.js","sourceRoot":"","sources":["../../../src/runtime/deploy/k8s-sidecar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AA4DH,SAAS,gBAAgB;IACvB,OAAO;QACL,QAAQ,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE;QACxC,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE;KACzC,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CACnB,aAAqB,EACrB,UAAkB,EAClB,IAAY;IAEZ,IAAI,aAAa,KAAK,aAAa,EAAE,CAAC;QACpC,OAAO;YACL,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;YACrB,IAAI,EAAE;gBACJ;oBACE,mBAAmB;oBACnB,+BAA+B,UAAU,EAAE;oBAC3C,YAAY,IAAI,EAAE;oBAClB,mBAAmB,IAAI,UAAU;oBACjC,6BAA6B,IAAI,EAAE;iBACpC,CAAC,IAA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 -1,86 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Kubernetes cluster-tenant manifest renderer (DEC-067 / Scenario B of DEC-056).
|
|
3
|
-
*
|
|
4
|
-
* Where the sidecar renderer (DEC-058, Scenario A) injects an `h2a mcp-serve`
|
|
5
|
-
* container into someone else's session Pod, the tenant renderer stands h2a up
|
|
6
|
-
* as its own namespaced tenant with a shared **ReadWriteMany** store that
|
|
7
|
-
* multiple Pods — potentially on different nodes — coordinate through. That
|
|
8
|
-
* cross-Pod concurrency is only safe because the Deployment runs the store in
|
|
9
|
-
* lease-lock mode (DEC-065/066) via `H2A_LOCK_MODE=lease`.
|
|
10
|
-
*
|
|
11
|
-
* The output is a complete multi-document manifest (Namespace + ResourceQuota
|
|
12
|
-
* + PVC + Deployment) ready for `kubectl apply -f -`, not a fragment to merge.
|
|
13
|
-
*
|
|
14
|
-
* The renderer is pure: no I/O, no filesystem access. The caller decides
|
|
15
|
-
* whether to print the YAML or write it to disk.
|
|
16
|
-
*/
|
|
17
|
-
export interface K8sTenantOptions {
|
|
18
|
-
/**
|
|
19
|
-
* Kubernetes namespace for the tenant. Default `h2a`. The namespace is
|
|
20
|
-
* created by the manifest (a `Namespace` document is always emitted).
|
|
21
|
-
*/
|
|
22
|
-
readonly namespace?: string;
|
|
23
|
-
/**
|
|
24
|
-
* Image strategy: `"npm-runtime"` (default) installs the CLI from npm onto a
|
|
25
|
-
* generic `node:22-alpine` base at Pod start; any other value is treated as a
|
|
26
|
-
* concrete OCI reference (e.g. `"ghcr.io/rhanka/h2a-cli:0.1.28"`) that
|
|
27
|
-
* already provides `h2a` on PATH.
|
|
28
|
-
*/
|
|
29
|
-
readonly image?: string;
|
|
30
|
-
/**
|
|
31
|
-
* Version pinned for the `npm i -g` line when `image = "npm-runtime"`.
|
|
32
|
-
* Default `latest`. Pin to a known X.Y.Z for reproducible Pods.
|
|
33
|
-
*/
|
|
34
|
-
readonly cliVersion?: string;
|
|
35
|
-
/**
|
|
36
|
-
* Mount path for the shared store inside each Pod. Default `/workspace/.h2a`.
|
|
37
|
-
*/
|
|
38
|
-
readonly root?: string;
|
|
39
|
-
/**
|
|
40
|
-
* Number of coordinating Pods. Default 2 — the smallest replica count that
|
|
41
|
-
* actually exercises cross-Pod locking (the whole point of Scenario B).
|
|
42
|
-
*/
|
|
43
|
-
readonly replicas?: number;
|
|
44
|
-
/**
|
|
45
|
-
* Requested size of the RWX PVC. Default `1Gi`.
|
|
46
|
-
*/
|
|
47
|
-
readonly storage?: string;
|
|
48
|
-
/**
|
|
49
|
-
* `storageClassName` for the PVC. Must back a ReadWriteMany volume. Default
|
|
50
|
-
* unset (cluster default StorageClass); on Scaleway pass e.g. `"scw-bssd"`'s
|
|
51
|
-
* RWX-capable class. Left unset so the manifest stays portable.
|
|
52
|
-
*/
|
|
53
|
-
readonly storageClass?: string;
|
|
54
|
-
/**
|
|
55
|
-
* Lease duration (ms) injected as `H2A_LEASE_MS`. Must exceed the longest
|
|
56
|
-
* critical section plus inter-host clock skew. Default 30000 (DEC-065).
|
|
57
|
-
*/
|
|
58
|
-
readonly leaseMs?: number;
|
|
59
|
-
/**
|
|
60
|
-
* Per-Pod resource requests/limits. Conservative defaults.
|
|
61
|
-
*/
|
|
62
|
-
readonly resources?: {
|
|
63
|
-
readonly requests?: {
|
|
64
|
-
cpu?: string;
|
|
65
|
-
memory?: string;
|
|
66
|
-
};
|
|
67
|
-
readonly limits?: {
|
|
68
|
-
cpu?: string;
|
|
69
|
-
memory?: string;
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
export interface K8sTenantManifest {
|
|
74
|
-
/** Structured documents in apply order (for programmatic consumers). */
|
|
75
|
-
readonly documents: ReadonlyArray<Record<string, unknown>>;
|
|
76
|
-
/** Convenience: the rendered multi-document YAML. */
|
|
77
|
-
readonly yaml: string;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Render a complete cluster-tenant manifest for Scenario B of DEC-056: a
|
|
81
|
-
* namespaced h2a Deployment backed by a shared ReadWriteMany store whose
|
|
82
|
-
* cross-Pod concurrency is made safe by the lease lock (DEC-065/066), turned
|
|
83
|
-
* on through the `H2A_LOCK_MODE=lease` env the Deployment injects.
|
|
84
|
-
*/
|
|
85
|
-
export declare function renderK8sTenant(options?: K8sTenantOptions): K8sTenantManifest;
|
|
86
|
-
//# sourceMappingURL=k8s-tenant.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"k8s-tenant.d.ts","sourceRoot":"","sources":["../../../src/runtime/deploy/k8s-tenant.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE;QACnB,QAAQ,CAAC,QAAQ,CAAC,EAAE;YAAE,GAAG,CAAC,EAAE,MAAM,CAAC;YAAC,MAAM,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QACtD,QAAQ,CAAC,MAAM,CAAC,EAAE;YAAE,GAAG,CAAC,EAAE,MAAM,CAAC;YAAC,MAAM,CAAC,EAAE,MAAM,CAAA;SAAE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