@ottimis/jack-provider-sdk 0.7.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -48,4 +48,5 @@ __exportStar(require("./provider"), exports);
48
48
  __exportStar(require("./usage"), exports);
49
49
  __exportStar(require("./host"), exports);
50
50
  __exportStar(require("./profiles"), exports);
51
+ __exportStar(require("./sandbox"), exports);
51
52
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;;;;;;;;;;;;;;;;AAEH,4CAAyB;AACzB,4CAAyB;AACzB,6CAA0B;AAC1B,0CAAuB;AACvB,yCAAsB;AACtB,6CAA0B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;;;;;;;;;;;;;;;;AAEH,4CAAyB;AACzB,4CAAyB;AACzB,6CAA0B;AAC1B,0CAAuB;AACvB,yCAAsB;AACtB,6CAA0B;AAC1B,4CAAyB"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ /**
3
+ * SandboxApi — provider-declared Docker sandbox capability.
4
+ *
5
+ * Jack runs sessions in a Docker container ("sandbox mode") to isolate the
6
+ * provider's CLI from the host filesystem and network. The container itself
7
+ * is generic — Jack owns the Docker orchestration, security policy (CapDrop,
8
+ * memory cap, non-privileged), project mount, and user-defined shared
9
+ * volumes. The PROVIDER-SPECIFIC bits live here:
10
+ *
11
+ * - which image to pull (each provider needs its own CLI installed)
12
+ * - which binary name to invoke inside the container (used by the host to
13
+ * rewrite host-resolved absolute paths like
14
+ * `/Users/foo/.local/bin/claude` to a bare command the container's
15
+ * PATH resolves)
16
+ * - which config dir to mount (`~/.claude`, `~/.codex`, `~/.gemini`, …)
17
+ * - optional env extras
18
+ *
19
+ * A provider declaring `sandbox` opts itself into sandbox mode. The
20
+ * matching capability flag {@link CapabilityMatrix.sandbox} MUST be `true`
21
+ * — the host derives it from `provider.sandbox != null` at registration.
22
+ *
23
+ * Providers that don't declare `sandbox` (or set it to `undefined`) are
24
+ * treated as sandbox-incompatible: the host hides the toggle in the UI and
25
+ * blocks spawn-time requests with a clear error.
26
+ *
27
+ * The host's distribution model expects images at
28
+ * `ghcr.io/ottimis/jack-sandbox-<provider-id>:<X.Y.Z>` (monorepo
29
+ * `github.com/ottimis/JACK-sandbox`). Providers can point `defaultImage`
30
+ * elsewhere — third-party plugin authors who maintain their own image are
31
+ * free to host wherever they like.
32
+ */
33
+ Object.defineProperty(exports, "__esModule", { value: true });
34
+ //# sourceMappingURL=sandbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sandbox.js","sourceRoot":"","sources":["../../src/sandbox.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG"}
package/dist/index.d.ts CHANGED
@@ -32,6 +32,7 @@ export * from './provider';
32
32
  export * from './usage';
33
33
  export * from './host';
34
34
  export * from './profiles';
35
+ export * from './sandbox';
35
36
  /**
36
37
  * Re-export of `NormalizedMessage` from chat-core so consumers don't need
37
38
  * to depend on it directly when their only entrypoint into the wire shape
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA;AACtB,cAAc,YAAY,CAAA;AAE1B;;;;;GAKG;AACH,YAAY,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA;AACtB,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AAEzB;;;;;GAKG;AACH,YAAY,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA"}
package/dist/index.js CHANGED
@@ -32,4 +32,5 @@ export * from './provider';
32
32
  export * from './usage';
33
33
  export * from './host';
34
34
  export * from './profiles';
35
+ export * from './sandbox';
35
36
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA;AACtB,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA;AACtB,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA"}
@@ -18,6 +18,7 @@
18
18
  import type { AgentBackend, AgentPermissionMode, AgentQueryOptions, McpServerSpec } from './backend';
19
19
  import type { HostServices } from './host';
20
20
  import type { ProfilesApi } from './profiles';
21
+ import type { SandboxApi } from './sandbox';
21
22
  import type { UsageApi } from './usage';
22
23
  import type { ZodType } from 'zod';
23
24
  import type { ClientToolHandler, NormalizedMessage, NormalizedToolRef, ProviderUserContentPolicy, ToolShape } from '@ottimis/jack-chat-core';
@@ -270,6 +271,17 @@ export type CapabilityMatrix = {
270
271
  * config dir; the host hides every profile-related affordance.
271
272
  */
