@pennixrv/trellis 0.7.0-beta.5 → 0.7.0-beta.50
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.d.ts.map +1 -1
- package/dist/cli/index.js +47 -3
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/backup.d.ts +25 -0
- package/dist/commands/backup.d.ts.map +1 -0
- package/dist/commands/backup.js +152 -0
- package/dist/commands/backup.js.map +1 -0
- package/dist/commands/channel/adapters/claude.d.ts.map +1 -1
- package/dist/commands/channel/adapters/claude.js +2 -0
- package/dist/commands/channel/adapters/claude.js.map +1 -1
- package/dist/commands/channel/adapters/codex.d.ts +5 -1
- package/dist/commands/channel/adapters/codex.d.ts.map +1 -1
- package/dist/commands/channel/adapters/codex.js +19 -9
- package/dist/commands/channel/adapters/codex.js.map +1 -1
- package/dist/commands/channel/adapters/index.d.ts +3 -0
- package/dist/commands/channel/adapters/index.d.ts.map +1 -1
- package/dist/commands/channel/adapters/index.js +3 -3
- package/dist/commands/channel/adapters/index.js.map +1 -1
- package/dist/commands/channel/adapters/types.d.ts +2 -0
- package/dist/commands/channel/adapters/types.d.ts.map +1 -1
- package/dist/commands/channel/guard.d.ts.map +1 -1
- package/dist/commands/channel/guard.js +38 -29
- package/dist/commands/channel/guard.js.map +1 -1
- package/dist/commands/channel/index.d.ts.map +1 -1
- package/dist/commands/channel/index.js +52 -16
- package/dist/commands/channel/index.js.map +1 -1
- package/dist/commands/channel/kill.d.ts.map +1 -1
- package/dist/commands/channel/kill.js +37 -15
- package/dist/commands/channel/kill.js.map +1 -1
- package/dist/commands/channel/messages.d.ts.map +1 -1
- package/dist/commands/channel/messages.js +3 -2
- package/dist/commands/channel/messages.js.map +1 -1
- package/dist/commands/channel/process-identity.d.ts +3 -0
- package/dist/commands/channel/process-identity.d.ts.map +1 -0
- package/dist/commands/channel/process-identity.js +24 -0
- package/dist/commands/channel/process-identity.js.map +1 -0
- package/dist/commands/channel/profiles.d.ts +26 -0
- package/dist/commands/channel/profiles.d.ts.map +1 -0
- package/dist/commands/channel/profiles.js +186 -0
- package/dist/commands/channel/profiles.js.map +1 -0
- package/dist/commands/channel/rm.d.ts +0 -1
- package/dist/commands/channel/rm.d.ts.map +1 -1
- package/dist/commands/channel/rm.js +203 -96
- package/dist/commands/channel/rm.js.map +1 -1
- package/dist/commands/channel/spawn.d.ts +3 -0
- package/dist/commands/channel/spawn.d.ts.map +1 -1
- package/dist/commands/channel/spawn.js +43 -15
- package/dist/commands/channel/spawn.js.map +1 -1
- package/dist/commands/channel/supervisor/idle.d.ts +2 -0
- package/dist/commands/channel/supervisor/idle.d.ts.map +1 -1
- package/dist/commands/channel/supervisor/idle.js +15 -7
- package/dist/commands/channel/supervisor/idle.js.map +1 -1
- package/dist/commands/channel/supervisor/inbox.d.ts.map +1 -1
- package/dist/commands/channel/supervisor/inbox.js +48 -33
- package/dist/commands/channel/supervisor/inbox.js.map +1 -1
- package/dist/commands/channel/supervisor/stdout.d.ts.map +1 -1
- package/dist/commands/channel/supervisor/stdout.js +6 -3
- package/dist/commands/channel/supervisor/stdout.js.map +1 -1
- package/dist/commands/channel/supervisor/warning.d.ts.map +1 -1
- package/dist/commands/channel/supervisor/warning.js +2 -3
- package/dist/commands/channel/supervisor/warning.js.map +1 -1
- package/dist/commands/channel/supervisor.d.ts +12 -0
- package/dist/commands/channel/supervisor.d.ts.map +1 -1
- package/dist/commands/channel/supervisor.js +88 -16
- package/dist/commands/channel/supervisor.js.map +1 -1
- package/dist/commands/channel/wait.d.ts +3 -1
- package/dist/commands/channel/wait.d.ts.map +1 -1
- package/dist/commands/channel/wait.js +59 -14
- package/dist/commands/channel/wait.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +23 -10
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +446 -333
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/workflow.d.ts +1 -0
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +56 -1
- package/dist/commands/workflow.js.map +1 -1
- package/dist/configurators/codex.d.ts +6 -0
- package/dist/configurators/codex.d.ts.map +1 -1
- package/dist/configurators/codex.js +93 -0
- package/dist/configurators/codex.js.map +1 -1
- package/dist/configurators/shared.js +2 -2
- package/dist/configurators/shared.js.map +1 -1
- package/dist/constants/paths.d.ts +2 -0
- package/dist/constants/paths.d.ts.map +1 -1
- package/dist/constants/paths.js +2 -0
- package/dist/constants/paths.js.map +1 -1
- package/dist/migrations/manifests/0.7.0-beta.10.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.11.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.12.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.13.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.14.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.15.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.16.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.17.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.18.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.19.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.20.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.21.json +17 -0
- package/dist/migrations/manifests/0.7.0-beta.22.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.23.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.24.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.25.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.26.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.27.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.28.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.29.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.30.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.31.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.32.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.33.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.34.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.35.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.36.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.37.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.38.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.39.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.40.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.41.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.42.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.43.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.44.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.45.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.46.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.47.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.48.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.49.json +13 -0
- package/dist/migrations/manifests/0.7.0-beta.50.json +12 -0
- package/dist/migrations/manifests/0.7.0-beta.6.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.7.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.8.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.9.json +9 -0
- package/dist/templates/codex/hooks/session-start.py +21 -17
- package/dist/templates/common/bundled-skills/trellis-channel/SKILL.md +3 -1
- package/dist/templates/common/bundled-skills/trellis-channel/references/command-reference.md +24 -16
- package/dist/templates/common/bundled-skills/trellis-channel/references/forum.md +4 -12
- package/dist/templates/common/bundled-skills/trellis-channel/references/multi-target-dispatch.md +139 -0
- package/dist/templates/common/bundled-skills/trellis-channel/references/progress-debugging.md +9 -5
- package/dist/templates/common/bundled-skills/trellis-channel/references/subnode-work.md +84 -14
- package/dist/templates/common/bundled-skills/trellis-channel/references/workers.md +9 -11
- package/dist/templates/common/bundled-skills/trellis-channel/references/workflows.md +25 -14
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-skills-or-commands.md +13 -11
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-task-lifecycle.md +7 -2
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/task-system.md +6 -1
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/workflow.md +6 -4
- package/dist/templates/common/bundled-skills/trellis-session-insight/SKILL.md +42 -3
- package/dist/templates/common/bundled-skills/trellis-session-insight/references/cli-quick-reference.md +1 -1
- package/dist/templates/common/bundled-skills/trellis-session-insight/references/triggering-patterns.md +10 -2
- package/dist/templates/common/commands/continue.md +36 -8
- package/dist/templates/common/commands/finish-work.md +17 -2
- package/dist/templates/common/commands/start.md +8 -1
- package/dist/templates/common/skills/brainstorm.md +49 -22
- package/dist/templates/common/skills/break-loop.md +6 -10
- package/dist/templates/common/skills/check.md +34 -5
- package/dist/templates/copilot/hooks/session-start.py +19 -15
- package/dist/templates/copilot/prompts/brainstorm.prompt.md +27 -21
- package/dist/templates/markdown/spec/backend/database-guidelines.md.txt +22 -22
- package/dist/templates/markdown/spec/backend/directory-structure.md.txt +20 -20
- package/dist/templates/markdown/spec/backend/error-handling.md.txt +22 -22
- package/dist/templates/markdown/spec/backend/index.md.txt +19 -19
- package/dist/templates/markdown/spec/backend/logging-guidelines.md.txt +22 -22
- package/dist/templates/markdown/spec/backend/quality-guidelines.md.txt +22 -22
- package/dist/templates/markdown/spec/frontend/component-guidelines.md.txt +25 -25
- package/dist/templates/markdown/spec/frontend/directory-structure.md.txt +20 -20
- package/dist/templates/markdown/spec/frontend/hook-guidelines.md.txt +22 -22
- package/dist/templates/markdown/spec/frontend/index.md.txt +20 -20
- package/dist/templates/markdown/spec/frontend/quality-guidelines.md.txt +22 -22
- package/dist/templates/markdown/spec/frontend/state-management.md.txt +22 -22
- package/dist/templates/markdown/spec/frontend/type-safety.md.txt +22 -22
- package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md.txt +80 -85
- package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +164 -209
- package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +161 -185
- package/dist/templates/markdown/spec/guides/index.md.txt +51 -51
- package/dist/templates/markdown/workspace-index.md +44 -44
- package/dist/templates/opencode/lib/session-utils.js +2 -2
- package/dist/templates/shared-hooks/inject-shell-session-context.py +3 -6
- package/dist/templates/shared-hooks/inject-workflow-state.py +3 -2
- package/dist/templates/shared-hooks/session-start.py +23 -18
- package/dist/templates/trellis/agents/subnode-profiles.json +13 -0
- package/dist/templates/trellis/agents/subnode.md +11 -5
- package/dist/templates/trellis/config.yaml +2 -0
- package/dist/templates/trellis/index.d.ts +2 -1
- package/dist/templates/trellis/index.d.ts.map +1 -1
- package/dist/templates/trellis/index.js +4 -2
- package/dist/templates/trellis/index.js.map +1 -1
- package/dist/templates/trellis/scripts/add_session.py +35 -32
- package/dist/templates/trellis/scripts/common/active_task.py +8 -8
- package/dist/templates/trellis/scripts/common/developer.py +18 -18
- package/dist/templates/trellis/scripts/common/ownership_record.py +13 -8
- package/dist/templates/trellis/scripts/common/safe_commit.py +38 -9
- package/dist/templates/trellis/scripts/common/task_planning.py +137 -0
- package/dist/templates/trellis/scripts/common/task_store.py +46 -14
- package/dist/templates/trellis/scripts/common/workflow_phase.py +4 -3
- package/dist/templates/trellis/scripts/subnode_artifact.py +470 -21
- package/dist/templates/trellis/scripts/task.py +175 -2
- package/dist/templates/trellis/workflow.md +407 -388
- package/dist/utils/managed-paths.d.ts +2 -0
- package/dist/utils/managed-paths.d.ts.map +1 -1
- package/dist/utils/managed-paths.js +24 -2
- package/dist/utils/managed-paths.js.map +1 -1
- package/dist/utils/template-fetcher.d.ts +1 -0
- package/dist/utils/template-fetcher.d.ts.map +1 -1
- package/dist/utils/template-fetcher.js +2 -1
- package/dist/utils/template-fetcher.js.map +1 -1
- package/dist/utils/uninstall-scrubbers.d.ts.map +1 -1
- package/dist/utils/uninstall-scrubbers.js +5 -0
- package/dist/utils/uninstall-scrubbers.js.map +1 -1
- package/dist/utils/workflow-provenance.d.ts +24 -0
- package/dist/utils/workflow-provenance.d.ts.map +1 -0
- package/dist/utils/workflow-provenance.js +71 -0
- package/dist/utils/workflow-provenance.js.map +1 -0
- package/dist/utils/workflow-resolver.d.ts +9 -2
- package/dist/utils/workflow-resolver.d.ts.map +1 -1
- package/dist/utils/workflow-resolver.js +33 -7
- package/dist/utils/workflow-resolver.js.map +1 -1
- package/package.json +2 -2
- package/dist/templates/trellis/agents/subnode.env +0 -4
|
@@ -294,33 +294,39 @@ def _parse_meta_pairs(pairs: list[str] | None) -> dict[str, str] | None:
|
|
|
294
294
|
file=sys.stderr,
|
|
295
295
|
)
|
|
296
296
|
return None
|
|
297
|
+
try:
|
|
298
|
+
from .task_planning import validate_meta_value
|
|
299
|
+
validate_meta_value(key, value)
|
|
300
|
+
except ValueError as exc:
|
|
301
|
+
print(colored(f"Error: {exc}", Colors.RED), file=sys.stderr)
|
|
302
|
+
return None
|
|
297
303
|
meta[key] = value
|
|
298
304
|
return meta
|
|
299
305
|
|
|
300
306
|
|
|
301
307
|
def _default_prd_content(title: str, description: str | None = None) -> str:
|
|
302
308
|
"""Return the default PRD skeleton created with every task."""
|
|
303
|
-
goal = (description or "").strip() or "
|
|
304
|
-
heading = title.strip() or "
|
|
309
|
+
goal = (description or "").strip() or "待填写。"
|
|
310
|
+
heading = title.strip() or "未命名任务"
|
|
305
311
|
return f"""# {heading}
|
|
306
312
|
|
|
307
|
-
## Goal
|
|
313
|
+
## 目标(Goal)
|
|
308
314
|
|
|
309
315
|
{goal}
|
|
310
316
|
|
|
311
|
-
## Requirements
|
|
317
|
+
## 需求(Requirements)
|
|
312
318
|
|
|
313
|
-
-
|
|
319
|
+
- 待填写
|
|
314
320
|
|
|
315
|
-
## Acceptance Criteria
|
|
321
|
+
## 验收标准(Acceptance Criteria)
|
|
316
322
|
|
|
317
|
-
- [ ]
|
|
323
|
+
- [ ] 待填写
|
|
318
324
|
|
|
319
|
-
## Notes
|
|
325
|
+
## 备注(Notes)
|
|
320
326
|
|
|
321
|
-
-
|
|
322
|
-
-
|
|
323
|
-
-
|
|
327
|
+
- 让 `prd.md` 聚焦需求、约束和验收标准。
|
|
328
|
+
- 轻量任务可以只保留 PRD。
|
|
329
|
+
- 复杂任务在 `task.py start` 前增加 `design.md` 记录技术设计,增加 `implement.md` 记录执行计划。
|
|
324
330
|
"""
|
|
325
331
|
|
|
326
332
|
|
|
@@ -662,7 +668,7 @@ def cmd_create(args: argparse.Namespace) -> int:
|
|
|
662
668
|
if getattr(args, "no_start", False):
|
|
663
669
|
print(
|
|
664
670
|
colored(
|
|
665
|
-
"Skipped session activation (--no-start); run task.py start when
|
|
671
|
+
"Skipped session activation (--no-start); run task.py select to plan, start only when authorized.",
|
|
666
672
|
Colors.YELLOW,
|
|
667
673
|
),
|
|
668
674
|
file=sys.stderr,
|
|
@@ -1327,6 +1333,13 @@ def cmd_archive(args: argparse.Namespace) -> int:
|
|
|
1327
1333
|
Colors.RED), file=sys.stderr)
|
|
1328
1334
|
return 1
|
|
1329
1335
|
|
|
1336
|
+
from .ownership_record import OwnershipError, assert_task_mutation_allowed
|
|
1337
|
+
try:
|
|
1338
|
+
assert_task_mutation_allowed(repo_root, task_dir)
|
|
1339
|
+
except (OwnershipError, OSError, ValueError) as exc:
|
|
1340
|
+
print(colored(f"Error: {exc}", Colors.RED), file=sys.stderr)
|
|
1341
|
+
return 1
|
|
1342
|
+
|
|
1330
1343
|
# Check the destination before anything below mutates task state. The
|
|
1331
1344
|
# mover refuses a collision too, but by then this command has already
|
|
1332
1345
|
# marked the task completed, re-parented its children and cleared the
|
|
@@ -1469,7 +1482,9 @@ def cmd_archive(args: argparse.Namespace) -> int:
|
|
|
1469
1482
|
|
|
1470
1483
|
# Auto-commit unless --no-commit
|
|
1471
1484
|
if not getattr(args, "no_commit", False):
|
|
1472
|
-
if not _auto_commit_archive(
|
|
1485
|
+
if not _auto_commit_archive(
|
|
1486
|
+
dir_name, repo_root, modified_children, archive_dest
|
|
1487
|
+
):
|
|
1473
1488
|
print(
|
|
1474
1489
|
colored(
|
|
1475
1490
|
"Archive moved on disk, but git auto-commit did not complete. "
|
|
@@ -1495,6 +1510,7 @@ def _auto_commit_archive(
|
|
|
1495
1510
|
task_name: str,
|
|
1496
1511
|
repo_root: Path,
|
|
1497
1512
|
modified_children: list[str] | None = None,
|
|
1513
|
+
archive_dest: Path | None = None,
|
|
1498
1514
|
) -> bool:
|
|
1499
1515
|
"""Stage Trellis-owned task paths and commit after archive.
|
|
1500
1516
|
|
|
@@ -1527,7 +1543,10 @@ def _auto_commit_archive(
|
|
|
1527
1543
|
source_was_tracked = rc == 0 and bool(tracked_out.strip())
|
|
1528
1544
|
|
|
1529
1545
|
paths = safe_archive_paths_to_add(
|
|
1530
|
-
repo_root,
|
|
1546
|
+
repo_root,
|
|
1547
|
+
task_name=task_name,
|
|
1548
|
+
modified_children=modified_children,
|
|
1549
|
+
archive_dest=archive_dest,
|
|
1531
1550
|
)
|
|
1532
1551
|
if not paths:
|
|
1533
1552
|
print("[OK] No task changes to commit.", file=sys.stderr)
|
|
@@ -1928,6 +1947,12 @@ def cmd_set_meta(args: argparse.Namespace) -> int:
|
|
|
1928
1947
|
return 1
|
|
1929
1948
|
key = args.key
|
|
1930
1949
|
value = args.value
|
|
1950
|
+
from .task_planning import invalidate_plan, validate_meta_value
|
|
1951
|
+
try:
|
|
1952
|
+
validate_meta_value(key, value)
|
|
1953
|
+
except ValueError as exc:
|
|
1954
|
+
print(colored(f"Error: {exc}", Colors.RED), file=sys.stderr)
|
|
1955
|
+
return 1
|
|
1931
1956
|
|
|
1932
1957
|
if not key:
|
|
1933
1958
|
print(colored("Error: Missing arguments", Colors.RED))
|
|
@@ -1953,6 +1978,13 @@ def cmd_set_meta(args: argparse.Namespace) -> int:
|
|
|
1953
1978
|
meta = data.get("meta")
|
|
1954
1979
|
if not isinstance(meta, dict):
|
|
1955
1980
|
meta = {}
|
|
1981
|
+
if key in {"execution_class", "delivery_mode"} and meta.get(key) != value and "planning" in meta:
|
|
1982
|
+
try:
|
|
1983
|
+
invalidate_plan(data)
|
|
1984
|
+
except ValueError as exc:
|
|
1985
|
+
print(colored(f"Error: {exc}", Colors.RED), file=sys.stderr)
|
|
1986
|
+
return 1
|
|
1987
|
+
meta = data["meta"]
|
|
1956
1988
|
meta[key] = value
|
|
1957
1989
|
data["meta"] = meta
|
|
1958
1990
|
if not write_json(task_json, data):
|
|
@@ -36,7 +36,8 @@ _MARKER_RE = re.compile(r"^\[(/?)([A-Za-z][^\[\]]*)\]\s*$")
|
|
|
36
36
|
_STEP_HEADING_RE = re.compile(r"^####\s+(\d+\.\d+)\b.*$")
|
|
37
37
|
|
|
38
38
|
# Phase Index starts here; Phase 1/2/3 step bodies follow; ends at Breadcrumbs.
|
|
39
|
-
|
|
39
|
+
_PHASE_INDEX_HEADINGS = {"## Phase Index", "## 阶段索引(Phase Index)"}
|
|
40
|
+
_PHASE_ONE_HEADINGS = {"## Phase 1: Plan", "## 阶段一:规划(Phase 1: Plan)"}
|
|
40
41
|
|
|
41
42
|
|
|
42
43
|
def _read_workflow() -> str:
|
|
@@ -75,10 +76,10 @@ def get_phase_index() -> str:
|
|
|
75
76
|
end: int | None = None
|
|
76
77
|
for i, line in enumerate(lines):
|
|
77
78
|
stripped = line.strip()
|
|
78
|
-
if start is None and stripped
|
|
79
|
+
if start is None and stripped in _PHASE_INDEX_HEADINGS:
|
|
79
80
|
start = i
|
|
80
81
|
continue
|
|
81
|
-
if start is not None and stripped
|
|
82
|
+
if start is not None and stripped in _PHASE_ONE_HEADINGS:
|
|
82
83
|
end = i
|
|
83
84
|
break
|
|
84
85
|
|