@comma-agents/core 2.0.0-rc.0 → 2.0.0-rc.1

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.
Files changed (75) hide show
  1. package/dist/agents/agent/agent.types.d.ts +2 -2
  2. package/dist/agents/loader/index.d.ts +2 -2
  3. package/dist/agents/loader/loader.d.ts +3 -5
  4. package/dist/agents/loader/loader.schema.d.ts +226 -13
  5. package/dist/agents/loader/loader.types.d.ts +9 -8
  6. package/dist/agents/registry/agent-registry.constants.d.ts +1 -0
  7. package/dist/agents/registry/agent-registry.d.ts +38 -0
  8. package/dist/agents/registry/agent-registry.types.d.ts +58 -0
  9. package/dist/agents/registry/index.d.ts +2 -0
  10. package/dist/credentials/backends/json-file.d.ts +1 -1
  11. package/dist/credentials/credentials.constants.d.ts +2 -0
  12. package/dist/credentials/credentials.utils.d.ts +0 -19
  13. package/dist/credentials/index.d.ts +1 -1
  14. package/dist/data-directory/data-directory.d.ts +11 -0
  15. package/dist/data-directory/index.d.ts +1 -0
  16. package/dist/defaults/defaults.d.ts +1 -1
  17. package/dist/flows/index.d.ts +2 -0
  18. package/dist/flows/loader/loader.schema.d.ts +2 -195
  19. package/dist/flows/loader/loader.utils.d.ts +5 -0
  20. package/dist/flows/registry/flow-registry.constants.d.ts +1 -0
  21. package/dist/flows/registry/flow-registry.d.ts +45 -0
  22. package/dist/flows/registry/flow-registry.types.d.ts +31 -0
  23. package/dist/flows/registry/index.d.ts +2 -0
  24. package/dist/hub/archive/archive.d.ts +2 -0
  25. package/dist/hub/archive/index.d.ts +1 -0
  26. package/dist/hub/comma-project.schema.json +171 -0
  27. package/dist/hub/hub.constants.d.ts +5 -0
  28. package/dist/hub/hub.d.ts +13 -0
  29. package/dist/hub/hub.schema.d.ts +1093 -0
  30. package/dist/hub/hub.types.d.ts +50 -0
  31. package/dist/hub/hub.utils.d.ts +3 -0
  32. package/dist/hub/index.d.ts +3 -0
  33. package/dist/hub/index.js +404 -0
  34. package/dist/hub/installed-packages/index.d.ts +2 -0
  35. package/dist/hub/installed-packages/installed-packages.d.ts +3 -0
  36. package/dist/hub/installed-packages/installed-packages.types.d.ts +14 -0
  37. package/dist/hub/package-installer/index.d.ts +2 -0
  38. package/dist/hub/package-installer/package-installer.d.ts +3 -0
  39. package/dist/hub/package-installer/package-installer.types.d.ts +11 -0
  40. package/dist/hub/registry-client/index.d.ts +2 -0
  41. package/dist/hub/registry-client/registry-client.d.ts +3 -0
  42. package/dist/hub/registry-client/registry-client.types.d.ts +10 -0
  43. package/dist/index.d.ts +13 -10
  44. package/dist/index.js +1386 -769
  45. package/dist/model/providers/catalog/catalog.utils.d.ts +2 -9
  46. package/dist/skills/skills.constants.d.ts +2 -2
  47. package/dist/skills/skills.types.d.ts +1 -1
  48. package/dist/skills/skills.utils.d.ts +0 -10
  49. package/dist/strategies/@comma/core-strategies/README.md +9 -0
  50. package/dist/strategies/@comma/core-strategies/build/build.json +69 -0
  51. package/dist/strategies/@comma/core-strategies/build/prompts/coder.md +56 -0
  52. package/dist/strategies/@comma/core-strategies/build/prompts/tester.md +39 -0
  53. package/dist/strategies/@comma/core-strategies/comma-project.json +49 -0
  54. package/dist/strategies/@comma/core-strategies/plan/plan.json +66 -0
  55. package/dist/strategies/@comma/core-strategies/plan/prompts/planner.md +59 -0
  56. package/dist/strategies/@comma/core-strategies/plan/prompts/reviewer.md +34 -0
  57. package/dist/strategies/@comma/core-strategies/qa.json +36 -0
  58. package/dist/strategies/@comma/core-strategies/reduce-complexity/reduce-complexity.jsonc +24 -0
  59. package/dist/strategies/@comma/core-strategies/standardize/manager.jsonc +54 -0
  60. package/dist/strategies/@comma/core-strategies/standardize/prompts/manager.md +278 -0
  61. package/dist/strategies/@comma/core-strategies/standardize/prompts/worker-auditor.md +131 -0
  62. package/dist/strategies/@comma/core-strategies/standardize/prompts/worker-reviewer.md +58 -0
  63. package/dist/strategies/@comma/core-strategies/standardize/worker.jsonc +69 -0
  64. package/dist/strategies/@comma/core-strategies/talk.json +42 -0
  65. package/dist/strategy/discover/discover.d.ts +10 -2
  66. package/dist/strategy/discover/discover.types.d.ts +6 -5
  67. package/dist/strategy/discover/discover.utils.d.ts +2 -13
  68. package/dist/strategy/discover/index.d.ts +1 -1
  69. package/dist/strategy/index.d.ts +3 -3
  70. package/dist/strategy/loader/loader.types.d.ts +2 -70
  71. package/dist/strategy/loader/loader.utils.d.ts +1 -8
  72. package/dist/strategy/loader/project-loader.d.ts +7 -1
  73. package/dist/strategy/schema.d.ts +154 -60
  74. package/dist/tools/built-in/list-strategy/list-strategy.d.ts +2 -2
  75. package/package.json +18 -7
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * Where a discovered strategy was found.
3
3
  *