272
273
  profiles: boolean;
274
+ /**
275
+ * Provider can run inside Jack's Docker sandbox. When `true`,
276
+ * {@link JackProvider.sandbox} MUST be defined; the host enables the
277
+ * sandbox toggle in the new-session dialog and renders an entry for this
278
+ * provider in `Settings → Sandbox`.
279
+ *
280
+ * When `false` (or omitted), sandbox mode is unavailable for this
281
+ * provider — the toggle is hidden / disabled in the UI, and a spawn-time
282
+ * sandbox request returns a clear error.
283
+ */
284
+ sandbox: boolean;
273
285
  /**
274
286
  * Permission modes the provider actually supports. Drives the
275
287
  * Shift-Tab cycle in the renderer (`MessageInputBar`) and any
@@ -288,6 +300,23 @@ export type CapabilityMatrix = {
288
300
  * or settings); the catalog only governs UI affordances.
289
301
  */
290
302
  permissionModes: readonly AgentPermissionMode[];
303
+ /**
304
+ * Suggested prompt-cache TTL in milliseconds — how long the provider's
305
+ * server-side prompt cache stays warm between user turns before a new
306
+ * cache-write is required. Optional: providers without prompt caching
307
+ * (or without a documented TTL) leave it undefined and the host hides
308
+ * the cache-countdown chip entirely for sessions on that provider.
309
+ *
310
+ * This is only the **suggested default**: the user can override per
311
+ * provider in `Settings → Prompt cache` and disable the chip outright.
312
+ * The host treats this as a UI-only countdown hint — never as a
313
+ * contract for actual cache eviction (the provider is the source of
314
+ * truth at request time).
315
+ *
316
+ * Claude declares 300_000 (5 min) per its prompt-caching docs. Codex
317
+ * and Gemini leave it undefined.
318
+ */
319
+ cacheTtlMs?: number;
291
320
  };
292
321
  /**
293
322
  * Re-exports of canonical wire-shape types from chat-core so consumers of
@@ -645,6 +674,14 @@ export type JackProvider = {
645
674
  * Codex `CODEX_HOME`, …).
646
675
  */
647
676
  profiles?: ProfilesApi;
