@actant/core 0.1.2 → 0.2.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.
- package/dist/{skill-md-parser-2HXC4AAW.js → chunk-DYGZP4MW.js} +8 -2
- package/dist/{skill-md-parser-2HXC4AAW.js.map → chunk-DYGZP4MW.js.map} +1 -1
- package/dist/index.d.ts +219 -20
- package/dist/index.js +1270 -218
- package/dist/index.js.map +1 -1
- package/dist/skill-md-parser-HXLTZAUU.js +9 -0
- package/dist/skill-md-parser-HXLTZAUU.js.map +1 -0
- package/package.json +2 -2
|
@@ -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=
|
|
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 t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B;AAAA,EACF;AAEA,SAAO;AACT;AAEO,SAAS,oBAAoB,KAAqC;AAEvE,MAAI,CAAC,IAAI,WAAW,KAAK,EAAG,QAAO;AAEnC,QAAM,SAAS,IAAI,QAAQ,OAAO,CAAC;AACnC,MAAI,WAAW,GAAI,QAAO;AAE1B,QAAM,cAAc,IAAI,UAAU,GAAG,MAAM,EAAE,KAAK;AAClD,QAAM,UAAU,IAAI,UAAU,SAAS,CAAC,EAAE,KAAK;AAG/C,QAAM,OAAO,qBAAqB,WAAW;AAE7C,QAAM,OAAO,KAAK;AAClB,MAAI,CAAC,KAAM,QAAO;AAElB,QAAM,OAAiB,CAAC;AACxB,QAAM,aAAa,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,
|
|
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,EAC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U,GAAG,MAAM,EAAE,KAAK;AAClD,QAAM,UAAU,IAAI,UAAU,SAAS,CAAC,EAAE,KAAK;AAG/C,QAAM,OAAO,qBAAqB,WAAW;AAE7C,QAAM,OAAO,KAAK;AAClB,MAAI,CAAC,KAAM,QAAO;AAElB,QAAM,OAAiB,CAAC;AACxB,QAAM,aAAa,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,QAAM,kBAAkB,KAAK,eAAe;AAC5C,QAAM,eAAe,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, 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, AgentStatus, ResolveResult, DetachResult, BackendDescriptor, AgentOpenMode, 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';
|
|
@@ -531,19 +531,39 @@ declare const DomainContextSchema: z.ZodObject<{
|
|
|
531
531
|
declare const AgentBackendSchema: z.ZodObject<{
|
|
532
532
|
type: z.ZodEnum<{
|
|
533
533
|
cursor: "cursor";
|
|
534
|
+
"cursor-agent": "cursor-agent";
|
|
534
535
|
"claude-code": "claude-code";
|
|
535
536
|
custom: "custom";
|
|
537
|
+
pi: "pi";
|
|
536
538
|
}>;
|
|
537
539
|
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
538
540
|
}, z.core.$strip>;
|
|
539
|
-
declare const
|
|
540
|
-
|
|
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<{
|
|
541
550
|
custom: "custom";
|
|
542
|
-
anthropic: "anthropic";
|
|
543
551
|
openai: "openai";
|
|
544
|
-
|
|
552
|
+
anthropic: "anthropic";
|
|
553
|
+
}>>;
|
|
554
|
+
baseUrl: z.ZodOptional<z.ZodString>;
|
|
545
555
|
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
546
|
-
}, 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
|
+
}>>;
|
|
547
567
|
declare const InitializerStepSchema: z.ZodObject<{
|
|
548
568
|
type: z.ZodString;
|
|
549
569
|
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -640,19 +660,33 @@ declare const AgentTemplateSchema: z.ZodObject<{
|
|
|
640
660
|
backend: z.ZodObject<{
|
|
641
661
|
type: z.ZodEnum<{
|
|
642
662
|
cursor: "cursor";
|
|
663
|
+
"cursor-agent": "cursor-agent";
|
|
643
664
|
"claude-code": "claude-code";
|
|
644
665
|
custom: "custom";
|
|
666
|
+
pi: "pi";
|
|
645
667
|
}>;
|
|
646
668
|
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
647
669
|
}, z.core.$strip>;
|
|
648
|
-
provider: z.ZodObject<{
|
|
649
|
-
type: z.
|
|
670
|
+
provider: z.ZodOptional<z.ZodPipe<z.ZodObject<{
|
|
671
|
+
type: z.ZodString;
|
|
672
|
+
protocol: z.ZodOptional<z.ZodEnum<{
|
|
650
673
|
custom: "custom";
|
|
651
|
-
anthropic: "anthropic";
|
|
652
674
|
openai: "openai";
|
|
653
|
-
|
|
675
|
+
anthropic: "anthropic";
|
|
676
|
+
}>>;
|
|
677
|
+
baseUrl: z.ZodOptional<z.ZodString>;
|
|
654
678
|
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
655
|
-
}, 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
|
+
}>>>;
|
|
656
690
|
domainContext: z.ZodObject<{
|
|
657
691
|
skills: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
658
692
|
prompts: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
@@ -946,6 +980,7 @@ declare class AgentInitializer {
|
|
|
946
980
|
private readonly builder;
|
|
947
981
|
private readonly pipeline?;
|
|
948
982
|
constructor(templateRegistry: TemplateRegistry, instancesBaseDir: string, options?: InitializerOptions | undefined);
|
|
983
|
+
get workspaceBuilder(): WorkspaceBuilder;
|
|
949
984
|
/**
|
|
950
985
|
* Create a new Agent Instance.
|
|
951
986
|
* 1. Resolve template from registry
|
|
@@ -1125,10 +1160,22 @@ declare const AgentInstanceMetaSchema: z.ZodObject<{
|
|
|
1125
1160
|
templateVersion: z.ZodString;
|
|
1126
1161
|
backendType: z.ZodDefault<z.ZodEnum<{
|
|
1127
1162
|
cursor: "cursor";
|
|
1163
|
+
"cursor-agent": "cursor-agent";
|
|
1128
1164
|
"claude-code": "claude-code";
|
|
1129
1165
|
custom: "custom";
|
|
1166
|
+
pi: "pi";
|
|
1130
1167
|
}>>;
|
|
1131
1168
|
backendConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1169
|
+
providerConfig: z.ZodOptional<z.ZodObject<{
|
|
1170
|
+
type: z.ZodString;
|
|
1171
|
+
protocol: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
1172
|
+
custom: "custom";
|
|
1173
|
+
openai: "openai";
|
|
1174
|
+
anthropic: "anthropic";
|
|
1175
|
+
}>>>;
|
|
1176
|
+
baseUrl: z.ZodOptional<z.ZodString>;
|
|
1177
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1178
|
+
}, z.core.$strip>>;
|
|
1132
1179
|
status: z.ZodEnum<{
|
|
1133
1180
|
error: "error";
|
|
1134
1181
|
running: "running";
|
|
@@ -1405,10 +1452,12 @@ declare class AgentManager {
|
|
|
1405
1452
|
created: boolean;
|
|
1406
1453
|
}>;
|
|
1407
1454
|
/**
|
|
1408
|
-
* Start an agent — launch the backend process.
|
|
1409
|
-
*
|
|
1455
|
+
* Start an agent — launch the backend process via ACP.
|
|
1456
|
+
* Requires the backend to support "acp" mode.
|
|
1457
|
+
* For acpOwnsProcess backends, ProcessLauncher is skipped.
|
|
1410
1458
|
* @throws {AgentNotFoundError} if agent is not in cache
|
|
1411
1459
|
* @throws {AgentAlreadyRunningError} if agent is already running
|
|
1460
|
+
* @throws {Error} if backend does not support "acp" mode
|
|
1412
1461
|
*/
|
|
1413
1462
|
startAgent(name: string): Promise<void>;
|
|
1414
1463
|
/**
|
|
@@ -1431,6 +1480,15 @@ declare class AgentManager {
|
|
|
1431
1480
|
* If the agent doesn't exist but templateName is provided, auto-creates it.
|
|
1432
1481
|
*/
|
|
1433
1482
|
resolveAgent(name: string, templateName?: string, overrides?: Partial<InstanceOverrides>): Promise<ResolveResult>;
|
|
1483
|
+
/**
|
|
1484
|
+
* Open an agent's native TUI/UI (e.g. `cursor <dir>`).
|
|
1485
|
+
* Requires the backend to support "open" mode.
|
|
1486
|
+
* @throws if backend does not support "open" mode
|
|
1487
|
+
*/
|
|
1488
|
+
openAgent(name: string): Promise<{
|
|
1489
|
+
command: string;
|
|
1490
|
+
args: string[];
|
|
1491
|
+
}>;
|
|
1434
1492
|
/**
|
|
1435
1493
|
* Register an externally-spawned process with the manager.
|
|
1436
1494
|
* Sets processOwnership to "external" and registers ProcessWatcher monitoring.
|
|
@@ -1454,9 +1512,10 @@ declare class AgentManager {
|
|
|
1454
1512
|
runPrompt(name: string, prompt: string, options?: RunPromptOptions): Promise<PromptResult>;
|
|
1455
1513
|
/**
|
|
1456
1514
|
* Send a prompt to an agent and stream the response.
|
|
1457
|
-
* Uses ACP connection if available, otherwise falls back to
|
|
1515
|
+
* Uses ACP connection if available, otherwise falls back to communicator.
|
|
1458
1516
|
*/
|
|
1459
1517
|
streamPrompt(name: string, prompt: string, options?: RunPromptOptions): AsyncIterable<StreamChunk>;
|
|
1518
|
+
private streamFromAcp;
|
|
1460
1519
|
/**
|
|
1461
1520
|
* Send a message to a running agent via its ACP session.
|
|
1462
1521
|
* Unlike runPrompt, this requires the agent to be started with ACP.
|
|
@@ -1603,13 +1662,51 @@ interface ResolvedBackend {
|
|
|
1603
1662
|
command: string;
|
|
1604
1663
|
args: string[];
|
|
1605
1664
|
}
|
|
1606
|
-
/**
|
|
1665
|
+
/**
|
|
1666
|
+
* Whether a backend type supports the ACP protocol for Actant-managed control.
|
|
1667
|
+
* Replaces the old hardcoded `isAcpBackend()`.
|
|
1668
|
+
*/
|
|
1607
1669
|
declare function isAcpBackend(backendType: AgentBackendType): boolean;
|
|
1608
1670
|
/**
|
|
1609
|
-
*
|
|
1610
|
-
*
|
|
1671
|
+
* Whether a backend's ACP connection owns the process lifecycle.
|
|
1672
|
+
* When true, ProcessLauncher.launch() is skipped — only AcpConnectionManager spawns the process.
|
|
1673
|
+
*/
|
|
1674
|
+
declare function isAcpOnlyBackend(backendType: AgentBackendType): boolean;
|
|
1675
|
+
/**
|
|
1676
|
+
* Resolve the executable command and arguments for spawning a backend (resolve mode).
|
|
1677
|
+
* @throws if the backend does not support "resolve" mode.
|
|
1611
1678
|
*/
|
|
1612
1679
|
declare function resolveBackend(backendType: AgentBackendType, workspaceDir: string, backendConfig?: Record<string, unknown>): ResolvedBackend;
|
|
1680
|
+
/**
|
|
1681
|
+
* Resolve the open command for directly launching a backend's native TUI/UI.
|
|
1682
|
+
* @throws if the backend does not support "open" mode.
|
|
1683
|
+
*/
|
|
1684
|
+
declare function openBackend(backendType: AgentBackendType, workspaceDir: string): ResolvedBackend;
|
|
1685
|
+
/**
|
|
1686
|
+
* Resolve the ACP spawn command for a backend.
|
|
1687
|
+
* For ACP backends, this returns the command used by AcpConnectionManager to spawn the agent process.
|
|
1688
|
+
* Checks acpCommand first, then falls back to resolveCommand.
|
|
1689
|
+
* @throws if the backend does not support "acp" mode.
|
|
1690
|
+
*/
|
|
1691
|
+
declare function resolveAcpBackend(backendType: AgentBackendType, workspaceDir: string, backendConfig?: Record<string, unknown>): ResolvedBackend;
|
|
1692
|
+
|
|
1693
|
+
/**
|
|
1694
|
+
* Register a backend descriptor.
|
|
1695
|
+
* Call at startup for built-in backends and from external packages (e.g. @actant/pi).
|
|
1696
|
+
*/
|
|
1697
|
+
declare function registerBackend(descriptor: BackendDescriptor): void;
|
|
1698
|
+
/**
|
|
1699
|
+
* Retrieve the descriptor for a backend type.
|
|
1700
|
+
* @throws if the type has not been registered.
|
|
1701
|
+
*/
|
|
1702
|
+
declare function getBackendDescriptor(type: AgentBackendType): BackendDescriptor;
|
|
1703
|
+
/** Check whether a backend supports a specific open mode. */
|
|
1704
|
+
declare function supportsMode(type: AgentBackendType, mode: AgentOpenMode): boolean;
|
|
1705
|
+
/**
|
|
1706
|
+
* Assert that a backend supports a mode, throwing a descriptive error if not.
|
|
1707
|
+
* Used as a guard in manager methods before executing mode-specific logic.
|
|
1708
|
+
*/
|
|
1709
|
+
declare function requireMode(type: AgentBackendType, mode: AgentOpenMode): void;
|
|
1613
1710
|
|
|
1614
1711
|
/**
|
|
1615
1712
|
* Check whether a process with the given PID is still alive.
|
|
@@ -1679,7 +1776,14 @@ declare class CursorCommunicator implements AgentCommunicator {
|
|
|
1679
1776
|
streamPrompt(_workspaceDir: string, _prompt: string, _options?: RunPromptOptions): AsyncIterable<StreamChunk>;
|
|
1680
1777
|
}
|
|
1681
1778
|
|
|
1682
|
-
|
|
1779
|
+
/**
|
|
1780
|
+
* Register a communicator factory for a backend type.
|
|
1781
|
+
* External packages (e.g. @actant/pi) call this at startup.
|
|
1782
|
+
* The factory receives the template's `backend.config` so it can extract
|
|
1783
|
+
* provider-specific settings (provider, model, apiKey, etc.).
|
|
1784
|
+
*/
|
|
1785
|
+
declare function registerCommunicator(backendType: AgentBackendType, factory: (backendConfig?: Record<string, unknown>) => AgentCommunicator): void;
|
|
1786
|
+
declare function createCommunicator(backendType: AgentBackendType, backendConfig?: Record<string, unknown>): AgentCommunicator;
|
|
1683
1787
|
|
|
1684
1788
|
declare function resolvePermissions(input: PermissionsInput | undefined): PermissionsConfig;
|
|
1685
1789
|
declare function resolvePermissionsWithMcp(input: PermissionsInput | undefined, mcpServerNames: string[]): PermissionsConfig;
|
|
@@ -1859,6 +1963,8 @@ interface ComponentSource {
|
|
|
1859
1963
|
readonly type: string;
|
|
1860
1964
|
readonly packageName: string;
|
|
1861
1965
|
readonly config: SourceConfig;
|
|
1966
|
+
/** Filesystem root directory for this source's content. */
|
|
1967
|
+
getRootDir(): string;
|
|
1862
1968
|
fetch(): Promise<FetchResult>;
|
|
1863
1969
|
sync(): Promise<FetchResult>;
|
|
1864
1970
|
dispose(): Promise<void>;
|
|
@@ -1874,6 +1980,7 @@ declare class GitHubSource implements ComponentSource {
|
|
|
1874
1980
|
readonly config: GitHubSourceConfig;
|
|
1875
1981
|
private readonly cacheDir;
|
|
1876
1982
|
constructor(packageName: string, config: GitHubSourceConfig, cacheDir: string);
|
|
1983
|
+
getRootDir(): string;
|
|
1877
1984
|
fetch(): Promise<FetchResult>;
|
|
1878
1985
|
sync(): Promise<FetchResult>;
|
|
1879
1986
|
dispose(): Promise<void>;
|
|
@@ -1887,6 +1994,7 @@ declare class LocalSource implements ComponentSource {
|
|
|
1887
1994
|
readonly packageName: string;
|
|
1888
1995
|
readonly config: LocalSourceConfig;
|
|
1889
1996
|
constructor(packageName: string, config: LocalSourceConfig);
|
|
1997
|
+
getRootDir(): string;
|
|
1890
1998
|
fetch(): Promise<FetchResult>;
|
|
1891
1999
|
sync(): Promise<FetchResult>;
|
|
1892
2000
|
dispose(): Promise<void>;
|
|
@@ -1925,6 +2033,10 @@ interface SourceManagerDeps {
|
|
|
1925
2033
|
* Manages component sources (GitHub repos, local dirs, etc.).
|
|
1926
2034
|
* Syncs remote components into the domain managers with `package@name` namespacing.
|
|
1927
2035
|
*/
|
|
2036
|
+
interface SourceManagerOptions {
|
|
2037
|
+
/** Skip auto-registration of the default actant-hub source (useful for tests). */
|
|
2038
|
+
skipDefaultSource?: boolean;
|
|
2039
|
+
}
|
|
1928
2040
|
declare class SourceManager {
|
|
1929
2041
|
private readonly sources;
|
|
1930
2042
|
private readonly presets;
|
|
@@ -1932,7 +2044,8 @@ declare class SourceManager {
|
|
|
1932
2044
|
private readonly homeDir;
|
|
1933
2045
|
private readonly sourcesFilePath;
|
|
1934
2046
|
private readonly cacheDir;
|
|
1935
|
-
|
|
2047
|
+
private readonly skipDefaultSource;
|
|
2048
|
+
constructor(homeDir: string, managers: SourceManagerDeps, options?: SourceManagerOptions);
|
|
1936
2049
|
addSource(name: string, config: SourceConfig): Promise<FetchResult>;
|
|
1937
2050
|
syncSource(name: string): Promise<FetchResult>;
|
|
1938
2051
|
syncSourceWithReport(name: string): Promise<{
|
|
@@ -1946,6 +2059,8 @@ declare class SourceManager {
|
|
|
1946
2059
|
removeSource(name: string): Promise<boolean>;
|
|
1947
2060
|
listSources(): SourceEntry[];
|
|
1948
2061
|
hasSource(name: string): boolean;
|
|
2062
|
+
/** Resolve a registered source name to its filesystem root directory. */
|
|
2063
|
+
getSourceRootDir(name: string): string;
|
|
1949
2064
|
listPresets(packageName?: string): PresetDefinition[];
|
|
1950
2065
|
getPreset(qualifiedName: string): PresetDefinition | undefined;
|
|
1951
2066
|
/**
|
|
@@ -1955,6 +2070,11 @@ declare class SourceManager {
|
|
|
1955
2070
|
*/
|
|
1956
2071
|
applyPreset(qualifiedName: string, template: AgentTemplate): AgentTemplate;
|
|
1957
2072
|
initialize(): Promise<void>;
|
|
2073
|
+
/**
|
|
2074
|
+
* Registers the official actant-hub as the default source if not already present.
|
|
2075
|
+
* Fails silently when offline or the repo is unreachable.
|
|
2076
|
+
*/
|
|
2077
|
+
private ensureDefaultSource;
|
|
1958
2078
|
private createSource;
|
|
1959
2079
|
private injectComponents;
|
|
1960
2080
|
private removeNamespacedComponents;
|
|
@@ -1965,4 +2085,83 @@ declare class SourceManager {
|
|
|
1965
2085
|
private buildSyncReport;
|
|
1966
2086
|
}
|
|
1967
2087
|
|
|
1968
|
-
|
|
2088
|
+
interface SourceValidationIssue {
|
|
2089
|
+
severity: "error" | "warning" | "info";
|
|
2090
|
+
path: string;
|
|
2091
|
+
component?: string;
|
|
2092
|
+
message: string;
|
|
2093
|
+
code?: string;
|
|
2094
|
+
}
|
|
2095
|
+
interface SourceValidationReport {
|
|
2096
|
+
valid: boolean;
|
|
2097
|
+
sourceName: string;
|
|
2098
|
+
rootDir: string;
|
|
2099
|
+
summary: {
|
|
2100
|
+
pass: number;
|
|
2101
|
+
warn: number;
|
|
2102
|
+
error: number;
|
|
2103
|
+
};
|
|
2104
|
+
issues: SourceValidationIssue[];
|
|
2105
|
+
}
|
|
2106
|
+
type CompatMode = "agent-skills";
|
|
2107
|
+
interface ValidateOptions {
|
|
2108
|
+
strict?: boolean;
|
|
2109
|
+
/** Enable compatibility checks against an external standard. */
|
|
2110
|
+
compat?: CompatMode;
|
|
2111
|
+
}
|
|
2112
|
+
declare class SourceValidator {
|
|
2113
|
+
/**
|
|
2114
|
+
* Validate all assets in a source directory.
|
|
2115
|
+
* Returns a report with pass/warn/error counts and detailed issues.
|
|
2116
|
+
*/
|
|
2117
|
+
validate(rootDir: string, options?: ValidateOptions): Promise<SourceValidationReport>;
|
|
2118
|
+
private validateManifest;
|
|
2119
|
+
private verifyManifestFileRefs;
|
|
2120
|
+
private validateExplicitFiles;
|
|
2121
|
+
private validateComponentDirs;
|
|
2122
|
+
private scanDirectory;
|
|
2123
|
+
private validateSingleFile;
|
|
2124
|
+
private validateTemplateComponent;
|
|
2125
|
+
private validateSkillMd;
|
|
2126
|
+
private validateAgentSkillsCompat;
|
|
2127
|
+
private validateSkillDirConventions;
|
|
2128
|
+
private validatePresetReferences;
|
|
2129
|
+
private trackComponentName;
|
|
2130
|
+
}
|
|
2131
|
+
|
|
2132
|
+
/**
|
|
2133
|
+
* Registry for model provider descriptors.
|
|
2134
|
+
*
|
|
2135
|
+
* Sources (registered at startup in this order):
|
|
2136
|
+
* 1. Built-in providers (anthropic, openai, deepseek, ...)
|
|
2137
|
+
* 2. Default provider from config.json `provider` field
|
|
2138
|
+
* 3. User-registered providers from config.json `providers` field
|
|
2139
|
+
*
|
|
2140
|
+
* Consumers:
|
|
2141
|
+
* - Zod schema validation (warning for unknown types)
|
|
2142
|
+
* - CLI setup wizard (dynamic provider list)
|
|
2143
|
+
* - AgentInitializer (resolve default when template omits provider)
|
|
2144
|
+
* - AgentManager (resolve provider → env vars for ACP)
|
|
2145
|
+
*/
|
|
2146
|
+
declare class ModelProviderRegistry {
|
|
2147
|
+
private readonly descriptors;
|
|
2148
|
+
private defaultType;
|
|
2149
|
+
register(descriptor: ModelProviderDescriptor): void;
|
|
2150
|
+
get(type: string): ModelProviderDescriptor | undefined;
|
|
2151
|
+
getOrThrow(type: string): ModelProviderDescriptor;
|
|
2152
|
+
has(type: string): boolean;
|
|
2153
|
+
list(): ModelProviderDescriptor[];
|
|
2154
|
+
setDefault(type: string): void;
|
|
2155
|
+
getDefault(): ModelProviderDescriptor | undefined;
|
|
2156
|
+
getDefaultType(): string | undefined;
|
|
2157
|
+
/** @internal Test-only: clear all registrations. */
|
|
2158
|
+
_reset(): void;
|
|
2159
|
+
}
|
|
2160
|
+
/** Singleton instance used throughout the application. */
|
|
2161
|
+
declare const modelProviderRegistry: ModelProviderRegistry;
|
|
2162
|
+
|
|
2163
|
+
declare const BUILTIN_PROVIDERS: readonly ModelProviderDescriptor[];
|
|
2164
|
+
/** Register all built-in providers into the singleton registry. */
|
|
2165
|
+
declare function registerBuiltinProviders(): void;
|
|
2166
|
+
|
|
2167
|
+
export { AgentBackendSchema, type AgentCommunicator, AgentInitializer, AgentInstanceMetaSchema, type AgentLauncher, AgentManager, type AgentProcess, AgentStatusSchema, type AgentTask, type AgentTemplateInput, type AgentTemplateOutput, AgentTemplateSchema, type AuditEntry, BUILTIN_PROVIDERS, type BackendBuilder, 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, getLaunchModeHandler, globMatch, isAcpBackend, isAcpOnlyBackend, isProcessAlive, metaFilePath, modelProviderRegistry, openBackend, readInstanceMeta, registerBackend, registerBuiltinProviders, registerCommunicator, requireMode, resolveAcpBackend, resolveBackend, resolvePermissions, resolvePermissionsWithMcp, scanInstances, supportsMode, toAgentTemplate, updateInstanceMeta, validateBackendConfig, validateDomainContextConfig, validatePermissionsConfig, validateProviderConfig, validateScheduleConfig, validateTemplate, writeInstanceMeta };
|