rhachet 1.11.0 → 1.12.2
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/contract/cli/invoke.js +10 -1
- package/dist/contract/cli/invoke.js.map +1 -1
- package/dist/contract/cli/invokeAsk.d.ts +3 -3
- package/dist/contract/cli/invokeBriefs.d.ts +2 -2
- package/dist/contract/cli/invokeBriefsBoot.d.ts +1 -1
- package/dist/contract/cli/invokeBriefsBoot.js +2 -2
- package/dist/contract/cli/invokeBriefsBoot.js.map +1 -1
- package/dist/contract/cli/invokeBriefsLink.d.ts +2 -2
- package/dist/contract/cli/invokeBriefsLink.js +9 -47
- package/dist/contract/cli/invokeBriefsLink.js.map +1 -1
- package/dist/contract/cli/invokeChoose.d.ts +1 -1
- package/dist/contract/cli/invokeInit.d.ts +9 -0
- package/dist/contract/cli/invokeInit.js +57 -0
- package/dist/contract/cli/invokeInit.js.map +1 -0
- package/dist/contract/cli/invokeList.d.ts +2 -2
- package/dist/contract/cli/invokeReadme.d.ts +2 -2
- package/dist/contract/cli/invokeRoles.d.ts +2 -2
- package/dist/contract/cli/invokeRolesBoot.d.ts +1 -1
- package/dist/contract/cli/invokeRolesBoot.js +2 -2
- package/dist/contract/cli/invokeRolesBoot.js.map +1 -1
- package/dist/contract/cli/invokeRolesLink.d.ts +2 -2
- package/dist/contract/cli/invokeRolesLink.js +17 -96
- package/dist/contract/cli/invokeRolesLink.js.map +1 -1
- package/dist/contract/sdk.d.ts +13 -13
- package/dist/contract/sdk.js +25 -25
- package/dist/contract/sdk.js.map +1 -1
- package/dist/domain/constants.d.ts +3 -0
- package/dist/domain/constants.js +5 -0
- package/dist/domain/constants.js.map +1 -0
- package/dist/domain/objects/InvokeHooks.d.ts +1 -1
- package/dist/domain/objects/InvokeOpts.d.ts +1 -1
- package/dist/domain/objects/Role.d.ts +2 -2
- package/dist/domain/objects/RoleContext.d.ts +1 -1
- package/dist/domain/objects/RoleSkill.d.ts +2 -2
- package/dist/domain/objects/RoleSkillArgGetter.d.ts +3 -3
- package/dist/domain/objects/RoleTrait.d.ts +2 -2
- package/dist/domain/objects/Stitch.d.ts +4 -4
- package/dist/domain/objects/Stitch.js.map +1 -1
- package/dist/domain/objects/StitchChoice.d.ts +2 -2
- package/dist/domain/objects/StitchChoice.js.map +1 -1
- package/dist/domain/objects/StitchCycle.d.ts +4 -4
- package/dist/domain/objects/StitchCycle.js.map +1 -1
- package/dist/domain/objects/StitchFanout.d.ts +4 -4
- package/dist/domain/objects/StitchFanout.js.map +1 -1
- package/dist/domain/objects/StitchRoute.d.ts +1 -1
- package/dist/domain/objects/StitchRoute.js.map +1 -1
- package/dist/domain/objects/StitchSetEvent.d.ts +3 -3
- package/dist/domain/objects/StitchStep.d.ts +3 -3
- package/dist/domain/objects/Stitcher.d.ts +9 -9
- package/dist/domain/objects/Stitcher.js.map +1 -1
- package/dist/domain/objects/Template.d.ts +2 -2
- package/dist/domain/objects/Template.js.map +1 -1
- package/dist/domain/objects/Thread.d.ts +2 -2
- package/dist/domain/objects/Threads.d.ts +2 -2
- package/dist/domain/objects/Threads.js.map +1 -1
- package/dist/domain/objects/index.d.ts +2 -2
- package/dist/domain/objects/index.js +2 -2
- package/dist/domain/objects/index.js.map +1 -1
- package/dist/logic/context/genContextStitchTrail.d.ts +1 -1
- package/dist/logic/context/genContextStitchTrail.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/invoke/assureFindRole.d.ts +2 -2
- package/dist/logic/invoke/assureUniqueRoles.d.ts +1 -1
- package/dist/logic/invoke/getAgentReadmeTemplates.js +1 -1
- package/dist/logic/invoke/getInvokeHooksByOpts.d.ts +4 -3
- package/dist/logic/invoke/getInvokeHooksByOpts.js +11 -3
- package/dist/logic/invoke/getInvokeHooksByOpts.js.map +1 -1
- package/dist/logic/invoke/getRegistriesByOpts.d.ts +2 -2
- package/dist/logic/invoke/getSkillContext.d.ts +3 -3
- package/dist/logic/invoke/getSkillThreads.d.ts +4 -4
- package/dist/logic/invoke/hooks/onInvokeAskInput.d.ts +2 -2
- 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.d.ts +2 -2
- package/dist/logic/invoke/performInIsolatedThread.execute.d.ts +1 -1
- package/dist/logic/invoke/performInIsolatedThread.invoke.d.ts +2 -2
- package/dist/logic/invoke/performInIsolatedThread.invoke.js +3 -3
- package/dist/logic/invoke/performInIsolatedThread.invoke.js.map +1 -1
- package/dist/logic/invoke/performInIsolatedThreads.d.ts +1 -1
- package/dist/logic/role/addRoleTraits.d.ts +5 -5
- package/dist/logic/role/enrollThread.d.ts +4 -4
- package/dist/logic/role/genRoleSkill.d.ts +1 -1
- package/dist/logic/stitch/adapters/imagineViaOpenAI.d.ts +1 -1
- package/dist/logic/stitch/enstitch.d.ts +3 -3
- package/dist/logic/stitch/enstitch.js +1 -1
- package/dist/logic/stitch/enstitch.js.map +1 -1
- package/dist/logic/stitch/invokeImagineStitcher.d.ts +3 -3
- package/dist/logic/stitch/withStitchTrail.d.ts +4 -4
- package/dist/logic/stitch/withStitchTrail.js +1 -1
- package/dist/logic/stitch/withStitchTrail.js.map +1 -1
- package/dist/logic/template/genStepImagineViaTemplate.d.ts +2 -2
- package/dist/logic/template/genStepImagineViaTemplate.js.map +1 -1
- package/dist/logic/template/genTemplate.d.ts +3 -3
- package/dist/logic/template/getTemplatePathByCallerPath.d.ts +1 -1
- package/dist/logic/template/getTemplatePathByCallerPath.js +2 -2
- package/dist/logic/template/getTemplatePathByCallerPath.js.map +1 -1
- package/dist/logic/template/getTemplateValFromArtifacts.d.ts +2 -2
- package/dist/logic/template/getTemplateValFromArtifacts.js.map +1 -1
- package/dist/logic/template/getTemplateVarsFromInheritance.d.ts +1 -1
- package/dist/logic/template/useTemplate.d.ts +2 -2
- package/dist/logic/thread/getStitch.d.ts +1 -1
- package/dist/logic/weave/compose/GStitcherInferredFromChoice.generic.d.ts +3 -3
- package/dist/logic/weave/compose/GStitcherInferredFromCycle.generic.d.ts +4 -4
- package/dist/logic/weave/compose/GStitcherInferredFromFanout.generic.d.ts +6 -6
- package/dist/logic/weave/compose/GStitcherInferredFromRoute.generic.d.ts +4 -4
- package/dist/logic/weave/compose/ProcedureContextMerged.generic.d.ts +1 -1
- package/dist/logic/weave/compose/ThreadsMerged.generic.d.ts +4 -4
- package/dist/logic/weave/compose/asStitcher.d.ts +3 -3
- package/dist/logic/weave/compose/asStitcherFlat.d.ts +2 -2
- package/dist/logic/weave/compose/genStitchChoice.d.ts +3 -3
- package/dist/logic/weave/compose/genStitchCycle.d.ts +5 -5
- package/dist/logic/weave/compose/genStitchFanout.d.ts +5 -5
- package/dist/logic/weave/compose/genStitchFanout.js.map +1 -1
- package/dist/logic/weave/compose/genStitchRoute.d.ts +3 -3
- package/dist/logic/weave/compose/genStitchRoute.js.map +1 -1
- package/dist/logic/weave/enweaveOneChoice.d.ts +2 -2
- package/dist/logic/weave/enweaveOneChoice.js.map +1 -1
- package/dist/logic/weave/enweaveOneCycle.d.ts +2 -2
- package/dist/logic/weave/enweaveOneCycle.js.map +1 -1
- package/dist/logic/weave/enweaveOneFanout.d.ts +2 -2
- package/dist/logic/weave/enweaveOneFanout.js.map +1 -1
- package/dist/logic/weave/enweaveOneRoute.d.ts +2 -2
- package/dist/logic/weave/enweaveOneRoute.js.map +1 -1
- package/dist/logic/weave/enweaveOneStitcher.d.ts +2 -2
- package/dist/logic/weave/enweaveOneStitcher.js.map +1 -1
- package/license.md +21 -0
- package/package.json +36 -36
- package/dist/.test/directory.d.ts +0 -2
- package/dist/.test/directory.js +0 -6
- package/dist/.test/directory.js.map +0 -1
- package/dist/.test/example.use.repo/example.echoRegistry.d.ts +0 -2
- package/dist/.test/example.use.repo/example.echoRegistry.js +0 -108
- package/dist/.test/example.use.repo/example.echoRegistry.js.map +0 -1
- package/dist/.test/genContextLogTrail.d.ts +0 -2
- package/dist/.test/genContextLogTrail.js +0 -12
- package/dist/.test/genContextLogTrail.js.map +0 -1
- package/dist/.test/getContextOpenAI.d.ts +0 -2
- package/dist/.test/getContextOpenAI.js +0 -18
- package/dist/.test/getContextOpenAI.js.map +0 -1
- package/dist/.test/stitchers/genStitcherCodeFileRead.d.ts +0 -14
- package/dist/.test/stitchers/genStitcherCodeFileRead.js +0 -23
- package/dist/.test/stitchers/genStitcherCodeFileRead.js.map +0 -1
- package/dist/.test/stitchers/genStitcherCodeFileWrite.d.ts +0 -16
- package/dist/.test/stitchers/genStitcherCodeFileWrite.js +0 -29
- package/dist/.test/stitchers/genStitcherCodeFileWrite.js.map +0 -1
- package/dist/.test/stitchers/genStitcherCodeReviewImagine.d.ts +0 -15
- package/dist/.test/stitchers/genStitcherCodeReviewImagine.js +0 -97
- package/dist/.test/stitchers/genStitcherCodeReviewImagine.js.map +0 -1
- package/dist/.test/stitchers/stitcherCodeDiffImagine.d.ts +0 -13
- package/dist/.test/stitchers/stitcherCodeDiffImagine.js +0 -33
- package/dist/.test/stitchers/stitcherCodeDiffImagine.js.map +0 -1
- package/dist/.test/stitchers/stitcherFanoutRandomSum.d.ts +0 -13
- package/dist/.test/stitchers/stitcherFanoutRandomSum.js +0 -45
- package/dist/.test/stitchers/stitcherFanoutRandomSum.js.map +0 -1
- package/dist/.test/stitchers/stitcherFanoutSubroutes.d.ts +0 -35
- package/dist/.test/stitchers/stitcherFanoutSubroutes.js +0 -76
- package/dist/.test/stitchers/stitcherFanoutSubroutes.js.map +0 -1
- package/dist/.test/threads/codeArtist.d.ts +0 -6
- package/dist/.test/threads/codeArtist.js +0 -26
- package/dist/.test/threads/codeArtist.js.map +0 -1
- package/dist/.test/threads/codeCritic.d.ts +0 -6
- package/dist/.test/threads/codeCritic.js +0 -21
- package/dist/.test/threads/codeCritic.js.map +0 -1
- package/dist/.test/threads/director.d.ts +0 -6
- package/dist/.test/threads/director.js +0 -14
- package/dist/.test/threads/director.js.map +0 -1
- package/dist/contract/cli/invoke.integration.test.d.ts +0 -1
- package/dist/contract/cli/invoke.integration.test.js +0 -39
- package/dist/contract/cli/invoke.integration.test.js.map +0 -1
- package/dist/contract/cli/invokeAsk.integration.test.d.ts +0 -1
- package/dist/contract/cli/invokeAsk.integration.test.js +0 -69
- package/dist/contract/cli/invokeAsk.integration.test.js.map +0 -1
- package/dist/contract/cli/invokeBriefsBoot.integration.test.d.ts +0 -1
- package/dist/contract/cli/invokeBriefsBoot.integration.test.js +0 -159
- package/dist/contract/cli/invokeBriefsBoot.integration.test.js.map +0 -1
- package/dist/contract/cli/invokeBriefsLink.integration.test.d.ts +0 -1
- package/dist/contract/cli/invokeBriefsLink.integration.test.js +0 -97
- package/dist/contract/cli/invokeBriefsLink.integration.test.js.map +0 -1
- package/dist/contract/cli/invokeChoose.integration.test.d.ts +0 -1
- package/dist/contract/cli/invokeChoose.integration.test.js +0 -111
- package/dist/contract/cli/invokeChoose.integration.test.js.map +0 -1
- package/dist/contract/cli/invokeReadme.integration.test.d.ts +0 -1
- package/dist/contract/cli/invokeReadme.integration.test.js +0 -62
- package/dist/contract/cli/invokeReadme.integration.test.js.map +0 -1
- package/dist/domain/objects/InvokeOpts.test.d.ts +0 -1
- package/dist/domain/objects/InvokeOpts.test.js +0 -41
- package/dist/domain/objects/InvokeOpts.test.js.map +0 -1
- package/dist/domain/objects/Stitcher.test.d.ts +0 -1
- package/dist/domain/objects/Stitcher.test.js +0 -78
- package/dist/domain/objects/Stitcher.test.js.map +0 -1
- package/dist/domain/objects/Template.test.d.ts +0 -1
- package/dist/domain/objects/Template.test.js +0 -48
- package/dist/domain/objects/Template.test.js.map +0 -1
- package/dist/logic/invoke/addAttemptQualifierToOutputPath.test.d.ts +0 -1
- package/dist/logic/invoke/addAttemptQualifierToOutputPath.test.js +0 -130
- package/dist/logic/invoke/addAttemptQualifierToOutputPath.test.js.map +0 -1
- package/dist/logic/invoke/getPeerQualifiersOfOutputChoice.test.d.ts +0 -1
- package/dist/logic/invoke/getPeerQualifiersOfOutputChoice.test.js +0 -77
- package/dist/logic/invoke/getPeerQualifiersOfOutputChoice.test.js.map +0 -1
- package/dist/logic/invoke/getSkillContext.test.d.ts +0 -1
- package/dist/logic/invoke/getSkillContext.test.js +0 -85
- package/dist/logic/invoke/getSkillContext.test.js.map +0 -1
- package/dist/logic/invoke/getSkillThread.test.d.ts +0 -1
- package/dist/logic/invoke/getSkillThread.test.js +0 -115
- package/dist/logic/invoke/getSkillThread.test.js.map +0 -1
- package/dist/logic/invoke/performInIsolatedThread.invoke.integration.test.d.ts +0 -1
- package/dist/logic/invoke/performInIsolatedThread.invoke.integration.test.js +0 -74
- package/dist/logic/invoke/performInIsolatedThread.invoke.integration.test.js.map +0 -1
- package/dist/logic/invoke/performInIsolatedThreads.integration.test.d.ts +0 -1
- package/dist/logic/invoke/performInIsolatedThreads.integration.test.js +0 -75
- package/dist/logic/invoke/performInIsolatedThreads.integration.test.js.map +0 -1
- package/dist/logic/role/addRoleTraits.test.d.ts +0 -1
- package/dist/logic/role/addRoleTraits.test.js +0 -93
- package/dist/logic/role/addRoleTraits.test.js.map +0 -1
- package/dist/logic/role/enrollThread.integration.test.d.ts +0 -1
- package/dist/logic/role/enrollThread.integration.test.js +0 -79
- package/dist/logic/role/enrollThread.integration.test.js.map +0 -1
- package/dist/logic/role/genRoleSkill.test.d.ts +0 -1
- package/dist/logic/role/genRoleSkill.test.js +0 -79
- package/dist/logic/role/genRoleSkill.test.js.map +0 -1
- package/dist/logic/stitch/enstitch.test.d.ts +0 -1
- package/dist/logic/stitch/enstitch.test.js +0 -112
- package/dist/logic/stitch/enstitch.test.js.map +0 -1
- package/dist/logic/stitch/invokeImagineStitcher.integration.test.d.ts +0 -1
- package/dist/logic/stitch/invokeImagineStitcher.integration.test.js +0 -195
- package/dist/logic/stitch/invokeImagineStitcher.integration.test.js.map +0 -1
- package/dist/logic/template/genStepImagineViaTemplate.test.d.ts +0 -1
- package/dist/logic/template/genStepImagineViaTemplate.test.js +0 -126
- package/dist/logic/template/genStepImagineViaTemplate.test.js.map +0 -1
- package/dist/logic/template/genTemplate.test.d.ts +0 -1
- package/dist/logic/template/genTemplate.test.js +0 -118
- package/dist/logic/template/genTemplate.test.js.map +0 -1
- package/dist/logic/template/useTemplate.integration.test.d.ts +0 -1
- package/dist/logic/template/useTemplate.integration.test.js +0 -28
- package/dist/logic/template/useTemplate.integration.test.js.map +0 -1
- package/dist/logic/thread/getStitch.test.d.ts +0 -1
- package/dist/logic/thread/getStitch.test.js +0 -73
- package/dist/logic/thread/getStitch.test.js.map +0 -1
- package/dist/logic/weave/compose/GStitcherInferredFromChoice.generic.test.d.ts +0 -1
- package/dist/logic/weave/compose/GStitcherInferredFromChoice.generic.test.js +0 -67
- package/dist/logic/weave/compose/GStitcherInferredFromChoice.generic.test.js.map +0 -1
- package/dist/logic/weave/compose/GStitcherInferredFromCycle.generic.test.d.ts +0 -1
- package/dist/logic/weave/compose/GStitcherInferredFromCycle.generic.test.js +0 -132
- package/dist/logic/weave/compose/GStitcherInferredFromCycle.generic.test.js.map +0 -1
- package/dist/logic/weave/compose/GStitcherInferredFromFanout.generic.test.d.ts +0 -1
- package/dist/logic/weave/compose/GStitcherInferredFromFanout.generic.test.js +0 -74
- package/dist/logic/weave/compose/GStitcherInferredFromFanout.generic.test.js.map +0 -1
- package/dist/logic/weave/compose/GStitcherInferredFromRoute.generic.test.d.ts +0 -1
- package/dist/logic/weave/compose/GStitcherInferredFromRoute.generic.test.js +0 -190
- package/dist/logic/weave/compose/GStitcherInferredFromRoute.generic.test.js.map +0 -1
- package/dist/logic/weave/compose/ProcedureContextMerged.generic.test.d.ts +0 -1
- package/dist/logic/weave/compose/ProcedureContextMerged.generic.test.js +0 -29
- package/dist/logic/weave/compose/ProcedureContextMerged.generic.test.js.map +0 -1
- package/dist/logic/weave/compose/ThreadsMerged.generic.test.d.ts +0 -1
- package/dist/logic/weave/compose/ThreadsMerged.generic.test.js +0 -420
- package/dist/logic/weave/compose/ThreadsMerged.generic.test.js.map +0 -1
- package/dist/logic/weave/compose/asStitcher.test.d.ts +0 -1
- package/dist/logic/weave/compose/asStitcher.test.js +0 -95
- package/dist/logic/weave/compose/asStitcher.test.js.map +0 -1
- package/dist/logic/weave/compose/asStitcherFlat.test.d.ts +0 -1
- package/dist/logic/weave/compose/asStitcherFlat.test.js +0 -96
- package/dist/logic/weave/compose/asStitcherFlat.test.js.map +0 -1
- package/dist/logic/weave/compose/genStitchChoice.test.d.ts +0 -1
- package/dist/logic/weave/compose/genStitchChoice.test.js +0 -200
- package/dist/logic/weave/compose/genStitchChoice.test.js.map +0 -1
- package/dist/logic/weave/compose/genStitchCycle.test.d.ts +0 -1
- package/dist/logic/weave/compose/genStitchCycle.test.js +0 -267
- package/dist/logic/weave/compose/genStitchCycle.test.js.map +0 -1
- package/dist/logic/weave/compose/genStitchFanout.test.d.ts +0 -1
- package/dist/logic/weave/compose/genStitchFanout.test.js +0 -79
- package/dist/logic/weave/compose/genStitchFanout.test.js.map +0 -1
- package/dist/logic/weave/compose/genStitchRoute.test.d.ts +0 -1
- package/dist/logic/weave/compose/genStitchRoute.test.js +0 -120
- package/dist/logic/weave/compose/genStitchRoute.test.js.map +0 -1
- package/dist/logic/weave/enweaveOneChoice.test.d.ts +0 -1
- package/dist/logic/weave/enweaveOneChoice.test.js +0 -181
- package/dist/logic/weave/enweaveOneChoice.test.js.map +0 -1
- package/dist/logic/weave/enweaveOneCycle.test.d.ts +0 -1
- package/dist/logic/weave/enweaveOneCycle.test.js +0 -180
- package/dist/logic/weave/enweaveOneCycle.test.js.map +0 -1
- package/dist/logic/weave/enweaveOneFanout.integration.test.d.ts +0 -1
- package/dist/logic/weave/enweaveOneFanout.integration.test.js +0 -166
- package/dist/logic/weave/enweaveOneFanout.integration.test.js.map +0 -1
- package/dist/logic/weave/enweaveOneRoute.integration.test.d.ts +0 -1
- package/dist/logic/weave/enweaveOneRoute.integration.test.js +0 -159
- package/dist/logic/weave/enweaveOneRoute.integration.test.js.map +0 -1
- package/dist/logic/weave/enweaveOneStitcher.integration.test.d.ts +0 -2
- package/dist/logic/weave/enweaveOneStitcher.integration.test.js +0 -258
- package/dist/logic/weave/enweaveOneStitcher.integration.test.js.map +0 -1
|
@@ -1,420 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const test_fns_1 = require("test-fns");
|
|
4
|
-
const Thread_1 = require("../../../domain/objects/Thread");
|
|
5
|
-
const genThread_1 = require("../../thread/genThread");
|
|
6
|
-
describe('ThreadsMerged', () => {
|
|
7
|
-
const artistEmpty = new Thread_1.Thread({
|
|
8
|
-
context: { role: 'artist' },
|
|
9
|
-
stitches: [],
|
|
10
|
-
});
|
|
11
|
-
const criticEmpty = new Thread_1.Thread({
|
|
12
|
-
context: { role: 'critic' },
|
|
13
|
-
stitches: [],
|
|
14
|
-
});
|
|
15
|
-
const directorEmpty = new Thread_1.Thread({
|
|
16
|
-
context: { role: 'director' },
|
|
17
|
-
stitches: [],
|
|
18
|
-
});
|
|
19
|
-
const judgeEmpty = new Thread_1.Thread({
|
|
20
|
-
context: { role: 'judge' },
|
|
21
|
-
stitches: [],
|
|
22
|
-
});
|
|
23
|
-
const directorWithVision = new Thread_1.Thread({
|
|
24
|
-
context: {
|
|
25
|
-
role: 'director',
|
|
26
|
-
vision: 'denser habitats -> more nature',
|
|
27
|
-
},
|
|
28
|
-
stitches: [],
|
|
29
|
-
});
|
|
30
|
-
const artistWithSkills = new Thread_1.Thread({
|
|
31
|
-
context: { role: 'artist', skills: ['code:diff:conflictMarkers'] },
|
|
32
|
-
stitches: [],
|
|
33
|
-
});
|
|
34
|
-
(0, test_fns_1.given)('threads with the same exact role.names & role.contexts', () => {
|
|
35
|
-
const threadsA = {
|
|
36
|
-
artist: artistEmpty,
|
|
37
|
-
director: directorEmpty,
|
|
38
|
-
};
|
|
39
|
-
const threadsB = {
|
|
40
|
-
artist: artistEmpty,
|
|
41
|
-
director: directorEmpty,
|
|
42
|
-
};
|
|
43
|
-
(0, test_fns_1.then)('they should support correct instantiation', () => {
|
|
44
|
-
const threadsMerged = {
|
|
45
|
-
artist: artistEmpty,
|
|
46
|
-
director: directorEmpty,
|
|
47
|
-
};
|
|
48
|
-
expect(threadsMerged);
|
|
49
|
-
});
|
|
50
|
-
(0, test_fns_1.then)('they should complain at missed inputs', () => {
|
|
51
|
-
// @ts-expect-error: Property 'director' is missing in type '{ artist: Thread<ThreadContextRole<"artist">>; }' but required in type 'ThreadsMerged<[Threads<{ artist: Empty; director: Empty; }>, Threads<{ artist: Empty; director: Empty; }>]>'
|
|
52
|
-
const threadsMerged = {
|
|
53
|
-
artist: artistEmpty,
|
|
54
|
-
};
|
|
55
|
-
expect(threadsMerged);
|
|
56
|
-
});
|
|
57
|
-
(0, test_fns_1.then)('they should complain at incorrect inputs', () => {
|
|
58
|
-
const threadsMerged = {
|
|
59
|
-
artist: artistEmpty,
|
|
60
|
-
// @ts-expect-error: Type 'Thread<ThreadContextRole<"artist">>' is not assignable to type 'Thread<ThreadContextRole<"director">>'.
|
|
61
|
-
director: artistEmpty,
|
|
62
|
-
};
|
|
63
|
-
expect(threadsMerged);
|
|
64
|
-
});
|
|
65
|
-
(0, test_fns_1.then)('they should complain at unexpected inputs', () => {
|
|
66
|
-
const threadsMerged = {
|
|
67
|
-
artist: artistEmpty,
|
|
68
|
-
director: directorEmpty,
|
|
69
|
-
// @ts-expect-error: 'critic' does not exist in type 'ThreadsMerged<[Threads<{ artist: Empty; director: Empty; }>, Threads<{ artist: Empty; director: Empty; }>]>'
|
|
70
|
-
critic: criticEmpty,
|
|
71
|
-
};
|
|
72
|
-
expect(threadsMerged);
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
(0, test_fns_1.given)('threads with different roles, one is a superset', () => {
|
|
76
|
-
const threadsA = {
|
|
77
|
-
artist: artistEmpty,
|
|
78
|
-
};
|
|
79
|
-
const threadsB = {
|
|
80
|
-
artist: artistEmpty,
|
|
81
|
-
director: directorEmpty,
|
|
82
|
-
};
|
|
83
|
-
(0, test_fns_1.then)('they should support correct instantiation', () => {
|
|
84
|
-
const threadsMerged = {
|
|
85
|
-
artist: artistEmpty,
|
|
86
|
-
director: directorEmpty,
|
|
87
|
-
};
|
|
88
|
-
expect(threadsMerged);
|
|
89
|
-
});
|
|
90
|
-
(0, test_fns_1.then)('they should complain at missed inputs', () => {
|
|
91
|
-
// @ts-expect-error: Property 'director' is missing in type '{ artist: Thread<ThreadContextRole<"artist">>; }' but required in type 'ThreadsMerged<[Threads<{ artist: Empty; director: Empty; }>, Threads<{ artist: Empty; director: Empty; }>]>'
|
|
92
|
-
const threadsMerged = {
|
|
93
|
-
artist: artistEmpty,
|
|
94
|
-
};
|
|
95
|
-
expect(threadsMerged);
|
|
96
|
-
});
|
|
97
|
-
(0, test_fns_1.then)('they should complain at incorrect inputs', () => {
|
|
98
|
-
const threadsMerged = {
|
|
99
|
-
artist: artistEmpty,
|
|
100
|
-
// @ts-expect-error: Type 'Thread<ThreadContextRole<"artist">>' is not assignable to type 'Thread<ThreadContextRole<"director">>'.
|
|
101
|
-
director: threadsA.artist,
|
|
102
|
-
};
|
|
103
|
-
expect(threadsMerged);
|
|
104
|
-
});
|
|
105
|
-
(0, test_fns_1.then)('they should complain at unexpected inputs', () => {
|
|
106
|
-
const threadsMerged = {
|
|
107
|
-
artist: artistEmpty,
|
|
108
|
-
director: directorEmpty,
|
|
109
|
-
// @ts-expect-error: 'judge' does not exist in type ...
|
|
110
|
-
judge: judgeEmpty,
|
|
111
|
-
};
|
|
112
|
-
expect(threadsMerged);
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
(0, test_fns_1.given)('threads with different roles, partial overlap', () => {
|
|
116
|
-
const threadsA = {
|
|
117
|
-
artist: artistEmpty,
|
|
118
|
-
critic: criticEmpty,
|
|
119
|
-
};
|
|
120
|
-
const threadsB = {
|
|
121
|
-
artist: artistEmpty,
|
|
122
|
-
director: directorEmpty,
|
|
123
|
-
};
|
|
124
|
-
(0, test_fns_1.then)('they should support correct instantiation', () => {
|
|
125
|
-
const threadsMerged = {
|
|
126
|
-
artist: artistEmpty,
|
|
127
|
-
critic: criticEmpty,
|
|
128
|
-
director: directorEmpty,
|
|
129
|
-
};
|
|
130
|
-
expect(threadsMerged);
|
|
131
|
-
});
|
|
132
|
-
(0, test_fns_1.then)('they should complain at missed inputs', () => {
|
|
133
|
-
// @ts-expect-error: Property 'director' is missing in type '{ artist: Thread<ThreadContextRole<"artist">>; }' but required in type 'ThreadsMerged<[Threads<{ artist: Empty; director: Empty; }>, Threads<{ artist: Empty; director: Empty; }>]>'
|
|
134
|
-
const threadsMerged = {
|
|
135
|
-
artist: artistEmpty,
|
|
136
|
-
critic: criticEmpty,
|
|
137
|
-
};
|
|
138
|
-
expect(threadsMerged);
|
|
139
|
-
});
|
|
140
|
-
(0, test_fns_1.then)('they should complain at incorrect inputs', () => {
|
|
141
|
-
const threadsMerged = {
|
|
142
|
-
artist: artistEmpty,
|
|
143
|
-
critic: criticEmpty,
|
|
144
|
-
// @ts-expect-error: Type 'Thread<ThreadContextRole<"artist">>' is not assignable to type 'Thread<ThreadContextRole<"director">>'.
|
|
145
|
-
director: artistEmpty,
|
|
146
|
-
};
|
|
147
|
-
expect(threadsMerged);
|
|
148
|
-
});
|
|
149
|
-
(0, test_fns_1.then)('they should complain at unexpected inputs', () => {
|
|
150
|
-
const threadsMerged = {
|
|
151
|
-
artist: artistEmpty,
|
|
152
|
-
director: directorEmpty,
|
|
153
|
-
critic: criticEmpty,
|
|
154
|
-
// @ts-expect-error: 'judge' does not exist in type ...
|
|
155
|
-
judge: judgeEmpty,
|
|
156
|
-
};
|
|
157
|
-
expect(threadsMerged);
|
|
158
|
-
});
|
|
159
|
-
});
|
|
160
|
-
(0, test_fns_1.given)('threads with different roles, no overlap', () => {
|
|
161
|
-
const threadsA = {
|
|
162
|
-
artist: artistEmpty,
|
|
163
|
-
};
|
|
164
|
-
const threadsB = {
|
|
165
|
-
director: directorEmpty,
|
|
166
|
-
};
|
|
167
|
-
(0, test_fns_1.then)('they should support correct instantiation', () => {
|
|
168
|
-
const threadsMerged = {
|
|
169
|
-
artist: artistEmpty,
|
|
170
|
-
director: directorEmpty,
|
|
171
|
-
};
|
|
172
|
-
expect(threadsMerged);
|
|
173
|
-
});
|
|
174
|
-
(0, test_fns_1.then)('they should complain at missed inputs', () => {
|
|
175
|
-
// @ts-expect-error: Property 'director' is missing in type '{ artist: Thread<ThreadContextRole<"artist">>; }' but required in type 'ThreadsMerged<[Threads<{ artist: Empty; director: Empty; }>, Threads<{ artist: Empty; director: Empty; }>]>'
|
|
176
|
-
const threadsMerged = {
|
|
177
|
-
artist: artistEmpty,
|
|
178
|
-
};
|
|
179
|
-
expect(threadsMerged);
|
|
180
|
-
});
|
|
181
|
-
(0, test_fns_1.then)('they should complain at incorrect inputs', () => {
|
|
182
|
-
const threadsMerged = {
|
|
183
|
-
artist: artistEmpty,
|
|
184
|
-
// @ts-expect-error: Type 'Thread<ThreadContextRole<"artist">>' is not assignable to type 'Thread<ThreadContextRole<"director">>'.
|
|
185
|
-
director: threadsA.artist,
|
|
186
|
-
};
|
|
187
|
-
expect(threadsMerged);
|
|
188
|
-
});
|
|
189
|
-
(0, test_fns_1.then)('they should complain at unexpected inputs', () => {
|
|
190
|
-
const threadsMerged = {
|
|
191
|
-
artist: artistEmpty,
|
|
192
|
-
director: directorEmpty,
|
|
193
|
-
// @ts-expect-error: 'critic' does not exist in type ...
|
|
194
|
-
critic: criticEmpty,
|
|
195
|
-
};
|
|
196
|
-
expect(threadsMerged);
|
|
197
|
-
});
|
|
198
|
-
});
|
|
199
|
-
(0, test_fns_1.given)('threads with the same exact role.names & role.contexts, but the contexts are extended', () => {
|
|
200
|
-
const threadsA = {
|
|
201
|
-
artist: artistWithSkills,
|
|
202
|
-
};
|
|
203
|
-
const threadsB = {
|
|
204
|
-
artist: artistWithSkills,
|
|
205
|
-
};
|
|
206
|
-
(0, test_fns_1.then)('they should support correct instantiation', () => {
|
|
207
|
-
const threadsMerged = {
|
|
208
|
-
artist: artistWithSkills,
|
|
209
|
-
};
|
|
210
|
-
expect(threadsMerged);
|
|
211
|
-
});
|
|
212
|
-
(0, test_fns_1.then)('they should complain at missed inputs', () => {
|
|
213
|
-
// @ts-expect-error: Property 'artist' is missing in type ...
|
|
214
|
-
const threadsMerged = {};
|
|
215
|
-
expect(threadsMerged);
|
|
216
|
-
});
|
|
217
|
-
(0, test_fns_1.then)('they should complain at incorrect inputs', () => {
|
|
218
|
-
const threadsMerged = {
|
|
219
|
-
// @ts-expect-error: Property 'skills' is missing in type '{ role: "artist"; }' but required in type ...
|
|
220
|
-
artist: artistEmpty,
|
|
221
|
-
};
|
|
222
|
-
expect(threadsMerged);
|
|
223
|
-
});
|
|
224
|
-
(0, test_fns_1.then)('they should complain at unexpected inputs', () => {
|
|
225
|
-
const threadsMerged = {
|
|
226
|
-
artist: artistWithSkills,
|
|
227
|
-
// @ts-expect-error: 'critic' does not exist in type ...
|
|
228
|
-
critic: criticEmpty,
|
|
229
|
-
};
|
|
230
|
-
expect(threadsMerged);
|
|
231
|
-
});
|
|
232
|
-
});
|
|
233
|
-
(0, test_fns_1.given)('threads with the one same exact role.names, but different role.contexts', () => {
|
|
234
|
-
const threadsA = {
|
|
235
|
-
artist: artistEmpty,
|
|
236
|
-
};
|
|
237
|
-
const threadsB = {
|
|
238
|
-
artist: artistWithSkills,
|
|
239
|
-
};
|
|
240
|
-
(0, test_fns_1.then)('they should support correct instantiation', () => {
|
|
241
|
-
const threadsMerged = {
|
|
242
|
-
artist: artistWithSkills,
|
|
243
|
-
};
|
|
244
|
-
expect(threadsMerged);
|
|
245
|
-
});
|
|
246
|
-
(0, test_fns_1.then)('they should complain at missed inputs', () => {
|
|
247
|
-
// @ts-expect-error: Property 'artist' is missing in type ...
|
|
248
|
-
const threadsMerged = {};
|
|
249
|
-
expect(threadsMerged);
|
|
250
|
-
});
|
|
251
|
-
(0, test_fns_1.then)('they should complain at incorrect inputs', { because: 'it should demand the superset context: artistWithSkills' }, () => {
|
|
252
|
-
const threadsMerged = {
|
|
253
|
-
// @ts-expect-error: Property 'skills' is missing in type '{ role: "artist"; }' but required in type ...
|
|
254
|
-
artist: artistEmpty,
|
|
255
|
-
};
|
|
256
|
-
expect(threadsMerged);
|
|
257
|
-
});
|
|
258
|
-
(0, test_fns_1.then)('they should complain at unexpected inputs', () => {
|
|
259
|
-
const threadsMerged = {
|
|
260
|
-
artist: artistWithSkills,
|
|
261
|
-
// @ts-expect-error: 'critic' does not exist in type ...
|
|
262
|
-
critic: criticEmpty,
|
|
263
|
-
};
|
|
264
|
-
expect(threadsMerged);
|
|
265
|
-
});
|
|
266
|
-
});
|
|
267
|
-
(0, test_fns_1.given)('threads with the same exact role.names, but different role.contexts', () => {
|
|
268
|
-
const threadsA = {
|
|
269
|
-
artist: artistEmpty,
|
|
270
|
-
director: directorWithVision,
|
|
271
|
-
};
|
|
272
|
-
const threadsB = {
|
|
273
|
-
artist: artistWithSkills,
|
|
274
|
-
director: directorEmpty,
|
|
275
|
-
};
|
|
276
|
-
(0, test_fns_1.then)('they should support correct instantiation', () => {
|
|
277
|
-
const threadsMerged = {
|
|
278
|
-
artist: artistWithSkills,
|
|
279
|
-
director: directorWithVision,
|
|
280
|
-
};
|
|
281
|
-
expect(threadsMerged);
|
|
282
|
-
});
|
|
283
|
-
(0, test_fns_1.then)('they should complain at missed inputs', () => {
|
|
284
|
-
// @ts-expect-error: Property 'director' is missing in type '{ artist: Thread<ThreadContextRole<"artist">>; }' but required in type 'ThreadsMerged<[Threads<{ artist: Empty; director: Empty; }>, Threads<{ artist: Empty; director: Empty; }>]>'
|
|
285
|
-
const threadsMerged = {
|
|
286
|
-
artist: artistWithSkills,
|
|
287
|
-
};
|
|
288
|
-
expect(threadsMerged);
|
|
289
|
-
});
|
|
290
|
-
(0, test_fns_1.then)('they should complain at incorrect input.roles', () => {
|
|
291
|
-
const threadsMerged = {
|
|
292
|
-
artist: artistWithSkills,
|
|
293
|
-
// @ts-expect-error: Type 'Thread<ThreadContextRole<"artist">>' is not assignable to type 'Thread<ThreadContextRole<"director">>'.
|
|
294
|
-
director: artistWithSkills,
|
|
295
|
-
};
|
|
296
|
-
expect(threadsMerged);
|
|
297
|
-
});
|
|
298
|
-
(0, test_fns_1.then)('they should complain at incorrect input.contexts, 1', () => {
|
|
299
|
-
const threadsMerged = {
|
|
300
|
-
// @ts-expect-error: Property 'skills' is missing in type '{ role: "artist"; }'
|
|
301
|
-
artist: artistEmpty,
|
|
302
|
-
director: directorWithVision,
|
|
303
|
-
};
|
|
304
|
-
expect(threadsMerged);
|
|
305
|
-
});
|
|
306
|
-
(0, test_fns_1.then)('they should complain at incorrect input.contexts, 2', () => {
|
|
307
|
-
const threadsMerged = {
|
|
308
|
-
artist: artistWithSkills,
|
|
309
|
-
// @ts-expect-error: Property 'vision' is missing in type '{ role: "artist"; }'
|
|
310
|
-
director: directorEmpty,
|
|
311
|
-
};
|
|
312
|
-
expect(threadsMerged);
|
|
313
|
-
});
|
|
314
|
-
(0, test_fns_1.then)('they should complain at unexpected inputs', () => {
|
|
315
|
-
const threadsMerged = {
|
|
316
|
-
artist: artistWithSkills,
|
|
317
|
-
director: directorWithVision,
|
|
318
|
-
// @ts-expect-error: 'critic' does not exist in type 'ThreadsMerged<[Threads<{ artist: Empty; director: Empty; }>, Threads<{ artist: Empty; director: Empty; }>]>'
|
|
319
|
-
critic: criticEmpty,
|
|
320
|
-
};
|
|
321
|
-
expect(threadsMerged);
|
|
322
|
-
});
|
|
323
|
-
});
|
|
324
|
-
(0, test_fns_1.given)('three thread sets with overlap and disjoint roles', () => {
|
|
325
|
-
const threadsA = {
|
|
326
|
-
artist: artistWithSkills,
|
|
327
|
-
};
|
|
328
|
-
const threadsB = {
|
|
329
|
-
director: directorWithVision,
|
|
330
|
-
};
|
|
331
|
-
const threadsC = {
|
|
332
|
-
artist: artistWithSkills,
|
|
333
|
-
judge: judgeEmpty,
|
|
334
|
-
};
|
|
335
|
-
(0, test_fns_1.then)('they should support correct merged instantiation', () => {
|
|
336
|
-
const threadsMerged = {
|
|
337
|
-
artist: artistWithSkills,
|
|
338
|
-
director: directorWithVision,
|
|
339
|
-
judge: judgeEmpty,
|
|
340
|
-
};
|
|
341
|
-
expect(threadsMerged);
|
|
342
|
-
});
|
|
343
|
-
(0, test_fns_1.then)('they should complain at missed inputs', () => {
|
|
344
|
-
// @ts-expect-error: Property 'director' is missing
|
|
345
|
-
const threadsMerged = {
|
|
346
|
-
artist: artistWithSkills,
|
|
347
|
-
judge: judgeEmpty,
|
|
348
|
-
};
|
|
349
|
-
expect(threadsMerged);
|
|
350
|
-
});
|
|
351
|
-
});
|
|
352
|
-
(0, test_fns_1.given)('merger with one empty thread set', () => {
|
|
353
|
-
const threadsA = {};
|
|
354
|
-
const threadsB = {
|
|
355
|
-
artist: artistWithSkills,
|
|
356
|
-
};
|
|
357
|
-
(0, test_fns_1.then)('it should infer just the non-empty threads', () => {
|
|
358
|
-
const threadsMerged = {
|
|
359
|
-
artist: artistWithSkills,
|
|
360
|
-
};
|
|
361
|
-
expect(threadsMerged);
|
|
362
|
-
});
|
|
363
|
-
(0, test_fns_1.then)('it should fail if required threads are missing', () => {
|
|
364
|
-
// @ts-expect-error: Property 'artist' is missing
|
|
365
|
-
const threadsMerged = {};
|
|
366
|
-
expect(threadsMerged);
|
|
367
|
-
});
|
|
368
|
-
});
|
|
369
|
-
(0, test_fns_1.given)('threads with same role but conflicting context field types', () => {
|
|
370
|
-
const artistWithSkillStrings = new Thread_1.Thread({
|
|
371
|
-
context: { role: 'artist', skills: ['draw'] },
|
|
372
|
-
stitches: [],
|
|
373
|
-
});
|
|
374
|
-
const artistWithSkillNumbers = new Thread_1.Thread({
|
|
375
|
-
context: { role: 'artist', skills: [123] },
|
|
376
|
-
stitches: [],
|
|
377
|
-
});
|
|
378
|
-
const threadsA = {
|
|
379
|
-
artist: artistWithSkillStrings,
|
|
380
|
-
};
|
|
381
|
-
const threadsB = {
|
|
382
|
-
artist: artistWithSkillNumbers,
|
|
383
|
-
};
|
|
384
|
-
(0, test_fns_1.then)('they should error due to conflicting types, choice one', () => {
|
|
385
|
-
const threadsMerged = {
|
|
386
|
-
// @ts-expect-error: skills type conflict
|
|
387
|
-
artist: artistWithSkillStrings,
|
|
388
|
-
};
|
|
389
|
-
expect(threadsMerged);
|
|
390
|
-
});
|
|
391
|
-
(0, test_fns_1.then)('they should error due to conflicting types, choice two', () => {
|
|
392
|
-
const threadsMerged = {
|
|
393
|
-
// @ts-expect-error: skills type conflict
|
|
394
|
-
artist: artistWithSkillNumbers,
|
|
395
|
-
};
|
|
396
|
-
expect(threadsMerged);
|
|
397
|
-
});
|
|
398
|
-
});
|
|
399
|
-
(0, test_fns_1.given)('an array instead of a tuple input of threads', () => {
|
|
400
|
-
(0, test_fns_1.then)('it should fail fast and block the usage', () => {
|
|
401
|
-
// // @ts-expect-error: 'anything' does not exist in type 'ThreadsMerged<Threads<{ main: Empty; }>[]>'.
|
|
402
|
-
// const expectError: Merged = { anything: 'goes' };
|
|
403
|
-
// expect(expectError);
|
|
404
|
-
// // and this should succeed
|
|
405
|
-
// const expectSuccess: Merged = { main: genThread({ role: 'main' }) };
|
|
406
|
-
// expect(expectSuccess);
|
|
407
|
-
});
|
|
408
|
-
});
|
|
409
|
-
(0, test_fns_1.given)('an readonly tuple', () => {
|
|
410
|
-
(0, test_fns_1.then)('it should resolve the type strictly still', () => {
|
|
411
|
-
// @ts-expect-error: 'anything' does not exist in type 'ThreadsMerged<Threads<{ main: Empty; }>[]>'.
|
|
412
|
-
const expectError = { anything: 'goes' };
|
|
413
|
-
expect(expectError);
|
|
414
|
-
// and this should succeed
|
|
415
|
-
const expectSuccess = { main: (0, genThread_1.genThread)({ role: 'main' }) };
|
|
416
|
-
expect(expectSuccess);
|
|
417
|
-
});
|
|
418
|
-
});
|
|
419
|
-
});
|
|
420
|
-
//# sourceMappingURL=ThreadsMerged.generic.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ThreadsMerged.generic.test.js","sourceRoot":"","sources":["../../../../src/logic/weave/compose/ThreadsMerged.generic.test.ts"],"names":[],"mappings":";;AAAA,uCAAuC;AAGvC,2DAAwD;AAExD,sDAAmD;AAGnD,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,MAAM,WAAW,GAAG,IAAI,eAAM,CAAC;QAC7B,OAAO,EAAE,EAAE,IAAI,EAAE,QAAiB,EAAE;QACpC,QAAQ,EAAE,EAAE;KACb,CAAC,CAAC;IACH,MAAM,WAAW,GAAG,IAAI,eAAM,CAAC;QAC7B,OAAO,EAAE,EAAE,IAAI,EAAE,QAAiB,EAAE;QACpC,QAAQ,EAAE,EAAE;KACb,CAAC,CAAC;IACH,MAAM,aAAa,GAAG,IAAI,eAAM,CAAC;QAC/B,OAAO,EAAE,EAAE,IAAI,EAAE,UAAmB,EAAE;QACtC,QAAQ,EAAE,EAAE;KACb,CAAC,CAAC;IACH,MAAM,UAAU,GAAG,IAAI,eAAM,CAAC;QAC5B,OAAO,EAAE,EAAE,IAAI,EAAE,OAAgB,EAAE;QACnC,QAAQ,EAAE,EAAE;KACb,CAAC,CAAC;IAEH,MAAM,kBAAkB,GAAG,IAAI,eAAM,CAAC;QACpC,OAAO,EAAE;YACP,IAAI,EAAE,UAAmB;YACzB,MAAM,EAAE,gCAAgC;SACzC;QACD,QAAQ,EAAE,EA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E,GAAG,EAAE;YAClE,MAAM,aAAa,GAAsD;gBACvE,yCAAyC;gBACzC,MAAM,EAAE,sBAAsB;aAC/B,CAAC;YACF,MAAM,CAAC,aAAa,CAAC,CAAC;QACxB,CAAC,CAAC,CAAC;QACH,IAAA,eAAI,EAAC,wDAAwD,EAAE,GAAG,EAAE;YAClE,MAAM,aAAa,GAAsD;gBACvE,yCAAyC;gBACzC,MAAM,EAAE,sBAAsB;aAC/B,CAAC;YACF,MAAM,CAAC,aAAa,CAAC,CAAC;QACxB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAA,gBAAK,EAAC,8CAA8C,EAAE,GAAG,EAAE;QACzD,IAAA,eAAI,EAAC,yCAAyC,EAAE,GAAG,EAAE;YASnD,wGAAwG;YACxG,oDAAoD;YACpD,uBAAuB;YAEvB,6BAA6B;YAC7B,uEAAuE;YACvE,yBAAyB;QAC3B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAA,gBAAK,EAAC,mBAAmB,EAAE,GAAG,EAAE;QAC9B,IAAA,eAAI,EAAC,2CAA2C,EAAE,GAAG,EAAE;YAYrD,qGAAqG;YACrG,MAAM,WAAW,GAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;YACjD,MAAM,CAAC,WAAW,CAAC,CAAC;YAEpB,0BAA0B;YAC1B,MAAM,aAAa,GAAW,EAAE,IAAI,EAAE,IAAA,qBAAS,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;YACpE,MAAM,CAAC,aAAa,CAAC,CAAC;QACxB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const test_fns_1 = require("test-fns");
|
|
4
|
-
const StitchStep_1 = require("../../../domain/objects/StitchStep");
|
|
5
|
-
const genThread_1 = require("../../thread/genThread");
|
|
6
|
-
const asStitcher_1 = require("./asStitcher");
|
|
7
|
-
const genStitchRoute_1 = require("./genStitchRoute");
|
|
8
|
-
describe('asStitcher type normalization', () => {
|
|
9
|
-
(0, test_fns_1.given)('a StitchStepCompute with basic threads and number output', () => {
|
|
10
|
-
const step = new StitchStep_1.StitchStepCompute({
|
|
11
|
-
slug: 'step',
|
|
12
|
-
readme: null,
|
|
13
|
-
form: 'COMPUTE',
|
|
14
|
-
stitchee: 'main',
|
|
15
|
-
invoke: () => ({ input: null, output: 42 }),
|
|
16
|
-
});
|
|
17
|
-
const stitcher = (0, asStitcher_1.asStitcher)(step);
|
|
18
|
-
(0, test_fns_1.then)('the thread type should be narrowly defined', () => {
|
|
19
|
-
const threads = {
|
|
20
|
-
main: (0, genThread_1.genThread)({ role: 'main' }),
|
|
21
|
-
// @ts-expect-error: bert does not exist
|
|
22
|
-
bert: (0, genThread_1.genThread)({ role: 'main' }),
|
|
23
|
-
};
|
|
24
|
-
expect(threads);
|
|
25
|
-
});
|
|
26
|
-
(0, test_fns_1.then)('it should preserve thread keys and force single fanin', () => {
|
|
27
|
-
const checkA = true;
|
|
28
|
-
const checkB = true;
|
|
29
|
-
expect(checkA);
|
|
30
|
-
expect(checkB);
|
|
31
|
-
});
|
|
32
|
-
(0, test_fns_1.then)('it should preserve context and output', () => {
|
|
33
|
-
const checkA = true;
|
|
34
|
-
const checkB = true;
|
|
35
|
-
expect(checkA);
|
|
36
|
-
expect(checkB);
|
|
37
|
-
});
|
|
38
|
-
(0, test_fns_1.then)('it should still be assignable to Stitcher<GStitcher>', () => {
|
|
39
|
-
const result = true;
|
|
40
|
-
expect(result);
|
|
41
|
-
});
|
|
42
|
-
(0, test_fns_1.then)('it should no longer exactly match the original', () => {
|
|
43
|
-
// @ts-expect-error: structural change after normalization
|
|
44
|
-
const exactMatch = true;
|
|
45
|
-
expect(exactMatch);
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
(0, test_fns_1.given)('a genStitchRoute that needs to be normalized for reuse', () => {
|
|
49
|
-
const step1 = new StitchStep_1.StitchStepCompute({
|
|
50
|
-
slug: 's1',
|
|
51
|
-
readme: null,
|
|
52
|
-
form: 'COMPUTE',
|
|
53
|
-
stitchee: 'main',
|
|
54
|
-
invoke: () => ({ input: null, output: 1 }),
|
|
55
|
-
});
|
|
56
|
-
const step2 = new StitchStep_1.StitchStepCompute({
|
|
57
|
-
slug: 's2',
|
|
58
|
-
readme: null,
|
|
59
|
-
form: 'COMPUTE',
|
|
60
|
-
stitchee: 'main',
|
|
61
|
-
invoke: () => ({ input: null, output: 2 }),
|
|
62
|
-
});
|
|
63
|
-
const route = (0, genStitchRoute_1.genStitchRoute)({
|
|
64
|
-
slug: 'route',
|
|
65
|
-
readme: null,
|
|
66
|
-
sequence: [step1, step2],
|
|
67
|
-
});
|
|
68
|
-
const stitcher = (0, asStitcher_1.asStitcher)(route);
|
|
69
|
-
(0, test_fns_1.then)('it should allow reuse in another route that expects single-threaded steps', () => {
|
|
70
|
-
const outer = (0, genStitchRoute_1.genStitchRoute)({
|
|
71
|
-
slug: 'outer',
|
|
72
|
-
readme: null,
|
|
73
|
-
sequence: [stitcher],
|
|
74
|
-
});
|
|
75
|
-
expect(outer.slug).toBe('outer');
|
|
76
|
-
expect(outer.sequence[0].slug).toBe('route');
|
|
77
|
-
});
|
|
78
|
-
(0, test_fns_1.then)('it should preserve thread structure', () => {
|
|
79
|
-
const checkA = true;
|
|
80
|
-
const checkB = true;
|
|
81
|
-
expect(checkA);
|
|
82
|
-
expect(checkB);
|
|
83
|
-
});
|
|
84
|
-
(0, test_fns_1.then)('it should be assignable to Stitcher<GStitcher>', () => {
|
|
85
|
-
const result = true;
|
|
86
|
-
expect(result);
|
|
87
|
-
});
|
|
88
|
-
(0, test_fns_1.then)('it should no longer match StitchRoute<T> exactly', () => {
|
|
89
|
-
// @ts-expect-error: nominal break due to generic rewrite
|
|
90
|
-
const exactMatch = true;
|
|
91
|
-
expect(exactMatch);
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
//# sourceMappingURL=asStitcher.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"asStitcher.test.js","sourceRoot":"","sources":["../../../../src/logic/weave/compose/asStitcher.test.ts"],"names":[],"mappings":";;AAAA,uCAAuC;AAIvC,mEAAuE;AAOvE,sDAAmD;AACnD,6CAA0C;AAC1C,qDAAkD;AAElD,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;IAC7C,IAAA,gBAAK,EAAC,0DAA0D,EAAE,GAAG,EAAE;QACrE,MAAM,IAAI,GAAG,IAAI,8BAAiB,CAEhC;YACA,IAAI,EAAE,MAAM;YACZ,MAAM,EAAE,IAAI;YACZ,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,MAAM;YAChB,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;SAC5C,CAAC,CAAC;QAEH,MAAM,QAAQ,GAAG,IAAA,uBAAU,EAAC,IAAI,CAAC,CAAC;QAElC,IAAA,eAAI,EAAC,4CAA4C,EAAE,GAAG,EAAE;YAItD,MAAM,OAAO,GAAe;gBAC1B,IAAI,EAAE,IAAA,qBAAS,EAAC,EAAE,IAAI,EAAE,MAAe,EAAE,CAAC;gBAE1C,wCAAwC;gBACxC,IAAI,EAAE,IAAA,qBAAS,EAAC,EAAE,IAAI,EAAE,MAAe,EAAE,CAAC;aAC3C,CAAC;YACF,MAAM,CAAC,OAAO,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;QAEH,IAAA,eAAI,EAAC,uDAAuD,EAAE,GAAG,EAAE;YASjE,MAAM,MAAM,GAAa,IAAI,CAAC;YAC9B,MAAM,MAAM,GAAY,IAAI,CAAC;YAC7B,MAAM,CAAC,MAAM,CAA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+0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const test_fns_1 = require("test-fns");
|
|
4
|
-
const StitchStep_1 = require("../../../domain/objects/StitchStep");
|
|
5
|
-
const asStitcherFlat_1 = require("./asStitcherFlat");
|
|
6
|
-
const genStitchRoute_1 = require("./genStitchRoute");
|
|
7
|
-
describe('asStitcherFlat (typed GStitcher version)', () => {
|
|
8
|
-
(0, test_fns_1.given)('a genStitchRoute that needs to be flattened and reused', () => {
|
|
9
|
-
const step1 = new StitchStep_1.StitchStepCompute({
|
|
10
|
-
slug: 's1',
|
|
11
|
-
readme: null,
|
|
12
|
-
form: 'COMPUTE',
|
|
13
|
-
stitchee: 'alpha',
|
|
14
|
-
invoke: () => ({ input: null, output: 'a' }),
|
|
15
|
-
});
|
|
16
|
-
const step2 = new StitchStep_1.StitchStepCompute({
|
|
17
|
-
slug: 's2',
|
|
18
|
-
readme: null,
|
|
19
|
-
form: 'COMPUTE',
|
|
20
|
-
stitchee: 'alpha',
|
|
21
|
-
invoke: () => ({ input: null, output: 'b' }),
|
|
22
|
-
});
|
|
23
|
-
const route = (0, genStitchRoute_1.genStitchRoute)({
|
|
24
|
-
slug: 'r1',
|
|
25
|
-
readme: null,
|
|
26
|
-
sequence: [step1, step2],
|
|
27
|
-
});
|
|
28
|
-
const stitcher = (0, asStitcherFlat_1.asStitcherFlat)(route);
|
|
29
|
-
(0, test_fns_1.then)('it should be assignable to the flattened form', () => {
|
|
30
|
-
const ok = stitcher;
|
|
31
|
-
expect(ok.slug).toBe('r1');
|
|
32
|
-
});
|
|
33
|
-
(0, test_fns_1.then)('it should have the expected thread structure', () => {
|
|
34
|
-
const single = true;
|
|
35
|
-
const has = true;
|
|
36
|
-
expect(single);
|
|
37
|
-
expect(has);
|
|
38
|
-
});
|
|
39
|
-
(0, test_fns_1.then)('it should preserve output and context types', () => {
|
|
40
|
-
const a = true;
|
|
41
|
-
const b = true;
|
|
42
|
-
expect(a);
|
|
43
|
-
expect(b);
|
|
44
|
-
});
|
|
45
|
-
(0, test_fns_1.then)('it should no longer exactly match the original route', () => {
|
|
46
|
-
// @ts-expect-error: not assignable anymore
|
|
47
|
-
const exact = true;
|
|
48
|
-
expect(exact);
|
|
49
|
-
});
|
|
50
|
-
(0, test_fns_1.then)('it should be usable in a route that expects flattened steps', () => {
|
|
51
|
-
const outer = (0, genStitchRoute_1.genStitchRoute)({
|
|
52
|
-
slug: 'outer',
|
|
53
|
-
readme: null,
|
|
54
|
-
sequence: [stitcher],
|
|
55
|
-
});
|
|
56
|
-
expect(outer.slug).toBe('outer');
|
|
57
|
-
expect(outer.sequence[0].slug).toBe('r1');
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
(0, test_fns_1.given)('a stitcher that does not match the given flat type', () => {
|
|
61
|
-
const wrongStep = new StitchStep_1.StitchStepCompute({
|
|
62
|
-
slug: 'fail',
|
|
63
|
-
readme: null,
|
|
64
|
-
form: 'COMPUTE',
|
|
65
|
-
stitchee: 'wrong',
|
|
66
|
-
invoke: () => ({ input: null, output: 123 }),
|
|
67
|
-
});
|
|
68
|
-
// @ts-expect-error: wrong thread role and output type
|
|
69
|
-
const bad = (0, asStitcherFlat_1.asStitcherFlat)(wrongStep);
|
|
70
|
-
expect(bad.slug).toBe('fail');
|
|
71
|
-
});
|
|
72
|
-
(0, test_fns_1.given)('flat can require more threads than the inferred stitcher needs', () => {
|
|
73
|
-
const needslittle = new StitchStep_1.StitchStepCompute({
|
|
74
|
-
slug: 'succeed-broader-thread-context',
|
|
75
|
-
readme: null,
|
|
76
|
-
form: 'COMPUTE',
|
|
77
|
-
stitchee: 'alpha',
|
|
78
|
-
invoke: () => ({ input: null, output: 'oops' }),
|
|
79
|
-
});
|
|
80
|
-
const overprovisioned = (0, asStitcherFlat_1.asStitcherFlat)(needslittle);
|
|
81
|
-
expect(overprovisioned.slug).toBe('succeed-broader-thread-context');
|
|
82
|
-
});
|
|
83
|
-
(0, test_fns_1.given)('flat cannot allow less threads than the inferred stitcher needs', () => {
|
|
84
|
-
const unsupported = new StitchStep_1.StitchStepCompute({
|
|
85
|
-
slug: 'fail-narrow-thread-context',
|
|
86
|
-
readme: null,
|
|
87
|
-
form: 'COMPUTE',
|
|
88
|
-
stitchee: 'alpha',
|
|
89
|
-
invoke: () => ({ input: null, output: 'oops' }),
|
|
90
|
-
});
|
|
91
|
-
// @ts-expect-error: Property 'tools' is missing in type 'ThreadContextRole<"alpha">' but required in type '{ tools: string[]; }'
|
|
92
|
-
const bad = (0, asStitcherFlat_1.asStitcherFlat)(unsupported);
|
|
93
|
-
expect(bad.slug).toBe('fail-narrow-thread-context');
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
//# sourceMappingURL=asStitcherFlat.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"asStitcherFlat.test.js","sourceRoot":"","sources":["../../../../src/logic/weave/compose/asStitcherFlat.test.ts"],"names":[],"mappings":";;AAAA,uCAAuC;AAIvC,mEAAuE;AAOvE,qDAAkD;AAClD,qDAAkD;AAElD,QAAQ,CAAC,0CAA0C,EAAE,GAAG,EAAE;IACxD,IAAA,gBAAK,EAAC,wDAAwD,EAAE,GAAG,EAAE;QACnE,MAAM,KAAK,GAAG,IAAI,8BAAiB,CAEjC;YACA,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,IAAI;YACZ,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,OAAO;YACjB,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;SAC7C,CAAC,CAAC;QAEH,MAAM,KAAK,GAAG,IAAI,8BAAiB,CAEjC;YACA,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,IAAI;YACZ,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,OAAO;YACjB,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,EAA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