@ottimis/jack-provider-sdk 0.9.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/sandbox.d.ts +29 -17
- package/dist/sandbox.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/sandbox.ts +29 -17
package/dist/sandbox.d.ts
CHANGED
|
@@ -30,29 +30,35 @@
|
|
|
30
30
|
* free to host wherever they like.
|
|
31
31
|
*/
|
|
32
32
|
/**
|
|
33
|
-
* Mount
|
|
34
|
-
* Most providers persist auth + sessions + per-user settings in
|
|
35
|
-
* dir under `$HOME` (Claude `~/.claude`, Codex `~/.codex`,
|
|
36
|
-
* `~/.gemini`)
|
|
37
|
-
*
|
|
38
|
-
*
|
|
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.
|
|
39
41
|
*
|
|
40
|
-
* Read-only
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
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.
|
|
44
49
|
*/
|
|
45
50
|
export type SandboxConfigMount = {
|
|
46
51
|
/**
|
|
47
52
|
* Absolute host path. Provider implementations resolve this lazily — call
|
|
48
|
-
* `os.homedir()` + `path.join(...)` at the time `
|
|
53
|
+
* `os.homedir()` + `path.join(...)` at the time `configMounts` is read,
|
|
49
54
|
* not at module-load time, so test environments and per-process HOME
|
|
50
|
-
* overrides work correctly.
|
|
55
|
+
* overrides work correctly. May point to either a directory or a single
|
|
56
|
+
* file — Docker's bind mount accepts both.
|
|
51
57
|
*/
|
|
52
58
|
hostPath: string;
|
|
53
59
|
/** Absolute container path. */
|
|
54
60
|
containerPath: string;
|
|
55
|
-
/** When `true`, the host adds `:ro` to the bind.
|
|
61
|
+
/** When `true`, the host adds `:ro` to the bind. */
|
|
56
62
|
readOnly: boolean;
|
|
57
63
|
};
|
|
58
64
|
/**
|
|
@@ -83,11 +89,17 @@ export interface SandboxApi {
|
|
|
83
89
|
*/
|
|
84
90
|
readonly binaryName: string;
|
|
85
91
|
/**
|
|
86
|
-
* Mount
|
|
87
|
-
* Optional — providers that are stateless on the host
|
|
88
|
-
* leave this undefined.
|
|
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.
|
|
89
101
|
*/
|
|
90
|
-
readonly
|
|
102
|
+
readonly configMounts?: readonly SandboxConfigMount[];
|
|
91
103
|
/**
|
|
92
104
|
* Optional environment extras to inject into the container. Layered AFTER
|
|
93
105
|
* the spawn-arg env so provider-specific overrides can win, but BEFORE
|
package/dist/sandbox.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../src/sandbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH
|
|
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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ottimis/jack-provider-sdk",
|
|
3
|
-
"version": "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/sandbox.ts
CHANGED
|
@@ -31,29 +31,35 @@
|
|
|
31
31
|
*/
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
|
-
* Mount
|
|
35
|
-
* Most providers persist auth + sessions + per-user settings in
|
|
36
|
-
* dir under `$HOME` (Claude `~/.claude`, Codex `~/.codex`,
|
|
37
|
-
* `~/.gemini`)
|
|
38
|
-
*
|
|
39
|
-
*
|
|
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.
|
|
40
42
|
*
|
|
41
|
-
* Read-only
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
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.
|
|
45
50
|
*/
|
|
46
51
|
export type SandboxConfigMount = {
|
|
47
52
|
/**
|
|
48
53
|
* Absolute host path. Provider implementations resolve this lazily — call
|
|
49
|
-
* `os.homedir()` + `path.join(...)` at the time `
|
|
54
|
+
* `os.homedir()` + `path.join(...)` at the time `configMounts` is read,
|
|
50
55
|
* not at module-load time, so test environments and per-process HOME
|
|
51
|
-
* overrides work correctly.
|
|
56
|
+
* overrides work correctly. May point to either a directory or a single
|
|
57
|
+
* file — Docker's bind mount accepts both.
|
|
52
58
|
*/
|
|
53
59
|
hostPath: string
|
|
54
60
|
/** Absolute container path. */
|
|
55
61
|
containerPath: string
|
|
56
|
-
/** When `true`, the host adds `:ro` to the bind.
|
|
62
|
+
/** When `true`, the host adds `:ro` to the bind. */
|
|
57
63
|
readOnly: boolean
|
|
58
64
|
}
|
|
59
65
|
|
|
@@ -87,11 +93,17 @@ export interface SandboxApi {
|
|
|
87
93
|
readonly binaryName: string
|
|
88
94
|
|
|
89
95
|
/**
|
|
90
|
-
* Mount
|
|
91
|
-
* Optional — providers that are stateless on the host
|
|
92
|
-
* leave this undefined.
|
|
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.
|
|
93
105
|
*/
|
|
94
|
-
readonly
|
|
106
|
+
readonly configMounts?: readonly SandboxConfigMount[]
|
|
95
107
|
|
|
96
108
|
/**
|
|
97
109
|
* Optional environment extras to inject into the container. Layered AFTER
|