open-multi-agent-kit 0.90.8 → 0.91.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +41 -0
- package/README.md +21 -2
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +4 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/commands/doctor-provider-cli.d.ts +33 -0
- package/dist/commands/doctor-provider-cli.d.ts.map +1 -0
- package/dist/commands/doctor-provider-cli.js +215 -0
- package/dist/commands/doctor-provider-cli.js.map +1 -0
- package/dist/commands/doctor-provider-transport.d.ts +35 -0
- package/dist/commands/doctor-provider-transport.d.ts.map +1 -0
- package/dist/commands/doctor-provider-transport.js +185 -0
- package/dist/commands/doctor-provider-transport.js.map +1 -0
- package/dist/commands/doctor-provider.d.ts +121 -7
- package/dist/commands/doctor-provider.d.ts.map +1 -1
- package/dist/commands/doctor-provider.js +1295 -102
- package/dist/commands/doctor-provider.js.map +1 -1
- package/dist/commands/session-doctor-cli.d.ts +43 -0
- package/dist/commands/session-doctor-cli.d.ts.map +1 -0
- package/dist/commands/session-doctor-cli.js +494 -0
- package/dist/commands/session-doctor-cli.js.map +1 -0
- package/dist/commands/verify-ci.d.ts +21 -0
- package/dist/commands/verify-ci.d.ts.map +1 -0
- package/dist/commands/verify-ci.js +66 -0
- package/dist/commands/verify-ci.js.map +1 -0
- package/dist/core/agent-session-services.d.ts +3 -0
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +3 -0
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +140 -2
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +1179 -95
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/agent-tool-settings.d.ts +35 -0
- package/dist/core/agent-tool-settings.d.ts.map +1 -0
- package/dist/core/agent-tool-settings.js +155 -0
- package/dist/core/agent-tool-settings.js.map +1 -0
- package/dist/core/atomic-session-file.d.ts +14 -0
- package/dist/core/atomic-session-file.d.ts.map +1 -0
- package/dist/core/atomic-session-file.js +104 -0
- package/dist/core/atomic-session-file.js.map +1 -0
- package/dist/core/command-safety.d.ts.map +1 -1
- package/dist/core/command-safety.js +0 -8
- package/dist/core/command-safety.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +6 -0
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +12 -1
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/hysteresis.d.ts +27 -0
- package/dist/core/compaction/hysteresis.d.ts.map +1 -0
- package/dist/core/compaction/hysteresis.js +84 -0
- package/dist/core/compaction/hysteresis.js.map +1 -0
- package/dist/core/compaction/index.d.ts +2 -0
- package/dist/core/compaction/index.d.ts.map +1 -1
- package/dist/core/compaction/index.js +2 -0
- package/dist/core/compaction/index.js.map +1 -1
- package/dist/core/compaction/transaction.d.ts +172 -0
- package/dist/core/compaction/transaction.d.ts.map +1 -0
- package/dist/core/compaction/transaction.js +824 -0
- package/dist/core/compaction/transaction.js.map +1 -0
- package/dist/core/context-budget-governor-v2.d.ts +2 -1
- package/dist/core/context-budget-governor-v2.d.ts.map +1 -1
- package/dist/core/context-budget-governor-v2.js +2 -1
- package/dist/core/context-budget-governor-v2.js.map +1 -1
- package/dist/core/context-budget-reserved-tokens.d.ts +110 -0
- package/dist/core/context-budget-reserved-tokens.d.ts.map +1 -0
- package/dist/core/context-budget-reserved-tokens.js +188 -0
- package/dist/core/context-budget-reserved-tokens.js.map +1 -0
- package/dist/core/context-budget-v2-cache-invalidation.d.ts +133 -0
- package/dist/core/context-budget-v2-cache-invalidation.d.ts.map +1 -0
- package/dist/core/context-budget-v2-cache-invalidation.js +452 -0
- package/dist/core/context-budget-v2-cache-invalidation.js.map +1 -0
- package/dist/core/context-budget-v2-cache-keys.d.ts +3 -0
- package/dist/core/context-budget-v2-cache-keys.d.ts.map +1 -1
- package/dist/core/context-budget-v2-cache-keys.js +6 -0
- package/dist/core/context-budget-v2-cache-keys.js.map +1 -1
- package/dist/core/context-budget-v2-cache-provider.d.ts +4 -0
- package/dist/core/context-budget-v2-cache-provider.d.ts.map +1 -1
- package/dist/core/context-budget-v2-cache-provider.js +19 -0
- package/dist/core/context-budget-v2-cache-provider.js.map +1 -1
- package/dist/core/context-budget-v2-plan-cache-keys.d.ts.map +1 -1
- package/dist/core/context-budget-v2-plan-cache-keys.js +1 -0
- package/dist/core/context-budget-v2-plan-cache-keys.js.map +1 -1
- package/dist/core/context-budget-v2-planner.d.ts.map +1 -1
- package/dist/core/context-budget-v2-planner.js +1 -0
- package/dist/core/context-budget-v2-planner.js.map +1 -1
- package/dist/core/context-budget-v2-types.d.ts +4 -0
- package/dist/core/context-budget-v2-types.d.ts.map +1 -1
- package/dist/core/context-budget-v2-types.js.map +1 -1
- package/dist/core/durable-file-directory.d.ts +4 -0
- package/dist/core/durable-file-directory.d.ts.map +1 -0
- package/dist/core/durable-file-directory.js +76 -0
- package/dist/core/durable-file-directory.js.map +1 -0
- package/dist/core/durable-file-identity.d.ts +26 -0
- package/dist/core/durable-file-identity.d.ts.map +1 -0
- package/dist/core/durable-file-identity.js +118 -0
- package/dist/core/durable-file-identity.js.map +1 -0
- package/dist/core/durable-file-io.d.ts +29 -0
- package/dist/core/durable-file-io.d.ts.map +1 -0
- package/dist/core/durable-file-io.js +179 -0
- package/dist/core/durable-file-io.js.map +1 -0
- package/dist/core/durable-file-lock-cleanup.d.ts +12 -0
- package/dist/core/durable-file-lock-cleanup.d.ts.map +1 -0
- package/dist/core/durable-file-lock-cleanup.js +39 -0
- package/dist/core/durable-file-lock-cleanup.js.map +1 -0
- package/dist/core/durable-file-lock-owner.d.ts +18 -0
- package/dist/core/durable-file-lock-owner.d.ts.map +1 -0
- package/dist/core/durable-file-lock-owner.js +78 -0
- package/dist/core/durable-file-lock-owner.js.map +1 -0
- package/dist/core/durable-file-lock-storage.d.ts +35 -0
- package/dist/core/durable-file-lock-storage.d.ts.map +1 -0
- package/dist/core/durable-file-lock-storage.js +263 -0
- package/dist/core/durable-file-lock-storage.js.map +1 -0
- package/dist/core/durable-file-mode.d.ts +8 -0
- package/dist/core/durable-file-mode.d.ts.map +1 -0
- package/dist/core/durable-file-mode.js +41 -0
- package/dist/core/durable-file-mode.js.map +1 -0
- package/dist/core/extensions/loader.d.ts +12 -0
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +46 -37
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts +7 -1
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +12 -0
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/index.d.ts +7 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +6 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/metrics-sampler.d.ts +20 -0
- package/dist/core/metrics-sampler.d.ts.map +1 -1
- package/dist/core/metrics-sampler.js +52 -0
- package/dist/core/metrics-sampler.js.map +1 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +4 -1
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +16 -7
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/provider-resilience.d.ts +51 -0
- package/dist/core/provider-resilience.d.ts.map +1 -0
- package/dist/core/provider-resilience.js +86 -0
- package/dist/core/provider-resilience.js.map +1 -0
- package/dist/core/redaction.d.ts +8 -0
- package/dist/core/redaction.d.ts.map +1 -0
- package/dist/core/redaction.js +31 -0
- package/dist/core/redaction.js.map +1 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +36 -0
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/run-journal-store.d.ts +53 -0
- package/dist/core/run-journal-store.d.ts.map +1 -0
- package/dist/core/run-journal-store.js +278 -0
- package/dist/core/run-journal-store.js.map +1 -0
- package/dist/core/run-journal.d.ts +172 -0
- package/dist/core/run-journal.d.ts.map +1 -0
- package/dist/core/run-journal.js +1045 -0
- package/dist/core/run-journal.js.map +1 -0
- package/dist/core/sdk.d.ts +7 -0
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +94 -3
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-doctor-plan.d.ts +128 -0
- package/dist/core/session-doctor-plan.d.ts.map +1 -0
- package/dist/core/session-doctor-plan.js +833 -0
- package/dist/core/session-doctor-plan.js.map +1 -0
- package/dist/core/session-file-compaction.d.ts +6 -0
- package/dist/core/session-file-compaction.d.ts.map +1 -0
- package/dist/core/session-file-compaction.js +169 -0
- package/dist/core/session-file-compaction.js.map +1 -0
- package/dist/core/session-file-head.d.ts +10 -0
- package/dist/core/session-file-head.d.ts.map +1 -0
- package/dist/core/session-file-head.js +78 -0
- package/dist/core/session-file-head.js.map +1 -0
- package/dist/core/session-file-persistence.d.ts +30 -0
- package/dist/core/session-file-persistence.d.ts.map +1 -0
- package/dist/core/session-file-persistence.js +106 -0
- package/dist/core/session-file-persistence.js.map +1 -0
- package/dist/core/session-integrity.d.ts +43 -0
- package/dist/core/session-integrity.d.ts.map +1 -0
- package/dist/core/session-integrity.js +420 -0
- package/dist/core/session-integrity.js.map +1 -0
- package/dist/core/session-manager.d.ts +24 -4
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +242 -125
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-owner-lease.d.ts +22 -0
- package/dist/core/session-owner-lease.d.ts.map +1 -0
- package/dist/core/session-owner-lease.js +176 -0
- package/dist/core/session-owner-lease.js.map +1 -0
- package/dist/core/session-path-policy.d.ts +132 -0
- package/dist/core/session-path-policy.d.ts.map +1 -0
- package/dist/core/session-path-policy.js +780 -0
- package/dist/core/session-path-policy.js.map +1 -0
- package/dist/core/session-repair-plan.d.ts +49 -0
- package/dist/core/session-repair-plan.d.ts.map +1 -0
- package/dist/core/session-repair-plan.js +202 -0
- package/dist/core/session-repair-plan.js.map +1 -0
- package/dist/core/session-termination.d.ts +106 -0
- package/dist/core/session-termination.d.ts.map +1 -0
- package/dist/core/session-termination.js +445 -0
- package/dist/core/session-termination.js.map +1 -0
- package/dist/core/settings-manager.d.ts +52 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +54 -5
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +1 -1
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +47 -0
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/omp-pure-seams.d.ts +41 -0
- package/dist/core/tools/omp-pure-seams.d.ts.map +1 -0
- package/dist/core/tools/omp-pure-seams.js +142 -0
- package/dist/core/tools/omp-pure-seams.js.map +1 -0
- package/dist/core/tools/omp-seam-runtime.d.ts +100 -0
- package/dist/core/tools/omp-seam-runtime.d.ts.map +1 -0
- package/dist/core/tools/omp-seam-runtime.js +40 -0
- package/dist/core/tools/omp-seam-runtime.js.map +1 -0
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +34 -1
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/verified-bash-adapter.d.ts +36 -0
- package/dist/core/verified-bash-adapter.d.ts.map +1 -0
- package/dist/core/verified-bash-adapter.js +90 -0
- package/dist/core/verified-bash-adapter.js.map +1 -0
- package/dist/guardrails/command-redaction.d.ts +32 -0
- package/dist/guardrails/command-redaction.d.ts.map +1 -0
- package/dist/guardrails/command-redaction.js +776 -0
- package/dist/guardrails/command-redaction.js.map +1 -0
- package/dist/guardrails/evidence-attestation.d.ts +31 -0
- package/dist/guardrails/evidence-attestation.d.ts.map +1 -0
- package/dist/guardrails/evidence-attestation.js +178 -0
- package/dist/guardrails/evidence-attestation.js.map +1 -0
- package/dist/guardrails/evidence-receipt-store.d.ts +33 -0
- package/dist/guardrails/evidence-receipt-store.d.ts.map +1 -0
- package/dist/guardrails/evidence-receipt-store.js +446 -0
- package/dist/guardrails/evidence-receipt-store.js.map +1 -0
- package/dist/guardrails/evidence-receipt.d.ts +58 -0
- package/dist/guardrails/evidence-receipt.d.ts.map +1 -0
- package/dist/guardrails/evidence-receipt.js +389 -0
- package/dist/guardrails/evidence-receipt.js.map +1 -0
- package/dist/guardrails/evidence-system.d.ts +39 -15
- package/dist/guardrails/evidence-system.d.ts.map +1 -1
- package/dist/guardrails/evidence-system.js +255 -97
- package/dist/guardrails/evidence-system.js.map +1 -1
- package/dist/guardrails/replay-ledger-io.d.ts +6 -0
- package/dist/guardrails/replay-ledger-io.d.ts.map +1 -0
- package/dist/guardrails/replay-ledger-io.js +42 -0
- package/dist/guardrails/replay-ledger-io.js.map +1 -0
- package/dist/guardrails/replay-ledger-lock-owner.d.ts +32 -0
- package/dist/guardrails/replay-ledger-lock-owner.d.ts.map +1 -0
- package/dist/guardrails/replay-ledger-lock-owner.js +138 -0
- package/dist/guardrails/replay-ledger-lock-owner.js.map +1 -0
- package/dist/guardrails/replay-ledger-lock.d.ts +24 -0
- package/dist/guardrails/replay-ledger-lock.d.ts.map +1 -0
- package/dist/guardrails/replay-ledger-lock.js +135 -0
- package/dist/guardrails/replay-ledger-lock.js.map +1 -0
- package/dist/guardrails/replay-ledger-mutation-gate.d.ts +24 -0
- package/dist/guardrails/replay-ledger-mutation-gate.d.ts.map +1 -0
- package/dist/guardrails/replay-ledger-mutation-gate.js +205 -0
- package/dist/guardrails/replay-ledger-mutation-gate.js.map +1 -0
- package/dist/guardrails/replay-ledger-quarantine.d.ts +2 -0
- package/dist/guardrails/replay-ledger-quarantine.d.ts.map +1 -0
- package/dist/guardrails/replay-ledger-quarantine.js +19 -0
- package/dist/guardrails/replay-ledger-quarantine.js.map +1 -0
- package/dist/guardrails/replay-ledger-store.d.ts +32 -0
- package/dist/guardrails/replay-ledger-store.d.ts.map +1 -0
- package/dist/guardrails/replay-ledger-store.js +211 -0
- package/dist/guardrails/replay-ledger-store.js.map +1 -0
- package/dist/guardrails/shell-command-name-glob.d.ts +3 -0
- package/dist/guardrails/shell-command-name-glob.d.ts.map +1 -0
- package/dist/guardrails/shell-command-name-glob.js +233 -0
- package/dist/guardrails/shell-command-name-glob.js.map +1 -0
- package/dist/guardrails/shell-command-option.d.ts +7 -0
- package/dist/guardrails/shell-command-option.d.ts.map +1 -0
- package/dist/guardrails/shell-command-option.js +24 -0
- package/dist/guardrails/shell-command-option.js.map +1 -0
- package/dist/guardrails/shell-command-tokenizer.d.ts +29 -0
- package/dist/guardrails/shell-command-tokenizer.d.ts.map +1 -0
- package/dist/guardrails/shell-command-tokenizer.js +145 -0
- package/dist/guardrails/shell-command-tokenizer.js.map +1 -0
- package/dist/guardrails/shell-command-wrapper.d.ts +18 -0
- package/dist/guardrails/shell-command-wrapper.d.ts.map +1 -0
- package/dist/guardrails/shell-command-wrapper.js +42 -0
- package/dist/guardrails/shell-command-wrapper.js.map +1 -0
- package/dist/guardrails/verified-executor.d.ts +65 -0
- package/dist/guardrails/verified-executor.d.ts.map +1 -0
- package/dist/guardrails/verified-executor.js +171 -0
- package/dist/guardrails/verified-executor.js.map +1 -0
- package/dist/guardrails/workspace-fingerprint.d.ts +23 -0
- package/dist/guardrails/workspace-fingerprint.d.ts.map +1 -0
- package/dist/guardrails/workspace-fingerprint.js +634 -0
- package/dist/guardrails/workspace-fingerprint.js.map +1 -0
- package/dist/index.d.ts +15 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +12 -0
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts +1 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +11 -8
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +3 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +59 -9
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/omk-aurora-dark.json +80 -0
- package/dist/modes/interactive/theme/omk-aurora-light.json +80 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +5 -0
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +43 -2
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +23 -5
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +3 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/types/evidence.d.ts +211 -1
- package/dist/types/evidence.d.ts.map +1 -1
- package/dist/types/evidence.js.map +1 -1
- package/dist/verify-ci.d.ts +3 -0
- package/dist/verify-ci.d.ts.map +1 -0
- package/dist/verify-ci.js +30 -0
- package/dist/verify-ci.js.map +1 -0
- package/docs/adaptorch-preview.md +1 -1
- package/docs/compaction.md +38 -4
- package/docs/extensions.md +2 -0
- package/docs/provider-resilience.md +87 -0
- package/docs/sdk.md +238 -1
- package/docs/settings.md +80 -2
- package/docs/themes.md +2 -0
- package/docs/usage.md +38 -0
- package/examples/extensions/custom-provider-anthropic/package-lock.json +5 -5
- 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 +4 -4
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +22 -13
- package/package.json +6 -5
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Provider resilience (root-level)
|
|
2
|
+
|
|
3
|
+
Built into OMK core — not an optional extension.
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
1. **Blocks sticky safety models** (e.g. `claude-fable-5`) from being selected as the session chat model.
|
|
8
|
+
2. **Ejects** them at prompt time if a resumed session still has one loaded.
|
|
9
|
+
3. On **content/safety stop** (`stop_reason=refusal`), **auto-failovers** to `k3 → grok-4.5 → deepseek` before retry.
|
|
10
|
+
4. Works with message sanitize (`transform-messages` orphan `tool_call_id` drop) so K3 protocol 400s can heal on retry.
|
|
11
|
+
|
|
12
|
+
This is session survival engineering, not a jailbreak.
|
|
13
|
+
|
|
14
|
+
## Settings (`~/.omk/agent/settings.json`)
|
|
15
|
+
|
|
16
|
+
```json
|
|
17
|
+
{
|
|
18
|
+
"defaultProvider": "kimi-coding",
|
|
19
|
+
"defaultModel": "k3",
|
|
20
|
+
"providerResilience": {
|
|
21
|
+
"blockStickySafetyModels": true,
|
|
22
|
+
"autoFailoverOnSafetyStop": true,
|
|
23
|
+
"failoverCandidates": [
|
|
24
|
+
{ "provider": "kimi-coding", "id": "k3" },
|
|
25
|
+
{ "provider": "grok-oauth-proxy", "id": "grok-4.5" },
|
|
26
|
+
{ "provider": "deepseek", "id": "deepseek-v4-pro" }
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
| Key | Default | Meaning |
|
|
33
|
+
|---|---|---|
|
|
34
|
+
| `blockStickySafetyModels` | `true` | Refuse `setModel` / initial pick of Fable-class ids |
|
|
35
|
+
| `autoFailoverOnSafetyStop` | `true` | Switch model before auto-retry on safety stop |
|
|
36
|
+
| `failoverCandidates` | k3→grok→deepseek… | Ordered targets |
|
|
37
|
+
|
|
38
|
+
Disable only if you intentionally want Fable:
|
|
39
|
+
|
|
40
|
+
```json
|
|
41
|
+
"providerResilience": { "blockStickySafetyModels": false, "autoFailoverOnSafetyStop": false }
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Code
|
|
45
|
+
|
|
46
|
+
| Module | Role |
|
|
47
|
+
|---|---|
|
|
48
|
+
| `src/core/provider-resilience.ts` | Shared detectors + failover pick |
|
|
49
|
+
| `src/core/agent-session.ts` | eject / failover / retry wiring |
|
|
50
|
+
| `src/core/model-resolver.ts` | skip sticky on initial model pick |
|
|
51
|
+
| `src/core/settings-manager.ts` | `providerResilience` settings |
|
|
52
|
+
| `packages/ai/.../transform-messages.ts` | drop orphan tool results |
|
|
53
|
+
|
|
54
|
+
## How Fable is neutralized (not "jailbroken")
|
|
55
|
+
|
|
56
|
+
Server-side content/safety stops cannot be removed by OAuth RE or local patches.
|
|
57
|
+
OMK **deletes Fable from the operational surface**:
|
|
58
|
+
|
|
59
|
+
| Layer | Kill switch |
|
|
60
|
+
|---|---|
|
|
61
|
+
| `models.json` | `claude-fable-5` removed from anthropic catalog |
|
|
62
|
+
| `model-registry.loadModels` | `/fable/i` filtered unless `OMK_ALLOW_STICKY_SAFETY_MODELS=1` |
|
|
63
|
+
| `model-resolver` | sticky skipped; k3 preferred |
|
|
64
|
+
| `setModel` | throws if sticky + block on |
|
|
65
|
+
| `cycleModel` (scoped + available) | sticky filtered; goes through `setModel` |
|
|
66
|
+
| prompt boundary | ejects leftover Fable session model → k3 |
|
|
67
|
+
| safety-stop retry | failover chain before continue |
|
|
68
|
+
|
|
69
|
+
**You don't fight Fable. You never load it.**
|
|
70
|
+
|
|
71
|
+
## Operator
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
# after rebuild — restart OMK session (required)
|
|
75
|
+
|
|
76
|
+
/model k3 # if still on a bad model
|
|
77
|
+
/new # if transcript is corrupted (orphan tool ids)
|
|
78
|
+
|
|
79
|
+
# emergency re-enable Fable (not recommended)
|
|
80
|
+
OMK_ALLOW_STICKY_SAFETY_MODELS=1 omk
|
|
81
|
+
# and settings: providerResilience.blockStickySafetyModels=false
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## arXiv note (2026-07)
|
|
85
|
+
|
|
86
|
+
Recent cs.CL hits on refusal/jailbreak are mostly attack-ASR / weight-edit / prefill studies.
|
|
87
|
+
No immediate ops patch beyond routing+sanitize already in-tree. Skip theory-only papers.
|
package/docs/sdk.md
CHANGED
|
@@ -87,6 +87,19 @@ interface AgentSession {
|
|
|
87
87
|
sessionFile: string | undefined;
|
|
88
88
|
sessionId: string;
|
|
89
89
|
|
|
90
|
+
// Lifecycle and termination
|
|
91
|
+
lastTermination: SessionTermination | undefined;
|
|
92
|
+
recordProcessSignal(signal: "SIGINT" | "SIGTERM" | "SIGHUP" | "SIGQUIT"): SessionTermination;
|
|
93
|
+
|
|
94
|
+
// Audit / repair
|
|
95
|
+
transcriptRepair: { insertedToolCallIds: string[]; reason: string } | undefined;
|
|
96
|
+
runJournalRecords: readonly unknown[];
|
|
97
|
+
runJournalQuarantineReport: RunJournalQuarantineReport | null;
|
|
98
|
+
|
|
99
|
+
// Workspace mutation signals (used by evidence freshness gating)
|
|
100
|
+
sessionRiskLevel: "normal" | "elevated";
|
|
101
|
+
workspaceMutationCount: number;
|
|
102
|
+
|
|
90
103
|
// Model control
|
|
91
104
|
setModel(model: Model): Promise<void>;
|
|
92
105
|
setThinkingLevel(level: ThinkingLevel): void;
|
|
@@ -181,6 +194,24 @@ session = runtime.session;
|
|
|
181
194
|
unsubscribe = session.subscribe(() => {});
|
|
182
195
|
```
|
|
183
196
|
|
|
197
|
+
### Run Termination and Replay Binding
|
|
198
|
+
|
|
199
|
+
Every real AgentSession run emits a `session_termination` event and exposes the latest value as `session.lastTermination`. The typed record includes `kind`, `provider`, `model`, retry flags, `causeCode`, `nextAction`, and `runId`; persisted sessions also fsync lifecycle records to `<session>.runjournal`.
|
|
200
|
+
|
|
201
|
+
To share evidence freshness ordering with runtime repairs and late tool settlements, pass the same optional replay ledger to the session and `VerifiedEvidenceExecutor`:
|
|
202
|
+
|
|
203
|
+
```typescript
|
|
204
|
+
const ledger = new ReplayLedgerManager(goalId, ledgerPath);
|
|
205
|
+
const { session } = await createAgentSession({
|
|
206
|
+
replayLedger: ledger,
|
|
207
|
+
replayGoalId: goalId,
|
|
208
|
+
replayLaneId: laneId,
|
|
209
|
+
});
|
|
210
|
+
const executor = new VerifiedEvidenceExecutor({ store, ledger });
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
`transcript_repaired`, `tool_timeout`, `tool_late_settlement`, and `workspace_mutation` use that ledger. A receipt at or before a later relevant workspace mutation is blocked by `EvidenceGate`.
|
|
214
|
+
|
|
184
215
|
### Prompting and Message Queueing
|
|
185
216
|
|
|
186
217
|
`PromptOptions` controls prompt expansion, queueing behavior while streaming, and prompt preflight notifications:
|
|
@@ -315,7 +346,7 @@ session.subscribe((event) => {
|
|
|
315
346
|
// event.toolResults: tool results from this turn
|
|
316
347
|
break;
|
|
317
348
|
|
|
318
|
-
// Session events (queue, compaction, retry)
|
|
349
|
+
// Session events (queue, compaction, retry, termination, workspace mutation)
|
|
319
350
|
case "queue_update":
|
|
320
351
|
console.log(event.steering, event.followUp);
|
|
321
352
|
break;
|
|
@@ -324,6 +355,12 @@ session.subscribe((event) => {
|
|
|
324
355
|
case "auto_retry_start":
|
|
325
356
|
case "auto_retry_end":
|
|
326
357
|
break;
|
|
358
|
+
case "session_termination":
|
|
359
|
+
// event.termination: latest session termination record
|
|
360
|
+
break;
|
|
361
|
+
case "workspace_mutation":
|
|
362
|
+
// Emitted when a late-settling potentially-writing tool may have mutated the workspace
|
|
363
|
+
break;
|
|
327
364
|
}
|
|
328
365
|
});
|
|
329
366
|
```
|
|
@@ -1091,6 +1128,122 @@ RPC mode is preferred when:
|
|
|
1091
1128
|
- You want process isolation
|
|
1092
1129
|
- You're building a language-agnostic client
|
|
1093
1130
|
|
|
1131
|
+
## Evidence and Verification
|
|
1132
|
+
|
|
1133
|
+
Execution-bound evidence is an optional, application-driven layer. It records a declared verification command and reported outcome between two artifact-set snapshots, then binds that record to a tamper-evident ledger. `VerifiedEvidenceExecutor` never executes the declared command. The opt-in `executeVerifiedBash()` adapter invokes caller-supplied `BashOperations`; `executeVerifiedLocalBash()` instead derives the shell identity and runner from OMK's built-in local backend. The default CLI and AgentSession bash paths remain unverified. The repository CI workflow is the sole built-in callsite: it runs the release-consistency verifier through the local adapter.
|
|
1134
|
+
|
|
1135
|
+
### Recorded and invoked inputs
|
|
1136
|
+
|
|
1137
|
+
| Input | SDK behavior |
|
|
1138
|
+
|-------|--------------|
|
|
1139
|
+
| `request.command` (`EvidenceCommandDescriptor`) | Validates, hashes, and records the structured descriptor; never executes it |
|
|
1140
|
+
| `request.executor` (`"bash-tool" \| "ci-runner" \| "mcp" \| "internal"`) | Records a label only |
|
|
1141
|
+
| `request.workspaceScope` (`WorkspaceScope`) | Captures the selected artifact set before and after the callback |
|
|
1142
|
+
| `request.execute` | Invokes your callback; your application owns its implementation and truthfulness |
|
|
1143
|
+
| `executeVerifiedBash()` | Passes the exact shell script to injected `BashOperations`; the caller supplies the matching shell identity and trusts the runner |
|
|
1144
|
+
| `executeVerifiedLocalBash()` | Resolves OMK's local shell identity, creates the matching local `BashOperations`, and delegates to `executeVerifiedBash()` |
|
|
1145
|
+
|
|
1146
|
+
### Runner honesty is a trust boundary
|
|
1147
|
+
|
|
1148
|
+
The SDK cannot prove that a callback or injected runner executed what it reported. A direct `VerifiedEvidenceExecutor` callback must execute the exact descriptor, normalize the disposition, and return already-redacted `Uint8Array` output.
|
|
1149
|
+
|
|
1150
|
+
`executeVerifiedBash()` handles the mechanical shell adapter contract:
|
|
1151
|
+
|
|
1152
|
+
- records a `kind: "shell"` descriptor using the same script passed to `BashOperations.exec()`,
|
|
1153
|
+
- maps exit, timeout, and abort states to receipt dispositions,
|
|
1154
|
+
- retains a rolling 128 KiB combined-output tail, applies OMK's high-confidence text redaction, then keeps the final 64 KiB, and
|
|
1155
|
+
- records the combined `BashOperations` stream as receipt `stdout`; receipt `stderr` is empty because that interface does not expose separate channels.
|
|
1156
|
+
|
|
1157
|
+
The policy is best-effort masking, not DLP. A credential spanning the rolling-window cut may lose matching context, although receipts persist only the resulting digest and byte count. The runner, declared shell identity, environment, remote execution behavior, and any runner-owned spill files remain caller trust boundaries. The script is stored in the receipt after credential-shaped preflight, so keep secrets out of command strings.
|
|
1158
|
+
|
|
1159
|
+
Injected runners must follow the built-in terminal protocol: return an integer exit code, throw `Error("aborted")` for abort, or throw an error whose message starts with `timeout:`. Other failures propagate without a receipt; `null` or non-integer exit codes fail closed with `VerifiedBashAdapterError`.
|
|
1160
|
+
|
|
1161
|
+
`executeVerifiedLocalBash()` removes the caller-declared shell mismatch by resolving the descriptor shell and local backend from the same shell setting. It does not bind the inherited environment, prove runner honesty, or provide OS isolation.
|
|
1162
|
+
|
|
1163
|
+
### First-party CI callsite
|
|
1164
|
+
|
|
1165
|
+
`.github/workflows/ci.yml` invokes the compiled `dist/verify-ci.js` entry after the normal repository check. That entry runs only `node scripts/check-release-consistency.mjs` through `executeVerifiedLocalBash()` with `executor: "ci-runner"`, applies a strict `EvidenceGate`, writes receipts, ledger, and report under `.omk/ci-evidence`, and returns a non-zero process exit when the gate is blocked. CI uploads that directory as `verified-release-consistency`.
|
|
1166
|
+
|
|
1167
|
+
This callsite does not wrap the full build, check, or test suite and does not enable receipts for interactive, RPC, or SDK-created AgentSession bash calls. Its workspace freshness scope is limited to the root and coding-agent package manifests.
|
|
1168
|
+
|
|
1169
|
+
### Execution ordering
|
|
1170
|
+
|
|
1171
|
+
`VerifiedEvidenceExecutor.execute(request)` runs, in order:
|
|
1172
|
+
|
|
1173
|
+
1. before artifact-set snapshot (`workspaceBefore`)
|
|
1174
|
+
2. your callback (`await request.execute()`)
|
|
1175
|
+
3. after artifact-set snapshot (`workspaceAfter`)
|
|
1176
|
+
4. replay-ledger `append` + `persist()`
|
|
1177
|
+
5. envelope binding to the ledger event (`seq`, `eventHash`)
|
|
1178
|
+
6. no-overwrite store publish (hard-link; cannot replace an existing receipt)
|
|
1179
|
+
|
|
1180
|
+
Ledger and receipt publication are fail-closed but not one filesystem transaction. A failure after `ledger.persist()` and before publication can leave a dangling ledger event; a failure after hard-link publication can leave a readable receipt even though `execute()` rejects. Reconcile the ledger and store before retrying an explicit receipt ID.
|
|
1181
|
+
|
|
1182
|
+
### Freshness, ledger load, and store hardening
|
|
1183
|
+
|
|
1184
|
+
- **Freshness** compares only the caller-selected artifact set (`WorkspaceScope.artifactPaths`). It issues no Git command and carries no Git fingerprint.
|
|
1185
|
+
- **Ledger**: `ReplayLedgerManager` verifies an existing ledger on construction (sequence order, prev-hash chain, payload hash, event hash) and **fails closed** on any violation.
|
|
1186
|
+
- **Store**: `EvidenceReceiptStore` uses an owner-only directory, symlink rejection, no-overwrite hard-link publication, and identity rechecks to detect observed path replacement. These checks assume same-UID path mutation is quiescent; they are **not** filesystem sandbox isolation.
|
|
1187
|
+
|
|
1188
|
+
### Receipt policy
|
|
1189
|
+
|
|
1190
|
+
`EvidenceGate` (default `receiptMode: "prefer"`) gates a `TaskContract` against its satisfied receipts. Pass `executor.createGateOptions()` so the gate resolves receipts, ledger events, and workspace fingerprints from the same store and ledger.
|
|
1191
|
+
|
|
1192
|
+
| Mode | Soft missing data | Tamper-grade mismatch | Legacy `hash` / `command` |
|
|
1193
|
+
|------|-------------------|-----------------------|----------------------------|
|
|
1194
|
+
| `strict` | blocked | blocked | n/a |
|
|
1195
|
+
| `prefer` (default) | conditional | blocked | n/a |
|
|
1196
|
+
| `legacy` | receipt checks skipped | receipt checks skipped | checked by legacy options (enabled by default) |
|
|
1197
|
+
|
|
1198
|
+
Soft missing data means no resolver was supplied or a resolver returned `undefined`. Resolver exceptions are hard failures in both `strict` and `prefer`. The resolver from `createGateOptions()` calls `EvidenceReceiptStore.read()`, so a claimed receipt ID that has no stored file throws and blocks the gate.
|
|
1199
|
+
|
|
1200
|
+
Tamper-grade mismatches include: receipt ID, goal, or claim mismatch; schema version ≠ 3; status not `passed` or `exitCode` ≠ 0; command-SHA mismatch; lane mismatch; artifact-changed-after-verification; and ledger-binding mismatch.
|
|
1201
|
+
|
|
1202
|
+
`createGateOptions()` returns three resolvers bound to the executor's own store and ledger: `resolveReceipt` (read a stored receipt), `resolveLedgerEvent` (find a chain event by `seq`), and `captureWorkspaceFingerprint` (snapshot the selected artifact set). The gate validates every returned value.
|
|
1203
|
+
|
|
1204
|
+
### Integration example
|
|
1205
|
+
|
|
1206
|
+
```typescript
|
|
1207
|
+
import {
|
|
1208
|
+
EvidenceGate, EvidenceReceiptStore, executeVerifiedLocalBash,
|
|
1209
|
+
ReplayLedgerManager, TaskContractBuilder, VerifiedEvidenceExecutor,
|
|
1210
|
+
type WorkspaceScope,
|
|
1211
|
+
} from "open-multi-agent-kit";
|
|
1212
|
+
|
|
1213
|
+
const goalId = "goal-123";
|
|
1214
|
+
const claim = "repository checks passed";
|
|
1215
|
+
const cwd = process.cwd();
|
|
1216
|
+
const workspaceScope: WorkspaceScope = { root: cwd, artifactPaths: ["packages/coding-agent/src/index.ts"] };
|
|
1217
|
+
|
|
1218
|
+
const store = new EvidenceReceiptStore("/secure/receipts");
|
|
1219
|
+
const ledger = new ReplayLedgerManager(goalId, "/secure/ledger.jsonl");
|
|
1220
|
+
const executor = new VerifiedEvidenceExecutor({ store, ledger });
|
|
1221
|
+
|
|
1222
|
+
const { evidenceMetadata } = await executeVerifiedLocalBash({
|
|
1223
|
+
evidenceExecutor: executor,
|
|
1224
|
+
goalId,
|
|
1225
|
+
claim,
|
|
1226
|
+
script: "npm run check",
|
|
1227
|
+
cwd,
|
|
1228
|
+
timeoutMs: 30_000,
|
|
1229
|
+
workspaceScope,
|
|
1230
|
+
});
|
|
1231
|
+
|
|
1232
|
+
const contract = new TaskContractBuilder(goalId)
|
|
1233
|
+
.setClaim(claim)
|
|
1234
|
+
.addRequiredEvidence({
|
|
1235
|
+
claim, category: "feature",
|
|
1236
|
+
receiptId: evidenceMetadata.receiptId, receiptSchemaVersion: 3,
|
|
1237
|
+
receiptCommandSha256: evidenceMetadata.receiptCommandSha256,
|
|
1238
|
+
})
|
|
1239
|
+
.updateEvidenceStatus(claim, "satisfied")
|
|
1240
|
+
.setVerdict("pass")
|
|
1241
|
+
.build();
|
|
1242
|
+
|
|
1243
|
+
const result = new EvidenceGate(executor.createGateOptions()).check(contract);
|
|
1244
|
+
// result.status: "open" | "conditional" | "blocked"
|
|
1245
|
+
```
|
|
1246
|
+
|
|
1094
1247
|
## Exports
|
|
1095
1248
|
|
|
1096
1249
|
The main entry point exports:
|
|
@@ -1098,7 +1251,9 @@ The main entry point exports:
|
|
|
1098
1251
|
```typescript
|
|
1099
1252
|
// Factory
|
|
1100
1253
|
createAgentSession
|
|
1254
|
+
createAgentSessionFromServices
|
|
1101
1255
|
createAgentSessionRuntime
|
|
1256
|
+
createAgentSessionServices
|
|
1102
1257
|
AgentSessionRuntime
|
|
1103
1258
|
|
|
1104
1259
|
// Auth and Models
|
|
@@ -1122,16 +1277,98 @@ createCodingTools
|
|
|
1122
1277
|
createReadOnlyTools
|
|
1123
1278
|
createReadTool, createBashTool, createEditTool, createWriteTool
|
|
1124
1279
|
createGrepTool, createFindTool, createLsTool
|
|
1280
|
+
createLocalBashOperations
|
|
1281
|
+
|
|
1282
|
+
// Compaction (programmatic primitives)
|
|
1283
|
+
calculateContextTokens, compact, createCompactionEnvelope,
|
|
1284
|
+
createCompactionHysteresisConfig, createCompactionHysteresisState,
|
|
1285
|
+
createCompactionSourceIdentity, createCompactionTransaction,
|
|
1286
|
+
createSessionRevisionToken, decideCompactionCommit, estimateTokens,
|
|
1287
|
+
evaluateCompactionBarrier, findCutPoint, findTurnStartIndex,
|
|
1288
|
+
generateBranchSummary, generateSummary, getLastAssistantUsage,
|
|
1289
|
+
prepareBranchEntries, serializeConversation, shouldCompact, stepCompactionHysteresis,
|
|
1290
|
+
validateCompactionEnvelope
|
|
1291
|
+
|
|
1292
|
+
// Context-budget v2 and reserved-token budget
|
|
1293
|
+
planPromptContextBudgetV2, applyContextCacheInvalidation,
|
|
1294
|
+
createMemoryContextBudgetCacheProviderV2, buildContextBudgetPlanCacheKeyV2,
|
|
1295
|
+
buildContextBudgetMaterializedRepresentationCacheKeyV2, createContextBudgetCacheKeyBaseV2,
|
|
1296
|
+
createContextCacheInvalidationSnapshot, serializeContextCacheSnapshot,
|
|
1297
|
+
CONTEXT_BUDGET_POLICY_VERSION_V2
|
|
1298
|
+
computeReservedTokenBudget, estimateToolResultReserve, ReservedTokenBudgetError
|
|
1299
|
+
|
|
1300
|
+
// Run journal and session termination
|
|
1301
|
+
RunJournalStore, appendRunJournalRecordDurably, writeQuarantineBytesDurably,
|
|
1302
|
+
classifySessionTermination, formatSessionTermination, SessionTerminationError
|
|
1303
|
+
|
|
1304
|
+
// Execution-bound evidence (optional, application-driven verification receipts)
|
|
1305
|
+
EvidenceReceiptStore
|
|
1306
|
+
ReplayLedgerManager
|
|
1307
|
+
EvidenceGate
|
|
1308
|
+
FailClosedMergeGate
|
|
1309
|
+
TaskContractBuilder
|
|
1310
|
+
VerifiedEvidenceExecutor
|
|
1311
|
+
VerifiedEvidenceExecutorError
|
|
1312
|
+
executeVerifiedBash
|
|
1313
|
+
executeVerifiedLocalBash
|
|
1314
|
+
VERIFIED_BASH_REDACTION_POLICY_ID
|
|
1315
|
+
VerifiedBashAdapterError
|
|
1316
|
+
redactCommandDescriptor
|
|
1317
|
+
createCommandHmacBinder
|
|
1318
|
+
EVIDENCE_COMMAND_REDACTION_POLICY_ID
|
|
1319
|
+
MAX_COMMAND_REDACTION_PLACEHOLDERS
|
|
1320
|
+
parseCommandHmacBinding
|
|
1321
|
+
parseCommandRedactionSummary
|
|
1322
|
+
CommandRedactionError
|
|
1125
1323
|
|
|
1126
1324
|
// Types
|
|
1127
1325
|
type CreateAgentSessionOptions
|
|
1128
1326
|
type CreateAgentSessionResult
|
|
1327
|
+
type CreateAgentSessionRuntimeFactory
|
|
1328
|
+
type CreateAgentSessionRuntimeResult
|
|
1329
|
+
type CreateAgentSessionServicesOptions
|
|
1129
1330
|
type ExtensionFactory
|
|
1130
1331
|
type ExtensionAPI
|
|
1131
1332
|
type ToolDefinition
|
|
1132
1333
|
type Skill
|
|
1133
1334
|
type PromptTemplate
|
|
1134
1335
|
type Tool
|
|
1336
|
+
type CompactionEnvelope
|
|
1337
|
+
type CompactionTransaction
|
|
1338
|
+
type CompactionHysteresisConfig
|
|
1339
|
+
type CompactionHysteresisState
|
|
1340
|
+
type CompactionBarrierResult
|
|
1341
|
+
type CompactionCommitDecision
|
|
1342
|
+
type ContextBudgetCacheProviderV2
|
|
1343
|
+
type ContextCacheInvalidationEvent
|
|
1344
|
+
type ContextCacheInvalidationSnapshot
|
|
1345
|
+
type ReservedTokenBudgetInput
|
|
1346
|
+
type ReservedTokenBudgetResult
|
|
1347
|
+
type RunJournalQuarantineReport
|
|
1348
|
+
type SessionTermination
|
|
1349
|
+
type SessionTerminationCause
|
|
1350
|
+
type SessionTerminationKind
|
|
1351
|
+
type ToolSchedulerSetting
|
|
1352
|
+
type AgentRuntimeSettings
|
|
1353
|
+
type VerifiedBashExecutionRequest
|
|
1354
|
+
type VerifiedLocalBashExecutionRequest
|
|
1355
|
+
type EvidenceGateOptions
|
|
1356
|
+
type VerifiedEvidenceExecutionRequest
|
|
1357
|
+
type VerifiedEvidenceExecutionResult
|
|
1358
|
+
type VerifiedEvidenceExecutionOutcome
|
|
1359
|
+
type EvidenceReceiptMode
|
|
1360
|
+
type TaskContract
|
|
1361
|
+
type EvidenceCommandDescriptor
|
|
1362
|
+
type WorkspaceScope
|
|
1363
|
+
type CommandRedactionPlaceholder
|
|
1364
|
+
type CommandRedactionSummary
|
|
1365
|
+
type EvidenceReceipt
|
|
1366
|
+
type EvidenceReceiptLedgerBinding
|
|
1367
|
+
type ReplayEvent
|
|
1368
|
+
type ReplayEventType
|
|
1369
|
+
type WorkspaceMutationReplayPayload
|
|
1370
|
+
type Sha256Hex
|
|
1371
|
+
type ArtifactSetWorkspaceFingerprint
|
|
1135
1372
|
```
|
|
1136
1373
|
|
|
1137
1374
|
For extension types, see [extensions.md](extensions.md) for the full API.
|
package/docs/settings.md
CHANGED
|
@@ -20,6 +20,8 @@ Edit directly or use `/settings` for common options.
|
|
|
20
20
|
| `defaultThinkingLevel` | string | - | `"off"`, `"minimal"`, `"low"`, `"medium"`, `"high"`, `"xhigh"` |
|
|
21
21
|
| `hideThinkingBlock` | boolean | `false` | Hide thinking blocks in output |
|
|
22
22
|
| `thinkingBudgets` | object | - | Custom token budgets per thinking level |
|
|
23
|
+
| `reasoningRouterLearning` | object | - | Opt-in v4 router learning bias (global settings file only) |
|
|
24
|
+
| `adaptorchBridge` | object | - | Opt-in AdaptOrch advisory bridge for the auto thinking-level resolver (global settings file only) |
|
|
23
25
|
|
|
24
26
|
#### thinkingBudgets
|
|
25
27
|
|
|
@@ -34,6 +36,34 @@ Edit directly or use `/settings` for common options.
|
|
|
34
36
|
}
|
|
35
37
|
```
|
|
36
38
|
|
|
39
|
+
#### reasoningRouterLearning
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"reasoningRouterLearning": {
|
|
44
|
+
"enabled": false,
|
|
45
|
+
"biasSnapshotPath": "~/.omk/agent/router-bias.json",
|
|
46
|
+
"feedbackLedgerPath": "~/.omk/agent/router-feedback.jsonl"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
#### adaptorchBridge
|
|
52
|
+
|
|
53
|
+
Advisory-only hint source for the v4 auto thinking-level resolver. Read from the **global** settings file only — a project-scope `.omk/settings.json` value is ignored by design. Default is fully off; the bridge is circuit-breaker protected and TTL-cached, and its hint can only nudge the resolved level by a bounded ±2 steps.
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"adaptorchBridge": {
|
|
58
|
+
"enabled": false,
|
|
59
|
+
"ttlMs": 300000,
|
|
60
|
+
"timeoutMs": 1500,
|
|
61
|
+
"maxConsultsPerSession": 5,
|
|
62
|
+
"failureThreshold": 3
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
37
67
|
### UI & Display
|
|
38
68
|
|
|
39
69
|
| Setting | Type | Default | Description |
|
|
@@ -73,15 +103,31 @@ Set `OMK_SKIP_VERSION_CHECK=1` to disable the OMK version update check. Use `--o
|
|
|
73
103
|
| Setting | Type | Default | Description |
|
|
74
104
|
|---------|------|---------|-------------|
|
|
75
105
|
| `compaction.enabled` | boolean | `true` | Enable auto-compaction |
|
|
76
|
-
| `compaction.
|
|
106
|
+
| `compaction.model` | string | session model | Authenticated canonical `provider/model` used only for compaction |
|
|
107
|
+
| `compaction.reserveTokens` | number | `16384` | Legacy/default output reserve (tokens reserved for the LLM response) |
|
|
108
|
+
| `compaction.reservedOutputTokens` | number | `reserveTokens` | Optional override for output-only reserve |
|
|
109
|
+
| `compaction.reservedToolResultTokens` | number | `0` | Reserve tokens for pending tool results |
|
|
110
|
+
| `compaction.safetyMarginTokens` | number | `0` | Extra safety margin added to the reserve |
|
|
111
|
+
| `compaction.imageReserveTokens` | number | `0` | Reserve tokens for image content |
|
|
77
112
|
| `compaction.keepRecentTokens` | number | `20000` | Recent tokens to keep (not summarized) |
|
|
113
|
+
| `compaction.maxUsageRatio` | number | `0.9` | Normal trigger ratio (fraction of context window) |
|
|
114
|
+
| `compaction.rearmRatio` | number | `0.75 × maxUsageRatio` | Ratio below which a triggered compaction can rearm |
|
|
115
|
+
| `compaction.emergencyRatio` | number | `0.98` | Emergency compaction ratio |
|
|
116
|
+
|
|
117
|
+
All numeric token reserves must be non-negative safe integers. Ratios must be finite and in `(0, 1]`. Invalid values fail session creation instead of silently weakening the policy.
|
|
78
118
|
|
|
79
119
|
```json
|
|
80
120
|
{
|
|
81
121
|
"compaction": {
|
|
82
122
|
"enabled": true,
|
|
123
|
+
"model": "zai/glm-5.2",
|
|
83
124
|
"reserveTokens": 16384,
|
|
84
|
-
"
|
|
125
|
+
"reservedToolResultTokens": 8192,
|
|
126
|
+
"safetyMarginTokens": 1024,
|
|
127
|
+
"keepRecentTokens": 20000,
|
|
128
|
+
"maxUsageRatio": 0.9,
|
|
129
|
+
"rearmRatio": 0.7,
|
|
130
|
+
"emergencyRatio": 0.98
|
|
85
131
|
}
|
|
86
132
|
}
|
|
87
133
|
```
|
|
@@ -100,6 +146,38 @@ Set `OMK_SKIP_VERSION_CHECK=1` to disable the OMK version update check. Use `--o
|
|
|
100
146
|
|
|
101
147
|
This setting is global-only: `.omk/settings.json` cannot enable or disable it. Use `OMK_CONTEXT_GOVERNOR=1` to force it on for one process or `OMK_CONTEXT_GOVERNOR=0` to force it off for a baseline run. The cache is never persisted or shared between sessions.
|
|
102
148
|
|
|
149
|
+
### Agent Tool Execution
|
|
150
|
+
|
|
151
|
+
| Setting | Type | Default | Description |
|
|
152
|
+
|---------|------|---------|-------------|
|
|
153
|
+
| `agent.toolScheduler` | string | `"dag-v2"` | Deterministic resource-claim scheduler. Use `"waves-v1"` for compatibility rollback |
|
|
154
|
+
| `agent.maxToolConcurrency` | number | `4` | Maximum calls in one DAG level; `0` removes the cap |
|
|
155
|
+
| `agent.toolTimeoutMs` | number | `0` | Fallback tool execution timeout in milliseconds; `0` disables the fallback timer |
|
|
156
|
+
| `agent.toolTimeouts` | object | built-in defaults | Per-tool-name timeout overrides; `0` disables that tool's timer |
|
|
157
|
+
|
|
158
|
+
Built-in defaults are 30 seconds for `read`, `grep`, `find`, and `ls`; 60 seconds for `edit` and `write`; and 300 seconds for `bash`. Explicit `agent.toolTimeouts` entries override these defaults. Extension/custom tools without a per-name value use `agent.toolTimeoutMs`. Timeout values must be integer milliseconds from `0` through `2147483647`.
|
|
159
|
+
|
|
160
|
+
```json
|
|
161
|
+
{
|
|
162
|
+
"agent": {
|
|
163
|
+
"toolScheduler": "dag-v2",
|
|
164
|
+
"maxToolConcurrency": 4,
|
|
165
|
+
"toolTimeoutMs": 0,
|
|
166
|
+
"toolTimeouts": {
|
|
167
|
+
"read": 30000,
|
|
168
|
+
"write": 60000,
|
|
169
|
+
"bash": 300000,
|
|
170
|
+
"my_mcp_tool": 120000,
|
|
171
|
+
"my_browser_tool": 180000
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
`OMK_TOOL_SCHEDULER` overrides the file setting for one process. Set it to `waves-v1` for rollback or `dag-v2` to force the resource DAG. Invalid scheduler and timeout values fail session creation instead of silently weakening the policy.
|
|
178
|
+
|
|
179
|
+
The DAG preserves source-order result artifacts. `bash`, unknown tools, and extension tools without explicit resource claims remain exclusive. Tool timeout is logical cancellation: OMK closes the tool call and signals cancellation, but arbitrary JavaScript or external side effects may continue if the tool ignores that signal.
|
|
180
|
+
|
|
103
181
|
### Branch Summary
|
|
104
182
|
|
|
105
183
|
| Setting | Type | Default | Description |
|
package/docs/themes.md
CHANGED
|
@@ -41,6 +41,8 @@ On first run, omk detects your terminal background and defaults to `omk-control-
|
|
|
41
41
|
|
|
42
42
|
The bundled Tinted themes are generated from [`tinted-theming/schemes`](https://github.com/tinted-theming/schemes) Base24 palettes (MIT): Catppuccin Mocha, Tokyo Night Storm, Kanagawa Dragon, Gruvbox Dark, and Dracula.
|
|
43
43
|
|
|
44
|
+
The Aurora pair (`omk-aurora-dark`, `omk-aurora-light`; aliases `aurora`, `aurora-dark`, `aurora-light`) ships a WCAG-verified palette: body text ≥14:1 contrast, muted ≥5.7:1, and semantic colors (success/error/warning/accent) ≥4.5:1 against their backgrounds, with a stepped thinking-level color ramp (dim → muted → accent → accentSoft → magenta). Both variants share the same 51-token map so light/dark switching stays visually consistent.
|
|
45
|
+
|
|
44
46
|
## Creating a Custom Theme
|
|
45
47
|
|
|
46
48
|
1. Create a theme file:
|
package/docs/usage.md
CHANGED
|
@@ -126,6 +126,21 @@ Useful session commands:
|
|
|
126
126
|
|
|
127
127
|
See [Sessions](sessions.md) and [Compaction](compaction.md) for details.
|
|
128
128
|
|
|
129
|
+
### Session Doctor and Recovery
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
omk session doctor # inspect all stored sessions
|
|
133
|
+
omk session doctor --session <path|id> # inspect one session
|
|
134
|
+
omk session doctor --session <path|id> --repair --dry-run
|
|
135
|
+
omk session doctor --session <path|id> --repair
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
The doctor verifies the session's complete JSONL prefix, run journal, compaction envelopes/transactions, replay-evidence links, workspace, and provider/model binding. `--dry-run` plans repairs without writing. Repair mode rechecks file hashes under a lock before writing and only allows unambiguous missing tool results, exact trailing-fragment quarantine, unclosed-run crash recovery, and stale compaction abandonment. Duplicate/orphan tool results, duplicate IDs, broken hashes/chains, and changed preconditions are refused.
|
|
139
|
+
|
|
140
|
+
Session and journal bytes after the final newline are copied byte-for-byte to a `.quarantine-*` file before the original is atomically rewritten to its valid complete prefix. Opening a session uses the same complete-prefix rule; `SessionManager.getQuarantineReport()` reports any startup quarantine.
|
|
141
|
+
|
|
142
|
+
Each real agent run writes fsynced `run_started` and `run_finished` records to `<session>.runjournal`. An unclosed valid run is recorded as an inferred `process_crash` on the next startup. JSON/RPC emit `session_termination`; text and TUI errors include kind, provider/model, retryability, cause, run ID, and next action.
|
|
143
|
+
|
|
129
144
|
## Context Files
|
|
130
145
|
|
|
131
146
|
OMK loads `AGENTS.md` or `CLAUDE.md` at startup from:
|
|
@@ -177,6 +192,28 @@ These commands manage omk packages, not the omk CLI installation. To uninstall o
|
|
|
177
192
|
|
|
178
193
|
See [OMK Packages](packages.md) for package sources and security notes.
|
|
179
194
|
|
|
195
|
+
### Session Doctor
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
omk session doctor [--session <path|id>] [--repair [--dry-run]]
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Exit codes: `0` healthy or successfully repaired, `1` issues found or dry-run repairs available, `2` refused/usage/CAS failure.
|
|
202
|
+
|
|
203
|
+
### Provider Doctor
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
omk provider doctor <provider-id> [--level <0|1>] [--model <model-id>] [--timeout <ms>] [--probe-model <model-id>]
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Diagnoses one provider and prints a single sanitized JSON document. Exit codes are stable: `0` ok, `1` diagnosis failed, `2` usage error. The legacy flag form `omk --doctor-provider <provider-id>` (with `--doctor-level`, `--doctor-model`, `--doctor-timeout`) remains an alias.
|
|
210
|
+
|
|
211
|
+
- **Level 0** (default) — static checks only, no network: config resolution, URL/scheme/address policy, model↔provider relation, credential presence.
|
|
212
|
+
- **Level 1** (`--level 1`) — adds non-generative, GET-only reachability probes (root + `/models`) with strict timeouts, no redirects, and DNS/address pinning. Results use the exact probe categories `ok | network | auth | unsupported-endpoint | server`: a root or `/models` 404 is neutral (`unsupported-endpoint`), 401/403 is an auth failure, and 5xx is a `server` failure.
|
|
213
|
+
- **Level 2** — reachable only via the explicit `--probe-model <model-id>` opt-in: sends one minimal-token generative request (`max_tokens: 1`) to the completions endpoint. **This may incur provider costs**; the JSON result marks it with `"costWarning": true`. No tool-call probe is ever sent.
|
|
214
|
+
|
|
215
|
+
Config sources, highest precedence first: `models.json`, `KIMI_BASE_URL`/`KIMI_MODEL_NAME` env, `~/.kimi/config.toml` root keys, then `[providers.<name>]` TOML tables with `type = "openai_legacy"` — the last are classified `custom-openai-compatible`, so native-only checks (login, native config) are skipped and endpoint reachability is checked instead. Credentials, URL userinfo/query/fragment, request bodies, and response bodies never appear in the output; malformed TOML is reported by line number only.
|
|
216
|
+
|
|
180
217
|
### Modes
|
|
181
218
|
|
|
182
219
|
| Flag | Description |
|
|
@@ -308,6 +345,7 @@ omk --exclude-tools ask_question
|
|
|
308
345
|
| `OMK_CODING_AGENT_DIR` | Override config directory; default is `~/.omk/agent` |
|
|
309
346
|
| `OMK_CODING_AGENT_SESSION_DIR` | Override session storage directory; overridden by `--session-dir` |
|
|
310
347
|
| `OMK_PACKAGE_DIR` | Override package directory, useful for Nix/Guix store paths |
|
|
348
|
+
| `OMK_TOOL_SCHEDULER` | Override the tool scheduler with `dag-v2` or use `waves-v1` for process-local rollback |
|
|
311
349
|
| `OMK_OFFLINE` | Disable startup network operations, including update checks, package update checks, and install/update telemetry |
|
|
312
350
|
| `OMK_SKIP_VERSION_CHECK` | Skip the OMK version update check at startup. This prevents the `the OMK repository` latest-version request |
|
|
313
351
|
| `OMK_TELEMETRY` | Override install/update telemetry and provider attribution headers: `1`/`true`/`yes` or `0`/`false`/`no`. This does not disable update checks |
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "omk-extension-custom-provider",
|
|
3
|
-
"version": "0.
|
|
2
|
+
"name": "omk-extension-custom-provider-anthropic",
|
|
3
|
+
"version": "0.91.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
|
-
"name": "omk-extension-custom-provider",
|
|
9
|
-
"version": "0.
|
|
8
|
+
"name": "omk-extension-custom-provider-anthropic",
|
|
9
|
+
"version": "0.91.0",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@anthropic-ai/sdk": "
|
|
11
|
+
"@anthropic-ai/sdk": "0.52.0"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"node_modules/@anthropic-ai/sdk": {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omk-extension-gondolin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.91.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "omk-extension-gondolin",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.91.0",
|
|
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": "0.
|
|
3
|
+
"version": "0.91.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "omk-extension-sandbox",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.91.0",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sandbox-runtime": "0.0.26"
|
|
12
12
|
}
|