@jini-ai/core 0.7.1 → 0.7.3-next.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/README.md +40 -12
- package/dist/admin-runtime/admin-api-error.d.ts +68 -0
- package/dist/admin-runtime/admin-api-error.js +72 -0
- package/dist/admin-runtime/admin-config-error.d.ts +8 -0
- package/dist/admin-runtime/admin-config-error.js +11 -0
- package/dist/admin-runtime/controller-store.d.ts +20 -0
- package/dist/admin-runtime/controller-store.js +32 -0
- package/dist/admin-runtime/index.d.ts +13 -0
- package/dist/admin-runtime/index.js +12 -0
- package/dist/admin-runtime/panel-access.d.ts +88 -0
- package/dist/admin-runtime/panel-access.js +76 -0
- package/dist/admin-runtime/query-suffix.d.ts +5 -0
- package/dist/admin-runtime/query-suffix.js +5 -0
- package/dist/agent-handles/element-handles.d.ts +134 -0
- package/dist/agent-handles/element-handles.js +45 -0
- package/dist/agent-handles/field-descriptor.d.ts +28 -0
- package/dist/agent-handles/field-descriptor.js +3 -0
- package/dist/agent-handles/handle.d.ts +109 -0
- package/dist/agent-handles/handle.js +109 -0
- package/dist/agent-handles/index.d.ts +9 -0
- package/dist/agent-handles/index.js +6 -0
- package/dist/agent-handles/list-handles.d.ts +46 -0
- package/dist/agent-handles/list-handles.js +67 -0
- package/dist/agent-handles/secret-attrs.d.ts +14 -0
- package/dist/agent-handles/secret-attrs.js +13 -0
- package/dist/approval-batch-chain.d.ts +45 -0
- package/dist/approval-batch-chain.js +75 -0
- package/dist/approval.d.ts +33 -14
- package/dist/approval.js +57 -43
- package/dist/batch-tool-inputs.js +24 -20
- package/dist/contracts/admin-module.d.ts +166 -0
- package/dist/contracts/admin-module.js +14 -0
- package/dist/contracts/agents/definition.d.ts +459 -0
- package/dist/contracts/agents/definition.js +2 -0
- package/dist/contracts/agents/index.d.ts +7 -0
- package/dist/contracts/agents/index.js +2 -0
- package/dist/contracts/agents/launch.d.ts +64 -0
- package/dist/contracts/agents/launch.js +2 -0
- package/dist/contracts/agents/model-catalog.d.ts +213 -0
- package/dist/contracts/agents/model-catalog.js +4 -0
- package/dist/contracts/agents/native-tool-policy.d.ts +42 -0
- package/dist/contracts/agents/native-tool-policy.js +2 -0
- package/dist/contracts/ai-trace/capture.d.ts +17 -0
- package/dist/contracts/ai-trace/capture.js +43 -0
- package/dist/contracts/ai-trace/classify.d.ts +12 -0
- package/dist/contracts/ai-trace/classify.js +16 -0
- package/dist/contracts/ai-trace/index.d.ts +13 -0
- package/dist/contracts/ai-trace/index.js +6 -0
- package/dist/contracts/ai-trace/recorder.d.ts +64 -0
- package/dist/contracts/ai-trace/recorder.js +283 -0
- package/dist/contracts/ai-trace/sinks.d.ts +51 -0
- package/dist/contracts/ai-trace/sinks.js +153 -0
- package/dist/contracts/ai-trace/types.d.ts +123 -0
- package/dist/contracts/ai-trace/types.js +17 -0
- package/dist/contracts/ai-trace/usage.d.ts +16 -0
- package/dist/contracts/ai-trace/usage.js +45 -0
- package/dist/contracts/blob.d.ts +31 -0
- package/dist/contracts/blob.js +10 -0
- package/dist/contracts/capabilities.d.ts +95 -0
- package/dist/contracts/capabilities.js +111 -0
- package/dist/contracts/charts.d.ts +75 -0
- package/dist/contracts/charts.js +4 -0
- package/dist/contracts/env.d.ts +96 -0
- package/dist/contracts/env.js +6 -0
- package/dist/contracts/events/change-set.d.ts +106 -0
- package/dist/contracts/events/change-set.js +2 -0
- package/dist/contracts/events/command.d.ts +118 -0
- package/dist/contracts/events/command.js +2 -0
- package/dist/contracts/events/ports.d.ts +172 -0
- package/dist/contracts/events/ports.js +2 -0
- package/dist/contracts/events.d.ts +5 -0
- package/dist/contracts/events.js +2 -0
- package/dist/contracts/forms.d.ts +110 -0
- package/dist/contracts/forms.js +4 -0
- package/dist/contracts/hosted-mcp/config.d.ts +19 -0
- package/dist/contracts/hosted-mcp/record.d.ts +61 -4
- package/dist/contracts/mail/email-sender.d.ts +118 -0
- package/dist/contracts/mail/email-sender.js +20 -0
- package/dist/contracts/mail/smtp-payload.d.ts +32 -0
- package/dist/contracts/mail/smtp-payload.js +2 -0
- package/dist/contracts/mail.d.ts +2 -0
- package/dist/contracts/mail.js +1 -1
- package/dist/contracts/observability.d.ts +232 -0
- package/dist/contracts/observability.js +27 -0
- package/dist/contracts/plugin-sdk.d.ts +186 -0
- package/dist/contracts/plugin-sdk.js +39 -0
- package/dist/contracts/runtime/command.d.ts +41 -0
- package/dist/contracts/runtime/command.js +60 -0
- package/dist/contracts/runtime/environment.d.ts +18 -0
- package/dist/contracts/runtime/environment.js +26 -0
- package/dist/contracts/runtime/file-lock.d.ts +94 -0
- package/dist/contracts/runtime/file-lock.js +25 -0
- package/dist/contracts/runtime/fs.d.ts +33 -0
- package/dist/contracts/runtime/fs.js +2 -0
- package/dist/contracts/runtime/http.d.ts +89 -0
- package/dist/contracts/runtime/http.js +2 -0
- package/dist/contracts/runtime/platform.d.ts +3 -0
- package/dist/contracts/runtime/platform.js +2 -0
- package/dist/contracts/runtime/process.d.ts +40 -0
- package/dist/contracts/runtime/process.js +31 -0
- package/dist/contracts/runtime/reader.d.ts +11 -0
- package/dist/contracts/runtime/reader.js +2 -0
- package/dist/contracts/runtime/terminal.d.ts +99 -0
- package/dist/contracts/runtime/terminal.js +2 -0
- package/dist/contracts/runtime/testing.d.ts +84 -0
- package/dist/contracts/runtime/testing.js +116 -0
- package/dist/contracts/runtime.d.ts +10 -0
- package/dist/contracts/runtime.js +10 -0
- package/dist/contracts/server/api-error.d.ts +43 -0
- package/dist/contracts/server/api-error.js +49 -0
- package/dist/contracts/server/auth.d.ts +20 -0
- package/dist/contracts/server/auth.js +21 -0
- package/dist/contracts/server/conformance.d.ts +25 -0
- package/dist/contracts/server/conformance.js +50 -0
- package/dist/contracts/server/json-route.d.ts +176 -0
- package/dist/contracts/server/json-route.js +155 -0
- package/dist/contracts/server/middleware.d.ts +35 -0
- package/dist/contracts/server/middleware.js +56 -0
- package/dist/contracts/server/origin.d.ts +44 -0
- package/dist/contracts/server/origin.js +32 -0
- package/dist/contracts/server/query.d.ts +16 -0
- package/dist/contracts/server/query.js +69 -0
- package/dist/contracts/server/rate-limit.d.ts +20 -0
- package/dist/contracts/server/rate-limit.js +8 -0
- package/dist/contracts/server/request-body.d.ts +26 -0
- package/dist/contracts/server/request-body.js +82 -0
- package/dist/contracts/server/result.d.ts +17 -0
- package/dist/contracts/server/result.js +5 -0
- package/dist/contracts/server/route-table.d.ts +54 -0
- package/dist/contracts/server/route-table.js +119 -0
- package/dist/contracts/server/same-origin-write.d.ts +18 -0
- package/dist/contracts/server/same-origin-write.js +31 -0
- package/dist/contracts/server/security-headers.d.ts +30 -0
- package/dist/contracts/server/security-headers.js +35 -0
- package/dist/contracts/server/sse.d.ts +82 -0
- package/dist/contracts/server/sse.js +103 -0
- package/dist/contracts/server/testing.d.ts +59 -0
- package/dist/contracts/server/testing.js +68 -0
- package/dist/contracts/server/verified-origin/configured-origin.d.ts +37 -0
- package/dist/contracts/server/verified-origin/configured-origin.js +103 -0
- package/dist/contracts/server/verified-origin/index.d.ts +7 -0
- package/dist/contracts/server/verified-origin/index.js +6 -0
- package/dist/contracts/server/verified-origin/loopback-host.d.ts +9 -0
- package/dist/contracts/server/verified-origin/loopback-host.js +17 -0
- package/dist/contracts/server/verified-origin/origin.d.ts +64 -0
- package/dist/contracts/server/verified-origin/origin.js +162 -0
- package/dist/contracts/server/verified-origin/ports.d.ts +38 -0
- package/dist/contracts/server/verified-origin/ports.js +2 -0
- package/dist/contracts/server/verified-origin/repo.memory.d.ts +32 -0
- package/dist/contracts/server/verified-origin/repo.memory.js +34 -0
- package/dist/contracts/server/verified-origin/site-path.d.ts +113 -0
- package/dist/contracts/server/verified-origin/site-path.js +188 -0
- package/dist/contracts/server/verified-origin/types.d.ts +33 -0
- package/dist/contracts/server/verified-origin/types.js +30 -0
- package/dist/contracts/server.d.ts +46 -2
- package/dist/contracts/server.js +17 -3
- package/dist/contracts/storage/kernel.d.ts +86 -0
- package/dist/contracts/storage/kernel.js +38 -0
- package/dist/contracts/storage/migration.d.ts +32 -0
- package/dist/contracts/storage/migration.js +2 -0
- package/dist/contracts/storage/rows.d.ts +33 -0
- package/dist/contracts/storage/rows.js +42 -0
- package/dist/contracts/storage/sqlite.d.ts +113 -0
- package/dist/contracts/storage/sqlite.js +8 -0
- package/dist/contracts/storage/values.d.ts +25 -0
- package/dist/contracts/storage/values.js +25 -0
- package/dist/contracts/storage.d.ts +8 -0
- package/dist/contracts/storage.js +6 -0
- package/dist/contracts/vault/invariants.d.ts +26 -0
- package/dist/contracts/vault/invariants.js +49 -0
- package/dist/contracts/vault.d.ts +1 -0
- package/dist/contracts/vault.js +1 -1
- package/dist/env/coercers.d.ts +21 -0
- package/dist/env/coercers.js +68 -0
- package/dist/env/describe-env-for-diagnostics.d.ts +16 -0
- package/dist/env/describe-env-for-diagnostics.js +23 -0
- package/dist/env/format-env-issue.d.ts +13 -0
- package/dist/env/format-env-issue.js +22 -0
- package/dist/env/parse-env.d.ts +24 -0
- package/dist/env/parse-env.js +102 -0
- package/dist/env/value-echo.d.ts +17 -0
- package/dist/env/value-echo.js +42 -0
- package/dist/errors/approved-cause.d.ts +36 -0
- package/dist/errors/approved-cause.js +17 -0
- package/dist/errors/bindings.d.ts +61 -0
- package/dist/errors/bindings.js +57 -0
- package/dist/errors/catalog.d.ts +84 -0
- package/dist/errors/catalog.js +151 -0
- package/dist/errors/disclosure.d.ts +48 -0
- package/dist/errors/disclosure.js +27 -0
- package/dist/errors/error-id.d.ts +26 -0
- package/dist/errors/error-id.js +23 -0
- package/dist/errors/idioms.d.ts +73 -0
- package/dist/errors/idioms.js +85 -0
- package/dist/errors/incident-text.d.ts +16 -0
- package/dist/errors/incident-text.js +77 -0
- package/dist/errors/reporter.d.ts +94 -0
- package/dist/errors/reporter.js +152 -0
- package/dist/errors/sentences.d.ts +68 -0
- package/dist/errors/sentences.js +93 -0
- package/dist/errors/testing.d.ts +50 -0
- package/dist/errors/testing.js +44 -0
- package/dist/fetch/cache.d.ts +12 -5
- package/dist/fetch/cache.js +46 -47
- package/dist/fetch/index.d.ts +1 -1
- package/dist/fetch/loader-read.d.ts +6 -2
- package/dist/fetch/loader-read.js +4 -4
- package/dist/format-error-for-log.d.ts +15 -0
- package/dist/format-error-for-log.js +55 -0
- package/dist/host-read-vocabulary.d.ts +47 -0
- package/dist/host-read-vocabulary.js +44 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +4 -0
- package/dist/list-page.d.ts +93 -0
- package/dist/list-page.js +154 -0
- package/dist/model-facing-tool-errors.d.ts +67 -5
- package/dist/model-facing-tool-errors.js +155 -19
- package/dist/net/endpoint-policy.d.ts +39 -0
- package/dist/net/endpoint-policy.js +218 -0
- package/dist/net/fetch-timeouts.d.ts +38 -0
- package/dist/net/fetch-timeouts.js +31 -0
- package/dist/net/index.d.ts +4 -0
- package/dist/net/index.js +4 -0
- package/dist/net/loopback.d.ts +13 -0
- package/dist/net/loopback.js +39 -0
- package/dist/optimistic-concurrency.d.ts +183 -0
- package/dist/optimistic-concurrency.js +222 -0
- package/dist/primitives/errors.d.ts +9 -0
- package/dist/primitives/errors.js +12 -0
- package/dist/primitives/ids.d.ts +0 -2
- package/dist/primitives/ids.js +1 -4
- package/dist/primitives/index.d.ts +3 -0
- package/dist/primitives/index.js +2 -0
- package/dist/primitives/logger.d.ts +36 -1
- package/dist/primitives/logger.js +125 -9
- package/dist/primitives/node-shape.d.ts +24 -0
- package/dist/primitives/node-shape.js +21 -0
- package/dist/primitives/time.d.ts +9 -2
- package/dist/primitives/time.js +4 -3
- package/dist/provider-registry.js +26 -20
- package/dist/records.d.ts +40 -7
- package/dist/records.js +37 -3
- package/dist/redact.d.ts +1 -84
- package/dist/redact.js +2 -826
- package/dist/redaction-collectors.d.ts +7 -0
- package/dist/redaction-collectors.js +152 -0
- package/dist/redaction-exact-secrets.d.ts +14 -0
- package/dist/redaction-exact-secrets.js +115 -0
- package/dist/redaction-labels.d.ts +14 -0
- package/dist/redaction-labels.js +156 -0
- package/dist/redaction-patterns.d.ts +54 -0
- package/dist/redaction-patterns.js +178 -0
- package/dist/redaction-spans.d.ts +31 -0
- package/dist/redaction-spans.js +83 -0
- package/dist/registration-kit.d.ts +1 -1
- package/dist/revision-conflict-error.d.ts +18 -0
- package/dist/revision-conflict-error.js +20 -0
- package/dist/secret-shapes.d.ts +50 -0
- package/dist/secret-shapes.js +105 -0
- package/dist/settings/agent-tools.js +22 -8
- package/dist/settings/agent-value-write-tools.d.ts +4 -1
- package/dist/settings/agent-value-write-tools.js +7 -6
- package/dist/settings/agent-writable-preferences.d.ts +3 -1
- package/dist/settings/agent-writable-preferences.js +1 -1
- package/dist/settings/agent-write-denylist.d.ts +7 -4
- package/dist/settings/agent-write-denylist.js +1 -1
- package/dist/settings/{express/cms-adapter.d.ts → cms-adapter.d.ts} +3 -2
- package/dist/settings/{express/cms-adapter.js → cms-adapter.js} +21 -11
- package/dist/settings/definitions-dispatch.js +3 -1
- package/dist/settings/ensure-definitions.js +3 -1
- package/dist/settings/errors.d.ts +1 -13
- package/dist/settings/errors.js +2 -15
- package/dist/settings/index.d.ts +11 -2
- package/dist/settings/index.js +10 -2
- package/dist/settings/purge-service.js +63 -86
- package/dist/settings/{express/contracts.d.ts → route-policy.d.ts} +53 -47
- package/dist/settings/{express/shared.js → route-policy.js} +1 -16
- package/dist/settings/settings.d.ts +19 -11
- package/dist/settings/settings.js +9 -11
- package/dist/settings/tool-registrations.d.ts +3 -3
- package/dist/settings/tool-registrations.js +130 -125
- package/dist/settings/types.d.ts +1 -1
- package/dist/settings/write-definition-rename.d.ts +37 -0
- package/dist/settings/write-definition-rename.js +119 -0
- package/dist/settings/write-definition-retype.d.ts +61 -0
- package/dist/settings/write-definition-retype.js +109 -0
- package/dist/settings/write-definition-status.d.ts +81 -0
- package/dist/settings/write-definition-status.js +121 -0
- package/dist/settings/write-reset.d.ts +34 -0
- package/dist/settings/write-reset.js +73 -0
- package/dist/settings/write-service.d.ts +16 -287
- package/dist/settings/write-service.js +49 -681
- package/dist/settings/write-value-revisions.d.ts +68 -0
- package/dist/settings/write-value-revisions.js +124 -0
- package/dist/settings/write-values.d.ts +96 -0
- package/dist/settings/write-values.js +83 -0
- package/dist/surface-exchanges.d.ts +2 -2
- package/dist/text/dictionary-translator.d.ts +19 -0
- package/dist/text/dictionary-translator.js +14 -0
- package/dist/text/format-byte-size.d.ts +25 -0
- package/dist/text/format-byte-size.js +25 -0
- package/dist/text/format-timestamp.d.ts +22 -0
- package/dist/text/format-timestamp.js +57 -0
- package/dist/text/index.d.ts +12 -0
- package/dist/text/index.js +9 -0
- package/dist/text/is-abort-error.d.ts +5 -0
- package/dist/text/is-abort-error.js +5 -0
- package/dist/text/mime.d.ts +5 -0
- package/dist/text/mime.js +21 -0
- package/dist/text/redact-urls.d.ts +7 -0
- package/dist/text/redact-urls.js +5 -0
- package/dist/text/resolve-active-tab-id.d.ts +13 -0
- package/dist/text/resolve-active-tab-id.js +15 -0
- package/dist/text/sanitize-untrusted-text.d.ts +1 -1
- package/dist/text/sanitize-untrusted-text.js +2 -1
- package/dist/text/tagged-text-suppression.d.ts +103 -0
- package/dist/text/tagged-text-suppression.js +143 -0
- package/dist/text/template-i18n.d.ts +37 -0
- package/dist/text/template-i18n.js +48 -0
- package/dist/tool-call-text.d.ts +59 -0
- package/dist/tool-call-text.js +62 -0
- package/dist/tool-input-envelope.js +8 -4
- package/dist/tool-input-normalization.js +8 -1
- package/dist/tool-input-repairs.d.ts +58 -0
- package/dist/tool-input-repairs.js +154 -0
- package/dist/tool-tokens.js +1 -1
- package/dist/user-facing-error.d.ts +1 -1
- package/dist/user-facing-error.js +3 -1
- package/package.json +234 -13
- package/dist/settings/express/contracts.js +0 -2
- package/dist/settings/express/http-request.d.ts +0 -33
- package/dist/settings/express/http-request.js +0 -50
- package/dist/settings/express/http.d.ts +0 -10
- package/dist/settings/express/http.js +0 -196
- package/dist/settings/express/index.d.ts +0 -5
- package/dist/settings/express/index.js +0 -4
- package/dist/settings/express/shared.d.ts +0 -68
- package/dist/settings/express/stream.d.ts +0 -24
- package/dist/settings/express/stream.js +0 -171
|
@@ -0,0 +1,459 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module types
|
|
3
|
+
*
|
|
4
|
+
* The central, product-neutral contract for this package: `RuntimeAgentDef`
|
|
5
|
+
* declaratively describes how to detect, authenticate, and spawn a single
|
|
6
|
+
* coding-agent CLI (Claude Code, Codex, Cursor, Aider, AMR, …). Everything
|
|
7
|
+
* else in `@jini-ai/agent-runtime` — the registry, detection, launch, and
|
|
8
|
+
* stream-parsing modules — operates on this type or on `DetectedAgent`, its
|
|
9
|
+
* runtime-probed sibling.
|
|
10
|
+
*
|
|
11
|
+
* Ported from OD's `apps/daemon/src/runtimes/types.ts`. Product-neutral
|
|
12
|
+
* as found — see `archived provenance ledger` for the full provenance table.
|
|
13
|
+
*/
|
|
14
|
+
import type { AgentModelDiscoveryPort, RuntimeEnv, RuntimeModelOption, RuntimeReasoningOption } from './model-catalog.js';
|
|
15
|
+
import type { NativeCapabilities } from './native-tool-policy.js';
|
|
16
|
+
export type RuntimeModelSource = 'live' | 'fallback';
|
|
17
|
+
/**
|
|
18
|
+
* Declares that a runtime carries its reasoning-effort choice INSIDE the model
|
|
19
|
+
* id — as a trailing `-<level>` on the slug — rather than in a flag of its own.
|
|
20
|
+
*
|
|
21
|
+
* The distinction is not cosmetic, and it is why this is a separate field from
|
|
22
|
+
* `RuntimeAgentDef.reasoningOptions` rather than another shape of it:
|
|
23
|
+
*
|
|
24
|
+
* - A `reasoningOptions` def (claude, codex) has ONE effort vocabulary that
|
|
25
|
+
* applies to every model it can run, and the chosen level travels to the
|
|
26
|
+
* CLI as its own argv (`--effort high`, `-c model_reasoning_effort="high"`)
|
|
27
|
+
* via `RuntimeBuildOptions.reasoning`.
|
|
28
|
+
* - A `reasoningInModelId` def (antigravity) has NO effort flag at all. Its
|
|
29
|
+
* level is already part of `--model`'s value, so `buildArgs` emits nothing
|
|
30
|
+
* extra, and — critically — **the available levels differ per base model**.
|
|
31
|
+
* Verified live against `agy models` (v1.1.25): `gemini-3.8-flash` has
|
|
32
|
+
* high/medium/low, `gemini-3.1-pro` has ONLY high and low,
|
|
33
|
+
* `gpt-oss-120b` has only medium, and `claude-sonnet-4-6` has none.
|
|
34
|
+
* `agy --model gemini-3.1-pro-medium` is rejected outright.
|
|
35
|
+
*
|
|
36
|
+
* So this field declares only the suffix VOCABULARY — which trailing tokens
|
|
37
|
+
* are effort levels at all, in the order a picker should offer them. Which of
|
|
38
|
+
* them exist for a given base model is DERIVED from that runtime's own model
|
|
39
|
+
* list (live or fallback), never listed here: a hand-written per-model table
|
|
40
|
+
* would be a second copy of the CLI's catalog, free to drift the moment
|
|
41
|
+
* upstream adds a variant.
|
|
42
|
+
*
|
|
43
|
+
* `levels` doubles as the guard against over-parsing: `claude-opus-4-6-thinking`
|
|
44
|
+
* ends in `-thinking`, which is NOT an effort level, so it must stay part of
|
|
45
|
+
* the base id. Only a trailing token that appears in `levels` is a level.
|
|
46
|
+
*/
|
|
47
|
+
export type RuntimeReasoningInModelId = {
|
|
48
|
+
/** The recognized effort suffixes, in picker display order. */
|
|
49
|
+
levels: readonly RuntimeReasoningOption[];
|
|
50
|
+
};
|
|
51
|
+
export type RuntimeBuildOptions = {
|
|
52
|
+
/** Executor-created per-run CLAUDE_CODE_TMPDIR; its /claude-<uid> child must fit 44 bytes. Absent grants no runtime scratch. */
|
|
53
|
+
filesystemRuntimeTempBase?: string;
|
|
54
|
+
/** Host folder boundary, independent of native grants; unsupported providers disclose the exception. */
|
|
55
|
+
filesystemRoot?: string;
|
|
56
|
+
/** Executor-created private temporary directory inside the host root; never a shared temp root. */
|
|
57
|
+
filesystemTempDir?: string;
|
|
58
|
+
/** Shared host/login temp roots denied even when child TMPDIR is replaced. */
|
|
59
|
+
filesystemSharedTempRoots?: readonly string[];
|
|
60
|
+
/** Executor-resolved CLI/runtime files; read-only exceptions for sandboxed commands. */
|
|
61
|
+
filesystemRuntimeReadPaths?: readonly string[];
|
|
62
|
+
/** Host-validated owner-picked folders outside filesystemRoot: natively readable, never writable. */
|
|
63
|
+
filesystemReadOnlyDirs?: readonly string[];
|
|
64
|
+
/** Host-verified per-run overrides; false dimensions must be enforced or launch refused. */
|
|
65
|
+
nativeCapabilities?: Partial<NativeCapabilities>;
|
|
66
|
+
/** Explicit host grant for shell/direct edits. false must be enforced or launch refused.
|
|
67
|
+
* Does not lift environment, MCP, path, approval or sandbox security controls. */
|
|
68
|
+
nativeToolAccess?: boolean;
|
|
69
|
+
/** Explicit trusted-host grant for hand-run CLI configuration and capabilities. */
|
|
70
|
+
cliParity?: boolean;
|
|
71
|
+
/** Host-scoped capability flags; absent retains the published compatibility cache. */
|
|
72
|
+
capabilities?: RuntimeCapabilityMap;
|
|
73
|
+
model?: string | null;
|
|
74
|
+
reasoning?: string | null;
|
|
75
|
+
permissionMode?: 'bypass' | 'restricted';
|
|
76
|
+
systemPromptOverlay?: string | null;
|
|
77
|
+
/**
|
|
78
|
+
* Tool names this run's CLI should refuse to execute, forwarded to whichever def-native flag
|
|
79
|
+
* expresses a deny-list — today, `claude`'s own `--disallowedTools` (verified against installed
|
|
80
|
+
* Claude Code 2.1.263: `--disallowedTools, --disallowed-tools <tools...>`, "Comma or
|
|
81
|
+
* space-separated list of tool names to deny"). This is a `@jini-ai/agent-runtime`-level
|
|
82
|
+
* *mechanism* only: no product's tool policy is baked in here (not one host's Bash-forbid opinion,
|
|
83
|
+
* not anyone else's) — the caller decides which names to pass. A def whose CLI has no equivalent
|
|
84
|
+
* flag simply ignores this field, same as `systemPromptOverlay` on a def with no overlay
|
|
85
|
+
* delivery. `undefined`/empty means no restriction — byte-identical to today's behavior (every
|
|
86
|
+
* tool the CLI's own grant already allows stays allowed).
|
|
87
|
+
*/
|
|
88
|
+
disallowedTools?: readonly string[];
|
|
89
|
+
/**
|
|
90
|
+
* Same mechanism as {@link disallowedTools}, for a def-native explicit allow-list flag — today,
|
|
91
|
+
* `claude`'s own `--allowedTools`. Rarely set alongside `disallowedTools` at once; the underlying
|
|
92
|
+
* CLI decides how an allow-list and a deny-list interact when both are present.
|
|
93
|
+
* `undefined`/empty means no restriction, same as today.
|
|
94
|
+
*/
|
|
95
|
+
allowedTools?: readonly string[];
|
|
96
|
+
/**
|
|
97
|
+
* Which of the CLI's own settings layers to load — today `claude`'s `--setting-sources`
|
|
98
|
+
* (`user`, `project`, `local`). An EMPTY list loads none: no settings-file hooks, no plugins the
|
|
99
|
+
* operator enabled for themselves, no personal model/effort defaults. For a host that embeds the
|
|
100
|
+
* CLI as a product assistant, so the operator's personal setup (e.g. SessionStart hooks that
|
|
101
|
+
* inject their own instructions) never reaches the product's runs. Unlike staging a separate
|
|
102
|
+
* `CLAUDE_CONFIG_DIR`, this keeps the CLI's Keychain login. `undefined` = the CLI's default (all).
|
|
103
|
+
*/
|
|
104
|
+
settingSources?: readonly string[];
|
|
105
|
+
/**
|
|
106
|
+
* Extra settings for this run — today `claude`'s `--settings <file-or-json>`, which the CLI applies
|
|
107
|
+
* on top of (and independently of) {@link settingSources}. Lets a host that loads no settings layers
|
|
108
|
+
* still hand the run the few it wants, e.g. one PreToolUse hook. `undefined`/empty = no flag.
|
|
109
|
+
*/
|
|
110
|
+
settings?: string;
|
|
111
|
+
/**
|
|
112
|
+
* Browser integration for this run — today `claude`'s `--chrome` (true) / `--no-chrome` (false),
|
|
113
|
+
* "Enable/Disable Claude in Chrome integration" in Claude Code 2.1.307's `-p --help`. A mechanism
|
|
114
|
+
* only: the host decides. Probe-gated like `--effort`, so a CLI without the flag gets neither.
|
|
115
|
+
* `undefined` = no flag, byte-identical to before; defs without `supportsChromeIntegration` ignore it.
|
|
116
|
+
*/
|
|
117
|
+
chromeIntegration?: boolean;
|
|
118
|
+
};
|
|
119
|
+
export type RuntimeContext = {
|
|
120
|
+
cwd?: string;
|
|
121
|
+
hasPriorAssistantTurn?: boolean;
|
|
122
|
+
agentLogFilePath?: string;
|
|
123
|
+
promptFilePath?: string;
|
|
124
|
+
resumeSessionId?: string | null;
|
|
125
|
+
newSessionId?: string;
|
|
126
|
+
mcpJsonPath?: string;
|
|
127
|
+
};
|
|
128
|
+
export type RuntimeCapabilityMap = Record<string, boolean>;
|
|
129
|
+
export type RuntimeListModels = {
|
|
130
|
+
args: string[];
|
|
131
|
+
timeoutMs: number;
|
|
132
|
+
parse: (requiredArgs: {
|
|
133
|
+
stdout: string;
|
|
134
|
+
}) => RuntimeModelOption[] | null;
|
|
135
|
+
};
|
|
136
|
+
export type RuntimePromptBudgetError = {
|
|
137
|
+
code: 'AGENT_PROMPT_TOO_LARGE';
|
|
138
|
+
message: string;
|
|
139
|
+
bytes?: number;
|
|
140
|
+
commandLineLength?: number;
|
|
141
|
+
limit: number;
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* How the caller should treat an adapter's raw stdout before text forwarding or structured parsing.
|
|
145
|
+
*
|
|
146
|
+
* Declared as a discriminated union rather than two independent flags
|
|
147
|
+
* (`stdoutBuffering` + `sanitizeStdout`) on purpose: a sanitizer is only
|
|
148
|
+
* *meaningful* on the buffered path, because a pattern to be redacted can
|
|
149
|
+
* straddle two `'data'` chunks — the exact case that motivates buffering at
|
|
150
|
+
* all. Two flat fields would let a def declare `sanitize` alongside live
|
|
151
|
+
* streaming, where the caller could not honor it; the confidentiality gap
|
|
152
|
+
* would then *look* closed in the def while leaking at runtime. The union
|
|
153
|
+
* makes that combination unrepresentable.
|
|
154
|
+
*
|
|
155
|
+
* `undefined` on a def means `{buffering: 'live'}` — today's behavior for
|
|
156
|
+
* every adapter, and the only sane default: a CLI that streams tokens should
|
|
157
|
+
* reach the user as it streams.
|
|
158
|
+
*/
|
|
159
|
+
export type RuntimeStdoutPolicy =
|
|
160
|
+
/**
|
|
161
|
+
* Forward every stdout chunk to the client as it arrives. The default;
|
|
162
|
+
* what a streaming CLI's own output cadence implies.
|
|
163
|
+
*/
|
|
164
|
+
{
|
|
165
|
+
readonly buffering: 'live';
|
|
166
|
+
}
|
|
167
|
+
/** Sanitize complete stdout lines before live delivery; partial lines remain bounded by the host. */
|
|
168
|
+
| {
|
|
169
|
+
readonly buffering: 'line';
|
|
170
|
+
readonly sanitize: (requiredArgs: {
|
|
171
|
+
fullText: string;
|
|
172
|
+
}) => string;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Accumulate every stdout chunk and forward the whole thing exactly once,
|
|
176
|
+
* after the child process closes. For adapters that can print a secret
|
|
177
|
+
* (e.g. an interactive OAuth URL) to stdout and *still exit 0*, where the
|
|
178
|
+
* only safe moment to decide what the user sees is after the output is
|
|
179
|
+
* complete.
|
|
180
|
+
*/
|
|
181
|
+
| {
|
|
182
|
+
readonly buffering: 'until-close';
|
|
183
|
+
/**
|
|
184
|
+
* Last transform applied to the fully-accumulated stdout before it is
|
|
185
|
+
* emitted. Receives the concatenation of every chunk; returns what the
|
|
186
|
+
* client may see. Must be pure and must not throw — the caller has
|
|
187
|
+
* nothing better to fall back on than the unsanitized text, so a
|
|
188
|
+
* throwing sanitizer is the leak it was added to prevent.
|
|
189
|
+
*/
|
|
190
|
+
readonly sanitize?: (requiredArgs: {
|
|
191
|
+
fullText: string;
|
|
192
|
+
}) => string;
|
|
193
|
+
};
|
|
194
|
+
/**
|
|
195
|
+
* Context for {@link RuntimeLock.acquire}, so a def can decide whether the
|
|
196
|
+
* side effect its lock guards will happen for *this* spawn at all — and skip
|
|
197
|
+
* serializing when it will not.
|
|
198
|
+
*/
|
|
199
|
+
export type RuntimeLockAcquireContext = {
|
|
200
|
+
/**
|
|
201
|
+
* The model id the caller is about to pass to `buildArgs` as
|
|
202
|
+
* `RuntimeBuildOptions.model`; `undefined` when the caller selected none.
|
|
203
|
+
*/
|
|
204
|
+
readonly model: string | undefined;
|
|
205
|
+
};
|
|
206
|
+
/**
|
|
207
|
+
* Context for {@link RuntimeLockHold.waitForHandoff} — everything a def needs
|
|
208
|
+
* to observe the spawned process confirming it consumed the guarded side
|
|
209
|
+
* effect, without the caller handing over a `ChildProcess` (which would couple
|
|
210
|
+
* `RuntimeAgentDef` to `node:child_process`'s process model for a concern that
|
|
211
|
+
* is really just "did the child read the file yet").
|
|
212
|
+
*/
|
|
213
|
+
export type RuntimeLockHandoffContext = {
|
|
214
|
+
/**
|
|
215
|
+
* The temp path the caller staged into `RuntimeContext.agentLogFilePath`
|
|
216
|
+
* for this spawn — `undefined` when the def did not declare
|
|
217
|
+
* `needsAgentLogFile`, or the caller could not stage one.
|
|
218
|
+
*/
|
|
219
|
+
readonly logFilePath: string | undefined;
|
|
220
|
+
/** The same value {@link RuntimeLockAcquireContext.model} carried. */
|
|
221
|
+
readonly model: string | undefined;
|
|
222
|
+
/**
|
|
223
|
+
* Aborts once the spawned process has exited. A def that polls for its
|
|
224
|
+
* handoff signal should pass this straight into its poller so the poll
|
|
225
|
+
* stops promptly instead of running out its own timeout against a log file
|
|
226
|
+
* that will never grow again.
|
|
227
|
+
*/
|
|
228
|
+
readonly processExited: AbortSignal;
|
|
229
|
+
};
|
|
230
|
+
/** A held {@link RuntimeLock}. See that type's doc for the release contract. */
|
|
231
|
+
export type RuntimeLockHold = {
|
|
232
|
+
/**
|
|
233
|
+
* Releases the lock. **Must be idempotent** — the caller invokes it on
|
|
234
|
+
* whichever of `waitForHandoff` settling or process exit happens first, and
|
|
235
|
+
* makes no attempt to suppress the second.
|
|
236
|
+
*/
|
|
237
|
+
readonly release: () => void;
|
|
238
|
+
/**
|
|
239
|
+
* Resolves once the spawned process has demonstrably consumed the guarded
|
|
240
|
+
* side effect, at which point the caller releases. Rejecting is treated
|
|
241
|
+
* exactly like resolving (the caller releases either way — a lock held
|
|
242
|
+
* forever because a watcher threw is worse than an early release).
|
|
243
|
+
*
|
|
244
|
+
* Omit it to hold the lock for the child's entire lifetime: the caller then
|
|
245
|
+
* releases only on process exit.
|
|
246
|
+
*/
|
|
247
|
+
readonly waitForHandoff?: (context: RuntimeLockHandoffContext) => Promise<void>;
|
|
248
|
+
};
|
|
249
|
+
/**
|
|
250
|
+
* A def-declared mutex around a *process-global* side effect its `buildArgs`
|
|
251
|
+
* performs — the case that exists today being an adapter with no `--model`
|
|
252
|
+
* flag, whose model choice must instead be written into a single shared
|
|
253
|
+
* settings file that the spawned CLI reads on its own startup. Two concurrent
|
|
254
|
+
* runs of such an adapter race: run A writes model A, A spawns, B writes
|
|
255
|
+
* model B, and *then* A's CLI reads the file — so A silently executes on B's
|
|
256
|
+
* model.
|
|
257
|
+
*
|
|
258
|
+
* The caller's contract, in order:
|
|
259
|
+
* 1. `acquire(...)` before `buildArgs` runs (which is what performs the
|
|
260
|
+
* side effect), awaiting the returned hold.
|
|
261
|
+
* 2. spawn.
|
|
262
|
+
* 3. `hold.waitForHandoff?.(...)` — and `hold.release()` on whichever of
|
|
263
|
+
* that settling or process exit comes first.
|
|
264
|
+
*
|
|
265
|
+
* Releasing on process exit is not a fallback, it is load-bearing: a
|
|
266
|
+
* `waitForHandoff` that gives up polling means "I stopped watching", never
|
|
267
|
+
* "the child definitely didn't read the file". Only exit proves the child can
|
|
268
|
+
* no longer read it.
|
|
269
|
+
*/
|
|
270
|
+
export type RuntimeLock = {
|
|
271
|
+
readonly acquire: (context: RuntimeLockAcquireContext) => Promise<RuntimeLockHold>;
|
|
272
|
+
};
|
|
273
|
+
export type RuntimeAgentDef = Partial<AgentModelDiscoveryPort> & {
|
|
274
|
+
/** This adapter enforces nativeToolAccess and emits normalized shell/edit tool_use events.
|
|
275
|
+
* A host requesting the policy must fail closed when this capability is absent. */
|
|
276
|
+
supportsNativeToolAccess?: boolean;
|
|
277
|
+
/** Missing/unknown isolation needs consent. A per-run claim must identify a verified CLI version and date. */
|
|
278
|
+
mcpIsolation?: 'none' | 'no-client' | {
|
|
279
|
+
readonly perRun: string;
|
|
280
|
+
};
|
|
281
|
+
/** Native tools cannot be limited per run; the host must obtain explicit consent. */
|
|
282
|
+
fullCliAccessOnly?: boolean;
|
|
283
|
+
/** Translation key explaining this runtime’s full-access requirement to the user. */
|
|
284
|
+
fullCliAccessNote?: string;
|
|
285
|
+
/** The CLI ships a native subagent tool (e.g. Claude Code's Task/Agent) a run can delegate to.
|
|
286
|
+
* Declarative only: hosts read it through `runtimeSupportsSubagents`, never by model name.
|
|
287
|
+
* Absent = no native subagents. */
|
|
288
|
+
supportsSubagents?: boolean;
|
|
289
|
+
/** `buildArgs` honors `RuntimeBuildOptions.chromeIntegration` (today Claude Code's
|
|
290
|
+
* `--chrome`/`--no-chrome`). Read through `runtimeSupportsChromeIntegration`; absent = unsupported. */
|
|
291
|
+
supportsChromeIntegration?: boolean;
|
|
292
|
+
id: string;
|
|
293
|
+
name: string;
|
|
294
|
+
bin: string;
|
|
295
|
+
versionArgs: string[];
|
|
296
|
+
fallbackModels: RuntimeModelOption[];
|
|
297
|
+
/** False when the native CLI exposes only routing modes and cannot pin a concrete ID. */
|
|
298
|
+
supportsConcreteModelSelection?: boolean;
|
|
299
|
+
/**
|
|
300
|
+
* `YYYY-MM-DD` — when this def's hardcoded `fallbackModels` list was last checked against the
|
|
301
|
+
* vendor's own current list.
|
|
302
|
+
*
|
|
303
|
+
* Required (by `scripts/check-model-fallback-freshness.ts`, not by this type) of any def whose
|
|
304
|
+
* fallback array is what a picker RENDERS when no live source answers. It exists because a
|
|
305
|
+
* hand-written list of vendor model ids has no other way to fail: it drifts from reality the day
|
|
306
|
+
* a model ships, and before this marker nothing anywhere went red when it did.
|
|
307
|
+
*
|
|
308
|
+
* Bump it only after actually comparing the list against a live source — the guard's MF3 rule
|
|
309
|
+
* does that comparison for you whenever the relevant CLI is installed.
|
|
310
|
+
*/
|
|
311
|
+
fallbackModelsAssertedAt?: string;
|
|
312
|
+
buildArgs: (requiredArgs: {
|
|
313
|
+
prompt: string;
|
|
314
|
+
imagePaths: string[];
|
|
315
|
+
}, optionalArgs?: {
|
|
316
|
+
extraAllowedDirs?: string[];
|
|
317
|
+
options?: RuntimeBuildOptions;
|
|
318
|
+
runtimeContext?: RuntimeContext;
|
|
319
|
+
}) => string[];
|
|
320
|
+
streamFormat: string;
|
|
321
|
+
/** Reported money spans a session or one run; absent preserves per-run adapter behavior. */
|
|
322
|
+
usageCostBasis?: 'session' | 'run';
|
|
323
|
+
fallbackBins?: string[];
|
|
324
|
+
versionProbeTimeoutMs?: number;
|
|
325
|
+
helpArgs?: string[];
|
|
326
|
+
capabilityFlags?: Record<string, string>;
|
|
327
|
+
promptViaFile?: boolean;
|
|
328
|
+
promptViaStdin?: boolean;
|
|
329
|
+
promptInputFormat?: 'text' | 'stream-json';
|
|
330
|
+
eventParser?: string;
|
|
331
|
+
env?: Record<string, string>;
|
|
332
|
+
listModels?: RuntimeListModels;
|
|
333
|
+
fetchModels?: (requiredArgs: {
|
|
334
|
+
resolvedBin: string;
|
|
335
|
+
env: RuntimeEnv;
|
|
336
|
+
}, optionalArgs?: {
|
|
337
|
+
acpModelProbe?: AcpModelProbe;
|
|
338
|
+
}) => Promise<RuntimeModelOption[] | null>;
|
|
339
|
+
reasoningOptions?: RuntimeReasoningOption[];
|
|
340
|
+
/**
|
|
341
|
+
* Narrows `reasoningOptions` to what the runtime's LIVE model list actually supports.
|
|
342
|
+
*
|
|
343
|
+
* Pure, and deliberately a function of the fetched models rather than a second network/CLI probe:
|
|
344
|
+
* the data it reads (`RuntimeModelOption.reasoning`) was already parsed out of the same catalog
|
|
345
|
+
* response `listModels`/`fetchModels` produced, so there is no extra I/O and no second source that
|
|
346
|
+
* could disagree with the first.
|
|
347
|
+
*
|
|
348
|
+
* `detection.ts` calls it once per probe and, when it returns a non-empty list, that list replaces
|
|
349
|
+
* the def's static `reasoningOptions` on the resulting `DetectedAgent`. Returning `null` (no live
|
|
350
|
+
* model carried levels — an older CLI, a fallback list, an offline probe) leaves the static list
|
|
351
|
+
* exactly as declared, so this can only ever ADD accuracy, never take the picker's effort choices
|
|
352
|
+
* away.
|
|
353
|
+
*
|
|
354
|
+
* Stripped from `DetectedAgent` alongside the other closures — see `detection.ts#stripFns`.
|
|
355
|
+
*/
|
|
356
|
+
deriveReasoningOptions?: (requiredArgs: {
|
|
357
|
+
models: readonly RuntimeModelOption[];
|
|
358
|
+
}) => RuntimeReasoningOption[] | null;
|
|
359
|
+
/**
|
|
360
|
+
* See {@link RuntimeReasoningInModelId}. Mutually exclusive with
|
|
361
|
+
* `reasoningOptions` in practice: a def declaring both would tell a picker
|
|
362
|
+
* that the same choice lives in two different places at once.
|
|
363
|
+
*
|
|
364
|
+
* Survives `detection.ts#stripFns` (plain data, no closure), so a UI reading
|
|
365
|
+
* a `DetectedAgent` off the wire gets the vocabulary it needs to do the
|
|
366
|
+
* per-base-model derivation itself.
|
|
367
|
+
*/
|
|
368
|
+
reasoningInModelId?: RuntimeReasoningInModelId;
|
|
369
|
+
/**
|
|
370
|
+
* How this def's CLI/protocol receives user-supplied image attachments.
|
|
371
|
+
* Supersedes the old `supportsImagePaths: boolean` field (which was never
|
|
372
|
+
* actually read anywhere outside its own two defs' tests — a pure
|
|
373
|
+
* documentation flag, not a gate on any real behavior): that boolean could
|
|
374
|
+
* not express *how* a def receives an image, so a caller had no way to
|
|
375
|
+
* apply the right mechanism per def, or to avoid applying two at once.
|
|
376
|
+
*
|
|
377
|
+
* 'native' — the def's own protocol/CLI already carries the image
|
|
378
|
+
* reference or bytes directly (an ACP `resource_link`
|
|
379
|
+
* prompt block, pi-rpc's base64 `images` field, a
|
|
380
|
+
* dedicated CLI flag like qoder's `--attachment`, …).
|
|
381
|
+
* The daemon must NOT also augment the prompt text or
|
|
382
|
+
* widen `extraAllowedDirs` for these — the def's own
|
|
383
|
+
* code path already delivers the image, and doing both
|
|
384
|
+
* would deliver the same image twice.
|
|
385
|
+
* 'prompt-path' — the CLI has no dedicated image mechanism, but CAN
|
|
386
|
+
* read a local file once its path is named in the
|
|
387
|
+
* prompt text (confirmed for Claude Code by a live
|
|
388
|
+
* `claude -p` probe — see `defs/claude.ts`'s module
|
|
389
|
+
* doc). The caller (`@jini-ai/daemon`'s
|
|
390
|
+
* `image-prompt-delivery.ts`) appends an
|
|
391
|
+
* attachment-naming section to the prompt and widens
|
|
392
|
+
* `extraAllowedDirs` with each image's containing
|
|
393
|
+
* directory before `buildArgs` runs.
|
|
394
|
+
* 'unsupported' — the CLI has no way to receive an image at all.
|
|
395
|
+
* Distinct from `undefined` on purpose: `undefined`
|
|
396
|
+
* means "not yet audited for image support", not "this
|
|
397
|
+
* CLI genuinely cannot do it" — a caller must not treat
|
|
398
|
+
* the two as equivalent.
|
|
399
|
+
*
|
|
400
|
+
* `undefined` (the default for most defs today) is the same as before this
|
|
401
|
+
* field existed: no def-specific image handling is applied, and images are
|
|
402
|
+
* silently dropped exactly as they were previously — unchanged behavior.
|
|
403
|
+
*/
|
|
404
|
+
imageDelivery?: 'native' | 'prompt-path' | 'unsupported';
|
|
405
|
+
maxPromptArgBytes?: number;
|
|
406
|
+
mcpDiscovery?: string;
|
|
407
|
+
externalMcpInjection?: 'claude-mcp-json' | 'acp-merge' | 'opencode-env-content' | 'mimo-env-content' | 'codex-toml' | 'env-passthrough';
|
|
408
|
+
/** CLI explicitly supports authenticated Streamable HTTP MCP; independent of stdio delivery. */
|
|
409
|
+
mcpHttp?: boolean;
|
|
410
|
+
systemPromptDelivery?: {
|
|
411
|
+
readonly strategy: 'append-flag';
|
|
412
|
+
readonly flag: string;
|
|
413
|
+
readonly capabilityKey?: string;
|
|
414
|
+
} | {
|
|
415
|
+
readonly strategy: 'env-var';
|
|
416
|
+
readonly varName: string;
|
|
417
|
+
} | {
|
|
418
|
+
readonly strategy: 'config-instructions-file';
|
|
419
|
+
readonly varName: string;
|
|
420
|
+
};
|
|
421
|
+
/** Supports a command hook supplying short child startup context. */
|
|
422
|
+
subagentStartHook?: boolean;
|
|
423
|
+
installUrl?: string;
|
|
424
|
+
docsUrl?: string;
|
|
425
|
+
supportsCustomModel?: boolean;
|
|
426
|
+
resumesSessionViaCli?: boolean;
|
|
427
|
+
capturesSessionIdFromStream?: boolean;
|
|
428
|
+
resumesSessionViaAcpLoad?: boolean;
|
|
429
|
+
defaultModelEnvVar?: string;
|
|
430
|
+
inactivityTimeoutMs?: number;
|
|
431
|
+
authProbe?: {
|
|
432
|
+
args: string[];
|
|
433
|
+
timeoutMs?: number;
|
|
434
|
+
};
|
|
435
|
+
acpMcpEnvFormat?: 'array' | 'map';
|
|
436
|
+
needsAgentLogFile?: boolean;
|
|
437
|
+
stdoutPolicy?: RuntimeStdoutPolicy;
|
|
438
|
+
runtimeLock?: RuntimeLock;
|
|
439
|
+
};
|
|
440
|
+
export interface AcpModelProbeRequest {
|
|
441
|
+
bin: string;
|
|
442
|
+
args: string[];
|
|
443
|
+
cwd?: string;
|
|
444
|
+
env?: RuntimeEnv;
|
|
445
|
+
timeoutMs?: number;
|
|
446
|
+
signal?: AbortSignal;
|
|
447
|
+
clientName?: string;
|
|
448
|
+
clientVersion?: string;
|
|
449
|
+
defaultModelOption?: RuntimeModelOption;
|
|
450
|
+
}
|
|
451
|
+
export interface AcpModelProbe {
|
|
452
|
+
detectModels(requiredArgs: Pick<AcpModelProbeRequest, 'bin' | 'args'>, optionalArgs?: Omit<AcpModelProbeRequest, 'bin' | 'args'>): Promise<RuntimeModelOption[]>;
|
|
453
|
+
/** Optional metadata capability preserves a native current selection without guessing from order. */
|
|
454
|
+
detectMetadata?(requiredArgs: Pick<AcpModelProbeRequest, 'bin' | 'args'>, optionalArgs?: Omit<AcpModelProbeRequest, 'bin' | 'args'>): Promise<{
|
|
455
|
+
models: RuntimeModelOption[];
|
|
456
|
+
currentModelId: string | null;
|
|
457
|
+
}>;
|
|
458
|
+
}
|
|
459
|
+
//# sourceMappingURL=definition.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** @agent-note Types only, plus one data-only error class. The runtime parts come from the host, usually `@jini-ai/agent-runtime` (bound to a launcher with `createAgentRuntimeBindings`). */
|
|
2
|
+
export type * from './definition.js';
|
|
3
|
+
export type * from './model-catalog.js';
|
|
4
|
+
export type * from './native-tool-policy.js';
|
|
5
|
+
export type * from './launch.js';
|
|
6
|
+
export { RuntimeSelectionError } from './model-catalog.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file What an agent runtime hands a launcher: the resolved executable, staged prompt and log files, the
|
|
3
|
+
* host-implemented prompt augmenter seam and the service-failure classes. Types only.
|
|
4
|
+
*/
|
|
5
|
+
export type AgentLaunchKind = 'selected' | 'codex-native';
|
|
6
|
+
export type AgentLaunchResolution = {
|
|
7
|
+
configuredOverridePath: string | null;
|
|
8
|
+
pathResolvedPath: string | null;
|
|
9
|
+
selectedPath: string | null;
|
|
10
|
+
} & {
|
|
11
|
+
launchPath: string | null;
|
|
12
|
+
launchKind: AgentLaunchKind;
|
|
13
|
+
childPathPrepend: string[];
|
|
14
|
+
diagnostic: string | null;
|
|
15
|
+
};
|
|
16
|
+
export type PreparedAgentLogFile = {
|
|
17
|
+
/** Absolute path to hand over as `RuntimeContext.agentLogFilePath`. The file itself does not exist yet — the spawned CLI creates it. */
|
|
18
|
+
path: string;
|
|
19
|
+
/** Removes the staged directory and whatever the CLI wrote into it. Safe to call more than once (`force: true`). */
|
|
20
|
+
cleanup: () => Promise<void>;
|
|
21
|
+
};
|
|
22
|
+
export type PreparedPromptFile = {
|
|
23
|
+
path: string;
|
|
24
|
+
cleanup: () => Promise<void>;
|
|
25
|
+
};
|
|
26
|
+
/** A single item in the run's attached/selected workspace context. `kind` is host-defined — the engine treats it as an opaque string. */
|
|
27
|
+
export interface WorkspaceContextItem {
|
|
28
|
+
id: string;
|
|
29
|
+
kind: string;
|
|
30
|
+
label: string;
|
|
31
|
+
}
|
|
32
|
+
export interface RunContextSelection {
|
|
33
|
+
items: WorkspaceContextItem[];
|
|
34
|
+
}
|
|
35
|
+
export interface PromptAugmenter {
|
|
36
|
+
/**
|
|
37
|
+
* Which workspace-context `kind` strings this consumer recognizes (OD:
|
|
38
|
+
* design-system, design-files, live-artifact, …). The engine itself only
|
|
39
|
+
* knows generic kinds: file, folder, browser, terminal, project,
|
|
40
|
+
* local-code.
|
|
41
|
+
*/
|
|
42
|
+
contextKinds(): readonly string[];
|
|
43
|
+
/**
|
|
44
|
+
* Inject product context blocks (design-system selection, skills, brand,
|
|
45
|
+
* …) into the composed user request. The engine passes the base prompt +
|
|
46
|
+
* selection; the adapter returns the augmented text.
|
|
47
|
+
*/
|
|
48
|
+
augmentUserRequest(input: {
|
|
49
|
+
basePrompt: string;
|
|
50
|
+
selection: RunContextSelection;
|
|
51
|
+
agentId: string;
|
|
52
|
+
hasPriorAssistantTurn: boolean;
|
|
53
|
+
}): Promise<string> | string;
|
|
54
|
+
/**
|
|
55
|
+
* Optional system-prompt overlay. Product-specific discovery /
|
|
56
|
+
* question-form protocols live here, not in the engine.
|
|
57
|
+
*/
|
|
58
|
+
systemOverlay?(input: {
|
|
59
|
+
agentId: string;
|
|
60
|
+
turnIndex: number;
|
|
61
|
+
}): string | null;
|
|
62
|
+
}
|
|
63
|
+
export type AgentServiceFailureCode = 'AGENT_AUTH_REQUIRED' | 'RATE_LIMITED' | 'UPSTREAM_UNAVAILABLE';
|
|
64
|
+
//# sourceMappingURL=launch.d.ts.map
|