clinkx 1.0.0 → 1.1.1
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 +95 -0
- package/README.md +184 -112
- package/clinkx-workflows/dist/chairman-knobs.d.ts +24 -0
- package/clinkx-workflows/dist/chairman-knobs.js +27 -0
- package/clinkx-workflows/dist/chairman-knobs.js.map +1 -0
- package/clinkx-workflows/dist/clink-client.d.ts +10 -0
- package/clinkx-workflows/dist/clink-client.js +39 -1
- package/clinkx-workflows/dist/clink-client.js.map +1 -1
- package/clinkx-workflows/dist/config.d.ts +29 -1
- package/clinkx-workflows/dist/config.js +35 -2
- package/clinkx-workflows/dist/config.js.map +1 -1
- package/clinkx-workflows/dist/context-preflight.d.ts +5 -0
- package/clinkx-workflows/dist/context-preflight.js.map +1 -1
- package/clinkx-workflows/dist/council-execution-policy.d.ts +68 -0
- package/clinkx-workflows/dist/council-execution-policy.js +110 -0
- package/clinkx-workflows/dist/council-execution-policy.js.map +1 -0
- package/clinkx-workflows/dist/council-expander.d.ts +9 -8
- package/clinkx-workflows/dist/council-expander.js +18 -9
- package/clinkx-workflows/dist/council-expander.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/activity-contract.d.ts +5557 -4
- package/clinkx-workflows/dist/dashboard/activity-contract.js +55 -3
- package/clinkx-workflows/dist/dashboard/activity-contract.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/activity-reader.d.ts +9 -5
- package/clinkx-workflows/dist/dashboard/activity-reader.js +15 -2
- package/clinkx-workflows/dist/dashboard/activity-reader.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/api-routes.d.ts +4 -0
- package/clinkx-workflows/dist/dashboard/api-routes.js +133 -25
- package/clinkx-workflows/dist/dashboard/api-routes.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/context-builder-invocation-contract.d.ts +3865 -0
- package/clinkx-workflows/dist/dashboard/context-builder-invocation-contract.js +69 -0
- package/clinkx-workflows/dist/dashboard/context-builder-invocation-contract.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/context-run-reader.d.ts +36 -2
- package/clinkx-workflows/dist/dashboard/context-run-reader.js +142 -19
- package/clinkx-workflows/dist/dashboard/context-run-reader.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/contracts.d.ts +20027 -480
- package/clinkx-workflows/dist/dashboard/contracts.js +133 -6
- package/clinkx-workflows/dist/dashboard/contracts.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/index.d.ts +4 -0
- package/clinkx-workflows/dist/dashboard/index.js +4 -0
- package/clinkx-workflows/dist/dashboard/index.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/invocation-contract.d.ts +786 -0
- package/clinkx-workflows/dist/dashboard/invocation-contract.js +201 -0
- package/clinkx-workflows/dist/dashboard/invocation-contract.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/lazy-content.d.ts +14 -1
- package/clinkx-workflows/dist/dashboard/lazy-content.js +53 -2
- package/clinkx-workflows/dist/dashboard/lazy-content.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/native-transcript/contract.d.ts +90 -0
- package/clinkx-workflows/dist/dashboard/native-transcript/contract.js +31 -0
- package/clinkx-workflows/dist/dashboard/native-transcript/contract.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/native-transcript/projection.d.ts +12 -0
- package/clinkx-workflows/dist/dashboard/native-transcript/projection.js +286 -0
- package/clinkx-workflows/dist/dashboard/native-transcript/projection.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/progress-report-contract.d.ts +147 -4
- package/clinkx-workflows/dist/dashboard/progress-report-contract.js +11 -11
- package/clinkx-workflows/dist/dashboard/progress-report-contract.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/progress-report-reader.js +4 -56
- package/clinkx-workflows/dist/dashboard/progress-report-reader.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/progress-report-status-store.d.ts +2 -1
- package/clinkx-workflows/dist/dashboard/progress-report-status-store.js +6 -5
- package/clinkx-workflows/dist/dashboard/progress-report-status-store.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/prompt-builder-library-contract.d.ts +194 -0
- package/clinkx-workflows/dist/dashboard/prompt-builder-library-contract.js +89 -0
- package/clinkx-workflows/dist/dashboard/prompt-builder-library-contract.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/prompt-builder-library-store.d.ts +26 -0
- package/clinkx-workflows/dist/dashboard/prompt-builder-library-store.js +102 -0
- package/clinkx-workflows/dist/dashboard/prompt-builder-library-store.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/request-admission.js +4 -0
- package/clinkx-workflows/dist/dashboard/request-admission.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/scanner.d.ts +3 -0
- package/clinkx-workflows/dist/dashboard/scanner.js +52 -8
- package/clinkx-workflows/dist/dashboard/scanner.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/server-factory.d.ts +14 -1
- package/clinkx-workflows/dist/dashboard/server-factory.js +73 -21
- package/clinkx-workflows/dist/dashboard/server-factory.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/session-log-contract.d.ts +223 -56
- package/clinkx-workflows/dist/dashboard/session-log-contract.js +26 -0
- package/clinkx-workflows/dist/dashboard/session-log-contract.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/session-log-journal.js +10 -3
- package/clinkx-workflows/dist/dashboard/session-log-journal.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/session-log-redaction.d.ts +9 -1
- package/clinkx-workflows/dist/dashboard/session-log-redaction.js +793 -59
- package/clinkx-workflows/dist/dashboard/session-log-redaction.js.map +1 -1
- package/clinkx-workflows/dist/dashboard-ui/assets/index-JPHQVtn9.js +106 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/style-DOMHk-j6.css +1 -0
- package/clinkx-workflows/dist/dashboard-ui/index.html +2 -2
- package/clinkx-workflows/dist/delegate-finalizer-policy.d.ts +26 -0
- package/clinkx-workflows/dist/delegate-finalizer-policy.js +72 -0
- package/clinkx-workflows/dist/delegate-finalizer-policy.js.map +1 -0
- package/clinkx-workflows/dist/delegate-signature.d.ts +14 -0
- package/clinkx-workflows/dist/delegate-signature.js +14 -0
- package/clinkx-workflows/dist/delegate-signature.js.map +1 -0
- package/clinkx-workflows/dist/delegate-validate.d.ts +32 -2
- package/clinkx-workflows/dist/delegate-validate.js +51 -0
- package/clinkx-workflows/dist/delegate-validate.js.map +1 -1
- package/clinkx-workflows/dist/engine.d.ts +113 -3
- package/clinkx-workflows/dist/engine.js +476 -80
- package/clinkx-workflows/dist/engine.js.map +1 -1
- package/clinkx-workflows/dist/errors.d.ts +22 -2
- package/clinkx-workflows/dist/errors.js +30 -2
- package/clinkx-workflows/dist/errors.js.map +1 -1
- package/clinkx-workflows/dist/fidelity.d.ts +47 -1
- package/clinkx-workflows/dist/fidelity.js +54 -1
- package/clinkx-workflows/dist/fidelity.js.map +1 -1
- package/clinkx-workflows/dist/fingerprint.d.ts +24 -6
- package/clinkx-workflows/dist/fingerprint.js +32 -9
- package/clinkx-workflows/dist/fingerprint.js.map +1 -1
- package/clinkx-workflows/dist/index.js +53 -1
- package/clinkx-workflows/dist/index.js.map +1 -1
- package/clinkx-workflows/dist/logger.d.ts +1 -1
- package/clinkx-workflows/dist/logger.js +17 -3
- package/clinkx-workflows/dist/logger.js.map +1 -1
- package/clinkx-workflows/dist/monotonic-clock.d.ts +19 -0
- package/clinkx-workflows/dist/monotonic-clock.js +22 -0
- package/clinkx-workflows/dist/monotonic-clock.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/contract.d.ts +52 -52
- package/clinkx-workflows/dist/plan-review/publication.d.ts +4 -4
- package/clinkx-workflows/dist/plan-review/run-state.d.ts +16 -16
- package/clinkx-workflows/dist/roster-contract.d.ts +889 -0
- package/clinkx-workflows/dist/roster-contract.js +180 -0
- package/clinkx-workflows/dist/roster-contract.js.map +1 -0
- package/clinkx-workflows/dist/rosters.d.ts +14 -0
- package/clinkx-workflows/dist/rosters.js +169 -0
- package/clinkx-workflows/dist/rosters.js.map +1 -0
- package/clinkx-workflows/dist/run-health.d.ts +7 -0
- package/clinkx-workflows/dist/run-health.js +25 -0
- package/clinkx-workflows/dist/run-health.js.map +1 -0
- package/clinkx-workflows/dist/schema.d.ts +64 -0
- package/clinkx-workflows/dist/schema.js +24 -0
- package/clinkx-workflows/dist/schema.js.map +1 -1
- package/clinkx-workflows/dist/server.js +2 -0
- package/clinkx-workflows/dist/server.js.map +1 -1
- package/clinkx-workflows/dist/shutdown.d.ts +15 -2
- package/clinkx-workflows/dist/shutdown.js +60 -16
- package/clinkx-workflows/dist/shutdown.js.map +1 -1
- package/clinkx-workflows/dist/state-schema.d.ts +23 -0
- package/clinkx-workflows/dist/state.d.ts +5 -0
- package/clinkx-workflows/dist/state.js +128 -21
- package/clinkx-workflows/dist/state.js.map +1 -1
- package/clinkx-workflows/dist/stdio-watchdog.d.ts +52 -0
- package/clinkx-workflows/dist/stdio-watchdog.js +212 -0
- package/clinkx-workflows/dist/stdio-watchdog.js.map +1 -0
- package/clinkx-workflows/dist/types.d.ts +6 -0
- package/clinkx-workflows/dist/validators/council.d.ts +50 -50
- package/clinkx-workflows/dist/validators/plan-review.d.ts +3 -3
- package/clinkx-workflows/dist/workflow-tools.d.ts +70 -0
- package/clinkx-workflows/dist/workflow-tools.js +760 -168
- package/clinkx-workflows/dist/workflow-tools.js.map +1 -1
- package/clinkx-workflows/templates/council/answer-chairman.txt +3 -0
- package/clinkx-workflows/templates/council/answer-cross-reviewer.txt +3 -0
- package/clinkx-workflows/templates/council/answer-specialist.txt +3 -0
- package/clinkx-workflows/templates/council/chairman.txt +3 -0
- package/clinkx-workflows/templates/council/code-review-chairman.txt +3 -0
- package/clinkx-workflows/templates/council/code-review-cross-reviewer.txt +3 -0
- package/clinkx-workflows/templates/council/code-review-reviewer.txt +3 -0
- package/clinkx-workflows/templates/council/debug-chairman.txt +3 -0
- package/clinkx-workflows/templates/council/debug-cross-reviewer.txt +3 -0
- package/clinkx-workflows/templates/council/debug-debugger.txt +3 -0
- package/clinkx-workflows/templates/council/discover-analyst.txt +3 -0
- package/clinkx-workflows/templates/council/discover-chairman.txt +3 -0
- package/clinkx-workflows/templates/council/discover-cross-reviewer.txt +3 -0
- package/clinkx-workflows/templates/council/member.txt +3 -0
- package/clinkx-workflows/templates/council/plan-review-chairman.txt +3 -0
- package/clinkx-workflows/templates/council/plan-review-cross-reviewer.txt +3 -0
- package/clinkx-workflows/templates/council/plan-review-reviewer.txt +3 -0
- package/clinkx-workflows/templates/council/reviewer.txt +3 -0
- package/clinkx-workflows/workflows/council-answer.yaml +3 -0
- package/clinkx-workflows/workflows/council-code-review.yaml +3 -0
- package/clinkx-workflows/workflows/council-debug.yaml +3 -0
- package/clinkx-workflows/workflows/council-default.yaml +7 -0
- package/clinkx-workflows/workflows/council-discover.yaml +3 -0
- package/clinkx-workflows/workflows/council-plan-review.yaml +3 -0
- package/conf/adapters/agy.json +9 -2
- package/conf/adapters/claude.json +7 -0
- package/conf/adapters/codex.json +7 -0
- package/conf/adapters/glm.json +19 -3
- package/conf/adapters/grok.json +9 -2
- package/conf/adapters/hapi/agy.json +9 -2
- package/conf/adapters/hapi/claude.json +7 -0
- package/conf/adapters/hapi/codex.json +7 -0
- package/conf/adapters/hapi/glm.json +20 -4
- package/conf/rosters/default-council.json +21 -0
- package/dist/activity-journal.d.ts +17 -3
- package/dist/activity-journal.js +404 -79
- package/dist/activity-journal.js.map +1 -1
- package/dist/codex/agent-tools.js +36 -0
- package/dist/codex/agent-tools.js.map +1 -1
- package/dist/codex/app-server-client.d.ts +3 -0
- package/dist/codex/app-server-client.js +11 -0
- package/dist/codex/app-server-client.js.map +1 -1
- package/dist/codex/app-server-registry.d.ts +18 -0
- package/dist/codex/app-server-registry.js +88 -2
- package/dist/codex/app-server-registry.js.map +1 -1
- package/dist/codex/client-types.d.ts +7 -1
- package/dist/codex/protocol.d.ts +4 -4
- package/dist/config.d.ts +220 -23
- package/dist/config.js +104 -1
- package/dist/config.js.map +1 -1
- package/dist/context-builder/bundle.d.ts +13 -0
- package/dist/context-builder/bundle.js +46 -0
- package/dist/context-builder/bundle.js.map +1 -1
- package/dist/context-builder/delegate-finalizer-effective.d.ts +33 -0
- package/dist/context-builder/delegate-finalizer-effective.js +82 -0
- package/dist/context-builder/delegate-finalizer-effective.js.map +1 -0
- package/dist/context-builder/delegate-packet.d.ts +18 -0
- package/dist/context-builder/delegate-packet.js +73 -9
- package/dist/context-builder/delegate-packet.js.map +1 -1
- package/dist/context-builder/delegate-reconstruction.d.ts +29 -0
- package/dist/context-builder/delegate-reconstruction.js +110 -41
- package/dist/context-builder/delegate-reconstruction.js.map +1 -1
- package/dist/context-builder/delegate-validation.d.ts +31 -0
- package/dist/context-builder/delegate-validation.js +87 -10
- package/dist/context-builder/delegate-validation.js.map +1 -1
- package/dist/context-builder/delegate.d.ts +9 -0
- package/dist/context-builder/delegate.js +210 -59
- package/dist/context-builder/delegate.js.map +1 -1
- package/dist/context-builder/diagnostics.d.ts +1 -1
- package/dist/context-builder/diagnostics.js.map +1 -1
- package/dist/context-builder/discovery-progress.d.ts +25 -0
- package/dist/context-builder/discovery-progress.js +64 -0
- package/dist/context-builder/discovery-progress.js.map +1 -0
- package/dist/context-builder/discovery-watchdog.d.ts +15 -0
- package/dist/context-builder/discovery-watchdog.js +39 -0
- package/dist/context-builder/discovery-watchdog.js.map +1 -0
- package/dist/context-builder/discovery.d.ts +7 -0
- package/dist/context-builder/discovery.js +119 -7
- package/dist/context-builder/discovery.js.map +1 -1
- package/dist/context-builder/external-gaps.d.ts +73 -0
- package/dist/context-builder/external-gaps.js +248 -0
- package/dist/context-builder/external-gaps.js.map +1 -0
- package/dist/context-builder/globs.d.ts +1 -0
- package/dist/context-builder/globs.js +15 -0
- package/dist/context-builder/globs.js.map +1 -1
- package/dist/context-builder/handler.d.ts +42 -1
- package/dist/context-builder/handler.js +690 -62
- package/dist/context-builder/handler.js.map +1 -1
- package/dist/context-builder/invocation-sidecar.d.ts +41 -0
- package/dist/context-builder/invocation-sidecar.js +189 -0
- package/dist/context-builder/invocation-sidecar.js.map +1 -0
- package/dist/context-builder/lifecycle-contract.d.ts +51 -51
- package/dist/context-builder/mutation-lock.d.ts +32 -0
- package/dist/context-builder/mutation-lock.js +321 -0
- package/dist/context-builder/mutation-lock.js.map +1 -0
- package/dist/context-builder/review-coverage.d.ts +32 -0
- package/dist/context-builder/review-coverage.js +130 -23
- package/dist/context-builder/review-coverage.js.map +1 -1
- package/dist/context-builder/schema.d.ts +76 -1
- package/dist/context-builder/schema.js +21 -1
- package/dist/context-builder/schema.js.map +1 -1
- package/dist/context-builder/secrets.d.ts +31 -0
- package/dist/context-builder/secrets.js +871 -84
- package/dist/context-builder/secrets.js.map +1 -1
- package/dist/context-builder/status.d.ts +1 -1
- package/dist/context-builder/status.js +1 -0
- package/dist/context-builder/status.js.map +1 -1
- package/dist/context-builder/storage.d.ts +29 -5
- package/dist/context-builder/storage.js +311 -236
- package/dist/context-builder/storage.js.map +1 -1
- package/dist/context-builder/versions.d.ts +19 -4
- package/dist/context-builder/versions.js +19 -4
- package/dist/context-builder/versions.js.map +1 -1
- package/dist/context-builder/workflow-runner.d.ts +6 -0
- package/dist/context-builder/workflow-runner.js +363 -173
- package/dist/context-builder/workflow-runner.js.map +1 -1
- package/dist/dashboard-adapter-catalog.js +7 -0
- package/dist/dashboard-adapter-catalog.js.map +1 -1
- package/dist/dashboard-cli.d.ts +2 -0
- package/dist/dashboard-cli.js +40 -2
- package/dist/dashboard-cli.js.map +1 -1
- package/dist/dashboard-companion/client.d.ts +1 -0
- package/dist/dashboard-companion/client.js +22 -3
- package/dist/dashboard-companion/client.js.map +1 -1
- package/dist/dashboard-companion/protocol.js +4 -1
- package/dist/dashboard-companion/protocol.js.map +1 -1
- package/dist/dashboard-gateway/index.d.ts +1 -0
- package/dist/dashboard-gateway/index.js +33 -2
- package/dist/dashboard-gateway/index.js.map +1 -1
- package/dist/handler.js +5 -1
- package/dist/handler.js.map +1 -1
- package/dist/index.d.ts +18 -1
- package/dist/index.js +145 -7
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts +1 -1
- package/dist/logger.js +18 -3
- package/dist/logger.js.map +1 -1
- package/dist/parsers/agy-stream-json.d.ts +14 -0
- package/dist/parsers/agy-stream-json.js +172 -0
- package/dist/parsers/agy-stream-json.js.map +1 -0
- package/dist/parsers/extract.js +5 -1
- package/dist/parsers/extract.js.map +1 -1
- package/dist/parsers/observed-invocation.d.ts +20 -0
- package/dist/parsers/observed-invocation.js +42 -0
- package/dist/parsers/observed-invocation.js.map +1 -0
- package/dist/pipeline.d.ts +13 -0
- package/dist/pipeline.js +60 -10
- package/dist/pipeline.js.map +1 -1
- package/dist/progress-report/lock.d.ts +74 -0
- package/dist/progress-report/lock.js +343 -0
- package/dist/progress-report/lock.js.map +1 -0
- package/dist/progress-report/schema.d.ts +808 -0
- package/dist/progress-report/schema.js +119 -0
- package/dist/progress-report/schema.js.map +1 -0
- package/dist/progress-report/store.d.ts +66 -0
- package/dist/progress-report/store.js +766 -0
- package/dist/progress-report/store.js.map +1 -0
- package/dist/progress-report/tools.d.ts +20 -0
- package/dist/progress-report/tools.js +141 -0
- package/dist/progress-report/tools.js.map +1 -0
- package/dist/prompt-mode.d.ts +1 -1
- package/dist/prompt-mode.js +7 -2
- package/dist/prompt-mode.js.map +1 -1
- package/dist/runner.d.ts +7 -0
- package/dist/runner.js +10 -3
- package/dist/runner.js.map +1 -1
- package/dist/safety.d.ts +50 -0
- package/dist/safety.js +182 -1
- package/dist/safety.js.map +1 -1
- package/dist/schema.d.ts +8 -0
- package/dist/schema.js +20 -0
- package/dist/schema.js.map +1 -1
- package/dist/server.d.ts +6 -1
- package/dist/server.js +94 -8
- package/dist/server.js.map +1 -1
- package/dist/session-log-stream.d.ts +1 -1
- package/dist/session-log-stream.js +280 -33
- package/dist/session-log-stream.js.map +1 -1
- package/dist/stdio-activity.d.ts +28 -0
- package/dist/stdio-activity.js +72 -0
- package/dist/stdio-activity.js.map +1 -0
- package/docs/configuration.md +426 -0
- package/docs/security.md +293 -0
- package/package.json +5 -5
- package/clinkx-workflows/dist/dashboard-ui/assets/index-DOkMXTfB.js +0 -25
- package/clinkx-workflows/dist/dashboard-ui/assets/style-ChJsn0KD.css +0 -1
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
# Configuration
|
|
2
|
+
|
|
3
|
+
ClinkX is config-driven: you define one or more **CLI adapters** as JSON files. At runtime, ClinkX loads adapters into a registry and resolves `cli_name` from each `tools/call` request.
|
|
4
|
+
|
|
5
|
+
## Config Discovery Order
|
|
6
|
+
|
|
7
|
+
ClinkX discovers adapter JSON files in this order:
|
|
8
|
+
|
|
9
|
+
1. `CLINKX_CONFIG_PATH` (file or directory) — **replaces** the search path entirely; shipped adapters are not loaded
|
|
10
|
+
2. `${XDG_CONFIG_HOME:-~/.config}/clinkx/adapters/*.json`
|
|
11
|
+
3. Packaged `conf/adapters/*.json` relative to the installed package (`import.meta.url`), **not** `process.cwd()`
|
|
12
|
+
|
|
13
|
+
If the same adapter name appears more than once, ClinkX uses **first-wins**: the higher-precedence source (discovered earlier in the order above) is kept, and any later file with the same name is skipped with a log line naming the kept and skipped paths. ClinkX does not fail on a duplicate name. A leftover XDG file that fails schema validation aborts the whole load; with default-on workflow preflight that is a fatal `ConfigError`.
|
|
14
|
+
|
|
15
|
+
## Adapter JSON Reference
|
|
16
|
+
|
|
17
|
+
Minimal adapter:
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"name": "agy",
|
|
22
|
+
"command": "agy"
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Full field reference:
|
|
27
|
+
|
|
28
|
+
| Field | Type | Default | Notes |
|
|
29
|
+
| --- | --- | --- | --- |
|
|
30
|
+
| `name` | string | (required) | Adapter name used as `cli_name`. Must be unique. |
|
|
31
|
+
| `command` | string | (required) | Executable to spawn. Uses `shell:false`. |
|
|
32
|
+
| `runner` | string | (optional) | Reserved for future compatibility; unused by v1. |
|
|
33
|
+
| `args` | string[] | `[]` | Safe args always included. |
|
|
34
|
+
| `unsafe_args` | string[] | `[]` | Always merged with `args` at runtime. Use for permission-bypass flags needed by non-interactive subprocesses. |
|
|
35
|
+
| `env` | record<string,string> | `{}` | Env injected into subprocess. |
|
|
36
|
+
| `env_allowlist` | string[] | `[]` | Additional env keys copied from the ClinkX process. |
|
|
37
|
+
| `timeout_seconds` | number | `600` | Per-call timeout (can be overridden by request `timeout_seconds`). |
|
|
38
|
+
| `parser` | enum | `"text"` | One of: `text`, `json_extract`, `codex_jsonl`, `claude_json`, `claude_stream_json`, `agy_stream_json`. |
|
|
39
|
+
| `tolerate_nonzero_exit_for_parse` | boolean | `false` | If true: a non-zero exit is treated as non-error when a valid payload is parsed. |
|
|
40
|
+
| `capabilities_hint` | string | (optional) | Inserted into the prompt to reflect the CLI agent’s capabilities. |
|
|
41
|
+
| `roles` | record<string,Role> | `{}` | Role prompts selected by request `role` (default: `"default"`). |
|
|
42
|
+
| `supports_images` | boolean | `false` | Informational (v1 does not inline image bytes). |
|
|
43
|
+
| `requires_tty` | boolean | `false` | If true: ClinkX rejects the call (PTY/TTY not supported in v1). |
|
|
44
|
+
| `result_contract` | object | `{ enabled:false, filename:"RESULT.md" }` | Optional file-based result extraction from the run dir. |
|
|
45
|
+
| `prompt_mode` | enum | `"stdin"` | One of: `stdin`, `arg`, `file`. Controls how the assembled prompt is delivered. |
|
|
46
|
+
| `prompt_file_flag` | string | (optional) | Flag starting with `-`, valid only with `prompt_mode:"file"`; delivery emits the flag and generated path together. |
|
|
47
|
+
| `invocation_overrides` | object | (optional) | Strict adapter consent block for per-call `model` and `effort`. Each knob declares an exactly two-token `args` template; effort also requires `allowed_values`. Load-time validation rejects a knob flag that exactly equals any `unsafe_args` token, `prompt_file_flag`, `native_output_file_flag`, or `stdin_placeholder_arg`. Collisions with base `args` / role `extra_args` remain legal (replacement targets). Not supported on `backend:"app_server"`. |
|
|
48
|
+
|
|
49
|
+
> **Migration note (breaking): `gemini_json` parser removed.** The `gemini` adapter and its `gemini_json` parser were removed in favor of the `agy` (Google Antigravity CLI) adapter. `gemini_json` is no longer a valid `parser` value, so any adapter config still declaring `parser: "gemini_json"` — in this repo or in your `~/.config/clinkx/adapters/*.json` — now fails `CliAdapterConfigSchema` validation when the adapters are loaded, which aborts server startup (independent of the workflow-context preflight, though preflight-enabled mode likewise hard-requires a valid registry). The server will not start until it is fixed. If you have a custom adapter using `parser: "gemini_json"` that is not emitting agy stream-json, rename it and set `parser: "text"`. Shipped agy uses `parser: "agy_stream_json"` with `--output-format stream-json`.
|
|
50
|
+
|
|
51
|
+
Role object (`roles.<roleName>`):
|
|
52
|
+
|
|
53
|
+
| Field | Type | Default | Notes |
|
|
54
|
+
| --- | --- | --- | --- |
|
|
55
|
+
| `inline_prompt` | string | (optional) | Inline role instruction inserted at top of prompt. |
|
|
56
|
+
| `prompt_file` | string | (optional) | Path (relative to the adapter config) to a prompt file, resolved into `inline_prompt` at load time; `inline_prompt` wins if both are set. |
|
|
57
|
+
| `parser` | enum | (optional) | Per-role parser override; falls back to the adapter-level `parser` when unset. |
|
|
58
|
+
| `extra_args` | string[] | `[]` | Extra args appended after the adapter `args` for this role (CLI last-wins semantics). |
|
|
59
|
+
|
|
60
|
+
## Per-call model and effort
|
|
61
|
+
|
|
62
|
+
`clink` accepts independently optional `model` and `effort` values. Omitting both preserves the complete argv, including the CLI's configured defaults. Callers cannot supply flags or templates. Models are trimmed, nonblank identifiers of 1–128 characters with no whitespace, NUL (U+0000), or leading `-`. Effort is trimmed, 1–32 characters, matches `^[a-z0-9][a-z0-9_-]*$`, and must belong to the resolved adapter's allowlist.
|
|
63
|
+
|
|
64
|
+
An adapter opts in explicitly, for example:
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
"invocation_overrides": {
|
|
68
|
+
"model": { "args": ["--model", "{value}"] },
|
|
69
|
+
"effort": {
|
|
70
|
+
"args": ["-c", "model_reasoning_effort={value}"],
|
|
71
|
+
"allowed_values": ["none", "minimal", "low", "medium", "high", "xhigh", "max"]
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Templates contain exactly two nonempty tokens: a literal flag starting with `-` and containing no `{value}`, then a token containing `{value}` exactly once. A static value prefix is supported, including a dash-leading prefix such as `--model={value}`. Model and effort templates may share a flag only when their static prefixes are disjoint: neither prefix may start with the other. Equal prefixes and an empty prefix shared with any other prefix are rejected; different suffixes after `{value}` do not disambiguate them. Different flags may use overlapping prefixes. Unknown keys inside the block and invalid templates fail adapter loading. A custom adapter with overlapping same-flag templates now fails registry loading instead of silently losing an override; none of the nine shipped subprocess adapters has this conflict.
|
|
77
|
+
|
|
78
|
+
| CLI | Model | Effort | Allowed effort values |
|
|
79
|
+
| --- | --- | --- | --- |
|
|
80
|
+
| Claude / GLM | `--model <value>` | `--effort <value>` | `low`, `medium`, `high`, `xhigh`, `max` |
|
|
81
|
+
| Grok | `--model <value>` | `--effort <value>` | `low`, `medium`, `high`, `xhigh` |
|
|
82
|
+
| agy | `--model <value>` | `--effort <value>` | `low`, `medium`, `high` |
|
|
83
|
+
| Codex | `--model <value>` | `-c model_reasoning_effort=<value>` | `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max` |
|
|
84
|
+
|
|
85
|
+
The same declarations apply to the shipped hapi templates. A declaration describes argv support, not provider acceptance of a model or proof that the provider honors effort. GLM effort honoring remains best-effort unless independently qualified. Some agy model IDs already encode effort (`…-high`, `…-low`); passing both knobs can fail at spawn with a provider error even when the effort value is in `allowed_values`.
|
|
86
|
+
|
|
87
|
+
Replacement is key-aware across adapter `args` and role `extra_args`: scan the original arguments once, remove every matching requested `[flag, value]` pair, then append model followed by effort before `unsafe_args`, native output, and prompt delivery. Matching uses the exact template flag and complete value shape: both the static prefix and suffix must match, and the candidate must be long enough for those static fragments not to overlap. Suffixes participate in ownership of a particular pair, but still do not disambiguate two same-flag knob declarations during load-time validation. Both declared templates identify pairs, even when only one override is requested: a recognized nonrequested pair remains intact, and its value is not interpreted as another flag. Newly rendered values are never scanned for removal. Thus `-c model_reasoning_effort=high` is replaced while `-c sandbox_mode=read-only` survives; a template `-c model={value}.json` owns `-c model=old.json` but preserves `-c model=old.txt` as unrelated. Aliases are not matched: `-m` is not `--model`. A nonempty prefix can own a dash-leading value; an empty prefix only owns a non-dash value. A requested empty-prefix bare flag is removed alone without consuming an unrecognized following flag. A requested nonempty-prefix flag followed by a dash-leading token that does not match its complete value shape is left intact so the follower is not orphaned. Unrelated arguments remain unchanged. Load-time validation rejects a declared invocation flag that collides with `unsafe_args`, `prompt_file_flag`, `native_output_file_flag`, or `stdin_placeholder_arg`. Collisions with base `args` / role `extra_args` remain legal replacement targets. `unsafe_args` is still not pin-swept at render time. `_debug` reports `requested_model` / `requested_effort` (the request), not argv. To witness the effective argv, set `CLINKX_LOG_LEVEL=debug` and read the stderr pino record `spawning subprocess` (`command` / `args`). Do not claim `_debug.argv` exists.
|
|
88
|
+
|
|
89
|
+
Unsupported knobs, malformed values, and effort outside the allowlist return MCP `-32602` before spawning. Root-hosted workflows validate effective calls before mutex/state creation for both sync and async requests; standalone workflows without the registry hook reject at dispatch as a permanent, non-retryable error. Context-builder delegates reject unsupported knobs under both `fail` and `fallback` policies, before run state. Delegate `InvalidParamsError` is never converted into fallback success, including an unknown provider CLI discovered at dispatch when no knobs were requested. A syntactically valid but unknown provider model can still fail at runtime.
|
|
90
|
+
|
|
91
|
+
The GLM `[1m]` suffix and `CLAUDE_CODE_AUTO_COMPACT_WINDOW` are adapter-level choices. A per-call model without `[1m]` selects the 200k route; the override does not rewrite companion environment settings. Keep the model and configured context window compatible.
|
|
92
|
+
|
|
93
|
+
### Invocation audit V2 writer activation
|
|
94
|
+
|
|
95
|
+
Invocation-audit readers are always V1/V2-capable, but every V2 persistence surface is disabled by default. Set `CLINKX_INVOCATION_AUDIT_V2_PERSISTENCE_ENABLED=true` (exact lowercase value) on producers only after all dashboards/readers have been upgraded. Unset, empty, `false`, `TRUE`, `1`, and whitespace-padded values are disabled: workflow `state_version: 1` call entries omit `invocation`, direct activity state is exact `ActivityStateV1` without `invocation`, and context-builder delegate calls do not update `invocation-audit.json`. A disabled sidecar update leaves any existing bytes untouched.
|
|
96
|
+
|
|
97
|
+
With exact `true`, root-hosted workflow calls persist their derived V2 audit, direct activities use `ActivityStateV2` when audit evidence exists, and curator/finalizer calls update the V2 sidecar. Standalone workflows still have no adapter registry/audit derivation capability, so their calls omit `invocation` even when the control is enabled. For rollback, disable producers first and retain V2-capable readers until all previously written V2 workflow state, activities, and sidecars have expired; disabling the control does not delete or downgrade existing V2 bytes.
|
|
98
|
+
|
|
99
|
+
**XDG migration and resume:** first-wins remains whole-file; a user override file must declare the block itself. Editing a referenced adapter (stage calls plus an enabled context delegate's curator and an effectively enabled finalizer) changes the fingerprint of runs using an explicit child config; unreferenced adapter JSON does not. Before any repo or XDG adapter edit, inventory unfinished resumable generic runs (`running`, `pending`, `failed`, and `cancelled`) and drain, resume to completion, or explicitly abandon them. Generic failed/cancelled status does not itself prohibit resume. Pre-edit runs become non-resumable across the fingerprint boundary; repeat the inventory for rollback. Unfinished resumable runs can also become non-resumable across a ClinkX upgrade that changes fingerprint composition (enabled context curator/finalizer refs), even if adapter JSON is unchanged — inventory/drain/abandon before deploying such a build, not only before adapter edits. Configs that omit both new keys retain their old normalized fingerprint shape. XDG edits and configured MCP restarts require separate authorization.
|
|
100
|
+
|
|
101
|
+
### Observed invocation writer activation
|
|
102
|
+
|
|
103
|
+
`ObservedInvocationV1` is a sibling persistence surface to the V2 audit — observed runtime telemetry, not another V2 provenance. Its writer gate is `CLINKX_OBSERVED_INVOCATION_PERSISTENCE_ENABLED` (exact lowercase `true` only), independent of `CLINKX_INVOCATION_AUDIT_V2_PERSISTENCE_ENABLED`, and off by default: unset, empty, `false`, `TRUE`, `1`, and whitespace-padded values write nothing. Readers always accept `ObservedInvocationV1` regardless of the control. Rollback mirrors the V2 sequence — disable writers first; disabling never scrubs already-persisted bytes. Observed values must never be baked into adapter JSON, run fingerprints, or `wfctx` cache keys. Authoritative observation sources are the `claude_stream_json` `system/init` `model` and the app-server `thread/start` `model` plus a string `reasoningEffort`; Codex exec JSONL and agy remain unknown (the dashboard renders unknown as "CLI default").
|
|
104
|
+
|
|
105
|
+
## Examples
|
|
106
|
+
|
|
107
|
+
### agy (Google Antigravity CLI, stream-json)
|
|
108
|
+
|
|
109
|
+
Shipped ClinkX uses `parser: "agy_stream_json"` with `--output-format stream-json`. Prompt delivery stays on stdin. Adapter `args` do not include `--print`. This is **not** Claude/Codex compatible. Grok still uses `claude_stream_json` because Grok's `streaming-messages-json` is Anthropic-shaped.
|
|
110
|
+
|
|
111
|
+
The stream-json discriminator is `event` (`init`, `step_update`, `result`). Canonical extract is `result.response`. `result.error` is a string present on failure. `tool_info.error` is `{type, message}`. Statuses include `SUCCESS`, `ERROR`, and `CANCELED` (one L). An empty SUCCESS `response` is a valid empty result. `ERROR`/`CANCELED` with an empty `response` is `isError`; `result.error` is carried as extract `metadata.agy_error` and as invalid-path extract content, and appears in the dashboard session log and in `_debug.parse_metadata` when `debug:true`. The default `clink` error body reports the rejection reason and does not reprint `result.error`. A present non-string `response` fails closed when it is the first result; a later malformed result is ignored after a nonempty string has already won. Session-log Timeline shows the concatenated partial transcript only when the stream ends without a terminal `result` event.
|
|
112
|
+
|
|
113
|
+
```json
|
|
114
|
+
{
|
|
115
|
+
"name": "agy",
|
|
116
|
+
"command": "agy",
|
|
117
|
+
"args": ["--print-timeout", "3600s", "--output-format", "stream-json"],
|
|
118
|
+
"parser": "agy_stream_json",
|
|
119
|
+
"prompt_mode": "stdin",
|
|
120
|
+
"timeout_seconds": 3600,
|
|
121
|
+
"idle_timeout_startup_seconds": 180,
|
|
122
|
+
"idle_timeout_seconds": 0,
|
|
123
|
+
"result_contract": {
|
|
124
|
+
"enabled": false,
|
|
125
|
+
"filename": "RESULT.md"
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
agy 1.1.22+ requires `--print` to take the prompt *text*. A valueless `--print` followed by another flag is an error (`--print took "--print-timeout" as its prompt`), and `--print <path>` is that path string as the user message — the CLI does not read the file. Do not put `--print` in `args`. Headless ClinkX delivers the prompt on stdin without `--print`; agy lists stdin as a native prompt source. Keep `--print-timeout` in `args` so a later `--print` still has a bounded wait; `timeout_seconds` is the subprocess ceiling. The shipped adapter uses a 1-hour print timeout (`--print-timeout 3600s` with `timeout_seconds: 3600`). stream-json normally emits `init` early, so `idle_timeout_startup_seconds` is `180` (text/json were silent until idle). Early-failure paths such as an invalid `--model` may emit only the terminal `result` with no `init`. Direct `clink` session logs are retained for this structured parser when `CLINKX_DIRECT_SESSION_LOGS_ENABLED` is on (default).
|
|
131
|
+
|
|
132
|
+
### agy via the hapi gateway (optional template)
|
|
133
|
+
|
|
134
|
+
`conf/adapters/hapi/agy.json` is an unverified **template**, not a ready-to-use adapter. It runs `agy` through a `hapi` gateway (`"command": "hapi"`, with `agy` as the first arg) and ships a placeholder `HAPI_API_URL` of `https://your.domain.com`. To use it you must supply a real `HAPI_API_URL` and a `hapi` gateway that actually proxies `agy`. It is optional and not needed for the direct `agy` adapter above.
|
|
135
|
+
|
|
136
|
+
### Codex (JSONL output, tail-heavy)
|
|
137
|
+
|
|
138
|
+
```json
|
|
139
|
+
{
|
|
140
|
+
"name": "codex",
|
|
141
|
+
"command": "codex",
|
|
142
|
+
"args": ["--output", "jsonl"],
|
|
143
|
+
"parser": "codex_jsonl",
|
|
144
|
+
"prompt_mode": "stdin"
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Grok (Grok Build CLI 1.0.x)
|
|
149
|
+
|
|
150
|
+
Shipped as `conf/adapters/grok.json` (`command: "grok"`). Headless `grok` does **not** read stdin, so `prompt_mode` is `file` and `prompt_file_flag` is `--prompt-file`. The runner appends this flag and its generated path together after `unsafe_args`; do not leave a bare prompt-file flag in `args`. The adapter uses `parser: "claude_stream_json"` because `--output-format streaming-messages-json` is Anthropic Messages compatible. `result_contract` is disabled. `unsafe_args` is empty; `--always-approve` lives in `args`. The adapter does not pin `-m`.
|
|
151
|
+
|
|
152
|
+
```json
|
|
153
|
+
{
|
|
154
|
+
"name": "grok",
|
|
155
|
+
"command": "grok",
|
|
156
|
+
"args": [
|
|
157
|
+
"--always-approve",
|
|
158
|
+
"--no-auto-update",
|
|
159
|
+
"--verbatim",
|
|
160
|
+
"--output-format",
|
|
161
|
+
"streaming-messages-json"
|
|
162
|
+
],
|
|
163
|
+
"unsafe_args": [],
|
|
164
|
+
"env_allowlist": ["XAI_API_KEY"],
|
|
165
|
+
"parser": "claude_stream_json",
|
|
166
|
+
"prompt_mode": "file",
|
|
167
|
+
"prompt_file_flag": "--prompt-file",
|
|
168
|
+
"result_contract": {
|
|
169
|
+
"enabled": false,
|
|
170
|
+
"filename": "RESULT.md"
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Local auth is OAuth via `~/.grok/auth.json` (`HOME` is in the sanitized baseline). `XAI_API_KEY` is the extra allowlist entry.
|
|
176
|
+
|
|
177
|
+
### GLM (Claude Code harness on Z.ai)
|
|
178
|
+
|
|
179
|
+
Shipped as `conf/adapters/glm.json` (`command: "claude"`). The optional template `conf/adapters/hapi/glm.json` uses `hapi` + `--yolo` instead of `claude` + `--permission-mode acceptEdits`; copy that file over `~/.config/clinkx/adapters/glm.json` if you spawn through hapi, then fill `ANTHROPIC_AUTH_TOKEN` and `HAPI_API_URL`.
|
|
180
|
+
|
|
181
|
+
The hapi template has `result_contract.enabled: true` (prompt-honor `RESULT.md` in the run dir, no `native_output_file_flag`) so long `--verbose stream-json` council seats can bypass capture-truncation fidelity hard-fails when the file is actually written. Shipped `conf/adapters/glm.json` (`command: claude`, `--permission-mode acceptEdits`) keeps `result_contract.enabled: false`: a 2026-08-28 overflow probe completed exit 0 with stdout truncated and never created `RESULT.md` under `${TMPDIR}/clinkx/runs`. Enabling it would fall through to the parser and still hard-fail context-producing workflow seats. Live XDG `~/.config/clinkx/adapters/glm.json` first-wins over shipped `glm.json` (no merge). A hapi live overlay must set `enabled: true` itself; flipping only the packaged claude glm.json does not affect a hapi XDG override.
|
|
182
|
+
|
|
183
|
+
Z.ai's Anthropic-compatible API plus Claude Code's 1M default is a known overflow shape (`API Error: The model has reached its context window limit`). The shipped spawn pins the official 1M Coding Plan route:
|
|
184
|
+
|
|
185
|
+
- `--model glm-5.3[1m]` and `ANTHROPIC_DEFAULT_{SONNET,OPUS}_MODEL=glm-5.3[1m]` (Haiku → `glm-4.7`)
|
|
186
|
+
- `CLAUDE_CODE_AUTO_COMPACT_WINDOW=1000000` (Z.ai's documented companion to the `[1m]` suffix; not the `--autocompact` CLI flag)
|
|
187
|
+
|
|
188
|
+
`--verbose` + `--output-format stream-json` are load-bearing for `parser: "claude_stream_json"`. Do not switch json roles to `--output-format json`.
|
|
189
|
+
|
|
190
|
+
If `glm-5.3[1m]` 404s, fall back to the 200k pin: drop the `[1m]` suffix, set `CLAUDE_CODE_DISABLE_1M_CONTEXT=1`, and `CLAUDE_CODE_AUTO_COMPACT_WINDOW=200000`. Do not mix the two pins.
|
|
191
|
+
|
|
192
|
+
## Environment Variables
|
|
193
|
+
|
|
194
|
+
| Variable | Purpose | Default |
|
|
195
|
+
| --- | --- | --- |
|
|
196
|
+
| `CLINKX_CONFIG_PATH` | Override adapter config file/directory. Replaces XDG + packaged builtins entirely. | unset |
|
|
197
|
+
| `CLINKX_ALLOWED_ROOTS` | Comma-separated allow-roots for `absolute_file_paths` / `images`. Fatal at startup only when cwd is filesystem root and this is unset. | `process.cwd()` |
|
|
198
|
+
| `CLINKX_WORKFLOWS_WORKSPACE_ROOT` | Workflow workspace root (plan_file containment, relative `cb_*` / `context_files` resolution). Unset/empty warns and falls back to `process.cwd()`. | unset → cwd |
|
|
199
|
+
| `CLINKX_WORKFLOWS_CONTEXT_PREFLIGHT_ENABLED` | Master switch for workflow context preflight. Unset/empty is enabled. Exactly `false` injects no runner and skips default-delegate startup validation. | `true` |
|
|
200
|
+
| `CLINKX_TIMEOUT_SECONDS` | Default timeout (seconds) | `600` |
|
|
201
|
+
| `CLINKX_SERVER_IDLE_TIMEOUT_SECONDS` | Opt-in idle lifetime for either STDIO server, in seconds. `0` disables idle shutdown; distinct from adapter output-idle timeouts. | `0` |
|
|
202
|
+
| `CLINKX_MAX_CONCURRENT` | Concurrent subprocess limit (fail-fast) | `5` |
|
|
203
|
+
| `CLINKX_MAX_PROMPT_BYTES` | Max prompt bytes written/passed to subprocess | `1048576` |
|
|
204
|
+
| `CLINKX_MAX_OUTPUT_BYTES` | Legacy per-stream capture control, superseded by CLINKX_MAX_CAPTURE_BYTES. Used as fallback when CLINKX_MAX_CAPTURE_BYTES is not set. | `10485760` |
|
|
205
|
+
| `CLINKX_MAX_CAPTURE_BYTES` | Per-stream capture retention ceiling (head + tail ring buffer). When output exceeds this, the middle is discarded and `_truncation` metadata is emitted. Result-contract-extracted calls are unaffected since output is read from a file. | `2097152` |
|
|
206
|
+
| `CLINKX_STRICT_FIDELITY` | When `true`, standalone clink returns `isError: true` if capture-layer truncation is detected on stdout-extracted (non-result-contract) calls. | `false` |
|
|
207
|
+
| `CLINKX_MAX_RESPONSE_CHARS` | Max chars returned in tool result (post-parse) | `20000` |
|
|
208
|
+
| `CLINKX_LOG_LEVEL` | Logger verbosity | `info` |
|
|
209
|
+
| `CLINKX_WORKFLOWS_STATE_DIR` | Absolute workflow state root shared by the workflow server and dashboard. The dashboard scans its `runs/` child; launch both processes with the same value. Relative values fail at startup. | See precedence below. |
|
|
210
|
+
| `XDG_STATE_HOME` | Absolute fallback base for workflow state when `CLINKX_WORKFLOWS_STATE_DIR` is unset or empty. Relative values fail at startup. | unset |
|
|
211
|
+
| `CLINKX_WORKFLOWS_DASHBOARD_PORT` | Dashboard listener port; local passkey mode binds both loopback families, while cloud passkey mode binds the private container interface. `0` selects an ephemeral local port. | `4180` |
|
|
212
|
+
| `CLINKX_WORKFLOWS_DASHBOARD_AUTH_MODE` | Dashboard auth selector. `passkey` is the default. `bearer` is a temporary rollback until the real local and live Traefik proof gates pass. `none` disables authentication entirely for loopback-only local testing (rejected in remote/gateway mode; the cloud artifacts never set it). | `passkey` |
|
|
213
|
+
| `CLINKX_WORKFLOWS_DASHBOARD_CREDENTIAL_DIR` | Optional absolute, non-root passkey credential directory. Overrides credential storage only, not workflow state. Containers pin it to the independent writable `/data/dashboard-credentials` volume. | `${CLINKX_WORKFLOWS_STATE_DIR}/dashboard/webauthn` |
|
|
214
|
+
| `CLINKX_WORKFLOWS_PROGRESS_REPORT_OVERRIDE_DIR` | Optional absolute, non-root parent directory for dashboard-private sidecars: `progress-report-status-overrides.json` and `prompt-builder-library.json`. Unset/empty keeps them beside `progress-reports/` under the workflow state directory. Containers pin it to the independent writable `/data/dashboard-overrides` volume so those files survive a read-only producer-state mount. Neither file is an execution input. | `${CLINKX_WORKFLOWS_STATE_DIR}` |
|
|
215
|
+
| `CLINKX_WORKFLOWS_DASHBOARD_RP_NAME` | WebAuthn RP display name shown by the authenticator. | `ClinkX Dashboard` |
|
|
216
|
+
| `CLINKX_WORKFLOWS_DASHBOARD_SESSION_TTL_SECONDS` | Absolute, non-sliding passkey session lifetime in seconds. | `43200` |
|
|
217
|
+
| `CLINKX_WORKFLOWS_DASHBOARD_MAX_STATE_BYTES` | Maximum admitted `state.json` bytes per run. Strict integer range `1048576..67108864`. | `16777216` |
|
|
218
|
+
| `CLINKX_WORKFLOWS_DASHBOARD_PUBLIC_API_ORIGIN` | Cloud dashboard canonical HTTPS origin. In passkey mode it must exactly equal the UI origin below; the hostname becomes the RP ID and IP literals are rejected. | _(unset → local)_ |
|
|
219
|
+
| `CLINKX_WORKFLOWS_DASHBOARD_UI_ORIGIN` | Cloud dashboard canonical HTTPS origin. Passkey mode requires the same origin as the API. | _(unset → local)_ |
|
|
220
|
+
| `CLINKX_WORKFLOWS_RETAIN_SUCCEEDED_DAYS` | Retention for ordinary synchronous successes after `run.lock` release. `0` keeps indefinitely. | `1` |
|
|
221
|
+
| `CLINKX_WORKFLOWS_RETAIN_ASYNC_DAYS` | Retention for successful detached runs. `0` keeps indefinitely. | `1` |
|
|
222
|
+
| `CLINKX_WORKFLOWS_RETAIN_FAILED_DAYS` | Retention for failed runs. `0` keeps indefinitely. | `30` |
|
|
223
|
+
| `CLINKX_WORKFLOWS_RETAIN_CANCELLED_DAYS` | Retention for cancelled runs. `0` keeps indefinitely. | `30` |
|
|
224
|
+
| `CLINKX_WORKFLOWS_RETAIN_DEBUG_DAYS` | Retention for debug-kept runs. `0` keeps indefinitely. | `7` |
|
|
225
|
+
| `CLINKX_INVOCATION_AUDIT_V2_PERSISTENCE_ENABLED` | Reader-first activation for all invocation-audit V2 writes. Only exact `true` enables root workflow call invocation, Activity V2, and context-builder sidecar updates; every other value preserves old-reader-safe writes. Readers stay V1/V2-capable. | `false` |
|
|
226
|
+
| `CLINKX_SESSION_LOG_TOOL_ARGUMENTS_PERSISTENCE_ENABLED` | Reader-first activation for live tool arguments, derived summaries, and best-effort coverage metadata. Only exact `true` enables writes; read once per producer at creation. Readers always accept extended events; disabling never rewrites existing journals. | `false` |
|
|
227
|
+
| `CLINKX_OBSERVED_INVOCATION_PERSISTENCE_ENABLED` | Reader-first activation for sibling `ObservedInvocationV1` writes (workflow call entries, Activity V3). Only exact `true` persists child-reported model/effort; every other value omits the field. Independent of the V2 gate. Readers always accept the envelope. | `false` |
|
|
228
|
+
| `CLINKX_DIRECT_SESSION_LOGS_ENABLED` | Master opt-OUT for retaining activity-family session logs on direct `clink` single runs that did not supply their own owner. When on (default), structured-parser providers (`claude_stream_json`, `codex_jsonl`, `agy_stream_json`) write a session log that surfaces in the dashboard "Single calls" list. Set to `false` to disable synthesis — those runs then show "This session log was not retained." Workflow/context runs and callers that supply their own owner are unaffected. Text-parser providers are never retained regardless of this flag. | `true` |
|
|
229
|
+
| `CLINKX_CONTEXT_BUILDER_RUNS_DIR` | Durable run directory for `context_builder` receipts, manifests, bundles, and candidate artifacts. The directory is created with private permissions where supported and must not be a broad root, home directory, workspace root, or ancestor of the workspace. | `${XDG_STATE_HOME:-~/.local/state}/clinkx/context-builder/runs` |
|
|
230
|
+
| `CLINKX_CONTEXT_BUILDER_MAX_CONCURRENT` | Fail-fast concurrency limit for `context_builder`. Requests are rejected when the limit is saturated; they are not queued. | `1` |
|
|
231
|
+
| `CLINKX_CONTEXT_ALLOW_SECRETS` | Environment-wide default for whether `context_builder` includes secret material (API keys, private keys, tokens, `.env`/`.pem`/`id_rsa`/`credentials.json`) verbatim in bundles, delegate packets, and downstream council/provider subprocesses. `false` restores fail-closed omission/redaction. Overridden per-call by `allow_secrets` and per-workflow by `cb_allow_secrets`. See "Context builder secret material". | `true` |
|
|
232
|
+
|
|
233
|
+
### Session-log tool arguments rollout
|
|
234
|
+
|
|
235
|
+
`CLINKX_SESSION_LOG_TOOL_ARGUMENTS_PERSISTENCE_ENABLED` defaults off and enables
|
|
236
|
+
extended writes only for the exact value `true`. It is read once when
|
|
237
|
+
`createProviderSessionLogProducer()` is created; changing the environment does
|
|
238
|
+
not change an existing producer. Disabled producers emit no `arguments`, no new
|
|
239
|
+
argument-derived summaries, and no `redaction.coverage`: Claude keeps
|
|
240
|
+
`"Tool invocation"`, while Codex/agy keep their legacy summaries. Redaction
|
|
241
|
+
pattern hardening remains active independently of this flag and `allow_secrets`.
|
|
242
|
+
|
|
243
|
+
Backend and browser readers always accept legacy and extended events. Deploy
|
|
244
|
+
every capable reader first, then enable producers. Rollback disables producers
|
|
245
|
+
first and keeps capable readers until extended journals age out; flag-off does
|
|
246
|
+
not make previously written gate-on journals old-reader-safe. The optional
|
|
247
|
+
`redaction.coverage: "pattern_best_effort"` describes the redaction method, not
|
|
248
|
+
cleanliness; absence is legacy metadata. Neither `no_matches` nor a positive
|
|
249
|
+
match count proves safety.
|
|
250
|
+
The native projection persists nothing and is independent of this gate.
|
|
251
|
+
|
|
252
|
+
### STDIO server lifetime
|
|
253
|
+
|
|
254
|
+
Both STDIO entrypoints monitor the parent captured at startup and request normal
|
|
255
|
+
shutdown with reason `parent-died` when that parent disappears. This covers
|
|
256
|
+
parent death without a stdin EOF, including the macOS socketpair failure mode.
|
|
257
|
+
Permission errors from the parent probe are not evidence of death. The parent
|
|
258
|
+
must own the MCP connection: a wrapper that exits while deliberately handing the
|
|
259
|
+
connection to another process is not a supported lifetime handoff. A server
|
|
260
|
+
already started under PID 1 cannot recover its previous parent's identity.
|
|
261
|
+
|
|
262
|
+
Structured diagnostics use Node's stderr stream and stop after a stderr error.
|
|
263
|
+
They are best-effort when the peer disconnects; teardown does not synchronously
|
|
264
|
+
flush an asynchronous Pino destination, which could otherwise block exit on a
|
|
265
|
+
closed macOS pipe. Failed diagnostic writes cannot recursively trigger more
|
|
266
|
+
shutdown logging.
|
|
267
|
+
|
|
268
|
+
Idle shutdown is disabled by default to preserve healthy but silent MCP sessions.
|
|
269
|
+
Set `CLINKX_SERVER_IDLE_TIMEOUT_SECONDS=1800` on the server process to opt into a
|
|
270
|
+
30-minute idle lifetime. Unset, empty, or `0` disables it. Explicit values must
|
|
271
|
+
be finite decimal seconds from `0` through `2147483.647`; invalid values fail
|
|
272
|
+
startup instead of silently disabling the watchdog or overflowing Node's timer.
|
|
273
|
+
Inbound messages and completed work refresh activity;
|
|
274
|
+
active tool handlers, admitted workflows, active Codex turns (including pending
|
|
275
|
+
approvals), and response delivery prevent idle shutdown. Idle expiry uses reason
|
|
276
|
+
`server_idle_orphan_timeout`. Parent death still triggers cleanup during active
|
|
277
|
+
work; the idle exemption does not keep an orphan alive.
|
|
278
|
+
|
|
279
|
+
Enable idle shutdown only where the host can reconnect and recover sessions.
|
|
280
|
+
Restart loses process-local continuation/session aliases and in-memory event
|
|
281
|
+
logs; Codex resume using a raw `thread_id` is the restart-safe path. Idle time
|
|
282
|
+
alone cannot distinguish an abandoned connection from a healthy quiet client.
|
|
283
|
+
These controls do not change adapter authentication, remove duplicate host MCP
|
|
284
|
+
registrations, or replace host-side connection teardown. They apply to the STDIO
|
|
285
|
+
executables, not to importing the workflow library or to the dashboard server.
|
|
286
|
+
|
|
287
|
+
Workflow state resolves in this order: nonempty `CLINKX_WORKFLOWS_STATE_DIR`,
|
|
288
|
+
nonempty `XDG_STATE_HOME` plus `/clinkx-workflows`, then nonempty `HOME` (or the
|
|
289
|
+
OS account home when `HOME` is absent or empty) plus
|
|
290
|
+
`/.local/state/clinkx-workflows`. Every selected root or base must be absolute;
|
|
291
|
+
the OS account-home fallback must also be nonempty and non-root. Older relative
|
|
292
|
+
configurations that resolved against the dashboard's cwd now fail explicitly.
|
|
293
|
+
Migrate a relative override by expanding it before launch:
|
|
294
|
+
|
|
295
|
+
```sh
|
|
296
|
+
export CLINKX_WORKFLOWS_STATE_DIR="$(pwd)/.clinkx-state"
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
Dashboard passkey challenges use protected capacities of 96 login and 32
|
|
300
|
+
registration entries, plus 8 concurrent verifications. Saturation returns 503
|
|
301
|
+
`auth_busy` with `Retry-After: 1`; live challenges are not evicted. Local
|
|
302
|
+
session/challenge cookie names include the browser-facing port, while the RP ID
|
|
303
|
+
remains bare `localhost`. Cloud cookie prefixes are unchanged.
|
|
304
|
+
|
|
305
|
+
Shutdown closes all dashboard listeners before auth/gateway resources. All
|
|
306
|
+
cleanup failures are retained in one listener-or-resource aggregate, and signal
|
|
307
|
+
handling remains idempotent.
|
|
308
|
+
|
|
309
|
+
## Context Builder
|
|
310
|
+
|
|
311
|
+
`context_builder` stores runs under environment-configured local state and uses the same adapter registry as `clink` only when delegate mode is explicitly enabled in the request. Without `delegate.enabled:true`, it uses deterministic local curation and does not invoke a CLI adapter.
|
|
312
|
+
|
|
313
|
+
Minimal request:
|
|
314
|
+
|
|
315
|
+
```json
|
|
316
|
+
{
|
|
317
|
+
"task": "Collect context for the server tool registration",
|
|
318
|
+
"roots": ["/path/to/workspace"],
|
|
319
|
+
"focus_paths": ["src/server.ts"]
|
|
320
|
+
}
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
Accepted anchor fields and scan filters:
|
|
324
|
+
|
|
325
|
+
- `focus_paths`: bounded file or directory paths resolved under one configured root
|
|
326
|
+
- `search_terms`: nonblank literal terms searched in eligible text files
|
|
327
|
+
- `include_globs`: selective root-relative include patterns that narrow scanning when combined with `focus_paths` or `search_terms`; they do not select context alone
|
|
328
|
+
- `allow_secrets`: optional boolean (default `true`) controlling whether secret material is included; see "Context builder secret material" below
|
|
329
|
+
|
|
330
|
+
The response is one minified JSON text block. The important handoff field is:
|
|
331
|
+
|
|
332
|
+
```json
|
|
333
|
+
{
|
|
334
|
+
"recommended_clink": {
|
|
335
|
+
"absolute_file_paths": [
|
|
336
|
+
"/.../artifacts/bundle.md",
|
|
337
|
+
"/.../manifest.json"
|
|
338
|
+
]
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
Pass those paths as the `absolute_file_paths` field in a later `clink` call. Do not rely on the receipt to contain source text; source-derived context lives in the persisted artifacts. The handoff remains `artifacts/bundle.md` plus `manifest.json` for deterministic, approved delegate, and fallback delegate runs.
|
|
344
|
+
|
|
345
|
+
Delegate request shape:
|
|
346
|
+
|
|
347
|
+
```json
|
|
348
|
+
{
|
|
349
|
+
"task": "Collect context for the server tool registration",
|
|
350
|
+
"roots": ["/path/to/workspace"],
|
|
351
|
+
"focus_paths": ["src/server.ts"],
|
|
352
|
+
"delegate": {
|
|
353
|
+
"enabled": true,
|
|
354
|
+
"curator": {
|
|
355
|
+
"cli_name": "<curator-cli>",
|
|
356
|
+
"role": "<curator-role>"
|
|
357
|
+
},
|
|
358
|
+
"finalizer": {
|
|
359
|
+
"cli_name": "<finalizer-cli>",
|
|
360
|
+
"role": "<finalizer-role>",
|
|
361
|
+
"min_score": 8.5
|
|
362
|
+
},
|
|
363
|
+
"failure_policy": "fallback",
|
|
364
|
+
"timeout_seconds": 120,
|
|
365
|
+
"max_response_chars": 20000
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
Delegate fields:
|
|
371
|
+
|
|
372
|
+
| Field | Required | Notes |
|
|
373
|
+
| --- | --- | --- |
|
|
374
|
+
| `delegate.enabled` | yes | `true` runs curator/finalizer orchestration; omitted or `false` keeps deterministic local curation. |
|
|
375
|
+
| `delegate.curator.cli_name` / `role` | yes when enabled | Must name an adapter and role configured in the existing adapter registry. There is no provider default. |
|
|
376
|
+
| `delegate.finalizer.cli_name` / `role` | yes when enabled | Must name an adapter and role configured in the existing adapter registry. There is no provider default. |
|
|
377
|
+
| `delegate.finalizer.min_score` | no | Defaults to the implementation policy threshold and is schema-validated in the range `0..10`. |
|
|
378
|
+
| `delegate.failure_policy` | no | `"fallback"` publishes deterministic local selection as a partial v2 run after delegate failure; `"fail"` returns a tool error and does not publish `manifest.json`. |
|
|
379
|
+
| `delegate.timeout_seconds` | no | Per delegate-call hard timeout. Omitted values use the implementation default; the schema caps accepted values. |
|
|
380
|
+
| `delegate.max_response_chars` | no | Per delegate-call response cap. Omitted values use the implementation default; the schema caps accepted values. |
|
|
381
|
+
|
|
382
|
+
Delegate provider output is not source authority. The server accepts only strict
|
|
383
|
+
JSON, validates candidate IDs and ranges against local discovery, reconstructs
|
|
384
|
+
source content locally, reapplies budgets and secret checks, and omits raw
|
|
385
|
+
provider output from receipts, manifests, summaries, and artifacts.
|
|
386
|
+
|
|
387
|
+
### Context builder mutation-lock recovery
|
|
388
|
+
|
|
389
|
+
Ordinary per-run mutation locking uses the existing exclusive-create main lock;
|
|
390
|
+
fresh and live contention does not invoke recovery. For an eligible stale main
|
|
391
|
+
lock, a remover must first create the sibling `.recovery` gate exclusively. While
|
|
392
|
+
holding that gate it authoritatively re-observes stale qualification, caller
|
|
393
|
+
admission, fingerprint identity, and removal, and removes only the unchanged
|
|
394
|
+
admitted main-lock incarnation. The `.recovery` gate is never stale-recovered.
|
|
395
|
+
|
|
396
|
+
This is an operational rollout boundary. A crash while holding the gate can wedge
|
|
397
|
+
stale recovery until operator cleanup. Quiesce old workers before a mixed-version
|
|
398
|
+
rollout against the same runs directory. The lock protocol assumes a cooperative,
|
|
399
|
+
trusted local filesystem with reliable exclusive create; it provides no NFS or
|
|
400
|
+
hostile-writer conditional-unlink guarantee.
|
|
401
|
+
|
|
402
|
+
### Context-run detail refresh
|
|
403
|
+
|
|
404
|
+
The dashboard resolves detail generation from the current observed row, then the
|
|
405
|
+
retained selection authority, then the request-start expectation. A
|
|
406
|
+
same-generation list response overlays a detail only when its completion epoch is
|
|
407
|
+
newer than that detail request, and terminal state remains monotonic across list
|
|
408
|
+
omission. Generation, terminal-audit, and recoverable-404 triggers share one
|
|
409
|
+
selection-scoped automatic reload; ordinary polls stay list-only. Each explicit
|
|
410
|
+
Retry performs at most one non-recursive detail read after refreshing the list.
|
|
411
|
+
An authoritative 404 clears pending obligations and can be escaped only by a
|
|
412
|
+
matching row from a genuinely later completed list or deliberate route re-entry.
|
|
413
|
+
The detail view does not offer Retry for `auth_expired`, `connection_changed`, or
|
|
414
|
+
`not_found` states.
|
|
415
|
+
|
|
416
|
+
### Context builder secret material
|
|
417
|
+
|
|
418
|
+
The `context_builder` secret filter is **non-blocking and default-on**. By default (`allow_secrets:true`), secret material — API keys, SSH/private keys, tokens, and files like `.env`, `.pem`, `id_rsa`, `credentials.json` — is included verbatim in curated bundles, delegate packets, and any downstream council member CLIs / upstream providers. Set the off-switch to restore fail-closed omission/redaction. There are three controls, resolved in this precedence (highest wins):
|
|
419
|
+
|
|
420
|
+
| Scope | Control | Where |
|
|
421
|
+
| --- | --- | --- |
|
|
422
|
+
| Per-call | `allow_secrets` (boolean) | standalone `context_builder` and `refine_context_run` request input |
|
|
423
|
+
| Per-workflow | `cb_allow_secrets` (boolean) | `run_workflow` variable; a context OVERRIDE variable (not an anchor) in `list_workflows` metadata |
|
|
424
|
+
| Environment | `CLINKX_CONTEXT_ALLOW_SECRETS` | environment variable (see the table above) |
|
|
425
|
+
|
|
426
|
+
Effective default when none is set: `true`. Both the standalone and workflow paths honor the env var. Allowing secrets into bundles does **not** affect log redaction, subprocess environment scrubbing, Elaris remote-session redaction, or path/allowed-root safety — see `docs/security.md`.
|