@ottimis/jack-provider-sdk 0.9.0 → 0.13.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/defaults.js +46 -0
- package/dist/cjs/defaults.js.map +1 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/oneshot.js +3 -0
- package/dist/cjs/oneshot.js.map +1 -0
- package/dist/defaults.d.ts +126 -0
- package/dist/defaults.d.ts.map +1 -0
- package/dist/defaults.js +45 -0
- package/dist/defaults.js.map +1 -0
- package/dist/host.d.ts +17 -0
- package/dist/host.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/oneshot.d.ts +81 -0
- package/dist/oneshot.d.ts.map +1 -0
- package/dist/oneshot.js +2 -0
- package/dist/oneshot.js.map +1 -0
- package/dist/provider.d.ts +151 -2
- package/dist/provider.d.ts.map +1 -1
- package/dist/sandbox.d.ts +79 -22
- package/dist/sandbox.d.ts.map +1 -1
- package/package.json +12 -7
- package/src/defaults.ts +130 -0
- package/src/host.ts +17 -0
- package/src/index.ts +2 -0
- package/src/oneshot.ts +81 -0
- package/src/provider.ts +151 -2
- package/src/sandbox.ts +84 -22
package/dist/provider.d.ts.map
CHANGED
|
@@ -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,UAAU,EAAE,MAAM,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AAC,CAAA;CACH,CAAA"}
|
package/dist/sandbox.d.ts
CHANGED
|
@@ -30,30 +30,36 @@
|
|
|
30
30
|
* free to host wherever they like.
|
|
31
31
|
*/
|
|
32
32
|
/**
|
|
33
|
-
* Mount
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
33
|
+
* Mount a named Docker volume into the container at {@link containerPath}.
|
|
34
|
+
* The pattern Anthropic recommends for CLI config dirs (see
|
|
35
|
+
* https://code.claude.com/docs/en/devcontainer#persist-authentication-and-settings-across-rebuilds):
|
|
36
|
+
* the volume is auto-created on demand, persists across container
|
|
37
|
+
* restarts, and isolates writes from the host filesystem entirely.
|
|
38
|
+
* Best fit for `~/.claude`, `~/.codex`, `~/.gemini` since they hold auth
|
|
39
|
+
* tokens, session JSONLs, and CLI-mutated settings.
|
|
39
40
|
*
|
|
40
|
-
* Read-only
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
41
|
+
* Read-only is recommended whenever the CLI doesn't genuinely need to
|
|
42
|
+
* mutate state. Set `readOnly: false` when the CLI writes back — Claude
|
|
43
|
+
* writes session-env, project history, MCP additions; Codex appends
|
|
44
|
+
* thread JSONL; etc.
|
|
44
45
|
*/
|
|
45
46
|
export type SandboxConfigMount = {
|
|
46
47
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
48
|
+
* Docker volume name. The host auto-creates the volume if missing
|
|
49
|
+
* (via `docker volume create <name>`). Use a stable, namespaced name
|
|
50
|
+
* like `jack-sandbox-<provider>-config` so volumes can be inspected
|
|
51
|
+
* / pruned predictably from the Docker CLI.
|
|
52
|
+
*
|
|
53
|
+
* Volumes are NOT scoped per session by default — sharing one volume
|
|
54
|
+
* across sandbox sessions of the same provider is the common case
|
|
55
|
+
* and matches Anthropic's reference. If you need per-session
|
|
56
|
+
* isolation, embed the session id in the name.
|
|
51
57
|
*/
|
|
52
|
-
|
|
58
|
+
readonly volumeName: string;
|
|
53
59
|
/** Absolute container path. */
|
|
54
|
-
containerPath: string;
|
|
55
|
-
/** When `true`, the host adds `:ro` to the bind.
|
|
56
|
-
readOnly: boolean;
|
|
60
|
+
readonly containerPath: string;
|
|
61
|
+
/** When `true`, the host adds `:ro` to the bind. */
|
|
62
|
+
readonly readOnly: boolean;
|
|
57
63
|
};
|
|
58
64
|
/**
|
|
59
65
|
* Provider-declared Docker sandbox capability. Optional on
|
|
@@ -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
|
|
@@ -100,5 +112,50 @@ export interface SandboxApi {
|
|
|
100
112
|
* sandbox even when the user has it on globally.
|
|
101
113
|
*/
|
|
102
114
|
envExtras?(): Record<string, string>;
|
|
115
|
+
/**
|
|
116
|
+
* Optional spawn-time setup hook. Runs once on the host before the
|
|
117
|
+
* container starts and lets the provider produce per-session artifacts
|
|
118
|
+
* (e.g. a sanitized `settings.json` with hooks stripped, a generated
|
|
119
|
+
* MCP manifest) and mount them into the container alongside the static
|
|
120
|
+
* {@link configMounts}.
|
|
121
|
+
*
|
|
122
|
+
* Returned `extraMounts` are appended to {@link configMounts} in
|
|
123
|
+
* declaration order. The `cleanup` callback (if provided) is invoked
|
|
124
|
+
* after the container exits so the provider can unlink temp files.
|
|
125
|
+
*
|
|
126
|
+
* Errors thrown here propagate as spawn failures — keep the work fast
|
|
127
|
+
* and synchronous-friendly (file I/O, not network calls).
|
|
128
|
+
*/
|
|
129
|
+
prepareSpawn?(ctx: SandboxSpawnContext): SandboxSpawnSetup | Promise<SandboxSpawnSetup>;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Context passed to {@link SandboxApi.prepareSpawn}. Identifies the Jack
|
|
133
|
+
* session and the project root being mounted at `/workspace`. Providers
|
|
134
|
+
* use these to namespace temp files (one settings overlay per session)
|
|
135
|
+
* and avoid collisions across concurrent sandbox sessions.
|
|
136
|
+
*/
|
|
137
|
+
export interface SandboxSpawnContext {
|
|
138
|
+
/** Stable per-session id. Safe to embed in temp filenames. */
|
|
139
|
+
readonly sessionId: string;
|
|
140
|
+
/** Absolute host path mounted at `/workspace` inside the container. */
|
|
141
|
+
readonly projectPath: string;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Return value of {@link SandboxApi.prepareSpawn}. Both fields optional —
|
|
145
|
+
* a no-op setup just returns `{}`.
|
|
146
|
+
*/
|
|
147
|
+
export interface SandboxSpawnSetup {
|
|
148
|
+
/**
|
|
149
|
+
* Mounts to merge with the provider's static {@link configMounts}.
|
|
150
|
+
* Useful for overlaying generated files (e.g. a sanitized settings.json
|
|
151
|
+
* mounted on top of a config-dir mount shadows the original entry).
|
|
152
|
+
*/
|
|
153
|
+
readonly extraMounts?: readonly SandboxConfigMount[];
|
|
154
|
+
/**
|
|
155
|
+
* Optional teardown. Invoked once after the container exits, even if
|
|
156
|
+
* the spawn fails after `prepareSpawn` resolved. Errors are logged but
|
|
157
|
+
* not propagated — cleanup is best-effort.
|
|
158
|
+
*/
|
|
159
|
+
cleanup?(): void | Promise<void>;
|
|
103
160
|
}
|
|
104
161
|
//# sourceMappingURL=sandbox.d.ts.map
|
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;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,+BAA+B;IAC/B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,oDAAoD;IACpD,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;CAC3B,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;IAEpC;;;;;;;;;;;;;OAaG;IACH,YAAY,CAAC,CACX,GAAG,EAAE,mBAAmB,GACvB,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA;CAClD;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,8DAA8D;IAC9D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,uEAAuE;IACvE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAC7B;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAA;IACpD;;;;OAIG;IACH,OAAO,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACjC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ottimis/jack-provider-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.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": {
|
|
@@ -29,14 +29,19 @@
|
|
|
29
29
|
"clean": "rm -rf dist"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@ottimis/jack-chat-core": ">=0.
|
|
32
|
+
"@ottimis/jack-chat-core": ">=0.7.0",
|
|
33
33
|
"zod": ">=3.22.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@ottimis/jack-chat-core": "
|
|
37
|
-
"@types/node": "^22.
|
|
38
|
-
"tsx": "^4.
|
|
39
|
-
"typescript": "^5.
|
|
40
|
-
"zod": "^4.3
|
|
36
|
+
"@ottimis/jack-chat-core": "0.7.0",
|
|
37
|
+
"@types/node": "^22.19.19",
|
|
38
|
+
"tsx": "^4.22.0",
|
|
39
|
+
"typescript": "^5.9.3",
|
|
40
|
+
"zod": "^4.4.3"
|
|
41
|
+
},
|
|
42
|
+
"pnpm": {
|
|
43
|
+
"ignoredBuiltDependencies": [
|
|
44
|
+
"esbuild"
|
|
45
|
+
]
|
|
41
46
|
}
|
|
42
47
|
}
|
package/src/defaults.ts
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider-declared user defaults — per-provider "what you want this provider
|
|
3
|
+
* to pick when a new session is created".
|
|
4
|
+
*
|
|
5
|
+
* Three field kinds are supported today: `model`, `effort`, and
|
|
6
|
+
* `permission_mode`. Each provider declares which of those are meaningful
|
|
7
|
+
* for its runtime and the catalog of legal values for each. The host owns
|
|
8
|
+
* storage (via `HostServices.kv`) and resolution (`resolveProviderDefaults`
|
|
9
|
+
* merges global → workspace → agent layers in the future; v1 is global
|
|
10
|
+
* only). The provider only declares the **catalog**; it never persists or
|
|
11
|
+
* resolves values itself.
|
|
12
|
+
*
|
|
13
|
+
* Design notes
|
|
14
|
+
* ------------
|
|
15
|
+
* - Catalog-only contract. The provider is authoritative on "what's
|
|
16
|
+
* settable" and "with which values". The host validates writes against
|
|
17
|
+
* this catalog and silently ignores stored values that fall outside it
|
|
18
|
+
* (e.g. after a provider bump removed a model).
|
|
19
|
+
* - Presence-based gating. A provider that doesn't declare `defaults`
|
|
20
|
+
* simply doesn't appear in `Settings → Provider defaults` and no
|
|
21
|
+
* pre-fill happens. No `CapabilityMatrix` flag needed.
|
|
22
|
+
* - Open for layering. The resolver signature (`workspaceId?`,
|
|
23
|
+
* `agentSlotId?`) is in v1 even though only the global layer is
|
|
24
|
+
* implemented, so adding workspace/agent overrides later is a host-only
|
|
25
|
+
* change without touching the SDK.
|
|
26
|
+
*
|
|
27
|
+
* Cross-references in the existing SDK surface
|
|
28
|
+
* --------------------------------------------
|
|
29
|
+
* - `model` overlaps with `JackProvider.modelOptions` (live dropdown) and
|
|
30
|
+
* `ProviderModelDefaults.oneShot` (host suggester tasks). The
|
|
31
|
+
* `ProviderDefaultsApi` is distinct: it answers "what model do new
|
|
32
|
+
* sessions get". A provider typically reuses `modelOptions` as the
|
|
33
|
+
* defaults catalog but it's not required (e.g. a provider could hide
|
|
34
|
+
* experimental models from the default-picker while keeping them in
|
|
35
|
+
* the live switcher).
|
|
36
|
+
* - `effort` mirrors `JackProvider.effortLevels` semantics. Codex applies
|
|
37
|
+
* effort at spawn time; declaring it as a default is how the host
|
|
38
|
+
* honours that without an extra dropdown in `NewSessionDialog`.
|
|
39
|
+
* - `permission_mode` mirrors `CapabilityMatrix.permissionModes`. The
|
|
40
|
+
* default is the mode every freshly-created session starts in
|
|
41
|
+
* (the user can still cycle it live via Shift-Tab if
|
|
42
|
+
* `livePermissionModeSwitch` is true).
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
import type { AgentEffortLevel, AgentPermissionMode } from './backend'
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* One field a provider exposes in the defaults form. Discriminated union
|
|
49
|
+
* keyed on `kind` so the host renders the right widget (string-id select
|
|
50
|
+
* for model, enum select for effort, etc.) without provider-specific code.
|
|
51
|
+
*
|
|
52
|
+
* `options` is the catalog of legal values. Empty → host hides the field
|
|
53
|
+
* (parity with `JackProvider.modelOptions` / `effortLevels` semantics).
|
|
54
|
+
*/
|
|
55
|
+
export type ProviderDefaultsField =
|
|
56
|
+
| {
|
|
57
|
+
kind: 'model'
|
|
58
|
+
/**
|
|
59
|
+
* Catalog of model identifiers. `value` is what the host writes into
|
|
60
|
+
* `sessions.model` at create time; `label` is the human display.
|
|
61
|
+
* Typically reuses `JackProvider.modelOptions` 1:1 but providers MAY
|
|
62
|
+
* filter (e.g. hide experimental models from new-session pre-fill).
|
|
63
|
+
*/
|
|
64
|
+
options: ReadonlyArray<{ value: string; label: string }>
|
|
65
|
+
}
|
|
66
|
+
| {
|
|
67
|
+
kind: 'effort'
|
|
68
|
+
/**
|
|
69
|
+
* Catalog of effort tiers. `value` MUST be a member of
|
|
70
|
+
* {@link AgentEffortLevel}. Renderer falls back to the raw string as
|
|
71
|
+
* the label.
|
|
72
|
+
*/
|
|
73
|
+
options: ReadonlyArray<AgentEffortLevel>
|
|
74
|
+
}
|
|
75
|
+
| {
|
|
76
|
+
kind: 'permission_mode'
|
|
77
|
+
/**
|
|
78
|
+
* Catalog of permission modes available as session-start defaults.
|
|
79
|
+
* Typically equals `CapabilityMatrix.permissionModes` but providers
|
|
80
|
+
* MAY narrow (e.g. exclude `'bypassPermissions'` from the default
|
|
81
|
+
* picker even when the cycle supports it — the user has to opt in
|
|
82
|
+
* deliberately).
|
|
83
|
+
*/
|
|
84
|
+
options: ReadonlyArray<AgentPermissionMode>
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Provider-declared catalog of configurable defaults. Static — the host
|
|
89
|
+
* reads `fields` once per provider listing and validates user writes
|
|
90
|
+
* against it. Empty array would technically be valid but pointless; the
|
|
91
|
+
* convention is "omit `JackProvider.defaults` entirely" for providers
|
|
92
|
+
* with no defaults to expose.
|
|
93
|
+
*/
|
|
94
|
+
export type ProviderDefaultsApi = {
|
|
95
|
+
readonly fields: ReadonlyArray<ProviderDefaultsField>
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Resolved defaults as the host serialises them per-provider in kv. Every
|
|
100
|
+
* field is optional — "not set" means "use the provider's runtime default"
|
|
101
|
+
* (model NULL, effort NULL, permission_mode 'default').
|
|
102
|
+
*
|
|
103
|
+
* Stored as a single JSON blob at `provider.<id>.defaults` so partial
|
|
104
|
+
* writes are atomic and the host can wipe the whole bag in one call.
|
|
105
|
+
*/
|
|
106
|
+
export type ProviderDefaultsValues = {
|
|
107
|
+
model?: string
|
|
108
|
+
effort?: AgentEffortLevel
|
|
109
|
+
permissionMode?: AgentPermissionMode
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Context the host resolver consumes. v1 only honours `providerId` (global
|
|
114
|
+
* defaults). `workspaceId` and `agentSlotId` are reserved placeholders for
|
|
115
|
+
* future per-workspace and per-agent overrides — the resolver signature
|
|
116
|
+
* accepts them today so the call sites can be written once and the host
|
|
117
|
+
* gains layering later without a callsite change.
|
|
118
|
+
*
|
|
119
|
+
* Resolution order (when layering lands): agent slot > workspace > global.
|
|
120
|
+
* Per-field merge: each field is resolved independently, so an agent slot
|
|
121
|
+
* can override `model` while letting `permissionMode` fall through to the
|
|
122
|
+
* global value.
|
|
123
|
+
*/
|
|
124
|
+
export type ProviderDefaultsResolveContext = {
|
|
125
|
+
providerId: string
|
|
126
|
+
/** Reserved for future per-workspace defaults; ignored in v1. */
|
|
127
|
+
workspaceId?: string
|
|
128
|
+
/** Reserved for future per-agent-slot defaults; ignored in v1. */
|
|
129
|
+
agentSlotId?: string
|
|
130
|
+
}
|
package/src/host.ts
CHANGED
|
@@ -156,4 +156,21 @@ export type HostServices = {
|
|
|
156
156
|
kv: HostKvScope
|
|
157
157
|
/** Auth flow primitives (cookie login today; OAuth / device-code in the future). */
|
|
158
158
|
auth: HostAuthService
|
|
159
|
+
/**
|
|
160
|
+
* Number of sessions currently pinned to a given profile id. Used by
|
|
161
|
+
* providers that surface profiles (`JackProvider.profiles`) to gate
|
|
162
|
+
* destructive operations:
|
|
163
|
+
*
|
|
164
|
+
* - `remove(profileId)` refuses when count > 0 so the user can't
|
|
165
|
+
* orphan the chat history of any pinned session.
|
|
166
|
+
* - `update(profileId, { configDir })` may surface a confirm dialog
|
|
167
|
+
* when count > 0 (UI-side concern; the API itself stays open since
|
|
168
|
+
* the user can move the on-disk `projects/`/rollouts folder
|
|
169
|
+
* manually to preserve history).
|
|
170
|
+
*
|
|
171
|
+
* Optional: providers without a profile concept never call it. The
|
|
172
|
+
* host implementation reads `SELECT COUNT(*) FROM sessions WHERE
|
|
173
|
+
* profile_id = ?`.
|
|
174
|
+
*/
|
|
175
|
+
profileUsageCount?(profileId: string): number
|
|
159
176
|
}
|
package/src/index.ts
CHANGED
package/src/oneshot.ts
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One-shot completion capability — fire-and-forget AI calls outside the
|
|
3
|
+
* lifetime of a session.
|
|
4
|
+
*
|
|
5
|
+
* Use cases the host wires this for:
|
|
6
|
+
* - Auto-generate a commit message from a staged diff (CommitComposer).
|
|
7
|
+
* - Future: summarize a tool result, propose a search query, name a
|
|
8
|
+
* workspace from its first prompt, etc.
|
|
9
|
+
*
|
|
10
|
+
* Distinct from {@link AgentBackend.query} on purpose:
|
|
11
|
+
* - No tools, no MCP, no permission flow, no resume.
|
|
12
|
+
* - No persisted session — the provider MUST NOT leave artifacts on disk.
|
|
13
|
+
* - Returns plain text, synchronously to the caller (no streaming UI).
|
|
14
|
+
* - Reuses whatever auth/credentials the user already has (CLI cookie,
|
|
15
|
+
* API key, OAuth token) — same source as session calls.
|
|
16
|
+
*
|
|
17
|
+
* Provider implementations are expected to be **cheap and fast**: pick the
|
|
18
|
+
* smallest reasonable model the user is authenticated for, no agentic
|
|
19
|
+
* loops, no tool definitions, no caching beyond what the platform does on
|
|
20
|
+
* its own. A typical call should complete in well under a second.
|
|
21
|
+
*/
|
|
22
|
+
export type OneshotCompleteOptions = {
|
|
23
|
+
/**
|
|
24
|
+
* The user prompt — what the model should respond to. The host builds
|
|
25
|
+
* this string by interpolating the relevant context (diff, branch,
|
|
26
|
+
* recent commit subjects, …) into a stable template; providers MUST
|
|
27
|
+
* NOT re-prompt or transform it beyond what's needed for their wire
|
|
28
|
+
* format.
|
|
29
|
+
*/
|
|
30
|
+
prompt: string
|
|
31
|
+
/**
|
|
32
|
+
* Optional system prompt. Use sparingly — keeping the host-side prompt
|
|
33
|
+
* provider-neutral means we can fan out the same call across providers
|
|
34
|
+
* without re-tuning. Implementations that don't have a system slot
|
|
35
|
+
* (rare) MAY prepend this to `prompt` and document the choice.
|
|
36
|
+
*/
|
|
37
|
+
system?: string
|
|
38
|
+
/**
|
|
39
|
+
* Cap on output tokens. Providers MUST honor it as best they can; the
|
|
40
|
+
* host treats overruns as warnings, not errors. Defaults are
|
|
41
|
+
* provider-specific.
|
|
42
|
+
*/
|
|
43
|
+
maxOutputTokens?: number
|
|
44
|
+
/**
|
|
45
|
+
* Cap on wall-clock time. Providers SHOULD abort the underlying request
|
|
46
|
+
* when the deadline is exceeded and reject the returned promise rather
|
|
47
|
+
* than block the caller forever. Default is provider-specific.
|
|
48
|
+
*/
|
|
49
|
+
timeoutMs?: number
|
|
50
|
+
/**
|
|
51
|
+
* AbortSignal — host-controlled cancellation. Providers MUST wire this
|
|
52
|
+
* into their underlying HTTP / process call so the renderer can drop a
|
|
53
|
+
* pending generation when the user closes the dialog or navigates away.
|
|
54
|
+
*/
|
|
55
|
+
signal?: AbortSignal
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* One-shot completion API — optional capability on {@link JackProvider}.
|
|
60
|
+
*
|
|
61
|
+
* Providers that expose this MUST also declare `capabilities.oneshot =
|
|
62
|
+
* true`. The host uses the capability flag to gate UI affordances (button
|
|
63
|
+
* disabled, tooltip explaining "active provider doesn't support this")
|
|
64
|
+
* before ever calling into the provider, so the API surface stays simple:
|
|
65
|
+
* providers don't need to throw a "not implemented" error — they just
|
|
66
|
+
* leave the field undefined.
|
|
67
|
+
*/
|
|
68
|
+
export type OneshotApi = {
|
|
69
|
+
/**
|
|
70
|
+
* Run a single non-agentic completion and return the assistant's text
|
|
71
|
+
* verbatim — no streaming, no tool calls, no follow-up turns.
|
|
72
|
+
*
|
|
73
|
+
* Errors:
|
|
74
|
+
* - Network / auth: reject with the underlying error. Host catches and
|
|
75
|
+
* surfaces a toast.
|
|
76
|
+
* - AbortSignal aborted: reject with `DOMException('AbortError')`.
|
|
77
|
+
* - Empty / malformed model output: return an empty string. Host
|
|
78
|
+
* treats empty as "no suggestion" and keeps the textarea unchanged.
|
|
79
|
+
*/
|
|
80
|
+
complete(opts: OneshotCompleteOptions): Promise<string>
|
|
81
|
+
}
|