4
- * - `bundled` — shipped with `@comma-agents/core` under `packages/core/strategies/`.
5
4
  * - `cwd` — single strategy file under `<cwd>/.comma/strategies/`.
6
5
  * - `cwd-project` — strategy referenced by a `comma-project.json`
7
6
  * inside `<cwd>/.comma/strategies/<project>/`.
@@ -9,8 +8,10 @@
9
8
  * - `data` — single strategy file under `<dataDir>/strategies/`.
10
9
  * - `data-project` — strategy referenced by a `comma-project.json`
11
10
  * inside `<dataDir>/strategies/<project>/`.
11
+ * - `hub-package` — exposed strategy from an installed Hub package.
12
+ * - `bundled` — exposed strategy from the official strategies bundled with Core.
12
13
  */
13
- export type DiscoveredStrategyOrigin = "bundled" | "bundled-project" | "cwd" | "cwd-project" | "cwd-root-project" | "data" | "data-project";
14
+ export type DiscoveredStrategyOrigin = "cwd" | "cwd-project" | "cwd-root-project" | "data" | "data-project" | "hub-package" | "bundled";
14
15
  /** A successfully discovered and schema-validated strategy. */
15
16
  export interface DiscoveredStrategy {
16
17
  /** Strategy `name` field from the file. */
@@ -52,8 +53,8 @@ export interface DiscoverStrategiesOptions {
52
53
  */
53
54
  readonly dataDir?: string;
54
55
  /**
55
- * Whether to include the strategies bundled with `@comma-agents/core`
56
- * (under `packages/core/strategies/`). Defaults to `true`.
56
+ * Include the official strategies bundled with Core.
57
+ * Defaults to `true`.
57
58
  */
58
59
  readonly includeBundled?: boolean;
59
60
  }
@@ -61,7 +62,7 @@ export interface DiscoverStrategiesOptions {
61
62
  export interface DiscoverStrategiesResult {
62
63
  /**
63
64
  * Schema-validated strategies, in source-priority order:
64
- * bundled → cwd → cwd-project → cwd-root-project → data → data-project.
65
+ * cwd → cwd-project → cwd-root-project → data → data-project → hub-package → bundled.
65
66
  * Duplicates (by absolute path) are removed.
66
67
  */
67
68
  readonly strategies: readonly DiscoveredStrategy[];
@@ -67,6 +67,8 @@ export declare function listStrategyFiles(dir: string): string[];
67
67
  * subdirectory of `dir` that contains one.
68
68
  */
69
69
  export declare function listProjectManifests(dir: string): string[];
70
+ /** List installed Hub manifests under `<dataDir>/packages/@scope/project`. */
71
+ export declare function listInstalledProjectManifests(dataDir: string): string[];
70
72
  /**
71
73
  * Build a {@link DiscoveredStrategy} from a parsed strategy header.
72
74
  * Project-scoped entries get a `"<project> > <name>"` label.
@@ -80,16 +82,3 @@ export declare function buildDiscoveredStrategy(input: {
80
82
  readonly projectName?: string;
81
83
  readonly manifestPath?: string;
82
84
  }): DiscoveredStrategy;
83
- /**
84
- * Locate the root directory of the `@comma-agents/core` package.
85
- *
86
- * Walks up from this source file looking for a `package.json` whose
87
- * `name === "@comma-agents/core"`. This works in both workspace
88
- * development (where the source lives under `packages/core/src/`) and
89
- * when the package is consumed from `node_modules`.
90
- *
91
- * Returns `null` if the package root cannot be located (e.g., when the
92
- * file has been bundled into a single artifact without a package
93
- * manifest nearby).
94
- */
95
- export declare function findCorePackageRoot(): string | null;
@@ -1,3 +1,3 @@
1
- export { discoverStrategies } from "./discover";
1
+ export { discoverStrategies, resolveInstalledStrategyReference, } from "./discover";
2
2
  export type { DiscoveredStrategy, DiscoveredStrategyOrigin, DiscoverStrategiesOptions, DiscoverStrategiesResult, DiscoveryWarning, } from "./discover.types";
3
3
  export { readStrategyFile } from "./discover.utils";
@@ -1,10 +1,10 @@
1
1
  export type { DiscoveredStrategy, DiscoveredStrategyOrigin, DiscoverStrategiesOptions, DiscoverStrategiesResult, DiscoveryWarning, } from "./discover/index";
2
- export { discoverStrategies, readStrategyFile } from "./discover/index";
2
+ export { discoverStrategies, readStrategyFile, resolveInstalledStrategyReference, } from "./discover/index";
3
3
  export { exportStrategy } from "./exporter/exporter";
4
4
  export type { ExportStrategyOptions } from "./exporter/exporter.types";
5
5
  export { loadStrategy, loadStrategyFromString } from "./loader/loader";
6
6
  export type { LoadedStrategy, LoadStrategyOptions, } from "./loader/loader.types";
7
7
  export type { LoadedProject } from "./loader/project-loader";
8
8
  export { loadProject } from "./loader/project-loader";
9
- export type { AgentDef, AgentStep, BroadcastFlowDef, BuiltInToolName, CommaProjectManifest, CycleFlowDef, FlowDef, LLMAgentDef, SequentialFlowDef, Strategy, UserAgentDef, } from "./schema";
10
- export { CommaProjectManifestSchema, isAgentStep, isFlowDef, isLLMAgentDef, isUserAgentDef, StrategySchema, } from "./schema";
9
+ export type { AgentDef, AgentStep, BroadcastFlowDef, BuiltInToolName, CustomAgentDef, CustomFlowDef, CycleFlowDef, FlowDef, LLMAgentDef, SequentialFlowDef, Strategy, UserAgentDef, } from "./schema";
10
+ export { CustomAgentDefSchema, CustomFlowDefSchema, isAgentStep, isCustomAgentDef, isFlowDef, isLLMAgentDef, isUserAgentDef, StrategySchema, } from "./schema";
@@ -1,9 +1,6 @@
1
1
  import type { Agent } from "../../agents/agent/agent.types";
2
- import type { InputCollector } from "../../agents/built-in/user/user-agent.types";
2
+ import type { AgentTypeRuntime } from "../../agents/registry/agent-registry.types";
3
3
  import type { FlowHooks } from "../../flows/flow/flow.types";
4
- import type { LanguageService } from "../../language";
5
- import type { SkillRegistry } from "../../skills/skills.types";
6
- import type { LaunchStrategyHandle } from "../../tools/launch-strategy.types";
7
4
  import type { Strategy } from "../schema";
8
5
  /**
9
6
  * Options for loading a strategy.
@@ -13,78 +10,13 @@ import type { Strategy } from "../schema";
13
10
  * not accept provider factories or credential stores — callers must
14
11
  * configure those globally before loading a strategy.
15
12
  */
16
- export interface LoadStrategyOptions {
17
- /**
18
- * Input collector function for user agents.
19
- * Required if the strategy contains any user agents with `requireInput: true`.
20
- */
21
- readonly inputCollector?: InputCollector;
13
+ export interface LoadStrategyOptions extends AgentTypeRuntime {
22
14
  /**
23
15
  * Flow hooks to inject into all flows via `hookIntoFlow()` after
24
16
  * construction. Useful for the daemon to observe step execution,
25
17
  * flow lifecycle, etc.
26
18
  */
27
19
  readonly flowHooks?: FlowHooks;
28
- /**
29
- * Override the model for ALL LLM agents in the strategy.
30
- *
31
- * When set, every agent's model string is replaced with this value,
32
- * regardless of what the strategy file specifies. Format: "providerID/modelID".
33
- *
34
- * Useful for the daemon's `--model-override` flag, allowing a single
35
- * daemon instance to serve any provider/model combination without
36
- * editing strategy files.
37
- *
38
- * @example "github-copilot/gpt-4o"
39
- */
40
- readonly modelOverride?: string;
41
- /**
42
- * Skill registry to make available to every LLM agent in this strategy.
43
- *
44
- * When provided, every agent that lists `load_skill` in its `tools`
45
- * array can resolve skill names against this registry. The loader also
46
- * prepends a compact `## Available Skills` block to each agent's
47
- * `systemPrompt` so the model knows what to ask for. Build the
48
- * registry with `loadSkills(workspaceRoot)`.
49
- */
50
- readonly skillRegistry?: SkillRegistry;
51
- /**
52
- * Optional base directory of the strategy file, used to resolve relative paths
53
- * (such as system prompt file paths).
54
- */
55
- readonly strategyDir?: string;
56
- /**
57
- * Optional handle for spawning sub-strategies, threaded into every
58
- * agent's {@link ToolContext} so tools such as `launch_strategy` can
59
- * delegate to a runtime-supplied implementation (e.g., the daemon
60
- * executor, which wires the nested run's flow/agent hooks to the
61
- * parent run's broadcast pipeline).
62
- *
63
- * When omitted, `launch_strategy` falls back to an in-process
64
- * `loadStrategy` + `flow.call()` invocation with no broadcast.
65
- */
66
- readonly launchStrategy?: LaunchStrategyHandle;
67
- /** Optional runtime language service threaded into every agent tool call. */
68
- readonly languageService?: LanguageService;
69
- /**
70
- * Optional run identifier propagated to every agent's
71
- * {@link AgentConfig.runId} (and from there into each tool's
72
- * {@link ToolContext.runId}).
73
- *
74
- * Distinct from `sessionId` (which scopes the audit log and trash
75
- * metadata across an entire user/daemon session): `runId` identifies
76
- * a single strategy invocation. The daemon executor passes the
77
- * top-level run id here, and gives each `launch_strategy` sub-load
78
- * a *fresh* derived id, so recursive strategy invocations have
79
- * isolated state for tools that key on `runId` (notably `todo_*`,
80
- * which shares state across agents within one invocation but must not
81
- * leak into recursive sub-runs).
82
- *
83
- * When omitted, runId-aware tools fall back to `agentName`-only
84
- * keying (their original behaviour) — safe for tests and embedded
85
- * callers that don't care about cross-launch isolation.
86
- */
87
- readonly runId?: string;
88
20
  }
89
21
  /**
90
22
  * The result of loading a strategy — contains the runnable flow
@@ -1,6 +1,6 @@
1
1
  import type { Agent } from "../../agents/agent/agent.types";
2
2
  import type { SkillRegistry } from "../../skills/skills.types";
3
- import type { FlowDef, Strategy } from "../schema";
3
+ import type { Strategy } from "../schema";
4
4
  import type { LoadStrategyOptions } from "./loader.types";
5
5
  /**
6
6
  * Build all agents defined in the strategy into live Agent instances.
@@ -11,10 +11,3 @@ import type { LoadStrategyOptions } from "./loader.types";
11
11
  export declare function buildAgentRegistry(strategy: Strategy, options: LoadStrategyOptions): Promise<Record<string, Agent>>;
12
12
  /** @internal Used by tests to assert the header gets attached. */
13
13
  export declare function previewSkillsHeader(registry: SkillRegistry): string;
14
- /**
15
- * Recursively build a flow definition into a runnable Agent.
16
- *
17
- * If `options.flowHooks` is provided, hooks are injected into the
18
- * created flow via `hookIntoFlow()` after construction.
19
- */
20
- export declare function buildFlow(flowDef: FlowDef, agents: Readonly<Record<string, Agent>>, options: LoadStrategyOptions): Agent;
@@ -1,9 +1,15 @@
1
- import type { CommaProjectManifest } from "../schema";
1
+ import { type CommaProjectManifest } from "../../hub";
2
+ /** A validated project manifest and its location on disk. */
2
3
  export interface LoadedProject {
4
+ /** Project name displayed with its discovered strategies. */
3
5
  readonly name: string;
6
+ /** Optional project version from the manifest. */
4
7
  readonly version?: string;
8
+ /** Optional project description from the manifest. */
5
9
  readonly description?: string;
10
+ /** Validated project manifest. */
6
11
  readonly manifest: CommaProjectManifest;
12
+ /** Absolute directory containing the manifest. */
7
13
  readonly manifestDir: string;
8
14
  }
9
15
  export declare function loadProject(manifestPath: string): Promise<LoadedProject>;
@@ -53,16 +53,15 @@ export declare const LLMAgentDefSchema: z.ZodObject<{
53
53
  */
54
54
  skills: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
55
55
  /**
56
- * Per-call provider options forwarded verbatim to the AI SDK. Used to
57
- * enable provider-specific features such as Anthropic extended thinking
58
- * or OpenAI reasoning effort. Shape:
56
+ * Per-call options for provider-specific features such as extended
57
+ * thinking or reasoning effort. Shape:
59
58
  * `{ <providerId>: { <option>: <value>, ... }, ... }`.
60
59
  */
61
60
  providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
62
61
  /**
63
- * Model-level generation parameters (temperature, maxOutputTokens, topP, seed,
64
- * etc.). Forwarded to `streamText` as top-level options. Provider-specific
65
- * features should use `providerOptions` instead.
62
+ * Provider-independent generation parameters such as temperature,
63
+ * maxOutputTokens, topP, and seed. Provider-specific features belong in
64
+ * `providerOptions` instead.
66
65
  */
67
66
  modelOptions: z.ZodOptional<z.ZodObject<{
68
67
  temperature: z.ZodOptional<z.ZodNumber>;
@@ -138,13 +137,13 @@ export declare const LLMAgentDefSchema: z.ZodObject<{
138
137
  }, "strict", z.ZodTypeAny, {
139
138
  type?: "llm" | undefined;
140
139
  description?: string | undefined;
140
+ tools?: string[] | undefined;
141
141
  model?: string | undefined;
142
142
  systemPrompt?: string | undefined;
143
143
  systemPromptTemplate?: {
144
144
  template: string;
145
145
  variables?: Record<string, string | number | boolean | string[] | Record<string, string>> | undefined;
146
146
  } | undefined;
147
- tools?: string[] | undefined;
148
147
  providerOptions?: Record<string, Record<string, unknown>> | undefined;
149
148
  modelOptions?: {
150
149
  temperature?: number | undefined;
@@ -171,13 +170,13 @@ export declare const LLMAgentDefSchema: z.ZodObject<{
171
170
  }, {
172
171
  type?: "llm" | undefined;
173
172
  description?: string | undefined;
173
+ tools?: string[] | undefined;
174
174
  model?: string | undefined;
175
175
  systemPrompt?: string | undefined;
176
176
  systemPromptTemplate?: {
177
177
  template: string;
178
178
  variables?: Record<string, string | number | boolean | string[] | Record<string, string>> | undefined;
179
179
  } | undefined;
180
- tools?: string[] | undefined;
181
180
  providerOptions?: Record<string, Record<string, unknown>> | undefined;
182
181
  modelOptions?: {
183
182
  temperature?: number | undefined;
@@ -202,11 +201,24 @@ export declare const LLMAgentDefSchema: z.ZodObject<{
202
201
  maxSteps?: number | undefined;
203
202
  skills?: string[] | undefined;
204
203
  }>;
205
- /**
206
- * An agent definition is either a user agent or an LLM agent.
207
- * Discriminated by the `type` field (user agents must have `type: "user"`,
208
- * LLM agents may omit `type` or set `type: "llm"`).
209
- */
204
+ /** A custom registered agent with implementation-specific configuration. */
205
+ export declare const CustomAgentDefSchema: z.ZodObject<{
206
+ /** Name registered with `registerAgent`. */
207
+ type: z.ZodEffects<z.ZodString, string, string>;
208
+ /** Optional human-readable description. */
209
+ description: z.ZodOptional<z.ZodString>;
210
+ /** Configuration validated by the registered agent type. */
211
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
212
+ }, "strict", z.ZodTypeAny, {
213
+ type: string;
214
+ description?: string | undefined;
215
+ config?: Record<string, unknown> | undefined;
216
+ }, {
217
+ type: string;
218
+ description?: string | undefined;
219
+ config?: Record<string, unknown> | undefined;
220
+ }>;
221
+ /** A built-in user, built-in LLM, or registered custom agent definition. */
210
222
  export declare const AgentDefSchema: z.ZodUnion<[z.ZodObject<{
211
223
  type: z.ZodLiteral<"user">;
212
224
  description: z.ZodOptional<z.ZodString>;
@@ -256,16 +268,15 @@ export declare const AgentDefSchema: z.ZodUnion<[z.ZodObject<{
256
268
  */
257
269
  skills: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
258
270
  /**
259
- * Per-call provider options forwarded verbatim to the AI SDK. Used to
260
- * enable provider-specific features such as Anthropic extended thinking
261
- * or OpenAI reasoning effort. Shape:
271
+ * Per-call options for provider-specific features such as extended
272
+ * thinking or reasoning effort. Shape:
262
273
  * `{ <providerId>: { <option>: <value>, ... }, ... }`.
263
274
  */
264
275
  providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
265
276
  /**
266
- * Model-level generation parameters (temperature, maxOutputTokens, topP, seed,
267
- * etc.). Forwarded to `streamText` as top-level options. Provider-specific
268
- * features should use `providerOptions` instead.
277
+ * Provider-independent generation parameters such as temperature,
278
+ * maxOutputTokens, topP, and seed. Provider-specific features belong in
279
+ * `providerOptions` instead.
269
280
  */
270
281
  modelOptions: z.ZodOptional<z.ZodObject<{
271
282
  temperature: z.ZodOptional<z.ZodNumber>;
@@ -341,13 +352,13 @@ export declare const AgentDefSchema: z.ZodUnion<[z.ZodObject<{
341
352
  }, "strict", z.ZodTypeAny, {
342
353
  type?: "llm" | undefined;
343
354
  description?: string | undefined;
355
+ tools?: string[] | undefined;
344
356
  model?: string | undefined;
345
357
  systemPrompt?: string | undefined;
346
358
  systemPromptTemplate?: {
347
359
  template: string;
348
360
  variables?: Record<string, string | number | boolean | string[] | Record<string, string>> | undefined;
349
361
  } | undefined;
350
- tools?: string[] | undefined;
351
362
  providerOptions?: Record<string, Record<string, unknown>> | undefined;
352
363
  modelOptions?: {
353
364
  temperature?: number | undefined;
@@ -374,13 +385,13 @@ export declare const AgentDefSchema: z.ZodUnion<[z.ZodObject<{
374
385
  }, {
375
386
  type?: "llm" | undefined;
376
387
  description?: string | undefined;
388
+ tools?: string[] | undefined;
377
389
  model?: string | undefined;
378
390
  systemPrompt?: string | undefined;
379
391
  systemPromptTemplate?: {
380
392
  template: string;
381
393
  variables?: Record<string, string | number | boolean | string[] | Record<string, string>> | undefined;
382
394
  } | undefined;
383
- tools?: string[] | undefined;
384
395
  providerOptions?: Record<string, Record<string, unknown>> | undefined;
385
396
  modelOptions?: {
386
397
  temperature?: number | undefined;
@@ -404,6 +415,21 @@ export declare const AgentDefSchema: z.ZodUnion<[z.ZodObject<{
404
415
  } | undefined;
405
416
  maxSteps?: number | undefined;
406
417
  skills?: string[] | undefined;
418
+ }>, z.ZodObject<{
419
+ /** Name registered with `registerAgent`. */
420
+ type: z.ZodEffects<z.ZodString, string, string>;
421
+ /** Optional human-readable description. */
422
+ description: z.ZodOptional<z.ZodString>;
423
+ /** Configuration validated by the registered agent type. */
424
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
425
+ }, "strict", z.ZodTypeAny, {
426
+ type: string;
427
+ description?: string | undefined;
428
+ config?: Record<string, unknown> | undefined;
429
+ }, {
430
+ type: string;
431
+ description?: string | undefined;
432
+ config?: Record<string, unknown> | undefined;
407
433
  }>]>;
408
434
  /** A step that references a named agent from the registry. */
409
435
  export declare const AgentStepSchema: z.ZodObject<{
@@ -499,8 +525,28 @@ export declare const BroadcastFlowDefSchema: z.ZodObject<{
499
525
  description?: string | undefined;
500
526
  separator?: string | undefined;
501
527
  }>;
502
- /** A flow definition discriminated union by `type`. */
503
- export declare const FlowDefSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
528
+ /** A custom registered flow with implementation-specific configuration. */
529
+ export declare const CustomFlowDefSchema: z.ZodObject<{
530
+ type: z.ZodEffects<z.ZodString, string, string>;
531
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
532
+ name: z.ZodString;
533
+ description: z.ZodOptional<z.ZodString>;
534
+ steps: z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">;
535
+ }, "strict", z.ZodTypeAny, {
536
+ type: string;
537
+ name: string;
538
+ steps: any[];
539
+ description?: string | undefined;
540
+ config?: Record<string, unknown> | undefined;
541
+ }, {
542
+ type: string;
543
+ name: string;
544
+ steps: any[];
545
+ description?: string | undefined;
546
+ config?: Record<string, unknown> | undefined;
547
+ }>;
548
+ /** A built-in or registered custom flow definition. */
549
+ export declare const FlowDefSchema: z.ZodUnion<[z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
504
550
  type: z.ZodLiteral<"sequential">;
505
551
  name: z.ZodString;
506
552
  description: z.ZodOptional<z.ZodString>;
@@ -575,6 +621,24 @@ export declare const FlowDefSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject
575
621
  steps: any[];
576
622
  description?: string | undefined;
577
623
  separator?: string | undefined;
624
+ }>]>, z.ZodObject<{
625
+ type: z.ZodEffects<z.ZodString, string, string>;
626
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
627
+ name: z.ZodString;
628
+ description: z.ZodOptional<z.ZodString>;
629
+ steps: z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">;
630
+ }, "strict", z.ZodTypeAny, {
631
+ type: string;
632
+ name: string;
633
+ steps: any[];
634
+ description?: string | undefined;
635
+ config?: Record<string, unknown> | undefined;
636
+ }, {
637
+ type: string;
638
+ name: string;
639
+ steps: any[];
640
+ description?: string | undefined;
641
+ config?: Record<string, unknown> | undefined;
578
642
  }>]>;
579
643
  export declare const StrategySchema: z.ZodObject<{
580
644
  name: z.ZodString;
@@ -629,16 +693,15 @@ export declare const StrategySchema: z.ZodObject<{
629
693
  */
630
694
  skills: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
631
695
  /**
632
- * Per-call provider options forwarded verbatim to the AI SDK. Used to
633
- * enable provider-specific features such as Anthropic extended thinking
634
- * or OpenAI reasoning effort. Shape:
696
+ * Per-call options for provider-specific features such as extended
697
+ * thinking or reasoning effort. Shape:
635
698
  * `{ <providerId>: { <option>: <value>, ... }, ... }`.
636
699
  */
637
700
  providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
638
701
  /**
639
- * Model-level generation parameters (temperature, maxOutputTokens, topP, seed,
640
- * etc.). Forwarded to `streamText` as top-level options. Provider-specific
641
- * features should use `providerOptions` instead.
702
+ * Provider-independent generation parameters such as temperature,
703
+ * maxOutputTokens, topP, and seed. Provider-specific features belong in
704
+ * `providerOptions` instead.
642
705
  */
643
706
  modelOptions: z.ZodOptional<z.ZodObject<{
644
707
  temperature: z.ZodOptional<z.ZodNumber>;
@@ -714,13 +777,13 @@ export declare const StrategySchema: z.ZodObject<{
714
777
  }, "strict", z.ZodTypeAny, {
715
778
  type?: "llm" | undefined;
716
779
  description?: string | undefined;
780
+ tools?: string[] | undefined;
717
781
  model?: string | undefined;
718
782
  systemPrompt?: string | undefined;
719
783
  systemPromptTemplate?: {
720
784
  template: string;
721
785
  variables?: Record<string, string | number | boolean | string[] | Record<string, string>> | undefined;
722
786
  } | undefined;
723
- tools?: string[] | undefined;
724
787
  providerOptions?: Record<string, Record<string, unknown>> | undefined;
725
788
  modelOptions?: {
726
789
  temperature?: number | undefined;
@@ -747,13 +810,13 @@ export declare const StrategySchema: z.ZodObject<{
747
810
  }, {
748
811
  type?: "llm" | undefined;
749
812
  description?: string | undefined;
813
+ tools?: string[] | undefined;
750
814
  model?: string | undefined;
751
815
  systemPrompt?: string | undefined;
752
816
  systemPromptTemplate?: {
753
817
  template: string;
754
818
  variables?: Record<string, string | number | boolean | string[] | Record<string, string>> | undefined;
755
819
  } | undefined;
756
- tools?: string[] | undefined;
757
820
  providerOptions?: Record<string, Record<string, unknown>> | undefined;
758
821
  modelOptions?: {
759
822
  temperature?: number | undefined;
@@ -777,8 +840,23 @@ export declare const StrategySchema: z.ZodObject<{
777
840
  } | undefined;
778
841
  maxSteps?: number | undefined;
779
842
  skills?: string[] | undefined;
843
+ }>, z.ZodObject<{
844
+ /** Name registered with `registerAgent`. */
845
+ type: z.ZodEffects<z.ZodString, string, string>;
846
+ /** Optional human-readable description. */
847
+ description: z.ZodOptional<z.ZodString>;
848
+ /** Configuration validated by the registered agent type. */
849
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
850
+ }, "strict", z.ZodTypeAny, {
851
+ type: string;
852
+ description?: string | undefined;
853
+ config?: Record<string, unknown> | undefined;
854
+ }, {
855
+ type: string;
856
+ description?: string | undefined;
857
+ config?: Record<string, unknown> | undefined;
780
858
  }>]>>;
781
- flow: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
859
+ flow: z.ZodUnion<[z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
782
860
  type: z.ZodLiteral<"sequential">;
783
861
  name: z.ZodString;
784
862
  description: z.ZodOptional<z.ZodString>;
@@ -853,6 +931,24 @@ export declare const StrategySchema: z.ZodObject<{
853
931
  steps: any[];
854
932
  description?: string | undefined;
855
933
  separator?: string | undefined;
934
+ }>]>, z.ZodObject<{
935
+ type: z.ZodEffects<z.ZodString, string, string>;
936
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
937
+ name: z.ZodString;
938
+ description: z.ZodOptional<z.ZodString>;
939
+ steps: z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">;
940
+ }, "strict", z.ZodTypeAny, {
941
+ type: string;
942
+ name: string;
943
+ steps: any[];
944
+ description?: string | undefined;
945
+ config?: Record<string, unknown> | undefined;
946
+ }, {
947
+ type: string;
948
+ name: string;
949
+ steps: any[];
950
+ description?: string | undefined;
951
+ config?: Record<string, unknown> | undefined;
856
952
  }>]>;
857
953
  }, "strict", z.ZodTypeAny, {
858
954
  name: string;
@@ -867,13 +963,13 @@ export declare const StrategySchema: z.ZodObject<{
867
963
  } | {
868
964
  type?: "llm" | undefined;
869
965
  description?: string | undefined;
966
+ tools?: string[] | undefined;
870
967
  model?: string | undefined;
871
968
  systemPrompt?: string | undefined;
872
969
  systemPromptTemplate?: {
873
970
  template: string;
874
971
  variables?: Record<string, string | number | boolean | string[] | Record<string, string>> | undefined;
875
972
  } | undefined;
876
- tools?: string[] | undefined;
877
973
  providerOptions?: Record<string, Record<string, unknown>> | undefined;
878
974
  modelOptions?: {
879
975
  temperature?: number | undefined;
@@ -897,6 +993,10 @@ export declare const StrategySchema: z.ZodObject<{
897
993
  } | undefined;
898
994
  maxSteps?: number | undefined;
899
995
  skills?: string[] | undefined;
996
+ } | {
997
+ type: string;
998
+ description?: string | undefined;
999
+ config?: Record<string, unknown> | undefined;
900
1000
  }>;
901
1001
  flow: {
902
1002
  type: "sequential";
@@ -918,6 +1018,12 @@ export declare const StrategySchema: z.ZodObject<{
918
1018
  steps: any[];
919
1019
  description?: string | undefined;
920
1020
  separator?: string | undefined;
1021
+ } | {
1022
+ type: string;
1023
+ name: string;
1024
+ steps: any[];
1025
+ description?: string | undefined;
1026
+ config?: Record<string, unknown> | undefined;
921
1027
  };
922
1028
  description?: string | undefined;
923
1029
  }, {
@@ -933,13 +1039,13 @@ export declare const StrategySchema: z.ZodObject<{
933
1039
  } | {
934
1040
  type?: "llm" | undefined;
935
1041
  description?: string | undefined;
1042
+ tools?: string[] | undefined;
936
1043
  model?: string | undefined;
937
1044
  systemPrompt?: string | undefined;
938
1045
  systemPromptTemplate?: {
939
1046
  template: string;
940
1047
  variables?: Record<string, string | number | boolean | string[] | Record<string, string>> | undefined;
941
1048
  } | undefined;
942
- tools?: string[] | undefined;
943
1049
  providerOptions?: Record<string, Record<string, unknown>> | undefined;
944
1050
  modelOptions?: {
945
1051
  temperature?: number | undefined;
@@ -963,6 +1069,10 @@ export declare const StrategySchema: z.ZodObject<{
963
1069
  } | undefined;
964
1070
  maxSteps?: number | undefined;
965
1071
  skills?: string[] | undefined;
1072
+ } | {
1073
+ type: string;
1074
+ description?: string | undefined;
1075
+ config?: Record<string, unknown> | undefined;
966
1076
  }>;
967
1077
  flow: {
968
1078
  type: "sequential";
@@ -984,48 +1094,32 @@ export declare const StrategySchema: z.ZodObject<{
984
1094
  steps: any[];
985
1095
  description?: string | undefined;
986
1096
  separator?: string | undefined;
1097
+ } | {
1098
+ type: string;
1099
+ name: string;
1100
+ steps: any[];
1101
+ description?: string | undefined;
1102
+ config?: Record<string, unknown> | undefined;
987
1103
  };
988
1104
  description?: string | undefined;
989
1105
  }>;
990
- export declare const CommaProjectManifestSchema: z.ZodObject<{
991
- name: z.ZodString;
992
- version: z.ZodOptional<z.ZodString>;
993
- description: z.ZodOptional<z.ZodString>;
994
- strategies: z.ZodArray<z.ZodString, "many">;
995
- tools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
996
- entry: z.ZodOptional<z.ZodString>;
997
- dependencies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
998
- }, "strict", z.ZodTypeAny, {
999
- name: string;
1000
- strategies: string[];
1001
- description?: string | undefined;
1002
- tools?: string[] | undefined;
1003
- version?: string | undefined;
1004
- entry?: string | undefined;
1005
- dependencies?: string[] | undefined;
1006
- }, {
1007
- name: string;
1008
- strategies: string[];
1009
- description?: string | undefined;
1010
- tools?: string[] | undefined;
1011
- version?: string | undefined;
1012
- entry?: string | undefined;
1013
- dependencies?: string[] | undefined;
1014
- }>;
1015
1106
  export type UserAgentDef = z.infer<typeof UserAgentDefSchema>;
1016
1107
  export type LLMAgentDef = z.infer<typeof LLMAgentDefSchema>;
1108
+ export type CustomAgentDef = z.infer<typeof CustomAgentDefSchema>;
1017
1109
  export type AgentDef = z.infer<typeof AgentDefSchema>;
1018
1110
  export type AgentStep = z.infer<typeof AgentStepSchema>;
1019
1111
  export type SequentialFlowDef = z.infer<typeof SequentialFlowDefSchema>;
1020
1112
  export type CycleFlowDef = z.infer<typeof CycleFlowDefSchema>;
1021
1113
  export type BroadcastFlowDef = z.infer<typeof BroadcastFlowDefSchema>;
1114
+ export type CustomFlowDef = z.infer<typeof CustomFlowDefSchema>;
1022
1115
  export type FlowDef = z.infer<typeof FlowDefSchema>;
1023
1116
  export type Strategy = z.infer<typeof StrategySchema>;
1024
- export type CommaProjectManifest = z.infer<typeof CommaProjectManifestSchema>;
1025
1117
  /** Check if an agent definition is a user agent. */
1026
1118
  export declare function isUserAgentDef(agentDefinition: AgentDef): agentDefinition is UserAgentDef;
1027
1119
  /** Check if an agent definition is an LLM agent. */
1028
1120
  export declare function isLLMAgentDef(agentDefinition: AgentDef): agentDefinition is LLMAgentDef;
1121
+ /** Check if an agent definition references a registered custom agent type. */
1122
+ export declare function isCustomAgentDef(agentDefinition: AgentDef): agentDefinition is CustomAgentDef;
1029
1123
  /** Check if a flow step is an agent reference (vs a nested flow). */
1030
1124
  export declare function isAgentStep(step: unknown): step is AgentStep;
1031
1125
  /** Check if a flow step is a nested flow definition. */
@@ -6,8 +6,8 @@ export declare const listStrategyParams: z.ZodObject<{}, "strip", z.ZodTypeAny,
6
6
  * Build the `list_strategy` tool.
7
7
  *
8
8
  * Enumerates every strategy that {@link discoverStrategies} can find on
9
- * disk (bundled, cwd `.comma/strategies/`, cwd projects, data dir, data
10
- * dir projects) and returns them in a structured payload plus a
9
+ * disk (cwd `.comma/strategies/`, cwd projects, data dir, data dir
10
+ * projects, installed Hub packages, and bundled defaults) and returns them in a structured payload plus a
11
11
  * human-readable summary. Strategies that fail schema validation are
12
12
  * not included; their paths are surfaced in `data.warnings`.
13
13
  */