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,15 @@
|
|
|
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
|
+
import fs from "node:fs";
|
|
8
|
+
import path from "node:path";
|
|
9
|
+
import { fileURLToPath } from "node:url";
|
|
10
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
11
|
+
const packageJsonPath = path.resolve(__dirname, "../../package.json");
|
|
12
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8"));
|
|
13
|
+
export const VERSION = packageJson.version;
|
|
14
|
+
export const PACKAGE_NAME = packageJson.name;
|
|
15
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/constants/version.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAOzC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/D,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;AACtE,MAAM,WAAW,GAAgB,IAAI,CAAC,KAAK,CACzC,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC,CAC1C,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAW,WAAW,CAAC,OAAO,CAAC;AACnD,MAAM,CAAC,MAAM,YAAY,GAAW,WAAW,CAAC,IAAI,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trellis - AI-assisted development workflow framework
|
|
3
|
+
*
|
|
4
|
+
* Based on Anthropic's "Effective Harnesses for Long-Running Agents"
|
|
5
|
+
* https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents
|
|
6
|
+
*/
|
|
7
|
+
export { VERSION } from "./constants/version.js";
|
|
8
|
+
export { init } from "./commands/init.js";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trellis - AI-assisted development workflow framework
|
|
3
|
+
*
|
|
4
|
+
* Based on Anthropic's "Effective Harnesses for Long-Running Agents"
|
|
5
|
+
* https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents
|
|
6
|
+
*/
|
|
7
|
+
export { VERSION } from "./constants/version.js";
|
|
8
|
+
export { init } from "./commands/init.js";
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claude Code templates — settings only.
|
|
3
|
+
* Hooks come from shared-hooks/. Commands come from common/.
|
|
4
|
+
*/
|
|
5
|
+
export declare const settingsTemplate: string;
|
|
6
|
+
export interface SettingsTemplate {
|
|
7
|
+
targetPath: string;
|
|
8
|
+
content: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function getSettingsTemplate(): SettingsTemplate;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/claude/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,eAAO,MAAM,gBAAgB,QAG5B,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,mBAAmB,IAAI,gBAAgB,CAKtD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claude Code templates — settings only.
|
|
3
|
+
* Hooks come from shared-hooks/. Commands come from common/.
|
|
4
|
+
*/
|
|
5
|
+
import { readFileSync } from "node:fs";
|
|
6
|
+
import { dirname, join } from "node:path";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
8
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
9
|
+
const __dirname = dirname(__filename);
|
|
10
|
+
export const settingsTemplate = readFileSync(join(__dirname, "settings.json"), "utf-8");
|
|
11
|
+
export function getSettingsTemplate() {
|
|
12
|
+
return {
|
|
13
|
+
targetPath: "settings.json",
|
|
14
|
+
content: settingsTemplate,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/claude/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,MAAM,CAAC,MAAM,gBAAgB,GAAG,YAAY,CAC1C,IAAI,CAAC,SAAS,EAAE,eAAe,CAAC,EAChC,OAAO,CACR,CAAC;AAOF,MAAM,UAAU,mBAAmB;IACjC,OAAO;QACL,UAAU,EAAE,eAAe;QAC3B,OAAO,EAAE,gBAAgB;KAC1B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"env": {
|
|
3
|
+
"CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR": "1"
|
|
4
|
+
},
|
|
5
|
+
"hooks": {
|
|
6
|
+
"SessionStart": [
|
|
7
|
+
{
|
|
8
|
+
"matcher": "startup",
|
|
9
|
+
"hooks": [
|
|
10
|
+
{
|
|
11
|
+
"type": "command",
|
|
12
|
+
"command": "{{PYTHON_CMD}} .claude/hooks/session-start.py",
|
|
13
|
+
"timeout": 30
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"matcher": "clear",
|
|
19
|
+
"hooks": [
|
|
20
|
+
{
|
|
21
|
+
"type": "command",
|
|
22
|
+
"command": "{{PYTHON_CMD}} .claude/hooks/session-start.py",
|
|
23
|
+
"timeout": 30
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"matcher": "compact",
|
|
29
|
+
"hooks": [
|
|
30
|
+
{
|
|
31
|
+
"type": "command",
|
|
32
|
+
"command": "{{PYTHON_CMD}} .claude/hooks/session-start.py",
|
|
33
|
+
"timeout": 30
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"enabledPlugins": {}
|
|
40
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Project-scoped Codex defaults written by mini-trellis.
|
|
2
|
+
# Codex merges this layer after the user-level config when the project
|
|
3
|
+
# is marked as a trusted project. To trust this project, add it under
|
|
4
|
+
# `[projects]` in ~/.codex/config.toml, e.g.:
|
|
5
|
+
#
|
|
6
|
+
# [projects."/abs/path/to/this/repo"]
|
|
7
|
+
# trust_level = "trusted"
|
|
8
|
+
|
|
9
|
+
# Keep AGENTS.md as the primary project instruction file.
|
|
10
|
+
project_doc_fallback_filenames = ["AGENTS.md"]
|
|
11
|
+
|
|
12
|
+
# Codex hooks (`hooks.json` in this directory) only fire when the user
|
|
13
|
+
# has enabled them in their USER-level config: `[features].hooks = true`
|
|
14
|
+
# in ~/.codex/config.toml (Codex 0.129+; legacy name: `codex_hooks = true`,
|
|
15
|
+
# still works but emits a deprecation warning on 0.129+). Project-level
|
|
16
|
+
# config.toml cannot set feature flags; they must be user-level.
|
|
17
|
+
# Codex 0.129+ additionally gates each installed hook behind a one-time
|
|
18
|
+
# `/hooks` TUI review; until the user approves it, the hook stays inactive.
|
|
19
|
+
|
|
20
|
+
# NOTE: mini-trellis intentionally does NOT write a [features.multi_agent_v2]
|
|
21
|
+
# block here. Codex CLI changed `features` deserialization between 0.130
|
|
22
|
+
# and 0.131: the structured table form (with max_concurrent_threads_per_session
|
|
23
|
+
# / *_wait_timeout_ms) is only accepted by 0.131+. On 0.130 and earlier —
|
|
24
|
+
# including the codex CLI bundled inside the Codex desktop app — it fails
|
|
25
|
+
# with `data did not match any variant of untagged enum FeatureToml`, which
|
|
26
|
+
# aborts the entire config load and blocks Codex from starting. Codex's own
|
|
27
|
+
# default for multi_agent_v2 is used instead; tune it in your user-level
|
|
28
|
+
# config if needed.
|
|
29
|
+
|
|
30
|
+
# Pin the subagent recursion depth explicitly instead of relying on Codex's
|
|
31
|
+
# default. #445 removed the per-agent `[features] multi_agent = false` guard
|
|
32
|
+
# (the #240/#241 wait_agent-deadlock structural fix) because native subagent
|
|
33
|
+
# dispatch already caps recursion via `agents.max_depth` — but that key is
|
|
34
|
+
# global/user-level, not settable inside an individual agent's .toml. Pinning
|
|
35
|
+
# it here means an upstream default change, or a user's own global override,
|
|
36
|
+
# can't silently reopen the recursion the #240/#241 fix closed. Project config
|
|
37
|
+
# (this file) takes precedence over user-level `~/.codex/config.toml`.
|
|
38
|
+
[agents]
|
|
39
|
+
max_depth = 1
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codex templates — hooks.json + config.toml.
|
|
3
|
+
* SessionStart script comes from shared-hooks/.
|
|
4
|
+
*/
|
|
5
|
+
export interface ConfigTemplate {
|
|
6
|
+
targetPath: string;
|
|
7
|
+
content: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function getHooksConfig(): string;
|
|
10
|
+
export declare function getConfigTemplate(): ConfigTemplate;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/codex/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,wBAAgB,iBAAiB,IAAI,cAAc,CAKlD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codex templates — hooks.json + config.toml.
|
|
3
|
+
* SessionStart script comes from shared-hooks/.
|
|
4
|
+
*/
|
|
5
|
+
import { readFileSync } from "node:fs";
|
|
6
|
+
import { dirname, join } from "node:path";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
8
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
9
|
+
const __dirname = dirname(__filename);
|
|
10
|
+
function readTemplate(relativePath) {
|
|
11
|
+
return readFileSync(join(__dirname, relativePath), "utf-8");
|
|
12
|
+
}
|
|
13
|
+
export function getHooksConfig() {
|
|
14
|
+
return readTemplate("hooks.json");
|
|
15
|
+
}
|
|
16
|
+
export function getConfigTemplate() {
|
|
17
|
+
return {
|
|
18
|
+
targetPath: "config.toml",
|
|
19
|
+
content: readTemplate("config.toml"),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/codex/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,SAAS,YAAY,CAAC,YAAoB;IACxC,OAAO,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,EAAE,OAAO,CAAC,CAAC;AAC9D,CAAC;AAOD,MAAM,UAAU,cAAc;IAC5B,OAAO,YAAY,CAAC,YAAY,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,iBAAiB;IAC/B,OAAO;QACL,UAAU,EAAE,aAAa;QACzB,OAAO,EAAE,YAAY,CAAC,aAAa,CAAC;KACrC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mini-trellis-session-insight
|
|
3
|
+
description: "Reach into past AI conversation history through the `mini-trellis mem` CLI. Use whenever the user asks 'how did we solve X last time', 'have we discussed this before', 'what was the decision on X', '上次怎么解的', '之前讨论过吗', or when continuing work across sessions. Returns raw past dialogue; decide whether to update spec, quote inline, or just internalize."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Session Insight
|
|
7
|
+
|
|
8
|
+
How to call `mini-trellis mem` and when that is the right move. Capability, not a workflow. No required write-back.
|
|
9
|
+
|
|
10
|
+
## What it is
|
|
11
|
+
|
|
12
|
+
A local CLI that indexes past Claude Code, Codex, OpenCode, and Pi conversation logs. Nothing is uploaded.
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
mini-trellis mem search "<keyword>"
|
|
16
|
+
mini-trellis mem extract <session-id> --grep "<keyword>"
|
|
17
|
+
mini-trellis mem context <session-id> --turns 3 --around 2
|
|
18
|
+
mini-trellis mem list --cwd <project-path>
|
|
19
|
+
mini-trellis mem projects
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Full flags: `mini-trellis mem help`.
|
|
23
|
+
|
|
24
|
+
## When
|
|
25
|
+
|
|
26
|
+
- The user asks whether a decision was already made
|
|
27
|
+
- A bug or topic feels familiar from an earlier session
|
|
28
|
+
- The user resumes after a gap ("where were we")
|
|
29
|
+
|
|
30
|
+
## When not
|
|
31
|
+
|
|
32
|
+
- The answer is already in the current turn, spec, git log, or open files
|
|
33
|
+
- The user asked not to dig through history
|
|
34
|
+
|
|
35
|
+
## After a hit
|
|
36
|
+
|
|
37
|
+
Treat output as raw material. Quote it, promote a durable boundary with `mini-trellis-update-spec`, or just use it. Do not invent a task directory.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# `mini-trellis mem` CLI Reference
|
|
2
|
+
|
|
3
|
+
Authoritative flags. `mini-trellis mem help` should match this file.
|
|
4
|
+
|
|
5
|
+
## Subcommands
|
|
6
|
+
|
|
7
|
+
| Command | Purpose |
|
|
8
|
+
| ------ | ------ |
|
|
9
|
+
| `list` | List sessions. Default when none is given. |
|
|
10
|
+
| `search <keyword>` | Find sessions whose contents match a keyword. |
|
|
11
|
+
| `context <session-id>` | Top-N hit turns plus surrounding context. Pair with `--grep`. |
|
|
12
|
+
| `extract <session-id>` | Dump cleaned dialogue. Combine with `--grep`. |
|
|
13
|
+
| `projects` | List active project `cwd` values with session counts. |
|
|
14
|
+
|
|
15
|
+
## Flags
|
|
16
|
+
|
|
17
|
+
| Flag | Subcommands | Meaning |
|
|
18
|
+
| ---- | ----------- | ------- |
|
|
19
|
+
| `--platform claude\|codex\|opencode\|pi\|all` | all | Default `all`. |
|
|
20
|
+
| `--since YYYY-MM-DD` | list / search | Inclusive lower date bound. |
|
|
21
|
+
| `--until YYYY-MM-DD` | list / search | Inclusive upper date bound. |
|
|
22
|
+
| `--global` | list / search | Include every project on this machine. |
|
|
23
|
+
| `--cwd <path>` | list / search | Force a project cwd. |
|
|
24
|
+
| `--limit N` | list / search | Cap rows. Default `50`. |
|
|
25
|
+
| `--grep KW` | extract / context | Filter turns by keyword. |
|
|
26
|
+
| `--turns N` | context | Hit turns to return. Default `3`. |
|
|
27
|
+
| `--around N` | context | Surrounding turns per hit. Default `1`. |
|
|
28
|
+
| `--max-chars N` | context | Character budget. Default `6000`. |
|
|
29
|
+
| `--include-children` | search / context | Merge OpenCode sub-agent sessions into parent. |
|
|
30
|
+
| `--json` | all | Machine-readable JSON. |
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
mini-trellis mem search "deadlock" --global --limit 20
|
|
34
|
+
mini-trellis mem context <session-id> --grep "lock" --turns 5 --around 2
|
|
35
|
+
mini-trellis mem extract <session-id> --grep memory
|
|
36
|
+
```
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Triggering Patterns
|
|
2
|
+
|
|
3
|
+
Verbatim user phrasings that should make an AI reach for `mini-trellis mem`. Calibrate instinct against these — if a user message hits one of these patterns and you do not reach for `mem`, you probably missed an obvious recall.
|
|
4
|
+
|
|
5
|
+
Patterns are grouped by the *intent* behind the phrasing, not the surface words. The same intent shows up in different languages and registers.
|
|
6
|
+
|
|
7
|
+
## Past-solution recall
|
|
8
|
+
|
|
9
|
+
The user is asking "how did we (or I) solve this before". Past dialogue holds the answer; the codebase shows the result but not the reasoning.
|
|
10
|
+
|
|
11
|
+
- "How did we solve this last time?"
|
|
12
|
+
- "What did we end up doing about X?"
|
|
13
|
+
- "We dealt with this once already, didn't we?"
|
|
14
|
+
- "上次怎么解的?"
|
|
15
|
+
- "之前是怎么搞定 X 的?"
|
|
16
|
+
- "我记得以前修过类似的"
|
|
17
|
+
|
|
18
|
+
Reach: `mini-trellis mem search "<symptom keyword>" --global --limit 10`, then `context` into the hit that looks closest.
|
|
19
|
+
|
|
20
|
+
## Decision retrieval
|
|
21
|
+
|
|
22
|
+
The user is referencing a decision that lives in old dialogue, not in any committed file.
|
|
23
|
+
|
|
24
|
+
- "What was the decision on X?"
|
|
25
|
+
- "Did we decide to use Postgres or SQLite?"
|
|
26
|
+
- "The rationale for choosing X over Y was…?"
|
|
27
|
+
- "我们当时为啥选了 X 而不是 Y?"
|
|
28
|
+
- "关于 X 我们之前是怎么定的?"
|
|
29
|
+
- "之前讨论过 X 的方案吗?"
|
|
30
|
+
|
|
31
|
+
Reach: `mini-trellis mem search "<decision keyword>"` to find the session, then `extract <id> --grep "<keyword>"` to recover the discussion.
|
|
32
|
+
|
|
33
|
+
## Cross-session continuation
|
|
34
|
+
|
|
35
|
+
The user resumed work after a gap and the context is implicit.
|
|
36
|
+
|
|
37
|
+
- "Where were we?"
|
|
38
|
+
- "Continue from last time."
|
|
39
|
+
- "Pick up where we left off."
|
|
40
|
+
- "继续上次的"
|
|
41
|
+
- "我们上次做到哪了"
|
|
42
|
+
- "接着昨天那个任务"
|
|
43
|
+
|
|
44
|
+
Reach: `mini-trellis mem list` for this project (or `--cwd <project-path>`), then `extract` the most recent session.
|
|
45
|
+
|
|
46
|
+
## Familiar-bug debugging
|
|
47
|
+
|
|
48
|
+
The current bug feels like one already seen. Past sessions probably hold the resolution path.
|
|
49
|
+
|
|
50
|
+
- "I feel like I've hit this before."
|
|
51
|
+
- "Doesn't this look like that bug from last month?"
|
|
52
|
+
- "Same kind of timeout I had in X."
|
|
53
|
+
- "这个错好像之前见过"
|
|
54
|
+
- "这个 bug 是不是上次那个?"
|
|
55
|
+
- "怎么又是这个 error?"
|
|
56
|
+
|
|
57
|
+
Reach: `mini-trellis mem search "<error message fragment>" --global`. Anchor on a short, distinctive token from the actual error string.
|
|
58
|
+
|
|
59
|
+
## Self-pattern spotting
|
|
60
|
+
|
|
61
|
+
The user is asking whether they keep repeating the same kind of mistake or decision.
|
|
62
|
+
|
|
63
|
+
- "Do I always make this mistake?"
|
|
64
|
+
- "How often have I run into X?"
|
|
65
|
+
- "Is this a recurring thing for me?"
|
|
66
|
+
- "我每次都踩这个坑吗?"
|
|
67
|
+
- "我老犯这个错?"
|
|
68
|
+
- "这类问题之前出现过几次?"
|
|
69
|
+
|
|
70
|
+
Reach: `mini-trellis mem search "<topic>" --global --limit 50` and scan the dates / projects in the listing. Optionally `extract` two or three for comparison.
|
|
71
|
+
|
|
72
|
+
## Session retrospective (on demand)
|
|
73
|
+
|
|
74
|
+
The user explicitly wants to look back at recent work — not as a forced step, only when they ask.
|
|
75
|
+
|
|
76
|
+
- "Summarize what we did."
|
|
77
|
+
- "What were the key decisions / surprises?"
|
|
78
|
+
- "Write up the lessons from this round."
|
|
79
|
+
- "总结一下这次的经验"
|
|
80
|
+
- "记一下这次踩的坑"
|
|
81
|
+
- "复盘下这个任务"
|
|
82
|
+
|
|
83
|
+
Reach: `mini-trellis mem list`, then `extract <id>` (add `--grep` when you already know the topic). Present a summary — surface concrete file:line citations where possible. Whether to also write the summary somewhere (spec, research, notes) is the user's call; offer, don't auto-write.
|
|
84
|
+
|
|
85
|
+
## Anti-patterns: do NOT reach for `mem` here
|
|
86
|
+
|
|
87
|
+
- "What does this function do?" → read the file.
|
|
88
|
+
- "Why is this test failing?" → read the test output and the file.
|
|
89
|
+
- "What's the right pattern for X in our codebase?" → grep / read spec files.
|
|
90
|
+
- "What's the latest npm version of Y?" → call `npm view`.
|
|
91
|
+
- "Fix this bug." → debug. Reach for `mem` only if you suspect prior context exists; otherwise it is noise.
|
|
92
|
+
|
|
93
|
+
The bar stays: would a senior teammate ask "didn't we already talk about this?" before answering? If yes, reach for `mem`. If no, don't.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Remember
|
|
2
|
+
|
|
3
|
+
Record this session into the journal.
|
|
4
|
+
|
|
5
|
+
## When
|
|
6
|
+
|
|
7
|
+
- The user asks to remember / persist notes
|
|
8
|
+
- The session is about to end
|
|
9
|
+
- The session was compacted, or context is about to be compacted
|
|
10
|
+
|
|
11
|
+
## Write
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
python3 ./.trellis/scripts/add_session.py \
|
|
15
|
+
--title "Short title" \
|
|
16
|
+
--commit - \
|
|
17
|
+
--summary "What happened, what was decided, what to reuse"
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
`--commit` already defaults to `-` (no git evidence). Add `--change`, `--test`, `--next-step` when they help a future session. Use `--stdin` for longer notes.
|
|
21
|
+
|
|
22
|
+
If this session produced reusable research, write `.trellis/research/<topic>.md` and mention that path in the summary. Promote durable boundaries into `.trellis/spec/` with `mini-trellis-update-spec` (short markdown).
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Common templates — single source of truth for all platforms.
|
|
3
|
+
*
|
|
4
|
+
* These templates contain {{placeholders}} that are resolved per-platform
|
|
5
|
+
* by resolvePlaceholders() in configurators/shared.ts.
|
|
6
|
+
*
|
|
7
|
+
* Directory structure:
|
|
8
|
+
* common/
|
|
9
|
+
* ├── commands/ # Templates that stay as slash commands
|
|
10
|
+
* ├── skills/ # Single-file templates that become auto-triggered skills
|
|
11
|
+
* └── bundled-skills/ # Multi-file built-in skills with references/assets
|
|
12
|
+
*/
|
|
13
|
+
export interface CommonTemplate {
|
|
14
|
+
/** Template name without extension (e.g., "start", "before-dev") */
|
|
15
|
+
name: string;
|
|
16
|
+
/** Raw content with {{placeholders}} — must be resolved before writing */
|
|
17
|
+
content: string;
|
|
18
|
+
}
|
|
19
|
+
export interface CommonBundledSkillFile {
|
|
20
|
+
/** POSIX path relative to the skill directory, e.g. "references/core.md" */
|
|
21
|
+
relativePath: string;
|
|
22
|
+
/** Raw content with {{placeholders}} — must be resolved before writing */
|
|
23
|
+
content: string;
|
|
24
|
+
}
|
|
25
|
+
export interface CommonBundledSkill {
|
|
26
|
+
/** Skill directory name, e.g. "trellis-meta" */
|
|
27
|
+
name: string;
|
|
28
|
+
/** Files that must be written under the skill directory */
|
|
29
|
+
files: CommonBundledSkillFile[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Get all command templates (stay as slash commands on all platforms).
|
|
33
|
+
* Results are cached after first call.
|
|
34
|
+
*/
|
|
35
|
+
export declare function getCommandTemplates(): CommonTemplate[];
|
|
36
|
+
/**
|
|
37
|
+
* Get all skill templates (become auto-triggered skills on supporting platforms).
|
|
38
|
+
* Results are cached after first call.
|
|
39
|
+
*/
|
|
40
|
+
export declare function getSkillTemplates(): CommonTemplate[];
|
|
41
|
+
/**
|
|
42
|
+
* Get all multi-file built-in skills.
|
|
43
|
+
*
|
|
44
|
+
* These are copied as complete skill directories so references and assets stay
|
|
45
|
+
* lazy-loadable instead of being flattened into one oversized SKILL.md.
|
|
46
|
+
*/
|
|
47
|
+
export declare function getBundledSkillTemplates(): CommonBundledSkill[];
|
|
48
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/common/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAuBH,MAAM,WAAW,cAAc;IAC7B,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB;IACrC,4EAA4E;IAC5E,YAAY,EAAE,MAAM,CAAC;IACrB,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,KAAK,EAAE,sBAAsB,EAAE,CAAC;CACjC;AAOD;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,cAAc,EAAE,CAMtD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,cAAc,EAAE,CAMpD;AAuCD;;;;;GAKG;AACH,wBAAgB,wBAAwB,IAAI,kBAAkB,EAAE,CAM/D"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Common templates — single source of truth for all platforms.
|
|
3
|
+
*
|
|
4
|
+
* These templates contain {{placeholders}} that are resolved per-platform
|
|
5
|
+
* by resolvePlaceholders() in configurators/shared.ts.
|
|
6
|
+
*
|
|
7
|
+
* Directory structure:
|
|
8
|
+
* common/
|
|
9
|
+
* ├── commands/ # Templates that stay as slash commands
|
|
10
|
+
* ├── skills/ # Single-file templates that become auto-triggered skills
|
|
11
|
+
* └── bundled-skills/ # Multi-file built-in skills with references/assets
|
|
12
|
+
*/
|
|
13
|
+
import { readdirSync, readFileSync, statSync } from "node:fs";
|
|
14
|
+
import { dirname, join, relative, sep } from "node:path";
|
|
15
|
+
import { fileURLToPath } from "node:url";
|
|
16
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
17
|
+
const __dirname = dirname(__filename);
|
|
18
|
+
function readTemplate(relativePath) {
|
|
19
|
+
return readFileSync(join(__dirname, relativePath), "utf-8");
|
|
20
|
+
}
|
|
21
|
+
function listMarkdownFiles(dir) {
|
|
22
|
+
try {
|
|
23
|
+
return readdirSync(join(__dirname, dir))
|
|
24
|
+
.filter((f) => f.endsWith(".md"))
|
|
25
|
+
.sort();
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
// Cached results — files don't change during a CLI run
|
|
32
|
+
let cachedCommands;
|
|
33
|
+
let cachedSkills;
|
|
34
|
+
let cachedBundledSkills;
|
|
35
|
+
/**
|
|
36
|
+
* Get all command templates (stay as slash commands on all platforms).
|
|
37
|
+
* Results are cached after first call.
|
|
38
|
+
*/
|
|
39
|
+
export function getCommandTemplates() {
|
|
40
|
+
cachedCommands ??= listMarkdownFiles("commands").map((file) => ({
|
|
41
|
+
name: file.replace(/\.md$/, ""),
|
|
42
|
+
content: readTemplate(`commands/${file}`),
|
|
43
|
+
}));
|
|
44
|
+
return cachedCommands;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Get all skill templates (become auto-triggered skills on supporting platforms).
|
|
48
|
+
* Results are cached after first call.
|
|
49
|
+
*/
|
|
50
|
+
export function getSkillTemplates() {
|
|
51
|
+
cachedSkills ??= listMarkdownFiles("skills").map((file) => ({
|
|
52
|
+
name: file.replace(/\.md$/, ""),
|
|
53
|
+
content: readTemplate(`skills/${file}`),
|
|
54
|
+
}));
|
|
55
|
+
return cachedSkills;
|
|
56
|
+
}
|
|
57
|
+
function listDirectories(dir) {
|
|
58
|
+
try {
|
|
59
|
+
return readdirSync(join(__dirname, dir))
|
|
60
|
+
.filter((entry) => statSync(join(__dirname, dir, entry)).isDirectory())
|
|
61
|
+
.sort();
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
return [];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function toPosixRelativePath(root, filePath) {
|
|
68
|
+
return relative(root, filePath).split(sep).join("/");
|
|
69
|
+
}
|
|
70
|
+
function listBundledSkillFiles(skillDir) {
|
|
71
|
+
const root = join(__dirname, "bundled-skills", skillDir);
|
|
72
|
+
const files = [];
|
|
73
|
+
function walk(dir) {
|
|
74
|
+
for (const entry of readdirSync(dir)) {
|
|
75
|
+
const fullPath = join(dir, entry);
|
|
76
|
+
const stat = statSync(fullPath);
|
|
77
|
+
if (stat.isDirectory()) {
|
|
78
|
+
walk(fullPath);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
files.push({
|
|
82
|
+
relativePath: toPosixRelativePath(root, fullPath),
|
|
83
|
+
content: readFileSync(fullPath, "utf-8"),
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
walk(root);
|
|
89
|
+
return files.sort((a, b) => a.relativePath.localeCompare(b.relativePath));
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Get all multi-file built-in skills.
|
|
93
|
+
*
|
|
94
|
+
* These are copied as complete skill directories so references and assets stay
|
|
95
|
+
* lazy-loadable instead of being flattened into one oversized SKILL.md.
|
|
96
|
+
*/
|
|
97
|
+
export function getBundledSkillTemplates() {
|
|
98
|
+
cachedBundledSkills ??= listDirectories("bundled-skills").map((name) => ({
|
|
99
|
+
name,
|
|
100
|
+
files: listBundledSkillFiles(name),
|
|
101
|
+
}));
|
|
102
|
+
return cachedBundledSkills;
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/common/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Update Spec
|
|
2
|
+
|
|
3
|
+
Capture durable contracts and conventions into `.trellis/spec/` as short markdown.
|
|
4
|
+
|
|
5
|
+
## When
|
|
6
|
+
|
|
7
|
+
- A debugging, implementation, or discussion produced a boundary that should still hold next session
|
|
8
|
+
- Research in `.trellis/research/<topic>.md` is ready to promote
|
|
9
|
+
|
|
10
|
+
## Write
|
|
11
|
+
|
|
12
|
+
- Short markdown. The 7-section template is optional.
|
|
13
|
+
- Link the new or updated file from the matching `index.md`.
|
|
14
|
+
- Prefer one concrete rule over a catalogue of principles.
|
|
15
|
+
|
|
16
|
+
Spec lives under `.trellis/spec/`. There are no task directories; do not create one.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
type TemplateCategory = "scripts" | "markdown" | "commands";
|
|
2
|
+
/**
|
|
3
|
+
* Get the path to the trellis templates directory (.trellis/ scaffolding).
|
|
4
|
+
*/
|
|
5
|
+
export declare function getTrellisTemplatePath(): string;
|
|
6
|
+
/** @deprecated Use getTrellisTemplatePath() instead. */
|
|
7
|
+
export declare function getTrellisSourcePath(): string;
|
|
8
|
+
/**
|
|
9
|
+
* Get the path to the claude templates directory (hooks, agents, settings).
|
|
10
|
+
*/
|
|
11
|
+
export declare function getClaudeTemplatePath(): string;
|
|
12
|
+
/**
|
|
13
|
+
* Get the path to the opencode templates directory (agents, plugins, lib).
|
|
14
|
+
*/
|
|
15
|
+
export declare function getOpenCodeTemplatePath(): string;
|
|
16
|
+
/**
|
|
17
|
+
* Get the path to the Pi Agent templates directory (agents, extension, settings).
|
|
18
|
+
*/
|
|
19
|
+
export declare function getPiTemplatePath(): string;
|
|
20
|
+
/** @deprecated Use getPiTemplatePath() instead. */
|
|
21
|
+
export declare function getPiSourcePath(): string;
|
|
22
|
+
/**
|
|
23
|
+
* Read a file from the trellis template directory.
|
|
24
|
+
*/
|
|
25
|
+
export declare function readTrellisFile(relativePath: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Read template content from a category directory.
|
|
28
|
+
*/
|
|
29
|
+
export declare function readTemplate(category: TemplateCategory, filename: string): string;
|
|
30
|
+
export declare function readScript(relativePath: string): string;
|
|
31
|
+
export declare function readMarkdown(relativePath: string): string;
|
|
32
|
+
export declare function readCommand(filename: string): string;
|
|
33
|
+
/**
|
|
34
|
+
* Copy a directory from trellis templates to target, making scripts executable.
|
|
35
|
+
*/
|
|
36
|
+
export declare function copyTrellisDir(srcRelativePath: string, destPath: string, options?: {
|
|
37
|
+
executable?: boolean;
|
|
38
|
+
}): Promise<void>;
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=extract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../src/templates/extract.ts"],"names":[],"mappings":"AASA,KAAK,gBAAgB,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAE5D;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAQ/C;AAED,wDAAwD;AACxD,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAQ9C;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,CAQhD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAQ1C;AAED,mDAAmD;AACnD,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAI5D;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,gBAAgB,EAC1B,QAAQ,EAAE,MAAM,GACf,MAAM,CAGR;AAED,wBAAgB,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,wBAAgB,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,GACjC,OAAO,CAAC,IAAI,CAAC,CAIf"}
|