@idapt/cli 1.13.0 → 2.1.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
@@ -7,11 +7,13 @@ import { HttpContext } from '@idapt/sdk';
7
7
  * Each endpoint is described once as a {@link V1CommandSpec}: its zod request +
8
8
  * response schemas (snake_case, matching the wire), its HTTP binding, the
9
9
  * `idapt <resource> <verb>` grammar it maps to, and the surface flags that
10
- * decide whether it appears in the public OpenAPI spec and/or as an agent tool.
10
+ * decide whether it appears in the public OpenAPI spec, as an agent/CLI tool,
11
+ * and in the generated SDK dynamic `client.call()` bindings.
11
12
  *
12
13
  * Consumers (all derive from these specs — nothing is hand-maintained twice):
13
14
  * - v1 route handlers → import the request/response schemas for validation
14
- * - `@idapt/sdk` → derives wire TYPES via `z.infer` (type-only import)
15
+ * - `@idapt/sdk` → derives wire TYPES via `z.infer` and generated
16
+ * bindings from the `sdkExposed` specs
15
17
  * - `shared/api/v1/openapi` → GENERATED from the `public` specs
16
18
  * - `@idapt/cli` → builds its command catalog (grammar + HTTP binding
17
19
  * + docs) from the `agentExposed` specs
@@ -59,6 +61,27 @@ interface V1ErrorOverride {
59
61
  }>>;
60
62
  }
61
63
  type V1OpError = V1ErrorStatus | V1ErrorOverride;
64
+ /**
65
+ * Public API date-version documentation override.
66
+ *
67
+ * Runtime compatibility still lives explicitly in the route/action boundary.
68
+ * These branches let generated artifacts describe old supported wire contracts
69
+ * without duplicating the route tree or the whole command registry. The OpenAPI
70
+ * generator applies the first branch whose `before` date is after the selected
71
+ * API version, so keep branches ordered from oldest cutoff to newest cutoff.
72
+ */
73
+ interface V1VersionBranch {
74
+ /** Use this override for public API versions before this YYYY-MM-DD date. */
75
+ readonly before: string;
76
+ readonly request?: z.ZodTypeAny;
77
+ readonly response?: z.ZodTypeAny | null;
78
+ readonly responseKind?: ResponseKind;
79
+ readonly summary?: string;
80
+ readonly description?: string;
81
+ readonly requestExample?: unknown;
82
+ readonly responseExample?: unknown;
83
+ readonly deprecated?: boolean;
84
+ }
62
85
  /**
63
86
  * Optional documentation + binding metadata carried by every command. These
64
87
  * feed the GENERATED OpenAPI spec (`scripts/generate-openapi.ts`); none affect
@@ -113,6 +136,8 @@ interface V1CommandDocFields {
113
136
  readonly idempotent?: boolean;
114
137
  /** Marks the operation `deprecated` in the spec. */
115
138
  readonly deprecated?: boolean;
139
+ /** Version-specific contract docs for older supported public API dates. */
140
+ readonly versionBranches?: readonly V1VersionBranch[];
116
141
  }
117
142
  /**
118
143
  * Resource type a request field resolves against. The v1 route turns a human
@@ -164,6 +189,13 @@ interface V1CommandSpec extends V1CommandDocFields {
164
189
  readonly public: boolean;
165
190
  /** Exposed as an agent tool (dispatcher / MCP / `idapt`). */
166
191
  readonly agentExposed: boolean;
192
+ /**
193
+ * Exposed through the generated `@idapt/sdk` dynamic command bindings and
194
+ * `client.call()` autocomplete. Omitted means exposed. Set `false` for
195
+ * pre-GA/default-off commands that may exist in the registry for routes/tests
196
+ * but must not appear in the published SDK surface yet.
197
+ */
198
+ readonly sdkExposed?: boolean;
167
199
  /**
168
200
  * Workspace-scope behavior for the IN-APP agent dispatcher only (CLI / MCP
169
201
  * always pass `workspace_id` explicitly and are unaffected):
@@ -385,6 +417,21 @@ interface ExecuteOptions {
385
417
  * {@link executeCommand} seam (in-chat dispatcher / MCP) never sets it.
386
418
  */
387
419
  readonly defaultWorkspaceRef?: string;
420
+ /**
421
+ * CLI ambient acting AGENT (resourceId | name) from `idapt agent use` or a
422
+ * per-call `--agent`. Injected as `agent_id` on `chat create` ONLY (that verb
423
+ * binds the acting agent; blanket `agent_id` injection would mis-scope
424
+ * `chat send`'s `sender_agent_id`, agent-CRUD filters, etc.), and only on the
425
+ * CLI-string path. An explicit `--agent-id`/positional still wins.
426
+ */
427
+ readonly defaultAgentRef?: string;
428
+ /**
429
+ * The selected agent's Memory box resourceId (from `idapt agent use`). Injected
430
+ * as the `:id` of `memory` verbs that address a box, when the call didn't name
431
+ * one — the client-side twin of the in-run dispatcher's box auto-injection, so
432
+ * `idapt memory …` reads/writes the selected agent's Memory.
433
+ */
434
+ readonly defaultAgentMemoryBoxId?: string;
388
435
  }
