@idapt/cli 1.10.0 → 1.12.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/bin.cjs +12931 -6437
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.js +143 -5
- package/dist/bin.js.map +1 -1
- package/dist/{chunk-CX7FTE47.js → chunk-GISKSK4V.js} +11933 -5577
- package/dist/chunk-GISKSK4V.js.map +1 -0
- package/dist/index.cjs +11931 -5575
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +61 -1
- package/dist/index.d.ts +61 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-CX7FTE47.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -37,7 +37,7 @@ type ResponseKind = "single" | "list" | "created" | "deleted" | "binary";
|
|
|
37
37
|
/** Wire auth mode — drives the OpenAPI `security` requirement + whether 401 is documented. */
|
|
38
38
|
type V1AuthMode = "standard" | "optional" | "public" | "bearer-only";
|
|
39
39
|
/** HTTP error statuses the v1 surface documents. */
|
|
40
|
-
type V1ErrorStatus = 401 | 402 | 403 | 404 | 409 | 422 | 429 | 500 | 503;
|
|
40
|
+
type V1ErrorStatus = 401 | 402 | 403 | 404 | 409 | 413 | 422 | 429 | 500 | 503;
|
|
41
41
|
/**
|
|
42
42
|
* A bespoke error response. Use instead of a bare {@link V1ErrorStatus} when an
|
|
43
43
|
* op documents an error with op-specific prose / example / headers that the
|
|
@@ -114,6 +114,31 @@ interface V1CommandDocFields {
|
|
|
114
114
|
/** Marks the operation `deprecated` in the spec. */
|
|
115
115
|
readonly deprecated?: boolean;
|
|
116
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* Resource type a request field resolves against. The v1 route turns a human
|
|
119
|
+
* reference (resourceId | slug | name | workspace-relative path) into the
|
|
120
|
+
* canonical internal id before the handler runs. This is the contract-level
|
|
121
|
+
* encoding of what the dispatcher's old `TOOL_PATH_PARAMETERS` map did — moved
|
|
122
|
+
* here so resolution is one server-side step shared by chat / CLI / MCP / SDK.
|
|
123
|
+
*/
|
|
124
|
+
type V1ResolveType = "file" | "folder" | "parent-folder" | "computer" | "agent" | "script" | "workspace";
|
|
125
|
+
/** How a single request field is resolved + (optionally) context-defaulted. */
|
|
126
|
+
interface V1FieldResolution {
|
|
127
|
+
/** Resource type to resolve this field's value(s) against. */
|
|
128
|
+
readonly type: V1ResolveType;
|
|
129
|
+
/** The field carries an ARRAY of references (e.g. `reference_image_ids`). */
|
|
130
|
+
readonly array?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* When the field is omitted, default it from request context instead of
|
|
133
|
+
* erroring. `"scopedWorkspace"` fills `workspace_id` from
|
|
134
|
+
* `credential.scopedWorkspaceId` (falling back to the actor's personal
|
|
135
|
+
* workspace) — the single defaulting rule that makes `workspace_id` optional
|
|
136
|
+
* on scope verbs for every caller.
|
|
137
|
+
*/
|
|
138
|
+
readonly autoDefault?: "scopedWorkspace";
|
|
139
|
+
}
|
|
140
|
+
/** Steering-policy: how this resource's playbook reaches the in-chat agent. */
|
|
141
|
+
type V1SteeringPolicy = "eager" | "reactive" | "none";
|
|
117
142
|
interface V1CommandSpec extends V1CommandDocFields {
|
|
118
143
|
/** Resource group, e.g. "drive". */
|
|
119
144
|
readonly resource: string;
|
|
@@ -139,10 +164,37 @@ interface V1CommandSpec extends V1CommandDocFields {
|
|
|
139
164
|
readonly public: boolean;
|
|
140
165
|
/** Exposed as an agent tool (dispatcher / MCP / `idapt`). */
|
|
141
166
|
readonly agentExposed: boolean;
|
|
167
|
+
/**
|
|
168
|
+
* Workspace-scope behavior for the IN-APP agent dispatcher only (CLI / MCP
|
|
169
|
+
* always pass `workspace_id` explicitly and are unaffected):
|
|
170
|
+
* - "scope" → `workspace_id` is an operating SCOPE; the dispatcher auto-pins
|
|
171
|
+
* it to the chat's current workspace when the model omits it.
|
|
172
|
+
* - "target" → `workspace_id` is a DESTINATION (move / copy / link); never
|
|
173
|
+
* auto-filled — the model must name it explicitly.
|
|
174
|
+
* Omitted → the dispatcher still auto-pins read (GET) verbs whose request
|
|
175
|
+
* declares `workspace_id`; everything else stays explicit. Cross-workspace
|
|
176
|
+
* targeting is additionally gated by the `cross_workspace_agent` flag.
|
|
177
|
+
*/
|
|
178
|
+
readonly workspaceScope?: "scope" | "target";
|
|
142
179
|
/** Long-running → goes through the async-operation layer. */
|
|
143
180
|
readonly async: boolean;
|
|
144
181
|
/** Tier-1 one-line decision hint (≤200 chars). */
|
|
145
182
|
readonly summary: string;
|
|
183
|
+
/**
|
|
184
|
+
* Per-field reference resolution + workspace defaulting, keyed by the request
|
|
185
|
+
* field name (snake_case wire name). The v1 route resolves each listed field
|
|
186
|
+
* (id | slug | name | path → internal id) using the caller's credential
|
|
187
|
+
* scope, in ONE place shared by every channel. Replaces the dispatcher's
|
|
188
|
+
* `TOOL_PATH_PARAMETERS`. Omit for verbs that take no references.
|
|
189
|
+
*/
|
|
190
|
+
readonly fieldResolution?: Readonly<Record<string, V1FieldResolution>>;
|
|
191
|
+
/**
|
|
192
|
+
* How this resource's playbook reaches the in-chat agent (default `reactive`).
|
|
193
|
+
* Set on EVERY command of a resource to the same value (resource-level policy);
|
|
194
|
+
* `eager` for destructive / orchestration resources. Drives the builtin
|
|
195
|
+
* `tool-steering` hook — there is no forced-round-trip gate.
|
|
196
|
+
*/
|
|
197
|
+
readonly steeringPolicy?: V1SteeringPolicy;
|
|
146
198
|
}
|
|
147
199
|
/**
|
|
148
200
|
* Resource-level playbook (tier-2b instructions) — the cross-cutting "when /
|
|
@@ -306,6 +358,14 @@ interface ExecuteOptions {
|
|
|
306
358
|
readonly maxPollAttempts?: number;
|
|
307
359
|
/** Injectable delay (tests pass a no-op); defaults to real setTimeout. */
|
|
308
360
|
readonly sleep?: (ms: number) => Promise<void>;
|
|
361
|
+
/**
|
|
362
|
+
* CLI ambient workspace (resourceId | UUID) from `idapt workspace use`.
|
|
363
|
+
* Injected as `workspace_id` ONLY on the CLI-string path ({@link execute}),
|
|
364
|
+
* only for verbs whose request declares `workspace_id`, and only when the
|
|
365
|
+
* call didn't already name a workspace. The programmatic
|
|
366
|
+
* {@link executeCommand} seam (in-chat dispatcher / MCP) never sets it.
|
|
367
|
+
*/
|
|
368
|
+
readonly defaultWorkspaceRef?: string;
|
|
309
369
|
}
|
|
310
370
|
interface ExecuteResult {
|
|
311
371
|
readonly ok: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ type ResponseKind = "single" | "list" | "created" | "deleted" | "binary";
|
|
|
37
37
|
/** Wire auth mode — drives the OpenAPI `security` requirement + whether 401 is documented. */
|
|
38
38
|
type V1AuthMode = "standard" | "optional" | "public" | "bearer-only";
|
|
39
39
|
/** HTTP error statuses the v1 surface documents. */
|
|
40
|
-
type V1ErrorStatus = 401 | 402 | 403 | 404 | 409 | 422 | 429 | 500 | 503;
|
|
40
|
+
type V1ErrorStatus = 401 | 402 | 403 | 404 | 409 | 413 | 422 | 429 | 500 | 503;
|
|
41
41
|
/**
|
|
42
42
|
* A bespoke error response. Use instead of a bare {@link V1ErrorStatus} when an
|
|
43
43
|
* op documents an error with op-specific prose / example / headers that the
|
|
@@ -114,6 +114,31 @@ interface V1CommandDocFields {
|
|
|
114
114
|
/** Marks the operation `deprecated` in the spec. */
|
|
115
115
|
readonly deprecated?: boolean;
|
|
116
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* Resource type a request field resolves against. The v1 route turns a human
|
|
119
|
+
* reference (resourceId | slug | name | workspace-relative path) into the
|
|
120
|
+
* canonical internal id before the handler runs. This is the contract-level
|
|
121
|
+
* encoding of what the dispatcher's old `TOOL_PATH_PARAMETERS` map did — moved
|
|
122
|
+
* here so resolution is one server-side step shared by chat / CLI / MCP / SDK.
|
|
123
|
+
*/
|
|
124
|
+
type V1ResolveType = "file" | "folder" | "parent-folder" | "computer" | "agent" | "script" | "workspace";
|
|
125
|
+
/** How a single request field is resolved + (optionally) context-defaulted. */
|
|
126
|
+
interface V1FieldResolution {
|
|
127
|
+
/** Resource type to resolve this field's value(s) against. */
|
|
128
|
+
readonly type: V1ResolveType;
|
|
129
|
+
/** The field carries an ARRAY of references (e.g. `reference_image_ids`). */
|
|
130
|
+
readonly array?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* When the field is omitted, default it from request context instead of
|
|
133
|
+
* erroring. `"scopedWorkspace"` fills `workspace_id` from
|
|
134
|
+
* `credential.scopedWorkspaceId` (falling back to the actor's personal
|
|
135
|
+
* workspace) — the single defaulting rule that makes `workspace_id` optional
|
|
136
|
+
* on scope verbs for every caller.
|
|
137
|
+
*/
|
|
138
|
+
readonly autoDefault?: "scopedWorkspace";
|
|
139
|
+
}
|
|
140
|
+
/** Steering-policy: how this resource's playbook reaches the in-chat agent. */
|
|
141
|
+
type V1SteeringPolicy = "eager" | "reactive" | "none";
|
|
117
142
|
interface V1CommandSpec extends V1CommandDocFields {
|
|
118
143
|
/** Resource group, e.g. "drive". */
|
|
119
144
|
readonly resource: string;
|
|
@@ -139,10 +164,37 @@ interface V1CommandSpec extends V1CommandDocFields {
|
|
|
139
164
|
readonly public: boolean;
|
|
140
165
|
/** Exposed as an agent tool (dispatcher / MCP / `idapt`). */
|
|
141
166
|
readonly agentExposed: boolean;
|
|
167
|
+
/**
|
|
168
|
+
* Workspace-scope behavior for the IN-APP agent dispatcher only (CLI / MCP
|
|
169
|
+
* always pass `workspace_id` explicitly and are unaffected):
|
|
170
|
+
* - "scope" → `workspace_id` is an operating SCOPE; the dispatcher auto-pins
|
|
171
|
+
* it to the chat's current workspace when the model omits it.
|
|
172
|
+
* - "target" → `workspace_id` is a DESTINATION (move / copy / link); never
|
|
173
|
+
* auto-filled — the model must name it explicitly.
|
|
174
|
+
* Omitted → the dispatcher still auto-pins read (GET) verbs whose request
|
|
175
|
+
* declares `workspace_id`; everything else stays explicit. Cross-workspace
|
|
176
|
+
* targeting is additionally gated by the `cross_workspace_agent` flag.
|
|
177
|
+
*/
|
|
178
|
+
readonly workspaceScope?: "scope" | "target";
|
|
142
179
|
/** Long-running → goes through the async-operation layer. */
|
|
143
180
|
readonly async: boolean;
|
|
144
181
|
/** Tier-1 one-line decision hint (≤200 chars). */
|
|
145
182
|
readonly summary: string;
|
|
183
|
+
/**
|
|
184
|
+
* Per-field reference resolution + workspace defaulting, keyed by the request
|
|
185
|
+
* field name (snake_case wire name). The v1 route resolves each listed field
|
|
186
|
+
* (id | slug | name | path → internal id) using the caller's credential
|
|
187
|
+
* scope, in ONE place shared by every channel. Replaces the dispatcher's
|
|
188
|
+
* `TOOL_PATH_PARAMETERS`. Omit for verbs that take no references.
|
|
189
|
+
*/
|
|
190
|
+
readonly fieldResolution?: Readonly<Record<string, V1FieldResolution>>;
|
|
191
|
+
/**
|
|
192
|
+
* How this resource's playbook reaches the in-chat agent (default `reactive`).
|
|
193
|
+
* Set on EVERY command of a resource to the same value (resource-level policy);
|
|
194
|
+
* `eager` for destructive / orchestration resources. Drives the builtin
|
|
195
|
+
* `tool-steering` hook — there is no forced-round-trip gate.
|
|
196
|
+
*/
|
|
197
|
+
readonly steeringPolicy?: V1SteeringPolicy;
|
|
146
198
|
}
|
|
147
199
|
/**
|
|
148
200
|
* Resource-level playbook (tier-2b instructions) — the cross-cutting "when /
|
|
@@ -306,6 +358,14 @@ interface ExecuteOptions {
|
|
|
306
358
|
readonly maxPollAttempts?: number;
|
|
307
359
|
/** Injectable delay (tests pass a no-op); defaults to real setTimeout. */
|
|
308
360
|
readonly sleep?: (ms: number) => Promise<void>;
|
|
361
|
+
/**
|
|
362
|
+
* CLI ambient workspace (resourceId | UUID) from `idapt workspace use`.
|
|
363
|
+
* Injected as `workspace_id` ONLY on the CLI-string path ({@link execute}),
|
|
364
|
+
* only for verbs whose request declares `workspace_id`, and only when the
|
|
365
|
+
* call didn't already name a workspace. The programmatic
|
|
366
|
+
* {@link executeCommand} seam (in-chat dispatcher / MCP) never sets it.
|
|
367
|
+
*/
|
|
368
|
+
readonly defaultWorkspaceRef?: string;
|
|
309
369
|
}
|
|
310
370
|
interface ExecuteResult {
|
|
311
371
|
readonly ok: boolean;
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { VERB_OVERRIDES, autoMode, commandsForResource, createFetchTransport, execute, executeCommand, findCommand, getResourcePlaybook, listCommands, listResources, mapArgsToV1, parseInvocation, reconcileToV1, render, renderHelp, renderInstructions, resolveCommand, toSnakeKey } from './chunk-
|
|
1
|
+
export { VERB_OVERRIDES, autoMode, commandsForResource, createFetchTransport, execute, executeCommand, findCommand, getResourcePlaybook, listCommands, listResources, mapArgsToV1, parseInvocation, reconcileToV1, render, renderHelp, renderInstructions, resolveCommand, toSnakeKey } from './chunk-GISKSK4V.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@idapt/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.0",
|
|
4
4
|
"description": "The idapt CLI — the `idapt <resource> <verb>` grammar, command→REST translation, help/instructions, output formatting, SOTA auth (OAuth 2.1 + PKCE / device-code / API-key) and self-update, over the public v1 API. One implementation shared by the in-chat dispatcher, MCP, and the `idapt` CLI binary.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://idapt.app/cli",
|