@actant/core 0.2.0 → 0.2.2

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.
@@ -100,16 +100,22 @@ function parseSkillMdContent(raw) {
100
100
  if (actantTags) {
101
101
  tags.push(...actantTags.split(",").map((t) => t.trim()).filter(Boolean));
102
102
  }
103
+ const allowedToolsRaw = meta["allowed-tools"];
104
+ const allowedTools = allowedToolsRaw ? allowedToolsRaw.split(/\s+/).filter(Boolean) : void 0;
103
105
  return {
104
106
  name,
105
107
  description: meta.description || void 0,
106
108
  version: meta["metadata.version"] || meta.version || void 0,
107
109
  content,
108
- tags: tags.length > 0 ? tags : void 0
110
+ tags: tags.length > 0 ? tags : void 0,
111
+ license: meta.license || void 0,
112
+ compatibility: meta.compatibility || void 0,
113
+ allowedTools
109
114
  };
110
115
  }
116
+
111
117
  export {
112
118
  parseSkillMd,
113
119
  parseSkillMdContent
114
120
  };
115
- //# sourceMappingURL=skill-md-parser-2HXC4AAW.js.map
121
+ //# sourceMappingURL=chunk-DYGZP4MW.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/source/skill-md-parser.ts"],"sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport type { SkillDefinition } from \"@actant/shared\";\n\n/**\n * Parses a SKILL.md file (Agent Skills / skill.sh format) into a SkillDefinition.\n * Format:\n * ---\n * name: skill-name\n * description: ...\n * license: MIT\n * metadata:\n * author: ...\n * version: \"1.0.0\"\n * actant-tags: \"tag1,tag2\"\n * ---\n *\n * # Skill content starts here...\n */\nexport async function parseSkillMd(filePath: string): Promise<SkillDefinition | null> {\n try {\n const raw = await readFile(filePath, \"utf-8\");\n return parseSkillMdContent(raw);\n } catch {\n return null;\n }\n}\n\n/**\n * Parses YAML frontmatter, handling single-line, quoted, and block scalar values.\n * Supports: key: value, key: \"quoted\", key: | (literal block), key: > (folded block).\n */\nfunction parseYamlFrontmatter(frontmatter: string): Record<string, string> {\n const meta: Record<string, string> = {};\n const lines = frontmatter.split(\"\\n\");\n let i = 0;\n let inMetadata = false;\n\n while (i < lines.length) {\n const line = lines[i];\n if (line === undefined) break;\n const trimmed = line.trim();\n\n if (trimmed === \"metadata:\") {\n inMetadata = true;\n i++;\n continue;\n }\n\n const isNested = inMetadata && (line.startsWith(\" \") || line.startsWith(\"\\t\"));\n const keyPrefix = isNested ? \"metadata.\" : \"\";\n\n const blockMatch = trimmed.match(/^(\\w[\\w-]*)\\s*:\\s*(\\||>)\\s*$/);\n if (blockMatch) {\n const key = keyPrefix + (blockMatch[1] ?? \"\");\n if (!isNested) inMetadata = false;\n\n const keyLineIndent = line.search(/\\S/);\n const blockIndent = keyLineIndent >= 0 ? keyLineIndent : line.length;\n const blockLines: string[] = [];\n i++;\n\n while (i < lines.length) {\n const nextLine = lines[i];\n if (nextLine === undefined) break;\n const nextIndent = nextLine.search(/\\S/);\n const isEmpty = nextLine.trim() === \"\";\n\n if (isEmpty) {\n blockLines.push(nextLine);\n i++;\n continue;\n }\n if (nextIndent !== -1 && nextIndent <= blockIndent) {\n break;\n }\n blockLines.push(nextLine);\n i++;\n }\n\n const nonEmpty = blockLines.filter((l) => l.trim() !== \"\");\n const minIndent =\n nonEmpty.length > 0 ? Math.min(...nonEmpty.map((l) => l.search(/\\S/))) : 0;\n meta[key] =\n blockMatch[2] === \"|\"\n ? blockLines\n .map((l) => (l.trim() === \"\" ? \"\" : l.slice(minIndent)))\n .join(\"\\n\")\n .trimEnd()\n : blockLines.map((l) => l.trim()).join(\" \").trim();\n continue;\n }\n\n const quotedMatch = trimmed.match(/^(\\w[\\w-]*)\\s*:\\s*\"((?:[^\"\\\\]|\\\\.)*)\"\\s*$/);\n if (quotedMatch) {\n const key = keyPrefix + (quotedMatch[1] ?? \"\");\n if (!isNested) inMetadata = false;\n try {\n meta[key] = JSON.parse(`\"${(quotedMatch[2] ?? \"\").replace(/\\\\/g, \"\\\\\\\\\")}\"`);\n } catch {\n meta[key] = (quotedMatch[2] ?? \"\").replace(/\\\\\"/g, '\"');\n }\n i++;\n continue;\n }\n\n const match = trimmed.match(/^(\\w[\\w-]*)\\s*:\\s*(.*)$/);\n if (match?.[1] !== undefined) {\n const key = keyPrefix + match[1];\n if (!isNested) inMetadata = false;\n let value = (match[2] ?? \"\").trim();\n if (value.startsWith('\"') && value.endsWith('\"')) {\n try {\n value = JSON.parse(value);\n } catch {\n value = value.slice(1, -1).replace(/\\\\\"/g, '\"');\n }\n }\n meta[key] = value;\n i++;\n continue;\n }\n\n if (!isNested) inMetadata = false;\n i++;\n }\n\n return meta;\n}\n\nexport function parseSkillMdContent(raw: string): SkillDefinition | null {\n // Check for YAML frontmatter\n if (!raw.startsWith(\"---\")) return null;\n\n const endIdx = raw.indexOf(\"---\", 3);\n if (endIdx === -1) return null;\n\n const frontmatter = raw.substring(3, endIdx).trim();\n const content = raw.substring(endIdx + 3).trim();\n\n // YAML parsing (handles single-line, quoted, and block scalars)\n const meta = parseYamlFrontmatter(frontmatter);\n\n const name = meta.name;\n if (!name) return null;\n\n const tags: string[] = [];\n const actantTags = meta[\"metadata.actant-tags\"];\n if (actantTags) {\n tags.push(...actantTags.split(\",\").map((t) => t.trim()).filter(Boolean));\n }\n\n return {\n name,\n description: meta.description || undefined,\n version: meta[\"metadata.version\"] || meta.version || undefined,\n content,\n tags: tags.length > 0 ? tags : undefined,\n };\n}\n"],"mappings":";AAAA,SAAS,gBAAgB;AAkBzB,eAAsB,aAAa,UAAmD;AACpF,MAAI;AACF,UAAM,MAAM,MAAM,SAAS,UAAU,OAAO;AAC5C,WAAO,oBAAoB,GAAG;AAAA,EAChC,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAMA,SAAS,qBAAqB,aAA6C;AACzE,QAAM,OAA+B,CAAC;AACtC,QAAM,QAAQ,YAAY,MAAM,IAAI;AACpC,MAAI,IAAI;AACR,MAAI,aAAa;AAEjB,SAAO,IAAI,MAAM,QAAQ;AACvB,UAAM,OAAO,MAAM,CAAC;AACpB,QAAI,SAAS,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KAAK,sBAAsB;AAC9C,MAAI,YAAY;AACd,SAAK,KAAK,GAAG,WAAW,MAAM,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,OAAO,CAAC;AAAA,EACzE;AAEA,SAAO;AAAA,IACL;AAAA,IACA,aAAa,KAAK,eAAe;AAAA,IACjC,SAAS,KAAK,kBAAkB,KAAK,KAAK,WAAW;AAAA,IACrD;AAAA,IACA,MAAM,KAAK,SAAS,IAAI,OAAO;AAAA,EACjC;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/source/skill-md-parser.ts"],"sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport type { SkillDefinition } from \"@actant/shared\";\n\n/**\n * Parses a SKILL.md file (Agent Skills / skill.sh format) into a SkillDefinition.\n * Format:\n * ---\n * name: skill-name\n * description: ...\n * license: MIT\n * metadata:\n * author: ...\n * version: \"1.0.0\"\n * actant-tags: \"tag1,tag2\"\n * ---\n *\n * # Skill content starts here...\n */\nexport async function parseSkillMd(filePath: string): Promise<SkillDefinition | null> {\n try {\n const raw = await readFile(filePath, \"utf-8\");\n return parseSkillMdContent(raw);\n } catch {\n return null;\n }\n}\n\n/**\n * Parses YAML frontmatter, handling single-line, quoted, and block scalar values.\n * Supports: key: value, key: \"quoted\", key: | (literal block), key: > (folded block).\n */\nfunction parseYamlFrontmatter(frontmatter: string): Record<string, string> {\n const meta: Record<string, string> = {};\n const lines = frontmatter.split(\"\\n\");\n let i = 0;\n let inMetadata = false;\n\n while (i < lines.length) {\n const line = lines[i];\n if (line === undefined) break;\n const trimmed = line.trim();\n\n if (trimmed === \"metadata:\") {\n inMetadata = true;\n i++;\n continue;\n }\n\n const isNested = inMetadata && (line.startsWith(\" \") || line.startsWith(\"\\t\"));\n const keyPrefix = isNested ? \"metadata.\" : \"\";\n\n const blockMatch = trimmed.match(/^(\\w[\\w-]*)\\s*:\\s*(\\||>)\\s*$/);\n if (blockMatch) {\n const key = keyPrefix + (blockMatch[1] ?? \"\");\n if (!isNested) inMetadata = false;\n\n const keyLineIndent = line.search(/\\S/);\n const blockIndent = keyLineIndent >= 0 ? keyLineIndent : line.length;\n const blockLines: string[] = [];\n i++;\n\n while (i < lines.length) {\n const nextLine = lines[i];\n if (nextLine === undefined) break;\n const nextIndent = nextLine.search(/\\S/);\n const isEmpty = nextLine.trim() === \"\";\n\n if (isEmpty) {\n blockLines.push(nextLine);\n i++;\n continue;\n }\n if (nextIndent !== -1 && nextIndent <= blockIndent) {\n break;\n }\n blockLines.push(nextLine);\n i++;\n }\n\n const nonEmpty = blockLines.filter((l) => l.trim() !== \"\");\n const minIndent =\n nonEmpty.length > 0 ? Math.min(...nonEmpty.map((l) => l.search(/\\S/))) : 0;\n meta[key] =\n blockMatch[2] === \"|\"\n ? blockLines\n .map((l) => (l.trim() === \"\" ? \"\" : l.slice(minIndent)))\n .join(\"\\n\")\n .trimEnd()\n : blockLines.map((l) => l.trim()).join(\" \").trim();\n continue;\n }\n\n const quotedMatch = trimmed.match(/^(\\w[\\w-]*)\\s*:\\s*\"((?:[^\"\\\\]|\\\\.)*)\"\\s*$/);\n if (quotedMatch) {\n const key = keyPrefix + (quotedMatch[1] ?? \"\");\n if (!isNested) inMetadata = false;\n try {\n meta[key] = JSON.parse(`\"${(quotedMatch[2] ?? \"\").replace(/\\\\/g, \"\\\\\\\\\")}\"`);\n } catch {\n meta[key] = (quotedMatch[2] ?? \"\").replace(/\\\\\"/g, '\"');\n }\n i++;\n continue;\n }\n\n const match = trimmed.match(/^(\\w[\\w-]*)\\s*:\\s*(.*)$/);\n if (match?.[1] !== undefined) {\n const key = keyPrefix + match[1];\n if (!isNested) inMetadata = false;\n let value = (match[2] ?? \"\").trim();\n if (value.startsWith('\"') && value.endsWith('\"')) {\n try {\n value = JSON.parse(value);\n } catch {\n value = value.slice(1, -1).replace(/\\\\\"/g, '\"');\n }\n }\n meta[key] = value;\n i++;\n continue;\n }\n\n if (!isNested) inMetadata = false;\n i++;\n }\n\n return meta;\n}\n\nexport function parseSkillMdContent(raw: string): SkillDefinition | null {\n // Check for YAML frontmatter\n if (!raw.startsWith(\"---\")) return null;\n\n const endIdx = raw.indexOf(\"---\", 3);\n if (endIdx === -1) return null;\n\n const frontmatter = raw.substring(3, endIdx).trim();\n const content = raw.substring(endIdx + 3).trim();\n\n // YAML parsing (handles single-line, quoted, and block scalars)\n const meta = parseYamlFrontmatter(frontmatter);\n\n const name = meta.name;\n if (!name) return null;\n\n const tags: string[] = [];\n const actantTags = meta[\"metadata.actant-tags\"];\n if (actantTags) {\n tags.push(...actantTags.split(\",\").map((t) => t.trim()).filter(Boolean));\n }\n\n const allowedToolsRaw = meta[\"allowed-tools\"];\n const allowedTools = allowedToolsRaw\n ? allowedToolsRaw.split(/\\s+/).filter(Boolean)\n : undefined;\n\n return {\n name,\n description: meta.description || undefined,\n version: meta[\"metadata.version\"] || meta.version || undefined,\n content,\n tags: tags.length > 0 ? tags : undefined,\n license: meta.license || undefined,\n compatibility: meta.compatibility || undefined,\n allowedTools,\n };\n}\n"],"mappings":";AAAA,SAAS,gBAAgB;AAkBzB,eAAsB,aAAa,UAAmD;AACpF,MAAI;AACF,UAAM,MAAM,MAAM,SAAS,UAAU,OAAO;AAC5C,WAAO,oBAAoB,GAAG;AAAA,EAChC,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAMA,SAAS,qBAAqB,aAA6C;AACzE,QAAM,OAA+B,CAAC;AACtC,QAAM,QAAQ,YAAY,MAAM,IAAI;AACpC,MAAI,IAAI;AACR,MAAI,aAAa;AAEjB,SAAO,IAAI,MAAM,QAAQ;AACvB,UAAM,OAAO,MAAM,CAAC;AACpB,QAAI,SAAS,OAAW;AACxB,UAAM,UAAU,KAAK,KAAK;AAE1B,QAAI,YAAY,aAAa;AAC3B,mBAAa;AACb;AACA;AAAA,IACF;AAEA,UAAM,WAAW,eAAe,KAAK,WAAW,IAAI,KAAK,KAAK,WAAW,GAAI;AAC7E,UAAM,YAAY,WAAW,cAAc;AAE3C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AAe,kBACjB,gBAAgB,MAAM,KAAK,EAAE,OAAO,OAAO,IAC3C;AAEJ,SAAO;AAAA,IACL;AAAA,IACA,aAAa,KAAK,eAAe;AAAA,IACjC,SAAS,KAAK,kBAAkB,KAAK,KAAK,WAAW;AAAA,IACrD;AAAA,IACA,MAAM,KAAK,SAAS,IAAI,OAAO;AAAA,IAC/B,SAAS,KAAK,WAAW;AAAA,IACzB,eAAe,KAAK,iBAAiB;AAAA,IACrC;AAAA,EACF;AACF;","names":[]}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AgentBackendType, SkillDefinition, PromptDefinition, McpServerDefinition, PluginDefinition, WorkflowDefinition, PermissionsInput, Logger, ConfigValidationResult, DomainContextConfig, AgentBackendConfig, ModelProviderConfig, AgentTemplate, AgentInstanceMeta, LaunchMode, WorkspacePolicy, WorkDirConflict, InitializerStep, AgentStatus, ResolveResult, DetachResult, BackendDescriptor, AgentOpenMode, PermissionsConfig, SourceConfig, PackageManifest, PresetDefinition, GitHubSourceConfig, LocalSourceConfig, SourceEntry } from '@actant/shared';
1
+ import { AgentBackendType, SkillDefinition, PromptDefinition, McpServerDefinition, PluginDefinition, WorkflowDefinition, PermissionsInput, Logger, ConfigValidationResult, DomainContextConfig, AgentBackendConfig, ModelProviderConfig, AgentTemplate, AgentInstanceMeta, LaunchMode, WorkspacePolicy, WorkDirConflict, InitializerStep, OpenSpawnOptions, AgentStatus, ResolveResult, DetachResult, BackendDefinition, AgentOpenMode, PlatformCommand, BackendInstallMethod, BackendDescriptor, PermissionsConfig, SourceConfig, PackageManifest, PresetDefinition, GitHubSourceConfig, LocalSourceConfig, SourceEntry, ModelProviderDescriptor } from '@actant/shared';
2
2
  import { z } from 'zod/v4';
