rhachet 1.10.1 → 1.12.1
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/.test/example.use.repo/example.echoRegistry.js +5 -2
- package/dist/.test/example.use.repo/example.echoRegistry.js.map +1 -1
- package/dist/contract/cli/invoke.js +11 -0
- package/dist/contract/cli/invoke.js.map +1 -1
- package/dist/contract/cli/invokeAsk.js +4 -2
- package/dist/contract/cli/invokeAsk.js.map +1 -1
- package/dist/contract/cli/invokeBriefsBoot.d.ts +1 -1
- package/dist/contract/cli/invokeBriefsBoot.integration.test.js +46 -36
- package/dist/contract/cli/invokeBriefsBoot.integration.test.js.map +1 -1
- package/dist/contract/cli/invokeBriefsBoot.js +9 -5
- package/dist/contract/cli/invokeBriefsBoot.js.map +1 -1
- package/dist/contract/cli/invokeBriefsLink.d.ts +1 -1
- package/dist/contract/cli/invokeBriefsLink.integration.test.js +33 -18
- package/dist/contract/cli/invokeBriefsLink.integration.test.js.map +1 -1
- package/dist/contract/cli/invokeBriefsLink.js +17 -49
- package/dist/contract/cli/invokeBriefsLink.js.map +1 -1
- package/dist/contract/cli/invokeInit.d.ts +9 -0
- package/dist/contract/cli/invokeInit.integration.test.d.ts +1 -0
- package/dist/contract/cli/invokeInit.integration.test.js +123 -0
- package/dist/contract/cli/invokeInit.integration.test.js.map +1 -0
- package/dist/contract/cli/invokeInit.js +57 -0
- package/dist/contract/cli/invokeInit.js.map +1 -0
- package/dist/contract/cli/invokeList.js +1 -1
- package/dist/contract/cli/invokeList.js.map +1 -1
- package/dist/contract/cli/invokeReadme.integration.test.js +1 -1
- package/dist/contract/cli/invokeReadme.integration.test.js.map +1 -1
- package/dist/contract/cli/invokeReadme.js +2 -2
- package/dist/contract/cli/invokeReadme.js.map +1 -1
- package/dist/contract/cli/invokeRoles.d.ts +11 -0
- package/dist/contract/cli/invokeRoles.js +19 -0
- package/dist/contract/cli/invokeRoles.js.map +1 -0
- package/dist/contract/cli/invokeRolesBoot.d.ts +9 -0
- package/dist/contract/cli/invokeRolesBoot.integration.test.d.ts +1 -0
- package/dist/contract/cli/invokeRolesBoot.integration.test.js +152 -0
- package/dist/contract/cli/invokeRolesBoot.integration.test.js.map +1 -0
- package/dist/contract/cli/invokeRolesBoot.js +205 -0
- package/dist/contract/cli/invokeRolesBoot.js.map +1 -0
- package/dist/contract/cli/invokeRolesLink.d.ts +11 -0
- package/dist/contract/cli/invokeRolesLink.integration.test.d.ts +1 -0
- package/dist/contract/cli/invokeRolesLink.integration.test.js +117 -0
- package/dist/contract/cli/invokeRolesLink.integration.test.js.map +1 -0
- package/dist/contract/cli/invokeRolesLink.js +78 -0
- package/dist/contract/cli/invokeRolesLink.js.map +1 -0
- package/dist/domain/objects/Role.d.ts +13 -3
- package/dist/domain/objects/Role.js.map +1 -1
- package/dist/logic/init/discoverRolePackages.d.ts +8 -0
- package/dist/logic/init/discoverRolePackages.js +20 -0
- package/dist/logic/init/discoverRolePackages.js.map +1 -0
- package/dist/logic/init/generateRhachetConfig.d.ts +8 -0
- package/dist/logic/init/generateRhachetConfig.js +40 -0
- package/dist/logic/init/generateRhachetConfig.js.map +1 -0
- package/dist/logic/init/generateRhachetConfig.test.d.ts +1 -0
- package/dist/logic/init/generateRhachetConfig.test.js +35 -0
- package/dist/logic/init/generateRhachetConfig.test.js.map +1 -0
- package/dist/logic/invoke/getAgentReadmeTemplates.d.ts +6 -0
- package/dist/logic/invoke/getAgentReadmeTemplates.js +42 -0
- package/dist/logic/invoke/getAgentReadmeTemplates.js.map +1 -0
- package/dist/logic/invoke/getInvokeHooksByOpts.d.ts +2 -1
- package/dist/logic/invoke/getInvokeHooksByOpts.js +11 -3
- package/dist/logic/invoke/getInvokeHooksByOpts.js.map +1 -1
- package/dist/logic/invoke/link/findsertFile.d.ts +9 -0
- package/dist/logic/invoke/link/findsertFile.js +29 -0
- package/dist/logic/invoke/link/findsertFile.js.map +1 -0
- package/dist/logic/invoke/link/symlinkResourceDirectories.d.ts +12 -0
- package/dist/logic/invoke/link/symlinkResourceDirectories.js +81 -0
- package/dist/logic/invoke/link/symlinkResourceDirectories.js.map +1 -0
- package/dist/logic/invoke/performInCurrentThread.js +1 -1
- package/dist/logic/invoke/performInCurrentThread.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const generateRhachetConfig_1 = require("./generateRhachetConfig");
|
|
4
|
+
describe('generateRhachetConfig', () => {
|
|
5
|
+
it('should generate config for single package with aliased imports', () => {
|
|
6
|
+
const result = (0, generateRhachetConfig_1.generateRhachetConfig)({
|
|
7
|
+
packages: ['rhachet-roles-ehmpathy'],
|
|
8
|
+
});
|
|
9
|
+
// Verify aliased imports for single package
|
|
10
|
+
expect(result).toContain("import { getRoleRegistry as getRoleRegistryEhmpathy, getInvokeHooks as getInvokeHooksEhmpathy } from 'rhachet-roles-ehmpathy'");
|
|
11
|
+
// Snapshot for observability
|
|
12
|
+
expect(result).toMatchSnapshot();
|
|
13
|
+
});
|
|
14
|
+
it('should generate config for multiple packages', () => {
|
|
15
|
+
const result = (0, generateRhachetConfig_1.generateRhachetConfig)({
|
|
16
|
+
packages: ['rhachet-roles-ehmpathy', 'rhachet-roles-other'],
|
|
17
|
+
});
|
|
18
|
+
// Verify multiple packages are included
|
|
19
|
+
expect(result).toContain('getRoleRegistryEhmpathy(), getRoleRegistryOther()');
|
|
20
|
+
expect(result).toContain('getInvokeHooksEhmpathy(), getInvokeHooksOther()');
|
|
21
|
+
// Snapshot for observability
|
|
22
|
+
expect(result).toMatchSnapshot();
|
|
23
|
+
});
|
|
24
|
+
it('should convert kebab-case to PascalCase for aliases', () => {
|
|
25
|
+
const result = (0, generateRhachetConfig_1.generateRhachetConfig)({
|
|
26
|
+
packages: ['rhachet-roles-my-custom-roles'],
|
|
27
|
+
});
|
|
28
|
+
// Verify key elements
|
|
29
|
+
expect(result).toContain('getRoleRegistryMyCustomRoles');
|
|
30
|
+
expect(result).toContain('getInvokeHooksMyCustomRoles');
|
|
31
|
+
// Snapshot for observability
|
|
32
|
+
expect(result).toMatchSnapshot();
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=generateRhachetConfig.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateRhachetConfig.test.js","sourceRoot":"","sources":["../../../src/logic/init/generateRhachetConfig.test.ts"],"names":[],"mappings":";;AAAA,mEAAgE;AAEhE,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,EAAE,CAAC,gEAAgE,EAAE,GAAG,EAAE;QACxE,MAAM,MAAM,GAAG,IAAA,6CAAqB,EAAC;YACnC,QAAQ,EAAE,CAAC,wBAAwB,CAAC;SACrC,CAAC,CAAC;QAEH,4CAA4C;QAC5C,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CACtB,+HAA+H,CAChI,CAAC;QAEF,6BAA6B;QAC7B,MAAM,CAAC,MAAM,CAAC,CAAC,eAAe,EAAE,CAAC;IACnC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;QACtD,MAAM,MAAM,GAAG,IAAA,6CAAqB,EAAC;YACnC,QAAQ,EAAE,CAAC,wBAAwB,EAAE,qBAAqB,CAAC;SAC5D,CAAC,CAAC;QAEH,wCAAwC;QACxC,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CACtB,mDAAmD,CACpD,CAAC;QACF,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,iDAAiD,CAAC,CAAC;QAE5E,6BAA6B;QAC7B,MAAM,CAAC,MAAM,CAAC,CAAC,eAAe,EAAE,CAAC;IACnC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qDAAqD,EAAE,GAAG,EAAE;QAC7D,MAAM,MAAM,GAAG,IAAA,6CAAqB,EAAC;YACnC,QAAQ,EAAE,CAAC,+BAA+B,CAAC;SAC5C,CAAC,CAAC;QAEH,sBAAsB;QACtB,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,8BAA8B,CAAC,CAAC;QACzD,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,6BAA6B,CAAC,CAAC;QAExD,6BAA6B;QAC7B,MAAM,CAAC,MAAM,CAAC,CAAC,eAAe,EAAE,CAAC;IACnC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* .what = provides template content for .agent/ directory readme files
|
|
3
|
+
* .why = standardizes the documentation structure for agent roles
|
|
4
|
+
*/
|
|
5
|
+
export declare const getAgentRootReadmeTemplate: () => string;
|
|
6
|
+
export declare const getAgentRepoThisReadmeTemplate: () => string;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* .what = provides template content for .agent/ directory readme files
|
|
4
|
+
* .why = standardizes the documentation structure for agent roles
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.getAgentRepoThisReadmeTemplate = exports.getAgentRootReadmeTemplate = void 0;
|
|
8
|
+
const getAgentRootReadmeTemplate = () => {
|
|
9
|
+
return `this dir hosts the .skills and .briefs useful to any agent, human or robot, when at work in this repo
|
|
10
|
+
|
|
11
|
+
repo=.this specifies the docs that are scoped to this specific @gitroot repo
|
|
12
|
+
|
|
13
|
+
repo=$repo specifies the docs that are scoped to any rhachet repo
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
glossary
|
|
18
|
+
|
|
19
|
+
agents = actors w/ delegated authority
|
|
20
|
+
actors = roles w/ repl
|
|
21
|
+
roles = coherent collections of skills and briefs
|
|
22
|
+
skills = mechanisms that can be executed to produce curated effects
|
|
23
|
+
briefs = resources that externalize knowledge of curated concepts
|
|
24
|
+
brain = a human or robot imagination machine
|
|
25
|
+
- e.g., robot:llama:openai.o4
|
|
26
|
+
- e.g., robot:agent:claude.sonnet.v4_5
|
|
27
|
+
- e.g., human:agent:you
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
written by rhachet 🦾
|
|
32
|
+
`;
|
|
33
|
+
};
|
|
34
|
+
exports.getAgentRootReadmeTemplate = getAgentRootReadmeTemplate;
|
|
35
|
+
const getAgentRepoThisReadmeTemplate = () => {
|
|
36
|
+
return `this directory contains the .skills and .briefs scoped to this specific @gitroot repository
|
|
37
|
+
|
|
38
|
+
these are resources that are specific to the current project and may not be reusable across other repositories
|
|
39
|
+
`;
|
|
40
|
+
};
|
|
41
|
+
exports.getAgentRepoThisReadmeTemplate = getAgentRepoThisReadmeTemplate;
|
|
42
|
+
//# sourceMappingURL=getAgentReadmeTemplates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAgentReadmeTemplates.js","sourceRoot":"","sources":["../../../src/logic/invoke/getAgentReadmeTemplates.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEI,MAAM,0BAA0B,GAAG,GAAW,EAAE;IACrD,OAAO;;;;;;;;;;;;;;;;;;;;;;;CAuBR,CAAC;AACF,CAAC,CAAC;AAzBW,QAAA,0BAA0B,8BAyBrC;AAEK,MAAM,8BAA8B,GAAG,GAAW,EAAE;IACzD,OAAO;;;CAGR,CAAC;AACF,CAAC,CAAC;AALW,QAAA,8BAA8B,kCAKzC"}
|
|
@@ -4,7 +4,8 @@ import { InvokeOpts } from '../../domain/objects/InvokeOpts';
|
|
|
4
4
|
* .what = get invoke hooks from the invocation options declared
|
|
5
5
|
* .how =
|
|
6
6
|
* - lookup the config based on the options
|
|
7
|
-
* - grab the hooks from the config
|
|
7
|
+
* - grab the hooks from the config (supports array of InvokeHooks)
|
|
8
|
+
* - merge hooks from all sources
|
|
8
9
|
*/
|
|
9
10
|
export declare const getInvokeHooksByOpts: (input: {
|
|
10
11
|
opts: InvokeOpts<{
|
|
@@ -28,13 +28,21 @@ exports.getInvokeHooksByOpts = void 0;
|
|
|
28
28
|
* .what = get invoke hooks from the invocation options declared
|
|
29
29
|
* .how =
|
|
30
30
|
* - lookup the config based on the options
|
|
31
|
-
* - grab the hooks from the config
|
|
31
|
+
* - grab the hooks from the config (supports array of InvokeHooks)
|
|
32
|
+
* - merge hooks from all sources
|
|
32
33
|
*/
|
|
33
34
|
const getInvokeHooksByOpts = async (input) => {
|
|
34
35
|
// import the config
|
|
35
36
|
const config = await Promise.resolve(`${input.opts.config}`).then(s => __importStar(require(s)));
|
|
36
|
-
// grab the
|
|
37
|
-
|
|
37
|
+
// grab the hooks (may be single or array)
|
|
38
|
+
const hooksResult = await config.getInvokeHooks?.();
|
|
39
|
+
if (!hooksResult)
|
|
40
|
+
return null;
|
|
41
|
+
// normalize to array and merge
|
|
42
|
+
const hooksList = Array.isArray(hooksResult) ? hooksResult : [hooksResult];
|
|
43
|
+
return {
|
|
44
|
+
onInvokeAskInput: hooksList.flatMap((h) => h?.onInvokeAskInput ?? []),
|
|
45
|
+
};
|
|
38
46
|
};
|
|
39
47
|
exports.getInvokeHooksByOpts = getInvokeHooksByOpts;
|
|
40
48
|
//# sourceMappingURL=getInvokeHooksByOpts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getInvokeHooksByOpts.js","sourceRoot":"","sources":["../../../src/logic/invoke/getInvokeHooksByOpts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAGA
|
|
1
|
+
{"version":3,"file":"getInvokeHooksByOpts.js","sourceRoot":"","sources":["../../../src/logic/invoke/getInvokeHooksByOpts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;;;;;GAMG;AACI,MAAM,oBAAoB,GAAG,KAAK,EAAE,KAE1C,EAA+B,EAAE;IAChC,oBAAoB;IACpB,MAAM,MAAM,GAKR,yBAAa,KAAK,CAAC,IAAI,CAAC,MAAM,uCAAC,CAAC;IAEpC,0CAA0C;IAC1C,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,cAAc,EAAE,EAAE,CAAC;IACpD,IAAI,CAAC,WAAW;QAAE,OAAO,IAAI,CAAC;IAE9B,+BAA+B;IAC/B,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;IAC3E,OAAO;QACL,gBAAgB,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,gBAAgB,IAAI,EAAE,CAAC;KACtE,CAAC;AACJ,CAAC,CAAC;AApBW,QAAA,oBAAoB,wBAoB/B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* .what = finds or inserts a file with template content
|
|
3
|
+
* .why = ensures standard readme files exist without overwriting custom changes
|
|
4
|
+
* .how = only writes if file doesn't exist or content matches template exactly
|
|
5
|
+
*/
|
|
6
|
+
export declare const findsertFile: (options: {
|
|
7
|
+
path: string;
|
|
8
|
+
template: string;
|
|
9
|
+
}) => void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.findsertFile = void 0;
|
|
4
|
+
const node_fs_1 = require("node:fs");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
/**
|
|
7
|
+
* .what = finds or inserts a file with template content
|
|
8
|
+
* .why = ensures standard readme files exist without overwriting custom changes
|
|
9
|
+
* .how = only writes if file doesn't exist or content matches template exactly
|
|
10
|
+
*/
|
|
11
|
+
const findsertFile = (options) => {
|
|
12
|
+
const { path, template } = options;
|
|
13
|
+
const relativePath = (0, node_path_1.relative)(process.cwd(), path);
|
|
14
|
+
if (!(0, node_fs_1.existsSync)(path)) {
|
|
15
|
+
console.log(` + ${relativePath} (created)`);
|
|
16
|
+
(0, node_fs_1.writeFileSync)(path, template, 'utf8');
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
// File exists - check if it matches template
|
|
20
|
+
const existingContent = (0, node_fs_1.readFileSync)(path, 'utf8');
|
|
21
|
+
if (existingContent === template) {
|
|
22
|
+
console.log(` ✓ ${relativePath} (unchanged)`);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
console.log(` ↻ ${relativePath} (preserved with custom changes)`);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
exports.findsertFile = findsertFile;
|
|
29
|
+
//# sourceMappingURL=findsertFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findsertFile.js","sourceRoot":"","sources":["../../../../src/logic/invoke/link/findsertFile.ts"],"names":[],"mappings":";;;AAAA,qCAAkE;AAClE,yCAAqC;AAErC;;;;GAIG;AACI,MAAM,YAAY,GAAG,CAAC,OAG5B,EAAQ,EAAE;IACT,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IACnC,MAAM,YAAY,GAAG,IAAA,oBAAQ,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,CAAC;IAEnD,IAAI,CAAC,IAAA,oBAAU,EAAC,IAAI,CAAC,EAAE,CAAC;QACtB,OAAO,CAAC,GAAG,CAAC,OAAO,YAAY,YAAY,CAAC,CAAC;QAC7C,IAAA,uBAAa,EAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QACtC,OAAO;IACT,CAAC;IAED,6CAA6C;IAC7C,MAAM,eAAe,GAAG,IAAA,sBAAY,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACnD,IAAI,eAAe,KAAK,QAAQ,EAAE,CAAC;QACjC,OAAO,CAAC,GAAG,CAAC,OAAO,YAAY,cAAc,CAAC,CAAC;IACjD,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,OAAO,YAAY,kCAAkC,CAAC,CAAC;IACrE,CAAC;AACH,CAAC,CAAC;AApBW,QAAA,YAAY,gBAoBvB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* .what = creates symlinks for resource directories to a target directory
|
|
3
|
+
* .why = enables role resources (briefs, skills, etc.) to be linked from node_modules or other sources
|
|
4
|
+
* .how = creates symlinks for entire directories, returns count of leaf files
|
|
5
|
+
*/
|
|
6
|
+
export declare const symlinkResourceDirectories: (options: {
|
|
7
|
+
sourceDirs: Array<{
|
|
8
|
+
uri: string;
|
|
9
|
+
}>;
|
|
10
|
+
targetDir: string;
|
|
11
|
+
resourceName: string;
|
|
12
|
+
}) => number;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.symlinkResourceDirectories = void 0;
|
|
4
|
+
const node_fs_1 = require("node:fs");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
/**
|
|
7
|
+
* .what = recursively counts all leaf files in a directory
|
|
8
|
+
* .why = to provide accurate file counts when linking directories
|
|
9
|
+
*/
|
|
10
|
+
const countFilesInDirectory = (dirPath) => {
|
|
11
|
+
let count = 0;
|
|
12
|
+
const entries = (0, node_fs_1.readdirSync)(dirPath);
|
|
13
|
+
for (const entry of entries) {
|
|
14
|
+
const fullPath = (0, node_path_1.resolve)(dirPath, entry);
|
|
15
|
+
const stats = (0, node_fs_1.statSync)(fullPath);
|
|
16
|
+
if (stats.isDirectory()) {
|
|
17
|
+
count += countFilesInDirectory(fullPath);
|
|
18
|
+
}
|
|
19
|
+
else if (stats.isFile()) {
|
|
20
|
+
count++;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return count;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* .what = creates symlinks for resource directories to a target directory
|
|
27
|
+
* .why = enables role resources (briefs, skills, etc.) to be linked from node_modules or other sources
|
|
28
|
+
* .how = creates symlinks for entire directories, returns count of leaf files
|
|
29
|
+
*/
|
|
30
|
+
const symlinkResourceDirectories = (options) => {
|
|
31
|
+
const { sourceDirs, targetDir, resourceName } = options;
|
|
32
|
+
if (sourceDirs.length === 0) {
|
|
33
|
+
return 0;
|
|
34
|
+
}
|
|
35
|
+
let totalFileCount = 0;
|
|
36
|
+
for (const sourceDir of sourceDirs) {
|
|
37
|
+
const sourcePath = (0, node_path_1.resolve)(process.cwd(), sourceDir.uri);
|
|
38
|
+
if (!(0, node_fs_1.existsSync)(sourcePath)) {
|
|
39
|
+
continue; // Skip if source doesn't exist
|
|
40
|
+
}
|
|
41
|
+
// Create target directory parent if needed
|
|
42
|
+
(0, node_fs_1.mkdirSync)(targetDir, { recursive: true });
|
|
43
|
+
// Create a unique target path for this source directory
|
|
44
|
+
// Use the basename of the source directory to avoid conflicts
|
|
45
|
+
const targetPath = (0, node_path_1.resolve)(targetDir, (0, node_path_1.basename)(sourcePath));
|
|
46
|
+
// Remove existing symlink/file if it exists
|
|
47
|
+
const relativeTargetPath = (0, node_path_1.relative)(process.cwd(), targetPath);
|
|
48
|
+
if ((0, node_fs_1.existsSync)(targetPath)) {
|
|
49
|
+
try {
|
|
50
|
+
(0, node_fs_1.unlinkSync)(targetPath);
|
|
51
|
+
console.log(` ↻ ${relativeTargetPath} (updated)`);
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
(0, node_fs_1.rmSync)(targetPath, { recursive: true, force: true });
|
|
55
|
+
console.log(` ↻ ${relativeTargetPath} (updated)`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
console.log(` + ${relativeTargetPath}`);
|
|
60
|
+
}
|
|
61
|
+
// Create relative symlink from target directory to source directory
|
|
62
|
+
const relativeSource = (0, node_path_1.relative)(targetDir, sourcePath);
|
|
63
|
+
try {
|
|
64
|
+
(0, node_fs_1.symlinkSync)(relativeSource, targetPath, 'dir');
|
|
65
|
+
// Count the files in the source directory
|
|
66
|
+
const fileCount = countFilesInDirectory(sourcePath);
|
|
67
|
+
totalFileCount += fileCount;
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
if (error.code === 'EEXIST') {
|
|
71
|
+
console.log(` ⚠️ ${relativeTargetPath} already exists (skipped)`);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
throw error;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return totalFileCount;
|
|
79
|
+
};
|
|
80
|
+
exports.symlinkResourceDirectories = symlinkResourceDirectories;
|
|
81
|
+
//# sourceMappingURL=symlinkResourceDirectories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symlinkResourceDirectories.js","sourceRoot":"","sources":["../../../../src/logic/invoke/link/symlinkResourceDirectories.ts"],"names":[],"mappings":";;;AAAA,qCAQiB;AACjB,yCAAwD;AAExD;;;GAGG;AACH,MAAM,qBAAqB,GAAG,CAAC,OAAe,EAAU,EAAE;IACxD,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,MAAM,OAAO,GAAG,IAAA,qBAAW,EAAC,OAAO,CAAC,CAAC;IAErC,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAAM,QAAQ,GAAG,IAAA,mBAAO,EAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACzC,MAAM,KAAK,GAAG,IAAA,kBAAQ,EAAC,QAAQ,CAAC,CAAC;QAEjC,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,KAAK,IAAI,qBAAqB,CAAC,QAAQ,CAAC,CAAC;QAC3C,CAAC;aAAM,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;YAC1B,KAAK,EAAE,CAAC;QACV,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF;;;;GAIG;AACI,MAAM,0BAA0B,GAAG,CAAC,OAI1C,EAAU,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,CAAC,OAAO,kBAAkB,EAAE,CAAC,CAAC;QAC3C,CAAC;QAED,oEAAoE;QACpE,MAAM,cAAc,GAAG,IAAA,oBAAQ,EAAC,SAAS,EAAE,UAAU,CAAC,CAAC;QAEvD,IAAI,CAAC;YACH,IAAA,qBAAW,EAAC,cAAc,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;YAC/C,0CAA0C;YAC1C,MAAM,SAAS,GAAG,qBAAqB,CAAC,UAAU,CAAC,CAAC;YACpD,cAAc,IAAI,SAAS,CAAC;QAC9B,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC5B,OAAO,CAAC,GAAG,CAAC,SAAS,kBAAkB,2BAA2B,CAAC,CAAC;YACtE,CAAC;iBAAM,CAAC;gBACN,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,cAAc,CAAC;AACxB,CAAC,CAAC;AA3DW,QAAA,0BAA0B,8BA2DrC"}
|
|
@@ -24,7 +24,7 @@ const performInCurrentThread = async (input) => {
|
|
|
24
24
|
if (!role)
|
|
25
25
|
helpful_errors_1.BadRequestError.throw(`unknown role "${input.opts.role}"`);
|
|
26
26
|
// lookup the skill
|
|
27
|
-
const skill = role.skills.find((s) => s.slug === input.opts.skill);
|
|
27
|
+
const skill = role.skills.refs.find((s) => s.slug === input.opts.skill);
|
|
28
28
|
if (!skill)
|
|
29
29
|
helpful_errors_1.BadRequestError.throw(`unknown skill "${input.opts.skill}" under role "${input.opts.role}"`);
|
|
30
30
|
// instantiate the threads
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"performInCurrentThread.js","sourceRoot":"","sources":["../../../src/logic/invoke/performInCurrentThread.ts"],"names":[],"mappings":";;;AAAA,mDAA0E;AAI1E,oEAAiE;AACjE,qDAAkD;AAClD,uDAAoD;AACpD,uDAAoD;AAEpD;;;;;GAKG;AACI,MAAM,sBAAsB,GAAG,KAAK,EAAE,KAO5C,EAAiB,EAAE;IAClB,kBAAkB;IAClB,MAAM,IAAI,GAAG,IAAA,+BAAc,EAAC;QAC1B,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,IAAI,EACF,KAAK,CAAC,IAAI,CAAC,IAAI;YACf,wCAAuB,CAAC,KAAK,CAAC,sCAAsC,EAAE;gBACpE,IAAI,EAAE,KAAK,CAAC,IAAI;aACjB,CAAC;KACL,CAAC,CAAC;IACH,IAAI,CAAC,IAAI;QAAE,gCAAe,CAAC,KAAK,CAAC,iBAAiB,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;IAEtE,mBAAmB;IACnB,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"performInCurrentThread.js","sourceRoot":"","sources":["../../../src/logic/invoke/performInCurrentThread.ts"],"names":[],"mappings":";;;AAAA,mDAA0E;AAI1E,oEAAiE;AACjE,qDAAkD;AAClD,uDAAoD;AACpD,uDAAoD;AAEpD;;;;;GAKG;AACI,MAAM,sBAAsB,GAAG,KAAK,EAAE,KAO5C,EAAiB,EAAE;IAClB,kBAAkB;IAClB,MAAM,IAAI,GAAG,IAAA,+BAAc,EAAC;QAC1B,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,IAAI,EACF,KAAK,CAAC,IAAI,CAAC,IAAI;YACf,wCAAuB,CAAC,KAAK,CAAC,sCAAsC,EAAE;gBACpE,IAAI,EAAE,KAAK,CAAC,IAAI;aACjB,CAAC;KACL,CAAC,CAAC;IACH,IAAI,CAAC,IAAI;QAAE,gCAAe,CAAC,KAAK,CAAC,iBAAiB,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;IAEtE,mBAAmB;IACnB,MAAM,KAAK,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ACrB,OAAO;KACR,EACD,OAAO,CACR,CAAC;AACJ,CAAC,CAAC;AAvDW,QAAA,sBAAsB,0BAuDjC"}
|
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.
|
|
5
|
+
"version": "1.12.1",
|
|
6
6
|
"repository": "ehmpathy/rhachet",
|
|
7
7
|
"homepage": "https://github.com/ehmpathy/rhachet",
|
|
8
8
|
"keywords": [
|