677
+ /**
678
+ * Docker sandbox capability — provider declares the image, binary name,
679
+ * and config-dir mount the host needs to spawn a sandboxed session for
680
+ * this provider. See {@link SandboxApi}. Optional; when undefined
681
+ * `capabilities.sandbox` MUST be `false` and the host disables sandbox
682
+ * mode for this provider's sessions.
683
+ */
684
+ sandbox?: SandboxApi;
648
685
  /**
649
686
  * Optional one-shot activation hook. Called once by the host during
650
687
  * registration with a {@link HostServices} bag scoped to this
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AACpG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AACvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AAClC,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,yBAAyB,EACzB,SAAS,EACV,MAAM,yBAAyB,CAAA;AAEhC,MAAM,MAAM,UAAU,GAAG,MAAM,CAAA;AAE/B;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;AAEvF;;;GAGG;AACH,KAAK,mBAAmB,GAAG;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,eAAe,GACvB,CAAC,mBAAmB,GAAG;IAAE,KAAK,EAAE,SAAS,CAAA;CAAE,CAAC,GAC5C,CAAC,mBAAmB,G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AAkB,EAC5B,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAA;IACV,GAAG,CACD,MAAM,EAAE,gBAAgB,EACxB,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAA;CACX,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB;;;;;;;;;;OAUG;IACH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC;QAClD,OAAO,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;QAC9C,OAAO,CAAC,EAAE,OAAO,CAAA;KAClB,CAAC,CAAA;CACH,CAAA"}
@@ -0,0 +1,116 @@
1
+ /**
2
+ * SandboxApi — provider-declared Docker sandbox capability.
3
+ *
4
+ * Jack runs sessions in a Docker container ("sandbox mode") to isolate the
5
+ * provider's CLI from the host filesystem and network. The container itself
6
+ * is generic — Jack owns the Docker orchestration, security policy (CapDrop,
7
+ * memory cap, non-privileged), project mount, and user-defined shared
8
+ * volumes. The PROVIDER-SPECIFIC bits live here:
9
+ *
10
+ * - which image to pull (each provider needs its own CLI installed)
11
+ * - which binary name to invoke inside the container (used by the host to
12
+ * rewrite host-resolved absolute paths like
13
+ * `/Users/foo/.local/bin/claude` to a bare command the container's
14
+ * PATH resolves)
15
+ * - which config dir to mount (`~/.claude`, `~/.codex`, `~/.gemini`, …)
16
+ * - optional env extras
17
+ *
18
+ * A provider declaring `sandbox` opts itself into sandbox mode. The
19
+ * matching capability flag {@link CapabilityMatrix.sandbox} MUST be `true`
20
+ * — the host derives it from `provider.sandbox != null` at registration.
21
+ *
22
+ * Providers that don't declare `sandbox` (or set it to `undefined`) are
23
+ * treated as sandbox-incompatible: the host hides the toggle in the UI and
24
+ * blocks spawn-time requests with a clear error.
25
+ *
26
+ * The host's distribution model expects images at
27
+ * `ghcr.io/ottimis/jack-sandbox-<provider-id>:<X.Y.Z>` (monorepo
28
+ * `github.com/ottimis/JACK-sandbox`). Providers can point `defaultImage`
29
+ * elsewhere — third-party plugin authors who maintain their own image are
30
+ * free to host wherever they like.
31
+ */
32
+ /**
33
+ * Mount a provider-side config artifact (directory or file) into the
34
+ * container. Most providers persist auth + sessions + per-user settings in
35
+ * a dotfile dir under `$HOME` (Claude `~/.claude`, Codex `~/.codex`,
36
+ * Gemini `~/.gemini`); some additionally need a sibling config file
37
+ * mounted alongside (Claude `~/.claude.json` is a good example — the CLI
38
+ * reads it as the "main config" separate from the dotfile dir). The host
39
+ * mounts each entry into the container at {@link containerPath} so the CLI
40
+ * inside the container has access to the same state as the host.
41
+ *
42
+ * Read-only is recommended whenever the provider's CLI doesn't genuinely
43
+ * need to mutate state. Set `readOnly: false` when the CLI writes back —
44
+ * Claude writes session-env, project history, MCP additions; Codex appends
45
+ * thread JSONL; etc. The trade-off when RW is enabled: sandbox sessions
46
+ * share the same on-disk state as the host CLI (history, project state,
47
+ * MCP edits). If you need credential isolation, build a copy-on-write
48
+ * scratch volume — the {@link SandboxApi} contract doesn't impose one.
49
+ */
50
+ export type SandboxConfigMount = {
51
+ /**
52
+ * Absolute host path. Provider implementations resolve this lazily — call
53
+ * `os.homedir()` + `path.join(...)` at the time `configMounts` is read,
54
+ * not at module-load time, so test environments and per-process HOME
55
+ * overrides work correctly. May point to either a directory or a single
56
+ * file — Docker's bind mount accepts both.
57
+ */
58
+ hostPath: string;
59
+ /** Absolute container path. */
60
+ containerPath: string;
61
+ /** When `true`, the host adds `:ro` to the bind. */
62
+ readOnly: boolean;
63
+ };
64
+ /**
65
+ * Provider-declared Docker sandbox capability. Optional on
66
+ * {@link JackProvider}; when present the matching
67
+ * {@link CapabilityMatrix.sandbox} flag MUST be `true`.
68
+ */
69
+ export interface SandboxApi {
70
+ /**
71
+ * Default image reference, pinned per provider release. Format:
72
+ * `<registry>/<repo>:<tag>`. Users can override per-provider via the host
73
+ * setting `sandbox.image.<providerId>`.
74
+ *
75
+ * For Jack's first-party providers the recommended location is
76
+ * `ghcr.io/ottimis/jack-sandbox-<providerId>:<X.Y.Z>` (monorepo built
77
+ * from `github.com/ottimis/JACK-sandbox`). Third-party plugins are free
78
+ * to host elsewhere.
79
+ */
80
+ readonly defaultImage: string;
81
+ /**
82
+ * CLI binary name as it should be invoked inside the container (e.g.
83
+ * `'claude'`, `'codex'`, `'gemini'`). Used by the host's spawner to
84
+ * rewrite host-resolved absolute binary paths to a bare command the
85
+ * container's PATH resolves.
86
+ *
87
+ * The image MUST install this binary at a location reachable from
88
+ * `$PATH` (typically `/usr/local/bin/<binaryName>` via `npm install -g`).
89
+ */
90
+ readonly binaryName: string;
91
+ /**
92
+ * Mount provider-side config artifacts (directories and/or files) into
93
+ * the container. Optional — providers that are stateless on the host
94
+ * (none today) leave this undefined or pass an empty array.
95
+ *
96
+ * Multiple entries support providers whose CLI splits state across more
97
+ * than one path (e.g. Claude needs both `~/.claude/` for the dotfile dir
98
+ * and `~/.claude.json` for the main config file). Order is preserved
99
+ * but mounts are independent — if two entries overlap, Docker resolves
100
+ * them in declaration order.
101
+ */
102
+ readonly configMounts?: readonly SandboxConfigMount[];
103
+ /**
104
+ * Optional environment extras to inject into the container. Layered AFTER
105
+ * the spawn-arg env so provider-specific overrides can win, but BEFORE
106
+ * the user can override (the user-facing override is per-provider via
107
+ * the host setting, not per-env-var).
108
+ *
109
+ * Most provider env is already on `SpawnArgs.env` from the backend's
110
+ * spawn pipeline. Use this only when the SDK contract doesn't expose a
111
+ * cleaner channel — e.g. forcing a CLI to disable telemetry inside the
112
+ * sandbox even when the user has it on globally.
113
+ */
114
+ envExtras?(): Record<string, string>;
115
+ }
116
+ //# sourceMappingURL=sandbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../src/sandbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB,+BAA+B;IAC/B,aAAa,EAAE,MAAM,CAAA;IACrB,oDAAoD;IACpD,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAA;AAED;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB;;;;;;;;;OASG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAE7B;;;;;;;;OAQG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAE3B;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAA;IAErD;;;;;;;;;;OAUG;IACH,SAAS,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACrC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * SandboxApi — provider-declared Docker sandbox capability.
3
+ *
4
+ * Jack runs sessions in a Docker container ("sandbox mode") to isolate the
5
+ * provider's CLI from the host filesystem and network. The container itself
6
+ * is generic — Jack owns the Docker orchestration, security policy (CapDrop,
7
+ * memory cap, non-privileged), project mount, and user-defined shared
8
+ * volumes. The PROVIDER-SPECIFIC bits live here:
9
+ *
10
+ * - which image to pull (each provider needs its own CLI installed)
11
+ * - which binary name to invoke inside the container (used by the host to
12
+ * rewrite host-resolved absolute paths like
13
+ * `/Users/foo/.local/bin/claude` to a bare command the container's
14
+ * PATH resolves)
15
+ * - which config dir to mount (`~/.claude`, `~/.codex`, `~/.gemini`, …)
16
+ * - optional env extras
17
+ *
18
+ * A provider declaring `sandbox` opts itself into sandbox mode. The
19
+ * matching capability flag {@link CapabilityMatrix.sandbox} MUST be `true`
20
+ * — the host derives it from `provider.sandbox != null` at registration.
21
+ *
22
+ * Providers that don't declare `sandbox` (or set it to `undefined`) are
23
+ * treated as sandbox-incompatible: the host hides the toggle in the UI and
24
+ * blocks spawn-time requests with a clear error.
25
+ *
26
+ * The host's distribution model expects images at
27
+ * `ghcr.io/ottimis/jack-sandbox-<provider-id>:<X.Y.Z>` (monorepo
28
+ * `github.com/ottimis/JACK-sandbox`). Providers can point `defaultImage`
29
+ * elsewhere — third-party plugin authors who maintain their own image are
30
+ * free to host wherever they like.
31
+ */
32
+ export {};
33
+ //# sourceMappingURL=sandbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sandbox.js","sourceRoot":"","sources":["../src/sandbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ottimis/jack-provider-sdk",
3
- "version": "0.7.0",
3
+ "version": "0.10.0",
4
4
  "description": "Plugin contract for AI provider integrations in Jack — backend interface, capability matrix, spawner primitives, knowledge context. Consumed both by in-tree providers and external packages.",
