open-multi-agent-kit 1.2.2 → 1.2.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 +22 -0
- package/README.md +2 -2
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +2 -0
- package/dist/cli/help.js.map +1 -1
- package/dist/commands/doctor-provider.d.ts.map +1 -1
- package/dist/commands/doctor-provider.js +2 -13
- package/dist/commands/doctor-provider.js.map +1 -1
- package/dist/commands/provider-adopt-cli.d.ts +24 -0
- package/dist/commands/provider-adopt-cli.d.ts.map +1 -0
- package/dist/commands/provider-adopt-cli.js +182 -0
- package/dist/commands/provider-adopt-cli.js.map +1 -0
- package/dist/commands/provider-adopt-status.d.ts +21 -0
- package/dist/commands/provider-adopt-status.d.ts.map +1 -0
- package/dist/commands/provider-adopt-status.js +84 -0
- package/dist/commands/provider-adopt-status.js.map +1 -0
- package/dist/commands/provider-known-apis.d.ts +2 -0
- package/dist/commands/provider-known-apis.d.ts.map +1 -0
- package/dist/commands/provider-known-apis.js +28 -0
- package/dist/commands/provider-known-apis.js.map +1 -0
- package/dist/commands/run-command.d.ts.map +1 -1
- package/dist/commands/run-command.js +4 -0
- package/dist/commands/run-command.js.map +1 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +6 -0
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts +16 -16
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +94 -111
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +13 -10
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/inert-tail.d.ts +23 -0
- package/dist/core/compaction/inert-tail.d.ts.map +1 -0
- package/dist/core/compaction/inert-tail.js +108 -0
- package/dist/core/compaction/inert-tail.js.map +1 -0
- package/dist/core/compaction/provenance.d.ts +30 -0
- package/dist/core/compaction/provenance.d.ts.map +1 -0
- package/dist/core/compaction/provenance.js +59 -0
- package/dist/core/compaction/provenance.js.map +1 -0
- package/dist/core/compaction/transaction.d.ts.map +1 -1
- package/dist/core/compaction/transaction.js +4 -1
- package/dist/core/compaction/transaction.js.map +1 -1
- package/dist/core/external-credential-sources.d.ts +48 -0
- package/dist/core/external-credential-sources.d.ts.map +1 -0
- package/dist/core/external-credential-sources.js +176 -0
- package/dist/core/external-credential-sources.js.map +1 -0
- package/dist/core/model-registry.d.ts +11 -0
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +28 -14
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/oauth-account-import.d.ts +52 -0
- package/dist/core/oauth-account-import.d.ts.map +1 -0
- package/dist/core/oauth-account-import.js +125 -0
- package/dist/core/oauth-account-import.js.map +1 -0
- package/dist/core/oauth-credential.d.ts +22 -0
- package/dist/core/oauth-credential.d.ts.map +1 -0
- package/dist/core/oauth-credential.js +36 -0
- package/dist/core/oauth-credential.js.map +1 -0
- package/dist/core/session-compaction-service.d.ts +2 -2
- package/dist/core/session-compaction-service.d.ts.map +1 -1
- package/dist/core/session-compaction-service.js +20 -57
- package/dist/core/session-compaction-service.js.map +1 -1
- package/dist/core/verified-run/owned-execution.d.ts.map +1 -1
- package/dist/core/verified-run/owned-execution.js +13 -1
- package/dist/core/verified-run/owned-execution.js.map +1 -1
- package/dist/core/verified-run/supervisor-adapter.d.ts +4 -0
- package/dist/core/verified-run/supervisor-adapter.d.ts.map +1 -1
- package/dist/core/verified-run/supervisor-adapter.js +4 -0
- package/dist/core/verified-run/supervisor-adapter.js.map +1 -1
- package/docs/compaction.md +2 -0
- package/docs/extensions.md +1 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +18 -18
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supervisor-adapter.js","sourceRoot":"","sources":["../../../src/core/verified-run/supervisor-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAA0B,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;AAElD,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACrC,eAAe;IACf,mBAAmB;IACnB,eAAe;IACf,YAAY;IACZ,KAAK;IACL,YAAY;IACZ,WAAW;IACX,MAAM;IACN,MAAM;IACN,WAAW;IACX,SAAS;IACT,MAAM;IACN,WAAW;IACX,SAAS;IACT,MAAM;IACN,WAAW;IACX,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,OAAO;IACP,MAAM;IACN,SAAS;IACT,MAAM;IACN,UAAU;IACV,MAAM;IACN,eAAe;IACf,UAAU;IACV,MAAM;IACN,SAAS;CACA,CAAC;AAIX;;;GAGG;AACH,MAAM,UAAU,qBAAqB,GAAkE;IACtG,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC;QACjE,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SAAS,CAAC;QACxC,IAAI,WAAW,CAAC,GAAG,EAAE,IAAI,QAAQ;YAAE,OAAO,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC;QACvF,MAAM,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;IACtE,CAAC;AAAA,CACD","sourcesContent":["import { existsSync, readdirSync, readFileSync, readlinkSync, statSync } from \"node:fs\";\nimport { performance } from \"node:perf_hooks\";\nimport { setTimeout as delay } from \"node:timers/promises\";\nimport { type NamespaceIdentity, probeNamespace } from \"./namespace-identity.ts\";\nimport { VerifiedRunError } from \"./storage.ts\";\n\n/**\n * Owned-process supervisor boundary (WP02).\n *\n * Three concerns are separated here so the broker only orchestrates them:\n *\n * - spawn: `SUPERVISOR_SYSTEM_ARGS` + `loadSupervisorBackend` describe the only\n * backend this package trusts — bubblewrap with `--unshare-all`, which puts\n * the supervised command in a fresh PID namespace whose init is the only\n * process the host can see. A platform without that backend has no way to\n * prove termination, so callers must refuse with `unsupported_boundary`\n * instead of degrading to best-effort signaling.\n * - cancel: `escalateTermination` sends SIGKILL to the supervised direct\n * child (the bwrap supervisor). `--die-with-parent` propagates death to the\n * namespace init, and the kernel then SIGKILLs every remaining task in that\n * namespace — including non-cooperative workers and detached (`setsid`)\n * descendants. Signal delivery is never treated as termination.\n * - termination witness: `probeNamespace` detects the recorded namespace\n * init's death and `awaitBoundaryDrained` waits for it. When a PID\n * namespace's init exits, the kernel SIGKILLs every remaining task in that\n * namespace, so init death is the exact termination witness — a `close`\n * event, a resolved promise, or a dead direct child with surviving\n * descendants is not. `namespaceMemberPids` remains as a diagnostic\n * enumeration only: host process-table scans are environment-dependent\n * (zombies keep their ns link until reaped; foreign same-uid tasks can be\n * unreadable) and have poisoned drains on kernels where either occurs.\n */\nexport const SUPERVISOR_BINARY = \"/usr/bin/bwrap\";\n\nexport const SUPERVISOR_SYSTEM_ARGS = [\n\t\"--unshare-all\",\n\t\"--die-with-parent\",\n\t\"--new-session\",\n\t\"--cap-drop\",\n\t\"ALL\",\n\t\"--clearenv\",\n\t\"--ro-bind\",\n\t\"/usr\",\n\t\"/usr\",\n\t\"--symlink\",\n\t\"usr/bin\",\n\t\"/bin\",\n\t\"--symlink\",\n\t\"usr/lib\",\n\t\"/lib\",\n\t\"--symlink\",\n\t\"usr/lib64\",\n\t\"/lib64\",\n\t\"--proc\",\n\t\"/proc\",\n\t\"--dev\",\n\t\"/dev\",\n\t\"--tmpfs\",\n\t\"/tmp\",\n\t\"--setenv\",\n\t\"PATH\",\n\t\"/usr/bin:/bin\",\n\t\"--setenv\",\n\t\"LANG\",\n\t\"C.UTF-8\",\n] as const;\n\nexport type SupervisorChild = { readonly kill: (signal: NodeJS.Signals) => boolean };\n\n/**\n * The only termination guarantee this package honors: a private PID namespace\n * plus the Linux bwrap supervisor. Anything else is refused at the boundary.\n */\nexport function loadSupervisorBackend(): { readonly binary: string; readonly args: readonly string[] } {\n\tif (process.platform !== \"linux\" || !existsSync(SUPERVISOR_BINARY))\n\t\tthrow new VerifiedRunError(\"unsupported_boundary\");\n\treturn { binary: SUPERVISOR_BINARY, args: SUPERVISOR_SYSTEM_ARGS };\n}\n\n/**\n * SIGKILL escalation to the supervised direct child. `--die-with-parent` makes\n * the kernel kill the whole PID namespace once this supervisor dies, so no\n * per-descendant signaling (which PID reuse would make unsafe) is needed.\n */\nexport function escalateTermination(child: SupervisorChild): void {\n\tchild.kill(\"SIGKILL\");\n}\n\n/**\n * Enumerate host PIDs of every task still inside `identity.namespace`.\n *\n * Membership is keyed on the recorded namespace symlink, not on the init's\n * PID: a fabricated or reaped direct child cannot mask surviving descendants.\n *\n * A task whose namespace link cannot be read is only a candidate member when\n * it could belong to the recorded boundary at all. The backend's members\n * always run under our real uid — the pid namespace is owned by a user\n * namespace we created and `CAP_SETUID` is dropped — so a task owned by\n * another uid, or one that vanished mid-scan, cannot be a member and is\n * skipped. An unreadable task owned by our uid is conservatively counted:\n * failing to prove emptiness must fail closed.\n */\nexport function namespaceMemberPids(identity: Pick<NamespaceIdentity, \"namespace\">): number[] {\n\tconst members: number[] = [];\n\t// A platform without getuid cannot exclude foreign-owned tasks, so every\n\t// unreadable entry stays a candidate member (fail closed).\n\tconst uid = typeof process.getuid === \"function\" ? process.getuid() : undefined;\n\tfor (const entry of readdirSync(\"/proc\")) {\n\t\tif (!/^\\d+$/.test(entry)) continue;\n\t\ttry {\n\t\t\tif (readlinkSync(`/proc/${entry}/ns/pid`) !== identity.namespace) continue;\n\t\t\t// A zombie still carries the namespace link until reaped, but it\n\t\t\t// cannot run: counting it as a member confuses teardown with\n\t\t\t// survival.\n\t\t\tconst stat = readFileSync(`/proc/${entry}/stat`, \"utf8\");\n\t\t\tconst state = stat\n\t\t\t\t.slice(stat.lastIndexOf(\")\") + 2)\n\t\t\t\t.trim()\n\t\t\t\t.split(/\\s+/)[0];\n\t\t\tif (state !== \"Z\" && state !== \"X\") members.push(Number(entry));\n\t\t} catch (error) {\n\t\t\tif (!(error instanceof Error && \"code\" in error)) continue;\n\t\t\tif (error.code === \"ENOENT\" || error.code === \"ESRCH\") continue;\n\t\t\ttry {\n\t\t\t\tif (uid === undefined || statSync(`/proc/${entry}`).uid === uid) members.push(Number(entry));\n\t\t\t} catch (statError) {\n\t\t\t\tif (\n\t\t\t\t\t!(statError instanceof Error && \"code\" in statError) ||\n\t\t\t\t\t(statError.code !== \"ENOENT\" && statError.code !== \"ESRCH\")\n\t\t\t\t)\n\t\t\t\t\tmembers.push(Number(entry));\n\t\t\t}\n\t\t}\n\t}\n\treturn members;\n}\n\n/** Init death terminates the whole namespace; a zombie init already proves teardown finished. */\nexport function probeOwnedNamespace(identity: NamespaceIdentity): \"terminated\" | \"alive\" | \"unknown\" {\n\tconst status = probeNamespace(identity);\n\treturn status === \"gone\" ? \"terminated\" : status;\n}\n\n/**\n * Wait for the namespace init's death within budgetMs. Init death is the\n * termination witness: the kernel SIGKILLs every remaining task in the PID\n * namespace when its init exits, so a drained namespace needs no process-table\n * enumeration. `populated`/`unknown` never release claims.\n *\n * `unknown` is not terminal here: teardown has a transient window where the\n * init's stat is readable but its ns link read is denied or the identity\n * probe is inconclusive, and that window resolves to `gone` once the kernel\n * finishes teardown. Only a probe that is still inconclusive at the deadline\n * stays `unknown`; a still-alive init is `populated`.\n */\nexport async function awaitBoundaryDrained(\n\tidentity: NamespaceIdentity,\n\tbudgetMs: number,\n): Promise<\"drained\" | \"populated\" | \"unknown\"> {\n\tconst deadline = performance.now() + Math.max(0, budgetMs);\n\tfor (;;) {\n\t\tconst status = probeNamespace(identity);\n\t\tif (status === \"gone\") return \"drained\";\n\t\tif (performance.now() >= deadline) return status === \"alive\" ? \"populated\" : \"unknown\";\n\t\tawait delay(Math.min(10, Math.max(1, deadline - performance.now())));\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"supervisor-adapter.js","sourceRoot":"","sources":["../../../src/core/verified-run/supervisor-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAA0B,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;AAElD,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACrC,eAAe;IACf,mBAAmB;IACnB,eAAe;IACf,YAAY;IACZ,KAAK;IACL,YAAY;IACZ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AAM,KAAK,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC;AAAA,CACjD;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACzC,QAA2B,EAC3B,QAAgB,EAC+B;IAC/C,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;IAC3D,SAAS,CAAC;QACT,MAAM,MAAM,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;QACxC,IAAI,MAAM,KAAK,MAAM;YAAE,OAAO,SAAS,CAAC;QACxC,IAAI,WAAW,CAAC,GAAG,EAAE,IAAI,QAAQ;YAAE,OAAO,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC;QACvF,MAAM,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;IACtE,CAAC;AAAA,CACD","sourcesContent":["import { existsSync, readdirSync, readFileSync, readlinkSync, statSync } from \"node:fs\";\nimport { performance } from \"node:perf_hooks\";\nimport { setTimeout as delay } from \"node:timers/promises\";\nimport { type NamespaceIdentity, probeNamespace } from \"./namespace-identity.ts\";\nimport { VerifiedRunError } from \"./storage.ts\";\n\n/**\n * Owned-process supervisor boundary (WP02).\n *\n * Three concerns are separated here so the broker only orchestrates them:\n *\n * - spawn: `SUPERVISOR_SYSTEM_ARGS` + `loadSupervisorBackend` describe the only\n * backend this package trusts — bubblewrap with `--unshare-all`, which puts\n * the supervised command in a fresh PID namespace whose init is the only\n * process the host can see. A platform without that backend has no way to\n * prove termination, so callers must refuse with `unsupported_boundary`\n * instead of degrading to best-effort signaling.\n * - cancel: `escalateTermination` sends SIGKILL to the supervised direct\n * child (the bwrap supervisor). `--die-with-parent` propagates death to the\n * namespace init, and the kernel then SIGKILLs every remaining task in that\n * namespace — including non-cooperative workers and detached (`setsid`)\n * descendants. Signal delivery is never treated as termination.\n * - termination witness: `probeNamespace` detects the recorded namespace\n * init's death and `awaitBoundaryDrained` waits for it. When a PID\n * namespace's init exits, the kernel SIGKILLs every remaining task in that\n * namespace, so init death is the exact termination witness — a `close`\n * event, a resolved promise, or a dead direct child with surviving\n * descendants is not. `namespaceMemberPids` remains as a diagnostic\n * enumeration only: host process-table scans are environment-dependent\n * (zombies keep their ns link until reaped; foreign same-uid tasks can be\n * unreadable) and have poisoned drains on kernels where either occurs.\n */\nexport const SUPERVISOR_BINARY = \"/usr/bin/bwrap\";\n\nexport const SUPERVISOR_SYSTEM_ARGS = [\n\t\"--unshare-all\",\n\t\"--die-with-parent\",\n\t\"--new-session\",\n\t\"--cap-drop\",\n\t\"ALL\",\n\t\"--clearenv\",\n\t\"--ro-bind\",\n\t\"/usr\",\n\t\"/usr\",\n\t\"--symlink\",\n\t\"usr/bin\",\n\t\"/bin\",\n\t\"--symlink\",\n\t\"usr/lib\",\n\t\"/lib\",\n\t\"--symlink\",\n\t\"usr/lib64\",\n\t\"/lib64\",\n\t\"--proc\",\n\t\"/proc\",\n\t\"--dev\",\n\t\"/dev\",\n\t\"--tmpfs\",\n\t\"/tmp\",\n\t\"--setenv\",\n\t\"PATH\",\n\t\"/usr/bin:/bin\",\n\t\"--setenv\",\n\t\"LANG\",\n\t\"C.UTF-8\",\n] as const;\n\nexport type SupervisorChild = { readonly kill: (signal: NodeJS.Signals) => boolean };\n\n/**\n * The only termination guarantee this package honors: a private PID namespace\n * plus the Linux bwrap supervisor. Anything else is refused at the boundary.\n */\nexport function loadSupervisorBackend(): { readonly binary: string; readonly args: readonly string[] } {\n\tif (process.platform !== \"linux\" || !existsSync(SUPERVISOR_BINARY))\n\t\tthrow new VerifiedRunError(\"unsupported_boundary\");\n\treturn { binary: SUPERVISOR_BINARY, args: SUPERVISOR_SYSTEM_ARGS };\n}\n\n/**\n * SIGKILL escalation to the supervised direct child. `--die-with-parent` makes\n * the kernel kill the whole PID namespace once this supervisor dies, so no\n * per-descendant signaling (which PID reuse would make unsafe) is needed.\n */\nexport function escalateTermination(child: SupervisorChild): void {\n\tchild.kill(\"SIGKILL\");\n}\n\n/**\n * Enumerate host PIDs of every task still inside `identity.namespace`.\n *\n * Membership is keyed on the recorded namespace symlink, not on the init's\n * PID: a fabricated or reaped direct child cannot mask surviving descendants.\n *\n * A task whose namespace link cannot be read is only a candidate member when\n * it could belong to the recorded boundary at all. The backend's members\n * always run under our real uid — the pid namespace is owned by a user\n * namespace we created and `CAP_SETUID` is dropped — so a task owned by\n * another uid, or one that vanished mid-scan, cannot be a member and is\n * skipped. An unreadable task owned by our uid is conservatively counted:\n * failing to prove emptiness must fail closed.\n */\nexport function namespaceMemberPids(identity: Pick<NamespaceIdentity, \"namespace\">): number[] {\n\tconst members: number[] = [];\n\t// A platform without getuid cannot exclude foreign-owned tasks, so every\n\t// unreadable entry stays a candidate member (fail closed).\n\tconst uid = typeof process.getuid === \"function\" ? process.getuid() : undefined;\n\tfor (const entry of readdirSync(\"/proc\")) {\n\t\tif (!/^\\d+$/.test(entry)) continue;\n\t\ttry {\n\t\t\tif (readlinkSync(`/proc/${entry}/ns/pid`) !== identity.namespace) continue;\n\t\t\t// A zombie still carries the namespace link until reaped, but it\n\t\t\t// cannot run: counting it as a member confuses teardown with\n\t\t\t// survival.\n\t\t\tconst stat = readFileSync(`/proc/${entry}/stat`, \"utf8\");\n\t\t\tconst state = stat\n\t\t\t\t.slice(stat.lastIndexOf(\")\") + 2)\n\t\t\t\t.trim()\n\t\t\t\t.split(/\\s+/)[0];\n\t\t\tif (state !== \"Z\" && state !== \"X\") members.push(Number(entry));\n\t\t} catch (error) {\n\t\t\tif (!(error instanceof Error && \"code\" in error)) continue;\n\t\t\tif (error.code === \"ENOENT\" || error.code === \"ESRCH\") continue;\n\t\t\ttry {\n\t\t\t\tif (uid === undefined || statSync(`/proc/${entry}`).uid === uid) members.push(Number(entry));\n\t\t\t} catch (statError) {\n\t\t\t\tif (\n\t\t\t\t\t!(statError instanceof Error && \"code\" in statError) ||\n\t\t\t\t\t(statError.code !== \"ENOENT\" && statError.code !== \"ESRCH\")\n\t\t\t\t)\n\t\t\t\t\tmembers.push(Number(entry));\n\t\t\t}\n\t\t}\n\t}\n\treturn members;\n}\n\n/** Init death terminates the whole namespace; a zombie init already proves teardown finished. */\nexport function probeOwnedNamespace(identity: NamespaceIdentity): \"terminated\" | \"alive\" | \"unknown\" {\n\tconst status = probeNamespace(identity);\n\treturn status === \"gone\" ? \"terminated\" : status;\n}\n\n/**\n * Wait for the namespace init's death within budgetMs. Init death is the\n * termination witness: the kernel SIGKILLs every remaining task in the PID\n * namespace when its init exits, so a drained namespace needs no process-table\n * enumeration. `populated`/`unknown` never release claims.\n *\n * `unknown` is not terminal here: teardown has a transient window where the\n * init's stat is readable but its ns link read is denied or the identity\n * probe is inconclusive, and that window resolves to `gone` once the kernel\n * finishes teardown. Only a probe that is still inconclusive at the deadline\n * stays `unknown`; a still-alive init is `populated`.\n *\n * `drained` means the kernel has provably killed every member; a task frozen\n * in uninterruptible kernel sleep can linger in /proc briefly afterwards —\n * that is kernel bookkeeping, not a live boundary.\n */\nexport async function awaitBoundaryDrained(\n\tidentity: NamespaceIdentity,\n\tbudgetMs: number,\n): Promise<\"drained\" | \"populated\" | \"unknown\"> {\n\tconst deadline = performance.now() + Math.max(0, budgetMs);\n\tfor (;;) {\n\t\tconst status = probeNamespace(identity);\n\t\tif (status === \"gone\") return \"drained\";\n\t\tif (performance.now() >= deadline) return status === \"alive\" ? \"populated\" : \"unknown\";\n\t\tawait delay(Math.min(10, Math.max(1, deadline - performance.now())));\n\t}\n}\n"]}
|
package/docs/compaction.md
CHANGED
|
@@ -132,6 +132,8 @@ This fallback still must pass the normal compaction transaction checks.
|
|
|
132
132
|
5. **Sanitize and append**: Deterministically redact sensitive values, then save the `CompactionEntry` with its summary, preserved-rule details, and `firstKeptEntryId`. Exact `[REDACTED]` assignment placeholders are valid; appended data and unredacted credential-shaped literals remain rejected.
|
|
133
133
|
6. **Reload**: Session reloads, using summary + messages from `firstKeptEntryId` onwards.
|
|
134
134
|
|
|
135
|
+
The summary is committed only if the session still matches what was summarized. Extension state appended with `appendEntry` while the built-in summary is generated does not count as a change, because the summarizer never reads it; the compaction entry is then appended after those entries. A summary returned by a `session_before_compact` handler gets no such allowance, since the extension may have read its own state. A new message, model change, provenance entry, rewritten file or branch move does count: the summary is discarded with `Session changed during compaction (revision_mismatch)`. This check is the same for every model.
|
|
136
|
+
|
|
135
137
|
```
|
|
136
138
|
Before compaction:
|
|
137
139
|
|
package/docs/extensions.md
CHANGED
|
@@ -1380,7 +1380,7 @@ See [send-user-message.ts](../examples/extensions/send-user-message.ts) for a co
|
|
|
1380
1380
|
|
|
1381
1381
|
### omk.appendEntry(customType, data?)
|
|
1382
1382
|
|
|
1383
|
-
Persist extension state (does NOT participate in LLM context).
|
|
1383
|
+
Persist extension state (does NOT participate in LLM context). Appending while a compaction is summarizing does not discard that compaction; see [Compaction](compaction.md#how-it-works).
|
|
1384
1384
|
|
|
1385
1385
|
```typescript
|
|
1386
1386
|
omk.appendEntry("my-state", { count: 42 });
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omk-extension-custom-provider-anthropic",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "omk-extension-custom-provider-anthropic",
|
|
9
|
-
"version": "1.2.
|
|
9
|
+
"version": "1.2.4",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "0.52.0"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omk-extension-gondolin",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "omk-extension-gondolin",
|
|
9
|
-
"version": "1.2.
|
|
9
|
+
"version": "1.2.4",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@earendil-works/gondolin": "0.12.0"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omk-extension-sandbox",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "omk-extension-sandbox",
|
|
9
|
-
"version": "1.2.
|
|
9
|
+
"version": "1.2.4",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sandbox-runtime": "0.0.26"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omk-extension-with-deps",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "omk-extension-with-deps",
|
|
9
|
-
"version": "1.2.
|
|
9
|
+
"version": "1.2.4",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"ms": "2.1.3"
|
|
12
12
|
},
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "open-multi-agent-kit",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "open-multi-agent-kit",
|
|
9
|
-
"version": "1.2.
|
|
9
|
+
"version": "1.2.4",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"omk-agent-core": "^1.2.
|
|
13
|
-
"omk-ai": "^1.2.
|
|
14
|
-
"omk-tui": "^1.2.
|
|
12
|
+
"omk-agent-core": "^1.2.4",
|
|
13
|
+
"omk-ai": "^1.2.4",
|
|
14
|
+
"omk-tui": "^1.2.4",
|
|
15
15
|
"@silvia-odwyer/photon-node": "0.3.4",
|
|
16
16
|
"canonicalize": "4.0.0",
|
|
17
17
|
"chalk": "5.6.2",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"typebox": "1.3.11",
|
|
28
28
|
"undici": "8.10.0",
|
|
29
29
|
"yaml": "2.9.0",
|
|
30
|
-
"omk-adaptorch-wpl": "^1.2.
|
|
31
|
-
"omk-protocol": "^1.2.
|
|
30
|
+
"omk-adaptorch-wpl": "^1.2.4",
|
|
31
|
+
"omk-protocol": "^1.2.4"
|
|
32
32
|
},
|
|
33
33
|
"optionalDependencies": {
|
|
34
34
|
"@mariozechner/clipboard": "0.3.9"
|
|
@@ -1285,19 +1285,19 @@
|
|
|
1285
1285
|
}
|
|
1286
1286
|
},
|
|
1287
1287
|
"node_modules/omk-adaptorch-wpl": {
|
|
1288
|
-
"version": "1.2.
|
|
1289
|
-
"resolved": "https://registry.npmjs.org/omk-adaptorch-wpl/-/omk-adaptorch-wpl-1.2.
|
|
1288
|
+
"version": "1.2.4",
|
|
1289
|
+
"resolved": "https://registry.npmjs.org/omk-adaptorch-wpl/-/omk-adaptorch-wpl-1.2.4.tgz",
|
|
1290
1290
|
"license": "MIT",
|
|
1291
1291
|
"engines": {
|
|
1292
1292
|
"node": ">=22.19.0"
|
|
1293
1293
|
}
|
|
1294
1294
|
},
|
|
1295
1295
|
"node_modules/omk-agent-core": {
|
|
1296
|
-
"version": "1.2.
|
|
1297
|
-
"resolved": "https://registry.npmjs.org/omk-agent-core/-/omk-agent-core-1.2.
|
|
1296
|
+
"version": "1.2.4",
|
|
1297
|
+
"resolved": "https://registry.npmjs.org/omk-agent-core/-/omk-agent-core-1.2.4.tgz",
|
|
1298
1298
|
"license": "MIT",
|
|
1299
1299
|
"dependencies": {
|
|
1300
|
-
"omk-ai": "^1.2.
|
|
1300
|
+
"omk-ai": "^1.2.4",
|
|
1301
1301
|
"ignore": "7.0.6",
|
|
1302
1302
|
"typebox": "1.3.11",
|
|
1303
1303
|
"yaml": "2.9.0"
|
|
@@ -1307,8 +1307,8 @@
|
|
|
1307
1307
|
}
|
|
1308
1308
|
},
|
|
1309
1309
|
"node_modules/omk-ai": {
|
|
1310
|
-
"version": "1.2.
|
|
1311
|
-
"resolved": "https://registry.npmjs.org/omk-ai/-/omk-ai-1.2.
|
|
1310
|
+
"version": "1.2.4",
|
|
1311
|
+
"resolved": "https://registry.npmjs.org/omk-ai/-/omk-ai-1.2.4.tgz",
|
|
1312
1312
|
"license": "MIT",
|
|
1313
1313
|
"dependencies": {
|
|
1314
1314
|
"@anthropic-ai/sdk": "0.91.1",
|
|
@@ -1330,16 +1330,16 @@
|
|
|
1330
1330
|
}
|
|
1331
1331
|
},
|
|
1332
1332
|
"node_modules/omk-protocol": {
|
|
1333
|
-
"version": "1.2.
|
|
1334
|
-
"resolved": "https://registry.npmjs.org/omk-protocol/-/omk-protocol-1.2.
|
|
1333
|
+
"version": "1.2.4",
|
|
1334
|
+
"resolved": "https://registry.npmjs.org/omk-protocol/-/omk-protocol-1.2.4.tgz",
|
|
1335
1335
|
"license": "MIT",
|
|
1336
1336
|
"engines": {
|
|
1337
1337
|
"node": ">=22.19.0"
|
|
1338
1338
|
}
|
|
1339
1339
|
},
|
|
1340
1340
|
"node_modules/omk-tui": {
|
|
1341
|
-
"version": "1.2.
|
|
1342
|
-
"resolved": "https://registry.npmjs.org/omk-tui/-/omk-tui-1.2.
|
|
1341
|
+
"version": "1.2.4",
|
|
1342
|
+
"resolved": "https://registry.npmjs.org/omk-tui/-/omk-tui-1.2.4.tgz",
|
|
1343
1343
|
"license": "MIT",
|
|
1344
1344
|
"dependencies": {
|
|
1345
1345
|
"get-east-asian-width": "1.6.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "open-multi-agent-kit",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"description": "OMK (Open Multi-Agent Kit) coding agent CLI with read, bash, edit, write tools and session management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"omkConfig": {
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"link-workspace-deps": "node ./scripts/link-workspace-deps.mjs"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"omk-agent-core": "^1.2.
|
|
47
|
-
"omk-ai": "^1.2.
|
|
48
|
-
"omk-tui": "^1.2.
|
|
46
|
+
"omk-agent-core": "^1.2.4",
|
|
47
|
+
"omk-ai": "^1.2.4",
|
|
48
|
+
"omk-tui": "^1.2.4",
|
|
49
49
|
"@silvia-odwyer/photon-node": "0.3.4",
|
|
50
50
|
"canonicalize": "4.0.0",
|
|
51
51
|
"chalk": "5.6.2",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"typebox": "1.3.11",
|
|
62
62
|
"undici": "8.10.0",
|
|
63
63
|
"yaml": "2.9.0",
|
|
64
|
-
"omk-adaptorch-wpl": "^1.2.
|
|
65
|
-
"omk-protocol": "^1.2.
|
|
64
|
+
"omk-adaptorch-wpl": "^1.2.4",
|
|
65
|
+
"omk-protocol": "^1.2.4"
|
|
66
66
|
},
|
|
67
67
|
"overrides": {
|
|
68
68
|
"rimraf": "6.1.2",
|