rhachet 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/__nonpublished_modules__/file-fns/src/getFile.d.ts +6 -0
- package/dist/__nonpublished_modules__/file-fns/src/getFile.js +14 -0
- package/dist/__nonpublished_modules__/file-fns/src/getFile.js.map +1 -0
- package/dist/__test_assets__/directory.d.ts +1 -0
- package/dist/__test_assets__/directory.js +5 -0
- package/dist/__test_assets__/directory.js.map +1 -0
- package/dist/__test_assets__/genContextLogTrail.d.ts +2 -0
- package/dist/__test_assets__/genContextLogTrail.js +12 -0
- package/dist/__test_assets__/genContextLogTrail.js.map +1 -0
- package/dist/__test_assets__/genContextStitchTrail.d.ts +2 -0
- package/dist/__test_assets__/genContextStitchTrail.js +8 -0
- package/dist/__test_assets__/genContextStitchTrail.js.map +1 -0
- package/dist/__test_assets__/getContextOpenAI.d.ts +2 -0
- package/dist/__test_assets__/getContextOpenAI.js +18 -0
- package/dist/__test_assets__/getContextOpenAI.js.map +1 -0
- package/dist/__test_assets__/stitchers/genStitcherCodeFileRead.d.ts +14 -0
- package/dist/__test_assets__/stitchers/genStitcherCodeFileRead.js +23 -0
- package/dist/__test_assets__/stitchers/genStitcherCodeFileRead.js.map +1 -0
- package/dist/__test_assets__/stitchers/genStitcherCodeFileWrite.d.ts +16 -0
- package/dist/__test_assets__/stitchers/genStitcherCodeFileWrite.js +29 -0
- package/dist/__test_assets__/stitchers/genStitcherCodeFileWrite.js.map +1 -0
- package/dist/__test_assets__/stitchers/genStitcherCodeReviewImagine.d.ts +15 -0
- package/dist/__test_assets__/stitchers/genStitcherCodeReviewImagine.js +97 -0
- package/dist/__test_assets__/stitchers/genStitcherCodeReviewImagine.js.map +1 -0
- package/dist/__test_assets__/stitchers/stitcherCodeDiffImagine.d.ts +13 -0
- package/dist/__test_assets__/stitchers/stitcherCodeDiffImagine.js +33 -0
- package/dist/__test_assets__/stitchers/stitcherCodeDiffImagine.js.map +1 -0
- package/dist/__test_assets__/stitchers/stitcherFanoutRandomSum.d.ts +13 -0
- package/dist/__test_assets__/stitchers/stitcherFanoutRandomSum.js +45 -0
- package/dist/__test_assets__/stitchers/stitcherFanoutRandomSum.js.map +1 -0
- package/dist/__test_assets__/stitchers/stitcherFanoutSubroutes.d.ts +29 -0
- package/dist/__test_assets__/stitchers/stitcherFanoutSubroutes.js +76 -0
- package/dist/__test_assets__/stitchers/stitcherFanoutSubroutes.js.map +1 -0
- package/dist/__test_assets__/threads/codeArtist.d.ts +6 -0
- package/dist/__test_assets__/threads/codeArtist.js +26 -0
- package/dist/__test_assets__/threads/codeArtist.js.map +1 -0
- package/dist/__test_assets__/threads/codeCritic.d.ts +6 -0
- package/dist/__test_assets__/threads/codeCritic.js +21 -0
- package/dist/__test_assets__/threads/codeCritic.js.map +1 -0
- package/dist/__test_assets__/threads/director.d.ts +6 -0
- package/dist/__test_assets__/threads/director.js +14 -0
- package/dist/__test_assets__/threads/director.js.map +1 -0
- package/dist/contract/sdk.d.ts +8 -0
- package/dist/contract/sdk.js +33 -0
- package/dist/contract/sdk.js.map +1 -0
- package/dist/domain/objects/Stitch.d.ts +42 -0
- package/dist/domain/objects/Stitch.js +9 -0
- package/dist/domain/objects/Stitch.js.map +1 -0
- package/dist/domain/objects/StitchChoice.d.ts +30 -0
- package/dist/domain/objects/StitchChoice.js +8 -0
- package/dist/domain/objects/StitchChoice.js.map +1 -0
- package/dist/domain/objects/StitchCycle.d.ts +44 -0
- package/dist/domain/objects/StitchCycle.js +8 -0
- package/dist/domain/objects/StitchCycle.js.map +1 -0
- package/dist/domain/objects/StitchFanout.d.ts +35 -0
- package/dist/domain/objects/StitchFanout.js +8 -0
- package/dist/domain/objects/StitchFanout.js.map +1 -0
- package/dist/domain/objects/StitchRoute.d.ts +22 -0
- package/dist/domain/objects/StitchRoute.js +8 -0
- package/dist/domain/objects/StitchRoute.js.map +1 -0
- package/dist/domain/objects/StitchSetEvent.d.ts +23 -0
- package/dist/domain/objects/StitchSetEvent.js +8 -0
- package/dist/domain/objects/StitchSetEvent.js.map +1 -0
- package/dist/domain/objects/StitchStep.d.ts +55 -0
- package/dist/domain/objects/StitchStep.js +11 -0
- package/dist/domain/objects/StitchStep.js.map +1 -0
- package/dist/domain/objects/StitchTrail.d.ts +26 -0
- package/dist/domain/objects/StitchTrail.js +19 -0
- package/dist/domain/objects/StitchTrail.js.map +1 -0
- package/dist/domain/objects/Stitcher.d.ts +105 -0
- package/dist/domain/objects/Stitcher.js +49 -0
- package/dist/domain/objects/Stitcher.js.map +1 -0
- package/dist/domain/objects/Stitcher.test.d.ts +1 -0
- package/dist/domain/objects/Stitcher.test.js +78 -0
- package/dist/domain/objects/Stitcher.test.js.map +1 -0
- package/dist/domain/objects/Thread.d.ts +31 -0
- package/dist/domain/objects/Thread.js +11 -0
- package/dist/domain/objects/Thread.js.map +1 -0
- package/dist/domain/objects/Threads.d.ts +56 -0
- package/dist/domain/objects/Threads.js +26 -0
- package/dist/domain/objects/Threads.js.map +1 -0
- package/dist/domain/objects/Weave.d.ts +0 -0
- package/dist/domain/objects/Weave.js +2 -0
- package/dist/domain/objects/Weave.js.map +1 -0
- package/dist/domain/objects/Weaver.d.ts +5 -0
- package/dist/domain/objects/Weaver.js +7 -0
- package/dist/domain/objects/Weaver.js.map +1 -0
- package/dist/domain/objects/index.d.ts +11 -0
- package/dist/domain/objects/index.js +30 -0
- package/dist/domain/objects/index.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/logic/stitch/adapters/imagineViaOpenAI.d.ts +13 -0
- package/dist/logic/stitch/adapters/imagineViaOpenAI.js +36 -0
- package/dist/logic/stitch/adapters/imagineViaOpenAI.js.map +1 -0
- package/dist/logic/stitch/enstitch.d.ts +27 -0
- package/dist/logic/stitch/enstitch.js +97 -0
- package/dist/logic/stitch/enstitch.js.map +1 -0
- package/dist/logic/stitch/enstitch.test.d.ts +1 -0
- package/dist/logic/stitch/enstitch.test.js +87 -0
- package/dist/logic/stitch/enstitch.test.js.map +1 -0
- package/dist/logic/stitch/invokeImagineStitcher.d.ts +10 -0
- package/dist/logic/stitch/invokeImagineStitcher.integration.test.d.ts +1 -0
- package/dist/logic/stitch/invokeImagineStitcher.integration.test.js +193 -0
- package/dist/logic/stitch/invokeImagineStitcher.integration.test.js.map +1 -0
- package/dist/logic/stitch/invokeImagineStitcher.js +23 -0
- package/dist/logic/stitch/invokeImagineStitcher.js.map +1 -0
- package/dist/logic/stitch/withStitchTrail.d.ts +16 -0
- package/dist/logic/stitch/withStitchTrail.js +40 -0
- package/dist/logic/stitch/withStitchTrail.js.map +1 -0
- package/dist/logic/thread/enroleThread.d.ts +4 -0
- package/dist/logic/thread/enroleThread.js +6 -0
- package/dist/logic/thread/enroleThread.js.map +1 -0
- package/dist/logic/thread/genThread.d.ts +7 -0
- package/dist/logic/thread/genThread.js +10 -0
- package/dist/logic/thread/genThread.js.map +1 -0
- package/dist/logic/weave/compose/GStitcherInferredFromChoice.generic.d.ts +17 -0
- package/dist/logic/weave/compose/GStitcherInferredFromChoice.generic.js +3 -0
- package/dist/logic/weave/compose/GStitcherInferredFromChoice.generic.js.map +1 -0
- package/dist/logic/weave/compose/GStitcherInferredFromChoice.generic.test.d.ts +1 -0
- package/dist/logic/weave/compose/GStitcherInferredFromChoice.generic.test.js +67 -0
- package/dist/logic/weave/compose/GStitcherInferredFromChoice.generic.test.js.map +1 -0
- package/dist/logic/weave/compose/GStitcherInferredFromCycle.generic.d.ts +18 -0
- package/dist/logic/weave/compose/GStitcherInferredFromCycle.generic.js +3 -0
- package/dist/logic/weave/compose/GStitcherInferredFromCycle.generic.js.map +1 -0
- package/dist/logic/weave/compose/GStitcherInferredFromCycle.generic.test.d.ts +1 -0
- package/dist/logic/weave/compose/GStitcherInferredFromCycle.generic.test.js +132 -0
- package/dist/logic/weave/compose/GStitcherInferredFromCycle.generic.test.js.map +1 -0
- package/dist/logic/weave/compose/GStitcherInferredFromFanout.generic.d.ts +23 -0
- package/dist/logic/weave/compose/GStitcherInferredFromFanout.generic.js +3 -0
- package/dist/logic/weave/compose/GStitcherInferredFromFanout.generic.js.map +1 -0
- package/dist/logic/weave/compose/GStitcherInferredFromFanout.generic.test.d.ts +1 -0
- package/dist/logic/weave/compose/GStitcherInferredFromFanout.generic.test.js +74 -0
- package/dist/logic/weave/compose/GStitcherInferredFromFanout.generic.test.js.map +1 -0
- package/dist/logic/weave/compose/GStitcherInferredFromRoute.generic.d.ts +24 -0
- package/dist/logic/weave/compose/GStitcherInferredFromRoute.generic.js +3 -0
- package/dist/logic/weave/compose/GStitcherInferredFromRoute.generic.js.map +1 -0
- package/dist/logic/weave/compose/GStitcherInferredFromRoute.generic.test.d.ts +1 -0
- package/dist/logic/weave/compose/GStitcherInferredFromRoute.generic.test.js +190 -0
- package/dist/logic/weave/compose/GStitcherInferredFromRoute.generic.test.js.map +1 -0
- package/dist/logic/weave/compose/ProcedureContextMerged.generic.d.ts +36 -0
- package/dist/logic/weave/compose/ProcedureContextMerged.generic.js +3 -0
- package/dist/logic/weave/compose/ProcedureContextMerged.generic.js.map +1 -0
- package/dist/logic/weave/compose/ProcedureContextMerged.generic.test.d.ts +1 -0
- package/dist/logic/weave/compose/ProcedureContextMerged.generic.test.js +29 -0
- package/dist/logic/weave/compose/ProcedureContextMerged.generic.test.js.map +1 -0
- package/dist/logic/weave/compose/ThreadsMerged.generic.d.ts +65 -0
- package/dist/logic/weave/compose/ThreadsMerged.generic.js +3 -0
- package/dist/logic/weave/compose/ThreadsMerged.generic.js.map +1 -0
- package/dist/logic/weave/compose/ThreadsMerged.generic.test.d.ts +1 -0
- package/dist/logic/weave/compose/ThreadsMerged.generic.test.js +420 -0
- package/dist/logic/weave/compose/ThreadsMerged.generic.test.js.map +1 -0
- package/dist/logic/weave/compose/asStitcher.d.ts +12 -0
- package/dist/logic/weave/compose/asStitcher.js +15 -0
- package/dist/logic/weave/compose/asStitcher.js.map +1 -0
- package/dist/logic/weave/compose/asStitcher.test.d.ts +1 -0
- package/dist/logic/weave/compose/asStitcher.test.js +95 -0
- package/dist/logic/weave/compose/asStitcher.test.js.map +1 -0
- package/dist/logic/weave/compose/asStitcherFlat.d.ts +10 -0
- package/dist/logic/weave/compose/asStitcherFlat.js +13 -0
- package/dist/logic/weave/compose/asStitcherFlat.js.map +1 -0
- package/dist/logic/weave/compose/asStitcherFlat.test.d.ts +1 -0
- package/dist/logic/weave/compose/asStitcherFlat.test.js +96 -0
- package/dist/logic/weave/compose/asStitcherFlat.test.js.map +1 -0
- package/dist/logic/weave/compose/genStitchChoice.d.ts +22 -0
- package/dist/logic/weave/compose/genStitchChoice.js +23 -0
- package/dist/logic/weave/compose/genStitchChoice.js.map +1 -0
- package/dist/logic/weave/compose/genStitchChoice.test.d.ts +1 -0
- package/dist/logic/weave/compose/genStitchChoice.test.js +200 -0
- package/dist/logic/weave/compose/genStitchChoice.test.js.map +1 -0
- package/dist/logic/weave/compose/genStitchCycle.d.ts +28 -0
- package/dist/logic/weave/compose/genStitchCycle.js +30 -0
- package/dist/logic/weave/compose/genStitchCycle.js.map +1 -0
- package/dist/logic/weave/compose/genStitchCycle.test.d.ts +1 -0
- package/dist/logic/weave/compose/genStitchCycle.test.js +152 -0
- package/dist/logic/weave/compose/genStitchCycle.test.js.map +1 -0
- package/dist/logic/weave/compose/genStitchFanout.d.ts +17 -0
- package/dist/logic/weave/compose/genStitchFanout.js +21 -0
- package/dist/logic/weave/compose/genStitchFanout.js.map +1 -0
- package/dist/logic/weave/compose/genStitchFanout.test.d.ts +1 -0
- package/dist/logic/weave/compose/genStitchFanout.test.js +79 -0
- package/dist/logic/weave/compose/genStitchFanout.test.js.map +1 -0
- package/dist/logic/weave/compose/genStitchRoute.d.ts +15 -0
- package/dist/logic/weave/compose/genStitchRoute.js +20 -0
- package/dist/logic/weave/compose/genStitchRoute.js.map +1 -0
- package/dist/logic/weave/compose/genStitchRoute.test.d.ts +1 -0
- package/dist/logic/weave/compose/genStitchRoute.test.js +120 -0
- package/dist/logic/weave/compose/genStitchRoute.test.js.map +1 -0
- package/dist/logic/weave/enweave.d.ts +0 -0
- package/dist/logic/weave/enweave.js +2 -0
- package/dist/logic/weave/enweave.js.map +1 -0
- package/dist/logic/weave/enweaveAllStitchers.d.ts +0 -0
- package/dist/logic/weave/enweaveAllStitchers.js +2 -0
- package/dist/logic/weave/enweaveAllStitchers.js.map +1 -0
- package/dist/logic/weave/enweaveOneChoice.d.ts +14 -0
- package/dist/logic/weave/enweaveOneChoice.js +48 -0
- package/dist/logic/weave/enweaveOneChoice.js.map +1 -0
- package/dist/logic/weave/enweaveOneChoice.test.d.ts +1 -0
- package/dist/logic/weave/enweaveOneChoice.test.js +181 -0
- package/dist/logic/weave/enweaveOneChoice.test.js.map +1 -0
- package/dist/logic/weave/enweaveOneCycle.d.ts +19 -0
- package/dist/logic/weave/enweaveOneCycle.js +98 -0
- package/dist/logic/weave/enweaveOneCycle.js.map +1 -0
- package/dist/logic/weave/enweaveOneCycle.test.d.ts +1 -0
- package/dist/logic/weave/enweaveOneCycle.test.js +180 -0
- package/dist/logic/weave/enweaveOneCycle.test.js.map +1 -0
- package/dist/logic/weave/enweaveOneFanout.d.ts +12 -0
- package/dist/logic/weave/enweaveOneFanout.integration.test.d.ts +1 -0
- package/dist/logic/weave/enweaveOneFanout.integration.test.js +166 -0
- package/dist/logic/weave/enweaveOneFanout.integration.test.js.map +1 -0
- package/dist/logic/weave/enweaveOneFanout.js +37 -0
- package/dist/logic/weave/enweaveOneFanout.js.map +1 -0
- package/dist/logic/weave/enweaveOneRoute.d.ts +12 -0
- package/dist/logic/weave/enweaveOneRoute.integration.test.d.ts +1 -0
- package/dist/logic/weave/enweaveOneRoute.integration.test.js +159 -0
- package/dist/logic/weave/enweaveOneRoute.integration.test.js.map +1 -0
- package/dist/logic/weave/enweaveOneRoute.js +33 -0
- package/dist/logic/weave/enweaveOneRoute.js.map +1 -0
- package/dist/logic/weave/enweaveOneStitcher.d.ts +11 -0
- package/dist/logic/weave/enweaveOneStitcher.integration.test.d.ts +2 -0
- package/dist/logic/weave/enweaveOneStitcher.integration.test.js +258 -0
- package/dist/logic/weave/enweaveOneStitcher.integration.test.js.map +1 -0
- package/dist/logic/weave/enweaveOneStitcher.js +42 -0
- package/dist/logic/weave/enweaveOneStitcher.js.map +1 -0
- package/package.json +88 -0
- package/readme.md +61 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Uladzimir Kasacheuski
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFile = void 0;
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
/**
|
|
7
|
+
* .what = loads a file as a string from disk
|
|
8
|
+
*/
|
|
9
|
+
const getFile = async (input) => {
|
|
10
|
+
const fullPath = (0, path_1.resolve)(input.path);
|
|
11
|
+
return await fs_1.promises.readFile(fullPath, 'utf-8');
|
|
12
|
+
};
|
|
13
|
+
exports.getFile = getFile;
|
|
14
|
+
//# sourceMappingURL=getFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFile.js","sourceRoot":"","sources":["../../../../src/__nonpublished_modules__/file-fns/src/getFile.ts"],"names":[],"mappings":";;;AAAA,2BAAoC;AACpC,+BAA+B;AAE/B;;GAEG;AACI,MAAM,OAAO,GAAG,KAAK,EAAE,KAAuB,EAAmB,EAAE;IACxE,MAAM,QAAQ,GAAG,IAAA,cAAO,EAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACrC,OAAO,MAAM,aAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC,CAAC;AAHW,QAAA,OAAO,WAGlB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const directoryTestAssets: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"directory.js","sourceRoot":"","sources":["../../src/__test_assets__/directory.ts"],"names":[],"mappings":";;;AAAa,QAAA,mBAAmB,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.genContextLogTrail = void 0;
|
|
4
|
+
const type_fns_1 = require("type-fns");
|
|
5
|
+
const genContextLogTrail = () => ({
|
|
6
|
+
log: {
|
|
7
|
+
...(0, type_fns_1.pick)(console, ['debug', 'log', 'info', 'warn', 'error']),
|
|
8
|
+
trail: [],
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
exports.genContextLogTrail = genContextLogTrail;
|
|
12
|
+
//# sourceMappingURL=genContextLogTrail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genContextLogTrail.js","sourceRoot":"","sources":["../../src/__test_assets__/genContextLogTrail.ts"],"names":[],"mappings":";;;AACA,uCAAgC;AAEzB,MAAM,kBAAkB,GAAG,GAAoB,EAAE,CAAC,CAAC;IACxD,GAAG,EAAE;QACH,GAAG,IAAA,eAAI,EAAC,OAAO,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;QAC3D,KAAK,EAAE,EAAE;KACV;CACF,CAAC,CAAC;AALU,QAAA,kBAAkB,sBAK5B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.genContextStitchTrail = void 0;
|
|
4
|
+
const genContextStitchTrail = () => ({
|
|
5
|
+
stitch: { trail: [] },
|
|
6
|
+
});
|
|
7
|
+
exports.genContextStitchTrail = genContextStitchTrail;
|
|
8
|
+
//# sourceMappingURL=genContextStitchTrail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genContextStitchTrail.js","sourceRoot":"","sources":["../../src/__test_assets__/genContextStitchTrail.ts"],"names":[],"mappings":";;;AAEO,MAAM,qBAAqB,GAAG,GAAuB,EAAE,CAAC,CAAC;IAC9D,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;CACtB,CAAC,CAAC;AAFU,QAAA,qBAAqB,yBAE/B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getContextOpenAI = void 0;
|
|
4
|
+
const helpful_errors_1 = require("helpful-errors");
|
|
5
|
+
const getContextOpenAI = () => ({
|
|
6
|
+
openai: {
|
|
7
|
+
auth: {
|
|
8
|
+
key: process.env.PREP_OPENAI_KEY ??
|
|
9
|
+
helpful_errors_1.UnexpectedCodePathError.throw('prep openai key not declared in env'),
|
|
10
|
+
},
|
|
11
|
+
llm: {
|
|
12
|
+
model: 'gpt-4-turbo-2024-04-09',
|
|
13
|
+
output: 'words',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
exports.getContextOpenAI = getContextOpenAI;
|
|
18
|
+
//# sourceMappingURL=getContextOpenAI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getContextOpenAI.js","sourceRoot":"","sources":["../../src/__test_assets__/getContextOpenAI.ts"],"names":[],"mappings":";;;AAAA,mDAAyD;AAIlD,MAAM,gBAAgB,GAAG,GAAkB,EAAE,CAAC,CAAC;IACpD,MAAM,EAAE;QACN,IAAI,EAAE;YACJ,GAAG,EACD,OAAO,CAAC,GAAG,CAAC,eAAe;gBAC3B,wCAAuB,CAAC,KAAK,CAAC,qCAAqC,CAAC;SACvE;QACD,GAAG,EAAE;YACH,KAAK,EAAE,wBAAwB;YAC/B,MAAM,EAAE,OAAO;SAChB;KACF;CACF,CAAC,CAAC;AAZU,QAAA,gBAAgB,oBAY1B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StitchStepCompute } from '../../domain/objects/StitchStep';
|
|
2
|
+
import { GStitcher } from '../../domain/objects/Stitcher';
|
|
3
|
+
import { Threads } from '../../domain/objects/Threads';
|
|
4
|
+
import { ContextOpenAI } from '../../logic/stitch/adapters/imagineViaOpenAI';
|
|
5
|
+
export type OutputFileRead = {
|
|
6
|
+
path: string;
|
|
7
|
+
content: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const genStitcherCodeFileRead: <TStitchee extends keyof TThreads, TThreads extends Threads = Threads>(input: {
|
|
10
|
+
stitchee: TStitchee;
|
|
11
|
+
output: OutputFileRead | ((input: {
|
|
12
|
+
threads: TThreads;
|
|
13
|
+
}) => OutputFileRead);
|
|
14
|
+
}) => StitchStepCompute<GStitcher<TThreads, ContextOpenAI & import("simple-log-methods").ContextLogTrail & import("../../logic/stitch/withStitchTrail").ContextStitchTrail, OutputFileRead>>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.genStitcherCodeFileRead = void 0;
|
|
4
|
+
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
5
|
+
const type_fns_1 = require("type-fns");
|
|
6
|
+
const StitchStep_1 = require("../../domain/objects/StitchStep");
|
|
7
|
+
const genStitcherCodeFileRead = (input) => new StitchStep_1.StitchStepCompute({
|
|
8
|
+
form: 'COMPUTE',
|
|
9
|
+
readme: null,
|
|
10
|
+
slug: '[any]<code:file.read>',
|
|
11
|
+
stitchee: input.stitchee,
|
|
12
|
+
invoke: ({ threads }) => {
|
|
13
|
+
const output = (0, type_fns_1.isAFunction)(input.output)
|
|
14
|
+
? input.output({ threads })
|
|
15
|
+
: input.output;
|
|
16
|
+
return {
|
|
17
|
+
input: { path: output.path },
|
|
18
|
+
output,
|
|
19
|
+
};
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
exports.genStitcherCodeFileRead = genStitcherCodeFileRead;
|
|
23
|
+
//# sourceMappingURL=genStitcherCodeFileRead.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genStitcherCodeFileRead.js","sourceRoot":"","sources":["../../../src/__test_assets__/stitchers/genStitcherCodeFileRead.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,uCAAuC;AAEvC,gEAAoE;AAU7D,MAAM,uBAAuB,GAAG,CAGrC,KAGD,EAAE,EAAE,CACH,IAAI,8BAAiB,CAEnB;IACA,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,uBAAuB;IAC7B,QAAQ,EAAE,KAAK,CAAC,QAAQ;IACxB,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;QACtB,MAAM,MAAM,GAAG,IAAA,sBAAW,EAAC,KAAK,CAAC,MAAM,CAAC;YACtC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC;YAC3B,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC;QACjB,OAAO;YACL,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE;YAC5B,MAAM;SACP,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAvBQ,QAAA,uBAAuB,2BAuB/B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { StitchStepCompute } from '../../domain/objects/StitchStep';
|
|
2
|
+
import { GStitcher } from '../../domain/objects/Stitcher';
|
|
3
|
+
import { Threads } from '../../domain/objects/Threads';
|
|
4
|
+
import { ContextOpenAI } from '../../logic/stitch/adapters/imagineViaOpenAI';
|
|
5
|
+
export type OutputFileWrite = {
|
|
6
|
+
path: string;
|
|
7
|
+
content: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* .what = generates a mock file write stitcher
|
|
11
|
+
* .why = finalizes a codediff into a file output result
|
|
12
|
+
*/
|
|
13
|
+
export declare const genStitcherCodeFileWrite: <TStitchee extends keyof TThreads, TThreads extends Threads<any> = Threads>(input: {
|
|
14
|
+
stitchee: TStitchee;
|
|
15
|
+
path?: string;
|
|
16
|
+
}) => StitchStepCompute<GStitcher<TThreads, ContextOpenAI & import("simple-log-methods").ContextLogTrail & import("../../logic/stitch/withStitchTrail").ContextStitchTrail, OutputFileWrite>>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.genStitcherCodeFileWrite = void 0;
|
|
4
|
+
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
5
|
+
const helpful_errors_1 = require("helpful-errors");
|
|
6
|
+
const StitchStep_1 = require("../../domain/objects/StitchStep");
|
|
7
|
+
/**
|
|
8
|
+
* .what = generates a mock file write stitcher
|
|
9
|
+
* .why = finalizes a codediff into a file output result
|
|
10
|
+
*/
|
|
11
|
+
const genStitcherCodeFileWrite = (input) => new StitchStep_1.StitchStepCompute({
|
|
12
|
+
form: 'COMPUTE',
|
|
13
|
+
slug: '[any]<code:file.write>',
|
|
14
|
+
readme: 'mock file writer that copies the output string into file output',
|
|
15
|
+
stitchee: input.stitchee,
|
|
16
|
+
invoke: ({ threads }) => {
|
|
17
|
+
const latest = threads[input.stitchee]?.stitches.slice(-1)[0];
|
|
18
|
+
const content = latest?.output;
|
|
19
|
+
if (typeof content !== 'string')
|
|
20
|
+
throw new helpful_errors_1.UnexpectedCodePathError('Expected previous stitch output to be a string-codediff', { latest, threads });
|
|
21
|
+
const result = {
|
|
22
|
+
path: input.path ?? '__mock__/rewritten.ts',
|
|
23
|
+
content,
|
|
24
|
+
};
|
|
25
|
+
return { input: result, output: result };
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
exports.genStitcherCodeFileWrite = genStitcherCodeFileWrite;
|
|
29
|
+
//# sourceMappingURL=genStitcherCodeFileWrite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genStitcherCodeFileWrite.js","sourceRoot":"","sources":["../../../src/__test_assets__/stitchers/genStitcherCodeFileWrite.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,mDAAyD;AAGzD,gEAAoE;AAUpE;;;GAGG;AACI,MAAM,wBAAwB,GAAG,CAGtC,KAGD,EAAE,EAAE,CACH,IAAI,8BAAiB,CAEnB;IACA,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,wBAAwB;IAC9B,MAAM,EAAE,iEAAiE;IACzE,QAAQ,EAAE,KAAK,CAAC,QAAQ;IACxB,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;QACtB,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9D,MAAM,OAAO,GAAG,MAAM,EAAE,MAAM,CAAC;QAC/B,IAAI,OAAO,OAAO,KAAK,QAAQ;YAC7B,MAAM,IAAI,wCAAuB,CAC/B,yDAAyD,EACzD,EAAE,MAAM,EAAE,OAAO,EAAE,CACpB,CAAC;QAEJ,MAAM,MAAM,GAAoB;YAC9B,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,uBAAuB;YAC3C,OAAO;SACR,CAAC;QAEF,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAC3C,CAAC;CACF,CAAC,CAAC;AA9BQ,QAAA,wBAAwB,4BA8BhC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Empty } from 'type-fns';
|
|
2
|
+
import { StitchStepImagine } from '../../domain/objects/StitchStep';
|
|
3
|
+
import { GStitcher } from '../../domain/objects/Stitcher';
|
|
4
|
+
import { Threads } from '../../domain/objects/Threads';
|
|
5
|
+
import { ContextOpenAI } from '../../logic/stitch/adapters/imagineViaOpenAI';
|
|
6
|
+
export declare const genStitcherCodeReview: (input: {
|
|
7
|
+
scope: 'technical' | 'functional';
|
|
8
|
+
focus: 'blockers' | 'chances' | 'praises';
|
|
9
|
+
}) => StitchStepImagine<GStitcher<Threads<{
|
|
10
|
+
director: Empty;
|
|
11
|
+
critic: {
|
|
12
|
+
tools: string[];
|
|
13
|
+
facts: string[];
|
|
14
|
+
};
|
|
15
|
+
}>, ContextOpenAI & import("simple-log-methods").ContextLogTrail & import("../../logic/stitch/withStitchTrail").ContextStitchTrail, string>>;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.genStitcherCodeReview = void 0;
|
|
4
|
+
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
5
|
+
const helpful_errors_1 = require("helpful-errors");
|
|
6
|
+
const StitchStep_1 = require("../../domain/objects/StitchStep");
|
|
7
|
+
const imagineViaOpenAI_1 = require("../../logic/stitch/adapters/imagineViaOpenAI");
|
|
8
|
+
// an example of the kind of knowledge that can be embedded globally within the stitcher, rather than the thread.role
|
|
9
|
+
const getReviewTools = (input) => {
|
|
10
|
+
const { scope, focus } = input;
|
|
11
|
+
const base = scope === 'technical'
|
|
12
|
+
? [
|
|
13
|
+
'leave a `//` comment above each paragraph of code, which we call a paragraph title; also, a newline above each `//` paragraph title',
|
|
14
|
+
'if comment needs >1 line, extract to procedure with /** .what, .why */',
|
|
15
|
+
'prefer procedural patterns: early returns, avoid deep nesting',
|
|
16
|
+
]
|
|
17
|
+
: [
|
|
18
|
+
'check if business edge cases are covered',
|
|
19
|
+
'verify alignment with product requirements',
|
|
20
|
+
'highlight logic that seems out of scope or brittle',
|
|
21
|
+
];
|
|
22
|
+
const additions = {
|
|
23
|
+
technical: {
|
|
24
|
+
blockers: [
|
|
25
|
+
'ensure naming is unambiguous and consistent with conventions',
|
|
26
|
+
'check for consistency in pattern usage across codebase',
|
|
27
|
+
"flag any logic that's tightly coupled or hard to extend",
|
|
28
|
+
],
|
|
29
|
+
chances: [
|
|
30
|
+
'suggest simple nitpicks (style, brevity, naming)',
|
|
31
|
+
'recommend upgrades (pattern refactors, extraction chances)',
|
|
32
|
+
'identify potential abstractions or DRY violations',
|
|
33
|
+
],
|
|
34
|
+
praises: [
|
|
35
|
+
'point out clean abstractions or elegant code structure',
|
|
36
|
+
'highlight patterns that should be reused elsewhere',
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
functional: {
|
|
40
|
+
blockers: [
|
|
41
|
+
'spot missing validations or edge case handling',
|
|
42
|
+
'check if any product requirement is unaddressed',
|
|
43
|
+
'identify logic that could break in common scenarios',
|
|
44
|
+
],
|
|
45
|
+
chances: [
|
|
46
|
+
'suggest guardrails or fallbacks for risky flows',
|
|
47
|
+
'recommend simplifications aligned with business intent',
|
|
48
|
+
'note any logic that can be reused or centralized',
|
|
49
|
+
],
|
|
50
|
+
praises: [
|
|
51
|
+
'acknowledge clear mapping to product goals',
|
|
52
|
+
'celebrate thoughtful handling of tricky logic',
|
|
53
|
+
'highlight robustness in dealing with user scenarios',
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
return [...base, ...(additions[scope]?.[focus] ?? [])];
|
|
58
|
+
};
|
|
59
|
+
const genStitcherCodeReview = (input) => new StitchStep_1.StitchStepImagine({
|
|
60
|
+
form: 'IMAGINE',
|
|
61
|
+
slug: `[critic]:<code:review:${input.scope}:${input.focus}>`,
|
|
62
|
+
stitchee: 'critic',
|
|
63
|
+
readme: `intent(imagines constructive feedback over the latest state of code, focused on ${input.scope} ${input.focus})`,
|
|
64
|
+
enprompt: ({ threads }) => {
|
|
65
|
+
const tacticTools = getReviewTools(input);
|
|
66
|
+
const combinedTools = [...tacticTools, ...threads.critic.context.tools];
|
|
67
|
+
return [
|
|
68
|
+
`imagine constructive ${input.scope} ${input.focus} feedback over the following code`,
|
|
69
|
+
'',
|
|
70
|
+
'context.tools = ',
|
|
71
|
+
combinedTools.map((tool) => ` - ${tool}`).join('\n'),
|
|
72
|
+
'',
|
|
73
|
+
'context.facts = ',
|
|
74
|
+
threads.critic.context.facts.map((fact) => ` - ${fact}`).join('\n'),
|
|
75
|
+
'',
|
|
76
|
+
'here is the current state of the code',
|
|
77
|
+
threads.critic.stitches.slice(-1)[0]?.output?.content ??
|
|
78
|
+
helpful_errors_1.UnexpectedCodePathError.throw('no prior stitch detected for code sample', { threads }),
|
|
79
|
+
'',
|
|
80
|
+
...(input.scope === 'functional'
|
|
81
|
+
? [
|
|
82
|
+
'here is the functional directive',
|
|
83
|
+
threads.director.stitches.slice(-1)[0]?.output,
|
|
84
|
+
]
|
|
85
|
+
: []),
|
|
86
|
+
'',
|
|
87
|
+
`return a json object with shape { feedback: { scope: '${input.scope}', focus: '${input.focus}', importance: HIGH | MEDIUM | LOW, description: string, example: CodeBlockString }[] }`,
|
|
88
|
+
].join('\n');
|
|
89
|
+
},
|
|
90
|
+
imagine: imagineViaOpenAI_1.imagineViaOpenAI,
|
|
91
|
+
deprompt: ({ promptOut, promptIn }) => ({
|
|
92
|
+
output: promptOut,
|
|
93
|
+
input: promptIn,
|
|
94
|
+
}),
|
|
95
|
+
});
|
|
96
|
+
exports.genStitcherCodeReview = genStitcherCodeReview;
|
|
97
|
+
//# sourceMappingURL=genStitcherCodeReviewImagine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genStitcherCodeReviewImagine.js","sourceRoot":"","sources":["../../../src/__test_assets__/stitchers/genStitcherCodeReviewImagine.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StitchStepImagine } from '../../domain/objects/StitchStep';
|
|
2
|
+
import { GStitcher } from '../../domain/objects/Stitcher';
|
|
3
|
+
import { Threads } from '../../domain/objects/Threads';
|
|
4
|
+
import { ContextOpenAI } from '../../logic/stitch/adapters/imagineViaOpenAI';
|
|
5
|
+
export declare const stitcherCodeDiffImagine: StitchStepImagine<GStitcher<Threads<{
|
|
6
|
+
artist: {
|
|
7
|
+
tools: string[];
|
|
8
|
+
facts: string[];
|
|
9
|
+
};
|
|
10
|
+
director: {
|
|
11
|
+
directive?: string;
|
|
12
|
+
};
|
|
13
|
+
}>, ContextOpenAI & import("simple-log-methods").ContextLogTrail & import("../../logic/stitch/withStitchTrail").ContextStitchTrail, string>>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stitcherCodeDiffImagine = void 0;
|
|
4
|
+
const StitchStep_1 = require("../../domain/objects/StitchStep");
|
|
5
|
+
const imagineViaOpenAI_1 = require("../../logic/stitch/adapters/imagineViaOpenAI");
|
|
6
|
+
exports.stitcherCodeDiffImagine = new StitchStep_1.StitchStepImagine({
|
|
7
|
+
form: 'IMAGINE',
|
|
8
|
+
slug: '[artist]<code:diff>',
|
|
9
|
+
stitchee: 'artist',
|
|
10
|
+
readme: 'intent(imagines a codediff)',
|
|
11
|
+
enprompt: ({ threads }) => [
|
|
12
|
+
'imagine a codediff to fulfill the directive',
|
|
13
|
+
'',
|
|
14
|
+
'context.tools = ',
|
|
15
|
+
threads.artist.context.tools.join('\n - '),
|
|
16
|
+
'',
|
|
17
|
+
'context.facts = ',
|
|
18
|
+
threads.artist.context.facts.join('\n - '),
|
|
19
|
+
'',
|
|
20
|
+
'here is the current state of the code',
|
|
21
|
+
threads.artist.stitches.slice(-1)[0]?.output.content,
|
|
22
|
+
'',
|
|
23
|
+
'here is the directive',
|
|
24
|
+
threads.director.context.directive ??
|
|
25
|
+
JSON.stringify(threads.director.stitches.slice(-1)[0]?.output),
|
|
26
|
+
].join('\n'),
|
|
27
|
+
imagine: imagineViaOpenAI_1.imagineViaOpenAI,
|
|
28
|
+
deprompt: ({ promptOut, promptIn }) => ({
|
|
29
|
+
output: promptOut,
|
|
30
|
+
input: promptIn,
|
|
31
|
+
}),
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=stitcherCodeDiffImagine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stitcherCodeDiffImagine.js","sourceRoot":"","sources":["../../../src/__test_assets__/stitchers/stitcherCodeDiffImagine.ts"],"names":[],"mappings":";;;AAAA,gEAAoE;AAGpE,mFAGsD;AAEzC,QAAA,uBAAuB,GAAG,IAAI,8BAAiB,CAS1D;IACA,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,qBAAqB;IAC3B,QAAQ,EAAE,QAAQ;IAClB,MAAM,EAAE,6BAA6B;IACrC,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CACxB;QACE,6CAA6C;QAC7C,EAAE;QACF,kBAAkB;QAClB,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;QAC1C,EAAE;QACF,kBAAkB;QAClB,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;QAC1C,EAAE;QACF,uCAAuC;QACvC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,OAAO;QACpD,EAAE;QACF,uBAAuB;QACvB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS;YAChC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;KACjE,CAAC,IAAI,CAAC,IAAI,CAAC;IACd,OAAO,EAAE,mCAAgB;IACzB,QAAQ,EAAE,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;QACtC,MAAM,EAAE,SAAS;QACjB,KAAK,EAAE,QAAQ;KAChB,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Empty } from 'type-fns';
|
|
2
|
+
import { StitchStepCompute } from '../../domain/objects/StitchStep';
|
|
3
|
+
import { GStitcher } from '../../domain/objects/Stitcher';
|
|
4
|
+
import { Threads } from '../../domain/objects/Threads';
|
|
5
|
+
export declare const stitcherFanoutRandomSum: import("../..").StitchFanout<import("../../logic/weave/compose/GStitcherInferredFromFanout.generic").GStitcherInferredFromFanout<[StitchStepCompute<GStitcher<Threads<{
|
|
6
|
+
main: Empty;
|
|
7
|
+
}>, import("simple-log-methods").ContextLogTrail & import("../../logic/stitch/withStitchTrail").ContextStitchTrail, number>>, StitchStepCompute<GStitcher<Threads<{
|
|
8
|
+
main: Empty;
|
|
9
|
+
}>, import("simple-log-methods").ContextLogTrail & import("../../logic/stitch/withStitchTrail").ContextStitchTrail, number>>, StitchStepCompute<GStitcher<Threads<{
|
|
10
|
+
main: Empty;
|
|
11
|
+
}>, import("simple-log-methods").ContextLogTrail & import("../../logic/stitch/withStitchTrail").ContextStitchTrail, number>>], StitchStepCompute<GStitcher<Threads<{
|
|
12
|
+
main: Empty;
|
|
13
|
+
}, "multiple">, import("simple-log-methods").ContextLogTrail & import("../../logic/stitch/withStitchTrail").ContextStitchTrail, number>>>>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stitcherFanoutRandomSum = void 0;
|
|
4
|
+
const StitchStep_1 = require("../../domain/objects/StitchStep");
|
|
5
|
+
const genStitchFanout_1 = require("../../logic/weave/compose/genStitchFanout");
|
|
6
|
+
const stitcherComputeRandom = new StitchStep_1.StitchStepCompute({
|
|
7
|
+
slug: `compute-random`,
|
|
8
|
+
form: 'COMPUTE',
|
|
9
|
+
readme: null,
|
|
10
|
+
stitchee: 'main',
|
|
11
|
+
invoke: () => ({
|
|
12
|
+
input: null,
|
|
13
|
+
output: Math.floor(Math.random() * 100),
|
|
14
|
+
}),
|
|
15
|
+
});
|
|
16
|
+
const stitcherAddAll = new StitchStep_1.StitchStepCompute({
|
|
17
|
+
slug: 'sum-up',
|
|
18
|
+
form: 'COMPUTE',
|
|
19
|
+
readme: null,
|
|
20
|
+
stitchee: 'main',
|
|
21
|
+
invoke: ({ threads }) => {
|
|
22
|
+
const numbers = threads.main.peers.map((t) => {
|
|
23
|
+
const last = t.stitches.at(-1);
|
|
24
|
+
if (!last)
|
|
25
|
+
throw new Error('Missing stitch on thread');
|
|
26
|
+
return last.output;
|
|
27
|
+
});
|
|
28
|
+
const sum = numbers.reduce((a, b) => a + b, 0);
|
|
29
|
+
return {
|
|
30
|
+
input: numbers,
|
|
31
|
+
output: sum,
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
exports.stitcherFanoutRandomSum = (0, genStitchFanout_1.genStitchFanout)({
|
|
36
|
+
slug: 'random:x5:sum',
|
|
37
|
+
readme: null,
|
|
38
|
+
parallels: [
|
|
39
|
+
stitcherComputeRandom,
|
|
40
|
+
stitcherComputeRandom,
|
|
41
|
+
stitcherComputeRandom,
|
|
42
|
+
],
|
|
43
|
+
concluder: stitcherAddAll,
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=stitcherFanoutRandomSum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stitcherFanoutRandomSum.js","sourceRoot":"","sources":["../../../src/__test_assets__/stitchers/stitcherFanoutRandomSum.ts"],"names":[],"mappings":";;;AAEA,gEAAoE;AAGpE,+EAA4E;AAE5E,MAAM,qBAAqB,GAAG,IAAI,8BAAiB,CAEjD;IACA,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,MAAM;IAChB,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;QACb,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC;KACxC,CAAC;CACH,CAAC,CAAC;AAEH,MAAM,cAAc,GAAG,IAAI,8BAAiB,CAE1C;IACA,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,MAAM;IAChB,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;QACtB,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YAC3C,MAAM,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;YAC/B,IAAI,CAAC,IAAI;gBAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;YACvD,OAAO,IAAI,CAAC,MAAgB,CAAC;QAC/B,CAAC,CAAC,CAAC;QAEH,MAAM,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QAE/C,OAAO;YACL,KAAK,EAAE,OAAO;YACd,MAAM,EAAE,GAAG;SACZ,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEU,QAAA,uBAAuB,GAAG,IAAA,iCAAe,EAAC;IACrD,IAAI,EAAE,eAAe;IACrB,MAAM,EAAE,IAAI;IACZ,SAAS,EAAE;QACT,qBAAqB;QACrB,qBAAqB;QACrB,qBAAqB;KACtB;IACD,SAAS,EAAE,cAAc;CAC1B,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Empty } from 'type-fns';
|
|
2
|
+
import { StitchStepCompute } from '../../domain/objects/StitchStep';
|
|
3
|
+
import { GStitcher } from '../../domain/objects/Stitcher';
|
|
4
|
+
import { Threads } from '../../domain/objects/Threads';
|
|
5
|
+
export declare const stitcherFanoutWithRoutes: import("../..").StitchFanout<import("../../logic/weave/compose/GStitcherInferredFromFanout.generic").GStitcherInferredFromFanout<readonly [import("../../domain/objects/Stitcher").Stitcher<GStitcher<Threads<{
|
|
6
|
+
main: import("../../domain/objects/Threads").ThreadContextRole<"main">;
|
|
7
|
+
}, "single">, {
|
|
8
|
+
log: import("simple-log-methods").LogMethods & {
|
|
9
|
+
_orig?: import("simple-log-methods").LogMethods | undefined;
|
|
10
|
+
} & {
|
|
11
|
+
trail?: import("simple-log-methods").LogTrail | undefined;
|
|
12
|
+
};
|
|
13
|
+
stitch: {
|
|
14
|
+
trail: import("../..").StitchTrail;
|
|
15
|
+
};
|
|
16
|
+
} & import("simple-log-methods").ContextLogTrail & import("../../logic/stitch/withStitchTrail").ContextStitchTrail, number>>, import("../../domain/objects/Stitcher").Stitcher<GStitcher<Threads<{
|
|
17
|
+
main: import("../../domain/objects/Threads").ThreadContextRole<"main">;
|
|
18
|
+
}, "single">, {
|
|
19
|
+
log: import("simple-log-methods").LogMethods & {
|
|
20
|
+
_orig?: import("simple-log-methods").LogMethods | undefined;
|
|
21
|
+
} & {
|
|
22
|
+
trail?: import("simple-log-methods").LogTrail | undefined;
|
|
23
|
+
};
|
|
24
|
+
stitch: {
|
|
25
|
+
trail: import("../..").StitchTrail;
|
|
26
|
+
};
|
|
27
|
+
} & import("simple-log-methods").ContextLogTrail & import("../../logic/stitch/withStitchTrail").ContextStitchTrail, number>>], StitchStepCompute<GStitcher<Threads<{
|
|
28
|
+
main: Empty;
|
|
29
|
+
}, "multiple">, import("simple-log-methods").ContextLogTrail & import("../../logic/stitch/withStitchTrail").ContextStitchTrail, number>>>>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stitcherFanoutWithRoutes = void 0;
|
|
4
|
+
const StitchStep_1 = require("../../domain/objects/StitchStep");
|
|
5
|
+
const asStitcher_1 = require("../../logic/weave/compose/asStitcher");
|
|
6
|
+
const genStitchFanout_1 = require("../../logic/weave/compose/genStitchFanout");
|
|
7
|
+
const genStitchRoute_1 = require("../../logic/weave/compose/genStitchRoute");
|
|
8
|
+
const stepAdd1 = new StitchStep_1.StitchStepCompute({
|
|
9
|
+
slug: 'add-1',
|
|
10
|
+
form: 'COMPUTE',
|
|
11
|
+
readme: null,
|
|
12
|
+
stitchee: 'main',
|
|
13
|
+
invoke: ({ threads }) => {
|
|
14
|
+
const last = threads.main.stitches.at(-1)?.output;
|
|
15
|
+
const base = typeof last === 'number' ? last : 0;
|
|
16
|
+
return { input: base, output: base + 1 };
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
const stepAdd2 = new StitchStep_1.StitchStepCompute({
|
|
20
|
+
slug: 'add-2',
|
|
21
|
+
form: 'COMPUTE',
|
|
22
|
+
readme: null,
|
|
23
|
+
stitchee: 'main',
|
|
24
|
+
invoke: ({ threads }) => {
|
|
25
|
+
const last = threads.main.stitches.at(-1)?.output;
|
|
26
|
+
const base = typeof last === 'number' ? last : 0;
|
|
27
|
+
return { input: base, output: base + 2 };
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
const stepAdd3 = new StitchStep_1.StitchStepCompute({
|
|
31
|
+
slug: 'add-3',
|
|
32
|
+
form: 'COMPUTE',
|
|
33
|
+
readme: null,
|
|
34
|
+
stitchee: 'main',
|
|
35
|
+
invoke: ({ threads }) => {
|
|
36
|
+
const last = threads.main.stitches.at(-1)?.output;
|
|
37
|
+
const base = typeof last === 'number' ? last : 0;
|
|
38
|
+
return { input: base, output: base + 3 };
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
const route1 = (0, genStitchRoute_1.genStitchRoute)({
|
|
42
|
+
slug: 'route-1',
|
|
43
|
+
readme: null,
|
|
44
|
+
sequence: [stepAdd1, stepAdd2], // 1 + 2 = 3
|
|
45
|
+
});
|
|
46
|
+
const route2 = (0, genStitchRoute_1.genStitchRoute)({
|
|
47
|
+
slug: 'route-2',
|
|
48
|
+
readme: null,
|
|
49
|
+
sequence: [stepAdd1, stepAdd2, stepAdd3], // 1 + 2 + 3 = 6
|
|
50
|
+
});
|
|
51
|
+
const concluderSumRoutes = new StitchStep_1.StitchStepCompute({
|
|
52
|
+
slug: 'sum-routes',
|
|
53
|
+
form: 'COMPUTE',
|
|
54
|
+
readme: null,
|
|
55
|
+
stitchee: 'main',
|
|
56
|
+
invoke: ({ threads }) => {
|
|
57
|
+
console.log(JSON.stringify(threads, null, 2));
|
|
58
|
+
const outputs = threads.main.peers.map((t) => {
|
|
59
|
+
const last = t.stitches.at(-1);
|
|
60
|
+
if (!last)
|
|
61
|
+
throw new Error('Missing stitch');
|
|
62
|
+
return last.output;
|
|
63
|
+
});
|
|
64
|
+
return {
|
|
65
|
+
input: outputs,
|
|
66
|
+
output: outputs.reduce((a, b) => a + b, 0),
|
|
67
|
+
};
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
exports.stitcherFanoutWithRoutes = (0, genStitchFanout_1.genStitchFanout)({
|
|
71
|
+
slug: 'fanout-with-routes',
|
|
72
|
+
readme: 'parallel route of 2 steps and 3 steps',
|
|
73
|
+
parallels: [(0, asStitcher_1.asStitcher)(route1), (0, asStitcher_1.asStitcher)(route2)],
|
|
74
|
+
concluder: concluderSumRoutes,
|
|
75
|
+
});
|
|
76
|
+
//# sourceMappingURL=stitcherFanoutSubroutes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stitcherFanoutSubroutes.js","sourceRoot":"","sources":["../../../src/__test_assets__/stitchers/stitcherFanoutSubroutes.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Thread } from '../../domain/objects/Thread';
|
|
2
|
+
import { ThreadContextRole } from '../../domain/objects/Threads';
|
|
3
|
+
export declare const getExampleThreadCodeArtist: () => Promise<Thread<ThreadContextRole<'artist'> & {
|
|
4
|
+
tools: string[];
|
|
5
|
+
facts: string[];
|
|
6
|
+
}>>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getExampleThreadCodeArtist = void 0;
|
|
4
|
+
const getFile_1 = require("../../__nonpublished_modules__/file-fns/src/getFile");
|
|
5
|
+
const Thread_1 = require("../../domain/objects/Thread");
|
|
6
|
+
const directory_1 = require("../directory");
|
|
7
|
+
// todo: use enroleThread to add role context & apply role tools
|
|
8
|
+
const getExampleThreadCodeArtist = async () => new Thread_1.Thread({
|
|
9
|
+
context: {
|
|
10
|
+
role: 'artist',
|
|
11
|
+
tools: [
|
|
12
|
+
await (0, getFile_1.getFile)({
|
|
13
|
+
path: directory_1.directoryTestAssets +
|
|
14
|
+
'/context/tools/codeDiffViaConflictMarkers.tactic.md',
|
|
15
|
+
}),
|
|
16
|
+
],
|
|
17
|
+
facts: [
|
|
18
|
+
await (0, getFile_1.getFile)({
|
|
19
|
+
path: directory_1.directoryTestAssets + '/context/facts/codeEnvTypescript.scene.md',
|
|
20
|
+
}),
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
stitches: [], // no history yet, by default
|
|
24
|
+
});
|
|
25
|
+
exports.getExampleThreadCodeArtist = getExampleThreadCodeArtist;
|
|
26
|
+
//# sourceMappingURL=codeArtist.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codeArtist.js","sourceRoot":"","sources":["../../../src/__test_assets__/threads/codeArtist.ts"],"names":[],"mappings":";;;AAAA,iFAA8E;AAC9E,wDAAqD;AAErD,4CAAmD;AAEnD,gEAAgE;AACzD,MAAM,0BAA0B,GAAG,KAAK,IAE7C,EAAE,CACF,IAAI,eAAM,CAER;IACA,OAAO,EAAE;QACP,IAAI,EAAE,QAAiB;QACvB,KAAK,EAAE;YACL,MAAM,IAAA,iBAAO,EAAC;gBACZ,IAAI,EACF,+BAAmB;oBACnB,qDAAqD;aACxD,CAAC;SACH;QACD,KAAK,EAAE;YACL,MAAM,IAAA,iBAAO,EAAC;gBACZ,IAAI,EACF,+BAAmB,GAAG,2CAA2C;aACpE,CAAC;SACH;KACF;IACD,QAAQ,EAAE,EAAE,EAAE,6BAA6B;CAC5C,CAAC,CAAC;AAvBQ,QAAA,0BAA0B,8BAuBlC"}
|