5
5
  "license": "MIT",
6
6
  "repository": {
package/src/index.ts CHANGED
@@ -33,6 +33,7 @@ export * from './provider'
33
33
  export * from './usage'
34
34
  export * from './host'
35
35
  export * from './profiles'
36
+ export * from './sandbox'
36
37
 
37
38
  /**
38
39
  * Re-export of `NormalizedMessage` from chat-core so consumers don't need
package/src/provider.ts CHANGED
@@ -19,6 +19,7 @@
19
19
  import type { AgentBackend, AgentPermissionMode, AgentQueryOptions, McpServerSpec } from './backend'
20
20
  import type { HostServices } from './host'
21
21
  import type { ProfilesApi } from './profiles'
22
+ import type { SandboxApi } from './sandbox'
22
23
  import type { UsageApi } from './usage'
23
24
  import type { ZodType } from 'zod'
24
25
  import type {
@@ -286,6 +287,17 @@ export type CapabilityMatrix = {
286
287
  * config dir; the host hides every profile-related affordance.
287
288
  */
288
289
  profiles: boolean
290
+ /**
291
+ * Provider can run inside Jack's Docker sandbox. When `true`,
292
+ * {@link JackProvider.sandbox} MUST be defined; the host enables the
293
+ * sandbox toggle in the new-session dialog and renders an entry for this
294
+ * provider in `Settings → Sandbox`.
295
+ *
296
+ * When `false` (or omitted), sandbox mode is unavailable for this
297
+ * provider — the toggle is hidden / disabled in the UI, and a spawn-time
298
+ * sandbox request returns a clear error.
299
+ */
300
+ sandbox: boolean
289
301
  /**
290
302
  * Permission modes the provider actually supports. Drives the
291
303
  * Shift-Tab cycle in the renderer (`MessageInputBar`) and any
@@ -304,6 +316,23 @@ export type CapabilityMatrix = {
304
316
  * or settings); the catalog only governs UI affordances.
305
317
  */
306
318
  permissionModes: readonly AgentPermissionMode[]
319
+ /**
320
+ * Suggested prompt-cache TTL in milliseconds — how long the provider's
321
+ * server-side prompt cache stays warm between user turns before a new
322
+ * cache-write is required. Optional: providers without prompt caching
323
+ * (or without a documented TTL) leave it undefined and the host hides
324
+ * the cache-countdown chip entirely for sessions on that provider.
325
+ *
326
+ * This is only the **suggested default**: the user can override per
327
+ * provider in `Settings → Prompt cache` and disable the chip outright.
328
+ * The host treats this as a UI-only countdown hint — never as a
329
+ * contract for actual cache eviction (the provider is the source of
330
+ * truth at request time).
331
+ *
332
+ * Claude declares 300_000 (5 min) per its prompt-caching docs. Codex
333
+ * and Gemini leave it undefined.
334
+ */
335
+ cacheTtlMs?: number
307
336
  }
