@idapt/cli 1.10.0 → 1.11.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/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 /
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 /
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-CX7FTE47.js';
1
+ export { VERB_OVERRIDES, autoMode, commandsForResource, createFetchTransport, execute, executeCommand, findCommand, getResourcePlaybook, listCommands, listResources, mapArgsToV1, parseInvocation, reconcileToV1, render, renderHelp, renderInstructions, resolveCommand, toSnakeKey } from './chunk-3CWHRMLZ.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.10.0",
3
+ "version": "1.11.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",