dot-agents 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +238 -0
- package/dist/cli/commands/daemon.d.ts +3 -0
- package/dist/cli/commands/daemon.d.ts.map +1 -0
- package/dist/cli/commands/daemon.js +179 -0
- package/dist/cli/commands/daemon.js.map +1 -0
- package/dist/cli/commands/index.d.ts +6 -0
- package/dist/cli/commands/index.d.ts.map +1 -0
- package/dist/cli/commands/index.js +6 -0
- package/dist/cli/commands/index.js.map +1 -0
- package/dist/cli/commands/list.d.ts +3 -0
- package/dist/cli/commands/list.d.ts.map +1 -0
- package/dist/cli/commands/list.js +100 -0
- package/dist/cli/commands/list.js.map +1 -0
- package/dist/cli/commands/run.d.ts +3 -0
- package/dist/cli/commands/run.d.ts.map +1 -0
- package/dist/cli/commands/run.js +107 -0
- package/dist/cli/commands/run.js.map +1 -0
- package/dist/cli/commands/schedule.d.ts +3 -0
- package/dist/cli/commands/schedule.d.ts.map +1 -0
- package/dist/cli/commands/schedule.js +172 -0
- package/dist/cli/commands/schedule.js.map +1 -0
- package/dist/cli/commands/show.d.ts +3 -0
- package/dist/cli/commands/show.d.ts.map +1 -0
- package/dist/cli/commands/show.js +122 -0
- package/dist/cli/commands/show.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +38 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/lib/index.d.ts +2 -0
- package/dist/cli/lib/index.d.ts.map +1 -0
- package/dist/cli/lib/index.js +2 -0
- package/dist/cli/lib/index.js.map +1 -0
- package/dist/cli/lib/runner.d.ts +41 -0
- package/dist/cli/lib/runner.d.ts.map +1 -0
- package/dist/cli/lib/runner.js +179 -0
- package/dist/cli/lib/runner.js.map +1 -0
- package/dist/daemon/api/index.d.ts +2 -0
- package/dist/daemon/api/index.d.ts.map +1 -0
- package/dist/daemon/api/index.js +2 -0
- package/dist/daemon/api/index.js.map +1 -0
- package/dist/daemon/api/server.d.ts +12 -0
- package/dist/daemon/api/server.d.ts.map +1 -0
- package/dist/daemon/api/server.js +111 -0
- package/dist/daemon/api/server.js.map +1 -0
- package/dist/daemon/daemon.d.ts +95 -0
- package/dist/daemon/daemon.d.ts.map +1 -0
- package/dist/daemon/daemon.js +265 -0
- package/dist/daemon/daemon.js.map +1 -0
- package/dist/daemon/index.d.ts +4 -0
- package/dist/daemon/index.d.ts.map +1 -0
- package/dist/daemon/index.js +4 -0
- package/dist/daemon/index.js.map +1 -0
- package/dist/daemon/lib/executor.d.ts +17 -0
- package/dist/daemon/lib/executor.d.ts.map +1 -0
- package/dist/daemon/lib/executor.js +169 -0
- package/dist/daemon/lib/executor.js.map +1 -0
- package/dist/daemon/lib/index.d.ts +4 -0
- package/dist/daemon/lib/index.d.ts.map +1 -0
- package/dist/daemon/lib/index.js +4 -0
- package/dist/daemon/lib/index.js.map +1 -0
- package/dist/daemon/lib/scheduler.d.ts +90 -0
- package/dist/daemon/lib/scheduler.d.ts.map +1 -0
- package/dist/daemon/lib/scheduler.js +176 -0
- package/dist/daemon/lib/scheduler.js.map +1 -0
- package/dist/daemon/lib/watcher.d.ts +48 -0
- package/dist/daemon/lib/watcher.d.ts.map +1 -0
- package/dist/daemon/lib/watcher.js +77 -0
- package/dist/daemon/lib/watcher.js.map +1 -0
- package/dist/lib/config.d.ts +14 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +76 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/frontmatter.d.ts +18 -0
- package/dist/lib/frontmatter.d.ts.map +1 -0
- package/dist/lib/frontmatter.js +26 -0
- package/dist/lib/frontmatter.js.map +1 -0
- package/dist/lib/index.d.ts +7 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +9 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/persona.d.ts +32 -0
- package/dist/lib/persona.d.ts.map +1 -0
- package/dist/lib/persona.js +177 -0
- package/dist/lib/persona.js.map +1 -0
- package/dist/lib/types/index.d.ts +69 -0
- package/dist/lib/types/index.d.ts.map +1 -0
- package/dist/lib/types/index.js +4 -0
- package/dist/lib/types/index.js.map +1 -0
- package/dist/lib/types/persona.d.ts +46 -0
- package/dist/lib/types/persona.d.ts.map +1 -0
- package/dist/lib/types/persona.js +2 -0
- package/dist/lib/types/persona.js.map +1 -0
- package/dist/lib/types/triggers.d.ts +96 -0
- package/dist/lib/types/triggers.d.ts.map +1 -0
- package/dist/lib/types/triggers.js +2 -0
- package/dist/lib/types/triggers.js.map +1 -0
- package/dist/lib/types/workflow.d.ts +75 -0
- package/dist/lib/types/workflow.d.ts.map +1 -0
- package/dist/lib/types/workflow.js +2 -0
- package/dist/lib/types/workflow.js.map +1 -0
- package/dist/lib/variables.d.ts +28 -0
- package/dist/lib/variables.d.ts.map +1 -0
- package/dist/lib/variables.js +113 -0
- package/dist/lib/variables.js.map +1 -0
- package/dist/lib/workflow.d.ts +29 -0
- package/dist/lib/workflow.d.ts.map +1 -0
- package/dist/lib/workflow.js +155 -0
- package/dist/lib/workflow.js.map +1 -0
- package/package.json +71 -0
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { readdir, stat } from "node:fs/promises";
|
|
2
|
+
import { join, dirname, relative } from "node:path";
|
|
3
|
+
import { loadMarkdownFile } from "./frontmatter.js";
|
|
4
|
+
const PERSONA_FILENAME = "PERSONA.md";
|
|
5
|
+
/**
|
|
6
|
+
* Load a single persona file
|
|
7
|
+
*/
|
|
8
|
+
export async function loadPersona(personaPath) {
|
|
9
|
+
const filePath = personaPath.endsWith(PERSONA_FILENAME)
|
|
10
|
+
? personaPath
|
|
11
|
+
: join(personaPath, PERSONA_FILENAME);
|
|
12
|
+
const { frontmatter, body } = await loadMarkdownFile(filePath);
|
|
13
|
+
if (!frontmatter.name) {
|
|
14
|
+
throw new Error(`Persona missing required 'name' field: ${filePath}`);
|
|
15
|
+
}
|
|
16
|
+
// cmd is optional for child personas (inherited from parent)
|
|
17
|
+
return {
|
|
18
|
+
...frontmatter,
|
|
19
|
+
path: dirname(filePath),
|
|
20
|
+
prompt: body || undefined,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Build the inheritance chain for a persona path
|
|
25
|
+
* Returns paths from root to leaf (e.g., ["claude", "claude/autonomous"])
|
|
26
|
+
*/
|
|
27
|
+
export function buildInheritanceChain(personaPath, personasRoot) {
|
|
28
|
+
const relativePath = relative(personasRoot, personaPath);
|
|
29
|
+
const parts = relativePath.split("/").filter(Boolean);
|
|
30
|
+
const chain = [];
|
|
31
|
+
let currentPath = personasRoot;
|
|
32
|
+
for (const part of parts) {
|
|
33
|
+
currentPath = join(currentPath, part);
|
|
34
|
+
chain.push(currentPath);
|
|
35
|
+
}
|
|
36
|
+
return chain;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Check if a directory contains a PERSONA.md file
|
|
40
|
+
*/
|
|
41
|
+
async function hasPersonaFile(dirPath) {
|
|
42
|
+
try {
|
|
43
|
+
const filePath = join(dirPath, PERSONA_FILENAME);
|
|
44
|
+
const stats = await stat(filePath);
|
|
45
|
+
return stats.isFile();
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Merge arrays with gitignore-style negation support
|
|
53
|
+
* Items prefixed with ! remove matching items from the array
|
|
54
|
+
*/
|
|
55
|
+
export function mergeArraysWithNegation(parent, child) {
|
|
56
|
+
const result = [...parent];
|
|
57
|
+
for (const item of child) {
|
|
58
|
+
if (item.startsWith("!")) {
|
|
59
|
+
// Remove items matching the negation pattern
|
|
60
|
+
const pattern = item.slice(1);
|
|
61
|
+
const index = result.indexOf(pattern);
|
|
62
|
+
if (index !== -1) {
|
|
63
|
+
result.splice(index, 1);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
else if (!result.includes(item)) {
|
|
67
|
+
// Add new items
|
|
68
|
+
result.push(item);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return result;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Deep merge two objects (child overrides parent)
|
|
75
|
+
*/
|
|
76
|
+
export function deepMerge(parent, child) {
|
|
77
|
+
const result = { ...parent };
|
|
78
|
+
for (const key of Object.keys(child)) {
|
|
79
|
+
const childValue = child[key];
|
|
80
|
+
const parentValue = parent[key];
|
|
81
|
+
if (childValue !== undefined &&
|
|
82
|
+
typeof childValue === "object" &&
|
|
83
|
+
childValue !== null &&
|
|
84
|
+
!Array.isArray(childValue) &&
|
|
85
|
+
typeof parentValue === "object" &&
|
|
86
|
+
parentValue !== null &&
|
|
87
|
+
!Array.isArray(parentValue)) {
|
|
88
|
+
// Recursively merge objects
|
|
89
|
+
result[key] = deepMerge(parentValue, childValue);
|
|
90
|
+
}
|
|
91
|
+
else if (childValue !== undefined) {
|
|
92
|
+
// Child overrides parent
|
|
93
|
+
result[key] = childValue;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return result;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Merge two personas (child inherits from parent)
|
|
100
|
+
*/
|
|
101
|
+
export function mergePersonas(parent, child) {
|
|
102
|
+
return {
|
|
103
|
+
// Scalars: child overrides
|
|
104
|
+
name: child.name,
|
|
105
|
+
description: child.description ?? parent.description,
|
|
106
|
+
cmd: child.cmd ?? parent.cmd, // inherit cmd if not specified
|
|
107
|
+
path: child.path,
|
|
108
|
+
parent: parent.path,
|
|
109
|
+
// Objects: deep merge
|
|
110
|
+
env: deepMerge(parent.env ?? {}, child.env ?? {}),
|
|
111
|
+
// Arrays: merge with negation
|
|
112
|
+
skills: mergeArraysWithNegation(parent.skills ?? [], child.skills ?? []),
|
|
113
|
+
// Prompt: child replaces entirely if present
|
|
114
|
+
prompt: child.prompt ?? parent.prompt,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Resolve a persona with full inheritance chain
|
|
119
|
+
*/
|
|
120
|
+
export async function resolvePersona(personaPath, personasRoot) {
|
|
121
|
+
const chain = buildInheritanceChain(personaPath, personasRoot);
|
|
122
|
+
const inheritanceChain = [];
|
|
123
|
+
let resolved = null;
|
|
124
|
+
for (const path of chain) {
|
|
125
|
+
if (await hasPersonaFile(path)) {
|
|
126
|
+
const persona = await loadPersona(path);
|
|
127
|
+
inheritanceChain.push(path);
|
|
128
|
+
if (resolved === null) {
|
|
129
|
+
resolved = persona;
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
resolved = mergePersonas(resolved, persona);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
if (resolved === null) {
|
|
137
|
+
throw new Error(`No persona found at path: ${personaPath}`);
|
|
138
|
+
}
|
|
139
|
+
// Normalize cmd to array
|
|
140
|
+
const cmd = Array.isArray(resolved.cmd) ? resolved.cmd : [resolved.cmd];
|
|
141
|
+
return {
|
|
142
|
+
name: resolved.name,
|
|
143
|
+
description: resolved.description,
|
|
144
|
+
cmd,
|
|
145
|
+
env: resolved.env ?? {},
|
|
146
|
+
skills: resolved.skills ?? [],
|
|
147
|
+
prompt: resolved.prompt,
|
|
148
|
+
path: resolved.path,
|
|
149
|
+
inheritanceChain,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* List all personas in a directory (recursive)
|
|
154
|
+
*/
|
|
155
|
+
export async function listPersonas(personasRoot) {
|
|
156
|
+
const personas = [];
|
|
157
|
+
async function scanDir(dir) {
|
|
158
|
+
try {
|
|
159
|
+
const entries = await readdir(dir, { withFileTypes: true });
|
|
160
|
+
for (const entry of entries) {
|
|
161
|
+
if (entry.isDirectory()) {
|
|
162
|
+
const subDir = join(dir, entry.name);
|
|
163
|
+
if (await hasPersonaFile(subDir)) {
|
|
164
|
+
personas.push(subDir);
|
|
165
|
+
}
|
|
166
|
+
await scanDir(subDir);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
catch {
|
|
171
|
+
// Directory doesn't exist or not readable
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
await scanDir(personasRoot);
|
|
175
|
+
return personas;
|
|
176
|
+
}
|
|
177
|
+
//# sourceMappingURL=persona.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persona.js","sourceRoot":"","sources":["../../src/lib/persona.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAY,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAOpD,MAAM,gBAAgB,GAAG,YAAY,CAAC;AAEtC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,WAAmB;IACnD,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,gBAAgB,CAAC;QACrD,CAAC,CAAC,WAAW;QACb,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC;IAExC,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,MAAM,gBAAgB,CAClD,QAAQ,CACT,CAAC;IAEF,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,0CAA0C,QAAQ,EAAE,CAAC,CAAC;IACxE,CAAC;IAED,6DAA6D;IAE7D,OAAO;QACL,GAAG,WAAW;QACd,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC;QACvB,MAAM,EAAE,IAAI,IAAI,SAAS;KAC1B,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CACnC,WAAmB,EACnB,YAAoB;IAEpB,MAAM,YAAY,GAAG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AC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export * from "./persona.js";
|
|
2
|
+
export * from "./workflow.js";
|
|
3
|
+
export * from "./triggers.js";
|
|
4
|
+
/**
|
|
5
|
+
* Execution context for variable expansion
|
|
6
|
+
*/
|
|
7
|
+
export interface ExecutionContext {
|
|
8
|
+
/** Current date (YYYY-MM-DD) */
|
|
9
|
+
DATE: string;
|
|
10
|
+
/** Current datetime (ISO 8601) */
|
|
11
|
+
DATETIME: string;
|
|
12
|
+
/** Current time (HH:MM:SS) */
|
|
13
|
+
TIME: string;
|
|
14
|
+
/** Unique run identifier */
|
|
15
|
+
RUN_ID: string;
|
|
16
|
+
/** Workflow name (if running a workflow) */
|
|
17
|
+
WORKFLOW_NAME?: string;
|
|
18
|
+
/** Path to workflow directory */
|
|
19
|
+
WORKFLOW_DIR?: string;
|
|
20
|
+
/** Resolved persona name */
|
|
21
|
+
PERSONA_NAME?: string;
|
|
22
|
+
/** Path to persona directory */
|
|
23
|
+
PERSONA_DIR?: string;
|
|
24
|
+
/** Path to .agents root */
|
|
25
|
+
AGENTS_DIR?: string;
|
|
26
|
+
/** Additional context variables */
|
|
27
|
+
[key: string]: string | undefined;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Result of a workflow execution
|
|
31
|
+
*/
|
|
32
|
+
export interface ExecutionResult {
|
|
33
|
+
/** Whether execution succeeded */
|
|
34
|
+
success: boolean;
|
|
35
|
+
/** Exit code from agent process */
|
|
36
|
+
exitCode: number;
|
|
37
|
+
/** Standard output */
|
|
38
|
+
stdout: string;
|
|
39
|
+
/** Standard error */
|
|
40
|
+
stderr: string;
|
|
41
|
+
/** Execution duration in milliseconds */
|
|
42
|
+
duration: number;
|
|
43
|
+
/** Unique run identifier */
|
|
44
|
+
runId: string;
|
|
45
|
+
/** Start timestamp */
|
|
46
|
+
startedAt: Date;
|
|
47
|
+
/** End timestamp */
|
|
48
|
+
endedAt: Date;
|
|
49
|
+
/** Output files that were created */
|
|
50
|
+
outputs?: string[];
|
|
51
|
+
/** Error message if failed */
|
|
52
|
+
error?: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Configuration for the dot-agents framework
|
|
56
|
+
*/
|
|
57
|
+
export interface DotAgentsConfig {
|
|
58
|
+
/** Root directory for .agents */
|
|
59
|
+
agentsDir: string;
|
|
60
|
+
/** Directory for personas */
|
|
61
|
+
personasDir: string;
|
|
62
|
+
/** Directory for workflows */
|
|
63
|
+
workflowsDir: string;
|
|
64
|
+
/** Directory for skills */
|
|
65
|
+
skillsDir: string;
|
|
66
|
+
/** Directory for session logs and runtime state */
|
|
67
|
+
sessionsDir: string;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAE9B;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iCAAiC;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4BAA4B;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gCAAgC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2BAA2B;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mCAAmC;IACnC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,kCAAkC;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,sBAAsB;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,qBAAqB;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,sBAAsB;IACtB,SAAS,EAAE,IAAI,CAAC;IAChB,oBAAoB;IACpB,OAAO,EAAE,IAAI,CAAC;IACd,qCAAqC;IACrC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,iCAAiC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,6BAA6B;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,8BAA8B;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,2BAA2B;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,mDAAmD;IACnD,WAAW,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Persona configuration - defines how to invoke an agent
|
|
3
|
+
*/
|
|
4
|
+
export interface PersonaFrontmatter {
|
|
5
|
+
/** Unique identifier for this persona */
|
|
6
|
+
name: string;
|
|
7
|
+
/** Human-readable description */
|
|
8
|
+
description?: string;
|
|
9
|
+
/** Agent invocation command(s) - tried in order as fallbacks */
|
|
10
|
+
cmd: string | string[];
|
|
11
|
+
/** Environment variables (supports ${VAR} expansion) */
|
|
12
|
+
env?: Record<string, string>;
|
|
13
|
+
/** Enabled skills - glob patterns, use ! for negation */
|
|
14
|
+
skills?: string[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Parsed persona including frontmatter and body content
|
|
18
|
+
*/
|
|
19
|
+
export interface Persona extends PersonaFrontmatter {
|
|
20
|
+
/** Path to the persona directory */
|
|
21
|
+
path: string;
|
|
22
|
+
/** System prompt from markdown body (supports ${VAR} expansion) */
|
|
23
|
+
prompt?: string;
|
|
24
|
+
/** Parent persona path if this is a child (for tracking) */
|
|
25
|
+
parent?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Resolved persona with all inheritance applied and arrays merged
|
|
29
|
+
*/
|
|
30
|
+
export interface ResolvedPersona {
|
|
31
|
+
name: string;
|
|
32
|
+
description?: string;
|
|
33
|
+
/** Resolved command list */
|
|
34
|
+
cmd: string[];
|
|
35
|
+
/** Merged environment variables */
|
|
36
|
+
env: Record<string, string>;
|
|
37
|
+
/** Merged and filtered skills (negations applied) */
|
|
38
|
+
skills: string[];
|
|
39
|
+
/** Combined system prompt */
|
|
40
|
+
prompt?: string;
|
|
41
|
+
/** Full path to persona */
|
|
42
|
+
path: string;
|
|
43
|
+
/** Inheritance chain (root to leaf) */
|
|
44
|
+
inheritanceChain: string[];
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=persona.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persona.d.ts","sourceRoot":"","sources":["../../../src/lib/types/persona.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gEAAgE;IAChE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACvB,wDAAwD;IACxD,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,yDAAyD;IACzD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,OAAQ,SAAQ,kBAAkB;IACjD,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4BAA4B;IAC5B,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,mCAAmC;IACnC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,qDAAqD;IACrD,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,6BAA6B;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,uCAAuC;IACvC,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persona.js","sourceRoot":"","sources":["../../../src/lib/types/persona.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trigger-specific input overrides
|
|
3
|
+
*/
|
|
4
|
+
export interface TriggerInputOverride {
|
|
5
|
+
[inputName: string]: string | number | boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Schedule trigger - cron-based execution
|
|
9
|
+
*/
|
|
10
|
+
export interface ScheduleTrigger {
|
|
11
|
+
/** Cron expression (e.g., "0 9 * * 1-5") */
|
|
12
|
+
cron: string;
|
|
13
|
+
/** Optional input overrides for this schedule */
|
|
14
|
+
inputs?: TriggerInputOverride;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Manual trigger configuration (equivalent to workflow_dispatch)
|
|
18
|
+
*/
|
|
19
|
+
export interface ManualTrigger {
|
|
20
|
+
/** Additional inputs specific to manual invocation */
|
|
21
|
+
inputs?: Record<string, {
|
|
22
|
+
description?: string;
|
|
23
|
+
default?: string | number | boolean;
|
|
24
|
+
required?: boolean;
|
|
25
|
+
}>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* File change trigger - watch for filesystem changes
|
|
29
|
+
*/
|
|
30
|
+
export interface FileChangeTrigger {
|
|
31
|
+
/** Glob patterns to watch (supports ! negation) */
|
|
32
|
+
paths: string[];
|
|
33
|
+
/** Event types to trigger on */
|
|
34
|
+
events?: ("modify" | "create" | "delete")[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Webhook trigger - HTTP endpoint
|
|
38
|
+
*/
|
|
39
|
+
export interface WebhookTrigger {
|
|
40
|
+
/** URL path for the webhook endpoint */
|
|
41
|
+
path: string;
|
|
42
|
+
/** Secret for validation (supports ${VAR} expansion) */
|
|
43
|
+
secret?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Workflow completion trigger - run after another workflow
|
|
47
|
+
*/
|
|
48
|
+
export interface WorkflowCompleteTrigger {
|
|
49
|
+
/** Name of workflow to watch */
|
|
50
|
+
workflow: string;
|
|
51
|
+
/** Status conditions to trigger on */
|
|
52
|
+
status?: ("success" | "failure" | "any")[];
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Git event trigger
|
|
56
|
+
*/
|
|
57
|
+
export interface GitTrigger {
|
|
58
|
+
/** Git events to trigger on */
|
|
59
|
+
events: ("post-commit" | "post-merge" | "pre-push")[];
|
|
60
|
+
/** Branch filter */
|
|
61
|
+
branches?: string[];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* GitHub event trigger
|
|
65
|
+
*/
|
|
66
|
+
export interface GitHubTrigger {
|
|
67
|
+
/** GitHub event types */
|
|
68
|
+
events: ("pull_request" | "issues" | "push" | "release")[];
|
|
69
|
+
/** Activity types within the event */
|
|
70
|
+
types?: string[];
|
|
71
|
+
/** Additional filters */
|
|
72
|
+
filters?: {
|
|
73
|
+
branches?: string[];
|
|
74
|
+
labels?: string[];
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* All workflow triggers
|
|
79
|
+
*/
|
|
80
|
+
export interface WorkflowTriggers {
|
|
81
|
+
/** Cron-based schedules */
|
|
82
|
+
schedule?: ScheduleTrigger[];
|
|
83
|
+
/** Manual/on-demand trigger */
|
|
84
|
+
manual?: boolean | ManualTrigger;
|
|
85
|
+
/** File system change trigger */
|
|
86
|
+
file_change?: FileChangeTrigger;
|
|
87
|
+
/** Webhook trigger */
|
|
88
|
+
webhook?: WebhookTrigger;
|
|
89
|
+
/** Workflow completion trigger */
|
|
90
|
+
workflow_complete?: WorkflowCompleteTrigger;
|
|
91
|
+
/** Git event trigger */
|
|
92
|
+
git?: GitTrigger;
|
|
93
|
+
/** GitHub event trigger */
|
|
94
|
+
github?: GitHubTrigger;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=triggers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triggers.d.ts","sourceRoot":"","sources":["../../../src/lib/types/triggers.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CAChD;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,MAAM,CAAC,EAAE,oBAAoB,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,sDAAsD;IACtD,MAAM,CAAC,EAAE,MAAM,CACb,MAAM,EACN;QACE,WAAW,CAA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AQ,CAAC,EAAE,eAAe,EAAE,CAAC;IAC7B,+BAA+B;IAC/B,MAAM,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC;IACjC,iCAAiC;IACjC,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,sBAAsB;IACtB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,kCAAkC;IAClC,iBAAiB,CAAC,EAAE,uBAAuB,CAAC;IAC5C,wBAAwB;IACxB,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB,2BAA2B;IAC3B,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triggers.js","sourceRoot":"","sources":["../../../src/lib/types/triggers.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { WorkflowTriggers } from "./triggers.js";
|
|
2
|
+
/**
|
|
3
|
+
* Workflow input parameter definition
|
|
4
|
+
*/
|
|
5
|
+
export interface WorkflowInput {
|
|
6
|
+
/** Parameter name (used as ${name} in templates) */
|
|
7
|
+
name: string;
|
|
8
|
+
/** Human-readable description */
|
|
9
|
+
description?: string;
|
|
10
|
+
/** Default value if not provided */
|
|
11
|
+
default?: string | number | boolean;
|
|
12
|
+
/** Whether this input is required */
|
|
13
|
+
required?: boolean;
|
|
14
|
+
/** Type hint for validation */
|
|
15
|
+
type?: "string" | "number" | "boolean" | "path";
|
|
16
|
+
/** Allowed values (for enum-like inputs) */
|
|
17
|
+
enum?: (string | number)[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Workflow output artifact definition
|
|
21
|
+
*/
|
|
22
|
+
export interface WorkflowOutput {
|
|
23
|
+
/** Output file path (supports ${VAR} expansion) */
|
|
24
|
+
path: string;
|
|
25
|
+
/** Description of this output */
|
|
26
|
+
description?: string;
|
|
27
|
+
/** Whether to fail if this output is not created */
|
|
28
|
+
required?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Retry policy for failed workflow executions
|
|
32
|
+
*/
|
|
33
|
+
export interface RetryPolicy {
|
|
34
|
+
/** Total number of attempts (including first) */
|
|
35
|
+
attempts: number;
|
|
36
|
+
/** Delay between attempts (e.g., "30s", "1m") */
|
|
37
|
+
delay: string;
|
|
38
|
+
/** Multiplier for exponential backoff */
|
|
39
|
+
backoff?: number;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Workflow frontmatter configuration
|
|
43
|
+
*/
|
|
44
|
+
export interface WorkflowFrontmatter {
|
|
45
|
+
/** Unique workflow identifier */
|
|
46
|
+
name: string;
|
|
47
|
+
/** Human-readable description */
|
|
48
|
+
description: string;
|
|
49
|
+
/** Persona path to use for execution (e.g., "claude/autonomous") */
|
|
50
|
+
persona: string;
|
|
51
|
+
/** Trigger configuration */
|
|
52
|
+
on?: WorkflowTriggers;
|
|
53
|
+
/** Input parameters */
|
|
54
|
+
inputs?: WorkflowInput[];
|
|
55
|
+
/** Expected output artifacts */
|
|
56
|
+
outputs?: WorkflowOutput[];
|
|
57
|
+
/** Workflow-specific environment variables */
|
|
58
|
+
env?: Record<string, string>;
|
|
59
|
+
/** Maximum execution time (e.g., "5m", "1h") */
|
|
60
|
+
timeout?: string;
|
|
61
|
+
/** Retry policy on failure */
|
|
62
|
+
retry?: RetryPolicy;
|
|
63
|
+
/** Working directory for execution */
|
|
64
|
+
working_dir?: string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Parsed workflow including frontmatter and body content
|
|
68
|
+
*/
|
|
69
|
+
export interface Workflow extends WorkflowFrontmatter {
|
|
70
|
+
/** Path to the workflow directory */
|
|
71
|
+
path: string;
|
|
72
|
+
/** Task/prompt content from markdown body */
|
|
73
|
+
task: string;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=workflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../../src/lib/types/workfl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A8C;IAC9C,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8BAA8B;IAC9B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,QAAS,SAAQ,mBAAmB;IACnD,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;CACd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow.js","sourceRoot":"","sources":["../../../src/lib/types/workflow.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ExecutionContext } from "./types/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Generate a unique run ID
|
|
4
|
+
*/
|
|
5
|
+
export declare function generateRunId(): string;
|
|
6
|
+
/**
|
|
7
|
+
* Create execution context with built-in variables
|
|
8
|
+
*/
|
|
9
|
+
export declare function createExecutionContext(overrides?: Partial<ExecutionContext>): ExecutionContext;
|
|
10
|
+
/**
|
|
11
|
+
* Expand environment variables in a string
|
|
12
|
+
* Supports ${VAR} syntax
|
|
13
|
+
*/
|
|
14
|
+
export declare function expandVariables(template: string, context: Record<string, string | undefined>, env?: Record<string, string | undefined>): string;
|
|
15
|
+
/**
|
|
16
|
+
* Expand variables in an object's string values (recursive)
|
|
17
|
+
*/
|
|
18
|
+
export declare function expandObjectVariables<T extends Record<string, unknown>>(obj: T, context: Record<string, string | undefined>, env?: Record<string, string | undefined>): T;
|
|
19
|
+
/**
|
|
20
|
+
* Process simple conditionals in a template
|
|
21
|
+
* Supports: {{#if var}}...{{/if}} and {{#unless var}}...{{/unless}}
|
|
22
|
+
*/
|
|
23
|
+
export declare function processConditionals(template: string, context: Record<string, unknown>): string;
|
|
24
|
+
/**
|
|
25
|
+
* Full template processing: conditionals then variable expansion
|
|
26
|
+
*/
|
|
27
|
+
export declare function processTemplate(template: string, context: Record<string, unknown>, env?: Record<string, string | undefined>): string;
|
|
28
|
+
//# sourceMappingURL=variables.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variables.d.ts","sourceRoot":"","sources":["../../src/lib/variables.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD;;GAEG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAItC;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,GAAE,OAAO,CAAC,gBAAgB,CAAM,GACxC,gBAAgB,CAUlB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,EAC3C,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAGrC,GACA,MAAM,CAYR;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrE,GAAG,EAAE,CAAC,EACN,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,EAC3C,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GACvC,CAAC,CA8BH;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,MAAM,CA0CR;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GACvC,MAAM,CAeR"}
|