@agents-inc/cli 0.34.1 → 0.38.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/CHANGELOG.md +45 -0
- package/config/skills-matrix.yaml +26 -26
- package/config/stacks.yaml +8 -8
- package/dist/{chunk-HTTPKSL6.js → chunk-2XX4TMCI.js} +2 -2
- package/dist/{chunk-CEWNZQMH.js → chunk-3E2V5YL3.js} +8 -2
- package/dist/chunk-3E2V5YL3.js.map +1 -0
- package/dist/{chunk-QC37C32G.js → chunk-3NQJOJZL.js} +3 -3
- package/dist/chunk-54ZZCWN4.js +51 -0
- package/dist/chunk-54ZZCWN4.js.map +1 -0
- package/dist/{chunk-VEZ2GZEK.js → chunk-ATLRUR3B.js} +2 -2
- package/dist/{chunk-ZI5EBHCC.js → chunk-CYFU3ARY.js} +38 -17
- package/dist/chunk-CYFU3ARY.js.map +1 -0
- package/dist/{chunk-X7SPCWY6.js → chunk-DUQFF45G.js} +14 -9
- package/dist/chunk-DUQFF45G.js.map +1 -0
- package/dist/{chunk-CB7GYRUP.js → chunk-EISBUEBL.js} +101 -52
- package/dist/chunk-EISBUEBL.js.map +1 -0
- package/dist/chunk-EXFVAEPY.js +80 -0
- package/dist/chunk-EXFVAEPY.js.map +1 -0
- package/dist/{chunk-ANGAZ444.js → chunk-FWQK3HWB.js} +4 -4
- package/dist/chunk-FWQK3HWB.js.map +1 -0
- package/dist/{chunk-DC5AK3LW.js → chunk-GG4BSB6S.js} +5 -11
- package/dist/chunk-GG4BSB6S.js.map +1 -0
- package/dist/{chunk-GGHH3KR2.js → chunk-HKDE4LJW.js} +2 -2
- package/dist/{chunk-R3AD6XBJ.js → chunk-HRMQ2RGY.js} +81 -26
- package/dist/chunk-HRMQ2RGY.js.map +1 -0
- package/dist/{chunk-YPJKOM42.js → chunk-HRW7BIDE.js} +2 -2
- package/dist/{chunk-LFHZBF6N.js → chunk-IVIK776Y.js} +4 -3
- package/dist/chunk-IVIK776Y.js.map +1 -0
- package/dist/{chunk-ALS7SH7X.js → chunk-IWNPFIGY.js} +38 -48
- package/dist/chunk-IWNPFIGY.js.map +1 -0
- package/dist/{chunk-GIFEDW27.js → chunk-IZRVFC2Z.js} +7 -7
- package/dist/chunk-IZRVFC2Z.js.map +1 -0
- package/dist/chunk-K77I4XGL.js +47 -0
- package/dist/chunk-K77I4XGL.js.map +1 -0
- package/dist/{chunk-JMVWYAHT.js → chunk-KUV24B5M.js} +4 -4
- package/dist/chunk-KUV24B5M.js.map +1 -0
- package/dist/{chunk-KENWMEKN.js → chunk-M6PGIZNS.js} +6 -6
- package/dist/{chunk-B47QYIUL.js → chunk-NFV4SKH5.js} +4 -4
- package/dist/chunk-NI2RSNWB.js +156 -0
- package/dist/chunk-NI2RSNWB.js.map +1 -0
- package/dist/{chunk-ZP4BI6J2.js → chunk-OEX5JDQD.js} +7 -7
- package/dist/chunk-OEX5JDQD.js.map +1 -0
- package/dist/{chunk-OKILA27U.js → chunk-TA6IIQI4.js} +86 -99
- package/dist/chunk-TA6IIQI4.js.map +1 -0
- package/dist/{chunk-JZOLJVWA.js → chunk-TBDIR6LY.js} +12 -11
- package/dist/chunk-TBDIR6LY.js.map +1 -0
- package/dist/{chunk-XYCN2GCV.js → chunk-TNFACSWF.js} +3 -3
- package/dist/{chunk-ZE355C6C.js → chunk-TY5GELDB.js} +9 -4
- package/dist/chunk-TY5GELDB.js.map +1 -0
- package/dist/{chunk-TM4I4EHK.js → chunk-U5OB5ADP.js} +2829 -2793
- package/dist/chunk-U5OB5ADP.js.map +1 -0
- package/dist/{chunk-JXMRTHDT.js → chunk-UOMMQ5M6.js} +2 -2
- package/dist/{chunk-A5CYQQVG.js → chunk-UV6JUGIY.js} +2 -2
- package/dist/{chunk-5YNZJ5TP.js → chunk-VAHVSQIG.js} +2 -2
- package/dist/{chunk-TKB4O2RY.js → chunk-VAK5PX72.js} +5 -5
- package/dist/chunk-WSGGJKD5.js +113 -0
- package/dist/chunk-WSGGJKD5.js.map +1 -0
- package/dist/{chunk-GVMA2EKC.js → chunk-YHQNTBBN.js} +2 -2
- package/dist/{chunk-NLR6Z37M.js → chunk-YJIJTBSX.js} +81 -97
- package/dist/chunk-YJIJTBSX.js.map +1 -0
- package/dist/{chunk-YCS7GF6Y.js → chunk-ZBJQXDQN.js} +3 -1
- package/dist/{chunk-YCS7GF6Y.js.map → chunk-ZBJQXDQN.js.map} +1 -1
- package/dist/cli/defaults/agent-mappings.yaml +4 -4
- package/dist/commands/build/marketplace.js +3 -3
- package/dist/commands/build/plugins.js +5 -5
- package/dist/commands/build/stack.js +5 -5
- package/dist/commands/compile.js +25 -19
- package/dist/commands/compile.js.map +1 -1
- package/dist/commands/config/get.js +8 -8
- package/dist/commands/config/get.js.map +1 -1
- package/dist/commands/config/index.js +5 -5
- package/dist/commands/config/path.js +4 -4
- package/dist/commands/config/set-project.js +7 -7
- package/dist/commands/config/set-project.js.map +1 -1
- package/dist/commands/config/show.js +5 -5
- package/dist/commands/config/unset-project.js +5 -5
- package/dist/commands/config/unset-project.js.map +1 -1
- package/dist/commands/diff.js +8 -8
- package/dist/commands/diff.js.map +1 -1
- package/dist/commands/doctor.js +4 -4
- package/dist/commands/edit.js +37 -28
- package/dist/commands/edit.js.map +1 -1
- package/dist/commands/eject.js +6 -6
- package/dist/commands/eject.js.map +1 -1
- package/dist/commands/import/skill.js +16 -16
- package/dist/commands/import/skill.js.map +1 -1
- package/dist/commands/info.js +5 -5
- package/dist/commands/init.js +31 -26
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/list.js +4 -4
- package/dist/commands/new/agent.js +5 -5
- package/dist/commands/new/skill.js +8 -8
- package/dist/commands/new/skill.js.map +1 -1
- package/dist/commands/outdated.js +4 -4
- package/dist/commands/search.js +7 -7
- package/dist/commands/uninstall.js +181 -97
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.js +6 -6
- package/dist/commands/validate.js +5 -5
- package/dist/commands/version/bump.js +4 -4
- package/dist/commands/version/index.js +4 -4
- package/dist/commands/version/set.js +4 -4
- package/dist/commands/version/show.js +4 -4
- package/dist/components/skill-search/skill-search.js +3 -3
- package/dist/components/wizard/category-grid.js +3 -3
- package/dist/components/wizard/category-grid.test.js +42 -21
- package/dist/components/wizard/category-grid.test.js.map +1 -1
- package/dist/components/wizard/checkbox-grid.js +10 -0
- package/dist/components/wizard/checkbox-grid.test.js +260 -0
- package/dist/components/wizard/checkbox-grid.test.js.map +1 -0
- package/dist/components/wizard/domain-selection.js +7 -5
- package/dist/components/wizard/help-modal.js +2 -2
- package/dist/components/wizard/menu-item.js +2 -2
- package/dist/components/wizard/search-modal.js +3 -3
- package/dist/components/wizard/search-modal.test.js +3 -3
- package/dist/components/wizard/section-progress.js +2 -2
- package/dist/components/wizard/section-progress.test.js +2 -2
- package/dist/components/wizard/source-grid.js +5 -5
- package/dist/components/wizard/source-grid.test.js +5 -5
- package/dist/components/wizard/stack-selection.js +8 -7
- package/dist/components/wizard/step-agents.js +16 -0
- package/dist/components/wizard/step-agents.js.map +1 -0
- package/dist/components/wizard/step-agents.test.js +185 -0
- package/dist/components/wizard/step-agents.test.js.map +1 -0
- package/dist/components/wizard/step-build.js +9 -7
- package/dist/components/wizard/step-build.test.js +25 -22
- package/dist/components/wizard/step-build.test.js.map +1 -1
- package/dist/components/wizard/step-confirm.js +2 -2
- package/dist/components/wizard/step-confirm.test.js +6 -5
- package/dist/components/wizard/step-confirm.test.js.map +1 -1
- package/dist/components/wizard/step-refine.js +2 -2
- package/dist/components/wizard/step-refine.test.js +2 -2
- package/dist/components/wizard/step-settings.js +6 -6
- package/dist/components/wizard/step-settings.test.js +9 -9
- package/dist/components/wizard/step-sources.js +12 -10
- package/dist/components/wizard/step-sources.test.js +14 -12
- package/dist/components/wizard/step-sources.test.js.map +1 -1
- package/dist/components/wizard/step-stack.js +11 -9
- package/dist/components/wizard/step-stack.test.js +12 -10
- package/dist/components/wizard/step-stack.test.js.map +1 -1
- package/dist/components/wizard/view-title.js +2 -2
- package/dist/components/wizard/wizard-layout.js +8 -7
- package/dist/components/wizard/wizard-tabs.js +2 -2
- package/dist/components/wizard/wizard-tabs.test.js +6 -4
- package/dist/components/wizard/wizard-tabs.test.js.map +1 -1
- package/dist/components/wizard/wizard.js +27 -23
- package/dist/config/skills-matrix.yaml +26 -26
- package/dist/config/stacks.yaml +8 -8
- package/dist/hooks/init.js +5 -3
- package/dist/hooks/init.js.map +1 -1
- package/dist/{source-manager-WJYANKDI.js → source-manager-FEGVYDFZ.js} +4 -4
- package/dist/source-manager-FEGVYDFZ.js.map +1 -0
- package/dist/stores/wizard-store.js +5 -4
- package/dist/stores/wizard-store.test.js +287 -15
- package/dist/stores/wizard-store.test.js.map +1 -1
- package/package.json +1 -1
- package/src/schemas/agent.schema.json +3 -3
- package/src/schemas/metadata.schema.json +14 -14
- package/src/schemas/project-config.schema.json +46 -2
- package/src/schemas/project-source-config.schema.json +17 -5
- package/src/schemas/skills-matrix.schema.json +4 -4
- package/src/schemas/stack.schema.json +1 -1
- package/src/schemas/stacks.schema.json +42 -1
- package/dist/chunk-2LUXM5FB.js +0 -277
- package/dist/chunk-2LUXM5FB.js.map +0 -1
- package/dist/chunk-ALS7SH7X.js.map +0 -1
- package/dist/chunk-ANGAZ444.js.map +0 -1
- package/dist/chunk-CB7GYRUP.js.map +0 -1
- package/dist/chunk-CEWNZQMH.js.map +0 -1
- package/dist/chunk-DC5AK3LW.js.map +0 -1
- package/dist/chunk-GIFEDW27.js.map +0 -1
- package/dist/chunk-JMVWYAHT.js.map +0 -1
- package/dist/chunk-JZOLJVWA.js.map +0 -1
- package/dist/chunk-LFHZBF6N.js.map +0 -1
- package/dist/chunk-NLR6Z37M.js.map +0 -1
- package/dist/chunk-OKILA27U.js.map +0 -1
- package/dist/chunk-R3AD6XBJ.js.map +0 -1
- package/dist/chunk-TM4I4EHK.js.map +0 -1
- package/dist/chunk-X7SPCWY6.js.map +0 -1
- package/dist/chunk-ZE355C6C.js.map +0 -1
- package/dist/chunk-ZI5EBHCC.js.map +0 -1
- package/dist/chunk-ZP4BI6J2.js.map +0 -1
- /package/dist/{chunk-HTTPKSL6.js.map → chunk-2XX4TMCI.js.map} +0 -0
- /package/dist/{chunk-QC37C32G.js.map → chunk-3NQJOJZL.js.map} +0 -0
- /package/dist/{chunk-VEZ2GZEK.js.map → chunk-ATLRUR3B.js.map} +0 -0
- /package/dist/{chunk-GGHH3KR2.js.map → chunk-HKDE4LJW.js.map} +0 -0
- /package/dist/{chunk-YPJKOM42.js.map → chunk-HRW7BIDE.js.map} +0 -0
- /package/dist/{chunk-KENWMEKN.js.map → chunk-M6PGIZNS.js.map} +0 -0
- /package/dist/{chunk-B47QYIUL.js.map → chunk-NFV4SKH5.js.map} +0 -0
- /package/dist/{chunk-XYCN2GCV.js.map → chunk-TNFACSWF.js.map} +0 -0
- /package/dist/{chunk-JXMRTHDT.js.map → chunk-UOMMQ5M6.js.map} +0 -0
- /package/dist/{chunk-A5CYQQVG.js.map → chunk-UV6JUGIY.js.map} +0 -0
- /package/dist/{chunk-5YNZJ5TP.js.map → chunk-VAHVSQIG.js.map} +0 -0
- /package/dist/{chunk-TKB4O2RY.js.map → chunk-VAK5PX72.js.map} +0 -0
- /package/dist/{chunk-GVMA2EKC.js.map → chunk-YHQNTBBN.js.map} +0 -0
- /package/dist/{source-manager-WJYANKDI.js.map → components/wizard/checkbox-grid.js.map} +0 -0
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
createMockCategory
|
|
4
|
-
|
|
3
|
+
createMockCategory,
|
|
4
|
+
createMockMatrix,
|
|
5
|
+
createMockSkill
|
|
6
|
+
} from "../chunk-FWQK3HWB.js";
|
|
5
7
|
import {
|
|
8
|
+
afterEach,
|
|
6
9
|
beforeEach,
|
|
7
10
|
describe,
|
|
8
11
|
globalExpect,
|
|
@@ -10,13 +13,19 @@ import {
|
|
|
10
13
|
} from "../chunk-XY3XDVMI.js";
|
|
11
14
|
import {
|
|
12
15
|
useWizardStore
|
|
13
|
-
} from "../chunk-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import
|
|
16
|
-
|
|
16
|
+
} from "../chunk-HRMQ2RGY.js";
|
|
17
|
+
import "../chunk-WSGGJKD5.js";
|
|
18
|
+
import {
|
|
19
|
+
clearDefaultsCache,
|
|
20
|
+
loadDefaultMappings
|
|
21
|
+
} from "../chunk-U5OB5ADP.js";
|
|
22
|
+
import {
|
|
23
|
+
typedKeys
|
|
24
|
+
} from "../chunk-T4EXUIBY.js";
|
|
25
|
+
import "../chunk-YJIJTBSX.js";
|
|
17
26
|
import {
|
|
18
27
|
DEFAULT_PRESELECTED_SKILLS
|
|
19
|
-
} from "../chunk-
|
|
28
|
+
} from "../chunk-ZBJQXDQN.js";
|
|
20
29
|
import {
|
|
21
30
|
init_esm_shims
|
|
22
31
|
} from "../chunk-DHET7RCE.js";
|
|
@@ -261,11 +270,11 @@ describe("WizardStore", () => {
|
|
|
261
270
|
const { installMode } = useWizardStore.getState();
|
|
262
271
|
globalExpect(installMode).toBe("local");
|
|
263
272
|
});
|
|
264
|
-
it("should toggle show
|
|
273
|
+
it("should toggle show labels", () => {
|
|
265
274
|
const store = useWizardStore.getState();
|
|
266
|
-
store.
|
|
267
|
-
const {
|
|
268
|
-
globalExpect(
|
|
275
|
+
store.toggleShowLabels();
|
|
276
|
+
const { showLabels } = useWizardStore.getState();
|
|
277
|
+
globalExpect(showLabels).toBe(true);
|
|
269
278
|
});
|
|
270
279
|
it("should toggle help on", () => {
|
|
271
280
|
const store = useWizardStore.getState();
|
|
@@ -431,7 +440,7 @@ describe("WizardStore", () => {
|
|
|
431
440
|
categories: {
|
|
432
441
|
"error-handling": createMockCategory("error-handling", "Error Handling", {
|
|
433
442
|
domain: "web-extras",
|
|
434
|
-
|
|
443
|
+
parentDomain: "web",
|
|
435
444
|
exclusive: false
|
|
436
445
|
}),
|
|
437
446
|
framework: createMockCategory("framework", "Framework", {
|
|
@@ -446,7 +455,7 @@ describe("WizardStore", () => {
|
|
|
446
455
|
})
|
|
447
456
|
}
|
|
448
457
|
};
|
|
449
|
-
it("should find parent domain for a domain with
|
|
458
|
+
it("should find parent domain for a domain with parentDomain", () => {
|
|
450
459
|
const store = useWizardStore.getState();
|
|
451
460
|
const parent = store.getParentDomain(
|
|
452
461
|
"web-extras",
|
|
@@ -454,7 +463,7 @@ describe("WizardStore", () => {
|
|
|
454
463
|
);
|
|
455
464
|
globalExpect(parent).toBe("web");
|
|
456
465
|
});
|
|
457
|
-
it("should return undefined for a domain without
|
|
466
|
+
it("should return undefined for a domain without parentDomain", () => {
|
|
458
467
|
const store = useWizardStore.getState();
|
|
459
468
|
const parent = store.getParentDomain("web", matrixWithoutParent);
|
|
460
469
|
globalExpect(parent).toBeUndefined();
|
|
@@ -556,7 +565,7 @@ describe("WizardStore", () => {
|
|
|
556
565
|
};
|
|
557
566
|
store.populateFromStack(stack, categories);
|
|
558
567
|
const { domainSelections } = useWizardStore.getState();
|
|
559
|
-
globalExpect(
|
|
568
|
+
globalExpect(typedKeys(domainSelections)).toHaveLength(0);
|
|
560
569
|
});
|
|
561
570
|
it("should populate multiple skills from array-valued subcategories", () => {
|
|
562
571
|
const store = useWizardStore.getState();
|
|
@@ -685,5 +694,268 @@ describe("WizardStore", () => {
|
|
|
685
694
|
globalExpect(state.domainSelections.web.framework).toEqual(["web-framework-react"]);
|
|
686
695
|
});
|
|
687
696
|
});
|
|
697
|
+
describe("buildSourceRows sort order", () => {
|
|
698
|
+
function makeSource(overrides) {
|
|
699
|
+
return {
|
|
700
|
+
type: "private",
|
|
701
|
+
installed: false,
|
|
702
|
+
...overrides
|
|
703
|
+
};
|
|
704
|
+
}
|
|
705
|
+
it("should sort local sources before scoped marketplace sources", () => {
|
|
706
|
+
const store = useWizardStore.getState();
|
|
707
|
+
const skill = createMockSkill("web-framework-react", "framework", {
|
|
708
|
+
displayName: "react",
|
|
709
|
+
availableSources: [
|
|
710
|
+
makeSource({ name: "Photoroom", type: "private", primary: true }),
|
|
711
|
+
makeSource({ name: "local", type: "local", installed: true, installMode: "local" })
|
|
712
|
+
]
|
|
713
|
+
});
|
|
714
|
+
const matrix = createMockMatrix(
|
|
715
|
+
{ "web-framework-react": skill },
|
|
716
|
+
{
|
|
717
|
+
displayNames: { "web-framework-react": "react" }
|
|
718
|
+
}
|
|
719
|
+
);
|
|
720
|
+
store.toggleTechnology("web", "framework", "web-framework-react", true);
|
|
721
|
+
const rows = store.buildSourceRows(matrix);
|
|
722
|
+
globalExpect(rows).toHaveLength(1);
|
|
723
|
+
globalExpect(rows[0].options[0].id).toBe("local");
|
|
724
|
+
globalExpect(rows[0].options[1].id).toBe("Photoroom");
|
|
725
|
+
});
|
|
726
|
+
it("should sort scoped marketplace before default public marketplace", () => {
|
|
727
|
+
const store = useWizardStore.getState();
|
|
728
|
+
const skill = createMockSkill("web-framework-react", "framework", {
|
|
729
|
+
displayName: "react",
|
|
730
|
+
availableSources: [
|
|
731
|
+
makeSource({ name: "Agents Inc", type: "public" }),
|
|
732
|
+
makeSource({ name: "Photoroom", type: "private", primary: true })
|
|
733
|
+
]
|
|
734
|
+
});
|
|
735
|
+
const matrix = createMockMatrix(
|
|
736
|
+
{ "web-framework-react": skill },
|
|
737
|
+
{
|
|
738
|
+
displayNames: { "web-framework-react": "react" }
|
|
739
|
+
}
|
|
740
|
+
);
|
|
741
|
+
store.toggleTechnology("web", "framework", "web-framework-react", true);
|
|
742
|
+
const rows = store.buildSourceRows(matrix);
|
|
743
|
+
globalExpect(rows).toHaveLength(1);
|
|
744
|
+
globalExpect(rows[0].options[0].id).toBe("Photoroom");
|
|
745
|
+
globalExpect(rows[0].options[1].id).toBe("Agents Inc");
|
|
746
|
+
});
|
|
747
|
+
it("should sort default public marketplace before third-party sources", () => {
|
|
748
|
+
const store = useWizardStore.getState();
|
|
749
|
+
const skill = createMockSkill("web-framework-react", "framework", {
|
|
750
|
+
displayName: "react",
|
|
751
|
+
availableSources: [
|
|
752
|
+
makeSource({ name: "Extra Corp", type: "private" }),
|
|
753
|
+
makeSource({ name: "Agents Inc", type: "public" })
|
|
754
|
+
]
|
|
755
|
+
});
|
|
756
|
+
const matrix = createMockMatrix(
|
|
757
|
+
{ "web-framework-react": skill },
|
|
758
|
+
{
|
|
759
|
+
displayNames: { "web-framework-react": "react" }
|
|
760
|
+
}
|
|
761
|
+
);
|
|
762
|
+
store.toggleTechnology("web", "framework", "web-framework-react", true);
|
|
763
|
+
const rows = store.buildSourceRows(matrix);
|
|
764
|
+
globalExpect(rows).toHaveLength(1);
|
|
765
|
+
globalExpect(rows[0].options[0].id).toBe("Agents Inc");
|
|
766
|
+
globalExpect(rows[0].options[1].id).toBe("Extra Corp");
|
|
767
|
+
});
|
|
768
|
+
it("should sort all four tiers in correct order", () => {
|
|
769
|
+
const store = useWizardStore.getState();
|
|
770
|
+
const skill = createMockSkill("web-framework-react", "framework", {
|
|
771
|
+
displayName: "react",
|
|
772
|
+
availableSources: [
|
|
773
|
+
makeSource({ name: "Extra Corp", type: "private" }),
|
|
774
|
+
makeSource({ name: "Agents Inc", type: "public" }),
|
|
775
|
+
makeSource({ name: "Photoroom", type: "private", primary: true }),
|
|
776
|
+
makeSource({ name: "local", type: "local", installed: true, installMode: "local" })
|
|
777
|
+
]
|
|
778
|
+
});
|
|
779
|
+
const matrix = createMockMatrix(
|
|
780
|
+
{ "web-framework-react": skill },
|
|
781
|
+
{
|
|
782
|
+
displayNames: { "web-framework-react": "react" }
|
|
783
|
+
}
|
|
784
|
+
);
|
|
785
|
+
store.toggleTechnology("web", "framework", "web-framework-react", true);
|
|
786
|
+
const rows = store.buildSourceRows(matrix);
|
|
787
|
+
globalExpect(rows).toHaveLength(1);
|
|
788
|
+
const sourceNames = rows[0].options.map((opt) => opt.id);
|
|
789
|
+
globalExpect(sourceNames).toEqual(["local", "Photoroom", "Agents Inc", "Extra Corp"]);
|
|
790
|
+
});
|
|
791
|
+
});
|
|
792
|
+
describe("agent selection", () => {
|
|
793
|
+
it("should start with empty selectedAgents", () => {
|
|
794
|
+
const { selectedAgents } = useWizardStore.getState();
|
|
795
|
+
globalExpect(selectedAgents).toEqual([]);
|
|
796
|
+
});
|
|
797
|
+
it("should toggle agent on", () => {
|
|
798
|
+
const store = useWizardStore.getState();
|
|
799
|
+
store.toggleAgent("web-developer");
|
|
800
|
+
const { selectedAgents } = useWizardStore.getState();
|
|
801
|
+
globalExpect(selectedAgents).toContain("web-developer");
|
|
802
|
+
});
|
|
803
|
+
it("should toggle agent off", () => {
|
|
804
|
+
const store = useWizardStore.getState();
|
|
805
|
+
store.toggleAgent("web-developer");
|
|
806
|
+
store.toggleAgent("web-developer");
|
|
807
|
+
const { selectedAgents } = useWizardStore.getState();
|
|
808
|
+
globalExpect(selectedAgents).not.toContain("web-developer");
|
|
809
|
+
});
|
|
810
|
+
it("should allow multiple agents to be selected", () => {
|
|
811
|
+
const store = useWizardStore.getState();
|
|
812
|
+
store.toggleAgent("web-developer");
|
|
813
|
+
store.toggleAgent("api-developer");
|
|
814
|
+
store.toggleAgent("web-reviewer");
|
|
815
|
+
const { selectedAgents } = useWizardStore.getState();
|
|
816
|
+
globalExpect(selectedAgents).toEqual(["web-developer", "api-developer", "web-reviewer"]);
|
|
817
|
+
});
|
|
818
|
+
it("should reset selectedAgents on reset", () => {
|
|
819
|
+
const store = useWizardStore.getState();
|
|
820
|
+
store.toggleAgent("web-developer");
|
|
821
|
+
store.reset();
|
|
822
|
+
const { selectedAgents } = useWizardStore.getState();
|
|
823
|
+
globalExpect(selectedAgents).toEqual([]);
|
|
824
|
+
});
|
|
825
|
+
});
|
|
826
|
+
describe("preselectAgentsFromSkills", () => {
|
|
827
|
+
beforeEach(async () => {
|
|
828
|
+
clearDefaultsCache();
|
|
829
|
+
await loadDefaultMappings();
|
|
830
|
+
});
|
|
831
|
+
afterEach(() => {
|
|
832
|
+
clearDefaultsCache();
|
|
833
|
+
});
|
|
834
|
+
it("should preselect web-related agents when web skills are selected", () => {
|
|
835
|
+
const store = useWizardStore.getState();
|
|
836
|
+
store.toggleTechnology("web", "framework", "web-framework-react", true);
|
|
837
|
+
store.preselectAgentsFromSkills();
|
|
838
|
+
const { selectedAgents } = useWizardStore.getState();
|
|
839
|
+
globalExpect(selectedAgents).toContain("web-developer");
|
|
840
|
+
globalExpect(selectedAgents).toContain("web-reviewer");
|
|
841
|
+
globalExpect(selectedAgents).toContain("web-researcher");
|
|
842
|
+
globalExpect(selectedAgents).toContain("web-tester");
|
|
843
|
+
globalExpect(selectedAgents).toContain("web-pm");
|
|
844
|
+
globalExpect(selectedAgents).toContain("web-architecture");
|
|
845
|
+
});
|
|
846
|
+
it("should preselect api-related agents when api skills are selected", () => {
|
|
847
|
+
const store = useWizardStore.getState();
|
|
848
|
+
store.toggleTechnology("api", "api", "api-framework-hono", true);
|
|
849
|
+
store.preselectAgentsFromSkills();
|
|
850
|
+
const { selectedAgents } = useWizardStore.getState();
|
|
851
|
+
globalExpect(selectedAgents).toContain("api-developer");
|
|
852
|
+
globalExpect(selectedAgents).toContain("api-reviewer");
|
|
853
|
+
globalExpect(selectedAgents).toContain("api-researcher");
|
|
854
|
+
globalExpect(selectedAgents).not.toContain("web-developer");
|
|
855
|
+
});
|
|
856
|
+
it("should never include optional agents regardless of skills", () => {
|
|
857
|
+
const store = useWizardStore.getState();
|
|
858
|
+
store.toggleTechnology("web", "framework", "web-framework-react", true);
|
|
859
|
+
store.toggleTechnology("api", "api", "api-framework-hono", true);
|
|
860
|
+
store.toggleTechnology("cli", "framework", "cli-framework-oclif-ink", true);
|
|
861
|
+
store.preselectAgentsFromSkills();
|
|
862
|
+
const { selectedAgents } = useWizardStore.getState();
|
|
863
|
+
globalExpect(selectedAgents).not.toContain("agent-summoner");
|
|
864
|
+
globalExpect(selectedAgents).not.toContain("skill-summoner");
|
|
865
|
+
globalExpect(selectedAgents).not.toContain("documentor");
|
|
866
|
+
globalExpect(selectedAgents).not.toContain("pattern-scout");
|
|
867
|
+
globalExpect(selectedAgents).not.toContain("web-pattern-critique");
|
|
868
|
+
});
|
|
869
|
+
it("should return empty agents when no skills are selected", () => {
|
|
870
|
+
const store = useWizardStore.getState();
|
|
871
|
+
store.preselectAgentsFromSkills();
|
|
872
|
+
const { selectedAgents } = useWizardStore.getState();
|
|
873
|
+
globalExpect(selectedAgents).toEqual([]);
|
|
874
|
+
});
|
|
875
|
+
it("should produce union of agents for skills across multiple domains", () => {
|
|
876
|
+
const store = useWizardStore.getState();
|
|
877
|
+
store.toggleTechnology("web", "framework", "web-framework-react", true);
|
|
878
|
+
store.toggleTechnology("api", "api", "api-framework-hono", true);
|
|
879
|
+
store.preselectAgentsFromSkills();
|
|
880
|
+
const { selectedAgents } = useWizardStore.getState();
|
|
881
|
+
globalExpect(selectedAgents).toContain("web-developer");
|
|
882
|
+
globalExpect(selectedAgents).toContain("api-developer");
|
|
883
|
+
globalExpect(selectedAgents).toContain("web-reviewer");
|
|
884
|
+
globalExpect(selectedAgents).toContain("api-reviewer");
|
|
885
|
+
});
|
|
886
|
+
it("should preselect cli agents when cli skills are selected", () => {
|
|
887
|
+
const store = useWizardStore.getState();
|
|
888
|
+
store.toggleTechnology("cli", "framework", "cli-framework-oclif-ink", true);
|
|
889
|
+
store.preselectAgentsFromSkills();
|
|
890
|
+
const { selectedAgents } = useWizardStore.getState();
|
|
891
|
+
globalExpect(selectedAgents).toContain("cli-developer");
|
|
892
|
+
globalExpect(selectedAgents).toContain("cli-tester");
|
|
893
|
+
globalExpect(selectedAgents).toContain("cli-reviewer");
|
|
894
|
+
globalExpect(selectedAgents).toContain("cli-migrator");
|
|
895
|
+
});
|
|
896
|
+
it("should not preselect api agents when only web skills are selected", () => {
|
|
897
|
+
const store = useWizardStore.getState();
|
|
898
|
+
store.toggleTechnology("web", "framework", "web-framework-react", true);
|
|
899
|
+
store.toggleTechnology("web", "styling", "web-styling-scss-modules", false);
|
|
900
|
+
store.preselectAgentsFromSkills();
|
|
901
|
+
const { selectedAgents } = useWizardStore.getState();
|
|
902
|
+
globalExpect(selectedAgents).toContain("web-developer");
|
|
903
|
+
globalExpect(selectedAgents).not.toContain("api-developer");
|
|
904
|
+
globalExpect(selectedAgents).not.toContain("api-reviewer");
|
|
905
|
+
});
|
|
906
|
+
it("should return sorted agents", () => {
|
|
907
|
+
const store = useWizardStore.getState();
|
|
908
|
+
store.toggleTechnology("web", "framework", "web-framework-react", true);
|
|
909
|
+
store.toggleTechnology("api", "api", "api-framework-hono", true);
|
|
910
|
+
store.preselectAgentsFromSkills();
|
|
911
|
+
const { selectedAgents } = useWizardStore.getState();
|
|
912
|
+
const sorted = [...selectedAgents].sort();
|
|
913
|
+
globalExpect(selectedAgents).toEqual(sorted);
|
|
914
|
+
});
|
|
915
|
+
it("should replace previous agent selection", () => {
|
|
916
|
+
const store = useWizardStore.getState();
|
|
917
|
+
store.toggleAgent("documentor");
|
|
918
|
+
store.toggleTechnology("web", "framework", "web-framework-react", true);
|
|
919
|
+
store.preselectAgentsFromSkills();
|
|
920
|
+
const { selectedAgents } = useWizardStore.getState();
|
|
921
|
+
globalExpect(selectedAgents).not.toContain("documentor");
|
|
922
|
+
});
|
|
923
|
+
});
|
|
924
|
+
describe("step progress with agents step", () => {
|
|
925
|
+
it("should include agents in completed steps when on confirm", () => {
|
|
926
|
+
const store = useWizardStore.getState();
|
|
927
|
+
store.setApproach("scratch");
|
|
928
|
+
store.setStep("build");
|
|
929
|
+
store.setStep("sources");
|
|
930
|
+
store.setStep("agents");
|
|
931
|
+
store.setStep("confirm");
|
|
932
|
+
const { completedSteps } = store.getStepProgress();
|
|
933
|
+
globalExpect(completedSteps).toContain("agents");
|
|
934
|
+
globalExpect(completedSteps).toContain("sources");
|
|
935
|
+
globalExpect(completedSteps).toContain("build");
|
|
936
|
+
});
|
|
937
|
+
it("should include sources in completed steps when on agents step", () => {
|
|
938
|
+
const store = useWizardStore.getState();
|
|
939
|
+
store.setApproach("scratch");
|
|
940
|
+
store.setStep("build");
|
|
941
|
+
store.setStep("sources");
|
|
942
|
+
store.setStep("agents");
|
|
943
|
+
const { completedSteps } = store.getStepProgress();
|
|
944
|
+
globalExpect(completedSteps).toContain("build");
|
|
945
|
+
globalExpect(completedSteps).toContain("sources");
|
|
946
|
+
globalExpect(completedSteps).not.toContain("agents");
|
|
947
|
+
});
|
|
948
|
+
it("should skip agents step when using stack defaults", () => {
|
|
949
|
+
const store = useWizardStore.getState();
|
|
950
|
+
store.setApproach("stack");
|
|
951
|
+
store.selectStack("nextjs-fullstack");
|
|
952
|
+
store.setStackAction("defaults");
|
|
953
|
+
store.setStep("confirm");
|
|
954
|
+
const { skippedSteps } = store.getStepProgress();
|
|
955
|
+
globalExpect(skippedSteps).toContain("agents");
|
|
956
|
+
globalExpect(skippedSteps).toContain("build");
|
|
957
|
+
globalExpect(skippedSteps).toContain("sources");
|
|
958
|
+
});
|
|
959
|
+
});
|
|
688
960
|
});
|
|
689
961
|
//# sourceMappingURL=wizard-store.test.js.map
|