taskgraph-ai 0.52.11 → 0.52.23
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/README.md +1 -1
- package/dist/ai-services-unified-CigO4oTy.js +1 -0
- package/dist/ai-services-unified-kmQRPU0g.js +3 -0
- package/dist/commands-dFNugMWF.js +116 -0
- package/dist/config-manager-C5Ih13nA.js +1 -0
- package/dist/config-manager-DhVH8AQp.js +1 -0
- package/dist/dependency-manager-CCREovZA.js +758 -0
- package/dist/{init-Br1q26E_.js → init-p_pWjmVE.js} +64 -67
- package/dist/mcp-server.js +2 -10
- package/dist/research-blv_5JOT.js +1 -0
- package/dist/response-language-D9UxmXBp.js +1 -0
- package/dist/response-language-ip84ug-k.js +1 -0
- package/dist/src-TZm8h0X-.js +207 -0
- package/dist/src-yE1DeXKG.js +468 -0
- package/dist/tag-management-Br2FX-YC.js +1 -0
- package/dist/task-manager-DWPIhAB7.js +1 -0
- package/dist/taskgraph.js +1 -1
- package/package.json +5 -7
- package/dist/ai-services-unified-BqZ9r6Q8.js +0 -3
- package/dist/ai-services-unified-l4nu72xN.js +0 -1
- package/dist/commands-Yp9dzlw9.js +0 -231
- package/dist/config-manager-B1nHXTtI.js +0 -1
- package/dist/config-manager-IVQuG97S.js +0 -1
- package/dist/dependency-manager-BNuzpRxe.js +0 -1292
- package/dist/research-B4CJNeH-.js +0 -1
- package/dist/response-language-CqZN1IYx.js +0 -1
- package/dist/response-language-Cw_fpdcD.js +0 -1
- package/dist/src-BU-pXNlJ.js +0 -207
- package/dist/tag-management-CkNrbDLJ.js +0 -1
- package/dist/task-manager-BLj8tYbK.js +0 -1
- package/dist/update-subtask-by-id-10dvm_d3.js +0 -1
- package/dist/update-task-by-id-C-cp0e4c.js +0 -1
- package/dist/utils-B1bWwygv.js +0 -1
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a as e}from"./ai-services-unified-kmQRPU0g.js";import{$ as t,Ct as n,Dt as r,Et as i,M as a,Ot as o,Q as s,St as c,Tt as l,_t as u,ht as d,vt as f,wt as ee,xt as p,yt as m}from"./config-manager-DhVH8AQp.js";import{r as h}from"./git-utils--i2q96hv.js";import{D as te,V as g}from"./src-yE1DeXKG.js";import _ from"chalk";import*as v from"node:path";import y from"path";import{execSync as b}from"child_process";import*as x from"node:fs";import S from"fs";import{fileURLToPath as C}from"url";import w from"readline";import ne from"os";import{randomUUID as re}from"crypto";const T=[`claude`];function ie(e){return e.filter(e=>!ae(e))}function ae(e){return T.includes(e)}const E=`tasks.json`,D=`tasks/`;function O(e){return e.trim().replace(/^#/,``).trim()}function k(e){let t=O(e);return t===`tasks.json`||t===`tasks/`}function oe(e,t){return e.map(e=>{if(k(e)){let n=O(e),r=e.match(/\s*$/)[0];return t?`# ${n}${r}`:`${n}${r}`}return e})}function se(e){let t=[],n=!1;for(let r of e)r.trim()===`# Task files`?n=!0:k(r)||(!n||r.trim())&&(n&&r.trim()&&!k(r)&&(n=!1),n||t.push(r));return t}function ce(e,t){return e.filter(e=>{let n=e.trim();return!n||k(e)||n===`# Task files`?!1:!t.has(n)})}function A(e){let t=[`# Task files`];return e?t.push(`# ${E}`,`# ${D} `):t.push(E,`${D} `),t}function le(e,t){if(e.some(k))return e;let n=[...e];for(;n.length>0&&!n[n.length-1].trim();)n.pop();return j(n),n.push(...A(t)),n}function j(e){if(e.some(e=>e.trim())){let t=e[e.length-1];t&&t.trim()&&e.push(``)}}function ue(e,t,n){if(!e||typeof e!=`string`)throw Error(`targetPath must be a non-empty string`);if(!e.endsWith(`.gitignore`))throw Error(`targetPath must end with .gitignore`);if(!t||typeof t!=`string`)throw Error(`content must be a non-empty string`);if(typeof n!=`boolean`)throw Error(`storeTasksInGit must be a boolean`)}function de(e,t,n){try{S.writeFileSync(e,t.join(`
|
|
2
2
|
`)+`
|
|
3
|
-
`),typeof n==`function`&&n(`success`,`Created ${e} with full template`)}catch(t){throw typeof n==`function`&&n(`error`,`Failed to create ${e}: ${t.message}`),t}}function
|
|
4
|
-
`)),a=
|
|
3
|
+
`),typeof n==`function`&&n(`success`,`Created ${e} with full template`)}catch(t){throw typeof n==`function`&&n(`error`,`Failed to create ${e}: ${t.message}`),t}}function fe(e,t,n,r){try{let i=se(S.readFileSync(e,`utf8`).split(`
|
|
4
|
+
`)),a=ce(t,new Set(i.map(e=>e.trim()).filter(e=>e))),o=[...i];a.length>0&&(j(o),o.push(...a)),j(o),o.push(...A(n)),S.writeFileSync(e,o.join(`
|
|
5
5
|
`)+`
|
|
6
|
-
`),typeof r==`function`&&r(`debug`,`Updated ${e} according to user preference${a.length>0?` and merged new content`:``}`)}catch(t){throw typeof r==`function`&&r(`error`,`Failed to merge content with ${e}: ${t.message}`),t}}function
|
|
7
|
-
`)
|
|
8
|
-
`),
|
|
9
|
-
`),
|
|
10
|
-
`),
|
|
6
|
+
`),typeof r==`function`&&r(`debug`,`Updated ${e} according to user preference${a.length>0?` and merged new content`:``}`)}catch(t){throw typeof r==`function`&&r(`error`,`Failed to merge content with ${e}: ${t.message}`),t}}function pe(e){try{if(!S.existsSync(e))return;let t=S.readFileSync(e,`utf8`).split(`
|
|
7
|
+
`).find(e=>O(e)===E);return t===void 0?void 0:t.trim().startsWith(`#`)}catch{return}}function me(e,t,n=!0,r=null){ue(e,t,n);let i=oe(t.split(`
|
|
8
|
+
`),n);S.existsSync(e)?fe(e,i,n,r):de(e,le(i,n),r)}const he=C(import.meta.url),M=y.dirname(he);function N(){let e=[y.join(M,`assets`),y.join(M,`..`,`assets`),y.join(M,`..`,`..`,`public`,`assets`),y.join(process.cwd(),`assets`),y.join(process.cwd(),`node_modules`,`taskgraph-ai`,`dist`,`assets`),y.join(process.cwd(),`node_modules`,`taskgraph-ai`,`assets`)];for(let t of e)if(S.existsSync(t)){let e=y.join(t,`AGENTS.md`);if(S.existsSync(e))return t}throw Error(`Assets directory not found. This is likely a packaging issue.`)}function P(e){let t=N();return y.join(t,e)}function ge(e){try{let t=P(e);return S.existsSync(t)}catch{return!1}}function F(e,t=`utf8`){let n=P(e);return S.readFileSync(n,t)}const I=`taskgraph-ai`;function _e(e){return Array.isArray(e?.args)&&e.args.some(e=>typeof e==`string`&&e.includes(`taskgraph-ai`))}function L(e){let t=JSON.stringify(e,null,` `);return t=t.replace(/(\[\n\t+)([^[\]]+?)(\n\t+\])/g,(e,t,n,r)=>!n.includes(`{`)&&!n.includes(`[`)?`[${n.replace(/\n\t+/g,` `).replace(/\s+/g,` `).trim()}]`:e),t}function ve(e,n){if(!n){t(`debug`,`[MCP Config] No mcpConfigPath provided, skipping MCP configuration setup`);return}let r=y.join(e,n),i=y.dirname(r);t(`debug`,`Setting up MCP configuration at ${r}...`);let a={[I]:{command:`npx`,args:[`-y`,I],env:{TASKGRAPH_TOOLS:`core`}}};if(S.existsSync(i)||S.mkdirSync(i,{recursive:!0}),S.existsSync(r)){t(`debug`,`MCP configuration file already exists, checking for existing taskgraph-ai...`);try{let e=JSON.parse(S.readFileSync(r,`utf8`));if(e.mcpServers||={},Object.values(e.mcpServers).some(_e)){t(`debug`,`Found existing taskgraph-ai MCP configuration in mcp.json, leaving untouched`);return}e.mcpServers[`taskgraph-ai`]?t(`debug`,`taskgraph-ai server already configured in mcp.json`):(e.mcpServers[I]=a[I],t(`debug`,`Added taskgraph-ai server to existing MCP configuration`)),S.writeFileSync(r,L(e)+`
|
|
9
|
+
`),t(`debug`,`Updated MCP configuration file`)}catch(e){t(`error`,`Failed to update MCP configuration: ${e.message}`);let n=`${r}.backup-${Date.now()}`;S.existsSync(r)&&(S.copyFileSync(r,n),t(`warn`,`Saved the old file as ${n}`));let i={mcpServers:a};S.writeFileSync(r,L(i)+`
|
|
10
|
+
`),t(`warn`,`Created new MCP configuration file (backup of original file was created if it existed)`)}}else{let e={mcpServers:a};S.writeFileSync(r,L(e)+`
|
|
11
|
+
`),t(`debug`,`Created MCP configuration file at ${r}`)}t(`debug`,`MCP server will use the installed taskgraph-ai package`)}function R(e){let{name:t,description:n,content:r,argumentHint:i}=e;return{type:`static`,metadata:{name:t,description:n,...i&&{argumentHint:i}},content:r}}function z(e,t,n,r){if(!r.includes(`$ARGUMENTS`))throw Error(`Dynamic slash command "${e}" must contain $ARGUMENTS placeholder`);return{type:`dynamic`,metadata:{name:e,description:t,argumentHint:n},content:r}}const ye=z(`parse-prd`,`Parse PRD`,`<prd-file>`,`Parse a PRD document to generate tasks.
|
|
11
12
|
|
|
12
13
|
Arguments: $ARGUMENTS (PRD file path)
|
|
13
14
|
|
|
@@ -55,7 +56,7 @@ After parsing:
|
|
|
55
56
|
1. Display task summary
|
|
56
57
|
2. Show dependency graph
|
|
57
58
|
3. Suggest task expansion for complex items
|
|
58
|
-
4. Recommend sprint planning`),
|
|
59
|
+
4. Recommend sprint planning`),be=z(`parse-prd-with-research`,`Parse PRD With Research`,`<prd-file>`,`Parse PRD with enhanced research mode for better task generation.
|
|
59
60
|
|
|
60
61
|
Arguments: $ARGUMENTS (PRD file path)
|
|
61
62
|
|
|
@@ -102,7 +103,7 @@ Research mode typically:
|
|
|
102
103
|
- New technology domains
|
|
103
104
|
- Complex requirements
|
|
104
105
|
- Regulatory compliance needed
|
|
105
|
-
- Best practices crucial`),
|
|
106
|
+
- Best practices crucial`),xe=z(`analyze-complexity`,`Analyze Complexity`,`[options]`,`Analyze task complexity and generate expansion recommendations.
|
|
106
107
|
|
|
107
108
|
Arguments: $ARGUMENTS
|
|
108
109
|
|
|
@@ -222,7 +223,7 @@ After analysis:
|
|
|
222
223
|
/taskgraph:expand 5 # Expand specific task
|
|
223
224
|
/taskgraph:expand-all # Expand all recommended
|
|
224
225
|
/taskgraph:complexity-report # View detailed report
|
|
225
|
-
\`\`\``),
|
|
226
|
+
\`\`\``),Se=z(`complexity-report`,`Complexity Report`,`[--file=<path>]`,`Display the task complexity analysis report.
|
|
226
227
|
|
|
227
228
|
Arguments: $ARGUMENTS
|
|
228
229
|
|
|
@@ -338,7 +339,7 @@ Use report for:
|
|
|
338
339
|
After viewing:
|
|
339
340
|
/taskgraph:expand 5
|
|
340
341
|
→ Expand high-complexity task
|
|
341
|
-
\`\`\``),
|
|
342
|
+
\`\`\``),Ce=z(`expand-task`,`Expand Task`,`<task-id>`,`Break down a complex task into subtasks.
|
|
342
343
|
|
|
343
344
|
Arguments: $ARGUMENTS (task ID)
|
|
344
345
|
|
|
@@ -386,7 +387,7 @@ After expansion:
|
|
|
386
387
|
1. Show subtask hierarchy
|
|
387
388
|
2. Update time estimates
|
|
388
389
|
3. Suggest implementation order
|
|
389
|
-
4. Highlight critical path`),
|
|
390
|
+
4. Highlight critical path`),we=R({name:`expand-all-tasks`,description:`Expand All Tasks`,content:`Expand all pending tasks that need subtasks.
|
|
390
391
|
|
|
391
392
|
## Bulk Task Expansion
|
|
392
393
|
|
|
@@ -436,7 +437,7 @@ After bulk expansion:
|
|
|
436
437
|
- Summary of tasks expanded
|
|
437
438
|
- New subtask count
|
|
438
439
|
- Updated complexity metrics
|
|
439
|
-
- Suggested task order`}),
|
|
440
|
+
- Suggested task order`}),Te=z(`add-task`,`Add Task`,`<description>`,`Add new tasks with intelligent parsing and context awareness.
|
|
440
441
|
|
|
441
442
|
Arguments: $ARGUMENTS
|
|
442
443
|
|
|
@@ -513,7 +514,7 @@ Intelligent defaults based on:
|
|
|
513
514
|
- Historical data
|
|
514
515
|
- Current sprint/phase
|
|
515
516
|
|
|
516
|
-
Result: High-quality tasks from minimal input.`),
|
|
517
|
+
Result: High-quality tasks from minimal input.`),Ee=z(`add-subtask`,`Add Subtask`,`<parent-id> <title>`,`Add a subtask to a parent task.
|
|
517
518
|
|
|
518
519
|
Arguments: $ARGUMENTS
|
|
519
520
|
|
|
@@ -588,7 +589,7 @@ taskgraph add-subtask --parent=<id> --task-id=<existing-id>
|
|
|
588
589
|
- Show updated task hierarchy
|
|
589
590
|
- Suggest logical next subtasks
|
|
590
591
|
- Update complexity estimates
|
|
591
|
-
- Recommend subtask order`),
|
|
592
|
+
- Recommend subtask order`),De=z(`remove-task`,`Remove Task`,`<task-id>`,`Remove a task permanently from the project.
|
|
592
593
|
|
|
593
594
|
Arguments: $ARGUMENTS (task ID)
|
|
594
595
|
|
|
@@ -694,7 +695,7 @@ Remove anyway? (y/n)
|
|
|
694
695
|
- Impact preview
|
|
695
696
|
- Removal logging
|
|
696
697
|
- Suggest alternatives
|
|
697
|
-
- No cascade delete of dependents`),
|
|
698
|
+
- No cascade delete of dependents`),Oe=z(`remove-subtask`,`Remove Subtask`,`<subtask-id>`,`Remove a subtask from its parent task.
|
|
698
699
|
|
|
699
700
|
Arguments: $ARGUMENTS
|
|
700
701
|
|
|
@@ -777,7 +778,7 @@ Confirm deletion? (y/n)
|
|
|
777
778
|
- Update parent task status
|
|
778
779
|
- Recalculate estimates
|
|
779
780
|
- Show updated hierarchy
|
|
780
|
-
- Suggest next actions`),
|
|
781
|
+
- Suggest next actions`),ke=z(`remove-subtasks`,`Remove Subtasks`,`<task-id>`,`Clear all subtasks from a specific task.
|
|
781
782
|
|
|
782
783
|
Arguments: $ARGUMENTS (task ID)
|
|
783
784
|
|
|
@@ -862,7 +863,7 @@ Suggest alternatives:
|
|
|
862
863
|
→ Cleared all subtasks from task #5
|
|
863
864
|
→ Updated parent task estimates
|
|
864
865
|
→ Suggestion: Consider re-expanding with better breakdown
|
|
865
|
-
\`\`\``),
|
|
866
|
+
\`\`\``),Ae=R({name:`remove-all-subtasks`,description:`Remove All Subtasks`,content:`Clear all subtasks from all tasks globally.
|
|
866
867
|
|
|
867
868
|
## Global Subtask Clearing
|
|
868
869
|
|
|
@@ -954,7 +955,7 @@ Next steps:
|
|
|
954
955
|
- Review updated task list
|
|
955
956
|
- Re-expand complex tasks as needed
|
|
956
957
|
- Check project timeline
|
|
957
|
-
\`\`\``}),
|
|
958
|
+
\`\`\``}),je=z(`convert-task-to-subtask`,`Convert Task To Subtask`,`<parent-id> <task-id>`,`Convert an existing task into a subtask.
|
|
958
959
|
|
|
959
960
|
Arguments: $ARGUMENTS
|
|
960
961
|
|
|
@@ -1024,7 +1025,7 @@ After: #5.1 "Implement validation" (subtask of #5)
|
|
|
1024
1025
|
- Show new task hierarchy
|
|
1025
1026
|
- List updated dependencies
|
|
1026
1027
|
- Verify project integrity
|
|
1027
|
-
- Suggest related conversions`),
|
|
1028
|
+
- Suggest related conversions`),Me=z(`add-dependency`,`Add Dependency`,`<task-id> <depends-on-id>`,`Add a dependency between tasks.
|
|
1028
1029
|
|
|
1029
1030
|
Arguments: $ARGUMENTS
|
|
1030
1031
|
|
|
@@ -1078,7 +1079,7 @@ After adding dependency:
|
|
|
1078
1079
|
→ Task #5 now depends on Task #3
|
|
1079
1080
|
→ Task #5 is now blocked until #3 completes
|
|
1080
1081
|
→ Suggested: Also consider if #5 needs #4
|
|
1081
|
-
\`\`\``),
|
|
1082
|
+
\`\`\``),Ne=z(`remove-dependency`,`Remove Dependency`,`<task-id> <depends-on-id>`,`Remove a dependency between tasks.
|
|
1082
1083
|
|
|
1083
1084
|
Arguments: $ARGUMENTS
|
|
1084
1085
|
|
|
@@ -1139,7 +1140,7 @@ After removing:
|
|
|
1139
1140
|
→ Removed: Task #5 no longer depends on #3
|
|
1140
1141
|
→ Task #5 is now UNBLOCKED and ready to start
|
|
1141
1142
|
→ Warning: Consider if #5 still needs #2 completed first
|
|
1142
|
-
\`\`\``),
|
|
1143
|
+
\`\`\``),Pe=R({name:`fix-dependencies`,description:`Fix Dependencies`,content:`Automatically fix dependency issues found during validation.
|
|
1143
1144
|
|
|
1144
1145
|
## Automatic Dependency Repair
|
|
1145
1146
|
|
|
@@ -1219,7 +1220,7 @@ Run '/taskgraph:validate-dependencies' to verify fixes
|
|
|
1219
1220
|
- Preview mode available
|
|
1220
1221
|
- Rollback capability
|
|
1221
1222
|
- Change logging
|
|
1222
|
-
- No data loss`}),
|
|
1223
|
+
- No data loss`}),Fe=R({name:`validate-dependencies`,description:`Validate Dependencies`,content:`Validate all task dependencies for issues.
|
|
1223
1224
|
|
|
1224
1225
|
## Dependency Validation
|
|
1225
1226
|
|
|
@@ -1289,7 +1290,7 @@ For each issue found:
|
|
|
1289
1290
|
After validation:
|
|
1290
1291
|
- Run \`/taskgraph:fix-dependencies\` to auto-fix
|
|
1291
1292
|
- Manually adjust problematic dependencies
|
|
1292
|
-
- Rerun to verify fixes`}),
|
|
1293
|
+
- Rerun to verify fixes`}),Ie=R({name:`setup-models`,description:`Setup Models`,content:`Run interactive setup to configure AI models.
|
|
1293
1294
|
|
|
1294
1295
|
## Interactive Model Configuration
|
|
1295
1296
|
|
|
@@ -1330,7 +1331,7 @@ Model choices are saved in \`.taskgraph/config.json\`.
|
|
|
1330
1331
|
After configuration:
|
|
1331
1332
|
- Show usage examples
|
|
1332
1333
|
- Suggest next steps
|
|
1333
|
-
- Verify parse-prd works`}),
|
|
1334
|
+
- Verify parse-prd works`}),Le=R({name:`view-models`,description:`View Models`,content:`View current AI model configuration.
|
|
1334
1335
|
|
|
1335
1336
|
## Model Configuration Display
|
|
1336
1337
|
|
|
@@ -1376,7 +1377,7 @@ Available Models:
|
|
|
1376
1377
|
Based on configuration:
|
|
1377
1378
|
- If Claude Code is missing → Suggest installing and signing in
|
|
1378
1379
|
- If no research model → Explain benefits
|
|
1379
|
-
- If all configured → Show usage tips`}),
|
|
1380
|
+
- If all configured → Show usage tips`}),Re=R({name:`install-taskgraph`,description:`Install TaskGraph`,content:`Check if TaskGraph is installed and install it if needed.
|
|
1380
1381
|
|
|
1381
1382
|
This command helps you get TaskGraph set up globally on your system.
|
|
1382
1383
|
|
|
@@ -1487,7 +1488,7 @@ Try: /taskgraph:init your-prd.md
|
|
|
1487
1488
|
After installation:
|
|
1488
1489
|
1. Run \`/taskgraph:status\` to verify setup
|
|
1489
1490
|
2. Configure AI providers with \`/taskgraph:setup-models\`
|
|
1490
|
-
3. Start using TaskGraph commands!`}),
|
|
1491
|
+
3. Start using TaskGraph commands!`}),ze=R({name:`quick-install-taskgraph`,description:`Quick Install TaskGraph`,content:`Quick install TaskGraph globally if not already installed.
|
|
1491
1492
|
|
|
1492
1493
|
Execute this streamlined installation:
|
|
1493
1494
|
|
|
@@ -1508,7 +1509,7 @@ If you see "command not found" after installation, you may need to:
|
|
|
1508
1509
|
|
|
1509
1510
|
Once installed, you can use all the TaskGraph commands!
|
|
1510
1511
|
|
|
1511
|
-
Quick test: Run \`/taskgraph:help\` to see all available commands.`}),
|
|
1512
|
+
Quick test: Run \`/taskgraph:help\` to see all available commands.`}),Be=z(`to-review`,`To Review`,`<task-id>`,`Set a task's status to review.
|
|
1512
1513
|
|
|
1513
1514
|
Arguments: $ARGUMENTS (task ID)
|
|
1514
1515
|
|
|
@@ -1547,7 +1548,7 @@ When setting to review:
|
|
|
1547
1548
|
- Create review reminders
|
|
1548
1549
|
- Track review duration
|
|
1549
1550
|
- Suggest reviewers based on expertise
|
|
1550
|
-
- Prepare rollback plan if needed`),
|
|
1551
|
+
- Prepare rollback plan if needed`),Ve=z(`to-deferred`,`To Deferred`,`<task-id>`,`Defer a task for later consideration.
|
|
1551
1552
|
|
|
1552
1553
|
Arguments: $ARGUMENTS (task ID)
|
|
1553
1554
|
|
|
@@ -1593,7 +1594,7 @@ When deferring:
|
|
|
1593
1594
|
- Monitor deferral duration
|
|
1594
1595
|
- Alert when criteria met
|
|
1595
1596
|
- Prevent scope creep
|
|
1596
|
-
- Regular review cycles`),
|
|
1597
|
+
- Regular review cycles`),He=z(`to-cancelled`,`To Cancelled`,`<task-id>`,`Cancel a task permanently.
|
|
1597
1598
|
|
|
1598
1599
|
Arguments: $ARGUMENTS (task ID)
|
|
1599
1600
|
|
|
@@ -1647,7 +1648,7 @@ When cancelling:
|
|
|
1647
1648
|
- Keep for reference
|
|
1648
1649
|
- Tag with cancellation reason
|
|
1649
1650
|
- Link to replacement if any
|
|
1650
|
-
- Maintain audit trail`),
|
|
1651
|
+
- Maintain audit trail`),Ue=z(`init-project`,`Init Project`,`[prd-file]`,`Initialize a new TaskGraph project.
|
|
1651
1652
|
|
|
1652
1653
|
Arguments: $ARGUMENTS
|
|
1653
1654
|
|
|
@@ -1696,7 +1697,7 @@ If PRD file provided:
|
|
|
1696
1697
|
\`\`\`
|
|
1697
1698
|
/taskgraph:init my-prd.md
|
|
1698
1699
|
→ Automatically runs parse-prd after init
|
|
1699
|
-
\`\`\``),
|
|
1700
|
+
\`\`\``),We=z(`init-project-quick`,`Init Project Quick`,`[prd-file]`,`Quick initialization with auto-confirmation.
|
|
1700
1701
|
|
|
1701
1702
|
Arguments: $ARGUMENTS
|
|
1702
1703
|
|
|
@@ -1741,7 +1742,7 @@ After quick init:
|
|
|
1741
1742
|
/taskgraph:add-task create initial setup
|
|
1742
1743
|
\`\`\`
|
|
1743
1744
|
|
|
1744
|
-
Perfect for rapid project setup!`);
|
|
1745
|
+
Perfect for rapid project setup!`);R({name:`generate-tasks`,description:`Generate Task Files`,content:`Generate individual task files from tasks.json.
|
|
1745
1746
|
|
|
1746
1747
|
## Task File Generation
|
|
1747
1748
|
|
|
@@ -1853,7 +1854,7 @@ Ready for:
|
|
|
1853
1854
|
- Easy task sharing
|
|
1854
1855
|
- AI tool compatibility
|
|
1855
1856
|
- Offline task access
|
|
1856
|
-
- Backup redundancy`});const
|
|
1857
|
+
- Backup redundancy`});const Ge=[ye,be,xe,Se,Ce,we,Te,Ee,De,Oe,ke,Ae,je,Me,Ne,Pe,Fe,Ie,Le,Re,ze,Be,Ve,He,Ue,We,z(`show-task`,`Show Task`,`<task-id>`,`Show detailed task information with rich context and insights.
|
|
1857
1858
|
|
|
1858
1859
|
Arguments: $ARGUMENTS
|
|
1859
1860
|
|
|
@@ -1934,13 +1935,13 @@ When showing multiple tasks:
|
|
|
1934
1935
|
- Common dependencies
|
|
1935
1936
|
- Optimal completion order
|
|
1936
1937
|
- Parallel work opportunities
|
|
1937
|
-
- Combined complexity analysis`),
|
|
1938
|
+
- Combined complexity analysis`),z(`graph`,`Dependency Graph`,`[task-id]`,`Show the project's tasks as a dependency tree.
|
|
1938
1939
|
|
|
1939
1940
|
Arguments: $ARGUMENTS
|
|
1940
1941
|
|
|
1941
1942
|
1. If the arguments contain a task ID, run \`taskgraph graph --id=<id>\` to show that task and everything that depends on it. Otherwise run \`taskgraph graph\`.
|
|
1942
1943
|
2. Show the output unchanged in a code block.
|
|
1943
|
-
3. Then, in one or two sentences, point out what stands out: the task marked "← next", anything in progress, and any task listed as missing a dependency or stuck in a dependency loop, with the fix command the output suggests.`),
|
|
1944
|
+
3. Then, in one or two sentences, point out what stands out: the task marked "← next", anything in progress, and any task listed as missing a dependency or stuck in a dependency loop, with the fix command the output suggests.`),z(`list-tasks`,`List Tasks`,`[filters]`,`List tasks with intelligent argument parsing.
|
|
1944
1945
|
|
|
1945
1946
|
Parse arguments to determine filters and display options:
|
|
1946
1947
|
- Status: pending, in-progress, done, review, deferred, cancelled
|
|
@@ -1982,7 +1983,7 @@ Let me parse your request intelligently:
|
|
|
1982
1983
|
Based on what you're viewing, suggest next actions:
|
|
1983
1984
|
- Many pending? → Suggest priority order
|
|
1984
1985
|
- Many blocked? → Show dependency resolution
|
|
1985
|
-
- Looking at specific tasks? → Show related tasks`),
|
|
1986
|
+
- Looking at specific tasks? → Show related tasks`),R({name:`list-tasks-with-subtasks`,description:`List Tasks With Subtasks`,content:`List all tasks including their subtasks in a hierarchical view.
|
|
1986
1987
|
|
|
1987
1988
|
This command shows all tasks with their nested subtasks, providing a complete project overview.
|
|
1988
1989
|
|
|
@@ -2010,7 +2011,7 @@ Based on the task hierarchy:
|
|
|
2010
2011
|
- Group by functional areas
|
|
2011
2012
|
- Indicate critical path items
|
|
2012
2013
|
|
|
2013
|
-
This gives you a complete tree view of your project structure.`}),
|
|
2014
|
+
This gives you a complete tree view of your project structure.`}),z(`list-tasks-by-status`,`List Tasks By Status`,`<status>`,`List tasks filtered by a specific status.
|
|
2014
2015
|
|
|
2015
2016
|
Arguments: $ARGUMENTS
|
|
2016
2017
|
|
|
@@ -2048,7 +2049,7 @@ Based on the status filter:
|
|
|
2048
2049
|
- **Done**: Show newly unblocked tasks
|
|
2049
2050
|
- **Review**: Indicate review duration
|
|
2050
2051
|
- **Deferred**: Show reactivation criteria
|
|
2051
|
-
- **Cancelled**: Display impact analysis`),
|
|
2052
|
+
- **Cancelled**: Display impact analysis`),z(`project-status`,`Project Status`,`[focus-area]`,`Enhanced status command with comprehensive project insights.
|
|
2052
2053
|
|
|
2053
2054
|
Arguments: $ARGUMENTS
|
|
2054
2055
|
|
|
@@ -2111,7 +2112,7 @@ Compare to previous periods:
|
|
|
2111
2112
|
- Velocity changes
|
|
2112
2113
|
- Pattern recognition
|
|
2113
2114
|
- Improvement areas
|
|
2114
|
-
- Success patterns to repeat`),
|
|
2115
|
+
- Success patterns to repeat`),z(`next-task`,`Next Task`,`[preference]`,`Intelligently determine and prepare the next action based on comprehensive context.
|
|
2115
2116
|
|
|
2116
2117
|
This enhanced version of 'next' considers:
|
|
2117
2118
|
- Current task states
|
|
@@ -2176,7 +2177,7 @@ Seamlessly connect to:
|
|
|
2176
2177
|
- \`/project:taskgraph:expand\` (if complex)
|
|
2177
2178
|
- \`/project:utils:complexity-report\` (if unsure)
|
|
2178
2179
|
|
|
2179
|
-
The goal: Zero friction from decision to implementation.`),
|
|
2180
|
+
The goal: Zero friction from decision to implementation.`),z(`help`,`Help`,`[command-name]`,"Show help for TaskGraph commands.\n\nArguments: $ARGUMENTS\n\nDisplay help for TaskGraph commands and available options.\n\n## TaskGraph Command Help\n\n### Quick Navigation\n\nType `/taskgraph:` and use tab completion to explore all commands.\n\n### Command Categories\n\n#### 🚀 Setup & Installation\n- `/taskgraph:install-taskgraph` - Comprehensive installation guide\n- `/taskgraph:quick-install-taskgraph` - One-line global install\n\n#### 📋 Project Setup\n- `/taskgraph:init-project` - Initialize new project\n- `/taskgraph:init-project-quick` - Quick setup with auto-confirm\n- `/taskgraph:view-models` - View AI configuration\n- `/taskgraph:setup-models` - Configure AI providers\n\n#### 🎯 Task Generation\n- `/taskgraph:parse-prd` - Generate tasks from PRD\n- `/taskgraph:parse-prd-with-research` - Enhanced parsing\n- `/taskgraph:generate-tasks` - Create task files\n\n#### 📝 Task Management\n- `/taskgraph:list-tasks` - List all tasks\n- `/taskgraph:list-tasks-by-status` - List tasks filtered by status\n- `/taskgraph:list-tasks-with-subtasks` - List tasks with subtasks\n- `/taskgraph:graph` - Show tasks as a dependency tree\n- `/taskgraph:show-task` - Display task details\n- `/taskgraph:add-task` - Create new task\n- `/taskgraph:update-task` - Update single task\n- `/taskgraph:update-tasks-from-id` - Update multiple tasks\n- `/taskgraph:next-task` - Get next task recommendation\n\n#### 🔄 Status Management\n- `/taskgraph:to-pending` - Set task to pending\n- `/taskgraph:to-in-progress` - Set task to in-progress\n- `/taskgraph:to-done` - Set task to done\n- `/taskgraph:to-review` - Set task to review\n- `/taskgraph:to-deferred` - Set task to deferred\n- `/taskgraph:to-cancelled` - Set task to cancelled\n\n#### 🔍 Analysis & Breakdown\n- `/taskgraph:analyze-complexity` - Analyze task complexity\n- `/taskgraph:complexity-report` - View complexity report\n- `/taskgraph:expand-task` - Break down complex task\n- `/taskgraph:expand-all-tasks` - Expand all eligible tasks\n\n#### 🔗 Dependencies\n- `/taskgraph:add-dependency` - Add task dependency\n- `/taskgraph:remove-dependency` - Remove dependency\n- `/taskgraph:validate-dependencies` - Check for issues\n- `/taskgraph:fix-dependencies` - Auto-fix dependency issues\n\n#### 📦 Subtasks\n- `/taskgraph:add-subtask` - Add subtask to task\n- `/taskgraph:convert-task-to-subtask` - Convert task to subtask\n- `/taskgraph:remove-subtask` - Remove subtask\n- `/taskgraph:remove-subtasks` - Clear specific task subtasks\n- `/taskgraph:remove-all-subtasks` - Clear all subtasks\n\n#### 🗑️ Task Removal\n- `/taskgraph:remove-task` - Remove task permanently\n\n#### 🤖 Workflows\n- `/taskgraph:smart-workflow` - Intelligent workflows\n- `/taskgraph:command-pipeline` - Command chaining\n- `/taskgraph:auto-implement-tasks` - Auto-implementation\n\n#### 📊 Utilities\n- `/taskgraph:analyze-project` - Project analysis\n- `/taskgraph:project-status` - Project dashboard\n- `/taskgraph:sync-readme` - Sync README with tasks\n- `/taskgraph:learn` - Interactive learning\n- `/taskgraph:tm-main` - Main TaskGraph interface\n\n### Quick Start Examples\n\n```\n/taskgraph:list-tasks\n/taskgraph:show-task 1.2\n/taskgraph:add-task\n/taskgraph:next-task\n```\n\n### Getting Started\n\n1. Install: `/taskgraph:quick-install-taskgraph`\n2. Initialize: `/taskgraph:init-project-quick`\n3. Learn: `/taskgraph:learn`\n4. Work: `/taskgraph:smart-workflow`\n\nFor detailed command info, run the specific command with `--help` or check command documentation."),z(`to-done`,`To Done`,`<task-id>`,`Mark a task as completed.
|
|
2180
2181
|
|
|
2181
2182
|
Arguments: $ARGUMENTS (task ID)
|
|
2182
2183
|
|
|
@@ -2219,7 +2220,7 @@ taskgraph set-status --id=$ARGUMENTS --status=done
|
|
|
2219
2220
|
- Show impact of completion
|
|
2220
2221
|
- Display unblocked work
|
|
2221
2222
|
- Recognize achievement
|
|
2222
|
-
- Capture lessons learned`),
|
|
2223
|
+
- Capture lessons learned`),z(`to-pending`,`To Pending`,`<task-id>`,`Set a task's status to pending.
|
|
2223
2224
|
|
|
2224
2225
|
Arguments: $ARGUMENTS (task ID)
|
|
2225
2226
|
|
|
@@ -2250,7 +2251,7 @@ After setting to pending:
|
|
|
2250
2251
|
- Update sprint planning if needed
|
|
2251
2252
|
- Notify about freed resources
|
|
2252
2253
|
- Suggest priority reassessment
|
|
2253
|
-
- Log the status change with context`),
|
|
2254
|
+
- Log the status change with context`),z(`to-in-progress`,`To In Progress`,`<task-id>`,`Start working on a task by setting its status to in-progress.
|
|
2254
2255
|
|
|
2255
2256
|
Arguments: $ARGUMENTS (task ID)
|
|
2256
2257
|
|
|
@@ -2285,7 +2286,7 @@ After setting to in-progress:
|
|
|
2285
2286
|
- Estimated completion time based on complexity
|
|
2286
2287
|
- Related files from similar tasks
|
|
2287
2288
|
- Potential blockers to watch for
|
|
2288
|
-
- Recommended first steps`),
|
|
2289
|
+
- Recommended first steps`),z(`update-task`,`Update Task`,`<update-spec>`,`Update tasks with intelligent field detection and bulk operations.
|
|
2289
2290
|
|
|
2290
2291
|
Arguments: $ARGUMENTS
|
|
2291
2292
|
|
|
@@ -2356,7 +2357,7 @@ After updates:
|
|
|
2356
2357
|
- Update sprint/milestone progress
|
|
2357
2358
|
- Log changes with context
|
|
2358
2359
|
|
|
2359
|
-
Result: Flexible, intelligent task updates with safety checks.`),
|
|
2360
|
+
Result: Flexible, intelligent task updates with safety checks.`),z(`update-single-task`,`Update Single Task`,`<task-id> <changes>`,`Update a single specific task with new information.
|
|
2360
2361
|
|
|
2361
2362
|
Arguments: $ARGUMENTS
|
|
2362
2363
|
|
|
@@ -2474,7 +2475,7 @@ Quick syntax for specific fields:
|
|
|
2474
2475
|
- Highlight changes
|
|
2475
2476
|
- Check related tasks
|
|
2476
2477
|
- Update suggestions
|
|
2477
|
-
- Timeline adjustments`),
|
|
2478
|
+
- Timeline adjustments`),z(`update-tasks-from-id`,`Update Tasks From ID`,`<from-id> <changes>`,`Update multiple tasks starting from a specific ID.
|
|
2478
2479
|
|
|
2479
2480
|
Arguments: $ARGUMENTS
|
|
2480
2481
|
|
|
@@ -2581,7 +2582,7 @@ Applied updates:
|
|
|
2581
2582
|
- Summary of changes
|
|
2582
2583
|
- Consistency verification
|
|
2583
2584
|
- Suggest review tasks
|
|
2584
|
-
- Update timeline if needed`),
|
|
2585
|
+
- Update timeline if needed`),R({name:`tm-main`,description:`TaskGraph Main`,content:"# TaskGraph Command Reference\n\nComprehensive command structure for TaskGraph integration with Claude Code.\n\n## Command Organization\n\nCommands are organized hierarchically to match TaskGraph's CLI structure while providing enhanced Claude Code integration.\n\n## Project Setup & Configuration\n\n### `/taskgraph:init`\n- `init-project` - Initialize new project (handles PRD files intelligently)\n- `init-project-quick` - Quick setup with auto-confirmation (-y flag)\n\n### `/taskgraph:models`\n- `view-models` - View current AI model configuration\n- `setup-models` - Interactive model configuration\n- `set-main` - Set primary generation model\n- `set-research` - Set research model\n- `set-fallback` - Set fallback model\n\n## Task Generation\n\n### `/taskgraph:parse-prd`\n- `parse-prd` - Generate tasks from PRD document\n- `parse-prd-with-research` - Enhanced parsing with research mode\n\n### `/taskgraph:generate`\n- `generate-tasks` - Create individual task files from tasks.json\n\n## Task Management\n\n### `/taskgraph:list`\n- `list-tasks` - Smart listing with natural language filters\n- `list-tasks-with-subtasks` - Include subtasks in hierarchical view\n- `list-tasks-by-status` - Filter by specific status\n- `graph` - Dependency tree with the next task marked\n\n### `/taskgraph:set-status`\n- `to-pending` - Reset task to pending\n- `to-in-progress` - Start working on task\n- `to-done` - Mark task complete\n- `to-review` - Submit for review\n- `to-deferred` - Defer task\n- `to-cancelled` - Cancel task\n\n### `/taskgraph:sync-readme`\n- `sync-readme` - Export tasks to README.md with formatting\n\n### `/taskgraph:update`\n- `update-task` - Update tasks with natural language\n- `update-tasks-from-id` - Update multiple tasks from a starting point\n- `update-single-task` - Update specific task\n\n### `/taskgraph:add-task`\n- `add-task` - Add new task with AI assistance\n\n### `/taskgraph:remove-task`\n- `remove-task` - Remove task with confirmation\n\n## Subtask Management\n\n### `/taskgraph:add-subtask`\n- `add-subtask` - Add new subtask to parent\n- `convert-task-to-subtask` - Convert existing task to subtask\n\n### `/taskgraph:remove-subtask`\n- `remove-subtask` - Remove subtask (with optional conversion)\n\n### `/taskgraph:clear-subtasks`\n- `clear-subtasks` - Clear subtasks from specific task\n- `clear-all-subtasks` - Clear all subtasks globally\n\n## Task Analysis & Breakdown\n\n### `/taskgraph:analyze-complexity`\n- `analyze-complexity` - Analyze and generate expansion recommendations\n\n### `/taskgraph:complexity-report`\n- `complexity-report` - Display complexity analysis report\n\n### `/taskgraph:expand`\n- `expand-task` - Break down specific task\n- `expand-all-tasks` - Expand all eligible tasks\n- `with-research` - Enhanced expansion\n\n## Task Navigation\n\n### `/taskgraph:next`\n- `next-task` - Intelligent next task recommendation\n\n### `/taskgraph:show`\n- `show-task` - Display detailed task information\n\n### `/taskgraph:status`\n- `project-status` - Comprehensive project dashboard\n\n## Dependency Management\n\n### `/taskgraph:add-dependency`\n- `add-dependency` - Add task dependency\n\n### `/taskgraph:remove-dependency`\n- `remove-dependency` - Remove task dependency\n\n### `/taskgraph:validate-dependencies`\n- `validate-dependencies` - Check for dependency issues\n\n### `/taskgraph:fix-dependencies`\n- `fix-dependencies` - Automatically fix dependency problems\n\n## Workflows & Automation\n\n### `/taskgraph:workflows`\n- `smart-workflow` - Context-aware intelligent workflow execution\n- `command-pipeline` - Chain multiple commands together\n- `auto-implement-tasks` - Advanced auto-implementation with code generation\n\n## Utilities\n\n### `/taskgraph:utils`\n- `analyze-project` - Deep project analysis and insights\n\n### `/taskgraph:setup`\n- `install-taskgraph` - Comprehensive installation guide\n- `quick-install-taskgraph` - One-line global installation\n\n## Usage Patterns\n\n### Natural Language\nMost commands accept natural language arguments:\n```\n/taskgraph:add-task create user authentication system\n/taskgraph:update mark all API tasks as high priority\n/taskgraph:list show blocked tasks\n```\n\n### ID-Based Commands\nCommands requiring IDs intelligently parse from $ARGUMENTS:\n```\n/taskgraph:show 45\n/taskgraph:expand 23\n/taskgraph:set-status/to-done 67\n```\n\n### Smart Defaults\nCommands provide intelligent defaults and suggestions based on context."}),z(`smart-workflow`,`Smart Workflow`,`[context]`,`Execute an intelligent workflow based on current project state and recent commands.
|
|
2585
2586
|
|
|
2586
2587
|
This command analyzes:
|
|
2587
2588
|
1. Recent commands you've run
|
|
@@ -2635,7 +2636,7 @@ This command learns from your patterns:
|
|
|
2635
2636
|
Example flows detected:
|
|
2636
2637
|
- Morning: standup → next → start
|
|
2637
2638
|
- After lunch: status → continue task
|
|
2638
|
-
- End of day: complete → commit → status`),
|
|
2639
|
+
- End of day: complete → commit → status`),z(`learn`,`Learn`,`[topic]`,`Learn about TaskGraph capabilities through interactive exploration.
|
|
2639
2640
|
|
|
2640
2641
|
Arguments: $ARGUMENTS
|
|
2641
2642
|
|
|
@@ -2737,7 +2738,7 @@ Based on what you asked about, try:
|
|
|
2737
2738
|
[Specific command suggestion based on $ARGUMENTS]
|
|
2738
2739
|
|
|
2739
2740
|
Want to learn more about a specific command?
|
|
2740
|
-
Type: /project:help <command-name>`),
|
|
2741
|
+
Type: /project:help <command-name>`),z(`command-pipeline`,`Command Pipeline`,`<pipeline-spec>`,`Execute a pipeline of commands based on a specification.
|
|
2741
2742
|
|
|
2742
2743
|
Arguments: $ARGUMENTS
|
|
2743
2744
|
|
|
@@ -2813,7 +2814,7 @@ if:idle>1day → prompt-update
|
|
|
2813
2814
|
6. Show summary
|
|
2814
2815
|
|
|
2815
2816
|
This enables complex workflows like:
|
|
2816
|
-
\`parse-prd → expand-all → filter:complex>70 → assign:senior → sprint-plan:weighted\``),
|
|
2817
|
+
\`parse-prd → expand-all → filter:complex>70 → assign:senior → sprint-plan:weighted\``),z(`auto-implement-tasks`,`Auto Implement Tasks`,`[task-id]`,`Enhanced auto-implementation with intelligent code generation and testing.
|
|
2817
2818
|
|
|
2818
2819
|
Arguments: $ARGUMENTS
|
|
2819
2820
|
|
|
@@ -2909,7 +2910,7 @@ After completion:
|
|
|
2909
2910
|
- Suggest follow-up tasks
|
|
2910
2911
|
- Update task relationships
|
|
2911
2912
|
|
|
2912
|
-
Result: High-quality, production-ready implementations.`),
|
|
2913
|
+
Result: High-quality, production-ready implementations.`),z(`analyze-project`,`Analyze Project`,`[focus-area]`,`Advanced project analysis with actionable insights and recommendations.
|
|
2913
2914
|
|
|
2914
2915
|
Arguments: $ARGUMENTS
|
|
2915
2916
|
|
|
@@ -3005,7 +3006,7 @@ High-level summary with:
|
|
|
3005
3006
|
- Recommended actions
|
|
3006
3007
|
- Success probability
|
|
3007
3008
|
|
|
3008
|
-
Result: Data-driven decisions with clear action paths.`),
|
|
3009
|
+
Result: Data-driven decisions with clear action paths.`),z(`sync-readme`,`Sync README`,`[options]`,`Export tasks to README.md with professional formatting.
|
|
3009
3010
|
|
|
3010
3011
|
Arguments: $ARGUMENTS
|
|
3011
3012
|
|
|
@@ -3121,22 +3122,18 @@ Works well with:
|
|
|
3121
3122
|
- CI/CD pipelines
|
|
3122
3123
|
- Project documentation
|
|
3123
3124
|
- Team updates
|
|
3124
|
-
- Client reports`)];var
|
|
3125
|
-
`)}}};function
|
|
3126
|
-
`)||t.includes(`\r`))return{success:!1,message:`Invalid value: must be a single-line string without newlines`};let r=
|
|
3127
|
-
`+
|
|
3128
|
-
`;
|
|
3129
|
-
`),
|
|
3130
|
-
`)}\n\n${i}`}function nt(e){try{let t=JSON.parse(x.readFileSync(e,`utf-8`));for(let e of[`main`,`research`,`fallback`])if(t.models&&t.models[e]){let n=t.models[e].provider,r=t.models[e].modelId;if(c[n]){let i=c[n].find(e=>e.id===r);i&&i.max_tokens&&(t.models[e].maxTokens=i.max_tokens)}}return x.writeFileSync(e,JSON.stringify(t,null,2)),!0}catch(e){return console.error(`Error updating config maxTokens:`,e.message),!1}}const q={debug:0,info:1,warn:2,error:3,success:4},rt=process.env.TASKGRAPH_LOG_LEVEL?q[process.env.TASKGRAPH_LOG_LEVEL.toLowerCase()]:q.info;function it(){f()||h()}function J(e,...t){let n={debug:p.muted(`•`),info:p.brand(`→`),warn:g.yellow(`!`),error:g.red(`✗`),success:g.green(`✓`)};if(q[e]>=rt){let r=n[e]||``;f()||(e===`error`?console.error(r,g.red(...t)):e===`warn`?console.warn(r,g.yellow(...t)):e===`success`?console.log(r,g.green(...t)):e===`info`?console.log(r,p.brand(...t)):console.log(r,...t))}if(process.env.DEBUG===`true`){let n=`[${e.toUpperCase()}] ${t.join(` `)}\n`;x.appendFileSync(`init-debug.log`,n)}}function Y(e){x.existsSync(e)||(x.mkdirSync(e,{recursive:!0}),J(`info`,`Created directory: ${e}`))}function X(){let e=process.env.HOME||process.env.USERPROFILE,t;if(process.env.SHELL?.includes(`zsh`))t=v.join(e,`.zshrc`);else if(process.env.SHELL?.includes(`bash`))t=v.join(e,`.bashrc`);else return J(`debug`,`Could not determine shell type. Aliases not added.`),!1;try{if(!x.existsSync(t))return J(`debug`,`Shell config file ${t} not found.`),!1;let e=x.readFileSync(t,`utf8`),n=[{name:`tm`,line:`alias tm='taskgraph'`},{name:`taskgraph`,line:`alias taskgraph='taskgraph'`}].filter(t=>!e.includes(t.line));if(n.length===0)return J(`debug`,`All TaskGraph aliases already exist.`),!0;let r=n.map(e=>e.line).join(`
|
|
3125
|
+
- Client reports`)];var Ke=class{supportsNestedCommands=!0;get supportsCommands(){return this.commandsDir!==``}formatAll(e){return e.map(e=>this.format(e))}getFilename(e){return this.supportsNestedCommands?`${e}${this.extension}`:`tm-${e}${this.extension}`}transformArgumentPlaceholder(e){return e}postProcess(e){return e}getCommandsPath(e){return this.supportsNestedCommands?v.join(e,this.commandsDir,`tm`):v.join(e,this.commandsDir)}addSlashCommands(e,t){let n=this.getCommandsPath(e),r=[];if(!this.supportsCommands)return{success:!1,count:0,directory:n,files:[],error:`Profile "${this.name}" does not support slash commands`};try{x.existsSync(n)||x.mkdirSync(n,{recursive:!0});let e=this.formatAll(t);for(let t of e){let e=v.join(n,t.filename);x.writeFileSync(e,t.content),r.push(t.filename)}return{success:!0,count:r.length,directory:n,files:r}}catch(e){return{success:!1,count:0,directory:n,files:[],error:e instanceof Error?e.message:String(e)}}}removeSlashCommands(e,t,n=!0){let r=this.getCommandsPath(e),i=[];if(!this.supportsCommands)return{success:!1,count:0,directory:r,files:[],error:`Profile "${this.name}" does not support slash commands`};if(!x.existsSync(r))return{success:!0,count:0,directory:r,files:[]};try{let e=new Set(t.map(e=>{let t=e.metadata.name.toLowerCase();return this.supportsNestedCommands?t:`tm-${t}`})),a=x.readdirSync(r);for(let t of a){let n=v.basename(t,v.extname(t)).toLowerCase();if(e.has(n)){let e=v.join(r,t);x.rmSync(e,{force:!0}),i.push(t)}}return n&&x.readdirSync(r).length===0&&x.rmSync(r,{recursive:!0,force:!0}),{success:!0,count:i.length,directory:r,files:i}}catch(e){return{success:!1,count:i.length,directory:r,files:i,error:e instanceof Error?e.message:String(e)}}}};const B={claude:new class extends Ke{name=`claude`;displayName=`Claude Code`;commandsDir=`.claude/commands`;extension=`.md`;format(e){let t=this.buildHeader(e),n=this.transformArgumentPlaceholder(e.content);return{filename:this.getFilename(e.metadata.name),content:`${t}${n}`}}buildHeader(e){let t=[e.metadata.description,``];return e.metadata.argumentHint&&(t.push(`Arguments: $ARGUMENTS`),t.push(``)),t.join(`
|
|
3126
|
+
`)}}};function qe(e){return B[e.toLowerCase()]}function Je(){let e=ne.homedir(),t=process.env.SHELL||``;if(t.includes(`zsh`))return y.join(e,`.zshrc`);if(t.includes(`bash`)){let t=y.join(e,`.bash_profile`);return process.platform===`darwin`?t:y.join(e,`.bashrc`)}if(t.includes(`fish`))return y.join(e,`.config`,`fish`,`config.fish`);if(process.platform===`win32`){if(process.env.PSModulePath){let t=process.env.PROFILE||y.join(e,`Documents`,`WindowsPowerShell`,`Microsoft.PowerShell_profile.ps1`),n=y.join(e,`Documents`,`PowerShell`,`Microsoft.PowerShell_profile.ps1`);return S.existsSync(n)?n:S.existsSync(t)?t:n}let t=y.join(e,`.bashrc`);if(S.existsSync(t))return t}let n=y.join(e,`.zshrc`);if(S.existsSync(n))return n;let r=y.join(e,`.bashrc`);return S.existsSync(r)?r:null}function V(e){return e.endsWith(`.ps1`)}function H(e){return e.includes(`config.fish`)}function Ye(e,t,n){if(!/^[A-Z_][A-Z0-9_]*$/i.test(e))return{success:!1,message:`Invalid environment variable name: ${e}. Must start with a letter or underscore and contain only alphanumeric characters and underscores.`};if(typeof t!=`string`||t.includes(`
|
|
3127
|
+
`)||t.includes(`\r`))return{success:!1,message:`Invalid value: must be a single-line string without newlines`};let r=Je();if(!r)return{success:!1,message:`Could not determine shell type (zsh, bash, fish, or PowerShell)`};try{let i=y.dirname(r);if(S.existsSync(i)||S.mkdirSync(i,{recursive:!0}),!S.existsSync(r)){let e=process.platform===`darwin`&&r.endsWith(`.bash_profile`);if(V(r)||e)S.writeFileSync(r,``);else return{success:!1,shellConfigFile:r,message:`Shell config file ${r} not found`}}let a=S.readFileSync(r,`utf8`),o;if(o=V(r)?RegExp(`^\\s*\\$env:${e}\\s*=`,`m`).test(a):H(r)?RegExp(`^\\s*set\\s+-[gux]*x[gux]*\\s+${e}\\s+`,`m`).test(a):RegExp(`^\\s*export\\s+${e}\\s*=`,`m`).test(a),o)return{success:!0,shellConfigFile:r,message:`${e} already configured`,alreadyExists:!0};let s,c;V(r)?(s=`$env:${e} = "${t.replace(/["`$]/g,"`$&")}"`,c=`#`):H(r)?(s=`set -gx ${e} '${t.replace(/'/g,`'\\''`)}'`,c=`#`):(s=`export ${e}='${t.replace(/'/g,`'\\''`)}'`,c=`#`);let l=`\n${n?`${c} ${n}\n`:``}${s}\n`;return S.appendFileSync(r,l),{success:!0,shellConfigFile:r,message:`Added ${e} to ${r}`}}catch(e){return{success:!1,shellConfigFile:r,message:`Failed to modify shell config: ${e.message}`}}}function Xe(){return Ye(`ENABLE_EXPERIMENTAL_MCP_CLI`,`true`,`Claude Code deferred MCP loading (added by TaskGraph)`)}function Ze(e){let{name:n,displayName:r=n,profileDir:i=`.${n.toLowerCase()}`,rulesDir:a=`${i}/rules`,mcpConfig:o=!0,mcpConfigName:s=o?`mcp.json`:null,fileMap:c={},onAdd:l,onPostConvert:u}=e,d=s?y.join(i,s):null,f=null;try{let e=qe(n);e?.supportsCommands&&(f={profile:e,commands:Ge})}catch(e){t(`debug`,`[${r}] Slash command profile lookup failed: ${e.message}`)}return{profileName:n,displayName:r,profileDir:i,rulesDir:a,mcpConfig:o,mcpConfigName:s,mcpConfigPath:d,fileMap:c,slashCommands:f,...l&&{onAddRulesProfile:l},...u&&{onPostConvertRulesProfile:u}}}function Qe(e,n){let r=y.join(n,`AGENTS.md`),i=y.join(e,`CLAUDE.md`),a=y.join(e,`.taskgraph`,`CLAUDE.md`),o=`@./.taskgraph/CLAUDE.md`,s=`\n## TaskGraph Instructions\n**Import TaskGraph's development workflow commands and guidelines, treat as if import is in the main CLAUDE.md file.**\n${o}`;if(S.existsSync(r))try{let n=y.join(e,`.taskgraph`);if(S.existsSync(n)||S.mkdirSync(n,{recursive:!0}),S.copyFileSync(r,a),t(`debug`,`[Claude] Created TaskGraph instructions at ${a}`),S.existsSync(i)){let e=S.readFileSync(i,`utf8`);if(e.includes(o))t(`debug`,`[Claude] TaskGraph import already present in ${i}`);else{let n=e.trim()+`
|
|
3128
|
+
`+s+`
|
|
3129
|
+
`;S.writeFileSync(i,n),t(`debug`,`[Claude] Added TaskGraph import to existing ${i}`)}}else{let e=`# Claude Code Instructions\n${s}\n`;S.writeFileSync(i,e),t(`debug`,`[Claude] Created ${i} with TaskGraph import`)}}catch(e){t(`error`,`[Claude] Failed to set up Claude instructions: ${e.message}`)}let c=Xe();c.success?c.alreadyExists?t(`debug`,`[Claude] Deferred MCP loading already configured`):t(`debug`,`[Claude] Enabled deferred MCP loading in ${c.shellConfigFile}`):t(`debug`,`[Claude] Could not configure deferred loading: ${c.message}`)}function $e(e){let t={};if(e.mcpServers){t.mcpServers={};for(let[n,r]of Object.entries(e.mcpServers)){let e={};e.type=`stdio`,r.command&&(e.command=r.command),r.args&&(e.args=r.args),r.env&&(e.env=r.env),Object.keys(r).forEach(t=>{[`command`,`args`,`env`,`type`].includes(t)||(e[t]=r[t])}),t.mcpServers[n]=e}}return t}function et(e,n){let r=y.join(e,`.mcp.json`);if(S.existsSync(r))try{let e=$e(JSON.parse(S.readFileSync(r,`utf8`)));S.writeFileSync(r,JSON.stringify(e,null,` `)+`
|
|
3130
|
+
`),t(`debug`,`[Claude] Transformed MCP configuration to Claude format at ${r}`)}catch(e){t(`error`,`[Claude] Failed to transform MCP configuration: ${e.message}`)}}const tt=Ze({name:`claude`,displayName:`Claude Code`,profileDir:`.`,rulesDir:`.`,mcpConfigName:`.mcp.json`,fileMap:{"AGENTS.md":`.taskgraph/CLAUDE.md`},onAdd:Qe,onPostConvert:et});var nt=/* @__PURE__ */ e({claudeProfile:()=>tt});function rt(e){return T.includes(e)}function it(e){if(!rt(e))return null;let t=nt[`${e}Profile`];if(!t)throw Error(`Profile not found: static import missing for '${e}'. Valid profiles: ${T.join(`, `)}`);return t}function at(e,n){let r=y.join(e,n.rulesDir),i=0;if(typeof n.onAddRulesProfile==`function`)try{n.onAddRulesProfile(r,N()),t(`debug`,`[Rule Transformer] Called onAddRulesProfile for ${n.profileName}`)}catch(e){t(`error`,`[Rule Transformer] onAddRulesProfile failed for ${n.profileName}: ${e.message}`),i++}if(n.mcpConfig!==!1)try{ve(e,n.mcpConfigPath),t(`debug`,`[Rule Transformer] Setup MCP configuration for ${n.profileName}`)}catch(e){t(`error`,`[Rule Transformer] MCP setup failed for ${n.profileName}: ${e.message}`)}if(typeof n.onPostConvertRulesProfile==`function`)try{n.onPostConvertRulesProfile(r,N()),t(`debug`,`[Rule Transformer] Called onPostConvertRulesProfile for ${n.profileName}`)}catch(e){t(`error`,`[Rule Transformer] onPostConvertRulesProfile failed for ${n.profileName}: ${e.message}`)}if(n.slashCommands)try{let r=n.slashCommands.profile.addSlashCommands(e,n.slashCommands.commands);r.success?t(`debug`,`[Rule Transformer] Created ${r.count} slash commands in ${r.directory}`):t(`error`,`[Rule Transformer] Failed to add slash commands for ${n.profileName}: ${r.error}`)}catch(e){t(`error`,`[Rule Transformer] Slash commands failed for ${n.profileName}: ${e.message}`)}return{success:1,failed:i}}function ot(e){try{let t=JSON.parse(S.readFileSync(e,`utf-8`));for(let e of[`main`,`research`,`fallback`])if(t.models&&t.models[e]){let n=t.models[e].provider,r=t.models[e].modelId;if(a[n]){let i=a[n].find(e=>e.id===r);i&&i.max_tokens&&(t.models[e].maxTokens=i.max_tokens)}}return S.writeFileSync(e,JSON.stringify(t,null,2)),!0}catch(e){return console.error(`Error updating config maxTokens:`,e.message),!1}}const U=`alias tm='taskgraph'`,W=`ENABLE_EXPERIMENTAL_MCP_CLI`,G={debug:0,info:1,warn:2,error:3,success:4},st=process.env.TASKGRAPH_LOG_LEVEL?G[process.env.TASKGRAPH_LOG_LEVEL.toLowerCase()]:G.info;function ct(){s()||g()}function K(e,...t){let n={debug:d.muted(`•`),info:d.brand(`→`),warn:_.yellow(`!`),error:_.red(`✗`),success:_.green(`✓`)};if(G[e]>=st){let r=n[e]||``;s()||(e===`error`?console.error(r,_.red(...t)):e===`warn`?console.warn(r,_.yellow(...t)):e===`success`?console.log(r,_.green(...t)):e===`info`?console.log(r,d.brand(...t)):console.log(r,...t))}if(process.env.DEBUG===`true`){let n=`[${e.toUpperCase()}] ${t.join(` `)}\n`;S.appendFileSync(`init-debug.log`,n)}}function lt(e,...t){K(e===`warn`||e===`error`?e:`debug`,...t)}function q(e){S.existsSync(e)||(S.mkdirSync(e,{recursive:!0}),K(`debug`,`Created directory: ${e}`))}function J(){let e=process.env.HOME||process.env.USERPROFILE;return e?[`.zshrc`,`.bashrc`,`.bash_profile`,`.profile`].map(t=>y.join(e,t)):[]}function ut(e){return[y.join(e,c),y.join(e,p),y.join(e,r),y.join(e,`.git`),y.join(e,m),y.join(e,u),y.join(e,`CLAUDE.md`),y.join(e,`.mcp.json`),...J()]}function Y(e){let t=/* @__PURE__ */ new Map;for(let n of e){let e=null;try{S.existsSync(n)&&(e=S.statSync(n).isDirectory()?``:S.readFileSync(n,`utf8`))}catch{e=null}t.set(n,e)}return t}function dt(e,t,n){let r=t=>y.join(e,t),i=e=>t.get(e)==null&&n.get(e)!=null,a=e=>t.get(e)!=null&&n.get(e)!=null&&t.get(e)!==n.get(e),o=t.get(r(`.taskgraph/config.json`))!=null||t.get(r(`.taskgraph/tasks/tasks.json`))!=null,s=[];!o&&n.get(r(`.taskgraph/config.json`))!=null?s.push({path:`${c}/`,note:`tasks, settings and PRD templates`}):o&&i(r(`.taskgraph/config.json`))&&s.push({path:p,note:`restored`}),i(r(`.git`))&&s.push({path:`.git/`,note:`new Git repository`});let l=[[m,`created`,`added TaskGraph entries`],[u,`optional settings`,`updated`],[`CLAUDE.md`,`loads TaskGraph's instructions in Claude Code`,`now imports TaskGraph's instructions`],[`.mcp.json`,`TaskGraph MCP server for Claude Code`,`added the TaskGraph MCP server`]];for(let[e,t,n]of l){let o=r(e);i(o)?s.push({path:e,note:t}):a(o)&&s.push({path:e,note:n})}let d=process.env.HOME||process.env.USERPROFILE;for(let e of J()){let r=t.get(e)||``,i=n.get(e)||``;if(i===r)continue;let a=[];i.includes(U)&&!r.includes(U)&&a.push("the `tm` alias"),i.includes(W)&&!r.includes(W)&&a.push(`deferred MCP loading`),a.length!==0&&s.push({path:d?e.replace(d,`~`):e,note:`added ${a.join(` and `)}; open a new terminal`})}return{alreadySetUp:o,changes:s}}function ft(){let e=process.env.HOME||process.env.USERPROFILE,t;if(process.env.SHELL?.includes(`zsh`))t=y.join(e,`.zshrc`);else if(process.env.SHELL?.includes(`bash`))t=y.join(e,`.bashrc`);else return K(`debug`,`Could not determine shell type. Aliases not added.`),!1;try{if(!S.existsSync(t))return K(`debug`,`Shell config file ${t} not found.`),!1;let e=S.readFileSync(t,`utf8`),n=[{name:`tm`,line:U}].filter(t=>!e.includes(t.line));if(n.length===0)return K(`debug`,`All TaskGraph aliases already exist.`),!0;let r=n.map(e=>e.line).join(`
|
|
3131
3131
|
`),i=`
|
|
3132
3132
|
# TaskGraph aliases added on ${(/* @__PURE__ */ new Date()).toLocaleDateString()}
|
|
3133
3133
|
${r}
|
|
3134
|
-
`;return
|
|
3134
|
+
`;return S.appendFileSync(t,i),K(`debug`,`Added ${n.length} alias(es): ${n.map(e=>e.name).join(`, `)}`),!0}catch(e){return K(`debug`,`Failed to add aliases: ${e.message}`),!1}}function pt(e){let t=y.join(e,l);if(S.existsSync(t)){K(`debug`,`State file already exists, preserving current configuration`);return}let n={currentTag:`master`,lastSwitched:(/* @__PURE__ */ new Date()).toISOString(),branchTagMapping:{},migrationNoticeShown:!0};try{S.writeFileSync(t,JSON.stringify(n,null,2)),K(`debug`,`Created initial state file: ${t}`)}catch(e){K(`error`,`Failed to create state file: ${e.message}`)}}function mt(e){let t=y.join(e,r);if(S.existsSync(t))return;let n={master:{tasks:[],metadata:{created:(/* @__PURE__ */ new Date()).toISOString(),description:`Tasks for master context`}}};try{S.writeFileSync(t,`${JSON.stringify(n,null,2)}\n`),K(`debug`,`Created empty tasks file: ${t}`)}catch(e){K(`error`,`Failed to create tasks file: ${e.message}`)}}function X(e,t,n={}){if(!ge(e)){K(`error`,`Source file not found: ${e}`);return}let r=F(e,`utf8`);if(Object.entries(n).forEach(([e,t])=>{let n=RegExp(`\\{\\{${e}\\}\\}`,`g`);r=r.replace(n,t)}),S.existsSync(t)){let e=y.basename(t);if(e===`.gitignore`){K(`debug`,`${t} already exists, merging content...`);let e=S.readFileSync(t,`utf8`),n=new Set(e.split(`
|
|
3135
3135
|
`).map(e=>e.trim())),i=r.split(`
|
|
3136
3136
|
`).filter(e=>!n.has(e.trim()));if(i.length>0){let n=`${e.trim()}\n\n# Added by TaskGraph\n${i.join(`
|
|
3137
|
-
`)}`;
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
`),r(e)})})}function st(){return D()}function ct(e){try{if(!x.existsSync(e)){J(`warn`,`Config file does not exist, skipping storage configuration`);return}let t=x.readFileSync(e,`utf8`),n=JSON.parse(t);n.storage||={},n.storage.type=`file`,n.storage.operatingMode=`solo`,J(`debug`,`Configured storage for local file storage`),x.writeFileSync(e,JSON.stringify(n,null,2)),J(`debug`,`Storage configuration updated in config.json`)}catch(e){J(`error`,`Failed to update storage configuration: ${e.message}`)}}async function $(e,c,l,d,p,h=O){let _=process.cwd();J(`debug`,`Initializing project in ${_}`),Y(v.join(_,a)),Y(v.join(_,i)),Y(v.join(_,u)),Y(v.join(_,t)),Y(v.join(_,o)),at(_);let b={year:(/* @__PURE__ */ new Date()).getFullYear()};function x(e){let t=et(e);t?tt(_,t):J(`warn`,`Unknown rule profile: ${e}`)}Z(`env.example`,v.join(_,n),b),Z(`config.json`,v.join(_,r),{...b});let S=v.join(_,r);nt(S)?J(`debug`,`Updated config with correct maxTokens values`):J(`debug`,`Could not update maxTokens in config`),ct(S);try{let e=R(`gitignore`,`utf8`);de(v.join(_,s),e,l,J)}catch(e){J(`error`,`Failed to create .gitignore: ${e.message}`)}Z(`example_prd.txt`,v.join(_,ee)),Z(`example_prd_rpg.txt`,v.join(_,o,`example_prd_rpg.txt`));try{c===!1?J(`info`,`Git initialization skipped due to --no-git flag.`):c===!0?m()?J(`debug`,`Existing Git repository detected – skipping git init despite --git flag.`):(J(`info`,`Initializing Git repository due to --git flag...`),y(`git init`,{cwd:_,stdio:`ignore`}),J(`success`,`Git repository initialized`)):m()?J(`debug`,`Existing Git repository detected – skipping git init.`):(J(`info`,`No Git repository detected. Initializing one in project root...`),y(`git init`,{cwd:_,stdio:`ignore`}),J(`success`,`Git repository initialized`))}catch{J(`warn`,`Git not available, skipping repository initialization`)}if(h.length>0){J(`info`,`Setting up Claude Code integration...`);for(let e of h)x(e)}if(e&&X(),f()&&J(`info`,`Running npm install silently...`),p.preferredLanguage&&!d)try{let e=(await import(`./response-language-Cw_fpdcD.js`)).default;e(p.preferredLanguage,{projectRoot:_,silent:!0}),J(`debug`,`Response language set to: ${p.preferredLanguage}`)}catch(e){J(`warn`,`Failed to set response language: ${e.message}`)}else f()&&!d?J(`debug`,`Skipping response language setup in silent (MCP) mode.`):d&&J(`debug`,`DRY RUN: Skipping response language setup.`);if(!f()&&!d&&!p?.yes){console.log(C(g.cyan(`Configuring AI Models...`),{padding:.5,margin:{top:1,bottom:.5},borderStyle:`round`,borderColor:`cyan`,width:60})),J(`info`,`Running interactive model setup. Please select your preferred AI models.`);try{y(`npx taskgraph models --setup`,{stdio:`inherit`,cwd:_}),J(`success`,`AI Models configured.`)}catch(e){J(`error`,`Failed to configure AI models:`,e.message),J(`warn`,`You may need to run "taskgraph models --setup" manually.`)}}else f()&&!d?(J(`info`,`Skipping interactive model setup in silent (MCP) mode.`),J(`warn`,`Please configure AI models using "taskgraph models --set-..." or the "models" MCP tool.`)):d?J(`info`,`DRY RUN: Skipping interactive model setup.`):p?.yes&&(J(`info`,`Skipping interactive model setup due to --yes flag.`),J(`info`,`Default AI models will be used. You can configure different models later using "taskgraph models --setup" or "taskgraph models --set-..." commands.`));if(e&&!d?(J(`debug`,`Adding shell aliases...`),X()&&J(`debug`,`Shell aliases added successfully`)):e&&d&&J(`debug`,`DRY RUN: Would add shell aliases (tm, taskgraph)`),f()||console.log(C(`${te.multiline(T.textSync(`Success!`,{font:`Standard`}))}\n${g.green(`Project initialized successfully!`)}`,{padding:1,margin:1,borderStyle:`double`,borderColor:`green`,width:60})),!f()){let e=K();console.log(C(g.yellow.bold(`Workflow
|
|
3141
|
-
`)+`
|
|
3142
|
-
`+e,{padding:1,margin:{top:0,bottom:1,left:0,right:0},borderStyle:`round`,borderColor:`yellow`,width:60}))}}export{O as n,ne as r,ot as t};
|
|
3137
|
+
`)}`;S.writeFileSync(t,n),K(`debug`,`Updated ${t} with additional entries`)}else K(`debug`,`No new content to add to ${t}`);return}if(e===`README-taskgraph.md`){K(`debug`,`${t} already exists`);let e=y.join(y.dirname(t),`README-taskgraph.md`);S.writeFileSync(e,r),K(`debug`,`Created ${e} (preserved original README-taskgraph.md)`);return}K(`debug`,`${t} already exists, skipping.`)}else S.writeFileSync(t,r),K(`debug`,`Created file: ${t}`)}async function ht(e={}){s()||ct(),e.git===!0?e.initGit=!0:e.git===!1&&(e.initGit=!1),e.gitTasks===!0?e.storeTasksInGit=!0:e.gitTasks===!1&&(e.storeTasksInGit=!1);let t=e.yes||e.name&&e.description,n;if(n=e.rulesExplicitlyProvided?e.rules:[],t){e.name,e.description,e.version,e.author;let t=e.dryRun||!1,r=e.initGit===void 0||e.initGit,i=e.storeTasksInGit??pe(y.join(process.cwd(),`.gitignore`))??!0;if(t)return $(r,i),{dryRun:!0};await Q(e.aliases!==!1,r,i,t,{...e,preferredLanguage:`English`},n)}else{K(`debug`,`Required options not provided, proceeding with prompts.`);let t;try{K(`debug`,`Init started - taskgraph_id: ${gt()}`),t=w.createInterface({input:process.stdin,output:process.stdout});let r=!0,i=!0;r=e.initGit===void 0?h()?!0:(await Z(t,_.cyan(`Initialize a Git repository in project root? (Y/n): `),e=>{let t=e.trim().toLowerCase()!==`n`,n=t?_.green(`✓`):_.dim(`–`);return _.cyan(`Initialize a Git repository in project root?`)+` `+n+` `+_.dim(t?`Yes`:`No`)})).trim().toLowerCase()!==`n`:e.initGit,i=e.storeTasksInGit===void 0?(await Z(t,_.cyan(`Store tasks in Git (tasks.json and tasks/ directory)? (Y/n): `),e=>{let t=e.trim().toLowerCase()!==`n`,n=t?_.green(`✓`):_.dim(`–`);return _.cyan(`Store tasks in Git (tasks.json and tasks/ directory)?`)+` `+n+` `+_.dim(t?`Yes`:`No`)})).trim().toLowerCase()!==`n`:e.storeTasksInGit;let a=!1;e.rulesExplicitlyProvided?K(`debug`,`Using rule profiles provided via command line: ${n.join(`, `)}`):a=(await Z(t,_.cyan(`Set up Claude Code integration (CLAUDE.md import)? (y/N): `),e=>{let t=e.trim().toLowerCase()===`y`,n=t?_.green(`✓`):_.dim(`–`);return _.cyan(`Set up Claude Code integration?`)+` `+n+` `+_.dim(t?`Yes`:`No`)})).trim().toLowerCase()===`y`;let o=(await Z(t,_.cyan(`Language for AI responses (English): `),e=>`${_.cyan(`Language for AI responses?`)} ${_.dim(e.trim()||`English`)}`)).trim()||`English`,s=e.dryRun||!1;if(s)return t.close(),$(r,i),{dryRun:!0};await Q(e.aliases!==!1,r,i,s,{...e,shouldSetupRules:a,preferredLanguage:o},a?T:n),t.close()}catch(e){t&&t.close(),K(`error`,`Error during initialization process: ${e.message}`),process.exit(1)}}}function Z(e,t,n){return new Promise(r=>{e.question(t,e=>{w.moveCursor(process.stdout,0,-1),w.cursorTo(process.stdout,0),w.clearLine(process.stdout,0),n&&process.stdout.write(n(e)+`
|
|
3138
|
+
`),r(e)})})}function gt(){return re()}function _t(e){try{if(!S.existsSync(e)){K(`warn`,`Config file does not exist, skipping storage configuration`);return}let t=S.readFileSync(e,`utf8`),n=JSON.parse(t);n.storage||={},n.storage.type=`file`,n.storage.operatingMode=`solo`,K(`debug`,`Configured storage for local file storage`),S.writeFileSync(e,JSON.stringify(n,null,2)),K(`debug`,`Storage configuration updated in config.json`)}catch(e){K(`error`,`Failed to update storage configuration: ${e.message}`)}}async function Q(e,t,r,a,l,d=T){let g=process.cwd();K(`debug`,`Initializing project in ${g}`);let _=s()?[]:ut(g),v=Y(_);q(y.join(g,c)),q(y.join(g,i)),q(y.join(g,n)),q(y.join(g,ee)),q(y.join(g,o)),pt(g),mt(g);let x={year:(/* @__PURE__ */ new Date()).getFullYear()};function S(e){let t=it(e);t?at(g,t):K(`warn`,`Unknown rule profile: ${e}`)}X(`env.example`,y.join(g,u),x),X(`config.json`,y.join(g,p),{...x});let C=y.join(g,p);ot(C)?K(`debug`,`Updated config with correct maxTokens values`):K(`debug`,`Could not update maxTokens in config`),_t(C);try{let e=F(`gitignore`,`utf8`);me(y.join(g,m),e,r,lt)}catch(e){K(`error`,`Failed to create .gitignore: ${e.message}`)}X(`example_prd.txt`,y.join(g,f)),X(`example_prd_rpg.txt`,y.join(g,o,`example_prd_rpg.txt`));try{t===!1?K(`debug`,`Git initialization skipped due to --no-git flag.`):h()?K(`debug`,`Existing Git repository detected; skipping git init.`):(b(`git init`,{cwd:g,stdio:`ignore`}),K(`debug`,`Git repository initialized`))}catch{K(`warn`,`Git not available, skipping repository initialization`)}if(d.length>0){K(`debug`,`Setting up Claude Code integration...`);for(let e of d)S(e)}if(l.preferredLanguage&&!a)try{let e=(await import(`./response-language-D9UxmXBp.js`)).default;e(l.preferredLanguage,{projectRoot:g,silent:!0}),K(`debug`,`Response language set to: ${l.preferredLanguage}`)}catch(e){K(`warn`,`Failed to set response language: ${e.message}`)}if(!s()&&!a&&!l?.yes){console.log(``);try{b(`"${process.execPath}" "${process.argv[1]}" models --setup --no-banner`,{stdio:`inherit`,cwd:g}),console.log(``)}catch{K(`warn`,"Model setup did not finish; run `taskgraph models --setup` to retry")}}else s()&&!a&&K(`debug`,`Skipping interactive model setup in silent (MCP) mode.`);if(e&&!a&&ft(),!s()){let{alreadySetUp:e,changes:t}=dt(g,v,Y(_));console.log(`${te({folder:y.basename(g),changes:t,alreadySetUp:e,claudeCode:d.includes(`claude`),defaultModels:!!l?.yes})}\n`)}}function $(e,t){if(s())return;let n=[`Dry run; nothing was changed. Init would:`,` create ${c}/ with tasks, settings and PRD templates`,` create or update ${m} and ${u}`];e!==!1&&!h()&&n.push(` start a Git repository`),n.push(t?` keep tasks in Git`:` keep tasks out of Git`),console.log(n.join(`
|
|
3139
|
+
`))}export{T as n,ie as r,ht as t};
|