@mindfoldhq/trellis 0.6.5 → 0.6.7
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/cli/index.js +1 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/channel/guard.d.ts.map +1 -1
- package/dist/commands/channel/guard.js +7 -2
- package/dist/commands/channel/guard.js.map +1 -1
- package/dist/commands/channel/store/paths.d.ts +14 -0
- package/dist/commands/channel/store/paths.d.ts.map +1 -1
- package/dist/commands/channel/store/paths.js +26 -0
- package/dist/commands/channel/store/paths.js.map +1 -1
- package/dist/commands/channel/supervisor/stdout.d.ts +7 -5
- package/dist/commands/channel/supervisor/stdout.d.ts.map +1 -1
- package/dist/commands/channel/supervisor/stdout.js +65 -18
- package/dist/commands/channel/supervisor/stdout.js.map +1 -1
- package/dist/commands/channel/supervisor.d.ts +13 -0
- package/dist/commands/channel/supervisor.d.ts.map +1 -1
- package/dist/commands/channel/supervisor.js +36 -16
- package/dist/commands/channel/supervisor.js.map +1 -1
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/uninstall.d.ts +9 -0
- package/dist/commands/uninstall.d.ts.map +1 -1
- package/dist/commands/uninstall.js +74 -4
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.d.ts +29 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +128 -58
- package/dist/commands/update.js.map +1 -1
- package/dist/configurators/copilot.d.ts +1 -0
- package/dist/configurators/copilot.d.ts.map +1 -1
- package/dist/configurators/copilot.js +4 -1
- package/dist/configurators/copilot.js.map +1 -1
- package/dist/configurators/index.d.ts.map +1 -1
- package/dist/configurators/index.js +7 -1
- package/dist/configurators/index.js.map +1 -1
- package/dist/configurators/omp.d.ts +11 -0
- package/dist/configurators/omp.d.ts.map +1 -0
- package/dist/configurators/omp.js +51 -0
- package/dist/configurators/omp.js.map +1 -0
- package/dist/configurators/shared.d.ts +7 -0
- package/dist/configurators/shared.d.ts.map +1 -1
- package/dist/configurators/shared.js +27 -0
- package/dist/configurators/shared.js.map +1 -1
- package/dist/configurators/zcode.d.ts +3 -3
- package/dist/configurators/zcode.js +12 -12
- package/dist/configurators/zcode.js.map +1 -1
- package/dist/migrations/manifests/0.6.6.json +17 -0
- package/dist/migrations/manifests/0.6.7.json +9 -0
- package/dist/templates/codex/hooks/session-start.py +6 -6
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-agents.md +1 -1
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-skills-or-commands.md +1 -1
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/bundled-skills.md +2 -1
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/generated-files.md +2 -2
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md +1 -1
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.md +3 -3
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md +19 -2
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/skills-and-commands.md +1 -1
- package/dist/templates/common/bundled-skills/trellis-session-insight/SKILL.md +1 -1
- package/dist/templates/copilot/copilot-instructions.md +11 -0
- package/dist/templates/copilot/hooks/session-start.py +6 -6
- package/dist/templates/copilot/index.d.ts +6 -1
- package/dist/templates/copilot/index.d.ts.map +1 -1
- package/dist/templates/copilot/index.js +8 -1
- package/dist/templates/copilot/index.js.map +1 -1
- package/dist/templates/omp/agents/trellis-check.md +41 -0
- package/dist/templates/omp/agents/trellis-implement.md +45 -0
- package/dist/templates/omp/agents/trellis-research.md +30 -0
- package/dist/templates/omp/extensions/trellis/index.ts.txt +462 -0
- package/dist/templates/omp/index.d.ts +4 -0
- package/dist/templates/omp/index.d.ts.map +1 -0
- package/dist/templates/omp/index.js +9 -0
- package/dist/templates/omp/index.js.map +1 -0
- package/dist/templates/pi/extensions/trellis/index.ts.txt +47 -21
- package/dist/templates/shared-hooks/inject-workflow-state.py +5 -5
- package/dist/templates/shared-hooks/session-start.py +7 -7
- package/dist/templates/trellis/scripts/add_session.py +65 -17
- package/dist/templates/trellis/scripts/common/cli_adapter.py +36 -1
- package/dist/templates/trellis/scripts/common/config.py +29 -0
- package/dist/templates/trellis/scripts/common/io.py +20 -3
- package/dist/templates/trellis/scripts/common/session_context.py +1 -1
- package/dist/templates/trellis/scripts/common/task_store.py +90 -19
- package/dist/templates/trellis/scripts/common/task_utils.py +22 -0
- package/dist/templates/trellis/scripts/task.py +8 -2
- package/dist/templates/trellis/workflow.md +13 -13
- package/dist/templates/zcode/agents/trellis-research.md +133 -0
- package/dist/templates/zcode/index.d.ts +6 -5
- package/dist/templates/zcode/index.d.ts.map +1 -1
- package/dist/templates/zcode/index.js +6 -5
- package/dist/templates/zcode/index.js.map +1 -1
- package/dist/types/ai-tools.d.ts +3 -3
- package/dist/types/ai-tools.d.ts.map +1 -1
- package/dist/types/ai-tools.js +29 -2
- package/dist/types/ai-tools.js.map +1 -1
- package/dist/utils/atomic-write.d.ts +12 -0
- package/dist/utils/atomic-write.d.ts.map +1 -0
- package/dist/utils/atomic-write.js +30 -0
- package/dist/utils/atomic-write.js.map +1 -0
- package/dist/utils/file-writer.d.ts.map +1 -1
- package/dist/utils/file-writer.js +6 -5
- package/dist/utils/file-writer.js.map +1 -1
- package/dist/utils/registry-config.d.ts.map +1 -1
- package/dist/utils/registry-config.js +3 -2
- package/dist/utils/registry-config.js.map +1 -1
- package/dist/utils/template-fetcher.d.ts.map +1 -1
- package/dist/utils/template-fetcher.js +36 -4
- package/dist/utils/template-fetcher.js.map +1 -1
- package/dist/utils/template-hash.d.ts.map +1 -1
- package/dist/utils/template-hash.js +2 -1
- package/dist/utils/template-hash.js.map +1 -1
- package/dist/utils/uninstall-scrubbers.d.ts +1 -0
- package/dist/utils/uninstall-scrubbers.d.ts.map +1 -1
- package/dist/utils/uninstall-scrubbers.js +19 -0
- package/dist/utils/uninstall-scrubbers.js.map +1 -1
- package/package.json +2 -2
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
Task Management Script.
|
|
5
5
|
|
|
6
6
|
Usage:
|
|
7
|
-
python3 task.py create "<title>" [--slug <name>] [--assignee <dev>] [--priority P0|P1|P2|P3] [--parent <dir>] [--package <pkg>]
|
|
7
|
+
python3 task.py create "<title>" [--slug <name>] [--assignee <dev>] [--priority P0|P1|P2|P3] [--parent <dir>] [--package <pkg>] [--no-start]
|
|
8
8
|
python3 task.py add-context <dir> <file> <path> [reason] # Add jsonl entry
|
|
9
9
|
python3 task.py validate <dir> # Validate jsonl files
|
|
10
10
|
python3 task.py list-context <dir> # List jsonl entries
|
|
@@ -307,6 +307,7 @@ Usage:
|
|
|
307
307
|
python3 task.py create <title> Create new task directory
|
|
308
308
|
python3 task.py create <title> --package <pkg> Create task for a specific package
|
|
309
309
|
python3 task.py create <title> --parent <dir> Create task as child of parent
|
|
310
|
+
python3 task.py create <title> --no-start Create without making it active in this session
|
|
310
311
|
python3 task.py add-context <dir> <jsonl> <path> [reason] Add entry to jsonl
|
|
311
312
|
python3 task.py validate <dir> Validate jsonl files
|
|
312
313
|
python3 task.py list-context <dir> List jsonl entries
|
|
@@ -392,12 +393,17 @@ def main() -> int:
|
|
|
392
393
|
# create
|
|
393
394
|
p_create = subparsers.add_parser("create", help="Create new task")
|
|
394
395
|
p_create.add_argument("title", help="Task title")
|
|
395
|
-
p_create.add_argument("--slug", "-s", help="Task slug")
|
|
396
|
+
p_create.add_argument("--slug", "-s", help="Task slug without the MM-DD date prefix")
|
|
396
397
|
p_create.add_argument("--assignee", "-a", help="Assignee developer")
|
|
397
398
|
p_create.add_argument("--priority", "-p", default="P2", help="Priority (P0-P3)")
|
|
398
399
|
p_create.add_argument("--description", "-d", help="Task description")
|
|
399
400
|
p_create.add_argument("--parent", help="Parent task directory (establishes subtask link)")
|
|
400
401
|
p_create.add_argument("--package", help="Package name for monorepo projects")
|
|
402
|
+
p_create.add_argument(
|
|
403
|
+
"--no-start",
|
|
404
|
+
action="store_true",
|
|
405
|
+
help="Create the task without making it active in this session",
|
|
406
|
+
)
|
|
401
407
|
|
|
402
408
|
# add-context
|
|
403
409
|
p_add = subparsers.add_parser("add-context", help="Add context entry")
|
|
@@ -183,7 +183,7 @@ Complex task: ask the user if you can create a Trellis task and enter the planni
|
|
|
183
183
|
- 1.0 Create task `[required · once]` (only after task-creation consent)
|
|
184
184
|
- 1.1 Requirement exploration `[required · repeatable]` (`prd.md`; complex tasks also need `design.md` + `implement.md`)
|
|
185
185
|
- 1.2 Research `[optional · repeatable]`
|
|
186
|
-
- 1.3 Configure context `[required · once]` — Claude Code, Cursor, OpenCode, Codex, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix (sub-agent-dispatch platforms only; inline platforms skip)
|
|
186
|
+
- 1.3 Configure context `[required · once]` — Claude Code, Cursor, OpenCode, Codex, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, Oh My Pi, ZCode, Reasonix (sub-agent-dispatch platforms only; inline platforms skip)
|
|
187
187
|
- 1.4 Activate task `[required · once]` (review gate, then `task.py start`; status → in_progress)
|
|
188
188
|
- 1.5 Completion criteria
|
|
189
189
|
|
|
@@ -272,13 +272,13 @@ Code committed. Run `/trellis:finish-work`; if dirty, return to Phase 3.4 first.
|
|
|
272
272
|
|
|
273
273
|
When a user request matches one of these intents inside an active task, route first, then load the detailed phase step if needed.
|
|
274
274
|
|
|
275
|
-
[Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix, Trae]
|
|
275
|
+
[Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, Oh My Pi, ZCode, Reasonix, Trae]
|
|
276
276
|
|
|
277
277
|
- Planning or unclear requirements -> `trellis-brainstorm`.
|
|
278
278
|
- `in_progress` implementation/check -> dispatch `trellis-implement` / `trellis-check`.
|
|
279
279
|
- Repeated debugging -> `trellis-break-loop`; spec updates -> `trellis-update-spec`.
|
|
280
280
|
|
|
281
|
-
[/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix, Trae]
|
|
281
|
+
[/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, Oh My Pi, ZCode, Reasonix, Trae]
|
|
282
282
|
|
|
283
283
|
[codex-inline, Kilo, Antigravity, Devin]
|
|
284
284
|
|
|
@@ -353,7 +353,7 @@ Return to this step whenever requirements change and revise the relevant artifac
|
|
|
353
353
|
|
|
354
354
|
Research can happen at any time during requirement exploration. It isn't limited to local code — you can use any available tool (MCP servers, skills, web search, etc.) to look up external information, including third-party library docs, industry practices, API references, etc.
|
|
355
355
|
|
|
356
|
-
[Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix, Trae]
|
|
356
|
+
[Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, Oh My Pi, ZCode, Reasonix, Trae]
|
|
357
357
|
|
|
358
358
|
Spawn the research sub-agent:
|
|
359
359
|
|
|
@@ -361,7 +361,7 @@ Spawn the research sub-agent:
|
|
|
361
361
|
- **Task description**: Research <specific question>
|
|
362
362
|
- **Key requirement**: Research output MUST be persisted to `{TASK_DIR}/research/`
|
|
363
363
|
|
|
364
|
-
[/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix, Trae]
|
|
364
|
+
[/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, Oh My Pi, ZCode, Reasonix, Trae]
|
|
365
365
|
|
|
366
366
|
[codex-inline, Kilo, Antigravity, Devin]
|
|
367
367
|
|
|
@@ -380,7 +380,7 @@ Brainstorm and research can interleave freely — pause to research a technical
|
|
|
380
380
|
|
|
381
381
|
#### 1.3 Configure context `[required · once]`
|
|
382
382
|
|
|
383
|
-
[Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix, Trae]
|
|
383
|
+
[Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, Oh My Pi, ZCode, Reasonix, Trae]
|
|
384
384
|
|
|
385
385
|
Curate `implement.jsonl` and `check.jsonl` so the Phase 2 sub-agents get the right spec/research context. These files were seeded on `task create` with a single self-describing `_example` line; your job here is to fill in real entries.
|
|
386
386
|
|
|
@@ -425,7 +425,7 @@ Ready gate: both `implement.jsonl` and `check.jsonl` must contain at least one r
|
|
|
425
425
|
|
|
426
426
|
Skip this step only when both files already have real curated entries.
|
|
427
427
|
|
|
428
|
-
[/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix, Trae]
|
|
428
|
+
[/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, Oh My Pi, ZCode, Reasonix, Trae]
|
|
429
429
|
|
|
430
430
|
[codex-inline, Kilo, Antigravity, Devin]
|
|
431
431
|
|
|
@@ -458,11 +458,11 @@ If `task.py start` errors with a session-identity message (no context key from h
|
|
|
458
458
|
| `design.md` exists (complex tasks) | ✅ |
|
|
459
459
|
| `implement.md` exists (complex tasks) | ✅ |
|
|
460
460
|
|
|
461
|
-
[Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix, Trae]
|
|
461
|
+
[Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, Oh My Pi, ZCode, Reasonix, Trae]
|
|
462
462
|
|
|
463
463
|
| `implement.jsonl` and `check.jsonl` each contain at least one real curated entry (seed row does not count) | ✅ |
|
|
464
464
|
|
|
465
|
-
[/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix, Trae]
|
|
465
|
+
[/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, Oh My Pi, ZCode, Reasonix, Trae]
|
|
466
466
|
|
|
467
467
|
---
|
|
468
468
|
|
|
@@ -472,7 +472,7 @@ Goal: turn reviewed planning artifacts into code that passes quality checks.
|
|
|
472
472
|
|
|
473
473
|
#### 2.1 Implement `[required · repeatable]`
|
|
474
474
|
|
|
475
|
-
[Claude Code, Cursor, OpenCode, CodeBuddy, Droid, Pi]
|
|
475
|
+
[Claude Code, Cursor, OpenCode, CodeBuddy, Droid, Pi, Oh My Pi]
|
|
476
476
|
|
|
477
477
|
Spawn the implement sub-agent:
|
|
478
478
|
|
|
@@ -484,7 +484,7 @@ The platform hook/plugin auto-handles:
|
|
|
484
484
|
- Reads `implement.jsonl` and injects referenced spec/research files into the agent prompt
|
|
485
485
|
- Injects `prd.md`, `design.md` if present, and `implement.md` if present
|
|
486
486
|
|
|
487
|
-
[/Claude Code, Cursor, OpenCode, CodeBuddy, Droid, Pi]
|
|
487
|
+
[/Claude Code, Cursor, OpenCode, CodeBuddy, Droid, Pi, Oh My Pi]
|
|
488
488
|
|
|
489
489
|
[codex-sub-agent, Gemini, Qoder, Copilot, ZCode, Reasonix, Trae]
|
|
490
490
|
|
|
@@ -526,7 +526,7 @@ The platform prelude auto-handles the context load requirement:
|
|
|
526
526
|
|
|
527
527
|
#### 2.2 Quality check `[required · repeatable]`
|
|
528
528
|
|
|
529
|
-
[Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix, Trae]
|
|
529
|
+
[Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, Oh My Pi, ZCode, Reasonix, Trae]
|
|
530
530
|
|
|
531
531
|
Spawn the check sub-agent:
|
|
532
532
|
|
|
@@ -540,7 +540,7 @@ The check agent's job:
|
|
|
540
540
|
- Auto-fix issues it finds
|
|
541
541
|
- Run lint and typecheck to verify
|
|
542
542
|
|
|
543
|
-
[/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix, Trae]
|
|
543
|
+
[/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, Oh My Pi, ZCode, Reasonix, Trae]
|
|
544
544
|
|
|
545
545
|
[codex-inline, Kilo, Antigravity, Devin]
|
|
546
546
|
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: trellis-research
|
|
3
|
+
description: |
|
|
4
|
+
Code and tech search expert. Finds files, patterns, and tech solutions, and PERSISTS every finding to the current task's research/ directory. No code modifications outside that directory.
|
|
5
|
+
color: "#4f46e5"
|
|
6
|
+
---
|
|
7
|
+
# Research Agent
|
|
8
|
+
|
|
9
|
+
You are the Research Agent in the Trellis workflow.
|
|
10
|
+
|
|
11
|
+
## Core Principle
|
|
12
|
+
|
|
13
|
+
**You do one thing: find, explain, and PERSIST information.**
|
|
14
|
+
|
|
15
|
+
Conversations get compacted; files don't. Every research output MUST end up as a file under `{TASK_DIR}/research/`. Returning findings only through the chat reply is a failure - the caller cannot read them next session.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Core Responsibilities
|
|
20
|
+
|
|
21
|
+
1. **Internal Search** - locate files/components, understand code logic, discover patterns
|
|
22
|
+
2. **External Search** - library docs, API references, best practices
|
|
23
|
+
3. **Persist** - write each research topic to `{TASK_DIR}/research/<topic>.md`
|
|
24
|
+
4. **Report** - return file paths + one-line summaries to the main agent, not full content
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Workflow
|
|
29
|
+
|
|
30
|
+
### Step 1: Resolve Current Task
|
|
31
|
+
|
|
32
|
+
Run `python3 ./.trellis/scripts/task.py current --source` to get the active task path. If no active task is set, ask the user where to write output; do NOT guess.
|
|
33
|
+
|
|
34
|
+
Ensure `{TASK_DIR}/research/` exists before writing findings.
|
|
35
|
+
|
|
36
|
+
### Step 2: Understand Search Request
|
|
37
|
+
|
|
38
|
+
Classify the request as internal, external, or mixed. Determine scope and expected output shape.
|
|
39
|
+
|
|
40
|
+
### Step 3: Execute Search
|
|
41
|
+
|
|
42
|
+
Run independent searches in parallel where possible. Read relevant source files, specs, and documentation before forming conclusions.
|
|
43
|
+
|
|
44
|
+
### Step 4: Persist Each Topic
|
|
45
|
+
|
|
46
|
+
For each distinct research topic, write a markdown file at `{TASK_DIR}/research/<topic-slug>.md` using the File Format below.
|
|
47
|
+
|
|
48
|
+
### Step 5: Report to Main Agent
|
|
49
|
+
|
|
50
|
+
Reply with ONLY:
|
|
51
|
+
|
|
52
|
+
- List of files written, paths relative to repo root
|
|
53
|
+
- One-line summary per file
|
|
54
|
+
- Any critical caveats that the main agent needs to know right now
|
|
55
|
+
|
|
56
|
+
Do NOT paste full research content into the reply. The files are the contract.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Scope Limits
|
|
61
|
+
|
|
62
|
+
### Write Allowed
|
|
63
|
+
|
|
64
|
+
- `{TASK_DIR}/research/*.md` - your own output
|
|
65
|
+
- Creating `{TASK_DIR}/research/` if it doesn't exist
|
|
66
|
+
|
|
67
|
+
### Write Forbidden
|
|
68
|
+
|
|
69
|
+
- Code files (`src/`, `lib/`, etc.)
|
|
70
|
+
- Spec files (`.trellis/spec/`) - main agent should use the update-spec skill instead
|
|
71
|
+
- `.trellis/scripts/`, `.trellis/workflow.md`, platform config (`.zcode/`, `.claude/`, `.cursor/`, etc.)
|
|
72
|
+
- Other task directories
|
|
73
|
+
- Any git operation
|
|
74
|
+
|
|
75
|
+
If the user asks you to edit code, decline and suggest spawning `trellis-implement` instead.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## File Format
|
|
80
|
+
|
|
81
|
+
Each `{TASK_DIR}/research/<topic>.md` should follow:
|
|
82
|
+
|
|
83
|
+
```markdown
|
|
84
|
+
# Research: <topic>
|
|
85
|
+
|
|
86
|
+
- Query: <original query>
|
|
87
|
+
- Scope: internal / external / mixed
|
|
88
|
+
- Date: YYYY-MM-DD
|
|
89
|
+
|
|
90
|
+
## Findings
|
|
91
|
+
|
|
92
|
+
### Files Found
|
|
93
|
+
|
|
94
|
+
| File Path | Description |
|
|
95
|
+
|---|---|
|
|
96
|
+
| `src/services/xxx.ts` | Main implementation |
|
|
97
|
+
| `src/types/xxx.ts` | Type definitions |
|
|
98
|
+
|
|
99
|
+
### Code Patterns
|
|
100
|
+
|
|
101
|
+
<describe patterns, cite file:line>
|
|
102
|
+
|
|
103
|
+
### External References
|
|
104
|
+
|
|
105
|
+
- [Library X docs](url) - <why relevant, version constraints>
|
|
106
|
+
|
|
107
|
+
### Related Specs
|
|
108
|
+
|
|
109
|
+
- `.trellis/spec/xxx.md` - <description>
|
|
110
|
+
|
|
111
|
+
## Caveats / Not Found
|
|
112
|
+
|
|
113
|
+
<anything incomplete or uncertain>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Guidelines
|
|
119
|
+
|
|
120
|
+
### Do
|
|
121
|
+
|
|
122
|
+
- Provide specific file paths and line numbers
|
|
123
|
+
- Quote actual code snippets only when they are relevant
|
|
124
|
+
- Persist every topic to its own file
|
|
125
|
+
- Return file paths in your reply, not the full content
|
|
126
|
+
- Mark "not found" explicitly when searches come up empty
|
|
127
|
+
|
|
128
|
+
### Don't
|
|
129
|
+
|
|
130
|
+
- Don't write code or modify files outside `{TASK_DIR}/research/`
|
|
131
|
+
- Don't guess uncertain info
|
|
132
|
+
- Don't paste full research text into the reply
|
|
133
|
+
- Don't propose implementation changes unless the main agent explicitly asked for research options
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
* ZCode template module.
|
|
3
3
|
*
|
|
4
4
|
* ZCode (智谱) is an agentic AI coding tool that supports multi-agent
|
|
5
|
-
* collaboration. It stores agents as `.zcode/
|
|
5
|
+
* collaboration. It stores agents as `.zcode/agents/<name>.md`
|
|
6
6
|
* (Markdown with YAML frontmatter: name, description, color).
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* trellis-implement and trellis-check use pull-based context injection.
|
|
9
|
+
* trellis-research is intentionally standalone: it does not receive the
|
|
10
|
+
* implement/check prelude, and persists findings under the active task's
|
|
11
|
+
* research directory instead.
|
|
11
12
|
*/
|
|
12
13
|
import { type AgentTemplate } from "../template-utils.js";
|
|
13
|
-
/** Sub-agent definitions (trellis-implement, trellis-check). */
|
|
14
|
+
/** Sub-agent definitions (trellis-implement, trellis-check, trellis-research). */
|
|
14
15
|
export declare function getAllAgents(): AgentTemplate[];
|
|
15
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/zcode/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/zcode/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAwB,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAIhF,kFAAkF;AAClF,wBAAgB,YAAY,IAAI,aAAa,EAAE,CAE9C"}
|
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
* ZCode template module.
|
|
3
3
|
*
|
|
4
4
|
* ZCode (智谱) is an agentic AI coding tool that supports multi-agent
|
|
5
|
-
* collaboration. It stores agents as `.zcode/
|
|
5
|
+
* collaboration. It stores agents as `.zcode/agents/<name>.md`
|
|
6
6
|
* (Markdown with YAML frontmatter: name, description, color).
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* trellis-implement and trellis-check use pull-based context injection.
|
|
9
|
+
* trellis-research is intentionally standalone: it does not receive the
|
|
10
|
+
* implement/check prelude, and persists findings under the active task's
|
|
11
|
+
* research directory instead.
|
|
11
12
|
*/
|
|
12
13
|
import { createTemplateReader } from "../template-utils.js";
|
|
13
14
|
const { listMdAgents } = createTemplateReader(import.meta.url);
|
|
14
|
-
/** Sub-agent definitions (trellis-implement, trellis-check). */
|
|
15
|
+
/** Sub-agent definitions (trellis-implement, trellis-check, trellis-research). */
|
|
15
16
|
export function getAllAgents() {
|
|
16
17
|
return listMdAgents();
|
|
17
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/zcode/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/zcode/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,oBAAoB,EAAsB,MAAM,sBAAsB,CAAC;AAEhF,MAAM,EAAE,YAAY,EAAE,GAAG,oBAAoB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/D,kFAAkF;AAClF,MAAM,UAAU,YAAY;IAC1B,OAAO,YAAY,EAAE,CAAC;AACxB,CAAC"}
|
package/dist/types/ai-tools.d.ts
CHANGED
|
@@ -6,16 +6,16 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* Supported AI coding tools
|
|
8
8
|
*/
|
|
9
|
-
export type AITool = "claude-code" | "cursor" | "opencode" | "codex" | "kilo" | "kiro" | "gemini" | "antigravity" | "devin" | "qoder" | "codebuddy" | "copilot" | "droid" | "pi" | "reasonix" | "zcode" | "trae";
|
|
9
|
+
export type AITool = "claude-code" | "cursor" | "opencode" | "codex" | "kilo" | "kiro" | "gemini" | "antigravity" | "devin" | "qoder" | "codebuddy" | "copilot" | "droid" | "pi" | "reasonix" | "zcode" | "trae" | "omp";
|
|
10
10
|
/**
|
|
11
11
|
* Template directory categories
|
|
12
12
|
*/
|
|
13
|
-
export type TemplateDir = "common" | "claude" | "cursor" | "opencode" | "codex" | "kilo" | "kiro" | "gemini" | "antigravity" | "devin" | "qoder" | "codebuddy" | "copilot" | "droid" | "pi" | "reasonix" | "zcode" | "trae";
|
|
13
|
+
export type TemplateDir = "common" | "claude" | "cursor" | "opencode" | "codex" | "kilo" | "kiro" | "gemini" | "antigravity" | "devin" | "qoder" | "codebuddy" | "copilot" | "droid" | "pi" | "reasonix" | "zcode" | "trae" | "omp";
|
|
14
14
|
/**
|
|
15
15
|
* CLI flag names for platform selection (e.g., --claude, --cursor, --kilo, --kiro, --gemini, --antigravity)
|
|
16
16
|
* Must match keys in InitOptions (src/commands/init.ts)
|
|
17
17
|
*/
|
|
18
|
-
export type CliFlag = "claude" | "cursor" | "opencode" | "codex" | "kilo" | "kiro" | "gemini" | "antigravity" | "devin" | "qoder" | "codebuddy" | "copilot" | "droid" | "pi" | "reasonix" | "zcode" | "trae";
|
|
18
|
+
export type CliFlag = "claude" | "cursor" | "opencode" | "codex" | "kilo" | "kiro" | "gemini" | "antigravity" | "devin" | "qoder" | "codebuddy" | "copilot" | "droid" | "pi" | "reasonix" | "zcode" | "trae" | "omp";
|
|
19
19
|
/**
|
|
20
20
|
* Template context for placeholder resolution.
|
|
21
21
|
* Controls how common templates are rendered per platform.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-tools.d.ts","sourceRoot":"","sources":["../../src/types/ai-tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,MAAM,GACd,aAAa,GACb,QAAQ,GACR,UAAU,GACV,OAAO,GACP,MAAM,GACN,MAAM,GACN,QAAQ,GACR,aAAa,GACb,OAAO,GACP,OAAO,GACP,WAAW,GACX,SAAS,GACT,OAAO,GACP,IAAI,GACJ,UAAU,GACV,OAAO,GACP,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ai-tools.d.ts","sourceRoot":"","sources":["../../src/types/ai-tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,MAAM,GACd,aAAa,GACb,QAAQ,GACR,UAAU,GACV,OAAO,GACP,MAAM,GACN,MAAM,GACN,QAAQ,GACR,aAAa,GACb,OAAO,GACP,OAAO,GACP,WAAW,GACX,SAAS,GACT,OAAO,GACP,IAAI,GACJ,UAAU,GACV,OAAO,GACP,MAAM,GACN,KAAK,CAAC;AAEV;;GAEG;AACH,MAAM,MAAM,WAAW,GACnB,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,OAAO,GACP,MAAM,GACN,MAAM,GACN,QAAQ,GACR,aAAa,GACb,OAAO,GACP,OAAO,GACP,WAAW,GACX,SAAS,GACT,OAAO,GACP,IAAI,GACJ,UAAU,GACV,OAAO,GACP,MAAM,GACN,KAAK,CAAC;AAEV;;;GAGG;AACH,MAAM,MAAM,OAAO,GACf,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,OAAO,GACP,MAAM,GACN,MAAM,GACN,QAAQ,GACR,aAAa,GACb,OAAO,GACP,OAAO,GACP,WAAW,GACX,SAAS,GACT,OAAO,GACP,IAAI,GACJ,UAAU,GACV,OAAO,GACP,MAAM,GACN,KAAK,CAAC;AAEV;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,yDAAyD;IACzD,YAAY,EAAE,WAAW,GAAG,WAAW,GAAG,GAAG,GAAG,GAAG,GAAG,iBAAiB,CAAC;IACxE,8DAA8D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|
extraManagedPaths: [
|
|
204
204
|
".github/agents",
|
|
205
|
+
".github/copilot-instructions.md",
|
|
205
206
|
".github/hooks",
|
|
206
207
|
".github/prompts",
|
|
207
208
|
".github/skills",
|
|
@@ -270,8 +271,18 @@ export const AI_TOOLS = {
|
|
|
270
271
|
name: "ZCode",
|
|
271
272
|
templateDirs: ["common", "zcode"],
|
|
272
273
|
configDir: ".zcode",
|
|
273
|
-
|
|
274
|
-
|
|
274
|
+
// `.zcode/cli/agents` is the pre-ZCode-update discovery path. Kept managed
|
|
275
|
+
// during the transition so `trellis update --migrate` (rename-dir →
|
|
276
|
+
// `.zcode/agents/`) and `trellis uninstall` can clean up the now-empty
|
|
277
|
+
// `.zcode/cli/` parent. Drop this entry once the migration has shipped and
|
|
278
|
+
// no project still holds the legacy dir. Only empty dirs are ever removed,
|
|
279
|
+
// so user files are never touched (see cleanupEmptyDirs in update.ts).
|
|
280
|
+
extraManagedPaths: [
|
|
281
|
+
".zcode/cli/agents",
|
|
282
|
+
".zcode/agents",
|
|
283
|
+
".zcode/commands",
|
|
284
|
+
".zcode/skills",
|
|
285
|
+
],
|
|
275
286
|
cliFlag: "zcode",
|
|
276
287
|
defaultChecked: false,
|
|
277
288
|
hasPythonHooks: false,
|
|
@@ -300,6 +311,22 @@ export const AI_TOOLS = {
|
|
|
300
311
|
cliFlag: "trae",
|
|
301
312
|
},
|
|
302
313
|
},
|
|
314
|
+
omp: {
|
|
315
|
+
name: "Oh My Pi",
|
|
316
|
+
templateDirs: ["common", "omp"],
|
|
317
|
+
configDir: ".omp",
|
|
318
|
+
cliFlag: "omp",
|
|
319
|
+
defaultChecked: false,
|
|
320
|
+
hasPythonHooks: false,
|
|
321
|
+
templateContext: {
|
|
322
|
+
cmdRefPrefix: "/trellis:",
|
|
323
|
+
executorAI: "Bash scripts or Task calls",
|
|
324
|
+
userActionLabel: "Slash commands",
|
|
325
|
+
agentCapable: true,
|
|
326
|
+
hasHooks: true,
|
|
327
|
+
cliFlag: "omp",
|
|
328
|
+
},
|
|
329
|
+
},
|
|
303
330
|
};
|
|
304
331
|
/**
|
|
305
332
|
* Get the configuration for a specific AI tool
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-tools.js","sourceRoot":"","sources":["../../src/types/ai-tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"ai-tools.js","sourceRoot":"","sources":["../../src/types/ai-tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAwIH;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAiC;IACpD,aAAa,EAAE;QACb,IAAI,EAAE,aAAa;QACnB,YAAY,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;QAClC,SAAS,EAAE,SAAS;QACpB,OAAO,EAAE,QAAQ;QACjB,cAAc,EAAE,IAAI;QACpB,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE;YACf,YAAY,EAAE,WAAW;YACzB,UAAU,EAAE,4BAA4B;YACxC,eAAe,EAAE,gBAAgB;YACjC,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,QAAQ;SAClB;KACF;IACD,MAAM,EAAE;QACN,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;QAClC,SAAS,EAAE,SAAS;QACpB,OAAO,EAAE,QAAQ;QACjB,cAAc,EAAE,IAAI;QACpB,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE;YACf,YAAY,EAAE,WAAW;YACzB,UAAU,EAAE,4BAA4B;YACxC,eAAe,EAAE,gBAAgB;YACjC,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,QAAQ;SAClB;KACF;IACD,QAAQ,EAAE;QACR,IAAI,EAAE,UAAU;QAChB,YAAY,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC;QACpC,SAAS,EAAE,WAAW;QACtB,OAAO,EA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AAa,CAAC,IAAY;IACxC,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;AACxB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC9B,MAAM,KAAK,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACjC,IAAI,MAAM,CAAC,mBAAmB,EAAE,CAAC;QAC/B,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAC/B,CAAC;IACD,IAAI,MAAM,CAAC,iBAAiB,EAAE,CAAC;QAC7B,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Write a file atomically: stream into a temp file in the same directory,
|
|
3
|
+
* then rename it over the target. A crash, Ctrl-C, or ENOSPC mid-write
|
|
4
|
+
* leaves the original file intact (or absent) — never truncated or
|
|
5
|
+
* half-written. The temp file shares the target's directory so the rename
|
|
6
|
+
* stays on one filesystem and is therefore atomic.
|
|
7
|
+
*
|
|
8
|
+
* On failure the temp file is removed on a best-effort basis and the
|
|
9
|
+
* original error is re-thrown.
|
|
10
|
+
*/
|
|
11
|
+
export declare function writeFileAtomic(filePath: string, data: string | Uint8Array): void;
|
|
12
|
+
//# sourceMappingURL=atomic-write.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atomic-write.d.ts","sourceRoot":"","sources":["../../src/utils/atomic-write.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,GAAG,UAAU,GACxB,IAAI,CAcN"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
/**
|
|
4
|
+
* Write a file atomically: stream into a temp file in the same directory,
|
|
5
|
+
* then rename it over the target. A crash, Ctrl-C, or ENOSPC mid-write
|
|
6
|
+
* leaves the original file intact (or absent) — never truncated or
|
|
7
|
+
* half-written. The temp file shares the target's directory so the rename
|
|
8
|
+
* stays on one filesystem and is therefore atomic.
|
|
9
|
+
*
|
|
10
|
+
* On failure the temp file is removed on a best-effort basis and the
|
|
11
|
+
* original error is re-thrown.
|
|
12
|
+
*/
|
|
13
|
+
export function writeFileAtomic(filePath, data) {
|
|
14
|
+
const dir = path.dirname(filePath);
|
|
15
|
+
const tmp = path.join(dir, `.${path.basename(filePath)}.${process.pid}.tmp`);
|
|
16
|
+
try {
|
|
17
|
+
fs.writeFileSync(tmp, data);
|
|
18
|
+
fs.renameSync(tmp, filePath);
|
|
19
|
+
}
|
|
20
|
+
catch (err) {
|
|
21
|
+
try {
|
|
22
|
+
fs.rmSync(tmp, { force: true });
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
// best-effort cleanup; surface the original write error
|
|
26
|
+
}
|
|
27
|
+
throw err;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=atomic-write.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atomic-write.js","sourceRoot":"","sources":["../../src/utils/atomic-write.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B;;;;;;;;;GASG;AACH,MAAM,UAAU,eAAe,CAC7B,QAAgB,EAChB,IAAyB;IAEzB,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnC,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,OAAO,CAAC,GAAG,MAAM,CAAC,CAAC;IAC7E,IAAI,CAAC;QACH,EAAE,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAC5B,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAC/B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC;YACH,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAClC,CAAC;QAAC,MAAM,CAAC;YACP,wDAAwD;QAC1D,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-writer.d.ts","sourceRoot":"","sources":["../../src/utils/file-writer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"file-writer.d.ts","sourceRoot":"","sources":["../../src/utils/file-writer.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE5D,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,SAAS,CAAC;CACjB;AASD,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAElD;AAED,wBAAgB,YAAY,IAAI,SAAS,CAExC;AAkBD;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAK7D;AAED,uFAAuF;AACvF,wBAAgB,mBAAmB,IAAI,IAAI,CAG1C;AAsCD;;;;;;;;GAQG;AACH,wBAAsB,SAAS,CAC7B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,GACjC,OAAO,CAAC,OAAO,CAAC,CA0HlB;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE/C"}
|
|
@@ -2,6 +2,7 @@ import fs from "node:fs";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import chalk from "chalk";
|
|
4
4
|
import inquirer from "inquirer";
|
|
5
|
+
import { writeFileAtomic } from "./atomic-write.js";
|
|
5
6
|
import { toPosix } from "./posix.js";
|
|
6
7
|
// Global write mode (set from CLI options)
|
|
7
8
|
let globalWriteMode = "ask";
|
|
@@ -72,7 +73,7 @@ function appendToFile(filePath, content, options) {
|
|
|
72
73
|
const newContent = existingContent.endsWith("\n")
|
|
73
74
|
? existingContent + content
|
|
74
75
|
: existingContent + "\n" + content;
|
|
75
|
-
|
|
76
|
+
writeFileAtomic(filePath, newContent);
|
|
76
77
|
if (options?.executable) {
|
|
77
78
|
fs.chmodSync(filePath, "755");
|
|
78
79
|
}
|
|
@@ -91,7 +92,7 @@ export async function writeFile(filePath, content, options) {
|
|
|
91
92
|
const displayPath = getRelativePath(filePath);
|
|
92
93
|
if (!exists) {
|
|
93
94
|
// File doesn't exist, write directly
|
|
94
|
-
|
|
95
|
+
writeFileAtomic(filePath, content);
|
|
95
96
|
if (options?.executable) {
|
|
96
97
|
fs.chmodSync(filePath, "755");
|
|
97
98
|
}
|
|
@@ -114,7 +115,7 @@ export async function writeFile(filePath, content, options) {
|
|
|
114
115
|
? "skip"
|
|
115
116
|
: globalWriteMode;
|
|
116
117
|
if (mode === "force") {
|
|
117
|
-
|
|
118
|
+
writeFileAtomic(filePath, content);
|
|
118
119
|
if (options?.executable) {
|
|
119
120
|
fs.chmodSync(filePath, "755");
|
|
120
121
|
}
|
|
@@ -158,7 +159,7 @@ export async function writeFile(filePath, content, options) {
|
|
|
158
159
|
return false;
|
|
159
160
|
}
|
|
160
161
|
if (action === "overwrite") {
|
|
161
|
-
|
|
162
|
+
writeFileAtomic(filePath, content);
|
|
162
163
|
if (options?.executable) {
|
|
163
164
|
fs.chmodSync(filePath, "755");
|
|
164
165
|
}
|
|
@@ -178,7 +179,7 @@ export async function writeFile(filePath, content, options) {
|
|
|
178
179
|
}
|
|
179
180
|
if (action === "overwrite-all") {
|
|
180
181
|
globalWriteMode = "force";
|
|
181
|
-
|
|
182
|
+
writeFileAtomic(filePath, content);
|
|
182
183
|
if (options?.executable) {
|
|
183
184
|
fs.chmodSync(filePath, "755");
|
|
184
185
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-writer.js","sourceRoot":"","sources":["../../src/utils/file-writer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAYrC,2CAA2C;AAC3C,IAAI,eAAe,GAAc,KAAK,CAAC;AAEvC,MAAM,UAAU,YAAY,CAAC,IAAe;IAC1C,eAAe,GAAG,IAAI,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,YAAY;IAC1B,OAAO,eAAe,CAAC;AACzB,CAAC;AAED,8EAA8E;AAC9E,kBAAkB;AAClB,EAAE;AACF,6EAA6E;AAC7E,2EAA2E;AAC3E,6EAA6E;AAC7E,6EAA6E;AAC7E,4EAA4E;AAC5E,wBAAwB;AACxB,8EAA8E;AAE9E,kFAAkF;AAClF,IAAI,aAAa,GAAuB,IAAI,CAAC;AAC7C,gFAAgF;AAChF,IAAI,iBAAiB,GAAkB,IAAI,CAAC;AAE5C;;;;;;;;;GASG;AACH,MAAM,UAAU,oBAAoB,CAAC,GAAW;IAC9C,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,aAAa,GAAG,IAAI,CAAC;IACrB,i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;AACH,MAAM,UAAU,SAAS,CAAC,OAAe;IACvC,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry-config.d.ts","sourceRoot":"","sources":["../../src/utils/registry-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registry-config.d.ts","sourceRoot":"","sources":["../../src/utils/registry-config.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAmBD,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,kBAAkB,GAAG,IAAI,CAmD7E;AAED,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,kBAAkB,GACzB,IAAI,CAmGN"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { DIR_NAMES } from "../constants/paths.js";
|
|
4
|
+
import { writeFileAtomic } from "./atomic-write.js";
|
|
4
5
|
import { toPosix } from "./posix.js";
|
|
5
6
|
function configPath(cwd) {
|
|
6
7
|
return path.join(cwd, DIR_NAMES.WORKFLOW, "config.yaml");
|
|
@@ -150,7 +151,7 @@ export function writeSpecRegistryConfig(cwd, config) {
|
|
|
150
151
|
output.push(...specLines);
|
|
151
152
|
}
|
|
152
153
|
}
|
|
153
|
-
|
|
154
|
+
writeFileAtomic(filePath, output.join("\n"));
|
|
154
155
|
return;
|
|
155
156
|
}
|
|
156
157
|
const section = [
|
|
@@ -166,6 +167,6 @@ export function writeSpecRegistryConfig(cwd, config) {
|
|
|
166
167
|
...specLines,
|
|
167
168
|
"",
|
|
168
169
|
].join("\n");
|
|
169
|
-
|
|
170
|
+
writeFileAtomic(filePath, content.trimEnd() + "\n" + section);
|
|
170
171
|
}
|
|
171
172
|
//# sourceMappingURL=registry-config.js.map
|