@a-company/paradigm 1.5.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.
Files changed (114) hide show
  1. package/README.md +142 -0
  2. package/dist/accept-orchestration-CWZNCGZX.js +188 -0
  3. package/dist/agents-suggest-35LIQKDH.js +83 -0
  4. package/dist/aggregate-W7Q6VIM2.js +88 -0
  5. package/dist/auto-IU7VN55K.js +470 -0
  6. package/dist/beacon-B47XSTL7.js +251 -0
  7. package/dist/chunk-2M6OSOIG.js +1302 -0
  8. package/dist/chunk-4NCFWYGG.js +110 -0
  9. package/dist/chunk-5C4SGQKH.js +705 -0
  10. package/dist/chunk-5GOA7WYD.js +1095 -0
  11. package/dist/chunk-5JGJACDU.js +37 -0
  12. package/dist/chunk-6QC3YGB6.js +114 -0
  13. package/dist/chunk-753RICFF.js +325 -0
  14. package/dist/chunk-AD2LSCHB.js +1595 -0
  15. package/dist/chunk-CHSHON3O.js +669 -0
  16. package/dist/chunk-ELLR7WP6.js +3175 -0
  17. package/dist/chunk-ILOWBJRC.js +12 -0
  18. package/dist/chunk-IRKUEJVW.js +405 -0
  19. package/dist/chunk-MC7XC7XQ.js +533 -0
  20. package/dist/chunk-MO4EEYFW.js +38 -0
  21. package/dist/chunk-MQWH7PFI.js +13366 -0
  22. package/dist/chunk-N6PJAPDE.js +364 -0
  23. package/dist/chunk-PBHIFAL4.js +259 -0
  24. package/dist/chunk-PMXRGPRQ.js +305 -0
  25. package/dist/chunk-PW2EXJQT.js +689 -0
  26. package/dist/chunk-TAP5N3HH.js +245 -0
  27. package/dist/chunk-THFVK5AE.js +148 -0
  28. package/dist/chunk-UM54F7G5.js +1533 -0
  29. package/dist/chunk-UUZ2DMG5.js +185 -0
  30. package/dist/chunk-WS5KM7OL.js +780 -0
  31. package/dist/chunk-YDNKXH4Z.js +2316 -0
  32. package/dist/chunk-YO6DVTL7.js +99 -0
  33. package/dist/claude-SUYNN72C.js +362 -0
  34. package/dist/claude-cli-OF43XAO3.js +276 -0
  35. package/dist/claude-code-PW6SKD2M.js +126 -0
  36. package/dist/claude-code-teams-JLZ5IXB6.js +199 -0
  37. package/dist/constellation-K3CIQCHI.js +225 -0
  38. package/dist/cost-AEK6R7HK.js +174 -0
  39. package/dist/cost-KYXIQ62X.js +93 -0
  40. package/dist/cursor-cli-IHJMPRCW.js +269 -0
  41. package/dist/cursorrules-KI5QWHIX.js +84 -0
  42. package/dist/diff-AJJ5H6HV.js +125 -0
  43. package/dist/dist-7MPIRMTZ-IOQOREMZ.js +10866 -0
  44. package/dist/dist-NHJQVVUW.js +68 -0
  45. package/dist/dist-ZEMSQV74.js +20 -0
  46. package/dist/doctor-6Y6L6HEB.js +11 -0
  47. package/dist/echo-VYZW3OTT.js +248 -0
  48. package/dist/export-R4FJ5NOH.js +38 -0
  49. package/dist/history-EVO3L6SC.js +277 -0
  50. package/dist/hooks-MBWE4ILT.js +12 -0
  51. package/dist/index.d.ts +2 -0
  52. package/dist/index.js +568 -0
  53. package/dist/lint-HXKTWRNO.js +316 -0
  54. package/dist/manual-Y3QOXWYA.js +204 -0
  55. package/dist/mcp.js +14745 -0
  56. package/dist/orchestrate-4ZH5GUQH.js +323 -0
  57. package/dist/probe-OYCP4JYG.js +151 -0
  58. package/dist/promote-Z52ZJTJU.js +181 -0
  59. package/dist/providers-4PGPZEWP.js +104 -0
  60. package/dist/remember-6VZ74B7E.js +77 -0
  61. package/dist/ripple-SBQOSTZD.js +215 -0
  62. package/dist/sentinel-LCFD56OJ.js +43 -0
  63. package/dist/server-F5ITNK6T.js +9846 -0
  64. package/dist/server-T6WIFYRQ.js +16076 -0
  65. package/dist/setup-DF4F3ICN.js +25 -0
  66. package/dist/setup-JHBPZAG7.js +296 -0
  67. package/dist/shift-HKIAP4ZN.js +226 -0
  68. package/dist/snapshot-GTVPRYZG.js +62 -0
  69. package/dist/spawn-BJRQA2NR.js +196 -0
  70. package/dist/summary-H6J6N6PJ.js +140 -0
  71. package/dist/switch-6EANJ7O6.js +232 -0
  72. package/dist/sync-BEOCW7TZ.js +11 -0
  73. package/dist/team-NWP2KJAB.js +32 -0
  74. package/dist/test-MA5TWJQV.js +934 -0
  75. package/dist/thread-JCJVRUQR.js +258 -0
  76. package/dist/triage-ETVXXFMV.js +1880 -0
  77. package/dist/tutorial-L5Q3ZDHK.js +666 -0
  78. package/dist/university-R2WDQLSI.js +40 -0
  79. package/dist/upgrade-5B3YGGC6.js +550 -0
  80. package/dist/validate-F3YHBCRZ.js +39 -0
  81. package/dist/validate-QEEY6KFS.js +64 -0
  82. package/dist/watch-4LT4O6K7.js +123 -0
  83. package/dist/watch-6IIWPWDN.js +111 -0
  84. package/dist/wisdom-LRM4FFCH.js +319 -0
  85. package/package.json +68 -0
  86. package/templates/paradigm/config.yaml +175 -0
  87. package/templates/paradigm/docs/commands.md +727 -0
  88. package/templates/paradigm/docs/decisions/000-template.md +47 -0
  89. package/templates/paradigm/docs/decisions/README.md +26 -0
  90. package/templates/paradigm/docs/error-patterns.md +215 -0
  91. package/templates/paradigm/docs/patterns.md +358 -0
  92. package/templates/paradigm/docs/queries.md +200 -0
  93. package/templates/paradigm/docs/troubleshooting.md +477 -0
  94. package/templates/paradigm/echoes.yaml +25 -0
  95. package/templates/paradigm/prompts/add-feature.md +152 -0
  96. package/templates/paradigm/prompts/add-gate.md +117 -0
  97. package/templates/paradigm/prompts/debug-auth.md +174 -0
  98. package/templates/paradigm/prompts/implement-ftux.md +722 -0
  99. package/templates/paradigm/prompts/implement-sandbox.md +651 -0
  100. package/templates/paradigm/prompts/read-docs.md +84 -0
  101. package/templates/paradigm/prompts/refactor.md +106 -0
  102. package/templates/paradigm/prompts/run-e2e-tests.md +340 -0
  103. package/templates/paradigm/prompts/trace-flow.md +202 -0
  104. package/templates/paradigm/prompts/validate-portals.md +279 -0
  105. package/templates/paradigm/specs/context-tracking.md +200 -0
  106. package/templates/paradigm/specs/context.md +461 -0
  107. package/templates/paradigm/specs/disciplines.md +413 -0
  108. package/templates/paradigm/specs/history.md +339 -0
  109. package/templates/paradigm/specs/logger.md +303 -0
  110. package/templates/paradigm/specs/navigator.md +236 -0
  111. package/templates/paradigm/specs/purpose.md +265 -0
  112. package/templates/paradigm/specs/scan.md +177 -0
  113. package/templates/paradigm/specs/symbols.md +451 -0
  114. package/templates/paradigm/specs/wisdom.md +294 -0