3
3
  import { EventEmitter } from 'node:events';
4
4
  import { Writable, Readable } from 'node:stream';
@@ -538,21 +538,32 @@ declare const AgentBackendSchema: z.ZodObject<{
538
538
  }>;
539
539
  config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
540
540
  }, z.core.$strip>;
541
- declare const ModelProviderSchema: z.ZodObject<{
542
- type: z.ZodEnum<{
541
+ declare const ModelApiProtocolEnum: z.ZodEnum<{
542
+ custom: "custom";
543
+ openai: "openai";
544
+ anthropic: "anthropic";
545
+ }>;
546
+ type ApiProtocol = z.infer<typeof ModelApiProtocolEnum>;
547
+ declare const ModelProviderSchema: z.ZodPipe<z.ZodObject<{
548
+ type: z.ZodString;
549
+ protocol: z.ZodOptional<z.ZodEnum<{
543
550
  custom: "custom";
544
- anthropic: "anthropic";
545
551
  openai: "openai";
546
- "openai-compatible": "openai-compatible";
547
- }>;
548
- protocol: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
549
- http: "http";
550
- websocket: "websocket";
551
- grpc: "grpc";
552
- }>>>;
552
+ anthropic: "anthropic";
553
+ }>>;
553
554
  baseUrl: z.ZodOptional<z.ZodString>;
554
555
  config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
555
- }, z.core.$strip>;
556
+ }, z.core.$strip>, z.ZodTransform<{
557
+ protocol: ApiProtocol;
558
+ type: string;
559
+ baseUrl?: string | undefined;
560
+ config?: Record<string, unknown> | undefined;
561
+ }, {
562
+ type: string;
563
+ protocol?: "custom" | "openai" | "anthropic" | undefined;
564
+ baseUrl?: string | undefined;
565
+ config?: Record<string, unknown> | undefined;
566
+ }>>;
556
567
  declare const InitializerStepSchema: z.ZodObject<{
557
568
  type: z.ZodString;
558
569
  config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -656,21 +667,26 @@ declare const AgentTemplateSchema: z.ZodObject<{
656
667
  }>;
657
668
  config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
658
669
  }, z.core.$strip>;
