mini-trellis 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/COPYRIGHT +20 -0
- package/LICENSE +235 -0
- package/README.md +66 -0
- package/bin/mini-trellis.js +3 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +153 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/commands/init.d.ts +19 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +401 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/mem.d.ts +30 -0
- package/dist/commands/mem.d.ts.map +1 -0
- package/dist/commands/mem.js +412 -0
- package/dist/commands/mem.js.map +1 -0
- package/dist/commands/migrate.d.ts +40 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/migrate.js +272 -0
- package/dist/commands/migrate.js.map +1 -0
- package/dist/commands/uninstall.d.ts +11 -0
- package/dist/commands/uninstall.d.ts.map +1 -0
- package/dist/commands/uninstall.js +135 -0
- package/dist/commands/uninstall.js.map +1 -0
- package/dist/commands/upgrade.d.ts +28 -0
- package/dist/commands/upgrade.d.ts.map +1 -0
- package/dist/commands/upgrade.js +84 -0
- package/dist/commands/upgrade.js.map +1 -0
- package/dist/configurators/claude.d.ts +3 -0
- package/dist/configurators/claude.d.ts.map +1 -0
- package/dist/configurators/claude.js +62 -0
- package/dist/configurators/claude.js.map +1 -0
- package/dist/configurators/codex.d.ts +3 -0
- package/dist/configurators/codex.d.ts.map +1 -0
- package/dist/configurators/codex.js +21 -0
- package/dist/configurators/codex.js.map +1 -0
- package/dist/configurators/index.d.ts +24 -0
- package/dist/configurators/index.d.ts.map +1 -0
- package/dist/configurators/index.js +80 -0
- package/dist/configurators/index.js.map +1 -0
- package/dist/configurators/opencode.d.ts +2 -0
- package/dist/configurators/opencode.d.ts.map +1 -0
- package/dist/configurators/opencode.js +62 -0
- package/dist/configurators/opencode.js.map +1 -0
- package/dist/configurators/pi.d.ts +2 -0
- package/dist/configurators/pi.d.ts.map +1 -0
- package/dist/configurators/pi.js +18 -0
- package/dist/configurators/pi.js.map +1 -0
- package/dist/configurators/shared.d.ts +147 -0
- package/dist/configurators/shared.d.ts.map +1 -0
- package/dist/configurators/shared.js +377 -0
- package/dist/configurators/shared.js.map +1 -0
- package/dist/configurators/workflow.d.ts +15 -0
- package/dist/configurators/workflow.d.ts.map +1 -0
- package/dist/configurators/workflow.js +46 -0
- package/dist/configurators/workflow.js.map +1 -0
- package/dist/constants/paths.d.ts +74 -0
- package/dist/constants/paths.d.ts.map +1 -0
- package/dist/constants/paths.js +83 -0
- package/dist/constants/paths.js.map +1 -0
- package/dist/constants/version.d.ts +9 -0
- package/dist/constants/version.d.ts.map +1 -0
- package/dist/constants/version.js +15 -0
- package/dist/constants/version.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/templates/claude/index.d.ts +11 -0
- package/dist/templates/claude/index.d.ts.map +1 -0
- package/dist/templates/claude/index.js +17 -0
- package/dist/templates/claude/index.js.map +1 -0
- package/dist/templates/claude/settings.json +40 -0
- package/dist/templates/codex/config.toml +39 -0
- package/dist/templates/codex/hooks.json +15 -0
- package/dist/templates/codex/index.d.ts +11 -0
- package/dist/templates/codex/index.d.ts.map +1 -0
- package/dist/templates/codex/index.js +22 -0
- package/dist/templates/codex/index.js.map +1 -0
- package/dist/templates/common/bundled-skills/mini-trellis-session-insight/SKILL.md +37 -0
- package/dist/templates/common/bundled-skills/mini-trellis-session-insight/references/cli-quick-reference.md +36 -0
- package/dist/templates/common/bundled-skills/mini-trellis-session-insight/references/triggering-patterns.md +93 -0
- package/dist/templates/common/commands/remember.md +22 -0
- package/dist/templates/common/index.d.ts +48 -0
- package/dist/templates/common/index.d.ts.map +1 -0
- package/dist/templates/common/index.js +104 -0
- package/dist/templates/common/index.js.map +1 -0
- package/dist/templates/common/skills/update-spec.md +16 -0
- package/dist/templates/extract.d.ts +40 -0
- package/dist/templates/extract.d.ts.map +1 -0
- package/dist/templates/extract.js +106 -0
- package/dist/templates/extract.js.map +1 -0
- package/dist/templates/markdown/agents.md +15 -0
- package/dist/templates/markdown/index.d.ts +10 -0
- package/dist/templates/markdown/index.d.ts.map +1 -0
- package/dist/templates/markdown/index.js +18 -0
- package/dist/templates/markdown/index.js.map +1 -0
- package/dist/templates/markdown/research-readme.md +9 -0
- package/dist/templates/markdown/spec/guides/index.md.txt +5 -0
- package/dist/templates/markdown/spec/guides/mini-memory.md.txt +30 -0
- package/dist/templates/markdown/workspace-index.md +23 -0
- package/dist/templates/opencode/lib/context-visibility.js +148 -0
- package/dist/templates/opencode/lib/session-utils.js +394 -0
- package/dist/templates/opencode/lib/trellis-context.js +627 -0
- package/dist/templates/opencode/package.json +5 -0
- package/dist/templates/opencode/plugins/session-start.js +65 -0
- package/dist/templates/pi/extensions/mini-trellis/index.ts.txt +170 -0
- package/dist/templates/pi/index.d.ts +4 -0
- package/dist/templates/pi/index.d.ts.map +1 -0
- package/dist/templates/pi/index.js +9 -0
- package/dist/templates/pi/index.js.map +1 -0
- package/dist/templates/pi/settings.json +9 -0
- package/dist/templates/shared-hooks/index.d.ts +13 -0
- package/dist/templates/shared-hooks/index.d.ts.map +1 -0
- package/dist/templates/shared-hooks/index.js +26 -0
- package/dist/templates/shared-hooks/index.js.map +1 -0
- package/dist/templates/shared-hooks/session-start.py +676 -0
- package/dist/templates/template-utils.d.ts +26 -0
- package/dist/templates/template-utils.d.ts.map +1 -0
- package/dist/templates/template-utils.js +64 -0
- package/dist/templates/template-utils.js.map +1 -0
- package/dist/templates/trellis/config.yaml +34 -0
- package/dist/templates/trellis/gitattributes.txt +9 -0
- package/dist/templates/trellis/gitignore.txt +32 -0
- package/dist/templates/trellis/index.d.ts +8 -0
- package/dist/templates/trellis/index.d.ts.map +1 -0
- package/dist/templates/trellis/index.js +16 -0
- package/dist/templates/trellis/index.js.map +1 -0
- package/dist/templates/trellis/scripts/__init__.py +5 -0
- package/dist/templates/trellis/scripts/add_session.py +1545 -0
- package/dist/templates/trellis/scripts/common/__init__.py +94 -0
- package/dist/templates/trellis/scripts/common/active_task.py +855 -0
- package/dist/templates/trellis/scripts/common/cli_adapter.py +950 -0
- package/dist/templates/trellis/scripts/common/config.py +482 -0
- package/dist/templates/trellis/scripts/common/developer.py +192 -0
- package/dist/templates/trellis/scripts/common/git.py +203 -0
- package/dist/templates/trellis/scripts/common/git_context.py +106 -0
- package/dist/templates/trellis/scripts/common/io.py +160 -0
- package/dist/templates/trellis/scripts/common/log.py +45 -0
- package/dist/templates/trellis/scripts/common/packages_context.py +238 -0
- package/dist/templates/trellis/scripts/common/paths.py +543 -0
- package/dist/templates/trellis/scripts/common/safe_commit.py +322 -0
- package/dist/templates/trellis/scripts/common/session_context.py +708 -0
- package/dist/templates/trellis/scripts/common/task_context.py +470 -0
- package/dist/templates/trellis/scripts/common/task_queue.py +188 -0
- package/dist/templates/trellis/scripts/common/task_store.py +1930 -0
- package/dist/templates/trellis/scripts/common/task_utils.py +498 -0
- package/dist/templates/trellis/scripts/common/tasks.py +122 -0
- package/dist/templates/trellis/scripts/common/trellis_config.py +239 -0
- package/dist/templates/trellis/scripts/common/types.py +110 -0
- package/dist/templates/trellis/scripts/common/workflow_phase.py +242 -0
- package/dist/templates/trellis/scripts/get_context.py +16 -0
- package/dist/templates/trellis/scripts/init_developer.py +51 -0
- package/dist/types/ai-tools.d.ts +30 -0
- package/dist/types/ai-tools.d.ts.map +1 -0
- package/dist/types/ai-tools.js +89 -0
- package/dist/types/ai-tools.js.map +1 -0
- 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/cwd-guard.d.ts +38 -0
- package/dist/utils/cwd-guard.d.ts.map +1 -0
- package/dist/utils/cwd-guard.js +62 -0
- package/dist/utils/cwd-guard.js.map +1 -0
- package/dist/utils/file-writer.d.ts +36 -0
- package/dist/utils/file-writer.d.ts.map +1 -0
- package/dist/utils/file-writer.js +204 -0
- package/dist/utils/file-writer.js.map +1 -0
- package/dist/utils/managed-paths.d.ts +5 -0
- package/dist/utils/managed-paths.d.ts.map +1 -0
- package/dist/utils/managed-paths.js +51 -0
- package/dist/utils/managed-paths.js.map +1 -0
- package/dist/utils/managed-removal.d.ts +42 -0
- package/dist/utils/managed-removal.d.ts.map +1 -0
- package/dist/utils/managed-removal.js +223 -0
- package/dist/utils/managed-removal.js.map +1 -0
- package/dist/utils/posix.d.ts +13 -0
- package/dist/utils/posix.d.ts.map +1 -0
- package/dist/utils/posix.js +15 -0
- package/dist/utils/posix.js.map +1 -0
- package/dist/utils/uninstall-scrubbers.d.ts +66 -0
- package/dist/utils/uninstall-scrubbers.d.ts.map +1 -0
- package/dist/utils/uninstall-scrubbers.js +417 -0
- package/dist/utils/uninstall-scrubbers.js.map +1 -0
- package/package.json +80 -0
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared utilities for platform configurators.
|
|
3
|
+
*
|
|
4
|
+
* Extracted here to avoid circular dependencies (index.ts imports configurators,
|
|
5
|
+
* configurators cannot import from index.ts).
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Module-level resolved Python command, set by the init flow after probing.
|
|
9
|
+
*
|
|
10
|
+
* Windows commonly has Python under one of: `python`, `python3`, `py -3` —
|
|
11
|
+
* which one works varies by installer (python.org / Microsoft Store / py
|
|
12
|
+
* launcher). `init.ts` detects which is available, then calls
|
|
13
|
+
* `setResolvedPythonCommand` so all subsequent template / configurator writes
|
|
14
|
+
* use the resolved value instead of the platform default.
|
|
15
|
+
*
|
|
16
|
+
* If unset (e.g. unit tests bypass init), `getPythonCommandForPlatform` falls
|
|
17
|
+
* back to the static platform default (`python` on Windows, `python3`
|
|
18
|
+
* elsewhere) — preserving legacy behavior.
|
|
19
|
+
*/
|
|
20
|
+
let resolvedPythonCommand = null;
|
|
21
|
+
export function setResolvedPythonCommand(cmd) {
|
|
22
|
+
const trimmed = cmd.trim();
|
|
23
|
+
resolvedPythonCommand = trimmed || null;
|
|
24
|
+
}
|
|
25
|
+
/** Test helper — clear the resolved cache between unit tests. */
|
|
26
|
+
export function resetResolvedPythonCommand() {
|
|
27
|
+
resolvedPythonCommand = null;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Get the Python command for the host platform.
|
|
31
|
+
*
|
|
32
|
+
* Returns the resolved command if `setResolvedPythonCommand` has been called;
|
|
33
|
+
* otherwise the static platform default — Windows: `python`, others:
|
|
34
|
+
* `python3`. Pass an explicit `platform` arg only for unit tests (it bypasses
|
|
35
|
+
* the resolved cache).
|
|
36
|
+
*/
|
|
37
|
+
export function getPythonCommandForPlatform(platform) {
|
|
38
|
+
if (platform === undefined && resolvedPythonCommand) {
|
|
39
|
+
return resolvedPythonCommand;
|
|
40
|
+
}
|
|
41
|
+
const target = platform ?? process.platform;
|
|
42
|
+
return target === "win32" ? "python" : "python3";
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Replace literal `python3` with the resolved Python command, excluding
|
|
46
|
+
* shebang lines.
|
|
47
|
+
*
|
|
48
|
+
* Applied at init/update write time so that all file types (including .py,
|
|
49
|
+
* .md, .toml, .json) get the correct command for the host platform without
|
|
50
|
+
* template-level changes.
|
|
51
|
+
*
|
|
52
|
+
* No-op when the resolved command is `python3` (the template default).
|
|
53
|
+
* Idempotent: running it twice produces the same result.
|
|
54
|
+
*/
|
|
55
|
+
export function replacePythonCommandLiterals(content) {
|
|
56
|
+
const target = getPythonCommandForPlatform();
|
|
57
|
+
if (target === "python3")
|
|
58
|
+
return content;
|
|
59
|
+
return content
|
|
60
|
+
.split("\n")
|
|
61
|
+
.map((line) => line.startsWith("#!") ? line : line.replaceAll("python3", target))
|
|
62
|
+
.join("\n");
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Resolve platform-specific placeholders in template content.
|
|
66
|
+
*
|
|
67
|
+
* When called without a context, only resolves {{PYTHON_CMD}} (legacy behavior
|
|
68
|
+
* for settings.json, hooks.json, etc.).
|
|
69
|
+
*
|
|
70
|
+
* When called with a TemplateContext, additionally resolves:
|
|
71
|
+
* - {{CMD_REF:name}} → platform-specific command reference
|
|
72
|
+
* - {{EXECUTOR_AI}} → AI executor description
|
|
73
|
+
* - {{USER_ACTION_LABEL}} → user action label
|
|
74
|
+
* - {{CLI_FLAG}} → platform cli flag (e.g. "claude", "codex")
|
|
75
|
+
* - {{#FLAG}}...{{/FLAG}} → conditional include (when FLAG is true)
|
|
76
|
+
* - {{^FLAG}}...{{/FLAG}} → negated conditional (when FLAG is false)
|
|
77
|
+
*
|
|
78
|
+
* Supported conditional flags: AGENT_CAPABLE, HAS_HOOKS
|
|
79
|
+
*/
|
|
80
|
+
// Pre-compiled regexes for placeholder resolution
|
|
81
|
+
const RE_PYTHON_CMD = /\{\{PYTHON_CMD\}\}/g;
|
|
82
|
+
const RE_CMD_REF = /\{\{CMD_REF:([\w][\w-]*)\}\}/g;
|
|
83
|
+
const RE_EXECUTOR_AI = /\{\{EXECUTOR_AI\}\}/g;
|
|
84
|
+
const RE_USER_ACTION_LABEL = /\{\{USER_ACTION_LABEL\}\}/g;
|
|
85
|
+
const RE_CLI_FLAG = /\{\{CLI_FLAG\}\}/g;
|
|
86
|
+
const RE_BLANK_LINES = /\n{3,}/g;
|
|
87
|
+
const CONDITIONAL_FLAGS = ["AGENT_CAPABLE", "HAS_HOOKS"];
|
|
88
|
+
const CONDITIONAL_REGEXES = Object.fromEntries(CONDITIONAL_FLAGS.map((flag) => [
|
|
89
|
+
flag,
|
|
90
|
+
{
|
|
91
|
+
pos: new RegExp(`\\{\\{#${flag}\\}\\}([\\s\\S]*?)\\{\\{/${flag}\\}\\}`, "g"),
|
|
92
|
+
neg: new RegExp(`\\{\\{\\^${flag}\\}\\}([\\s\\S]*?)\\{\\{/${flag}\\}\\}`, "g"),
|
|
93
|
+
},
|
|
94
|
+
]));
|
|
95
|
+
export function resolvePlaceholders(content, context) {
|
|
96
|
+
let result = replacePythonCommandLiterals(content.replace(RE_PYTHON_CMD, getPythonCommandForPlatform()));
|
|
97
|
+
if (!context)
|
|
98
|
+
return result;
|
|
99
|
+
// Simple substitutions
|
|
100
|
+
result = result.replace(RE_CMD_REF, (_match, name) => `${context.cmdRefPrefix}${name}`);
|
|
101
|
+
result = result.replace(RE_EXECUTOR_AI, context.executorAI);
|
|
102
|
+
result = result.replace(RE_USER_ACTION_LABEL, context.userActionLabel);
|
|
103
|
+
result = result.replace(RE_CLI_FLAG, context.cliFlag);
|
|
104
|
+
// Conditional blocks
|
|
105
|
+
const flagValues = {
|
|
106
|
+
AGENT_CAPABLE: context.agentCapable,
|
|
107
|
+
HAS_HOOKS: context.hasHooks,
|
|
108
|
+
};
|
|
109
|
+
for (const flag of CONDITIONAL_FLAGS) {
|
|
110
|
+
const value = flagValues[flag];
|
|
111
|
+
const { pos, neg } = CONDITIONAL_REGEXES[flag];
|
|
112
|
+
// Reset lastIndex for global regexes reused across calls
|
|
113
|
+
pos.lastIndex = 0;
|
|
114
|
+
neg.lastIndex = 0;
|
|
115
|
+
result = result.replace(pos, value ? "$1" : "");
|
|
116
|
+
result = result.replace(neg, value ? "" : "$1");
|
|
117
|
+
}
|
|
118
|
+
// Clean up blank lines left by removed conditional blocks
|
|
119
|
+
result = result.replace(RE_BLANK_LINES, "\n\n");
|
|
120
|
+
return result;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Resolve placeholders for files written under `.agents/skills/` (the shared
|
|
124
|
+
* Agent Skills directory consumed by multiple platforms via the upstream
|
|
125
|
+
* `.agents/skills/` workspace alias — Codex, Gemini CLI 0.40+, etc.).
|
|
126
|
+
*
|
|
127
|
+
* Identical to {@link resolvePlaceholders} except that {@link CMD_REF} is
|
|
128
|
+
* rendered in a platform-neutral form (`` `name` (Trellis command) ``)
|
|
129
|
+
* instead of substituting a platform-specific prefix. This is the only
|
|
130
|
+
* placeholder that varies between platforms in the auto-triggered skill templates
|
|
131
|
+
* from `common/skills/`, so
|
|
132
|
+
* neutralizing it makes the rendered SKILL.md files byte-identical regardless
|
|
133
|
+
* of which Trellis configurator wrote them — eliminating the
|
|
134
|
+
* "last-writer-wins" collision when both Codex and Gemini target
|
|
135
|
+
* `.agents/skills/`.
|
|
136
|
+
*
|
|
137
|
+
* `{{CLI_FLAG}}`, `{{EXECUTOR_AI}}`, `{{USER_ACTION_LABEL}}`, conditionals,
|
|
138
|
+
* and `{{PYTHON_CMD}}` are still resolved from the platform context. The
|
|
139
|
+
* shared skills do not use those placeholders, so they remain platform-
|
|
140
|
+
* neutral. Codex-only skill files (e.g. `trellis-continue/SKILL.md`,
|
|
141
|
+
* `trellis-finish-work/SKILL.md` written via `resolveAllAsSkillsNeutral`) DO
|
|
142
|
+
* use `{{CLI_FLAG}}` / `{{PYTHON_CMD}}` and resolve to Codex-correct values
|
|
143
|
+
* — no other platform writes those files, so byte-identity is not required.
|
|
144
|
+
*/
|
|
145
|
+
export function resolvePlaceholdersNeutral(content, context) {
|
|
146
|
+
let result = replacePythonCommandLiterals(content.replace(RE_PYTHON_CMD, getPythonCommandForPlatform()));
|
|
147
|
+
if (!context)
|
|
148
|
+
return result;
|
|
149
|
+
// Neutral form for the only collision-causing placeholder
|
|
150
|
+
result = result.replace(RE_CMD_REF, (_match, name) => `\`${name}\` (Trellis command)`);
|
|
151
|
+
result = result.replace(RE_EXECUTOR_AI, context.executorAI);
|
|
152
|
+
result = result.replace(RE_USER_ACTION_LABEL, context.userActionLabel);
|
|
153
|
+
result = result.replace(RE_CLI_FLAG, context.cliFlag);
|
|
154
|
+
// Conditional blocks (resolved per platform — none of the auto-triggered
|
|
155
|
+
// shared skills use conditionals, but Codex-only command-as-skill files might in future).
|
|
156
|
+
const flagValues = {
|
|
157
|
+
AGENT_CAPABLE: context.agentCapable,
|
|
158
|
+
HAS_HOOKS: context.hasHooks,
|
|
159
|
+
};
|
|
160
|
+
for (const flag of CONDITIONAL_FLAGS) {
|
|
161
|
+
const value = flagValues[flag];
|
|
162
|
+
const { pos, neg } = CONDITIONAL_REGEXES[flag];
|
|
163
|
+
pos.lastIndex = 0;
|
|
164
|
+
neg.lastIndex = 0;
|
|
165
|
+
result = result.replace(pos, value ? "$1" : "");
|
|
166
|
+
result = result.replace(neg, value ? "" : "$1");
|
|
167
|
+
}
|
|
168
|
+
result = result.replace(RE_BLANK_LINES, "\n\n");
|
|
169
|
+
return result;
|
|
170
|
+
}
|
|
171
|
+
// ---------------------------------------------------------------------------
|
|
172
|
+
// Template wrapping utilities
|
|
173
|
+
// ---------------------------------------------------------------------------
|
|
174
|
+
/** Skill description registry — maps template name to auto-trigger description. */
|
|
175
|
+
const SKILL_DESCRIPTIONS = {
|
|
176
|
+
remember: "Record this session into the mini-trellis journal. Use when the user asks to remember, persist notes, end the session, or after compact. May also write .trellis/research/<topic>.md.",
|
|
177
|
+
"update-spec": "Captures durable contracts and conventions into .trellis/spec/ as short markdown. Use when a debugging, implementation, or discussion produced a boundary that should still hold next session.",
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* Wrap resolved template content with YAML frontmatter for skill format.
|
|
181
|
+
* Used by platforms that use SKILL.md (Codex, Kiro, Qoder, etc.).
|
|
182
|
+
*/
|
|
183
|
+
export function wrapWithSkillFrontmatter(name, content) {
|
|
184
|
+
// Look up description by base name (without trellis- prefix)
|
|
185
|
+
const baseName = name.replace(/^mini-trellis-/, "").replace(/^trellis-/, "");
|
|
186
|
+
const description = SKILL_DESCRIPTIONS[baseName];
|
|
187
|
+
if (!description) {
|
|
188
|
+
throw new Error(`Missing skill description for "${baseName}". Add it to SKILL_DESCRIPTIONS in shared.ts.`);
|
|
189
|
+
}
|
|
190
|
+
return `---\nname: ${name}\ndescription: "${description}"\n---\n\n${content}`;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* One-line blurbs shown in a `/` command palette — kept separate from
|
|
194
|
+
* SKILL_DESCRIPTIONS, which is long prose aimed at the skill matcher.
|
|
195
|
+
*/
|
|
196
|
+
const COMMAND_DESCRIPTIONS = {
|
|
197
|
+
remember: "Record this session into the mini-trellis journal.",
|
|
198
|
+
};
|
|
199
|
+
/** Wrap resolved command content with YAML frontmatter (name + description). */
|
|
200
|
+
export function wrapWithCommandFrontmatter(name, content) {
|
|
201
|
+
const baseName = name.replace(/^mini-trellis-/, "").replace(/^trellis-/, "");
|
|
202
|
+
const description = COMMAND_DESCRIPTIONS[baseName];
|
|
203
|
+
if (!description) {
|
|
204
|
+
throw new Error(`Missing command description for "${baseName}". Add it to COMMAND_DESCRIPTIONS in shared.ts.`);
|
|
205
|
+
}
|
|
206
|
+
// JSON.stringify produces a double-quoted YAML scalar, which is safe even
|
|
207
|
+
// when the description contains a colon (an unquoted plain scalar cannot
|
|
208
|
+
// contain ": " — some parsers reject it outright, e.g. Trae CLI's SlashCommand
|
|
209
|
+
// schema; others silently truncate at the second colon).
|
|
210
|
+
return `---\nname: ${name}\ndescription: ${JSON.stringify(description)}\n---\n\n${content}`;
|
|
211
|
+
}
|
|
212
|
+
// ---------------------------------------------------------------------------
|
|
213
|
+
// Shared configurator helpers
|
|
214
|
+
// ---------------------------------------------------------------------------
|
|
215
|
+
import path from "node:path";
|
|
216
|
+
import { ensureDir, writeFile } from "../utils/file-writer.js";
|
|
217
|
+
import { getBundledSkillTemplates, getCommandTemplates, getSkillTemplates, } from "../templates/common/index.js";
|
|
218
|
+
import { getSharedHookScriptsForPlatform, } from "../templates/shared-hooks/index.js";
|
|
219
|
+
/**
|
|
220
|
+
* Filter command templates based on platform capabilities.
|
|
221
|
+
*
|
|
222
|
+
* `start.md` is stripped only on platforms that are BOTH `agentCapable` AND
|
|
223
|
+
* `hasHooks` — those platforms (Claude Code, Cursor, Kiro, Gemini, Qoder,
|
|
224
|
+
* CodeBuddy, Copilot, Droid, Pi) have a SessionStart-style hook that
|
|
225
|
+
* auto-injects the workflow overview, so a user-facing `start` would be
|
|
226
|
+
* redundant.
|
|
227
|
+
*
|
|
228
|
+
* `agentCapable && !hasHooks` platforms (Codex, ZCode, OpenCode, Reasonix, Grok)
|
|
229
|
+
* have no such hook (or use an out-of-band plugin), so they need the
|
|
230
|
+
* user-invocable `trellis-start` skill / `start.md` command as fallback.
|
|
231
|
+
* Snow is class-1 (`hasHooks: true`) with auto inject + project agents.
|
|
232
|
+
* Agent-less platforms (Kilo, Antigravity, Devin) also keep `start` since
|
|
233
|
+
* they rely entirely on user-triggered workflows.
|
|
234
|
+
*/
|
|
235
|
+
function filterCommands(templates, _ctx) {
|
|
236
|
+
return templates;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Resolve ALL templates as skills with trellis- prefix.
|
|
240
|
+
* Used by skill-only platforms (Kiro, Qoder, Codex) where everything is a skill.
|
|
241
|
+
*
|
|
242
|
+
* `start` is filtered out on agent-capable platforms — the session-start hook
|
|
243
|
+
* injects the workflow overview instead.
|
|
244
|
+
*/
|
|
245
|
+
export function resolveAllAsSkills(ctx) {
|
|
246
|
+
const templates = [
|
|
247
|
+
...filterCommands(getCommandTemplates(), ctx),
|
|
248
|
+
...getSkillTemplates(),
|
|
249
|
+
];
|
|
250
|
+
return templates.map((tmpl) => ({
|
|
251
|
+
name: `mini-trellis-${tmpl.name}`,
|
|
252
|
+
content: wrapWithSkillFrontmatter(`mini-trellis-${tmpl.name}`, resolvePlaceholders(tmpl.content, ctx)),
|
|
253
|
+
}));
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Resolve command templates as plain commands (no wrapping).
|
|
257
|
+
* Used by "both" platforms for the user-ritual commands.
|
|
258
|
+
*
|
|
259
|
+
* `start` is filtered out on agent-capable platforms.
|
|
260
|
+
*/
|
|
261
|
+
export function resolveCommands(ctx) {
|
|
262
|
+
return filterCommands(getCommandTemplates(), ctx).map((tmpl) => ({
|
|
263
|
+
name: tmpl.name,
|
|
264
|
+
content: resolvePlaceholders(tmpl.content, ctx),
|
|
265
|
+
}));
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Resolve the auto-triggered skill templates from `common/skills/` with trellis- prefix + SKILL.md frontmatter.
|
|
269
|
+
* Used by "both" platforms for the auto-triggered skills.
|
|
270
|
+
*/
|
|
271
|
+
export function resolveSkills(ctx) {
|
|
272
|
+
return getSkillTemplates().map((tmpl) => ({
|
|
273
|
+
name: `mini-trellis-${tmpl.name}`,
|
|
274
|
+
content: wrapWithSkillFrontmatter(`mini-trellis-${tmpl.name}`, resolvePlaceholders(tmpl.content, ctx)),
|
|
275
|
+
}));
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Same as {@link resolveSkills} but uses {@link resolvePlaceholdersNeutral}
|
|
279
|
+
* so the rendered SKILL.md files are byte-identical across any two platforms
|
|
280
|
+
* that target `.agents/skills/`. Use this for shared `.agents/skills/`
|
|
281
|
+
* writes (Gemini); platform-private skill roots should keep
|
|
282
|
+
* {@link resolveSkills}.
|
|
283
|
+
*/
|
|
284
|
+
export function resolveSkillsNeutral(ctx) {
|
|
285
|
+
return getSkillTemplates().map((tmpl) => ({
|
|
286
|
+
name: `mini-trellis-${tmpl.name}`,
|
|
287
|
+
content: wrapWithSkillFrontmatter(`mini-trellis-${tmpl.name}`, resolvePlaceholdersNeutral(tmpl.content, ctx)),
|
|
288
|
+
}));
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Same as {@link resolveAllAsSkills} but uses
|
|
292
|
+
* {@link resolvePlaceholdersNeutral} for the shared common skills. The 2 command
|
|
293
|
+
* templates (continue, finish-work) folded into the skill set still resolve
|
|
294
|
+
* `{{CLI_FLAG}}` / `{{PYTHON_CMD}}` per platform — only Codex writes those
|
|
295
|
+
* files into `.agents/skills/`, so byte-identity isn't required there.
|
|
296
|
+
*/
|
|
297
|
+
export function resolveAllAsSkillsNeutral(ctx) {
|
|
298
|
+
const templates = [
|
|
299
|
+
...filterCommands(getCommandTemplates(), ctx),
|
|
300
|
+
...getSkillTemplates(),
|
|
301
|
+
];
|
|
302
|
+
return templates.map((tmpl) => ({
|
|
303
|
+
name: `mini-trellis-${tmpl.name}`,
|
|
304
|
+
content: wrapWithSkillFrontmatter(`mini-trellis-${tmpl.name}`, resolvePlaceholdersNeutral(tmpl.content, ctx)),
|
|
305
|
+
}));
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Resolve multi-file built-in skills.
|
|
309
|
+
*
|
|
310
|
+
* Unlike workflow skills, bundled skills already contain their own SKILL.md
|
|
311
|
+
* frontmatter and may include references/assets. They are still rendered
|
|
312
|
+
* through placeholder resolution so init and update get byte-identical output.
|
|
313
|
+
*/
|
|
314
|
+
export function resolveBundledSkills(ctx) {
|
|
315
|
+
return getBundledSkillTemplates().flatMap((skill) => skill.files.map((file) => ({
|
|
316
|
+
relativePath: `${skill.name}/${file.relativePath}`,
|
|
317
|
+
content: resolvePlaceholders(file.content, ctx),
|
|
318
|
+
})));
|
|
319
|
+
}
|
|
320
|
+
// ---------------------------------------------------------------------------
|
|
321
|
+
// Shared collectors
|
|
322
|
+
// ---------------------------------------------------------------------------
|
|
323
|
+
/** Collect skill files under a target root for update hash tracking. */
|
|
324
|
+
export function collectSkillTemplates(skillsRoot, skills, bundledSkills = []) {
|
|
325
|
+
const files = new Map();
|
|
326
|
+
for (const skill of skills) {
|
|
327
|
+
files.set(`${skillsRoot}/${skill.name}/SKILL.md`, skill.content);
|
|
328
|
+
}
|
|
329
|
+
for (const skillFile of bundledSkills) {
|
|
330
|
+
files.set(`${skillsRoot}/${skillFile.relativePath}`, skillFile.content);
|
|
331
|
+
}
|
|
332
|
+
return files;
|
|
333
|
+
}
|
|
334
|
+
// ---------------------------------------------------------------------------
|
|
335
|
+
// Template maps — a platform's file set, described once
|
|
336
|
+
//
|
|
337
|
+
// `collect<Platform>Templates()` returns `Map<relPath, content>`: the single
|
|
338
|
+
// description of what a platform installs. `trellis update` diffs that map and
|
|
339
|
+
// `configure` writes it through `writeTemplateMap`. Nothing else enumerates a
|
|
340
|
+
// platform's files — two descriptions that disagree is how `trellis update`
|
|
341
|
+
// silently stops managing a file (manifests/0.5.7.json).
|
|
342
|
+
// ---------------------------------------------------------------------------
|
|
343
|
+
/** Apply the python3 → python rewrite to every entry of a template map. */
|
|
344
|
+
export function renderTemplateMap(files) {
|
|
345
|
+
const rendered = new Map();
|
|
346
|
+
for (const [relPath, content] of files) {
|
|
347
|
+
rendered.set(relPath, replacePythonCommandLiterals(content));
|
|
348
|
+
}
|
|
349
|
+
return rendered;
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Write a collected template map into `cwd`.
|
|
353
|
+
*
|
|
354
|
+
* Renders through {@link renderTemplateMap} first — the same rewrite
|
|
355
|
+
* `collectPlatformTemplates` applies on the update path — so a file's
|
|
356
|
+
* init-time bytes and its update-time expected bytes cannot drift.
|
|
357
|
+
*/
|
|
358
|
+
export async function writeTemplateMap(cwd, files) {
|
|
359
|
+
for (const [relPath, content] of renderTemplateMap(files)) {
|
|
360
|
+
const absPath = path.join(cwd, ...relPath.split("/"));
|
|
361
|
+
ensureDir(path.dirname(absPath));
|
|
362
|
+
await writeFile(absPath, content);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Collect the shared hook scripts that `platform` actually registers, keyed
|
|
367
|
+
* under `hooksPath`. Driven by SHARED_HOOKS_BY_PLATFORM so a platform's hook
|
|
368
|
+
* set is never restated per configurator.
|
|
369
|
+
*/
|
|
370
|
+
export function collectSharedHooks(hooksPath, platform) {
|
|
371
|
+
const files = new Map();
|
|
372
|
+
for (const hook of getSharedHookScriptsForPlatform(platform)) {
|
|
373
|
+
files.set(`${hooksPath}/${hook.name}`, hook.content);
|
|
374
|
+
}
|
|
375
|
+
return files;
|
|
376
|
+
}
|
|
377
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 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ACtD,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QACjC,MAAM,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACpC,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAChC,SAAiB,EACjB,QAA4B;IAE5B,MAAM,KAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;IACxC,KAAK,MAAM,IAAI,IAAI,+BAA+B,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC7D,KAAK,CAAC,GAAG,CAAC,GAAG,SAAS,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface WorkflowOptions {
|
|
2
|
+
packages?: {
|
|
3
|
+
name: string;
|
|
4
|
+
path: string;
|
|
5
|
+
isSubmodule?: boolean;
|
|
6
|
+
isGitRepo?: boolean;
|
|
7
|
+
}[];
|
|
8
|
+
}
|
|
9
|
+
export declare function ensureGitattributes(cwd: string): void;
|
|
10
|
+
/**
|
|
11
|
+
* Create the mini-trellis memory skeleton under `.trellis/`.
|
|
12
|
+
* Does not write task.py, workflow.md, tasks/, or channel agents.
|
|
13
|
+
*/
|
|
14
|
+
export declare function createWorkflowStructure(cwd: string, _options?: WorkflowOptions): Promise<void>;
|
|
15
|
+
//# sourceMappingURL=workflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/configurators/workflow.ts"],"names":[],"mappings":"AAqBA,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE;QACT,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,SAAS,CAAC,EAAE,OAAO,CAAC;KACrB,EAAE,CAAC;CACL;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAerD;AAED;;;GAGG;AACH,wBAAsB,uBAAuB,CAC3C,GAAG,EAAE,MAAM,EACX,QAAQ,CAAC,EAAE,eAAe,GACzB,OAAO,CAAC,IAAI,CAAC,CAoCf"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { DIR_NAMES, PATHS } from "../constants/paths.js";
|
|
4
|
+
import { copyTrellisDir } from "../templates/extract.js";
|
|
5
|
+
import { configYamlTemplate, gitignoreTemplate, gitattributesTemplate, } from "../templates/trellis/index.js";
|
|
6
|
+
import { agentProgressIndexContent, guidesIndexContent, miniMemoryGuideContent, researchReadmeContent, } from "../templates/markdown/index.js";
|
|
7
|
+
import { writeFile, ensureDir } from "../utils/file-writer.js";
|
|
8
|
+
import { replacePythonCommandLiterals } from "./shared.js";
|
|
9
|
+
const JOURNAL_MERGE_UNION_PATTERN = /journal-\*\.md\s+merge=union/;
|
|
10
|
+
export function ensureGitattributes(cwd) {
|
|
11
|
+
const targetPath = path.join(cwd, ".gitattributes");
|
|
12
|
+
if (!fs.existsSync(targetPath)) {
|
|
13
|
+
fs.writeFileSync(targetPath, gitattributesTemplate);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const existing = fs.readFileSync(targetPath, "utf-8");
|
|
17
|
+
if (JOURNAL_MERGE_UNION_PATTERN.test(existing)) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const separator = existing.endsWith("\n") ? "\n" : "\n\n";
|
|
21
|
+
fs.writeFileSync(targetPath, existing + separator + gitattributesTemplate);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Create the mini-trellis memory skeleton under `.trellis/`.
|
|
25
|
+
* Does not write task.py, workflow.md, tasks/, or channel agents.
|
|
26
|
+
*/
|
|
27
|
+
export async function createWorkflowStructure(cwd, _options) {
|
|
28
|
+
ensureDir(path.join(cwd, DIR_NAMES.WORKFLOW));
|
|
29
|
+
await copyTrellisDir("scripts", path.join(cwd, PATHS.SCRIPTS), {
|
|
30
|
+
executable: true,
|
|
31
|
+
});
|
|
32
|
+
await writeFile(path.join(cwd, DIR_NAMES.WORKFLOW, ".gitignore"), gitignoreTemplate);
|
|
33
|
+
await writeFile(path.join(cwd, DIR_NAMES.WORKFLOW, "config.yaml"), configYamlTemplate);
|
|
34
|
+
ensureGitattributes(cwd);
|
|
35
|
+
ensureDir(path.join(cwd, PATHS.WORKSPACE));
|
|
36
|
+
await writeFile(path.join(cwd, PATHS.WORKSPACE, "index.md"), replacePythonCommandLiterals(agentProgressIndexContent));
|
|
37
|
+
const researchDir = path.join(cwd, DIR_NAMES.WORKFLOW, "research");
|
|
38
|
+
ensureDir(researchDir);
|
|
39
|
+
await writeFile(path.join(researchDir, "README.md"), researchReadmeContent);
|
|
40
|
+
ensureDir(path.join(researchDir, "archive"));
|
|
41
|
+
const guidesDir = path.join(cwd, PATHS.SPEC, "guides");
|
|
42
|
+
ensureDir(guidesDir);
|
|
43
|
+
await writeFile(path.join(guidesDir, "index.md"), guidesIndexContent);
|
|
44
|
+
await writeFile(path.join(guidesDir, "mini-memory.md"), miniMemoryGuideContent);
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow.js","sourceRoot":"","sources":["../../src/configurators/workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,+BAA+B,CAAC;AACvC,O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Path constants for Trellis workflow structure
|
|
3
|
+
*
|
|
4
|
+
* Change these values to rename directories across the entire project.
|
|
5
|
+
* All paths should be relative to the project root.
|
|
6
|
+
*/
|
|
7
|
+
export declare const DIR_NAMES: {
|
|
8
|
+
/** Root workflow directory */
|
|
9
|
+
readonly WORKFLOW: ".trellis";
|
|
10
|
+
/** Workspace directory (under .trellis/) - developer work areas */
|
|
11
|
+
readonly WORKSPACE: "workspace";
|
|
12
|
+
/** Tasks directory (under .trellis/) - unified task storage */
|
|
13
|
+
readonly TASKS: "tasks";
|
|
14
|
+
/** Archive directory (under tasks/) */
|
|
15
|
+
readonly ARCHIVE: "archive";
|
|
16
|
+
/** Spec/guidelines directory (under .trellis/) */
|
|
17
|
+
readonly SPEC: "spec";
|
|
18
|
+
/** Scripts directory (under .trellis/) */
|
|
19
|
+
readonly SCRIPTS: "scripts";
|
|
20
|
+
/** Channel runtime agent definitions (under .trellis/) */
|
|
21
|
+
readonly AGENTS: "agents";
|
|
22
|
+
};
|
|
23
|
+
export declare const FILE_NAMES: {
|
|
24
|
+
/** Root agent instructions file */
|
|
25
|
+
readonly AGENTS: "AGENTS.md";
|
|
26
|
+
/** Developer identity file */
|
|
27
|
+
readonly DEVELOPER: ".developer";
|
|
28
|
+
/** Current task pointer */
|
|
29
|
+
readonly CURRENT_TASK: ".current-task";
|
|
30
|
+
/** Task metadata */
|
|
31
|
+
readonly TASK_JSON: "task.json";
|
|
32
|
+
/** Requirements document */
|
|
33
|
+
readonly PRD: "prd.md";
|
|
34
|
+
/** Workflow guide */
|
|
35
|
+
readonly WORKFLOW_GUIDE: "workflow.md";
|
|
36
|
+
/** Journal file prefix */
|
|
37
|
+
readonly JOURNAL_PREFIX: "journal-";
|
|
38
|
+
};
|
|
39
|
+
export declare const PATHS: {
|
|
40
|
+
/** .trellis/ */
|
|
41
|
+
readonly WORKFLOW: ".trellis";
|
|
42
|
+
/** .trellis/workspace/ */
|
|
43
|
+
readonly WORKSPACE: ".trellis/workspace";
|
|
44
|
+
/** .trellis/tasks/ */
|
|
45
|
+
readonly TASKS: ".trellis/tasks";
|
|
46
|
+
/** .trellis/spec/ */
|
|
47
|
+
readonly SPEC: ".trellis/spec";
|
|
48
|
+
/** .trellis/scripts/ */
|
|
49
|
+
readonly SCRIPTS: ".trellis/scripts";
|
|
50
|
+
/** .trellis/agents/ */
|
|
51
|
+
readonly AGENTS: ".trellis/agents";
|
|
52
|
+
/** .trellis/.developer */
|
|
53
|
+
readonly DEVELOPER_FILE: ".trellis/.developer";
|
|
54
|
+
/** .trellis/.current-task */
|
|
55
|
+
readonly CURRENT_TASK_FILE: ".trellis/.current-task";
|
|
56
|
+
/** .trellis/workflow.md */
|
|
57
|
+
readonly WORKFLOW_GUIDE_FILE: ".trellis/workflow.md";
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Get developer's workspace directory path
|
|
61
|
+
* @example getWorkspaceDir("john") => ".trellis/workspace/john"
|
|
62
|
+
*/
|
|
63
|
+
export declare function getWorkspaceDir(developer: string): string;
|
|
64
|
+
/**
|
|
65
|
+
* Get task directory path
|
|
66
|
+
* @example getTaskDir("01-21-my-task") => ".trellis/tasks/01-21-my-task"
|
|
67
|
+
*/
|
|
68
|
+
export declare function getTaskDir(taskName: string): string;
|
|
69
|
+
/**
|
|
70
|
+
* Get archive directory path
|
|
71
|
+
* @example getArchiveDir() => ".trellis/tasks/archive"
|
|
72
|
+
*/
|
|
73
|
+
export declare function getArchiveDir(): string;
|
|
74
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/constants/paths.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,eAAO,MAAM,SAAS;IACpB,8BAA8B;;IAE9B,mEAAmE;;IAEnE,+DAA+D;;IAE/D,uCAAuC;;IAEvC,kDAAkD;;IAElD,0CAA0C;;IAE1C,0DAA0D;;CAElD,CAAC;AAGX,eAAO,MAAM,UAAU;IACrB,mCAAmC;;IAEnC,8BAA8B;;IAE9B,2BAA2B;;IAE3B,oBAAoB;;IAEpB,4BAA4B;;IAE5B,qBAAqB;;IAErB,0BAA0B;;CAElB,CAAC;AAGX,eAAO,MAAM,KAAK;IAChB,gBAAgB;;IAEhB,0BAA0B;;IAE1B,sBAAsB;;IAEtB,qBAAqB;;IAErB,wBAAwB;;IAExB,uBAAuB;;IAEvB,0BAA0B;;IAE1B,6BAA6B;;IAE7B,2BAA2B;;CAEnB,CAAC;AAEX;;;GAGG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;GAGG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAEtC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path constants for Trellis workflow structure
|
|
3
|
+
*
|
|
4
|
+
* Change these values to rename directories across the entire project.
|
|
5
|
+
* All paths should be relative to the project root.
|
|
6
|
+
*/
|
|
7
|
+
// Directory names (can be renamed)
|
|
8
|
+
export const DIR_NAMES = {
|
|
9
|
+
/** Root workflow directory */
|
|
10
|
+
WORKFLOW: ".trellis",
|
|
11
|
+
/** Workspace directory (under .trellis/) - developer work areas */
|
|
12
|
+
WORKSPACE: "workspace",
|
|
13
|
+
/** Tasks directory (under .trellis/) - unified task storage */
|
|
14
|
+
TASKS: "tasks",
|
|
15
|
+
/** Archive directory (under tasks/) */
|
|
16
|
+
ARCHIVE: "archive",
|
|
17
|
+
/** Spec/guidelines directory (under .trellis/) */
|
|
18
|
+
SPEC: "spec",
|
|
19
|
+
/** Scripts directory (under .trellis/) */
|
|
20
|
+
SCRIPTS: "scripts",
|
|
21
|
+
/** Channel runtime agent definitions (under .trellis/) */
|
|
22
|
+
AGENTS: "agents",
|
|
23
|
+
};
|
|
24
|
+
// File names
|
|
25
|
+
export const FILE_NAMES = {
|
|
26
|
+
/** Root agent instructions file */
|
|
27
|
+
AGENTS: "AGENTS.md",
|
|
28
|
+
/** Developer identity file */
|
|
29
|
+
DEVELOPER: ".developer",
|
|
30
|
+
/** Current task pointer */
|
|
31
|
+
CURRENT_TASK: ".current-task",
|
|
32
|
+
/** Task metadata */
|
|
33
|
+
TASK_JSON: "task.json",
|
|
34
|
+
/** Requirements document */
|
|
35
|
+
PRD: "prd.md",
|
|
36
|
+
/** Workflow guide */
|
|
37
|
+
WORKFLOW_GUIDE: "workflow.md",
|
|
38
|
+
/** Journal file prefix */
|
|
39
|
+
JOURNAL_PREFIX: "journal-",
|
|
40
|
+
};
|
|
41
|
+
// Constructed paths (relative to project root)
|
|
42
|
+
export const PATHS = {
|
|
43
|
+
/** .trellis/ */
|
|
44
|
+
WORKFLOW: DIR_NAMES.WORKFLOW,
|
|
45
|
+
/** .trellis/workspace/ */
|
|
46
|
+
WORKSPACE: `${DIR_NAMES.WORKFLOW}/${DIR_NAMES.WORKSPACE}`,
|
|
47
|
+
/** .trellis/tasks/ */
|
|
48
|
+
TASKS: `${DIR_NAMES.WORKFLOW}/${DIR_NAMES.TASKS}`,
|
|
49
|
+
/** .trellis/spec/ */
|
|
50
|
+
SPEC: `${DIR_NAMES.WORKFLOW}/${DIR_NAMES.SPEC}`,
|
|
51
|
+
/** .trellis/scripts/ */
|
|
52
|
+
SCRIPTS: `${DIR_NAMES.WORKFLOW}/${DIR_NAMES.SCRIPTS}`,
|
|
53
|
+
/** .trellis/agents/ */
|
|
54
|
+
AGENTS: `${DIR_NAMES.WORKFLOW}/${DIR_NAMES.AGENTS}`,
|
|
55
|
+
/** .trellis/.developer */
|
|
56
|
+
DEVELOPER_FILE: `${DIR_NAMES.WORKFLOW}/${FILE_NAMES.DEVELOPER}`,
|
|
57
|
+
/** .trellis/.current-task */
|
|
58
|
+
CURRENT_TASK_FILE: `${DIR_NAMES.WORKFLOW}/${FILE_NAMES.CURRENT_TASK}`,
|
|
59
|
+
/** .trellis/workflow.md */
|
|
60
|
+
WORKFLOW_GUIDE_FILE: `${DIR_NAMES.WORKFLOW}/${FILE_NAMES.WORKFLOW_GUIDE}`,
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Get developer's workspace directory path
|
|
64
|
+
* @example getWorkspaceDir("john") => ".trellis/workspace/john"
|
|
65
|
+
*/
|
|
66
|
+
export function getWorkspaceDir(developer) {
|
|
67
|
+
return `${PATHS.WORKSPACE}/${developer}`;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Get task directory path
|
|
71
|
+
* @example getTaskDir("01-21-my-task") => ".trellis/tasks/01-21-my-task"
|
|
72
|
+
*/
|
|
73
|
+
export function getTaskDir(taskName) {
|
|
74
|
+
return `${PATHS.TASKS}/${taskName}`;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Get archive directory path
|
|
78
|
+
* @example getArchiveDir() => ".trellis/tasks/archive"
|
|
79
|
+
*/
|
|
80
|
+
export function getArchiveDir() {
|
|
81
|
+
return `${PATHS.TASKS}/${DIR_NAMES.ARCHIVE}`;
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/constants/paths.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,mCAAmC;AACnC,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,8BAA8B;IAC9B,QAAQ,EAAE,UAAU;IACpB,mEAAmE;IACnE,SAAS,EAAE,WAAW;IACtB,+DAA+D;IAC/D,KAAK,EAAE,OAAO;IACd,uCAAuC;IACvC,OAAO,EAAE,SAAS;IAClB,kDAAkD;IAClD,IAAI,EAAE,MAAM;IACZ,0CAA0C;IAC1C,OAAO,EAAE,SAAS;IAClB,0DAA0D;IAC1D,MAAM,EAAE,QAAQ;CACR,CAAC;AAEX,aAAa;AACb,MAAM,CAAC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I,SAAS,EAAE,CAAC;AAC3C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,QAAgB;IACzC,OAAO,GAAG,KAAK,CAAC,KAAK,IAAI,QAAQ,EAAE,CAAC;AACtC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,GAAG,KAAK,CAAC,KAAK,IAAI,SAAS,CAAC,OAAO,EAAE,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Package version and name constants.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from cli/index.ts to avoid import-time side effects
|
|
5
|
+
* (program.parse(), checkForUpdates, etc.) when only VERSION is needed.
|
|
6
|
+
*/
|
|
7
|
+
export declare const VERSION: string;
|
|
8
|
+
export declare const PACKAGE_NAME: string;
|
|
9
|
+
//# sourceMappingURL=version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/constants/version.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAiBH,eAAO,MAAM,OAAO,EAAE,MAA4B,CAAC;AACnD,eAAO,MAAM,YAAY,EAAE,MAAyB,CAAC"}
|