308
337
 
309
338
  /**
@@ -699,6 +728,14 @@ export type JackProvider = {
699
728
  * Codex `CODEX_HOME`, …).
700
729
  */
701
730
  profiles?: ProfilesApi
731
+ /**
732
+ * Docker sandbox capability — provider declares the image, binary name,
733
+ * and config-dir mount the host needs to spawn a sandboxed session for
734
+ * this provider. See {@link SandboxApi}. Optional; when undefined
735
+ * `capabilities.sandbox` MUST be `false` and the host disables sandbox
736
+ * mode for this provider's sessions.
737
+ */
738
+ sandbox?: SandboxApi
702
739
  /**
703
740
  * Optional one-shot activation hook. Called once by the host during
704
741
  * registration with a {@link HostServices} bag scoped to this
package/src/sandbox.ts ADDED
@@ -0,0 +1,120 @@
1
+ /**
2
+ * SandboxApi — provider-declared Docker sandbox capability.
3
+ *
4
+ * Jack runs sessions in a Docker container ("sandbox mode") to isolate the
5
+ * provider's CLI from the host filesystem and network. The container itself
6
+ * is generic — Jack owns the Docker orchestration, security policy (CapDrop,
7
+ * memory cap, non-privileged), project mount, and user-defined shared
8
+ * volumes. The PROVIDER-SPECIFIC bits live here:
9
+ *
10
+ * - which image to pull (each provider needs its own CLI installed)
11
+ * - which binary name to invoke inside the container (used by the host to
12
+ * rewrite host-resolved absolute paths like
13
+ * `/Users/foo/.local/bin/claude` to a bare command the container's
14
+ * PATH resolves)
15
+ * - which config dir to mount (`~/.claude`, `~/.codex`, `~/.gemini`, …)
16
+ * - optional env extras
17
+ *
18
+ * A provider declaring `sandbox` opts itself into sandbox mode. The
19
+ * matching capability flag {@link CapabilityMatrix.sandbox} MUST be `true`
20
+ * — the host derives it from `provider.sandbox != null` at registration.
21
+ *
22
+ * Providers that don't declare `sandbox` (or set it to `undefined`) are
23
+ * treated as sandbox-incompatible: the host hides the toggle in the UI and
24
+ * blocks spawn-time requests with a clear error.
25
+ *
26
+ * The host's distribution model expects images at
27
+ * `ghcr.io/ottimis/jack-sandbox-<provider-id>:<X.Y.Z>` (monorepo
28
+ * `github.com/ottimis/JACK-sandbox`). Providers can point `defaultImage`
29
+ * elsewhere — third-party plugin authors who maintain their own image are
30
+ * free to host wherever they like.
31
+ */
32
+
33
+ /**
34
+ * Mount a provider-side config artifact (directory or file) into the
35
+ * container. Most providers persist auth + sessions + per-user settings in
36
+ * a dotfile dir under `$HOME` (Claude `~/.claude`, Codex `~/.codex`,
37
+ * Gemini `~/.gemini`); some additionally need a sibling config file
38
+ * mounted alongside (Claude `~/.claude.json` is a good example — the CLI
39
+ * reads it as the "main config" separate from the dotfile dir). The host
40
+ * mounts each entry into the container at {@link containerPath} so the CLI
41
+ * inside the container has access to the same state as the host.
42
+ *
43
+ * Read-only is recommended whenever the provider's CLI doesn't genuinely
44
+ * need to mutate state. Set `readOnly: false` when the CLI writes back —
45
+ * Claude writes session-env, project history, MCP additions; Codex appends
46
+ * thread JSONL; etc. The trade-off when RW is enabled: sandbox sessions
47
+ * share the same on-disk state as the host CLI (history, project state,
48
+ * MCP edits). If you need credential isolation, build a copy-on-write
49
+ * scratch volume — the {@link SandboxApi} contract doesn't impose one.
50
+ */
51
+ export type SandboxConfigMount = {
52
+ /**
53
+ * Absolute host path. Provider implementations resolve this lazily — call
54
+ * `os.homedir()` + `path.join(...)` at the time `configMounts` is read,
55
+ * not at module-load time, so test environments and per-process HOME
56
+ * overrides work correctly. May point to either a directory or a single
57
+ * file — Docker's bind mount accepts both.
58
+ */
59
+ hostPath: string
60
+ /** Absolute container path. */
61
+ containerPath: string
62
+ /** When `true`, the host adds `:ro` to the bind. */
63
+ readOnly: boolean
64
+ }
65
+
66
+ /**
67
+ * Provider-declared Docker sandbox capability. Optional on
68
+ * {@link JackProvider}; when present the matching
69
+ * {@link CapabilityMatrix.sandbox} flag MUST be `true`.
70
+ */
71
+ export interface SandboxApi {
72
+ /**
73
+ * Default image reference, pinned per provider release. Format:
74
+ * `<registry>/<repo>:<tag>`. Users can override per-provider via the host
75
+ * setting `sandbox.image.<providerId>`.
76
+ *
77
+ * For Jack's first-party providers the recommended location is
78
+ * `ghcr.io/ottimis/jack-sandbox-<providerId>:<X.Y.Z>` (monorepo built
79
+ * from `github.com/ottimis/JACK-sandbox`). Third-party plugins are free
80
+ * to host elsewhere.
81
+ */
82
+ readonly defaultImage: string
83
+
84
+ /**
85
+ * CLI binary name as it should be invoked inside the container (e.g.
86
+ * `'claude'`, `'codex'`, `'gemini'`). Used by the host's spawner to
87
+ * rewrite host-resolved absolute binary paths to a bare command the
88
+ * container's PATH resolves.
89
+ *
90
+ * The image MUST install this binary at a location reachable from
91
+ * `$PATH` (typically `/usr/local/bin/<binaryName>` via `npm install -g`).
92
+ */
93
+ readonly binaryName: string
94
+
95
+ /**
96
+ * Mount provider-side config artifacts (directories and/or files) into
97
+ * the container. Optional — providers that are stateless on the host
98
+ * (none today) leave this undefined or pass an empty array.
99
+ *
100
+ * Multiple entries support providers whose CLI splits state across more
101
+ * than one path (e.g. Claude needs both `~/.claude/` for the dotfile dir
102
+ * and `~/.claude.json` for the main config file). Order is preserved
103
+ * but mounts are independent — if two entries overlap, Docker resolves
104
+ * them in declaration order.
105
+ */
106
+ readonly configMounts?: readonly SandboxConfigMount[]
107
+
108
+ /**
109
+ * Optional environment extras to inject into the container. Layered AFTER
110
+ * the spawn-arg env so provider-specific overrides can win, but BEFORE
111
+ * the user can override (the user-facing override is per-provider via
112
+ * the host setting, not per-env-var).
113
+ *
114
+ * Most provider env is already on `SpawnArgs.env` from the backend's
115
+ * spawn pipeline. Use this only when the SDK contract doesn't expose a
116
+ * cleaner channel — e.g. forcing a CLI to disable telemetry inside the
117
+ * sandbox even when the user has it on globally.
118
+ */
119
+ envExtras?(): Record<string, string>
120
+ }