rhachet 1.1.0 → 1.3.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/bin/run +4 -0
- package/dist/.test/directory.js.map +1 -0
- package/dist/.test/genContextLogTrail.js.map +1 -0
- package/dist/.test/genContextStitchTrail.js.map +1 -0
- package/dist/.test/getContextOpenAI.js.map +1 -0
- package/dist/.test/stitchers/genStitcherCodeFileRead.js.map +1 -0
- package/dist/.test/stitchers/genStitcherCodeFileWrite.js.map +1 -0
- package/dist/.test/stitchers/genStitcherCodeReviewImagine.js.map +1 -0
- package/dist/.test/stitchers/stitcherCodeDiffImagine.js.map +1 -0
- package/dist/.test/stitchers/stitcherFanoutRandomSum.js.map +1 -0
- package/dist/.test/stitchers/stitcherFanoutSubroutes.js.map +1 -0
- package/dist/{__test_assets__ → .test}/threads/codeArtist.js +1 -1
- package/dist/.test/threads/codeArtist.js.map +1 -0
- package/dist/{__test_assets__ → .test}/threads/codeCritic.js +1 -1
- package/dist/.test/threads/codeCritic.js.map +1 -0
- package/dist/.test/threads/director.js.map +1 -0
- package/dist/_topublish/file-fns/src/getFile.js.map +1 -0
- package/dist/contract/cli/.test/example.echoRegistry.d.ts +2 -0
- package/dist/contract/cli/.test/example.echoRegistry.js +54 -0
- package/dist/contract/cli/.test/example.echoRegistry.js.map +1 -0
- package/dist/contract/cli/invoke.d.ts +12 -0
- package/dist/contract/cli/invoke.integration.test.d.ts +1 -0
- package/dist/contract/cli/invoke.integration.test.js +38 -0
- package/dist/contract/cli/invoke.integration.test.js.map +1 -0
- package/dist/contract/cli/invoke.js +88 -0
- package/dist/contract/cli/invoke.js.map +1 -0
- package/dist/contract/cli/invokeAsk.d.ts +10 -0
- package/dist/contract/cli/invokeAsk.integration.test.d.ts +1 -0
- package/dist/contract/cli/invokeAsk.integration.test.js +41 -0
- package/dist/contract/cli/invokeAsk.integration.test.js.map +1 -0
- package/dist/contract/cli/invokeAsk.js +78 -0
- package/dist/contract/cli/invokeAsk.js.map +1 -0
- package/dist/contract/cli/invokeList.d.ts +10 -0
- package/dist/contract/cli/invokeList.js +48 -0
- package/dist/contract/cli/invokeList.js.map +1 -0
- package/dist/contract/cli/invokeReadme.d.ts +15 -0
- package/dist/contract/cli/invokeReadme.integration.test.d.ts +1 -0
- package/dist/contract/cli/invokeReadme.integration.test.js +62 -0
- package/dist/contract/cli/invokeReadme.integration.test.js.map +1 -0
- package/dist/contract/cli/invokeReadme.js +72 -0
- package/dist/contract/cli/invokeReadme.js.map +1 -0
- package/dist/domain/objects/Role.d.ts +47 -0
- package/dist/domain/objects/Role.js +9 -0
- package/dist/domain/objects/Role.js.map +1 -0
- package/dist/domain/objects/RoleContext.d.ts +46 -0
- package/dist/domain/objects/RoleContext.js +3 -0
- package/dist/domain/objects/RoleContext.js.map +1 -0
- package/dist/domain/objects/RoleRegistry.d.ts +31 -0
- package/dist/domain/objects/RoleRegistry.js +13 -0
- package/dist/domain/objects/RoleRegistry.js.map +1 -0
- package/dist/domain/objects/RoleSkill.d.ts +38 -0
- package/dist/domain/objects/RoleSkill.js +9 -0
- package/dist/domain/objects/RoleSkill.js.map +1 -0
- package/dist/domain/objects/RoleSkillArgGetter.d.ts +137 -0
- package/dist/domain/objects/RoleSkillArgGetter.js +11 -0
- package/dist/domain/objects/RoleSkillArgGetter.js.map +1 -0
- package/dist/domain/objects/RoleTrait.d.ts +34 -0
- package/dist/domain/objects/RoleTrait.js +9 -0
- package/dist/domain/objects/RoleTrait.js.map +1 -0
- package/dist/domain/objects/StitchStep.d.ts +1 -1
- package/dist/domain/objects/StitchStep.js.map +1 -1
- package/dist/domain/objects/Template.d.ts +21 -0
- package/dist/domain/objects/Template.js +8 -0
- package/dist/domain/objects/Template.js.map +1 -0
- package/dist/domain/objects/Template.test.d.ts +1 -0
- package/dist/domain/objects/Template.test.js +48 -0
- package/dist/domain/objects/Template.test.js.map +1 -0
- package/dist/domain/objects/index.d.ts +7 -0
- package/dist/domain/objects/index.js +7 -0
- package/dist/domain/objects/index.js.map +1 -1
- package/dist/logic/invoke/assureFindRole.d.ts +10 -0
- package/dist/logic/invoke/assureFindRole.js +22 -0
- package/dist/logic/invoke/assureFindRole.js.map +1 -0
- package/dist/logic/invoke/assureUniqueRoles.d.ts +5 -0
- package/dist/logic/invoke/assureUniqueRoles.js +19 -0
- package/dist/logic/invoke/assureUniqueRoles.js.map +1 -0
- package/dist/logic/invoke/getSkillContext.d.ts +17 -0
- package/dist/logic/invoke/getSkillContext.js +44 -0
- package/dist/logic/invoke/getSkillContext.js.map +1 -0
- package/dist/logic/invoke/getSkillContext.test.d.ts +1 -0
- package/dist/logic/invoke/getSkillContext.test.js +85 -0
- package/dist/logic/invoke/getSkillContext.test.js.map +1 -0
- package/dist/logic/invoke/getSkillThread.test.d.ts +1 -0
- package/dist/logic/invoke/getSkillThread.test.js +115 -0
- package/dist/logic/invoke/getSkillThread.test.js.map +1 -0
- package/dist/logic/invoke/getSkillThreads.d.ts +16 -0
- package/dist/logic/invoke/getSkillThreads.js +46 -0
- package/dist/logic/invoke/getSkillThreads.js.map +1 -0
- package/dist/logic/role/addRoleTraits.d.ts +18 -0
- package/dist/logic/role/addRoleTraits.js +33 -0
- package/dist/logic/role/addRoleTraits.js.map +1 -0
- package/dist/logic/role/addRoleTraits.test.d.ts +1 -0
- package/dist/logic/role/addRoleTraits.test.js +93 -0
- package/dist/logic/role/addRoleTraits.test.js.map +1 -0
- package/dist/logic/role/enrollThread.d.ts +16 -0
- package/dist/logic/role/enrollThread.integration.test.d.ts +1 -0
- package/dist/logic/role/enrollThread.integration.test.js +79 -0
- package/dist/logic/role/enrollThread.integration.test.js.map +1 -0
- package/dist/logic/role/enrollThread.js +36 -0
- package/dist/logic/role/enrollThread.js.map +1 -0
- package/dist/logic/stitch/adapters/imagineViaOpenAI.js.map +1 -1
- package/dist/logic/stitch/enstitch.test.js +2 -2
- package/dist/logic/stitch/enstitch.test.js.map +1 -1
- package/dist/logic/stitch/invokeImagineStitcher.integration.test.js +5 -3
- package/dist/logic/stitch/invokeImagineStitcher.integration.test.js.map +1 -1
- package/dist/logic/stitch/invokeImagineStitcher.js +1 -1
- package/dist/logic/stitch/invokeImagineStitcher.js.map +1 -1
- package/dist/logic/template/genStepImagineViaTemplate.d.ts +22 -0
- package/dist/logic/template/genStepImagineViaTemplate.js +22 -0
- package/dist/logic/template/genStepImagineViaTemplate.js.map +1 -0
- package/dist/logic/template/genStepImagineViaTemplate.test.d.ts +1 -0
- package/dist/logic/template/genStepImagineViaTemplate.test.js +126 -0
- package/dist/logic/template/genStepImagineViaTemplate.test.js.map +1 -0
- package/dist/logic/template/genTemplate.d.ts +16 -0
- package/dist/logic/template/genTemplate.js +21 -0
- package/dist/logic/template/genTemplate.js.map +1 -0
- package/dist/logic/template/genTemplate.test.d.ts +1 -0
- package/dist/logic/template/genTemplate.test.js +118 -0
- package/dist/logic/template/genTemplate.test.js.map +1 -0
- package/dist/logic/template/getTemplateValFromArtifacts.d.ts +9 -0
- package/dist/logic/template/getTemplateValFromArtifacts.js +27 -0
- package/dist/logic/template/getTemplateValFromArtifacts.js.map +1 -0
- package/dist/logic/template/getTemplateVarsFromInheritance.d.ts +22 -0
- package/dist/logic/template/getTemplateVarsFromInheritance.js +15 -0
- package/dist/logic/template/getTemplateVarsFromInheritance.js.map +1 -0
- package/dist/logic/template/useTemplate.d.ts +10 -0
- package/dist/logic/template/useTemplate.integration.test.d.ts +1 -0
- package/dist/logic/template/useTemplate.integration.test.js +28 -0
- package/dist/logic/template/useTemplate.integration.test.js.map +1 -0
- package/dist/logic/template/useTemplate.js +26 -0
- package/dist/logic/template/useTemplate.js.map +1 -0
- package/dist/logic/thread/getStitch.d.ts +11 -0
- package/dist/logic/thread/getStitch.js +18 -0
- package/dist/logic/thread/getStitch.js.map +1 -0
- package/dist/logic/thread/getStitch.test.d.ts +1 -0
- package/dist/logic/thread/getStitch.test.js +73 -0
- package/dist/logic/thread/getStitch.test.js.map +1 -0
- package/dist/logic/weave/compose/GStitcherInferredFromChoice.generic.test.js +2 -2
- package/dist/logic/weave/compose/GStitcherInferredFromChoice.generic.test.js.map +1 -1
- package/dist/logic/weave/compose/GStitcherInferredFromCycle.generic.test.js +2 -2
- package/dist/logic/weave/compose/GStitcherInferredFromCycle.generic.test.js.map +1 -1
- package/dist/logic/weave/compose/GStitcherInferredFromFanout.generic.test.js +2 -2
- package/dist/logic/weave/compose/GStitcherInferredFromFanout.generic.test.js.map +1 -1
- package/dist/logic/weave/compose/GStitcherInferredFromRoute.generic.test.js +2 -2
- package/dist/logic/weave/compose/GStitcherInferredFromRoute.generic.test.js.map +1 -1
- package/dist/logic/weave/compose/genStitchCycle.test.js +117 -2
- package/dist/logic/weave/compose/genStitchCycle.test.js.map +1 -1
- package/dist/logic/weave/compose/genStitchFanout.test.js +2 -2
- package/dist/logic/weave/compose/genStitchFanout.test.js.map +1 -1
- package/dist/logic/weave/enweaveOneChoice.test.js +2 -2
- package/dist/logic/weave/enweaveOneChoice.test.js.map +1 -1
- package/dist/logic/weave/enweaveOneCycle.test.js +2 -2
- package/dist/logic/weave/enweaveOneCycle.test.js.map +1 -1
- package/dist/logic/weave/enweaveOneFanout.integration.test.js +6 -6
- package/dist/logic/weave/enweaveOneFanout.integration.test.js.map +1 -1
- package/dist/logic/weave/enweaveOneRoute.integration.test.js +6 -6
- package/dist/logic/weave/enweaveOneRoute.integration.test.js.map +1 -1
- package/dist/logic/weave/enweaveOneStitcher.integration.test.js +10 -10
- package/dist/logic/weave/enweaveOneStitcher.integration.test.js.map +1 -1
- package/package.json +14 -4
- package/readme.md +32 -33
- package/dist/__nonpublished_modules__/file-fns/src/getFile.js.map +0 -1
- package/dist/__test_assets__/directory.js.map +0 -1
- package/dist/__test_assets__/genContextLogTrail.js.map +0 -1
- package/dist/__test_assets__/genContextStitchTrail.js.map +0 -1
- package/dist/__test_assets__/getContextOpenAI.js.map +0 -1
- package/dist/__test_assets__/stitchers/genStitcherCodeFileRead.js.map +0 -1
- package/dist/__test_assets__/stitchers/genStitcherCodeFileWrite.js.map +0 -1
- package/dist/__test_assets__/stitchers/genStitcherCodeReviewImagine.js.map +0 -1
- package/dist/__test_assets__/stitchers/stitcherCodeDiffImagine.js.map +0 -1
- package/dist/__test_assets__/stitchers/stitcherFanoutRandomSum.js.map +0 -1
- package/dist/__test_assets__/stitchers/stitcherFanoutSubroutes.js.map +0 -1
- package/dist/__test_assets__/threads/codeArtist.js.map +0 -1
- package/dist/__test_assets__/threads/codeCritic.js.map +0 -1
- package/dist/__test_assets__/threads/director.js.map +0 -1
- package/dist/logic/thread/enroleThread.d.ts +0 -4
- package/dist/logic/thread/enroleThread.js +0 -6
- package/dist/logic/thread/enroleThread.js.map +0 -1
- /package/dist/{__test_assets__ → .test}/directory.d.ts +0 -0
- /package/dist/{__test_assets__ → .test}/directory.js +0 -0
- /package/dist/{__test_assets__ → .test}/genContextLogTrail.d.ts +0 -0
- /package/dist/{__test_assets__ → .test}/genContextLogTrail.js +0 -0
- /package/dist/{__test_assets__ → .test}/genContextStitchTrail.d.ts +0 -0
- /package/dist/{__test_assets__ → .test}/genContextStitchTrail.js +0 -0
- /package/dist/{__test_assets__ → .test}/getContextOpenAI.d.ts +0 -0
- /package/dist/{__test_assets__ → .test}/getContextOpenAI.js +0 -0
- /package/dist/{__test_assets__ → .test}/stitchers/genStitcherCodeFileRead.d.ts +0 -0
- /package/dist/{__test_assets__ → .test}/stitchers/genStitcherCodeFileRead.js +0 -0
- /package/dist/{__test_assets__ → .test}/stitchers/genStitcherCodeFileWrite.d.ts +0 -0
- /package/dist/{__test_assets__ → .test}/stitchers/genStitcherCodeFileWrite.js +0 -0
- /package/dist/{__test_assets__ → .test}/stitchers/genStitcherCodeReviewImagine.d.ts +0 -0
- /package/dist/{__test_assets__ → .test}/stitchers/genStitcherCodeReviewImagine.js +0 -0
- /package/dist/{__test_assets__ → .test}/stitchers/stitcherCodeDiffImagine.d.ts +0 -0
- /package/dist/{__test_assets__ → .test}/stitchers/stitcherCodeDiffImagine.js +0 -0
- /package/dist/{__test_assets__ → .test}/stitchers/stitcherFanoutRandomSum.d.ts +0 -0
- /package/dist/{__test_assets__ → .test}/stitchers/stitcherFanoutRandomSum.js +0 -0
- /package/dist/{__test_assets__ → .test}/stitchers/stitcherFanoutSubroutes.d.ts +0 -0
- /package/dist/{__test_assets__ → .test}/stitchers/stitcherFanoutSubroutes.js +0 -0
- /package/dist/{__test_assets__ → .test}/threads/codeArtist.d.ts +0 -0
- /package/dist/{__test_assets__ → .test}/threads/codeCritic.d.ts +0 -0
- /package/dist/{__test_assets__ → .test}/threads/director.d.ts +0 -0
- /package/dist/{__test_assets__ → .test}/threads/director.js +0 -0
- /package/dist/{__nonpublished_modules__ → _topublish}/file-fns/src/getFile.d.ts +0 -0
- /package/dist/{__nonpublished_modules__ → _topublish}/file-fns/src/getFile.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invokeReadme.integration.test.js","sourceRoot":"","sources":["../../../src/contract/cli/invokeReadme.integration.test.ts"],"names":[],"mappings":";;AAAA,yCAAoC;AACpC,uCAAuD;AAEvD,uEAAgE;AAChE,iDAA8C;AAE9C,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IAC1C,IAAA,gBAAK,EACH,mEAAmE,EACnE,GAAG,EAAE;QACH,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;QAC9B,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,kBAAkB,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QACvE,UAAU,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;QACrC,IAAA,2BAAY,EAAC,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,uCAAgB,CAAC,EAAE,CAAC,CAAC;QAE1D,IAAA,eAAI,EAAC,8BAA8B,EAAE,GAAG,EAAE;YACxC,IAAA,eAAI,EAAC,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AC;QACL,CAAC,CAAC,CAAC;QAEH,IAAA,eAAI,EAAC,kCAAkC,EAAE,GAAG,EAAE;YAC5C,IAAA,eAAI,EAAC,0CAA0C,EAAE,KAAK,IAAI,EAAE;gBAC1D,MAAM,KAAK,GAAG,MAAM,IAAA,mBAAQ,EAAC,GAAG,EAAE,CAChC,OAAO,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE,YAAY,EAAE,SAAS,CAAC,EAAE;oBACtD,IAAI,EAAE,MAAM;iBACb,CAAC,CACH,CAAC;gBAEF,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,mCAAmC,CAAC,CAAC;YACxE,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CACF,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.indentLines = exports.invokeReadme = void 0;
|
|
4
|
+
const helpful_errors_1 = require("helpful-errors");
|
|
5
|
+
const assureFindRole_1 = require("../../logic/invoke/assureFindRole");
|
|
6
|
+
/**
|
|
7
|
+
* .what = main entrypoint for `readme` CLI command
|
|
8
|
+
* .why = allows devs to introspect registry, role, or skill documentation from the CLI
|
|
9
|
+
*/
|
|
10
|
+
const invokeReadme = ({ program, registries, }) => {
|
|
11
|
+
program
|
|
12
|
+
.command('readme')
|
|
13
|
+
.description('print documentation for the registry, a role, or a skill')
|
|
14
|
+
.option('--registry <slug>', 'which registry to inspect')
|
|
15
|
+
.option('--role <slug>', 'which role to inspect')
|
|
16
|
+
.option('--skill <slug>', 'which skill to inspect')
|
|
17
|
+
.action((opts) => {
|
|
18
|
+
// no inputs provided
|
|
19
|
+
if (!opts.registry && !opts.role)
|
|
20
|
+
helpful_errors_1.BadRequestError.throw('must provide --registry or --role');
|
|
21
|
+
// resolve registry
|
|
22
|
+
const registry = opts.registry
|
|
23
|
+
? registries.find((r) => r.slug === opts.registry)
|
|
24
|
+
: null;
|
|
25
|
+
if (!opts.role) {
|
|
26
|
+
if (!registry)
|
|
27
|
+
helpful_errors_1.BadRequestError.throw(`no registry matches given options`);
|
|
28
|
+
// registry level readme
|
|
29
|
+
return printReadme(`${registry.slug}`, registry.readme);
|
|
30
|
+
}
|
|
31
|
+
// resolve role
|
|
32
|
+
const role = (0, assureFindRole_1.assureFindRole)({ registries, slug: opts.role });
|
|
33
|
+
if (!role)
|
|
34
|
+
helpful_errors_1.BadRequestError.throw(`no role named "${opts.role}" in configured registries`, {
|
|
35
|
+
registries: registries.map((thisRegistry) => thisRegistry.slug),
|
|
36
|
+
});
|
|
37
|
+
// role-level readme
|
|
38
|
+
if (!opts.skill)
|
|
39
|
+
return printReadme(`${role.slug}`, role.readme);
|
|
40
|
+
// resolve skill
|
|
41
|
+
const skill = role.skills.find((s) => s.slug === opts.skill);
|
|
42
|
+
if (!skill)
|
|
43
|
+
helpful_errors_1.BadRequestError.throw(`no skill "${opts.skill}" in role "${opts.role}"`, { skills: role.skills.map((thisSkill) => thisSkill.slug) });
|
|
44
|
+
// skill-level readme
|
|
45
|
+
return printReadme(`${role.slug}.${skill.slug}`, skill.readme);
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
exports.invokeReadme = invokeReadme;
|
|
49
|
+
/**
|
|
50
|
+
* .what = logs a formatted markdown readme block with label
|
|
51
|
+
* .why = standardizes output for registry/role/skill readmes in CLI
|
|
52
|
+
*/
|
|
53
|
+
const printReadme = (slug, markdown) => {
|
|
54
|
+
console.log('');
|
|
55
|
+
console.log(`📜 ${slug}.readme`);
|
|
56
|
+
console.log('');
|
|
57
|
+
console.log((0, exports.indentLines)(markdown));
|
|
58
|
+
console.log('');
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* .what = indents each line of a string by a fixed number of spaces
|
|
62
|
+
* .why = ensures markdown blocks are consistently readable in nested output
|
|
63
|
+
*/
|
|
64
|
+
const indentLines = (text, spaces = 4) => {
|
|
65
|
+
const prefix = ' '.repeat(spaces);
|
|
66
|
+
return text
|
|
67
|
+
.split('\n')
|
|
68
|
+
.map((line) => `${prefix}${line}`)
|
|
69
|
+
.join('\n');
|
|
70
|
+
};
|
|
71
|
+
exports.indentLines = indentLines;
|
|
72
|
+
//# sourceMappingURL=invokeReadme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invokeReadme.js","sourceRoot":"","sources":["../../../src/contract/cli/invokeReadme.ts"],"names":[],"mappings":";;;AACA,mDAAiD;AAEjD,sEAAmE;AAGnE;;;GAGG;AACI,MAAM,YAAY,GAAG,CAAC,EAC3B,OAAO,EACP,UAAU,GAIX,EAAQ,EAAE;IACT,OAAO;SACJ,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,0DAA0D,CAAC;SACvE,MAAM,CAAC,mBAAmB,EAAE,2BAA2B,CAAC;SACxD,MAAM,CAAC,eAAe,EAAE,uBAAuB,CAAC;SAChD,MAAM,CAAC,gBAAgB,EAAE,wBAAwB,CAAC;SAClD,MAAM,CAAC,CAAC,IAA0D,EAAE,EAAE;QACrE,qBAAqB;QACrB,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,IAAI;YAC9B,gCAAe,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;QAE7D,mBAAmB;QACnB,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ;YAC5B,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,QAAQ,CAAC;YAClD,CAAC,CAAC,IAAI,CAAC;QACT,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACf,IAAI,CAAC,QAAQ;gBACX,gCAAe,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;YAE7D,wBAAwB;YACxB,OAAO,WAAW,CAAC,GAAG,Q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O,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,MAAM,IAAI,SAAS,CAAC,CAAC;IACjC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,IAAA,mBAAW,EAAC,QAAQ,CAAC,CAAC,CAAC;IACnC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAClB,CAAC,CAAC;AAEF;;;GAGG;AACI,MAAM,WAAW,GAAG,CAAC,IAAY,EAAE,MAAM,GAAG,CAAC,EAAU,EAAE;IAC9D,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAClC,OAAO,IAAI;SACR,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,MAAM,GAAG,IAAI,EAAE,CAAC;SACjC,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC,CAAC;AANW,QAAA,WAAW,eAMtB"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { DomainEntity } from 'domain-objects';
|
|
2
|
+
import { RoleSkill } from './RoleSkill';
|
|
3
|
+
import { RoleTrait } from './RoleTrait';
|
|
4
|
+
/**
|
|
5
|
+
* .what = defines a role that can have traits, know skills, and be instantiated across thread.context
|
|
6
|
+
* .why =
|
|
7
|
+
* - enables registration of usable roles (e.g., 'mechanic', 'designer', 'architect', 'ecologist')
|
|
8
|
+
* - enables instantiation of thread.contexts
|
|
9
|
+
*/
|
|
10
|
+
export interface Role {
|
|
11
|
+
/**
|
|
12
|
+
* .what = a unique, readable identifier
|
|
13
|
+
* .example = "mechanic"
|
|
14
|
+
*/
|
|
15
|
+
slug: string;
|
|
16
|
+
/**
|
|
17
|
+
* .what = a display name for the role
|
|
18
|
+
* .example = "Mechanic"
|
|
19
|
+
*/
|
|
20
|
+
name: string;
|
|
21
|
+
/**
|
|
22
|
+
* .what = a brief on why this role exists
|
|
23
|
+
* .why =
|
|
24
|
+
* - explain when and for what it should be used
|
|
25
|
+
* - sets what you can expect from it
|
|
26
|
+
*/
|
|
27
|
+
purpose: string;
|
|
28
|
+
/**
|
|
29
|
+
* .what = a readme that explains more about the role
|
|
30
|
+
* .why =
|
|
31
|
+
* - give detail about what it does and how it does it
|
|
32
|
+
*/
|
|
33
|
+
readme: string;
|
|
34
|
+
/**
|
|
35
|
+
* .what = the traits inherent to the role
|
|
36
|
+
* .why = declares how the role goes about things
|
|
37
|
+
*/
|
|
38
|
+
traits: RoleTrait<any>[];
|
|
39
|
+
/**
|
|
40
|
+
* .what = the skills known by the role
|
|
41
|
+
* .why = declares what the role can do
|
|
42
|
+
*/
|
|
43
|
+
skills: RoleSkill<any>[];
|
|
44
|
+
}
|
|
45
|
+
export declare class Role extends DomainEntity<Role> implements Role {
|
|
46
|
+
static unique: readonly ["slug"];
|
|
47
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Role = void 0;
|
|
4
|
+
const domain_objects_1 = require("domain-objects");
|
|
5
|
+
class Role extends domain_objects_1.DomainEntity {
|
|
6
|
+
}
|
|
7
|
+
exports.Role = Role;
|
|
8
|
+
Role.unique = ['slug'];
|
|
9
|
+
//# sourceMappingURL=Role.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Role.js","sourceRoot":"","sources":["../../../src/domain/objects/Role.ts"],"names":[],"mappings":";;;AAAA,mDAA8C;AAmD9C,MAAa,IAAK,SAAQ,6BAAkB;;AAA5C,oBAEC;AADe,WAAM,GAAG,CAAC,MAAM,CAAU,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ThreadContextRole, ThreadRole } from './Threads';
|
|
2
|
+
/**
|
|
3
|
+
* .what = a resolved RoleTrait, accessible in a thread's context
|
|
4
|
+
* .why = defines the default mindset or behavioral axioms that persist across all tasks performed in the role
|
|
5
|
+
* .examples =
|
|
6
|
+
* - treat ubiquitous language as top priority
|
|
7
|
+
* - treat consistency as top priority
|
|
8
|
+
* - prefer given/when/then test suites
|
|
9
|
+
* todo:
|
|
10
|
+
* - ensure that traits are always leveraged in every template that uses a role'd thread?
|
|
11
|
+
*/
|
|
12
|
+
export interface RoleContextTrait {
|
|
13
|
+
content: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* .what = a reference to a skill which is learned and accessible to any actor which assumes the role
|
|
17
|
+
* .why = enables agents to perform tasks within the role using repeatable methods, patterns, or strategies
|
|
18
|
+
* .cases =
|
|
19
|
+
* - domain distillation is a process where you extract domain terms and clarify their relationships; here's how to use
|
|
20
|
+
* - given/when/then enables test suites with behavior-driven structure; here's how to use
|
|
21
|
+
* todo:
|
|
22
|
+
* - update this to a shape that actually helps dynamic subskill execution, once we get to fluid routes
|
|
23
|
+
*/
|
|
24
|
+
export interface RoleContextSkill {
|
|
25
|
+
content: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* .what = the context that each role carries with it
|
|
29
|
+
* .why = provides each role with a set of traits (inherent truths) and skills (learned abilities) to influence how they approach decisions, actions, and interpretations
|
|
30
|
+
*/
|
|
31
|
+
export interface RoleContext<TRole extends ThreadRole, TStash extends Record<string, any> | undefined> extends ThreadContextRole<TRole> {
|
|
32
|
+
role: TRole;
|
|
33
|
+
/**
|
|
34
|
+
* .what = the persistent traits and skills that define how this role behaves
|
|
35
|
+
* .why = allows role-specific behavior, reasoning styles, and tool usage to persist across steps
|
|
36
|
+
*/
|
|
37
|
+
inherit: {
|
|
38
|
+
traits: RoleContextTrait[];
|
|
39
|
+
skills: RoleContextSkill[];
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* .what = short-lived or dynamic data needed for the current task
|
|
43
|
+
* .why = gives the thread situational context without polluting long-term role identity
|
|
44
|
+
*/
|
|
45
|
+
stash: TStash;
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoleContext.js","sourceRoot":"","sources":["../../../src/domain/objects/RoleContext.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { DomainEntity } from 'domain-objects';
|
|
2
|
+
import { Role } from './Role';
|
|
3
|
+
/**
|
|
4
|
+
* .what = a curated collection of roles, available for use
|
|
5
|
+
* .why =
|
|
6
|
+
* - acts as a declaration of available roles
|
|
7
|
+
* - enables composition of registries
|
|
8
|
+
* - supports cli and documentation introspection
|
|
9
|
+
* - supports fluid composition of roles via delegation (e.g., one role can runtime delegate to another that it found via registry)
|
|
10
|
+
*/
|
|
11
|
+
export interface RoleRegistry {
|
|
12
|
+
/**
|
|
13
|
+
* .what = unique identifier for this registry
|
|
14
|
+
*/
|
|
15
|
+
slug: string;
|
|
16
|
+
/**
|
|
17
|
+
* .what = markdown-formatted overview of what this registry contains
|
|
18
|
+
* .why = provides documentation, context, and intended use
|
|
19
|
+
*/
|
|
20
|
+
readme: string;
|
|
21
|
+
/**
|
|
22
|
+
* .what = the roles that this registry has collected
|
|
23
|
+
*/
|
|
24
|
+
roles: Role[];
|
|
25
|
+
}
|
|
26
|
+
export declare class RoleRegistry extends DomainEntity<RoleRegistry> implements RoleRegistry {
|
|
27
|
+
static unique: readonly ["slug"];
|
|
28
|
+
static nested: {
|
|
29
|
+
roles: typeof Role;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RoleRegistry = void 0;
|
|
4
|
+
const domain_objects_1 = require("domain-objects");
|
|
5
|
+
const Role_1 = require("./Role");
|
|
6
|
+
class RoleRegistry extends domain_objects_1.DomainEntity {
|
|
7
|
+
}
|
|
8
|
+
exports.RoleRegistry = RoleRegistry;
|
|
9
|
+
RoleRegistry.unique = ['slug'];
|
|
10
|
+
RoleRegistry.nested = {
|
|
11
|
+
roles: Role_1.Role,
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=RoleRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoleRegistry.js","sourceRoot":"","sources":["../../../src/domain/objects/RoleRegistry.ts"],"names":[],"mappings":";;;AAAA,mDAA8C;AAE9C,iCAA8B;AA2B9B,MAAa,YACX,SAAQ,6BAA0B;;AADpC,oCAQC;AAJe,mBAAM,GAAG,CAAC,MAAM,CAAU,CAAC;AAC3B,mBAAM,GAAG;IACrB,KAAK,EAAE,WAAI;CACZ,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { DomainEntity } from 'domain-objects';
|
|
2
|
+
import { RoleSkillContextGetter, RoleSkillThreadsGetter } from './RoleSkillArgGetter';
|
|
3
|
+
import { GStitcher, Stitcher } from './Stitcher';
|
|
4
|
+
/**
|
|
5
|
+
* .what = a skill is an action a role can perform; a route it can weave
|
|
6
|
+
* .why =
|
|
7
|
+
* - defines a reusable skill you can ask a role to perform
|
|
8
|
+
* - usable for skill invocation, e.g., via the cli
|
|
9
|
+
*/
|
|
10
|
+
export interface RoleSkill<TStitcher extends GStitcher> {
|
|
11
|
+
/**
|
|
12
|
+
* .what = short, unique identifier
|
|
13
|
+
* .example = "summarize"
|
|
14
|
+
*/
|
|
15
|
+
slug: string;
|
|
16
|
+
/**
|
|
17
|
+
* .what = a full description of the skill
|
|
18
|
+
* .why = explains what can be expected, how to use it, and details of operation
|
|
19
|
+
* .note =
|
|
20
|
+
* - the first two lines of the readme will be used as a description
|
|
21
|
+
*/
|
|
22
|
+
readme: string;
|
|
23
|
+
/**
|
|
24
|
+
* .what = the route via which the skill is executable
|
|
25
|
+
*/
|
|
26
|
+
route: Stitcher<TStitcher>;
|
|
27
|
+
/**
|
|
28
|
+
* .what = how to instantiate the threads for this skill
|
|
29
|
+
*/
|
|
30
|
+
threads: RoleSkillThreadsGetter<TStitcher['threads'], any>;
|
|
31
|
+
/**
|
|
32
|
+
* .what = how to instantiate the context for this skill
|
|
33
|
+
*/
|
|
34
|
+
context: RoleSkillContextGetter<TStitcher['context'], any>;
|
|
35
|
+
}
|
|
36
|
+
export declare class RoleSkill<TStitcher extends GStitcher> extends DomainEntity<RoleSkill<TStitcher>> implements RoleSkill<TStitcher> {
|
|
37
|
+
static unique: readonly ["slug"];
|
|
38
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RoleSkill = void 0;
|
|
4
|
+
const domain_objects_1 = require("domain-objects");
|
|
5
|
+
class RoleSkill extends domain_objects_1.DomainEntity {
|
|
6
|
+
}
|
|
7
|
+
exports.RoleSkill = RoleSkill;
|
|
8
|
+
RoleSkill.unique = ['slug'];
|
|
9
|
+
//# sourceMappingURL=RoleSkill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoleSkill.js","sourceRoot":"","sources":["../../../src/domain/objects/RoleSkill.ts"],"names":[],"mappings":";;;AAAA,mDAA8C;AA4C9C,MAAa,SACX,SAAQ,6BAAkC;;AAD5C,8BAKC;AADe,gBAAM,GAAG,CAAC,MAAM,CAAU,CAAC"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { DomainLiteral } from 'domain-objects';
|
|
2
|
+
import { Empty } from 'type-fns';
|
|
3
|
+
import { GStitcher } from './Stitcher';
|
|
4
|
+
import { Threads } from './Threads';
|
|
5
|
+
/**
|
|
6
|
+
* .what = a generic specification for how to collect, verify, and instantiate skill arguments
|
|
7
|
+
* .why =
|
|
8
|
+
* - enables runtime hydration of `threads` or `context` from dynamic sources (e.g., CLI args, env vars)
|
|
9
|
+
* - supports unified handling for both declaration and execution paths
|
|
10
|
+
* - decouples static input schema from runtime instantiation logic
|
|
11
|
+
* .how =
|
|
12
|
+
* - supports lookup and passin mode
|
|
13
|
+
* - for lookup mode, will lookup the vars based on the schema specified, then assure correctness
|
|
14
|
+
* - for passin mode, will accept the passin declaration and simply assure correctness
|
|
15
|
+
*/
|
|
16
|
+
export interface RoleSkillArgGetter<TOutput, TVariables extends Record<string, any>> {
|
|
17
|
+
/**
|
|
18
|
+
* .what = declares how to collect required inputs (from CLI, env, etc)
|
|
19
|
+
*/
|
|
20
|
+
lookup: Record<string, {
|
|
21
|
+
/**
|
|
22
|
+
* .what = where to get lookup from
|
|
23
|
+
*/
|
|
24
|
+
source: 'process.env';
|
|
25
|
+
/**
|
|
26
|
+
* .what = a description of the input
|
|
27
|
+
*/
|
|
28
|
+
desc: string;
|
|
29
|
+
/**
|
|
30
|
+
* .what = what envar key to dereference
|
|
31
|
+
*/
|
|
32
|
+
envar: string;
|
|
33
|
+
/**
|
|
34
|
+
* .what = what type to expect
|
|
35
|
+
*/
|
|
36
|
+
type: 'string';
|
|
37
|
+
} | {
|
|
38
|
+
/**
|
|
39
|
+
* .what = where to get lookup from
|
|
40
|
+
*/
|
|
41
|
+
source: 'process.argv';
|
|
42
|
+
/**
|
|
43
|
+
* .what = a description of the input
|
|
44
|
+
*/
|
|
45
|
+
desc: string;
|
|
46
|
+
/**
|
|
47
|
+
* .what = what shorthand char alias to use, if from process.argv
|
|
48
|
+
*/
|
|
49
|
+
char?: string;
|
|
50
|
+
/**
|
|
51
|
+
* .what = what type to expect
|
|
52
|
+
*/
|
|
53
|
+
type: 'string';
|
|
54
|
+
}>;
|
|
55
|
+
/**
|
|
56
|
+
* .what = assures the input from lookup or passin was correctly declared
|
|
57
|
+
*/
|
|
58
|
+
assess: (input: any) => input is TVariables;
|
|
59
|
+
/**
|
|
60
|
+
* .what = instantiates the desired runtime object from the assured input
|
|
61
|
+
*/
|
|
62
|
+
instantiate: (input: TVariables) => Promise<TOutput> | TOutput;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* .what = a specification of the inputs required to instantiate the threads required for a skill
|
|
66
|
+
* .why =
|
|
67
|
+
* - enables declaration of inputs required for threads.getter(inputs)
|
|
68
|
+
* - unlocks cli usage where declaration is dynamic and runtime specified
|
|
69
|
+
* .how =
|
|
70
|
+
* - supports lookup and passin mode
|
|
71
|
+
* - for lookup mode, will lookup the vars based on the schema specified, then assure correctness
|
|
72
|
+
* - for passin mode, will accept the passin declaration and simply assure correctness
|
|
73
|
+
*/
|
|
74
|
+
export interface RoleSkillThreadsGetter<TOutput extends Threads<any>, TVariables extends Record<string, string>> extends RoleSkillArgGetter<TOutput, TVariables> {
|
|
75
|
+
/**
|
|
76
|
+
* .what = how to lookup the required inputs for thread instantiation
|
|
77
|
+
* .example = { target: { char: t, desc: "the target file or dir to upsert against", shape: "string" } }
|
|
78
|
+
*/
|
|
79
|
+
lookup: Record<string, {
|
|
80
|
+
/**
|
|
81
|
+
* .what = where to get lookup from
|
|
82
|
+
*/
|
|
83
|
+
source: 'process.argv';
|
|
84
|
+
/**
|
|
85
|
+
* .what = a description of the input
|
|
86
|
+
*/
|
|
87
|
+
desc: string;
|
|
88
|
+
/**
|
|
89
|
+
* .what = what shorthand single char alias to use
|
|
90
|
+
*/
|
|
91
|
+
char?: string;
|
|
92
|
+
/**
|
|
93
|
+
* .what = what type to expect
|
|
94
|
+
*/
|
|
95
|
+
type: 'string';
|
|
96
|
+
}> & {
|
|
97
|
+
ask?: Empty;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
export declare class RoleSkillThreadsGetter<TOutput extends Threads<any>, TVariables extends Record<string, string>> extends DomainLiteral<RoleSkillThreadsGetter<TOutput, TVariables>> implements RoleSkillThreadsGetter<TOutput, TVariables> {
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* .what = a specification of the inputs required to instantiate the context required for a skill
|
|
104
|
+
* .why =
|
|
105
|
+
* - enables declaration of inputs required for context.getter(inputs)
|
|
106
|
+
* - unlocks cli usage where declaration is dynamic and runtime specified
|
|
107
|
+
* .how =
|
|
108
|
+
* - supports lookup and passin mode
|
|
109
|
+
* - for lookup mode, will lookup the vars based on the schema specified, then assure correctness
|
|
110
|
+
* - for passin mode, will accept the passin declaration and simply assure correctness
|
|
111
|
+
*/
|
|
112
|
+
export interface RoleSkillContextGetter<TOutput extends GStitcher['context'], TVariables extends Record<string, string>> extends RoleSkillArgGetter<TOutput, TVariables> {
|
|
113
|
+
/**
|
|
114
|
+
* .what = how to lookup the required inputs for context instantiation
|
|
115
|
+
* .example = { openaiApiKey: { envar: "PREP_OPENAI_KEY" } }
|
|
116
|
+
*/
|
|
117
|
+
lookup: Record<string, {
|
|
118
|
+
/**
|
|
119
|
+
* .what = where to get lookup from
|
|
120
|
+
*/
|
|
121
|
+
source: 'process.env';
|
|
122
|
+
/**
|
|
123
|
+
* .what = a description of the input
|
|
124
|
+
*/
|
|
125
|
+
desc: string;
|
|
126
|
+
/**
|
|
127
|
+
* .what = what envar key to dereference
|
|
128
|
+
*/
|
|
129
|
+
envar: string;
|
|
130
|
+
/**
|
|
131
|
+
* .what = what type to expect
|
|
132
|
+
*/
|
|
133
|
+
type: 'string';
|
|
134
|
+
}>;
|
|
135
|
+
}
|
|
136
|
+
export declare class RoleSkillContextGetter<TOutput extends GStitcher['context'], TVariables extends Record<string, string>> extends DomainLiteral<RoleSkillContextGetter<TOutput, TVariables>> implements RoleSkillContextGetter<TOutput, TVariables> {
|
|
137
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RoleSkillContextGetter = exports.RoleSkillThreadsGetter = void 0;
|
|
4
|
+
const domain_objects_1 = require("domain-objects");
|
|
5
|
+
class RoleSkillThreadsGetter extends domain_objects_1.DomainLiteral {
|
|
6
|
+
}
|
|
7
|
+
exports.RoleSkillThreadsGetter = RoleSkillThreadsGetter;
|
|
8
|
+
class RoleSkillContextGetter extends domain_objects_1.DomainLiteral {
|
|
9
|
+
}
|
|
10
|
+
exports.RoleSkillContextGetter = RoleSkillContextGetter;
|
|
11
|
+
//# sourceMappingURL=RoleSkillArgGetter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoleSkillArgGetter.js","sourceRoot":"","sources":["../../../src/domain/objects/RoleSkillArgGetter.ts"],"names":[],"mappings":";;;AAAA,mDAA+C;AA8H/C,MAAa,sBAIX,SAAQ,8BAA0D;CACT;AAL3D,wDAK2D;AA6C3D,MAAa,sBAIX,SAAQ,8BAA0D;CACT;AAL3D,wDAK2D"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { DomainEntity } from 'domain-objects';
|
|
2
|
+
import { Serializable } from 'serde-fns';
|
|
3
|
+
import { Template } from './Template';
|
|
4
|
+
/**
|
|
5
|
+
* .what = a trait is a reusable behavioral modifier for a role
|
|
6
|
+
* - it's adopted as an inherent truth of any actor which assumes the role
|
|
7
|
+
* - defines the default mindset or behavioral axioms leveraged by the role
|
|
8
|
+
* .why =
|
|
9
|
+
* - helps cluster similar role behaviors (e.g. “asksQuestions”, “retriesUntilSolved”)
|
|
10
|
+
* - enables composable role design
|
|
11
|
+
* .examples =
|
|
12
|
+
* - treat ubiquitous language as top priority
|
|
13
|
+
* - treat consistency as top priority
|
|
14
|
+
* - prefer given/when/then test suites
|
|
15
|
+
*/
|
|
16
|
+
export interface RoleTrait<TVariables extends Serializable> {
|
|
17
|
+
/**
|
|
18
|
+
* .what = short identifier for this trait
|
|
19
|
+
* .example = "asksQuestions"
|
|
20
|
+
*/
|
|
21
|
+
slug: string;
|
|
22
|
+
/**
|
|
23
|
+
* .what = what this trait describes
|
|
24
|
+
* .example = "asks clarifying questions before responding"
|
|
25
|
+
*/
|
|
26
|
+
readme: string;
|
|
27
|
+
/**
|
|
28
|
+
* .what = the brief that houses this trait's declaration
|
|
29
|
+
*/
|
|
30
|
+
brief: Template<TVariables>;
|
|
31
|
+
}
|
|
32
|
+
export declare class RoleTrait<TVariables extends Serializable> extends DomainEntity<RoleTrait<TVariables>> implements RoleTrait<TVariables> {
|
|
33
|
+
static unique: readonly ["slug"];
|
|
34
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RoleTrait = void 0;
|
|
4
|
+
const domain_objects_1 = require("domain-objects");
|
|
5
|
+
class RoleTrait extends domain_objects_1.DomainEntity {
|
|
6
|
+
}
|
|
7
|
+
exports.RoleTrait = RoleTrait;
|
|
8
|
+
RoleTrait.unique = ['slug'];
|
|
9
|
+
//# sourceMappingURL=RoleTrait.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoleTrait.js","sourceRoot":"","sources":["../../../src/domain/objects/RoleTrait.ts"],"names":[],"mappings":";;;AAAA,mDAA8C;AAmC9C,MAAa,SACX,SAAQ,6BAAmC;;AAD7C,8BAKC;AADe,gBAAM,GAAG,CAAC,MAAM,CAAU,CAAC"}
|
|
@@ -32,7 +32,7 @@ export interface StitchStepImagine<TStitcher extends GStitcher<Threads<any, any>
|
|
|
32
32
|
*/
|
|
33
33
|
enprompt: (input: {
|
|
34
34
|
threads: TStitcher['threads'];
|
|
35
|
-
}) => string
|
|
35
|
+
}) => string | Promise<string>;
|
|
36
36
|
/**
|
|
37
37
|
* .what = invokes an llm to imagine based on a prompt
|
|
38
38
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StitchStep.js","sourceRoot":"","sources":["../../../src/domain/objects/StitchStep.ts"],"names":[],"mappings":";;;AAAA,mDAA+C;AA4B/C,MAAa,iBAGX,SAAQ,8BAA2C;CACT;AAJ5C,8CAI4C;
|
|
1
|
+
{"version":3,"file":"StitchStep.js","sourceRoot":"","sources":["../../../src/domain/objects/StitchStep.ts"],"names":[],"mappings":";;;AAAA,mDAA+C;AA4B/C,MAAa,iBAGX,SAAQ,8BAA2C;CACT;AAJ5C,8CAI4C;AAmC5C,MAAa,iBAGX,SAAQ,8BAA2C;CACT;AAJ5C,8CAI4C"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DomainEntity, RefByUnique } from 'domain-objects';
|
|
2
|
+
import { GitFile } from 'rhachet-artifact-git';
|
|
3
|
+
/**
|
|
4
|
+
* .what = a template reference that can be hydrated with variables
|
|
5
|
+
* .why = enables rendering reusable text templates with custom input
|
|
6
|
+
*
|
|
7
|
+
* .cases =
|
|
8
|
+
* - load a GitFile template from a known uri
|
|
9
|
+
* - hydrate the template using input variables
|
|
10
|
+
* - return the final string with placeholders filled
|
|
11
|
+
*/
|
|
12
|
+
export interface Template<TVariables = any> {
|
|
13
|
+
ref: RefByUnique<typeof GitFile>;
|
|
14
|
+
/**
|
|
15
|
+
* .what = renders the template with the given variables
|
|
16
|
+
* .why = supports consistent formatting for any templated output
|
|
17
|
+
*/
|
|
18
|
+
use: (input: TVariables) => Promise<string>;
|
|
19
|
+
}
|
|
20
|
+
export declare class Template<TVariables = any> extends DomainEntity<Template<TVariables>> implements Template<TVariables> {
|
|
21
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Template = void 0;
|
|
4
|
+
const domain_objects_1 = require("domain-objects");
|
|
5
|
+
class Template extends domain_objects_1.DomainEntity {
|
|
6
|
+
}
|
|
7
|
+
exports.Template = Template;
|
|
8
|
+
//# sourceMappingURL=Template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Template.js","sourceRoot":"","sources":["../../../src/domain/objects/Template.ts"],"names":[],"mappings":";;;AAAA,mDAA2D;AAsB3D,MAAa,QACX,SAAQ,6BAAkC;CACR;AAFpC,4BAEoC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const test_fns_1 = require("test-fns");
|
|
4
|
+
const Template_1 = require("./Template");
|
|
5
|
+
describe('Template', () => {
|
|
6
|
+
const mockUri = 'templates/hello.md';
|
|
7
|
+
(0, test_fns_1.given)('a Template that uses input variables to render', () => {
|
|
8
|
+
const template = new Template_1.Template({
|
|
9
|
+
ref: { uri: mockUri },
|
|
10
|
+
use: async ({ name }) => `Hello, ${name}!`,
|
|
11
|
+
});
|
|
12
|
+
(0, test_fns_1.when)('calling use with a variable object', () => {
|
|
13
|
+
(0, test_fns_1.then)('it returns the correctly hydrated string', async () => {
|
|
14
|
+
const result = await template.use({ name: 'Casey' });
|
|
15
|
+
expect(result).toBe('Hello, Casey!');
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
(0, test_fns_1.given)('a Template with empty variable usage', () => {
|
|
20
|
+
const template = new Template_1.Template({
|
|
21
|
+
ref: { uri: mockUri },
|
|
22
|
+
use: async () => '',
|
|
23
|
+
});
|
|
24
|
+
(0, test_fns_1.when)('calling use with an empty object', () => {
|
|
25
|
+
(0, test_fns_1.then)('it returns an empty string', async () => {
|
|
26
|
+
const result = await template.use({});
|
|
27
|
+
expect(result).toBe('');
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
it('should error if required variable is missing', async () => {
|
|
32
|
+
const template = new Template_1.Template({
|
|
33
|
+
ref: { uri: mockUri },
|
|
34
|
+
use: async ({ name }) => `Hi ${name}`,
|
|
35
|
+
});
|
|
36
|
+
// @ts-expect-error - missing required field `name`
|
|
37
|
+
await template.use({});
|
|
38
|
+
});
|
|
39
|
+
it('should error if variable shape is incompatible', () => {
|
|
40
|
+
const template = new Template_1.Template({
|
|
41
|
+
ref: { uri: mockUri },
|
|
42
|
+
// @ts-expect-error - attempting to access a nonexistent property on age
|
|
43
|
+
use: async ({ age }) => `Age: ${age.name}`,
|
|
44
|
+
});
|
|
45
|
+
expect(template);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
//#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C,CAAC;gBACtC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAC1B,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8CAA8C,EAAE,KAAK,IAAI,EAAE;QAC5D,MAAM,QAAQ,GAAG,IAAI,mBAAQ,CAAmB;YAC9C,GAAG,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE;YACrB,GAAG,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,MAAM,IAAI,EAAE;SACtC,CAAC,CAAC;QAEH,mDAAmD;QACnD,MAAM,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;QACxD,MAAM,QAAQ,GAAG,IAAI,mBAAQ,CAAkB;YAC7C,GAAG,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE;YACrB,wEAAwE;YACxE,GAAG,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,QAAQ,GAAG,CAAC,IAAI,EAAE;SAC3C,CAAC,CAAC;QACH,MAAM,CAAC,QAAQ,CAAC,CAAC;IACnB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -9,3 +9,10 @@ export * from './StitchStep';
|
|
|
9
9
|
export * from './StitchTrail';
|
|
10
10
|
export * from './Thread';
|
|
11
11
|
export * from './Threads';
|
|
12
|
+
export * from './Role';
|
|
13
|
+
export * from './RoleContext';
|
|
14
|
+
export * from './RoleRegistry';
|
|
15
|
+
export * from './RoleSkill';
|
|
16
|
+
export * from './RoleSkillArgGetter';
|
|
17
|
+
export * from './RoleTrait';
|
|
18
|
+
export * from './Template';
|
|
@@ -27,4 +27,11 @@ __exportStar(require("./Thread"), exports);
|
|
|
27
27
|
__exportStar(require("./Threads"), exports);
|
|
28
28
|
// export * from './Weave';
|
|
29
29
|
// export * from './Weaver';
|
|
30
|
+
__exportStar(require("./Role"), exports);
|
|
31
|
+
__exportStar(require("./RoleContext"), exports);
|
|
32
|
+
__exportStar(require("./RoleRegistry"), exports);
|
|
33
|
+
__exportStar(require("./RoleSkill"), exports);
|
|
34
|
+
__exportStar(require("./RoleSkillArgGetter"), exports);
|
|
35
|
+
__exportStar(require("./RoleTrait"), exports);
|
|
36
|
+
__exportStar(require("./Template"), exports);
|
|
30
37
|
//# sourceMappingURL=index.js.map
|