@theihtisham/agent-shadow-brain 7.0.0 → 7.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/CHANGELOG.md +9 -0
- package/README.md +25 -3
- package/dist/brain/auto-update.js +1 -1
- package/dist/brain/brain-portability.js +1 -1
- package/dist/brain/mcp-server.d.ts +2 -0
- package/dist/brain/mcp-server.d.ts.map +1 -1
- package/dist/brain/mcp-server.js +39 -5
- package/dist/brain/mcp-server.js.map +1 -1
- package/dist/brain/orchestrator.js +1 -1
- package/dist/brain/task-workflow.d.ts +22 -0
- package/dist/brain/task-workflow.d.ts.map +1 -0
- package/dist/brain/task-workflow.js +182 -0
- package/dist/brain/task-workflow.js.map +1 -0
- package/dist/brain/workflow-skills.d.ts +86 -0
- package/dist/brain/workflow-skills.d.ts.map +1 -0
- package/dist/brain/workflow-skills.js +514 -0
- package/dist/brain/workflow-skills.js.map +1 -0
- package/dist/cli.js +3 -1
- package/dist/cli.js.map +1 -1
- package/dist/dashboard/server.js +1 -1
- package/dist/dashboard/v6-dashboard-html.d.ts +1 -1
- package/dist/dashboard/v6-dashboard-html.js +3 -3
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/workflow-cli.d.ts +3 -0
- package/dist/workflow-cli.d.ts.map +1 -0
- package/dist/workflow-cli.js +100 -0
- package/dist/workflow-cli.js.map +1 -0
- package/docs/WORKFLOW_INTEGRATION.md +105 -0
- package/docs/launch/RELEASE_NOTES_v7.1.0.md +32 -0
- package/package.json +213 -207
- package/skills/shadow-debug/SKILL.md +16 -0
- package/skills/shadow-implement/SKILL.md +16 -0
- package/skills/shadow-release/SKILL.md +16 -0
- package/skills/shadow-research/SKILL.md +12 -0
- package/skills/shadow-review/SKILL.md +14 -0
- package/skills/shadow-workflow/SKILL.md +31 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
const TRANSFORMATION = /^(?:(?:please|just)\s+)*(?:translate|rewrite|rephrase|summarize|summarise|proofread|format|capitalize|convert|shorten)\b/;
|
|
2
|
+
const SMALL_EDIT = /^(?:(?:please|just)\s+)*(?:fix|correct)\s+(?:this|the|a|one)\s+(?:typo|spelling|punctuation|grammar in (?:this|the) (?:sentence|text|paragraph))\b/;
|
|
3
|
+
const EXPLANATION = /^(?:(?:please|just)\s+)*(?:what (?:does|is|are|means?)|why does|how (?:does|do i|can i|to)|explain|define)\b/;
|
|
4
|
+
const ENGINEERING_SCOPE = /\b(?:api|backend|frontend|service|application|database|codebase|repository|entire project)\b/;
|
|
5
|
+
const DIAGNOSIS_ONLY = /\b(?:analy[sz]e|analysis|diagnose|diagnosis|investigate|inspection) only\b/;
|
|
6
|
+
const PLAN_ONLY = /\b(?:plan only|only plan|just plan|planning only|just (?:write|make|draft|give|provide)?\s*(?:me )?a plan|do not execute|don['’]t execute|without executing)\b/;
|
|
7
|
+
const ASK_FOR_PLAN = /^(?:(?:please|just)\s+)*(?:plan\b|outline\b|(?:make|create|draft|write|provide|give)\s+(?:me\s+)?(?:a\s+)?(?:\w+\s+){0,2}(?:plan|roadmap)\b)/;
|
|
8
|
+
const PLAN_THEN_EXECUTE = /\b(?:plan|outline)\b[^.!?\n]{0,120}(?:[.!?\n]\s*then|\b(?:then|and))\s+(?:(?:actually|also|then)\s+)?(?:implement|execute|fix|build|repair|apply|ship|deploy|publish)\b/;
|
|
9
|
+
const NO_EDITS = /\b(?:(?:do not|don['’]t|never|without|no)\s+(?:make\s+)?(?:chang(?:e|es|ing)|edit(?:s|ing)?|modify(?:ing)?|mutat(?:e|ion|ing)?|implement(?:ing)?|write|writing)|read[- ]only|leave (?:the files|everything) unchanged)\b/;
|
|
10
|
+
const REVIEW_REQUEST = /\b(?:review|audit|inspect|assess)\s+(?:this|the|my|our|these|a|an|changes|code|pr|pull request|patch|diff|repo(?:sitory)?|for)\b|^(?:please\s+)?(?:review|audit)\b/;
|
|
11
|
+
const RESEARCH_REQUEST = /\b(?:research|look up|find out|compare)\b|\b(?:which|what)\b[^.!?\n]{0,100}\b(?:current|latest|supports?|available|official)\b/;
|
|
12
|
+
const DEBUG_REQUEST = /\b(?:debug|diagnose|diagnosis|troubleshoot|reproduce|regression|broken|failing|fails|failure|crash(?:es|ing)?|error|bug|repair)\b/;
|
|
13
|
+
const DIAGNOSIS_REQUEST = /^(?:(?:please|just)\s+)*(?:diagnose|investigate|analy[sz]e|identify the cause|find out why)\b/;
|
|
14
|
+
const IMPLEMENT_REQUEST = /\b(?:build|implement|add|create|write|update|modify|refactor|integrate|migrate|migration|change|fix|edit|improve|rewrite|convert)\b/;
|
|
15
|
+
const RELEASE_REQUEST = /\b(?:release (?:checklist|plan|package|artifact|notes|preparation)|(?:prepare|stage|cut|make|create)\b[^.!?\n]{0,80}\b(?:release|artifact)|package (?:the|this|our) (?:release|project|artifact|build|application)|(?:publish|deploy|ship|push|tag)\b[^.!?\n]{0,80}\b(?:npm|production|artifact|package|release|repository|repo\b|github|version|build|live)|(?:publish|deploy)\b)/;
|
|
16
|
+
const COMPLEX_REQUEST = /\b(?:migration|migrate|rollout|production|architecture|cross[- ](?:service|project|platform)|multiple (?:components|services|projects|files)|across (?:the )?(?:api|ui|backend|frontend|services|projects)|(?:api|backend)\s+(?:and|plus)\s+(?:ui|frontend)|end[- ]to[- ]end|from scratch|multi[- ]step)\b/;
|
|
17
|
+
const NEGATIVE_CLAUSE = /\b(?:do not|don['’]t|never|without|avoid|no)\s+[^.!?;,\n]*?(?=\s+(?:but|then|however)\b|[.!?;,\n]|$)/g;
|
|
18
|
+
const RELEASE_CHECKLIST = /\brelease (?:checklist|roadmap|plan)\b/;
|
|
19
|
+
function requestedAction(phrase) {
|
|
20
|
+
return new RegExp('(?:^|[.;!?\\n]|\\b(?:and|then|also|but|please|can you|could you|would you)\\s+)\\s*(?:' + phrase + ')\\b');
|
|
21
|
+
}
|
|
22
|
+
const REQUESTED_EDIT = requestedAction('fix|implement|repair|patch|apply|edit|update|change|modify');
|
|
23
|
+
const SIDE_EFFECTS = [
|
|
24
|
+
['publish', requestedAction('publish|push\\s+(?:it|to|the|this|our)|upload\\b[^.!?\\n]{0,65}\\b(?:npm|github|repository)')],
|
|
25
|
+
['deploy', requestedAction('deploy|roll out')],
|
|
26
|
+
['destructive-change', requestedAction('force[- ]push|(?:delete|drop|purge|erase|wipe|remove)\\s+(?:all\\s+|the\\s+|our\\s+|a\\s+)*(?:production|database|accounts?|repositories|repository|backups?|customer data)')],
|
|
27
|
+
['send-external-message', requestedAction('send\\s+(?:an?\\s+|the\\s+|this\\s+)?(?:message|email|notice)|email\\s+(?:our|the|all)|notify\\s+(?:our|the|all)')],
|
|
28
|
+
['spend-money', requestedAction('purchase|buy|place (?:an?|the) order|subscribe to')],
|
|
29
|
+
];
|
|
30
|
+
function actionText(request) {
|
|
31
|
+
return request
|
|
32
|
+
.replace(/\x60{3}[\s\S]*?(?:\x60{3}|$)|\x60[^\x60\n]*\x60|“[^”\n]*”|"[^"\n]*"|(^|\s)'[^'\n]*'(?=\s|[.!?,;]|$)/g, ' ')
|
|
33
|
+
.toLowerCase()
|
|
34
|
+
.trim();
|
|
35
|
+
}
|
|
36
|
+
function step(id, title, completion) {
|
|
37
|
+
return { id, title, completion };
|
|
38
|
+
}
|
|
39
|
+
function buildSteps(taskType, mode, mayEdit, external) {
|
|
40
|
+
if (mode === 'plan-only') {
|
|
41
|
+
return [
|
|
42
|
+
step('inspect', 'Inspect the relevant context', 'Identify the requested outcome, constraints, and current state using available evidence.'),
|
|
43
|
+
step('plan', 'Write the requested plan', 'Describe the proposed actions and verification, then stop at the plan.'),
|
|
44
|
+
];
|
|
45
|
+
}
|
|
46
|
+
const steps = [];
|
|
47
|
+
if (mode === 'plan-then-execute') {
|
|
48
|
+
steps.push(step('plan', 'Plan the scoped work', 'Identify dependencies, material risks, and how to verify the requested outcome.'));
|
|
49
|
+
}
|
|
50
|
+
switch (taskType) {
|
|
51
|
+
case 'direct':
|
|
52
|
+
steps.push(step('respond', 'Complete the request', 'Return the requested result in the requested format.'));
|
|
53
|
+
break;
|
|
54
|
+
case 'implement':
|
|
55
|
+
steps.push(step('inspect', 'Inspect the relevant code and constraints', 'Identify existing behavior and the acceptance criteria for the change.'));
|
|
56
|
+
if (mayEdit) {
|
|
57
|
+
steps.push(step('implement', 'Implement the scoped change', 'Deliver the requested behavior through its normal entry points.'), step('verify', 'Verify the affected behavior', 'Check the result against the request and report any remaining gap.'));
|
|
58
|
+
}
|
|
59
|
+
break;
|
|
60
|
+
case 'debug':
|
|
61
|
+
steps.push(step('reproduce', 'Reproduce or isolate the failure', 'Identify the failing behavior and the evidence for its cause.'));
|
|
62
|
+
if (mayEdit) {
|
|
63
|
+
steps.push(step('fix', 'Fix the isolated cause', 'Make the smallest change that resolves the requested failure.'), step('verify', 'Verify the original failure', 'Repeat the failing path and check the related behavior for regressions.'));
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
steps.push(step('diagnosis', 'Report the diagnosis', 'State the cause supported by the evidence and any remaining uncertainty.'));
|
|
67
|
+
}
|
|
68
|
+
break;
|
|
69
|
+
case 'review':
|
|
70
|
+
steps.push(step('review', 'Review the requested scope', 'Inspect the relevant changes and prioritize actionable findings with evidence.'));
|
|
71
|
+
if (mayEdit) {
|
|
72
|
+
steps.push(step('fix', 'Fix the requested findings', 'Apply scoped changes for findings the user asked to fix.'), step('verify', 'Verify the fixes', 'Confirm the observed problems are resolved in the affected paths.'));
|
|
73
|
+
}
|
|
74
|
+
steps.push(step('findings', 'Report the review findings', 'Give evidence and locations for actionable findings, with remaining verification gaps.'));
|
|
75
|
+
break;
|
|
76
|
+
case 'research':
|
|
77
|
+
steps.push(step('sources', 'Check the relevant sources', 'Use available primary evidence and identify gaps or conflicting information.'), step('answer', 'Answer the research question', 'State what the evidence supports and identify material uncertainty.'));
|
|
78
|
+
break;
|
|
79
|
+
case 'release':
|
|
80
|
+
steps.push(step('artifact', 'Prepare and verify the release artifact', 'Confirm version, artifact identity, destination when specified, and relevant checks.'));
|
|
81
|
+
if (external.some(action => action === 'publish' || action === 'deploy')) {
|
|
82
|
+
steps.push(step('release', 'Carry out the authorized release action', 'Use the intended destination and the verified artifact with existing authorization.'), step('verify', 'Verify the destination independently', 'Confirm the actual remote version, artifact, or deployed result.'));
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
steps.push(step('report', 'Report the release preparation', 'Provide the requested checklist or release materials and any remaining dependencies.'));
|
|
86
|
+
}
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
return steps;
|
|
90
|
+
}
|
|
91
|
+
/** Return advisory routing based on the request and explicit options. */
|
|
92
|
+
export function analyzeTask(request, options = {}) {
|
|
93
|
+
if (typeof request !== 'string' || !request.trim())
|
|
94
|
+
throw new TypeError('A nonempty task request is required.');
|
|
95
|
+
const { mode = 'auto', taskType: selectedType = 'auto', complexity = 'auto' } = options;
|
|
96
|
+
if (!['auto', 'plan-only', 'execute'].includes(mode))
|
|
97
|
+
throw new TypeError('Unknown workflow mode.');
|
|
98
|
+
if (!['auto', 'implement', 'debug', 'review', 'research', 'release'].includes(selectedType)) {
|
|
99
|
+
throw new TypeError('Unknown workflow task type.');
|
|
100
|
+
}
|
|
101
|
+
if (!['auto', 'simple', 'complex'].includes(complexity))
|
|
102
|
+
throw new TypeError('Unknown workflow complexity.');
|
|
103
|
+
const text = actionText(request);
|
|
104
|
+
const positive = text.replace(NEGATIVE_CLAUSE, ' ');
|
|
105
|
+
const noEdits = NO_EDITS.test(text) || DIAGNOSIS_ONLY.test(text) || /\bno (?:code|file|source) changes\b/.test(text);
|
|
106
|
+
const explicitPlan = PLAN_ONLY.test(text);
|
|
107
|
+
const thenExecute = PLAN_THEN_EXECUTE.test(positive);
|
|
108
|
+
const planRequested = ASK_FOR_PLAN.test(text) || RELEASE_CHECKLIST.test(text);
|
|
109
|
+
const planOnly = mode === 'plan-only' || explicitPlan || (planRequested && noEdits) ||
|
|
110
|
+
(mode === 'auto' && !thenExecute && planRequested);
|
|
111
|
+
const engineeringTransform = TRANSFORMATION.test(text) && ENGINEERING_SCOPE.test(text);
|
|
112
|
+
const directRequest = SMALL_EDIT.test(text) || (TRANSFORMATION.test(text) && !engineeringTransform) ||
|
|
113
|
+
(EXPLANATION.test(text) && !RESEARCH_REQUEST.test(text));
|
|
114
|
+
let taskType;
|
|
115
|
+
const reasons = [];
|
|
116
|
+
if (selectedType !== 'auto') {
|
|
117
|
+
taskType = selectedType;
|
|
118
|
+
reasons.push('The task type was selected explicitly.');
|
|
119
|
+
}
|
|
120
|
+
else if (directRequest) {
|
|
121
|
+
taskType = 'direct';
|
|
122
|
+
reasons.push('The request is a direct answer or small transformation.');
|
|
123
|
+
}
|
|
124
|
+
else if (REVIEW_REQUEST.test(positive)) {
|
|
125
|
+
taskType = 'review';
|
|
126
|
+
reasons.push('The request asks for findings from a review.');
|
|
127
|
+
}
|
|
128
|
+
else if (RESEARCH_REQUEST.test(positive)) {
|
|
129
|
+
taskType = 'research';
|
|
130
|
+
reasons.push('The request asks for source-based information or comparison.');
|
|
131
|
+
}
|
|
132
|
+
else if (RELEASE_REQUEST.test(positive)) {
|
|
133
|
+
taskType = 'release';
|
|
134
|
+
reasons.push('The request concerns release preparation or delivery.');
|
|
135
|
+
}
|
|
136
|
+
else if (DEBUG_REQUEST.test(positive)) {
|
|
137
|
+
taskType = 'debug';
|
|
138
|
+
reasons.push('The request identifies a failure or regression.');
|
|
139
|
+
}
|
|
140
|
+
else if (IMPLEMENT_REQUEST.test(positive) || thenExecute) {
|
|
141
|
+
taskType = 'implement';
|
|
142
|
+
reasons.push('The request asks for a scoped implementation.');
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
taskType = 'direct';
|
|
146
|
+
reasons.push('The request has no clear specialized workflow cue.');
|
|
147
|
+
}
|
|
148
|
+
if (noEdits)
|
|
149
|
+
reasons.push('The request limits the work to inspection.');
|
|
150
|
+
const complex = complexity === 'complex' ||
|
|
151
|
+
(complexity === 'auto' && taskType !== 'direct' &&
|
|
152
|
+
(taskType === 'release' || engineeringTransform || COMPLEX_REQUEST.test(positive)));
|
|
153
|
+
const resultMode = planOnly ? 'plan-only' : thenExecute || complex ? 'plan-then-execute' : 'direct';
|
|
154
|
+
if (planOnly)
|
|
155
|
+
reasons.push('The workflow stops after planning.');
|
|
156
|
+
else if (thenExecute)
|
|
157
|
+
reasons.push('The request explicitly asks to plan and then act.');
|
|
158
|
+
else if (complex)
|
|
159
|
+
reasons.push('The scope benefits from a short plan before work starts.');
|
|
160
|
+
const requestedEdit = REQUESTED_EDIT.test(positive);
|
|
161
|
+
const mayEdit = !noEdits && (taskType !== 'review' || requestedEdit) &&
|
|
162
|
+
(taskType !== 'debug' || !DIAGNOSIS_REQUEST.test(positive) || requestedEdit);
|
|
163
|
+
const sideEffects = planOnly || noEdits || taskType === 'research' || (taskType === 'review' && !mayEdit) || directRequest
|
|
164
|
+
? []
|
|
165
|
+
: SIDE_EFFECTS.filter(([, pattern]) => pattern.test(positive)).map(([id]) => id);
|
|
166
|
+
const skills = taskType === 'direct'
|
|
167
|
+
? (resultMode === 'direct' ? [] : ['shadow-workflow'])
|
|
168
|
+
: ['shadow-workflow', 'shadow-' + taskType];
|
|
169
|
+
return {
|
|
170
|
+
taskType,
|
|
171
|
+
mode: resultMode,
|
|
172
|
+
skills,
|
|
173
|
+
steps: buildSteps(taskType, resultMode, mayEdit, sideEffects),
|
|
174
|
+
reasons,
|
|
175
|
+
requiresAuthorization: sideEffects,
|
|
176
|
+
limitations: [
|
|
177
|
+
'Routing uses English request cues and explicit options.',
|
|
178
|
+
'The host performs the suggested work and checks authorization already present in the conversation.',
|
|
179
|
+
],
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
//# sourceMappingURL=task-workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-workflow.js","sourceRoot":"","sources":["../../src/brain/task-workflow.ts"],"names":[],"mappings":"AAoBA,MAA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C,CAAC;IAC9C,OAAO;QACL,QAAQ;QACR,IAAI,EAAE,UAAU;QAChB,MAAM;QACN,KAAK,EAAE,UAAU,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,CAAC;QAC7D,OAAO;QACP,qBAAqB,EAAE,WAAW;QAClC,WAAW,EAAE;YACX,yDAAyD;YACzD,oGAAoG;SACrG;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export declare const WORKFLOW_TARGETS: Readonly<{
|
|
2
|
+
readonly codex: Readonly<{
|
|
3
|
+
skillRoot: ".agents/skills";
|
|
4
|
+
instructionFile: "AGENTS.md";
|
|
5
|
+
}>;
|
|
6
|
+
readonly 'claude-code': Readonly<{
|
|
7
|
+
skillRoot: ".claude/skills";
|
|
8
|
+
instructionFile: "CLAUDE.md";
|
|
9
|
+
}>;
|
|
10
|
+
readonly opencode: Readonly<{
|
|
11
|
+
skillRoot: ".opencode/skills";
|
|
12
|
+
instructionFile: "AGENTS.md";
|
|
13
|
+
}>;
|
|
14
|
+
readonly 'deepseek-harness': Readonly<{
|
|
15
|
+
skillRoot: ".dsh/skills";
|
|
16
|
+
instructionFile: "AGENTS.md";
|
|
17
|
+
}>;
|
|
18
|
+
readonly portable: Readonly<{
|
|
19
|
+
skillRoot: ".agents/skills";
|
|
20
|
+
instructionFile: "AGENTS.md";
|
|
21
|
+
}>;
|
|
22
|
+
}>;
|
|
23
|
+
export type WorkflowTarget = keyof typeof WORKFLOW_TARGETS;
|
|
24
|
+
export interface BundledWorkflowSkill {
|
|
25
|
+
name: string;
|
|
26
|
+
description: string;
|
|
27
|
+
}
|
|
28
|
+
export interface SkillInstallOptions {
|
|
29
|
+
projectDir: string;
|
|
30
|
+
targets: WorkflowTarget[];
|
|
31
|
+
skills?: string[];
|
|
32
|
+
}
|
|
33
|
+
export interface SkillInstallFile {
|
|
34
|
+
path: string;
|
|
35
|
+
relativePath: string;
|
|
36
|
+
kind: 'skill' | 'instructions' | 'manifest';
|
|
37
|
+
action: 'create' | 'update' | 'unchanged' | 'conflict';
|
|
38
|
+
beforeSha256: string | null;
|
|
39
|
+
afterSha256: string | null;
|
|
40
|
+
content: string;
|
|
41
|
+
reason?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface SkillInstallPlan {
|
|
44
|
+
projectDir: string;
|
|
45
|
+
targets: WorkflowTarget[];
|
|
46
|
+
skills: string[];
|
|
47
|
+
files: SkillInstallFile[];
|
|
48
|
+
warnings: string[];
|
|
49
|
+
}
|
|
50
|
+
export interface SkillInstallResult {
|
|
51
|
+
projectDir: string;
|
|
52
|
+
created: string[];
|
|
53
|
+
updated: string[];
|
|
54
|
+
unchanged: string[];
|
|
55
|
+
backupDir: string | null;
|
|
56
|
+
}
|
|
57
|
+
export declare function listWorkflowTargets(): ({
|
|
58
|
+
skillRoot: ".agents/skills";
|
|
59
|
+
instructionFile: "AGENTS.md";
|
|
60
|
+
target: "claude-code" | "opencode" | "codex" | "deepseek-harness" | "portable";
|
|
61
|
+
} | {
|
|
62
|
+
skillRoot: ".claude/skills";
|
|
63
|
+
instructionFile: "CLAUDE.md";
|
|
64
|
+
target: "claude-code" | "opencode" | "codex" | "deepseek-harness" | "portable";
|
|
65
|
+
} | {
|
|
66
|
+
skillRoot: ".opencode/skills";
|
|
67
|
+
instructionFile: "AGENTS.md";
|
|
68
|
+
target: "claude-code" | "opencode" | "codex" | "deepseek-harness" | "portable";
|
|
69
|
+
} | {
|
|
70
|
+
skillRoot: ".dsh/skills";
|
|
71
|
+
instructionFile: "AGENTS.md";
|
|
72
|
+
target: "claude-code" | "opencode" | "codex" | "deepseek-harness" | "portable";
|
|
73
|
+
} | {
|
|
74
|
+
skillRoot: ".agents/skills";
|
|
75
|
+
instructionFile: "AGENTS.md";
|
|
76
|
+
target: "claude-code" | "opencode" | "codex" | "deepseek-harness" | "portable";
|
|
77
|
+
})[];
|
|
78
|
+
export declare function getBundledSkill(name: string): BundledWorkflowSkill & {
|
|
79
|
+
content: string;
|
|
80
|
+
};
|
|
81
|
+
export declare function listBundledSkills(): BundledWorkflowSkill[];
|
|
82
|
+
/** Inspect the requested project and compute a preview without making filesystem changes. */
|
|
83
|
+
export declare function planSkillInstall(options: SkillInstallOptions): SkillInstallPlan;
|
|
84
|
+
/** Apply a still-current preview. Existing edited or unowned files are preserved. */
|
|
85
|
+
export declare function applySkillInstall(plan: SkillInstallPlan): SkillInstallResult;
|
|
86
|
+
//# sourceMappingURL=workflow-skills.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-skills.d.ts","sourceRoot":"","sources":["../../src/brain/workflow-skills.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;EAMlB,CAAC;AAEZ,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,gBAAgB,CAAC;AAE3D,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,OAAO,GAAG,cAAc,GAAG,UAAU,CAAC;IAC5C,MAAM,EAAE,QAAQ,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,CAAC;IACvD,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,cAAc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