389
436
  interface ExecuteResult {
390
437
  readonly ok: boolean;
package/dist/index.d.ts CHANGED
@@ -7,11 +7,13 @@ import { HttpContext } from '@idapt/sdk';
7
7
  * Each endpoint is described once as a {@link V1CommandSpec}: its zod request +
8
8
  * response schemas (snake_case, matching the wire), its HTTP binding, the
9
9
  * `idapt <resource> <verb>` grammar it maps to, and the surface flags that
10
- * decide whether it appears in the public OpenAPI spec and/or as an agent tool.
10
+ * decide whether it appears in the public OpenAPI spec, as an agent/CLI tool,
11
+ * and in the generated SDK dynamic `client.call()` bindings.
11
12
  *
12
13
  * Consumers (all derive from these specs — nothing is hand-maintained twice):
13
14
  * - v1 route handlers → import the request/response schemas for validation
14
- * - `@idapt/sdk` → derives wire TYPES via `z.infer` (type-only import)
15
+ * - `@idapt/sdk` → derives wire TYPES via `z.infer` and generated
16
+ * bindings from the `sdkExposed` specs
15
17
  * - `shared/api/v1/openapi` → GENERATED from the `public` specs
16
18
  * - `@idapt/cli` → builds its command catalog (grammar + HTTP binding
17
19
  * + docs) from the `agentExposed` specs
@@ -59,6 +61,27 @@ interface V1ErrorOverride {
59
61
  }>>;
60
62
  }
61
63
  type V1OpError = V1ErrorStatus | V1ErrorOverride;
64
+ /**
65
+ * Public API date-version documentation override.
66
+ *
67
+ * Runtime compatibility still lives explicitly in the route/action boundary.
68
+ * These branches let generated artifacts describe old supported wire contracts
69
+ * without duplicating the route tree or the whole command registry. The OpenAPI
70
+ * generator applies the first branch whose `before` date is after the selected
71
+ * API version, so keep branches ordered from oldest cutoff to newest cutoff.
72
+ */
73
+ interface V1VersionBranch {
74
+ /** Use this override for public API versions before this YYYY-MM-DD date. */
75
+ readonly before: string;
76
+ readonly request?: z.ZodTypeAny;
77
+ readonly response?: z.ZodTypeAny | null;
78
+ readonly responseKind?: ResponseKind;
79
+ readonly summary?: string;
80
+ readonly description?: string;
81
+ readonly requestExample?: unknown;
82
+ readonly responseExample?: unknown;
83
+ readonly deprecated?: boolean;
84
+ }
62
85
  /**
63
86
  * Optional documentation + binding metadata carried by every command. These
64
87
  * feed the GENERATED OpenAPI spec (`scripts/generate-openapi.ts`); none affect
@@ -113,6 +136,8 @@ interface V1CommandDocFields {
113
136
  readonly idempotent?: boolean;
114
137
  /** Marks the operation `deprecated` in the spec. */
115
138
  readonly deprecated?: boolean;
139
+ /** Version-specific contract docs for older supported public API dates. */
140
+ readonly versionBranches?: readonly V1VersionBranch[];
116
141
  }
117
142
  /**
118
143
  * Resource type a request field resolves against. The v1 route turns a human
@@ -164,6 +189,13 @@ interface V1CommandSpec extends V1CommandDocFields {
164
189
  readonly public: boolean;
165
190
  /** Exposed as an agent tool (dispatcher / MCP / `idapt`). */
166
191
  readonly agentExposed: boolean;
192
+ /**
193
+ * Exposed through the generated `@idapt/sdk` dynamic command bindings and
194
+ * `client.call()` autocomplete. Omitted means exposed. Set `false` for
195
+ * pre-GA/default-off commands that may exist in the registry for routes/tests
196
+ * but must not appear in the published SDK surface yet.
197
+ */
198
+ readonly sdkExposed?: boolean;
167
199
  /**
168
200
  * Workspace-scope behavior for the IN-APP agent dispatcher only (CLI / MCP
169
201
  * always pass `workspace_id` explicitly and are unaffected):
@@ -385,6 +417,21 @@ interface ExecuteOptions {
385
417
  * {@link executeCommand} seam (in-chat dispatcher / MCP) never sets it.
386
418
  */
387
419
  readonly defaultWorkspaceRef?: string;
420
+ /**
421
+ * CLI ambient acting AGENT (resourceId | name) from `idapt agent use` or a
422
+ * per-call `--agent`. Injected as `agent_id` on `chat create` ONLY (that verb
423
+ * binds the acting agent; blanket `agent_id` injection would mis-scope
424
+ * `chat send`'s `sender_agent_id`, agent-CRUD filters, etc.), and only on the
425
+ * CLI-string path. An explicit `--agent-id`/positional still wins.
426
+ */
427
+ readonly defaultAgentRef?: string;
428
+ /**
429
+ * The selected agent's Memory box resourceId (from `idapt agent use`). Injected
430
+ * as the `:id` of `memory` verbs that address a box, when the call didn't name
431
+ * one — the client-side twin of the in-run dispatcher's box auto-injection, so
432
+ * `idapt memory …` reads/writes the selected agent's Memory.
433
+ */
434
+ readonly defaultAgentMemoryBoxId?: string;
388
435
  }
389
436
  interface ExecuteResult {
390
437
  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-CZEBGFAQ.js';
1
+ export { VERB_OVERRIDES, autoMode, commandsForResource, createFetchTransport, execute, executeCommand, findCommand, getResourcePlaybook, listCommands, listResources, mapArgsToV1, parseInvocation, reconcileToV1, render, renderHelp, renderInstructions, resolveCommand, toSnakeKey } from './chunk-AR3DW2SX.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.13.0",
3
+ "version": "2.1.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",