659
- provider: z.ZodObject<{
660
- type: z.ZodEnum<{
670
+ provider: z.ZodOptional<z.ZodPipe<z.ZodObject<{
671
+ type: z.ZodString;
672
+ protocol: z.ZodOptional<z.ZodEnum<{
661
673
  custom: "custom";
662
- anthropic: "anthropic";
663
674
  openai: "openai";
664
- "openai-compatible": "openai-compatible";
665
- }>;
666
- protocol: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
667
- http: "http";
668
- websocket: "websocket";
669
- grpc: "grpc";
670
- }>>>;
675
+ anthropic: "anthropic";
676
+ }>>;
671
677
  baseUrl: z.ZodOptional<z.ZodString>;
672
678
  config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
673
- }, z.core.$strip>;
679
+ }, z.core.$strip>, z.ZodTransform<{
680
+ protocol: ApiProtocol;
681
+ type: string;
682
+ baseUrl?: string | undefined;
683
+ config?: Record<string, unknown> | undefined;
684
+ }, {
685
+ type: string;
686
+ protocol?: "custom" | "openai" | "anthropic" | undefined;
687
+ baseUrl?: string | undefined;
688
+ config?: Record<string, unknown> | undefined;
689
+ }>>>;
674
690
  domainContext: z.ZodObject<{
675
691
  skills: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
676
692
  prompts: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
@@ -1142,14 +1158,18 @@ declare const AgentInstanceMetaSchema: z.ZodObject<{
1142
1158
  name: z.ZodString;
1143
1159
  templateName: z.ZodString;
1144
1160
  templateVersion: z.ZodString;
1145
- backendType: z.ZodDefault<z.ZodEnum<{
1146
- cursor: "cursor";
1147
- "cursor-agent": "cursor-agent";
1148
- "claude-code": "claude-code";
1149
- custom: "custom";
1150
- pi: "pi";
1151
- }>>;
1161
+ backendType: z.ZodDefault<z.ZodString>;
1152
1162
  backendConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1163
+ providerConfig: z.ZodOptional<z.ZodObject<{
1164
+ type: z.ZodString;
1165
+ protocol: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
1166
+ custom: "custom";
1167
+ openai: "openai";
1168
+ anthropic: "anthropic";
1169
+ }>>>;
1170
+ baseUrl: z.ZodOptional<z.ZodString>;
1171
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1172
+ }, z.core.$strip>>;
1153
1173
  status: z.ZodEnum<{
1154
1174
  error: "error";
1155
1175
  running: "running";
@@ -1279,6 +1299,46 @@ interface AgentLauncher {
1279
1299
  terminate(process: AgentProcess): Promise<void>;
1280
1300
  }
1281
1301
 
1302
+ interface ResolvedBackend {
1303
+ command: string;
1304
+ args: string[];
1305
+ /** npm package providing the binary (for auto-resolution when not on PATH). */
1306
+ resolvePackage?: string;
1307
+ /** Working directory for the spawned process. */
1308
+ cwd?: string;
1309
+ /** Declarative spawn options for `open` mode (from BackendDescriptor). */
1310
+ openSpawnOptions?: OpenSpawnOptions;
1311
+ }
1312
+ /**
1313
+ * Whether a backend type supports the ACP protocol for Actant-managed control.
1314
+ * Replaces the old hardcoded `isAcpBackend()`.
1315
+ */
1316
+ declare function isAcpBackend(backendType: AgentBackendType): boolean;
1317
+ /**
1318
+ * Whether a backend's ACP connection owns the process lifecycle.
1319
+ * When true, ProcessLauncher.launch() is skipped — only AcpConnectionManager spawns the process.
1320
+ */
1321
+ declare function isAcpOnlyBackend(backendType: AgentBackendType): boolean;
1322
+ /**
1323
+ * Resolve the executable command and arguments for spawning a backend (resolve mode).
1324
+ * @throws if the backend does not support "resolve" mode.
1325
+ */
1326
+ declare function resolveBackend(backendType: AgentBackendType, workspaceDir: string, backendConfig?: Record<string, unknown>): ResolvedBackend;
1327
+ /**
1328
+ * Resolve the open command for directly launching a backend's native TUI/UI.
1329
+ * `openWorkspaceDir` is consumed here to build `args`/`cwd`; the returned
1330
+ * `openSpawnOptions` maps 1:1 to `child_process.SpawnOptions` so the CLI
1331
+ * can spread it as-is with zero branching.
1332
+ */
1333
+ declare function openBackend(backendType: AgentBackendType, workspaceDir: string): ResolvedBackend;
1334
+ /**
1335
+ * Resolve the ACP spawn command for a backend.
1336
+ * For ACP backends, this returns the command used by AcpConnectionManager to spawn the agent process.
1337
+ * Checks acpCommand first, then falls back to resolveCommand.
1338
+ * @throws if the backend does not support "acp" mode.
1339
+ */
1340
+ declare function resolveAcpBackend(backendType: AgentBackendType, workspaceDir: string, backendConfig?: Record<string, unknown>): ResolvedBackend;
1341
+
1282
1342
  interface RestartPolicy {
1283
1343
  /** Maximum number of restarts before giving up. Default: 5 */
1284
1344
  maxRestarts: number;
@@ -1366,6 +1426,7 @@ interface AcpConnectionManagerLike {
1366
1426
  command: string;
1367
1427
  args: string[];
1368
1428
  cwd: string;
1429
+ resolvePackage?: string;
1369
1430
  connectionOptions?: {
1370
1431
  autoApprove?: boolean;
1371
1432
  env?: Record<string, string>;
@@ -1459,10 +1520,7 @@ declare class AgentManager {
1459
1520
  * Requires the backend to support "open" mode.
1460
1521
  * @throws if backend does not support "open" mode
1461
1522
  */
1462
- openAgent(name: string): Promise<{
1463
- command: string;
1464
- args: string[];
1465
- }>;
1523
+ openAgent(name: string): Promise<ResolvedBackend>;
1466
1524
  /**
1467
1525
  * Register an externally-spawned process with the manager.
1468
1526
  * Sets processOwnership to "external" and registers ProcessWatcher monitoring.
@@ -1632,55 +1690,62 @@ interface LauncherConfig {
1632
1690
  */
1633
1691
  declare function createLauncher(config?: Partial<LauncherConfig>): AgentLauncher;
1634
1692
 
1635
- interface ResolvedBackend {
1693
+ type AcpResolverFn = (workspaceDir: string, backendConfig?: Record<string, unknown>) => {
1636
1694
  command: string;
1637
1695
  args: string[];
1638
- }
1639
- /**
1640
- * Whether a backend type supports the ACP protocol for Actant-managed control.
1641
- * Replaces the old hardcoded `isAcpBackend()`.
1642
- */
1643
- declare function isAcpBackend(backendType: AgentBackendType): boolean;
1644
- /**
1645
- * Whether a backend's ACP connection owns the process lifecycle.
1646
- * When true, ProcessLauncher.launch() is skipped — only AcpConnectionManager spawns the process.
1647
- */
1648
- declare function isAcpOnlyBackend(backendType: AgentBackendType): boolean;
1649
- /**
1650
- * Resolve the executable command and arguments for spawning a backend (resolve mode).
1651
- * @throws if the backend does not support "resolve" mode.
1652
- */
1653
- declare function resolveBackend(backendType: AgentBackendType, workspaceDir: string, backendConfig?: Record<string, unknown>): ResolvedBackend;
1654
- /**
1655
- * Resolve the open command for directly launching a backend's native TUI/UI.
1656
- * @throws if the backend does not support "open" mode.
1657
- */
1658
- declare function openBackend(backendType: AgentBackendType, workspaceDir: string): ResolvedBackend;
1696
+ };
1659
1697
  /**
1660
- * Resolve the ACP spawn command for a backend.
1661
- * For ACP backends, this returns the command used by AcpConnectionManager to spawn the agent process.
1662
- * Checks acpCommand first, then falls back to resolveCommand.
1663
- * @throws if the backend does not support "acp" mode.
1698
+ * Manages backend definitions as VersionedComponents.
1699
+ *
1700
+ * Pure-data definitions are stored in the component registry (JSON-serializable,
1701
+ * loadable from `~/.actant/configs/backends/`). Non-serializable behavioral
1702
+ * extensions (acpResolver) are stored in a separate Map keyed by backend name.
1664
1703
  */
1665
- declare function resolveAcpBackend(backendType: AgentBackendType, workspaceDir: string, backendConfig?: Record<string, unknown>): ResolvedBackend;
1704
+ declare class BackendManager extends BaseComponentManager<BackendDefinition> {
1705
+ protected readonly componentType = "Backend";
1706
+ private readonly acpResolvers;
1707
+ constructor();
1708
+ registerAcpResolver(backendName: string, resolver: AcpResolverFn): void;
1709
+ getAcpResolver(backendName: string): AcpResolverFn | undefined;
1710
+ supportsMode(backendName: string, mode: AgentOpenMode): boolean;
1711
+ requireMode(backendName: string, mode: AgentOpenMode): void;
1712
+ getPlatformCommand(cmd: PlatformCommand): string;
1713
+ /**
1714
+ * Probe whether a backend binary is available on the system.
1715
+ * Uses the `existenceCheck` field. Returns `{ available, version? }`.
1716
+ * If no `existenceCheck` is configured, returns `{ available: true }` (assume ok).
1717
+ */
1718
+ checkAvailability(backendName: string): Promise<BackendAvailability>;
1719
+ /**
1720
+ * Get platform-appropriate install methods for a backend.
1721
+ * Filters by `platforms` field; returns all methods if no platform restriction.
1722
+ */
1723
+ getInstallMethods(backendName: string): BackendInstallMethod[];
1724
+ validate(data: unknown, _source: string): ConfigValidationResult<BackendDefinition>;
1725
+ }
1726
+ interface BackendAvailability {
1727
+ available: boolean;
1728
+ version?: string;
1729
+ error?: string;
1730
+ }
1666
1731
 
1732
+ /** Access the singleton BackendManager for advanced operations (CRUD, persistence, directory loading). */
1733
+ declare function getBackendManager(): BackendManager;
1667
1734
  /**
1668
- * Register a backend descriptor.
1669
- * Call at startup for built-in backends and from external packages (e.g. @actant/pi).
1735
+ * Register a backend descriptor (legacy API).
1736
+ * Converts `BackendDescriptor.type` `BackendDefinition.name` and
1737
+ * extracts `acpResolver` into the behavioral registry.
1670
1738
  */
1671
1739
  declare function registerBackend(descriptor: BackendDescriptor): void;
1672
1740
  /**
1673
- * Retrieve the descriptor for a backend type.
1674
- * @throws if the type has not been registered.
1741
+ * Register a BackendDefinition directly (new API).
1742
+ * For behavioral extensions, use `getBackendManager().registerAcpResolver()`.
1675
1743
  */
1676
- declare function getBackendDescriptor(type: AgentBackendType): BackendDescriptor;
1677
- /** Check whether a backend supports a specific open mode. */
1744
+ declare function registerBackendDefinition(definition: BackendDefinition): void;
1745
+ declare function getBackendDescriptor(type: AgentBackendType): BackendDefinition;
1678
1746
  declare function supportsMode(type: AgentBackendType, mode: AgentOpenMode): boolean;
1679
- /**
1680
- * Assert that a backend supports a mode, throwing a descriptive error if not.
1681
- * Used as a guard in manager methods before executing mode-specific logic.
1682
- */
1683
1747
  declare function requireMode(type: AgentBackendType, mode: AgentOpenMode): void;
1748
+ declare function getInstallHint(type: AgentBackendType): string | undefined;
1684
1749
 
1685
1750
  /**
1686
1751
  * Check whether a process with the given PID is still alive.
@@ -1926,6 +1991,7 @@ interface FetchResult {
1926
1991
  prompts: PromptDefinition[];
1927
1992
  mcpServers: McpServerDefinition[];
1928
1993
  workflows: WorkflowDefinition[];
1994
+ backends: BackendDefinition[];
1929
1995
  presets: PresetDefinition[];
1930
1996
  templates: AgentTemplate[];
1931
1997
  }
@@ -1937,6 +2003,8 @@ interface ComponentSource {
1937
2003
  readonly type: string;
1938
2004
  readonly packageName: string;
1939
2005
  readonly config: SourceConfig;
2006
+ /** Filesystem root directory for this source's content. */
2007
+ getRootDir(): string;
1940
2008
  fetch(): Promise<FetchResult>;
1941
2009
  sync(): Promise<FetchResult>;
1942
2010
  dispose(): Promise<void>;
@@ -1952,6 +2020,7 @@ declare class GitHubSource implements ComponentSource {
1952
2020
  readonly config: GitHubSourceConfig;
1953
2021
  private readonly cacheDir;
1954
2022
  constructor(packageName: string, config: GitHubSourceConfig, cacheDir: string);
2023
+ getRootDir(): string;
1955
2024
  fetch(): Promise<FetchResult>;
1956
2025
  sync(): Promise<FetchResult>;
1957
2026
  dispose(): Promise<void>;
@@ -1965,6 +2034,7 @@ declare class LocalSource implements ComponentSource {
1965
2034
  readonly packageName: string;
1966
2035
  readonly config: LocalSourceConfig;
1967
2036
  constructor(packageName: string, config: LocalSourceConfig);
2037
+ getRootDir(): string;
1968
2038
  fetch(): Promise<FetchResult>;
1969
2039
  sync(): Promise<FetchResult>;
1970
2040
  dispose(): Promise<void>;
@@ -1997,6 +2067,7 @@ interface SourceManagerDeps {
1997
2067
  promptManager: BaseComponentManager<PromptDefinition>;
1998
2068
  mcpConfigManager: BaseComponentManager<McpServerDefinition>;
1999
2069
  workflowManager: BaseComponentManager<WorkflowDefinition>;
2070
+ backendManager?: BaseComponentManager<BackendDefinition>;
2000
2071
  templateRegistry?: TemplateRegistry;
2001
2072
  }
2002
2073
  /**
@@ -2029,6 +2100,8 @@ declare class SourceManager {
2029
2100
  removeSource(name: string): Promise<boolean>;
2030
2101
  listSources(): SourceEntry[];
2031
2102
  hasSource(name: string): boolean;
2103
+ /** Resolve a registered source name to its filesystem root directory. */
2104
+ getSourceRootDir(name: string): string;
2032
2105
  listPresets(packageName?: string): PresetDefinition[];
2033
2106
  getPreset(qualifiedName: string): PresetDefinition | undefined;
2034
2107
  /**
@@ -2053,4 +2126,83 @@ declare class SourceManager {
2053
2126
  private buildSyncReport;
2054
2127
  }
2055
2128
 
2056
- export { AgentBackendSchema, type AgentCommunicator, AgentInitializer, AgentInstanceMetaSchema, type AgentLauncher, AgentManager, type AgentProcess, AgentStatusSchema, type AgentTask, type AgentTemplateInput, type AgentTemplateOutput, AgentTemplateSchema, type AuditEntry, type BackendBuilder, BaseComponentManager, ClaudeCodeBuilder, ClaudeCodeCommunicator, type CommunicatorFactory, ComponentOriginSchema, type ComponentSource, type ComponentTypeHandler, ContextMaterializer, type CreateSessionOptions, type CronConfig, CronConfigSchema, CronInput, CursorBuilder, CursorCommunicator, CustomBuilder, type CustomBuilderConfig, DEFAULT_RESTART_POLICY, DEFAULT_SOURCE_CONFIG, DEFAULT_SOURCE_NAME, DomainContextSchema, type DomainManagers$1 as DomainManagers, EmployeeScheduler, ExecStep, ExecutionLog, type ExecutionRecord, type FetchResult, FileCopyStep, GitCloneStep, GitHubSource, type HeartbeatConfig, HeartbeatConfigSchema, HeartbeatInput, type HookConfig, HookConfigSchema, HookInput, InitializationPipeline, type InitializerOptions, InitializerSchema, InitializerStepExecutor, InitializerStepSchema, InputRouter, type InputSource, type InstanceOverrides, InstanceRegistry, type InstanceRegistryAdapter, type InstanceRegistryData, type InstanceRegistryEntry, type LaunchModeHandler, LaunchModeSchema, type LauncherConfig, type LauncherMode, LocalSource, type ManagerOptions, McpConfigManager, McpServerRefSchema, MkdirStep, MockLauncher, ModelProviderSchema, type NamedComponent, NpmInstallStep, type PermissionAuditEvent, PermissionAuditLogger, PermissionPolicyEnforcer, PermissionPresetSchema, PermissionsInputSchema, PermissionsObjectSchema, type PipelineOptions, type PipelineResult, PluginManager, type PolicyAction, type PolicyDecision, type ProcessExitAction, type ProcessExitHandler, type ProcessExitInfo, ProcessLauncher, type ProcessLauncherOptions, ProcessLogWriter, type ProcessLogWriterOptions, ProcessWatcher, type ProcessWatcherOptions, type PromptAgentFn, PromptManager, type PromptResult, type RecoveryAction, type RegistryOptions, type ResolvedBackend, type RestartDecision, type RestartPolicy, RestartTracker, type RunPromptOptions, type ScheduleConfig, type ScheduleConfigInput, ScheduleConfigSchema, type SessionLease, SessionRegistry, type SessionRegistryOptions, type SessionState, SkillManager, SourceManager, type SourceManagerDeps, type SourceManagerOptions, type StepContext, StepRegistry, type StepResult, type StepValidationResult, type StreamChunk, type TaskCallback, TaskDispatcher, type TaskPriority, TaskQueue, type TaskStatus, TemplateFileWatcher, type TemplateFileWatcherOptions, TemplateLoader, TemplateRegistry, type ToolCallInfo, type VerifyResult, WorkflowManager, type WorkspaceBuildResult, WorkspaceBuilder, createCommunicator, createDefaultStepRegistry, createLauncher, getBackendDescriptor, getLaunchModeHandler, globMatch, isAcpBackend, isAcpOnlyBackend, isProcessAlive, metaFilePath, openBackend, readInstanceMeta, registerBackend, registerCommunicator, requireMode, resolveAcpBackend, resolveBackend, resolvePermissions, resolvePermissionsWithMcp, scanInstances, supportsMode, toAgentTemplate, updateInstanceMeta, validateBackendConfig, validateDomainContextConfig, validatePermissionsConfig, validateProviderConfig, validateScheduleConfig, validateTemplate, writeInstanceMeta };
2129
+ interface SourceValidationIssue {
2130
+ severity: "error" | "warning" | "info";
2131
+ path: string;
2132
+ component?: string;
2133
+ message: string;
2134
+ code?: string;
2135
+ }
2136
+ interface SourceValidationReport {
2137
+ valid: boolean;
2138
+ sourceName: string;
2139
+ rootDir: string;
2140
+ summary: {
2141
+ pass: number;
2142
+ warn: number;
2143
+ error: number;
2144
+ };
2145
+ issues: SourceValidationIssue[];
2146
+ }
2147
+ type CompatMode = "agent-skills";
2148
+ interface ValidateOptions {
2149
+ strict?: boolean;
2150
+ /** Enable compatibility checks against an external standard. */
2151
+ compat?: CompatMode;
2152
+ }
2153
+ declare class SourceValidator {
2154
+ /**
2155
+ * Validate all assets in a source directory.
2156
+ * Returns a report with pass/warn/error counts and detailed issues.
2157
+ */
2158
+ validate(rootDir: string, options?: ValidateOptions): Promise<SourceValidationReport>;
2159
+ private validateManifest;
2160
+ private verifyManifestFileRefs;
2161
+ private validateExplicitFiles;
2162
+ private validateComponentDirs;
2163
+ private scanDirectory;
2164
+ private validateSingleFile;
2165
+ private validateTemplateComponent;
2166
+ private validateSkillMd;
2167
+ private validateAgentSkillsCompat;
2168
+ private validateSkillDirConventions;
2169
+ private validatePresetReferences;
2170
+ private trackComponentName;
2171
+ }
2172
+
2173
+ /**
2174
+ * Registry for model provider descriptors.
2175
+ *
2176
+ * Sources (registered at startup in this order):
2177
+ * 1. Built-in providers (anthropic, openai, deepseek, ...)
2178
+ * 2. Default provider from config.json `provider` field
2179
+ * 3. User-registered providers from config.json `providers` field
2180
+ *
2181
+ * Consumers:
2182
+ * - Zod schema validation (warning for unknown types)
2183
+ * - CLI setup wizard (dynamic provider list)
2184
+ * - AgentInitializer (resolve default when template omits provider)
2185
+ * - AgentManager (resolve provider → env vars for ACP)
2186
+ */
2187
+ declare class ModelProviderRegistry {
2188
+ private readonly descriptors;
2189
+ private defaultType;
2190
+ register(descriptor: ModelProviderDescriptor): void;
2191
+ get(type: string): ModelProviderDescriptor | undefined;
2192
+ getOrThrow(type: string): ModelProviderDescriptor;
2193
+ has(type: string): boolean;
2194
+ list(): ModelProviderDescriptor[];
2195
+ setDefault(type: string): void;
2196
+ getDefault(): ModelProviderDescriptor | undefined;
2197
+ getDefaultType(): string | undefined;
2198
+ /** @internal Test-only: clear all registrations. */
2199
+ _reset(): void;
2200
+ }
2201
+ /** Singleton instance used throughout the application. */
2202
+ declare const modelProviderRegistry: ModelProviderRegistry;
2203
+
2204
+ declare const BUILTIN_PROVIDERS: readonly ModelProviderDescriptor[];
2205
+ /** Register all built-in providers into the singleton registry. */
2206
+ declare function registerBuiltinProviders(): void;
2207
+
2208
+ export { type AcpResolverFn, AgentBackendSchema, type AgentCommunicator, AgentInitializer, AgentInstanceMetaSchema, type AgentLauncher, AgentManager, type AgentProcess, AgentStatusSchema, type AgentTask, type AgentTemplateInput, type AgentTemplateOutput, AgentTemplateSchema, type AuditEntry, BUILTIN_PROVIDERS, type BackendAvailability, type BackendBuilder, BackendManager, BaseComponentManager, ClaudeCodeBuilder, ClaudeCodeCommunicator, type CommunicatorFactory, type CompatMode, ComponentOriginSchema, type ComponentSource, type ComponentTypeHandler, ContextMaterializer, type CreateSessionOptions, type CronConfig, CronConfigSchema, CronInput, CursorBuilder, CursorCommunicator, CustomBuilder, type CustomBuilderConfig, DEFAULT_RESTART_POLICY, DEFAULT_SOURCE_CONFIG, DEFAULT_SOURCE_NAME, DomainContextSchema, type DomainManagers$1 as DomainManagers, EmployeeScheduler, ExecStep, ExecutionLog, type ExecutionRecord, type FetchResult, FileCopyStep, GitCloneStep, GitHubSource, type HeartbeatConfig, HeartbeatConfigSchema, HeartbeatInput, type HookConfig, HookConfigSchema, HookInput, InitializationPipeline, type InitializerOptions, InitializerSchema, InitializerStepExecutor, InitializerStepSchema, InputRouter, type InputSource, type InstanceOverrides, InstanceRegistry, type InstanceRegistryAdapter, type InstanceRegistryData, type InstanceRegistryEntry, type LaunchModeHandler, LaunchModeSchema, type LauncherConfig, type LauncherMode, LocalSource, type ManagerOptions, McpConfigManager, McpServerRefSchema, MkdirStep, MockLauncher, ModelProviderRegistry, ModelProviderSchema, type NamedComponent, NpmInstallStep, type PermissionAuditEvent, PermissionAuditLogger, PermissionPolicyEnforcer, PermissionPresetSchema, PermissionsInputSchema, PermissionsObjectSchema, type PipelineOptions, type PipelineResult, PluginManager, type PolicyAction, type PolicyDecision, type ProcessExitAction, type ProcessExitHandler, type ProcessExitInfo, ProcessLauncher, type ProcessLauncherOptions, ProcessLogWriter, type ProcessLogWriterOptions, ProcessWatcher, type ProcessWatcherOptions, type PromptAgentFn, PromptManager, type PromptResult, type RecoveryAction, type RegistryOptions, type ResolvedBackend, type RestartDecision, type RestartPolicy, RestartTracker, type RunPromptOptions, type ScheduleConfig, type ScheduleConfigInput, ScheduleConfigSchema, type SessionLease, SessionRegistry, type SessionRegistryOptions, type SessionState, SkillManager, SourceManager, type SourceManagerDeps, type SourceManagerOptions, type SourceValidationIssue, type SourceValidationReport, SourceValidator, type StepContext, StepRegistry, type StepResult, type StepValidationResult, type StreamChunk, type TaskCallback, TaskDispatcher, type TaskPriority, TaskQueue, type TaskStatus, TemplateFileWatcher, type TemplateFileWatcherOptions, TemplateLoader, TemplateRegistry, type ToolCallInfo, type ValidateOptions, type VerifyResult, WorkflowManager, type WorkspaceBuildResult, WorkspaceBuilder, createCommunicator, createDefaultStepRegistry, createLauncher, getBackendDescriptor, getBackendManager, getInstallHint, getLaunchModeHandler, globMatch, isAcpBackend, isAcpOnlyBackend, isProcessAlive, metaFilePath, modelProviderRegistry, openBackend, readInstanceMeta, registerBackend, registerBackendDefinition, registerBuiltinProviders, registerCommunicator, requireMode, resolveAcpBackend, resolveBackend, resolvePermissions, resolvePermissionsWithMcp, scanInstances, supportsMode, toAgentTemplate, updateInstanceMeta, validateBackendConfig, validateDomainContextConfig, validatePermissionsConfig, validateProviderConfig, validateScheduleConfig, validateTemplate, writeInstanceMeta };