rhachet 1.13.6 → 1.13.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/run +1 -1
- package/dist/contract/cli/invoke.js +0 -2
- package/dist/contract/cli/invoke.js.map +1 -1
- package/dist/domain.operations/invoke/bootRoleResources.js +13 -58
- package/dist/domain.operations/invoke/bootRoleResources.js.map +1 -1
- package/package.json +1 -1
- package/dist/contract/cli/invokeBriefs.d.ts +0 -11
- package/dist/contract/cli/invokeBriefs.js +0 -19
- package/dist/contract/cli/invokeBriefs.js.map +0 -1
- package/dist/contract/cli/invokeBriefsBoot.d.ts +0 -11
- package/dist/contract/cli/invokeBriefsBoot.js +0 -141
- package/dist/contract/cli/invokeBriefsBoot.js.map +0 -1
- package/dist/contract/cli/invokeBriefsLink.d.ts +0 -11
- package/dist/contract/cli/invokeBriefsLink.js +0 -49
- package/dist/contract/cli/invokeBriefsLink.js.map +0 -1
package/bin/run
CHANGED
|
@@ -9,7 +9,6 @@ const getInvokeHooksByOpts_1 = require("../../domain.operations/invoke/getInvoke
|
|
|
9
9
|
const getRegistriesByOpts_1 = require("../../domain.operations/invoke/getRegistriesByOpts");
|
|
10
10
|
const node_path_1 = require("node:path");
|
|
11
11
|
const invokeAsk_1 = require("./invokeAsk");
|
|
12
|
-
const invokeBriefs_1 = require("./invokeBriefs");
|
|
13
12
|
const invokeChoose_1 = require("./invokeChoose");
|
|
14
13
|
const invokeInit_1 = require("./invokeInit");
|
|
15
14
|
const invokeList_1 = require("./invokeList");
|
|
@@ -64,7 +63,6 @@ const invoke = async (input) => {
|
|
|
64
63
|
(0, invokeReadme_1.invokeReadme)({ program, registries });
|
|
65
64
|
(0, invokeList_1.invokeList)({ program, registries });
|
|
66
65
|
(0, invokeRoles_1.invokeRoles)({ program, registries });
|
|
67
|
-
(0, invokeBriefs_1.invokeBriefs)({ program, registries });
|
|
68
66
|
(0, invokeChoose_1.invokeChoose)({ program });
|
|
69
67
|
(0, invokeAsk_1.invokeAsk)({ program, config: { path: configPath }, registries, hooks });
|
|
70
68
|
// invoke it
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoke.js","sourceRoot":"","sources":["../../../src/contract/cli/invoke.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,mDAAiD;AACjD,+DAAsD;AAEtD,uFAAoF;AACpF,6FAA0F;AAC1F,2FAAwF;AAExF,yCAAoC;AACpC,2CAAwC;AACxC,iDAA8C;AAC9C,
|
|
1
|
+
{"version":3,"file":"invoke.js","sourceRoot":"","sources":["../../../src/contract/cli/invoke.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,mDAAiD;AACjD,+DAAsD;AAEtD,uFAAoF;AACpF,6FAA0F;AAC1F,2FAAwF;AAExF,yCAAoC;AACpC,2CAAwC;AACxC,iDAA8C;AAC9C,6CAA0C;AAC1C,6CAA0C;AAC1C,iDAA8C;AAC9C,+CAA4C;AAE5C;;;;;;;;GAQG;AACI,MAAM,MAAM,GAAG,KAAK,EAAE,KAAyB,EAAiB,EAAE;IACvE,8EAA8E;IAC9E,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAChC,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;QAC9B,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACxB,IAAA,uBAAU,EAAC,EAAE,OAAO,EAAE,CAAC,CAAC;QACxB,MAAM,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;QACvD,OAAO;IACT,CAAC;IAED,6BAA6B;IAC7B,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,UAAU,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC;IAC9E,MAAM,kBAAkB,GACtB,SAA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AC,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC;IACpC,IAAA,yBAAW,EAAC,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC;IACrC,IAAA,2BAAY,EAAC,EAAE,OAAO,EAAE,CAAC,CAAC;IAC1B,IAAA,qBAAS,EAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;IAExE,YAAY;IACZ,MAAM,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACrE,IAAI,KAAK,YAAY,gCAAe,EAAE,CAAC;YACrC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAClB,OAAO,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YACpC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAClB,OAAO,CAAC,KAAK,CAAC,UAAU,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;YACtC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAClB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AA7DW,QAAA,MAAM,UA6DjB"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.bootRoleResources = void 0;
|
|
4
|
-
const rhachet_artifact_git_1 = require("rhachet-artifact-git");
|
|
5
4
|
const extractSkillDocumentation_1 = require("../../domain.operations/role/extractSkillDocumentation");
|
|
6
|
-
const node_child_process_1 = require("node:child_process");
|
|
7
5
|
const node_fs_1 = require("node:fs");
|
|
8
6
|
const node_path_1 = require("node:path");
|
|
9
7
|
/**
|
|
@@ -30,7 +28,6 @@ const getAllFilesFromDir = (dir) => {
|
|
|
30
28
|
* .how = reads files from .agent/repo=$repo/role=$role and prints them with formatting
|
|
31
29
|
*/
|
|
32
30
|
const bootRoleResources = async ({ repoSlug, roleSlug, ifPresent, }) => {
|
|
33
|
-
const gitRoot = await (0, rhachet_artifact_git_1.getGitRepoRoot)({ from: process.cwd() });
|
|
34
31
|
const isRepoThis = repoSlug === '.this';
|
|
35
32
|
const roleDir = (0, node_path_1.resolve)(process.cwd(), '.agent', `repo=${repoSlug}`, `role=${roleSlug}`);
|
|
36
33
|
// check if role directory exists
|
|
@@ -87,44 +84,14 @@ const bootRoleResources = async ({ repoSlug, roleSlug, ifPresent, }) => {
|
|
|
87
84
|
: `$${approxCost.toFixed(2).replace(/\.?0+$/, '')}`;
|
|
88
85
|
// print stats helper
|
|
89
86
|
const printStats = () => {
|
|
90
|
-
console.log('
|
|
91
|
-
console.log('
|
|
92
|
-
console.log(
|
|
93
|
-
console.log(
|
|
94
|
-
console.log(
|
|
95
|
-
console.log(
|
|
96
|
-
console.log(
|
|
97
|
-
console.log(
|
|
98
|
-
console.log(` │ ├── briefs = ${briefFiles.length}`);
|
|
99
|
-
console.log(` │ └── skills = ${skillFiles.length}`);
|
|
100
|
-
console.log(` ├── chars = ${totalChars}`);
|
|
101
|
-
console.log(` └── tokens ≈ ${approxTokens} (${costFormatted} at $3/mil)`);
|
|
102
|
-
console.log('');
|
|
103
|
-
console.log(' treestruct');
|
|
104
|
-
const treeOutput = (0, node_child_process_1.execSync)(`tree -l ${roleDir}`, {
|
|
105
|
-
encoding: 'utf-8',
|
|
106
|
-
})
|
|
107
|
-
.split('\n')
|
|
108
|
-
.map((line) => line.replace(/ -> .*$/, ''))
|
|
109
|
-
.map((line) => line.replace(gitRoot, '@gitroot'))
|
|
110
|
-
.filter((line) => !line.match(/^\s*\d+\s+director(y|ies),/))
|
|
111
|
-
.filter((line) => line.trim() !== '')
|
|
112
|
-
.map((line) => ` ${line}`)
|
|
113
|
-
.join('\n');
|
|
114
|
-
console.log(treeOutput);
|
|
115
|
-
console.log('');
|
|
116
|
-
console.log(' quant');
|
|
117
|
-
console.log(` ├── files = ${relevantFiles.length}`);
|
|
118
|
-
console.log(` │ ├── briefs = ${briefFiles.length}`);
|
|
119
|
-
console.log(` │ └── skills = ${skillFiles.length}`);
|
|
120
|
-
console.log(` ├── chars = ${totalChars}`);
|
|
121
|
-
console.log(` └── tokens ≈ ${approxTokens} (${costFormatted} at $3/mil)`);
|
|
122
|
-
console.log('');
|
|
123
|
-
console.log('#####################################################');
|
|
124
|
-
console.log('## ended:stats');
|
|
125
|
-
console.log('#####################################################');
|
|
126
|
-
console.log('#####################################################');
|
|
127
|
-
console.log('#####################################################');
|
|
87
|
+
console.log('<stats>');
|
|
88
|
+
console.log('quant');
|
|
89
|
+
console.log(` ├── files = ${relevantFiles.length}`);
|
|
90
|
+
console.log(` │ ├── briefs = ${briefFiles.length}`);
|
|
91
|
+
console.log(` │ └── skills = ${skillFiles.length}`);
|
|
92
|
+
console.log(` ├── chars = ${totalChars}`);
|
|
93
|
+
console.log(` └── tokens ≈ ${approxTokens} (${costFormatted} at $3/mil)`);
|
|
94
|
+
console.log('</stats>');
|
|
128
95
|
console.log('');
|
|
129
96
|
};
|
|
130
97
|
// print stats header
|
|
@@ -133,26 +100,14 @@ const bootRoleResources = async ({ repoSlug, roleSlug, ifPresent, }) => {
|
|
|
133
100
|
for (const filepath of relevantFiles) {
|
|
134
101
|
const relativePath = `.agent/repo=${repoSlug}/role=${roleSlug}/${(0, node_path_1.relative)(roleDir, filepath)}`;
|
|
135
102
|
const isSkill = filepath.startsWith(skillsDir);
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
console.log(
|
|
139
|
-
console.log(`## began:${relativePath}`);
|
|
140
|
-
console.log('#####################################################');
|
|
141
|
-
console.log('');
|
|
103
|
+
const isReadme = filepath === readmePath;
|
|
104
|
+
const tagName = isSkill ? 'skill' : isReadme ? 'readme' : 'brief';
|
|
105
|
+
console.log(`<${tagName} path="${relativePath}">`);
|
|
142
106
|
const content = isSkill
|
|
143
107
|
? (0, extractSkillDocumentation_1.extractSkillDocumentation)(filepath)
|
|
144
108
|
: (0, node_fs_1.readFileSync)(filepath, 'utf-8');
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
.map((line) => ` ${line}`)
|
|
148
|
-
.join('\n');
|
|
149
|
-
console.log(indentedContent);
|
|
150
|
-
console.log('');
|
|
151
|
-
console.log('#####################################################');
|
|
152
|
-
console.log(`## ended:${relativePath}`);
|
|
153
|
-
console.log('#####################################################');
|
|
154
|
-
console.log('#####################################################');
|
|
155
|
-
console.log('#####################################################');
|
|
109
|
+
console.log(content);
|
|
110
|
+
console.log(`</${tagName}>`);
|
|
156
111
|
console.log('');
|
|
157
112
|
}
|
|
158
113
|
// print stats footer
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootRoleResources.js","sourceRoot":"","sources":["../../../src/domain.operations/invoke/bootRoleResources.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"bootRoleResources.js","sourceRoot":"","sources":["../../../src/domain.operations/invoke/bootRoleResources.ts"],"names":[],"mappings":";;;AAAA,qGAAkG;AAElG,qCAA0E;AAC1E,yCAA8C;AAE9C;;GAEG;AACH,MAAM,kBAAkB,GAAG,CAAC,GAAW,EAAY,EAAE;IACnD,MAAM,OAAO,GAAG,IAAA,qBAAW,EAAC,GAAG,CAAC,CAAC;IACjC,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAAM,QAAQ,GAAG,IAAA,mBAAO,EAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACrC,MAAM,KAAK,GAAG,IAAA,kBAAQ,EAAC,QAAQ,CAAC,CAAC;QAEjC,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CA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,CAAC,EAAE,CAAC;QAC/F,MAAM,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;QAC/C,MAAM,QAAQ,GAAG,QAAQ,KAAK,UAAU,CAAC;QACzC,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;QAElE,OAAO,CAAC,GAAG,CAAC,IAAI,OAAO,UAAU,YAAY,IAAI,CAAC,CAAC;QAEnD,MAAM,OAAO,GAAG,OAAO;YACrB,CAAC,CAAC,IAAA,qDAAyB,EAAC,QAAQ,CAAC;YACrC,CAAC,CAAC,IAAA,sBAAY,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAEpC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACrB,OAAO,CAAC,GAAG,CAAC,KAAK,OAAO,GAAG,CAAC,CAAC;QAC7B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC;IAED,qBAAqB;IACrB,UAAU,EAAE,CAAC;AACf,CAAC,CAAC;AAhHW,QAAA,iBAAiB,qBAgH5B"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "rhachet",
|
|
3
3
|
"author": "ehmpathy",
|
|
4
4
|
"description": "A framework for reliable, thorough thought. Weave threads of thought via stitches.",
|
|
5
|
-
"version": "1.13.
|
|
5
|
+
"version": "1.13.7",
|
|
6
6
|
"repository": "ehmpathy/rhachet",
|
|
7
7
|
"homepage": "https://github.com/ehmpathy/rhachet",
|
|
8
8
|
"keywords": [
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Command } from 'commander';
|
|
2
|
-
import type { RoleRegistry } from '../../contract/sdk';
|
|
3
|
-
/**
|
|
4
|
-
* .what = adds the "briefs" command to the CLI with subcommands
|
|
5
|
-
* .why = manages role briefs (link from node_modules, boot/print context)
|
|
6
|
-
* .how = registers "link" and "boot" subcommands under "briefs"
|
|
7
|
-
*/
|
|
8
|
-
export declare const invokeBriefs: ({ program, registries, }: {
|
|
9
|
-
program: Command;
|
|
10
|
-
registries: RoleRegistry[];
|
|
11
|
-
}) => void;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.invokeBriefs = void 0;
|
|
4
|
-
const invokeBriefsBoot_1 = require("./invokeBriefsBoot");
|
|
5
|
-
const invokeBriefsLink_1 = require("./invokeBriefsLink");
|
|
6
|
-
/**
|
|
7
|
-
* .what = adds the "briefs" command to the CLI with subcommands
|
|
8
|
-
* .why = manages role briefs (link from node_modules, boot/print context)
|
|
9
|
-
* .how = registers "link" and "boot" subcommands under "briefs"
|
|
10
|
-
*/
|
|
11
|
-
const invokeBriefs = ({ program, registries, }) => {
|
|
12
|
-
const briefsCommand = program
|
|
13
|
-
.command('briefs')
|
|
14
|
-
.description('manage role briefs (link, boot)');
|
|
15
|
-
(0, invokeBriefsLink_1.invokeBriefsLink)({ command: briefsCommand, registries });
|
|
16
|
-
(0, invokeBriefsBoot_1.invokeBriefsBoot)({ command: briefsCommand, registries });
|
|
17
|
-
};
|
|
18
|
-
exports.invokeBriefs = invokeBriefs;
|
|
19
|
-
//# sourceMappingURL=invokeBriefs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"invokeBriefs.js","sourceRoot":"","sources":["../../../src/contract/cli/invokeBriefs.ts"],"names":[],"mappings":";;;AAIA,yDAAsD;AACtD,yDAAsD;AAEtD;;;;GAIG;AACI,MAAM,YAAY,GAAG,CAAC,EAC3B,OAAO,EACP,UAAU,GAIX,EAAQ,EAAE;IACT,MAAM,aAAa,GAAG,OAAO;SAC1B,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,iCAAiC,CAAC,CAAC;IAElD,IAAA,mCAAgB,EAAC,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC,CAAC;IACzD,IAAA,mCAAgB,EAAC,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC,CAAC;AAC3D,CAAC,CAAC;AAbW,QAAA,YAAY,gBAavB"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Command } from 'commander';
|
|
2
|
-
import type { RoleRegistry } from '../../domain.objects/RoleRegistry';
|
|
3
|
-
/**
|
|
4
|
-
* .what = adds the "briefs boot" subcommand to the CLI
|
|
5
|
-
* .why = outputs all brief files with stats for context loading
|
|
6
|
-
* .how = reads all files in .agent/repo=$repo/role=$role/briefs and prints them with formatting
|
|
7
|
-
*/
|
|
8
|
-
export declare const invokeBriefsBoot: ({ command, registries, }: {
|
|
9
|
-
command: Command;
|
|
10
|
-
registries: RoleRegistry[];
|
|
11
|
-
}) => void;
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.invokeBriefsBoot = void 0;
|
|
4
|
-
const helpful_errors_1 = require("helpful-errors");
|
|
5
|
-
const rhachet_artifact_git_1 = require("rhachet-artifact-git");
|
|
6
|
-
const inferRepoByRole_1 = require("../../domain.operations/invoke/inferRepoByRole");
|
|
7
|
-
const node_child_process_1 = require("node:child_process");
|
|
8
|
-
const node_fs_1 = require("node:fs");
|
|
9
|
-
const node_path_1 = require("node:path");
|
|
10
|
-
/**
|
|
11
|
-
* .what = adds the "briefs boot" subcommand to the CLI
|
|
12
|
-
* .why = outputs all brief files with stats for context loading
|
|
13
|
-
* .how = reads all files in .agent/repo=$repo/role=$role/briefs and prints them with formatting
|
|
14
|
-
*/
|
|
15
|
-
const invokeBriefsBoot = ({ command, registries, }) => {
|
|
16
|
-
command
|
|
17
|
-
.command('boot')
|
|
18
|
-
.description('boot context from role briefs (print all brief files)')
|
|
19
|
-
.option('--repo <slug>', 'the repository slug for the role')
|
|
20
|
-
.option('--role <slug>', 'the role to boot briefs for')
|
|
21
|
-
.action(async (opts) => {
|
|
22
|
-
if (!opts.role)
|
|
23
|
-
helpful_errors_1.BadRequestError.throw('--role is required (e.g., --role mechanic)');
|
|
24
|
-
const roleSlug = opts.role;
|
|
25
|
-
const repo = opts.repo
|
|
26
|
-
? registries.find((r) => r.slug === opts.repo)
|
|
27
|
-
: (0, inferRepoByRole_1.inferRepoByRole)({ registries, roleSlug });
|
|
28
|
-
if (!repo)
|
|
29
|
-
helpful_errors_1.BadRequestError.throw(`No repo found with slug "${opts.repo}"`);
|
|
30
|
-
const briefsDir = (0, node_path_1.resolve)(process.cwd(), '.agent', `repo=${repo.slug}`, `role=${roleSlug}`, 'briefs');
|
|
31
|
-
const gitRoot = await (0, rhachet_artifact_git_1.getGitRepoRoot)({ from: briefsDir });
|
|
32
|
-
// Check if briefs directory exists
|
|
33
|
-
if (!(0, node_fs_1.existsSync)(briefsDir)) {
|
|
34
|
-
helpful_errors_1.BadRequestError.throw(`Briefs directory not found: ${briefsDir}\nRun "rhachet briefs link --repo ${repo.slug} --role ${roleSlug}" first`);
|
|
35
|
-
}
|
|
36
|
-
// Recursively read all files, including those in symlinked directories
|
|
37
|
-
const getAllFiles = (dir) => {
|
|
38
|
-
const entries = (0, node_fs_1.readdirSync)(dir);
|
|
39
|
-
const files = [];
|
|
40
|
-
for (const entry of entries) {
|
|
41
|
-
const fullPath = (0, node_path_1.resolve)(dir, entry);
|
|
42
|
-
const stats = (0, node_fs_1.statSync)(fullPath); // statSync follows symlinks
|
|
43
|
-
if (stats.isDirectory()) {
|
|
44
|
-
// Recursively traverse directories (including symlinked ones)
|
|
45
|
-
files.push(...getAllFiles(fullPath));
|
|
46
|
-
}
|
|
47
|
-
else if (stats.isFile()) {
|
|
48
|
-
files.push(fullPath);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return files;
|
|
52
|
-
};
|
|
53
|
-
const files = getAllFiles(briefsDir).sort();
|
|
54
|
-
if (files.length === 0) {
|
|
55
|
-
console.log(``);
|
|
56
|
-
console.log(`⚠️ No briefs found in ${briefsDir}`);
|
|
57
|
-
console.log(``);
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
// Count total characters and approximate tokens
|
|
61
|
-
let totalChars = 0;
|
|
62
|
-
for (const filepath of files) {
|
|
63
|
-
const content = (0, node_fs_1.readFileSync)(filepath, 'utf-8');
|
|
64
|
-
totalChars += content.length;
|
|
65
|
-
}
|
|
66
|
-
const approxTokens = Math.ceil(totalChars / 4);
|
|
67
|
-
const costPerMillionTokens = 3; // $3 per million tokens
|
|
68
|
-
const approxCost = (approxTokens / 1000000) * costPerMillionTokens;
|
|
69
|
-
const costFormatted = approxCost < 0.01
|
|
70
|
-
? `< $0.01`
|
|
71
|
-
: `$${approxCost.toFixed(2).replace(/\.?0+$/, '')}`;
|
|
72
|
-
// Print stats helper
|
|
73
|
-
const printStats = () => {
|
|
74
|
-
console.log('#####################################################');
|
|
75
|
-
console.log('#####################################################');
|
|
76
|
-
console.log('#####################################################');
|
|
77
|
-
console.log('## began:stats');
|
|
78
|
-
console.log('#####################################################');
|
|
79
|
-
console.log('');
|
|
80
|
-
console.log(' quant');
|
|
81
|
-
console.log(` ├── files = ${files.length}`);
|
|
82
|
-
console.log(` ├── chars = ${totalChars}`);
|
|
83
|
-
console.log(` └── tokens ≈ ${approxTokens} (${costFormatted} at $3/mil)`);
|
|
84
|
-
console.log('');
|
|
85
|
-
console.log(' treestruct');
|
|
86
|
-
const treeOutput = (0, node_child_process_1.execSync)(`tree -l ${briefsDir}`, {
|
|
87
|
-
encoding: 'utf-8',
|
|
88
|
-
})
|
|
89
|
-
.split('\n')
|
|
90
|
-
.map((line) => line.replace(/ -> .*$/, ''))
|
|
91
|
-
.map((line) => line.replace(gitRoot, '@gitroot'))
|
|
92
|
-
.filter((line) => !line.match(/^\s*\d+\s+director(y|ies),/))
|
|
93
|
-
.filter((line) => line.trim() !== '')
|
|
94
|
-
.map((line) => ` ${line}`)
|
|
95
|
-
.join('\n');
|
|
96
|
-
console.log(treeOutput);
|
|
97
|
-
console.log('');
|
|
98
|
-
console.log(' quant');
|
|
99
|
-
console.log(` ├── files = ${files.length}`);
|
|
100
|
-
console.log(` ├── chars = ${totalChars}`);
|
|
101
|
-
console.log(` └── tokens ≈ ${approxTokens} (${costFormatted} at $3/mil)`);
|
|
102
|
-
console.log('');
|
|
103
|
-
console.log('#####################################################');
|
|
104
|
-
console.log('## ended:stats');
|
|
105
|
-
console.log('#####################################################');
|
|
106
|
-
console.log('#####################################################');
|
|
107
|
-
console.log('#####################################################');
|
|
108
|
-
console.log('');
|
|
109
|
-
};
|
|
110
|
-
// Print stats header
|
|
111
|
-
printStats();
|
|
112
|
-
// Print each file
|
|
113
|
-
for (const filepath of files) {
|
|
114
|
-
const content = (0, node_fs_1.readFileSync)(filepath, 'utf-8');
|
|
115
|
-
const relativePath = `.agent/repo=${repo.slug}/role=${roleSlug}/briefs/${(0, node_path_1.relative)(briefsDir, filepath)}`;
|
|
116
|
-
console.log('#####################################################');
|
|
117
|
-
console.log('#####################################################');
|
|
118
|
-
console.log('#####################################################');
|
|
119
|
-
console.log(`## began:${relativePath}`);
|
|
120
|
-
console.log('#####################################################');
|
|
121
|
-
console.log('');
|
|
122
|
-
// Print content with indentation
|
|
123
|
-
const indentedContent = content
|
|
124
|
-
.split('\n')
|
|
125
|
-
.map((line) => ` ${line}`)
|
|
126
|
-
.join('\n');
|
|
127
|
-
console.log(indentedContent);
|
|
128
|
-
console.log('');
|
|
129
|
-
console.log('#####################################################');
|
|
130
|
-
console.log(`## ended:${relativePath}`);
|
|
131
|
-
console.log('#####################################################');
|
|
132
|
-
console.log('#####################################################');
|
|
133
|
-
console.log('#####################################################');
|
|
134
|
-
console.log('');
|
|
135
|
-
}
|
|
136
|
-
// Print stats footer
|
|
137
|
-
printStats();
|
|
138
|
-
});
|
|
139
|
-
};
|
|
140
|
-
exports.invokeBriefsBoot = invokeBriefsB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GAAG,CAAC,YAAY,YAAY,EAAE,CAAC,CAAC;YACxC,OAAO,CAAC,GAAG,CAAC,uDAAuD,CAAC,CAAC;YACrE,OAAO,CAAC,GAAG,CAAC,uDAAuD,CAAC,CAAC;YACrE,OAAO,CAAC,GAAG,CAAC,uDAAuD,CAAC,CAAC;YACrE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAClB,CAAC;QAED,qBAAqB;QACrB,UAAU,EAAE,CAAC;IACf,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAlKW,QAAA,gBAAgB,oBAkK3B"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Command } from 'commander';
|
|
2
|
-
import type { RoleRegistry } from '../../contract/sdk';
|
|
3
|
-
/**
|
|
4
|
-
* .what = adds the "briefs link" subcommand to the CLI
|
|
5
|
-
* .why = creates symlinks to role briefs from node_modules for easy access
|
|
6
|
-
* .how = creates .agent/repo=$repo/role=$role/briefs directory and symlinks brief files
|
|
7
|
-
*/
|
|
8
|
-
export declare const invokeBriefsLink: ({ command, registries, }: {
|
|
9
|
-
command: Command;
|
|
10
|
-
registries: RoleRegistry[];
|
|
11
|
-
}) => void;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.invokeBriefsLink = void 0;
|
|
4
|
-
const helpful_errors_1 = require("helpful-errors");
|
|
5
|
-
const assureFindRole_1 = require("../../domain.operations/invoke/assureFindRole");
|
|
6
|
-
const inferRepoByRole_1 = require("../../domain.operations/invoke/inferRepoByRole");
|
|
7
|
-
const symlinkResourceDirectories_1 = require("../../domain.operations/invoke/link/symlinkResourceDirectories");
|
|
8
|
-
const node_path_1 = require("node:path");
|
|
9
|
-
/**
|
|
10
|
-
* .what = adds the "briefs link" subcommand to the CLI
|
|
11
|
-
* .why = creates symlinks to role briefs from node_modules for easy access
|
|
12
|
-
* .how = creates .agent/repo=$repo/role=$role/briefs directory and symlinks brief files
|
|
13
|
-
*/
|
|
14
|
-
const invokeBriefsLink = ({ command, registries, }) => {
|
|
15
|
-
command
|
|
16
|
-
.command('link')
|
|
17
|
-
.description('create symlinks to role briefs in .agent/ structure')
|
|
18
|
-
.option('--repo <slug>', 'the repository slug for the role')
|
|
19
|
-
.option('--role <slug>', 'the role to link briefs for')
|
|
20
|
-
.action((opts) => {
|
|
21
|
-
if (!opts.role)
|
|
22
|
-
helpful_errors_1.BadRequestError.throw('--role is required (e.g., --role mechanic)');
|
|
23
|
-
// Find the role from registries
|
|
24
|
-
const role = (0, assureFindRole_1.assureFindRole)({ registries, slug: opts.role });
|
|
25
|
-
const repo = opts.repo
|
|
26
|
-
? registries.find((r) => r.slug === opts.repo)
|
|
27
|
-
: (0, inferRepoByRole_1.inferRepoByRole)({ registries, roleSlug: opts.role });
|
|
28
|
-
if (!repo)
|
|
29
|
-
helpful_errors_1.BadRequestError.throw(`No repo found with slug "${opts.repo}"`);
|
|
30
|
-
// Check if role has briefs configured
|
|
31
|
-
if (role.briefs.dirs.length === 0) {
|
|
32
|
-
helpful_errors_1.BadRequestError.throw(`Role "${role.slug}" does not have briefs configured`);
|
|
33
|
-
}
|
|
34
|
-
console.log(``);
|
|
35
|
-
console.log(`📎 Linking briefs for role "${role.slug}" from repo "${repo.slug}"...`);
|
|
36
|
-
// Create .agent/repo=$repo/role=$role/briefs directory and link briefs
|
|
37
|
-
const briefsDir = (0, node_path_1.resolve)(process.cwd(), '.agent', `repo=${repo.slug}`, `role=${role.slug}`, 'briefs');
|
|
38
|
-
const totalFiles = (0, symlinkResourceDirectories_1.symlinkResourceDirectories)({
|
|
39
|
-
sourceDirs: role.briefs.dirs,
|
|
40
|
-
targetDir: briefsDir,
|
|
41
|
-
resourceName: 'briefs',
|
|
42
|
-
});
|
|
43
|
-
console.log(``);
|
|
44
|
-
console.log(`🔗 Linked ${totalFiles} brief(s) to ${briefsDir}`);
|
|
45
|
-
console.log(``);
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
exports.invokeBriefsLink = invokeBriefsLink;
|
|
49
|
-
//# sourceMappingURL=invokeBriefsLink.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"invokeBriefsLink.js","sourceRoot":"","sources":["../../../src/contract/cli/invokeBriefsLink.ts"],"names":[],"mappings":";;;AACA,mDAAiD;AAGjD,iFAA8E;AAC9E,mFAAgF;AAChF,8GAA2G;AAE3G,yCAAoC;AAEpC;;;;GAIG;AACI,MAAM,gBAAgB,GAAG,CAAC,EAC/B,OAAO,EACP,UAAU,GAIX,EAAQ,EAAE;IACT,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,qDAAqD,CAAC;SAClE,MAAM,CAAC,eAAe,EAAE,kCAAkC,CAAC;SAC3D,MAAM,CAAC,eAAe,EAAE,6BAA6B,CAAC;SACtD,MAAM,CAAC,CAAC,IAAsC,EAAE,EAAE;QACjD,IAAI,CAAC,IAAI,CAAC,IAAI;YACZ,gCAAe,CAAC,KAAK,CAAC,4CAA4C,CAAC,CAAC;QAEtE,gCAAgC;QAChC,MAAM,IAAI,GAAG,IAAA,+BAAc,EAAC,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QAC7D,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI;YACpB,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC;YAC9C,CAAC,CAAC,IAAA,iCAAe,EAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QACzD,IAAI,CAAC,IAAI;YACP,gCAAe,CAAC,KAAK,CAAC,4BAA4B,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;QAElE,sCAAsC;QACtC,IAAI,IAAI,CAAC,MAAM,CAAC,IAA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