@@ -0,0 +1,316 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ findPurposeFiles,
4
+ parsePurposeFileDetailed,
5
+ serializePurposeFile,
6
+ validatePurposeFile
7
+ } from "./chunk-PW2EXJQT.js";
8
+ import {
9
+ log
10
+ } from "./chunk-4NCFWYGG.js";
11
+ import "./chunk-MO4EEYFW.js";
12
+
13
+ // src/commands/lint.ts
14
+ import * as fs from "fs";
15
+ import * as path from "path";
16
+ import chalk from "chalk";
17
+ import ora from "ora";
18
+ function getSuggestion(error) {
19
+ const msg = error.message.toLowerCase();
20
+ if (msg.includes("expected object, received array") && error.path?.includes("features")) {
21
+ return 'Convert to object format: features: { feature-name: { description: "..." } }';
22
+ }
23
+ if (msg.includes("expected object, received array") && error.path?.includes("components")) {
24
+ return 'Convert to object format: components: { component-name: { description: "..." } }';
25
+ }
26
+ if (msg.includes("has no description")) {
27
+ return "Add a description field to help AI understand this item";
28
+ }
29
+ if (msg.includes("should use alphanumeric")) {
30
+ return "Use kebab-case: my-feature-name (lowercase, hyphens)";
31
+ }
32
+ if (msg.includes("references unknown")) {
33
+ return "Define the symbol in a .purpose file or remove the reference";
34
+ }
35
+ if (msg.includes("yaml syntax") || msg.includes("bad indentation")) {
36
+ return "Check indentation (use 2 spaces) and YAML syntax";
37
+ }
38
+ return void 0;
39
+ }
40
+ function isMarkdownFormat(content) {
41
+ const lines = content.trim().split("\n");
42
+ const hasMarkdownHeader = lines.some((l) => /^#+\s/.test(l));
43
+ const hasNoYamlStructure = !content.includes(":") || lines[0].startsWith("#") || lines[0].startsWith("@");
44
+ return hasMarkdownHeader || hasNoYamlStructure && !content.trim().startsWith("---");
45
+ }
46
+ function convertMarkdownToYaml(content, filePath) {
47
+ const lines = content.trim().split("\n");
48
+ const dirName = path.basename(path.dirname(filePath));
49
+ let description = "";
50
+ for (const line of lines) {
51
+ if (!line.startsWith("#") && !line.startsWith("@") && line.trim()) {
52
+ description = line.trim();
53
+ break;
54
+ }
55
+ if (line.startsWith("#")) {
56
+ description = line.replace(/^#+\s*/, "").trim();
57
+ }
58
+ }
59
+ return `# Auto-converted from markdown format
60
+ description: "${description || `Purpose file for ${dirName}`}"
61
+
62
+ # TODO: Add features and components
63
+ # features:
64
+ # feature-name:
65
+ # description: "What this feature does"
66
+
67
+ # components:
68
+ # component-name:
69
+ # description: "What this component does"
70
+ `;
71
+ }
72
+ function autoQuoteSpecialChars(content) {
73
+ return content.replace(
74
+ /\[\s*([^\]]+)\s*\]/g,
75
+ (_match, arrayContent) => {
76
+ const items = arrayContent.split(",").map((item) => {
77
+ const trimmed = item.trim();
78
+ if (/^[#@$^!%]/.test(trimmed) && !trimmed.startsWith('"') && !trimmed.startsWith("'")) {
79
+ return `"${trimmed}"`;
80
+ }
81
+ return trimmed;
82
+ });
83
+ return `[${items.join(", ")}]`;
84
+ }
85
+ );
86
+ }
87
+ function attemptFix(filePath, errors) {
88
+ try {
89
+ let content = fs.readFileSync(filePath, "utf8");
90
+ let modified = false;
91
+ if (isMarkdownFormat(content)) {
92
+ content = convertMarkdownToYaml(content, filePath);
93
+ modified = true;
94
+ }
95
+ const hasUnquotedSymbols = errors.some(
96
+ (e) => e.message.includes("tag suffix") || e.message.includes("flow indicator") || e.message.includes("missed comma")
97
+ );
98
+ if (hasUnquotedSymbols || content.match(/\[[^\]]*[#@$^!%][^\]"']*\]/)) {
99
+ const quoted = autoQuoteSpecialChars(content);
100
+ if (quoted !== content) {
101
+ content = quoted;
102
+ modified = true;
103
+ }
104
+ }
105
+ if (modified) {
106
+ const tempPath = filePath + ".tmp";
107
+ fs.writeFileSync(tempPath, content);
108
+ const result2 = parsePurposeFileDetailed(tempPath);
109
+ fs.unlinkSync(tempPath);
110
+ if (result2.isYamlValid && result2.data) {
111
+ return serializePurposeFile(result2.data);
112
+ }
113
+ return content;
114
+ }
115
+ const result = parsePurposeFileDetailed(filePath);
116
+ if (result.isYamlValid && result.data) {
117
+ const fixed = serializePurposeFile(result.data);
118
+ if (fixed.trim() !== content.trim()) {
119
+ return fixed;
120
+ }
121
+ }
122
+ return null;
123
+ } catch {
124
+ return null;
125
+ }
126
+ }
127
+ function lintFile(filePath, rootDir, options) {
128
+ const relativePath = path.relative(rootDir, filePath);
129
+ const errors = [];
130
+ const warnings = [];
131
+ let fixed = false;
132
+ const parseResult = parsePurposeFileDetailed(filePath);
133
+ for (const error of parseResult.detailedErrors || []) {
134
+ const issue = {
135
+ message: error.message,
136
+ line: error.line,
137
+ path: error.path,
138
+ type: error.type === "yaml" || error.type === "file" ? "error" : "error",
139
+ suggestion: getSuggestion(error),
140
+ fixable: error.type === "schema"
141
+ // Schema errors might be fixable
142
+ };
143
+ errors.push(issue);
144
+ }
145
+ if (parseResult.data) {
146
+ const validationResult = validatePurposeFile(parseResult.data, relativePath);
147
+ for (const issue of validationResult.issues) {
148
+ const lintIssue = {
149
+ message: issue.message,
150
+ path: issue.path,
151
+ type: issue.type,
152
+ suggestion: getSuggestion(issue),
153
+ fixable: false
154
+ };
155
+ if (issue.type === "error") {
156
+ errors.push(lintIssue);
157
+ } else {
158
+ warnings.push(lintIssue);
159
+ }
160
+ }
161
+ }
162
+ if (options.fix && errors.length > 0) {
163
+ const fixedContent = attemptFix(filePath, errors);
164
+ if (fixedContent) {
165
+ fs.writeFileSync(filePath, fixedContent);
166
+ fixed = true;
167
+ const reparse = parsePurposeFileDetailed(filePath);
168
+ if (reparse.detailedErrors && reparse.detailedErrors.length < errors.length) {
169
+ errors.length = 0;
170
+ warnings.length = 0;
171
+ for (const error of reparse.detailedErrors || []) {
172
+ errors.push({
173
+ message: error.message,
174
+ line: error.line,
175
+ path: error.path,
176
+ type: "error",
177
+ suggestion: getSuggestion(error)
178
+ });
179
+ }
180
+ }
181
+ }
182
+ }
183
+ const valid = errors.length === 0 && (!options.strict || warnings.length === 0);
184
+ return {
185
+ path: filePath,
186
+ relativePath,
187
+ valid,
188
+ errors,
189
+ warnings,
190
+ fixed
191
+ };
192
+ }
193
+ function formatIssue(issue, indent = " ") {
194
+ const lines = [];
195
+ const icon = issue.type === "error" ? chalk.red("\u2717") : chalk.yellow("\u26A0");
196
+ const lineInfo = issue.line ? chalk.gray(` (line ${issue.line})`) : "";
197
+ const pathInfo = issue.path ? chalk.gray(` at ${issue.path}`) : "";
198
+ lines.push(`${indent}${icon} ${issue.message}${lineInfo}${pathInfo}`);
199
+ if (issue.suggestion) {
200
+ lines.push(`${indent} ${chalk.cyan("\u2192")} ${chalk.gray(issue.suggestion)}`);
201
+ }
202
+ return lines;
203
+ }
204
+ async function lintCommand(targetPath, options) {
205
+ const rootDir = targetPath ? path.resolve(targetPath) : process.cwd();
206
+ const spinner = ora();
207
+ if (!options.quiet && !options.json) {
208
+ console.log(chalk.blue("\n\u{1F50D} Paradigm Lint\n"));
209
+ }
210
+ const tracker = log.command("lint").start("Linting purpose files", { fix: !!options.fix });
211
+ spinner.start("Finding .purpose files...");
212
+ const files = await findPurposeFiles(rootDir);
213
+ spinner.stop();
214
+ log.operation("find-files").debug("Purpose files found", { count: files.length });
215
+ if (files.length === 0) {
216
+ if (options.json) {
217
+ console.log(JSON.stringify({ files: [], summary: { totalFiles: 0 } }));
218
+ } else if (!options.quiet) {
219
+ console.log(chalk.yellow("No .purpose files found.\n"));
220
+ console.log(chalk.gray("Run `paradigm init` to create your first .purpose file.\n"));
221
+ }
222
+ return;
223
+ }
224
+ if (!options.quiet && !options.json) {
225
+ console.log(chalk.gray(`Checking ${files.length} .purpose file${files.length > 1 ? "s" : ""}...
226
+ `));
227
+ }
228
+ const results = [];
229
+ for (const file of files) {
230
+ const result = lintFile(file, rootDir, options);
231
+ results.push(result);
232
+ if (!options.quiet && !options.json) {
233
+ if (!result.valid || result.errors.length > 0 || result.warnings.length > 0) {
234
+ const icon = result.errors.length > 0 ? chalk.red("\u2717") : result.warnings.length > 0 ? chalk.yellow("\u26A0") : chalk.green("\u2713");
235
+ const fixedBadge = result.fixed ? chalk.cyan(" [fixed]") : "";
236
+ console.log(`${icon} ${result.relativePath}${fixedBadge}`);
237
+ for (const error of result.errors) {
238
+ for (const line of formatIssue(error)) {
239
+ console.log(line);
240
+ }
241
+ }
242
+ for (const warning of result.warnings) {
243
+ for (const line of formatIssue(warning)) {
244
+ console.log(line);
245
+ }
246
+ }
247
+ console.log("");
248
+ }
249
+ }
250
+ }
251
+ const summary = {
252
+ totalFiles: results.length,
253
+ validFiles: results.filter((r) => r.valid).length,
254
+ filesWithErrors: results.filter((r) => r.errors.length > 0).length,
255
+ filesWithWarnings: results.filter((r) => r.warnings.length > 0).length,
256
+ totalErrors: results.reduce((sum, r) => sum + r.errors.length, 0),
257
+ totalWarnings: results.reduce((sum, r) => sum + r.warnings.length, 0),
258
+ fixedFiles: results.filter((r) => r.fixed).length
259
+ };
260
+ if (options.json) {
261
+ const output = {
262
+ files: results.map((r) => ({
263
+ path: r.relativePath,
264
+ valid: r.valid,
265
+ errors: r.errors,
266
+ warnings: r.warnings,
267
+ fixed: r.fixed
268
+ })),
269
+ summary
270
+ };
271
+ console.log(JSON.stringify(output, null, 2));
272
+ process.exit(summary.filesWithErrors > 0 ? 1 : 0);
273
+ return;
274
+ }
275
+ if (!options.quiet) {
276
+ console.log(chalk.gray("\u2500".repeat(40)));
277
+ if (summary.totalErrors === 0 && summary.totalWarnings === 0) {
278
+ console.log(chalk.green(`
279
+ \u2713 All ${summary.totalFiles} file${summary.totalFiles > 1 ? "s" : ""} valid
280
+ `));
281
+ tracker.success("All files valid", { files: summary.totalFiles });
282
+ } else {
283
+ tracker.error("Files have issues", {
284
+ errors: summary.totalErrors,
285
+ warnings: summary.totalWarnings,
286
+ fixed: summary.fixedFiles
287
+ });
288
+ console.log("");
289
+ if (summary.validFiles > 0) {
290
+ console.log(chalk.green(`\u2713 ${summary.validFiles} file${summary.validFiles > 1 ? "s" : ""} valid`));
291
+ }
292
+ if (summary.filesWithErrors > 0) {
293
+ console.log(chalk.red(`\u2717 ${summary.filesWithErrors} file${summary.filesWithErrors > 1 ? "s" : ""} with errors (${summary.totalErrors} total)`));
294
+ }
295
+ if (summary.filesWithWarnings > 0) {
296
+ console.log(chalk.yellow(`\u26A0 ${summary.filesWithWarnings} file${summary.filesWithWarnings > 1 ? "s" : ""} with warnings (${summary.totalWarnings} total)`));
297
+ }
298
+ if (summary.fixedFiles > 0) {
299
+ console.log(chalk.cyan(`\u21BB ${summary.fixedFiles} file${summary.fixedFiles > 1 ? "s" : ""} auto-fixed`));
300
+ }
301
+ console.log("");
302
+ if (summary.totalErrors > 0 && !options.fix) {
303
+ console.log(chalk.gray("Run `paradigm lint --fix` to auto-fix where possible.\n"));
304
+ }
305
+ }
306
+ }
307
+ if (summary.filesWithErrors > 0) {
308
+ process.exit(1);
309
+ }
310
+ if (options.strict && summary.filesWithWarnings > 0) {
311
+ process.exit(1);
312
+ }
313
+ }
314
+ export {
315
+ lintCommand
316
+ };
@@ -0,0 +1,204 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ MODEL_PRICING
4
+ } from "./chunk-5JGJACDU.js";
5
+ import "./chunk-MO4EEYFW.js";
6
+
7
+ // src/core/providers/manual.ts
8
+ import * as fs from "fs";
9
+ import * as path from "path";
10
+ import * as yaml from "js-yaml";
11
+ var ManualProvider = class {
12
+ name = "manual";
13
+ rootDir;
14
+ constructor(rootDir = process.cwd()) {
15
+ this.rootDir = rootDir;
16
+ }
17
+ listModels() {
18
+ return ["opus", "sonnet", "haiku"];
19
+ }
20
+ supportsParallel() {
21
+ return false;
22
+ }
23
+ supportsMcp() {
24
+ return true;
25
+ }
26
+ getTokenCost(model) {
27
+ return MODEL_PRICING[model];
28
+ }
29
+ async isAvailable() {
30
+ return true;
31
+ }
32
+ /**
33
+ * Create a handoff file for manual execution
34
+ */
35
+ async *spawn(agent, options) {
36
+ const handoffsDir = path.join(this.rootDir, ".paradigm", "handoffs");
37
+ const tasksDir = path.join(this.rootDir, ".paradigm", "tasks");
38
+ for (const dir of [handoffsDir, tasksDir]) {
39
+ if (!fs.existsSync(dir)) {
40
+ fs.mkdirSync(dir, { recursive: true });
41
+ }
42
+ }
43
+ const handoffId = `${Date.now()}-manual-${agent.name}`;
44
+ const handoffFile = path.join(handoffsDir, `${handoffId}.yaml`);
45
+ const taskFile = path.join(tasksDir, `${handoffId}.md`);
46
+ const handoff = {
47
+ id: handoffId,
48
+ from: "orchestrator",
49
+ to: agent.name,
50
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
51
+ status: "pending",
52
+ completed: {
53
+ symbols: options.context.symbols,
54
+ artifacts: []
55
+ },
56
+ context: {
57
+ summary: options.task,
58
+ key_symbols: options.context.symbols.map((s) => ({ symbol: s, relevance: "task-related" })),
59
+ warnings: ["This is a manual handoff - execute the task file manually"],
60
+ suggested_approach: `Read ${taskFile} and follow the instructions`
61
+ }
62
+ };
63
+ fs.writeFileSync(handoffFile, yaml.dump(handoff));
64
+ const taskContent = this.buildTaskFile(agent, options, handoffId);
65
+ fs.writeFileSync(taskFile, taskContent);
66
+ yield {
67
+ type: "text",
68
+ content: `
69
+ \u{1F4CB} **Manual Handoff Created**
70
+
71
+ `,
72
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
73
+ };
74
+ yield {
75
+ type: "text",
76
+ content: `Agent: **${agent.name}**
77
+ `,
78
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
79
+ };
80
+ yield {
81
+ type: "text",
82
+ content: `Task: ${options.task}
83
+
84
+ `,
85
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
86
+ };
87
+ yield {
88
+ type: "text",
89
+ content: `**To execute manually:**
90
+ `,
91
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
92
+ };
93
+ yield {
94
+ type: "text",
95
+ content: `1. Open: ${taskFile}
96
+ `,
97
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
98
+ };
99
+ yield {
100
+ type: "text",
101
+ content: `2. Follow the instructions in the file
102
+ `,
103
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
104
+ };
105
+ yield {
106
+ type: "text",
107
+ content: `3. Run: \`paradigm team accept ${handoffId}\` when done
108
+
109
+ `,
110
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
111
+ };
112
+ yield {
113
+ type: "text",
114
+ content: `Or paste this into a new Claude session:
115
+ \`\`\`
116
+ ${this.buildPrompt(agent, options)}
117
+ \`\`\`
118
+ `,
119
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
120
+ };
121
+ yield {
122
+ type: "done",
123
+ content: "Manual handoff created",
124
+ usage: { input: 0, output: 0, total: 0 },
125
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
126
+ };
127
+ }
128
+ // ==========================================================================
129
+ // Private Methods
130
+ // ==========================================================================
131
+ buildTaskFile(agent, options, handoffId) {
132
+ const lines = [];
133
+ lines.push(`# ${agent.name.toUpperCase()} Task`);
134
+ lines.push("");
135
+ lines.push(`> Handoff ID: ${handoffId}`);
136
+ lines.push(`> Created: ${(/* @__PURE__ */ new Date()).toISOString()}`);
137
+ lines.push("");
138
+ lines.push("---");
139
+ lines.push("");
140
+ lines.push("## Task");
141
+ lines.push("");
142
+ lines.push(options.task);
143
+ lines.push("");
144
+ lines.push("---");
145
+ lines.push("");
146
+ lines.push("## Agent Role");
147
+ lines.push("");
148
+ lines.push(agent.role);
149
+ lines.push("");
150
+ lines.push("---");
151
+ lines.push("");
152
+ lines.push("## Focus Areas");
153
+ lines.push("");
154
+ lines.push("**Read:** " + agent.focus.reads.join(", "));
155
+ lines.push("");
156
+ lines.push("**Write:** " + agent.focus.writes.join(", "));
157
+ lines.push("");
158
+ if (options.context.symbols.length > 0) {
159
+ lines.push("---");
160
+ lines.push("");
161
+ lines.push("## Symbols in Scope");
162
+ lines.push("");
163
+ lines.push(options.context.symbols.map((s) => `- \`${s}\``).join("\n"));
164
+ lines.push("");
165
+ }
166
+ if (options.context.handoffContext) {
167
+ lines.push("---");
168
+ lines.push("");
169
+ lines.push("## Context from Previous Agent");
170
+ lines.push("");
171
+ lines.push(options.context.handoffContext);
172
+ lines.push("");
173
+ }
174
+ lines.push("---");
175
+ lines.push("");
176
+ lines.push("## When Complete");
177
+ lines.push("");
178
+ lines.push("Run:");
179
+ lines.push("```bash");
180
+ lines.push(`paradigm team accept ${handoffId}`);
181
+ lines.push("```");
182
+ lines.push("");
183
+ return lines.join("\n");
184
+ }
185
+ buildPrompt(agent, options) {
186
+ const parts = [];
187
+ parts.push(`You are the ${agent.name.toUpperCase()} agent.`);
188
+ parts.push("");
189
+ parts.push("## Your Role");
190
+ parts.push(agent.role);
191
+ parts.push("");
192
+ parts.push("## Task");
193
+ parts.push(options.task);
194
+ if (options.context.symbols.length > 0) {
195
+ parts.push("");
196
+ parts.push("## Symbols");
197
+ parts.push(options.context.symbols.join(", "));
198
+ }
199
+ return parts.join("\n");
200
+ }
201
+ };
202
+ export {
203
+ ManualProvider
204
+ };