@mindfoldhq/trellis 0.3.10-beta.0 → 0.3.10
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/dist/cli/index.js +0 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/init.d.ts +0 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +31 -203
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +6 -154
- package/dist/commands/update.js.map +1 -1
- package/dist/configurators/workflow.d.ts +2 -6
- package/dist/configurators/workflow.d.ts.map +1 -1
- package/dist/configurators/workflow.js +58 -88
- package/dist/configurators/workflow.js.map +1 -1
- package/dist/migrations/index.d.ts +0 -1
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/index.js +0 -2
- package/dist/migrations/index.js.map +1 -1
- package/dist/migrations/manifests/0.3.10.json +9 -0
- package/dist/templates/claude/agents/dispatch.md +2 -1
- package/dist/templates/claude/agents/implement.md +3 -2
- package/dist/templates/claude/commands/trellis/before-backend-dev.md +13 -0
- package/dist/templates/claude/commands/trellis/before-frontend-dev.md +13 -0
- package/dist/templates/claude/commands/trellis/check-backend.md +13 -0
- package/dist/templates/claude/commands/trellis/check-frontend.md +13 -0
- package/dist/templates/claude/commands/trellis/create-command.md +2 -2
- package/dist/templates/claude/commands/trellis/onboard.md +13 -13
- package/dist/templates/claude/commands/trellis/parallel.md +2 -1
- package/dist/templates/claude/commands/trellis/record-session.md +2 -2
- package/dist/templates/claude/commands/trellis/start.md +4 -8
- package/dist/templates/claude/hooks/inject-subagent-context.py +13 -21
- package/dist/templates/claude/hooks/session-start.py +2 -170
- package/dist/templates/codex/skills/before-backend-dev/SKILL.md +18 -0
- package/dist/templates/codex/skills/before-frontend-dev/SKILL.md +18 -0
- package/dist/templates/codex/skills/check-backend/SKILL.md +18 -0
- package/dist/templates/codex/skills/check-frontend/SKILL.md +18 -0
- package/dist/templates/codex/skills/create-command/SKILL.md +2 -2
- package/dist/templates/codex/skills/onboard/SKILL.md +11 -11
- package/dist/templates/codex/skills/record-session/SKILL.md +2 -2
- package/dist/templates/codex/skills/start/SKILL.md +3 -8
- package/dist/templates/cursor/commands/trellis-before-backend-dev.md +13 -0
- package/dist/templates/cursor/commands/trellis-before-frontend-dev.md +13 -0
- package/dist/templates/cursor/commands/trellis-check-backend.md +13 -0
- package/dist/templates/cursor/commands/trellis-check-frontend.md +13 -0
- package/dist/templates/cursor/commands/trellis-create-command.md +2 -2
- package/dist/templates/cursor/commands/trellis-onboard.md +13 -13
- package/dist/templates/cursor/commands/trellis-record-session.md +2 -2
- package/dist/templates/cursor/commands/trellis-start.md +16 -7
- package/dist/templates/gemini/commands/trellis/before-backend-dev.toml +17 -0
- package/dist/templates/gemini/commands/trellis/before-frontend-dev.toml +17 -0
- package/dist/templates/gemini/commands/trellis/check-backend.toml +17 -0
- package/dist/templates/gemini/commands/trellis/check-frontend.toml +17 -0
- package/dist/templates/gemini/commands/trellis/create-command.toml +2 -2
- package/dist/templates/gemini/commands/trellis/onboard.toml +2 -2
- package/dist/templates/gemini/commands/trellis/record-session.toml +2 -2
- package/dist/templates/gemini/commands/trellis/start.toml +4 -9
- package/dist/templates/iflow/agents/dispatch.md +2 -1
- package/dist/templates/iflow/agents/implement.md +3 -2
- package/dist/templates/iflow/commands/trellis/before-backend-dev.md +13 -0
- package/dist/templates/iflow/commands/trellis/before-frontend-dev.md +13 -0
- package/dist/templates/iflow/commands/trellis/check-backend.md +13 -0
- package/dist/templates/iflow/commands/trellis/check-frontend.md +13 -0
- package/dist/templates/iflow/commands/trellis/create-command.md +2 -2
- package/dist/templates/iflow/commands/trellis/onboard.md +13 -13
- package/dist/templates/iflow/commands/trellis/parallel.md +2 -1
- package/dist/templates/iflow/commands/trellis/record-session.md +2 -2
- package/dist/templates/iflow/commands/trellis/start.md +4 -8
- package/dist/templates/iflow/hooks/inject-subagent-context.py +13 -21
- package/dist/templates/iflow/hooks/session-start.py +1 -156
- package/dist/templates/kilo/workflows/before-backend-dev.md +13 -0
- package/dist/templates/kilo/workflows/before-frontend-dev.md +13 -0
- package/dist/templates/kilo/workflows/check-backend.md +13 -0
- package/dist/templates/kilo/workflows/check-frontend.md +13 -0
- package/dist/templates/kilo/workflows/create-command.md +2 -2
- package/dist/templates/kilo/workflows/onboard.md +13 -13
- package/dist/templates/kilo/workflows/parallel.md +2 -1
- package/dist/templates/kilo/workflows/record-session.md +2 -2
- package/dist/templates/kilo/workflows/start.md +3 -8
- package/dist/templates/kiro/skills/before-backend-dev/SKILL.md +18 -0
- package/dist/templates/kiro/skills/before-frontend-dev/SKILL.md +18 -0
- package/dist/templates/kiro/skills/check-backend/SKILL.md +18 -0
- package/dist/templates/kiro/skills/check-frontend/SKILL.md +18 -0
- package/dist/templates/kiro/skills/create-command/SKILL.md +2 -2
- package/dist/templates/kiro/skills/onboard/SKILL.md +11 -11
- package/dist/templates/kiro/skills/record-session/SKILL.md +2 -2
- package/dist/templates/kiro/skills/start/SKILL.md +3 -8
- package/dist/templates/markdown/spec/backend/script-conventions.md +0 -93
- package/dist/templates/opencode/agents/dispatch.md +2 -1
- package/dist/templates/opencode/agents/implement.md +2 -2
- package/dist/templates/opencode/agents/research.md +2 -1
- package/dist/templates/opencode/commands/trellis/before-backend-dev.md +13 -0
- package/dist/templates/opencode/commands/trellis/before-frontend-dev.md +13 -0
- package/dist/templates/opencode/commands/trellis/check-backend.md +13 -0
- package/dist/templates/opencode/commands/trellis/check-frontend.md +13 -0
- package/dist/templates/opencode/commands/trellis/create-command.md +2 -2
- package/dist/templates/opencode/commands/trellis/onboard.md +13 -13
- package/dist/templates/opencode/commands/trellis/parallel.md +2 -1
- package/dist/templates/opencode/commands/trellis/record-session.md +2 -2
- package/dist/templates/opencode/commands/trellis/start.md +3 -8
- package/dist/templates/opencode/plugin/inject-subagent-context.js +18 -45
- package/dist/templates/opencode/plugin/session-start.js +1 -149
- package/dist/templates/qoder/skills/before-backend-dev/SKILL.md +18 -0
- package/dist/templates/qoder/skills/before-frontend-dev/SKILL.md +18 -0
- package/dist/templates/qoder/skills/check-backend/SKILL.md +18 -0
- package/dist/templates/qoder/skills/check-frontend/SKILL.md +18 -0
- package/dist/templates/qoder/skills/create-command/SKILL.md +2 -2
- package/dist/templates/qoder/skills/onboard/SKILL.md +13 -13
- package/dist/templates/qoder/skills/record-session/SKILL.md +2 -2
- package/dist/templates/qoder/skills/start/SKILL.md +3 -8
- package/dist/templates/trellis/config.yaml +0 -20
- package/dist/templates/trellis/index.d.ts +0 -11
- package/dist/templates/trellis/index.d.ts.map +1 -1
- package/dist/templates/trellis/index.js +0 -22
- package/dist/templates/trellis/index.js.map +1 -1
- package/dist/templates/trellis/scripts/add_session.py +7 -52
- package/dist/templates/trellis/scripts/common/cli_adapter.py +45 -33
- package/dist/templates/trellis/scripts/common/config.py +0 -152
- package/dist/templates/trellis/scripts/common/git_context.py +586 -23
- package/dist/templates/trellis/scripts/common/paths.py +0 -46
- package/dist/templates/trellis/scripts/common/phase.py +49 -50
- package/dist/templates/trellis/scripts/common/registry.py +72 -41
- package/dist/templates/trellis/scripts/common/task_queue.py +98 -27
- package/dist/templates/trellis/scripts/common/task_utils.py +6 -96
- package/dist/templates/trellis/scripts/create_bootstrap.py +26 -31
- package/dist/templates/trellis/scripts/multi_agent/cleanup.py +48 -43
- package/dist/templates/trellis/scripts/multi_agent/create_pr.py +45 -336
- package/dist/templates/trellis/scripts/multi_agent/plan.py +26 -2
- package/dist/templates/trellis/scripts/multi_agent/start.py +57 -126
- package/dist/templates/trellis/scripts/multi_agent/status.py +753 -12
- package/dist/templates/trellis/scripts/task.py +975 -50
- package/dist/templates/trellis/workflow.md +34 -21
- package/dist/types/migration.d.ts +1 -3
- package/dist/types/migration.d.ts.map +1 -1
- package/dist/utils/project-detector.d.ts +0 -23
- package/dist/utils/project-detector.d.ts.map +1 -1
- package/dist/utils/project-detector.js +0 -364
- package/dist/utils/project-detector.js.map +1 -1
- package/dist/utils/template-fetcher.d.ts +10 -2
- package/dist/utils/template-fetcher.d.ts.map +1 -1
- package/dist/utils/template-fetcher.js +43 -12
- package/dist/utils/template-fetcher.js.map +1 -1
- package/package.json +1 -1
- package/dist/migrations/manifests/0.4.0-beta.1.json +0 -228
- package/dist/templates/claude/commands/trellis/before-dev.md +0 -29
- package/dist/templates/claude/commands/trellis/check.md +0 -25
- package/dist/templates/codex/skills/before-dev/SKILL.md +0 -34
- package/dist/templates/codex/skills/check/SKILL.md +0 -30
- package/dist/templates/cursor/commands/trellis-before-dev.md +0 -29
- package/dist/templates/cursor/commands/trellis-check.md +0 -25
- package/dist/templates/gemini/commands/trellis/before-dev.toml +0 -33
- package/dist/templates/gemini/commands/trellis/check.toml +0 -29
- package/dist/templates/iflow/commands/trellis/before-dev.md +0 -29
- package/dist/templates/iflow/commands/trellis/check.md +0 -25
- package/dist/templates/kilo/workflows/before-dev.md +0 -29
- package/dist/templates/kilo/workflows/check.md +0 -25
- package/dist/templates/kiro/skills/before-dev/SKILL.md +0 -34
- package/dist/templates/kiro/skills/check/SKILL.md +0 -30
- package/dist/templates/opencode/commands/trellis/before-dev.md +0 -29
- package/dist/templates/opencode/commands/trellis/check.md +0 -25
- package/dist/templates/qoder/skills/before-dev/SKILL.md +0 -34
- package/dist/templates/qoder/skills/check/SKILL.md +0 -30
- package/dist/templates/trellis/scripts/common/git.py +0 -31
- package/dist/templates/trellis/scripts/common/io.py +0 -37
- package/dist/templates/trellis/scripts/common/log.py +0 -45
- package/dist/templates/trellis/scripts/common/packages_context.py +0 -233
- package/dist/templates/trellis/scripts/common/session_context.py +0 -466
- package/dist/templates/trellis/scripts/common/task_context.py +0 -384
- package/dist/templates/trellis/scripts/common/task_store.py +0 -534
- package/dist/templates/trellis/scripts/common/tasks.py +0 -109
- package/dist/templates/trellis/scripts/common/types.py +0 -112
- package/dist/templates/trellis/scripts/hooks/linear_sync.py +0 -243
- package/dist/templates/trellis/scripts/multi_agent/_bootstrap.py +0 -17
- package/dist/templates/trellis/scripts/multi_agent/status_display.py +0 -542
- package/dist/templates/trellis/scripts/multi_agent/status_monitor.py +0 -225
|
@@ -29,23 +29,12 @@ export declare const commonPhase: string;
|
|
|
29
29
|
export declare const commonRegistry: string;
|
|
30
30
|
export declare const commonCliAdapter: string;
|
|
31
31
|
export declare const commonConfig: string;
|
|
32
|
-
export declare const commonIo: string;
|
|
33
|
-
export declare const commonLog: string;
|
|
34
|
-
export declare const commonGit: string;
|
|
35
|
-
export declare const commonTypes: string;
|
|
36
|
-
export declare const commonTasks: string;
|
|
37
|
-
export declare const commonTaskContext: string;
|
|
38
|
-
export declare const commonTaskStore: string;
|
|
39
|
-
export declare const commonSessionContext: string;
|
|
40
|
-
export declare const commonPackagesContext: string;
|
|
41
32
|
export declare const multiAgentInit: string;
|
|
42
33
|
export declare const multiAgentStart: string;
|
|
43
34
|
export declare const multiAgentCleanup: string;
|
|
44
35
|
export declare const multiAgentStatus: string;
|
|
45
36
|
export declare const multiAgentCreatePr: string;
|
|
46
37
|
export declare const multiAgentPlan: string;
|
|
47
|
-
export declare const multiAgentStatusDisplay: string;
|
|
48
|
-
export declare const multiAgentStatusMonitor: string;
|
|
49
38
|
export declare const getDeveloperScript: string;
|
|
50
39
|
export declare const initDeveloperScript: string;
|
|
51
40
|
export declare const taskScript: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/trellis/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAcH,eAAO,MAAM,WAAW,QAAsC,CAAC;AAG/D,eAAO,MAAM,UAAU,QAA6C,CAAC;AACrE,eAAO,MAAM,WAAW,QAA0C,CAAC;AACnE,eAAO,MAAM,eAAe,QAA8C,CAAC;AAC3E,eAAO,MAAM,gBAAgB,QAAgD,CAAC;AAC9E,eAAO,MAAM,cAAc,QAA6C,CAAC;AACzE,eAAO,MAAM,eAAe,QAA+C,CAAC;AA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EjC,CAAC;AAGF,eAAO,MAAM,kBAAkB,QAA8B,CAAC;AAC9D,eAAO,MAAM,kBAAkB,QAA8B,CAAC;AAC9D,eAAO,MAAM,oBAAoB,QAAgC,CAAC;AAClE,eAAO,MAAM,iBAAiB,QAAgC,CAAC;AAE/D;;GAEG;AACH,wBAAgB,aAAa,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAoCnD"}
|
|
@@ -39,15 +39,6 @@ export const commonPhase = readTemplate("scripts/common/phase.py");
|
|
|
39
39
|
export const commonRegistry = readTemplate("scripts/common/registry.py");
|
|
40
40
|
export const commonCliAdapter = readTemplate("scripts/common/cli_adapter.py");
|
|
41
41
|
export const commonConfig = readTemplate("scripts/common/config.py");
|
|
42
|
-
export const commonIo = readTemplate("scripts/common/io.py");
|
|
43
|
-
export const commonLog = readTemplate("scripts/common/log.py");
|
|
44
|
-
export const commonGit = readTemplate("scripts/common/git.py");
|
|
45
|
-
export const commonTypes = readTemplate("scripts/common/types.py");
|
|
46
|
-
export const commonTasks = readTemplate("scripts/common/tasks.py");
|
|
47
|
-
export const commonTaskContext = readTemplate("scripts/common/task_context.py");
|
|
48
|
-
export const commonTaskStore = readTemplate("scripts/common/task_store.py");
|
|
49
|
-
export const commonSessionContext = readTemplate("scripts/common/session_context.py");
|
|
50
|
-
export const commonPackagesContext = readTemplate("scripts/common/packages_context.py");
|
|
51
42
|
// Python scripts - multi_agent
|
|
52
43
|
export const multiAgentInit = readTemplate("scripts/multi_agent/__init__.py");
|
|
53
44
|
export const multiAgentStart = readTemplate("scripts/multi_agent/start.py");
|
|
@@ -55,8 +46,6 @@ export const multiAgentCleanup = readTemplate("scripts/multi_agent/cleanup.py");
|
|
|
55
46
|
export const multiAgentStatus = readTemplate("scripts/multi_agent/status.py");
|
|
56
47
|
export const multiAgentCreatePr = readTemplate("scripts/multi_agent/create_pr.py");
|
|
57
48
|
export const multiAgentPlan = readTemplate("scripts/multi_agent/plan.py");
|
|
58
|
-
export const multiAgentStatusDisplay = readTemplate("scripts/multi_agent/status_display.py");
|
|
59
|
-
export const multiAgentStatusMonitor = readTemplate("scripts/multi_agent/status_monitor.py");
|
|
60
49
|
// Python scripts - main
|
|
61
50
|
export const getDeveloperScript = readTemplate("scripts/get_developer.py");
|
|
62
51
|
export const initDeveloperScript = readTemplate("scripts/init_developer.py");
|
|
@@ -88,15 +77,6 @@ export function getAllScripts() {
|
|
|
88
77
|
scripts.set("common/registry.py", commonRegistry);
|
|
89
78
|
scripts.set("common/cli_adapter.py", commonCliAdapter);
|
|
90
79
|
scripts.set("common/config.py", commonConfig);
|
|
91
|
-
scripts.set("common/io.py", commonIo);
|
|
92
|
-
scripts.set("common/log.py", commonLog);
|
|
93
|
-
scripts.set("common/git.py", commonGit);
|
|
94
|
-
scripts.set("common/types.py", commonTypes);
|
|
95
|
-
scripts.set("common/tasks.py", commonTasks);
|
|
96
|
-
scripts.set("common/task_context.py", commonTaskContext);
|
|
97
|
-
scripts.set("common/task_store.py", commonTaskStore);
|
|
98
|
-
scripts.set("common/session_context.py", commonSessionContext);
|
|
99
|
-
scripts.set("common/packages_context.py", commonPackagesContext);
|
|
100
80
|
// Multi-agent
|
|
101
81
|
scripts.set("multi_agent/__init__.py", multiAgentInit);
|
|
102
82
|
scripts.set("multi_agent/start.py", multiAgentStart);
|
|
@@ -104,8 +84,6 @@ export function getAllScripts() {
|
|
|
104
84
|
scripts.set("multi_agent/status.py", multiAgentStatus);
|
|
105
85
|
scripts.set("multi_agent/create_pr.py", multiAgentCreatePr);
|
|
106
86
|
scripts.set("multi_agent/plan.py", multiAgentPlan);
|
|
107
|
-
scripts.set("multi_agent/status_display.py", multiAgentStatusDisplay);
|
|
108
|
-
scripts.set("multi_agent/status_monitor.py", multiAgentStatusMonitor);
|
|
109
87
|
// Main
|
|
110
88
|
scripts.set("get_developer.py", getDeveloperScript);
|
|
111
89
|
scripts.set("init_developer.py", initDeveloperScript);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"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sB,EAAE,eAAe,CAAC,CAAC;IACrD,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE,iBAAiB,CAAC,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,gBAAgB,CAAC,CAAC;IACvD,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,kBAAkB,CAAC,CAAC;IAC5D,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,cAAc,CAAC,CAAC;IAEnD,OAAO;IACP,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;IACpD,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,CAAC;IACtD,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IACnC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;IAChD,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;IAChD,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,qBAAqB,CAAC,CAAC;IAE1D,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -4,18 +4,13 @@
|
|
|
4
4
|
Add a new session to journal file and update index.md.
|
|
5
5
|
|
|
6
6
|
Usage:
|
|
7
|
-
python3 add_session.py --title "Title" --commit "hash" --summary "Summary"
|
|
8
|
-
|
|
9
|
-
# Pipe detailed content via stdin (use --stdin to opt in):
|
|
10
|
-
cat << 'EOF' | python3 add_session.py --stdin --title "Title" --summary "Summary"
|
|
11
|
-
<session content here>
|
|
12
|
-
EOF
|
|
7
|
+
python3 add_session.py --title "Title" --commit "hash" --summary "Summary"
|
|
8
|
+
echo "content" | python3 add_session.py --title "Title" --commit "hash"
|
|
13
9
|
"""
|
|
14
10
|
|
|
15
11
|
from __future__ import annotations
|
|
16
12
|
|
|
17
13
|
import argparse
|
|
18
|
-
import json
|
|
19
14
|
import re
|
|
20
15
|
import subprocess
|
|
21
16
|
import sys
|
|
@@ -25,20 +20,11 @@ from pathlib import Path
|
|
|
25
20
|
from common.paths import (
|
|
26
21
|
FILE_JOURNAL_PREFIX,
|
|
27
22
|
get_repo_root,
|
|
28
|
-
get_current_task,
|
|
29
23
|
get_developer,
|
|
30
24
|
get_workspace_dir,
|
|
31
25
|
)
|
|
32
26
|
from common.developer import ensure_developer
|
|
33
|
-
from common.
|
|
34
|
-
from common.config import (
|
|
35
|
-
get_packages,
|
|
36
|
-
get_session_commit_message,
|
|
37
|
-
get_max_journal_lines,
|
|
38
|
-
is_monorepo,
|
|
39
|
-
resolve_package,
|
|
40
|
-
validate_package,
|
|
41
|
-
)
|
|
27
|
+
from common.config import get_session_commit_message, get_max_journal_lines
|
|
42
28
|
|
|
43
29
|
|
|
44
30
|
# =============================================================================
|
|
@@ -137,8 +123,7 @@ def generate_session_content(
|
|
|
137
123
|
commit: str,
|
|
138
124
|
summary: str,
|
|
139
125
|
extra_content: str,
|
|
140
|
-
today: str
|
|
141
|
-
package: str | None = None,
|
|
126
|
+
today: str
|
|
142
127
|
) -> str:
|
|
143
128
|
"""Generate session content."""
|
|
144
129
|
if commit and commit != "-":
|
|
@@ -150,14 +135,12 @@ def generate_session_content(
|
|
|
150
135
|
else:
|
|
151
136
|
commit_table = "(No commits - planning session)"
|
|
152
137
|
|
|
153
|
-
package_line = f"\n**Package**: {package}" if package else ""
|
|
154
|
-
|
|
155
138
|
return f"""
|
|
156
139
|
|
|
157
140
|
## Session {session_num}: {title}
|
|
158
141
|
|
|
159
142
|
**Date**: {today}
|
|
160
|
-
**Task**: {title}
|
|
143
|
+
**Task**: {title}
|
|
161
144
|
|
|
162
145
|
### Summary
|
|
163
146
|
|
|
@@ -322,7 +305,6 @@ def add_session(
|
|
|
322
305
|
summary: str = "(Add summary)",
|
|
323
306
|
extra_content: str = "(Add details)",
|
|
324
307
|
auto_commit: bool = True,
|
|
325
|
-
package: str | None = None,
|
|
326
308
|
) -> int:
|
|
327
309
|
"""Add a new session."""
|
|
328
310
|
repo_root = get_repo_root()
|
|
@@ -348,7 +330,7 @@ def add_session(
|
|
|
348
330
|
new_session = current_session + 1
|
|
349
331
|
|
|
350
332
|
session_content = generate_session_content(
|
|
351
|
-
new_session, title, commit, summary, extra_content, today
|
|
333
|
+
new_session, title, commit, summary, extra_content, today
|
|
352
334
|
)
|
|
353
335
|
content_lines = len(session_content.splitlines())
|
|
354
336
|
|
|
@@ -418,11 +400,8 @@ def main() -> int:
|
|
|
418
400
|
parser.add_argument("--commit", default="-", help="Comma-separated commit hashes")
|
|
419
401
|
parser.add_argument("--summary", default="(Add summary)", help="Brief summary")
|
|
420
402
|
parser.add_argument("--content-file", help="Path to file with detailed content")
|
|
421
|
-
parser.add_argument("--package", help="Package name tag (e.g., cli, docs-site)")
|
|
422
403
|
parser.add_argument("--no-commit", action="store_true",
|
|
423
404
|
help="Skip auto-commit of workspace changes")
|
|
424
|
-
parser.add_argument("--stdin", action="store_true",
|
|
425
|
-
help="Read extra content from stdin (explicit opt-in)")
|
|
426
405
|
|
|
427
406
|
args = parser.parse_args()
|
|
428
407
|
|
|
@@ -431,36 +410,12 @@ def main() -> int:
|
|
|
431
410
|
content_path = Path(args.content_file)
|
|
432
411
|
if content_path.is_file():
|
|
433
412
|
extra_content = content_path.read_text(encoding="utf-8")
|
|
434
|
-
elif
|
|
413
|
+
elif not sys.stdin.isatty():
|
|
435
414
|
extra_content = sys.stdin.read()
|
|
436
415
|
|
|
437
|
-
# Resolve package: CLI → active task → default_package → None
|
|
438
|
-
repo_root = get_repo_root()
|
|
439
|
-
package = args.package
|
|
440
|
-
if package:
|
|
441
|
-
# CLI source: fail-fast in monorepo, ignore in single-repo
|
|
442
|
-
if not is_monorepo(repo_root):
|
|
443
|
-
print("Warning: --package ignored in single-repo project", file=sys.stderr)
|
|
444
|
-
package = None
|
|
445
|
-
elif not validate_package(package, repo_root):
|
|
446
|
-
packages = get_packages(repo_root)
|
|
447
|
-
available = ", ".join(sorted(packages.keys())) if packages else "(none)"
|
|
448
|
-
print(f"Error: unknown package '{package}'. Available: {available}", file=sys.stderr)
|
|
449
|
-
return 1
|
|
450
|
-
else:
|
|
451
|
-
# Inferred: active task's task.json.package → default_package → None
|
|
452
|
-
task_package = None
|
|
453
|
-
current = get_current_task(repo_root)
|
|
454
|
-
if current:
|
|
455
|
-
ct = load_task(repo_root / current)
|
|
456
|
-
if ct and ct.package:
|
|
457
|
-
task_package = ct.package
|
|
458
|
-
package = resolve_package(task_package, repo_root)
|
|
459
|
-
|
|
460
416
|
return add_session(
|
|
461
417
|
args.title, args.commit, args.summary, extra_content,
|
|
462
418
|
auto_commit=not args.no_commit,
|
|
463
|
-
package=package,
|
|
464
419
|
)
|
|
465
420
|
|
|
466
421
|
|
|
@@ -175,7 +175,7 @@ class CLIAdapter:
|
|
|
175
175
|
"""Get relative path to a trellis command file.
|
|
176
176
|
|
|
177
177
|
Args:
|
|
178
|
-
name: Command name without extension (e.g., 'finish-work', 'check')
|
|
178
|
+
name: Command name without extension (e.g., 'finish-work', 'check-backend')
|
|
179
179
|
|
|
180
180
|
Returns:
|
|
181
181
|
Relative path string for use in JSONL entries
|
|
@@ -492,29 +492,6 @@ def get_cli_adapter(platform: str = "claude") -> CLIAdapter:
|
|
|
492
492
|
return CLIAdapter(platform=platform) # type: ignore
|
|
493
493
|
|
|
494
494
|
|
|
495
|
-
_ALL_PLATFORM_CONFIG_DIRS = (
|
|
496
|
-
".claude",
|
|
497
|
-
".cursor",
|
|
498
|
-
".iflow",
|
|
499
|
-
".opencode",
|
|
500
|
-
".agents",
|
|
501
|
-
".kilocode",
|
|
502
|
-
".kiro",
|
|
503
|
-
".gemini",
|
|
504
|
-
".agent",
|
|
505
|
-
)
|
|
506
|
-
"""All platform config directory names (used by detect_platform exclusion checks)."""
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
def _has_other_platform_dir(project_root: Path, exclude: set[str]) -> bool:
|
|
510
|
-
"""Check if any platform config dir exists besides those in *exclude*."""
|
|
511
|
-
return any(
|
|
512
|
-
(project_root / d).is_dir()
|
|
513
|
-
for d in _ALL_PLATFORM_CONFIG_DIRS
|
|
514
|
-
if d not in exclude
|
|
515
|
-
)
|
|
516
|
-
|
|
517
|
-
|
|
518
495
|
def detect_platform(project_root: Path) -> Platform:
|
|
519
496
|
"""Auto-detect platform based on existing config directories.
|
|
520
497
|
|
|
@@ -556,10 +533,12 @@ def detect_platform(project_root: Path) -> Platform:
|
|
|
556
533
|
return env_platform # type: ignore
|
|
557
534
|
|
|
558
535
|
# Check for .opencode directory (OpenCode-specific)
|
|
536
|
+
# Note: .claude might exist in both platforms during migration
|
|
559
537
|
if (project_root / ".opencode").is_dir():
|
|
560
538
|
return "opencode"
|
|
561
539
|
|
|
562
540
|
# Check for .iflow directory (iFlow-specific)
|
|
541
|
+
# Note: .claude might exist in both platforms during migration
|
|
563
542
|
if (project_root / ".iflow").is_dir():
|
|
564
543
|
return "iflow"
|
|
565
544
|
|
|
@@ -573,9 +552,20 @@ def detect_platform(project_root: Path) -> Platform:
|
|
|
573
552
|
return "gemini"
|
|
574
553
|
|
|
575
554
|
# Check for Codex skills directory only when no other platform config exists
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
555
|
+
other_platform_dirs_codex = (
|
|
556
|
+
".claude",
|
|
557
|
+
".cursor",
|
|
558
|
+
".iflow",
|
|
559
|
+
".opencode",
|
|
560
|
+
".kilocode",
|
|
561
|
+
".kiro",
|
|
562
|
+
".gemini",
|
|
563
|
+
".agent",
|
|
564
|
+
)
|
|
565
|
+
has_other_platform_config = any(
|
|
566
|
+
(project_root / directory).is_dir() for directory in other_platform_dirs_codex
|
|
567
|
+
)
|
|
568
|
+
if (project_root / ".agents" / "skills").is_dir() and not has_other_platform_config:
|
|
579
569
|
return "codex"
|
|
580
570
|
|
|
581
571
|
# Check for .kilocode directory (Kilo-specific)
|
|
@@ -583,17 +573,39 @@ def detect_platform(project_root: Path) -> Platform:
|
|
|
583
573
|
return "kilo"
|
|
584
574
|
|
|
585
575
|
# Check for Kiro skills directory only when no other platform config exists
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
576
|
+
other_platform_dirs_kiro = (
|
|
577
|
+
".claude",
|
|
578
|
+
".cursor",
|
|
579
|
+
".iflow",
|
|
580
|
+
".opencode",
|
|
581
|
+
".agents",
|
|
582
|
+
".kilocode",
|
|
583
|
+
".gemini",
|
|
584
|
+
".agent",
|
|
585
|
+
)
|
|
586
|
+
has_other_platform_config = any(
|
|
587
|
+
(project_root / directory).is_dir() for directory in other_platform_dirs_kiro
|
|
588
|
+
)
|
|
589
|
+
if (project_root / ".kiro" / "skills").is_dir() and not has_other_platform_config:
|
|
589
590
|
return "kiro"
|
|
590
591
|
|
|
591
592
|
# Check for Antigravity workflow directory only when no other platform config exists
|
|
593
|
+
other_platform_dirs_antigravity = (
|
|
594
|
+
".claude",
|
|
595
|
+
".cursor",
|
|
596
|
+
".iflow",
|
|
597
|
+
".opencode",
|
|
598
|
+
".agents",
|
|
599
|
+
".kilocode",
|
|
600
|
+
".kiro",
|
|
601
|
+
)
|
|
602
|
+
has_other_platform_config = any(
|
|
603
|
+
(project_root / directory).is_dir()
|
|
604
|
+
for directory in other_platform_dirs_antigravity
|
|
605
|
+
)
|
|
592
606
|
if (
|
|
593
607
|
project_root / ".agent" / "workflows"
|
|
594
|
-
).is_dir() and not
|
|
595
|
-
project_root, {".agent", ".gemini"}
|
|
596
|
-
):
|
|
608
|
+
).is_dir() and not has_other_platform_config:
|
|
597
609
|
return "antigravity"
|
|
598
610
|
|
|
599
611
|
# Check for .qoder directory (Qoder-specific)
|
|
@@ -7,7 +7,6 @@ Reads settings from .trellis/config.yaml with sensible defaults.
|
|
|
7
7
|
|
|
8
8
|
from __future__ import annotations
|
|
9
9
|
|
|
10
|
-
import sys
|
|
11
10
|
from pathlib import Path
|
|
12
11
|
|
|
13
12
|
from .paths import DIR_WORKFLOW, get_repo_root
|
|
@@ -71,154 +70,3 @@ def get_hooks(event: str, repo_root: Path | None = None) -> list[str]:
|
|
|
71
70
|
if isinstance(commands, list):
|
|
72
71
|
return [str(c) for c in commands]
|
|
73
72
|
return []
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
# =============================================================================
|
|
77
|
-
# Monorepo / Packages
|
|
78
|
-
# =============================================================================
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
def get_packages(repo_root: Path | None = None) -> dict[str, dict] | None:
|
|
82
|
-
"""Get monorepo package declarations.
|
|
83
|
-
|
|
84
|
-
Returns:
|
|
85
|
-
Dict mapping package name to its config (path, type, etc.),
|
|
86
|
-
or None if not configured (single-repo mode).
|
|
87
|
-
|
|
88
|
-
Example return:
|
|
89
|
-
{"cli": {"path": "packages/cli"}, "docs-site": {"path": "docs-site", "type": "submodule"}}
|
|
90
|
-
"""
|
|
91
|
-
config = _load_config(repo_root)
|
|
92
|
-
packages = config.get("packages")
|
|
93
|
-
if not isinstance(packages, dict):
|
|
94
|
-
return None
|
|
95
|
-
# Ensure each value is a dict (filter out scalar entries)
|
|
96
|
-
filtered = {k: v for k, v in packages.items() if isinstance(v, dict)}
|
|
97
|
-
if not filtered:
|
|
98
|
-
return None
|
|
99
|
-
return filtered
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
def get_default_package(repo_root: Path | None = None) -> str | None:
|
|
103
|
-
"""Get the default package name from config.
|
|
104
|
-
|
|
105
|
-
Returns:
|
|
106
|
-
Package name string, or None if not configured.
|
|
107
|
-
"""
|
|
108
|
-
config = _load_config(repo_root)
|
|
109
|
-
value = config.get("default_package")
|
|
110
|
-
return str(value) if value else None
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
def get_submodule_packages(repo_root: Path | None = None) -> dict[str, str]:
|
|
114
|
-
"""Get packages that are git submodules.
|
|
115
|
-
|
|
116
|
-
Returns:
|
|
117
|
-
Dict mapping package name to its path for submodule-type packages.
|
|
118
|
-
Empty dict if none configured.
|
|
119
|
-
|
|
120
|
-
Example return:
|
|
121
|
-
{"docs-site": "docs-site"}
|
|
122
|
-
"""
|
|
123
|
-
packages = get_packages(repo_root)
|
|
124
|
-
if packages is None:
|
|
125
|
-
return {}
|
|
126
|
-
return {
|
|
127
|
-
name: cfg.get("path", name)
|
|
128
|
-
for name, cfg in packages.items()
|
|
129
|
-
if cfg.get("type") == "submodule"
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
def is_monorepo(repo_root: Path | None = None) -> bool:
|
|
134
|
-
"""Check if the project is configured as a monorepo (has packages in config)."""
|
|
135
|
-
return get_packages(repo_root) is not None
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
def get_spec_base(package: str | None = None, repo_root: Path | None = None) -> str:
|
|
139
|
-
"""Get the spec directory base path relative to .trellis/.
|
|
140
|
-
|
|
141
|
-
Single-repo: returns "spec"
|
|
142
|
-
Monorepo with package: returns "spec/<package>"
|
|
143
|
-
Monorepo without package: returns "spec" (caller should specify package)
|
|
144
|
-
"""
|
|
145
|
-
if package and is_monorepo(repo_root):
|
|
146
|
-
return f"spec/{package}"
|
|
147
|
-
return "spec"
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
def validate_package(package: str, repo_root: Path | None = None) -> bool:
|
|
151
|
-
"""Check if a package name is valid in this project.
|
|
152
|
-
|
|
153
|
-
Single-repo (no packages configured): always returns True.
|
|
154
|
-
Monorepo: returns True only if package exists in config.yaml packages.
|
|
155
|
-
"""
|
|
156
|
-
packages = get_packages(repo_root)
|
|
157
|
-
if packages is None:
|
|
158
|
-
return True # Single-repo, no validation needed
|
|
159
|
-
return package in packages
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
def resolve_package(
|
|
163
|
-
task_package: str | None = None,
|
|
164
|
-
repo_root: Path | None = None,
|
|
165
|
-
) -> str | None:
|
|
166
|
-
"""Resolve package from inferred sources with validation.
|
|
167
|
-
|
|
168
|
-
Checks in order: task_package → default_package.
|
|
169
|
-
Invalid inferred values print a warning to stderr and are skipped.
|
|
170
|
-
|
|
171
|
-
Returns:
|
|
172
|
-
Resolved package name, or None if no valid package found.
|
|
173
|
-
|
|
174
|
-
Note:
|
|
175
|
-
CLI --package should be validated separately by the caller
|
|
176
|
-
(fail-fast with available packages list on error).
|
|
177
|
-
"""
|
|
178
|
-
packages = get_packages(repo_root)
|
|
179
|
-
if packages is None:
|
|
180
|
-
return None # Single-repo, no package needed
|
|
181
|
-
|
|
182
|
-
# Try task_package (guard against non-string values from malformed JSON)
|
|
183
|
-
if task_package and isinstance(task_package, str):
|
|
184
|
-
if task_package in packages:
|
|
185
|
-
return task_package
|
|
186
|
-
print(
|
|
187
|
-
f"Warning: task.json package '{task_package}' not found in config, skipping",
|
|
188
|
-
file=sys.stderr,
|
|
189
|
-
)
|
|
190
|
-
|
|
191
|
-
# Try default_package
|
|
192
|
-
default = get_default_package(repo_root)
|
|
193
|
-
if default:
|
|
194
|
-
if default in packages:
|
|
195
|
-
return default
|
|
196
|
-
print(
|
|
197
|
-
f"Warning: default_package '{default}' not found in config, skipping",
|
|
198
|
-
file=sys.stderr,
|
|
199
|
-
)
|
|
200
|
-
|
|
201
|
-
return None
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
def get_spec_scope(repo_root: Path | None = None) -> list[str] | str | None:
|
|
205
|
-
"""Get session.spec_scope configuration.
|
|
206
|
-
|
|
207
|
-
Returns:
|
|
208
|
-
list[str]: Package names to include in spec scanning.
|
|
209
|
-
str: "active_task" to use current task's package.
|
|
210
|
-
None: No scope configured (scan all packages).
|
|
211
|
-
"""
|
|
212
|
-
config = _load_config(repo_root)
|
|
213
|
-
session = config.get("session")
|
|
214
|
-
if not isinstance(session, dict):
|
|
215
|
-
return None
|
|
216
|
-
|
|
217
|
-
scope = session.get("spec_scope")
|
|
218
|
-
if scope is None:
|
|
219
|
-
return None
|
|
220
|
-
if isinstance(scope, str):
|
|
221
|
-
return scope # e.g. "active_task"
|
|
222
|
-
if isinstance(scope, list):
|
|
223
|
-
return [str(s) for s in scope]
|
|
224
|
-
return None
|