@testchimp/cli 0.1.26 → 0.1.27

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.
@@ -936,6 +936,33 @@ export function buildCliProgram() {
936
936
  const out = await runTool("mark-semantic-tests-distinct", merged, { postMcp });
937
937
  console.log(out);
938
938
  });
939
+ program
940
+ .command("list-semantic-nearby")
941
+ .description(TOOL_DEFINITIONS.find((t) => t.kebab === "list-semantic-nearby").description)
942
+ .addOption(jsonInputOption())
943
+ .action(async (opts) => {
944
+ const merged = mergeBodies({}, opts.jsonInput);
945
+ const out = await runTool("list-semantic-nearby", merged, { postMcp });
946
+ console.log(out);
947
+ });
948
+ program
949
+ .command("mark-entity-distinct")
950
+ .description(TOOL_DEFINITIONS.find((t) => t.kebab === "mark-entity-distinct").description)
951
+ .addOption(jsonInputOption())
952
+ .action(async (opts) => {
953
+ const merged = mergeBodies({}, opts.jsonInput);
954
+ const out = await runTool("mark-entity-distinct", merged, { postMcp });
955
+ console.log(out);
956
+ });
957
+ program
958
+ .command("unmark-entity-distinct")
959
+ .description(TOOL_DEFINITIONS.find((t) => t.kebab === "unmark-entity-distinct").description)
960
+ .addOption(jsonInputOption())
961
+ .action(async (opts) => {
962
+ const merged = mergeBodies({}, opts.jsonInput);
963
+ const out = await runTool("unmark-entity-distinct", merged, { postMcp });
964
+ console.log(out);
965
+ });
939
966
  program
940
967
  .command("get-requirement-quality-report")
941
968
  .description(TOOL_DEFINITIONS.find((t) => t.kebab === "get-requirement-quality-report").description)
@@ -924,6 +924,64 @@ export declare const markSemanticTestsDistinctInput: z.ZodObject<{
924
924
  testName: z.ZodString;
925
925
  }, z.core.$strip>;
926
926
  }, z.core.$strip>;
927
+ /** LinkedEntityType names for semantic nearby (embedding-capable). */
928
+ export declare const semanticNearbyEntityTypeSchema: z.ZodEnum<{
929
+ STORY: "STORY";
930
+ SCENARIO: "SCENARIO";
931
+ TEST: "TEST";
932
+ ISSUE: "ISSUE";
933
+ EVENT: "EVENT";
934
+ }>;
935
+ export declare const listSemanticNearbyInput: z.ZodObject<{
936
+ sourceEntityType: z.ZodEnum<{
937
+ STORY: "STORY";
938
+ SCENARIO: "SCENARIO";
939
+ TEST: "TEST";
940
+ ISSUE: "ISSUE";
941
+ EVENT: "EVENT";
942
+ }>;
943
+ sourceTest: z.ZodOptional<z.ZodObject<{
944
+ folderPath: z.ZodOptional<z.ZodArray<z.ZodString>>;
945
+ fileName: z.ZodString;
946
+ testSuite: z.ZodOptional<z.ZodArray<z.ZodString>>;
947
+ testName: z.ZodString;
948
+ }, z.core.$strip>>;
949
+ sourceOrdinalId: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
950
+ sourceEventTitle: z.ZodOptional<z.ZodString>;
951
+ targetEntityTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
952
+ STORY: "STORY";
953
+ SCENARIO: "SCENARIO";
954
+ TEST: "TEST";
955
+ ISSUE: "ISSUE";
956
+ EVENT: "EVENT";
957
+ }>>>;
958
+ limit: z.ZodOptional<z.ZodNumber>;
959
+ }, z.core.$strip>;
960
+ export declare const markEntityDistinctInput: z.ZodObject<{
961
+ entityType: z.ZodEnum<{
962
+ STORY: "STORY";
963
+ SCENARIO: "SCENARIO";
964
+ TEST: "TEST";
965
+ ISSUE: "ISSUE";
966
+ EVENT: "EVENT";
967
+ }>;
968
+ focusTest: z.ZodOptional<z.ZodObject<{
969
+ folderPath: z.ZodOptional<z.ZodArray<z.ZodString>>;
970
+ fileName: z.ZodString;
971
+ testSuite: z.ZodOptional<z.ZodArray<z.ZodString>>;
972
+ testName: z.ZodString;
973
+ }, z.core.$strip>>;
974
+ otherTest: z.ZodOptional<z.ZodObject<{
975
+ folderPath: z.ZodOptional<z.ZodArray<z.ZodString>>;
976
+ fileName: z.ZodString;
977
+ testSuite: z.ZodOptional<z.ZodArray<z.ZodString>>;
978
+ testName: z.ZodString;
979
+ }, z.core.$strip>>;
980
+ focusOrdinalId: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
981
+ otherOrdinalId: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
982
+ focusEventTitle: z.ZodOptional<z.ZodString>;
983
+ otherEventTitle: z.ZodOptional<z.ZodString>;
984
+ }, z.core.$strip>;
927
985
  /** RequirementSubjectType — proto enum names (JsonFormat camelCase on wire). */
928
986
  export declare const requirementSubjectTypeSchema: z.ZodEnum<{
929
987
  STORY: "STORY";
@@ -1234,11 +1292,11 @@ export declare const agentActionEntityTypeSchema: z.ZodEnum<{
1234
1292
  SCENARIO: "SCENARIO";
1235
1293
  ISSUE: "ISSUE";
1236
1294
  TEST_EXECUTION: "TEST_EXECUTION";
1295
+ EVENT: "EVENT";
1237
1296
  USER_STORY: "USER_STORY";
1238
1297
  POLICY: "POLICY";
1239
1298
  TEST_INVOCATION_BATCH: "TEST_INVOCATION_BATCH";
1240
1299
  EXPLORATION: "EXPLORATION";
1241
- EVENT: "EVENT";
1242
1300
  WORKFLOW: "WORKFLOW";
1243
1301
  }>;
1244
1302
  export declare const agentActionTypeSchema: z.ZodEnum<{
@@ -1295,11 +1353,11 @@ export declare const reportAgentActionInput: z.ZodObject<{
1295
1353
  SCENARIO: "SCENARIO";
1296
1354
  ISSUE: "ISSUE";
1297
1355
  TEST_EXECUTION: "TEST_EXECUTION";
1356
+ EVENT: "EVENT";
1298
1357
  USER_STORY: "USER_STORY";
1299
1358
  POLICY: "POLICY";
1300
1359
  TEST_INVOCATION_BATCH: "TEST_INVOCATION_BATCH";
1301
1360
  EXPLORATION: "EXPLORATION";
1302
- EVENT: "EVENT";
1303
1361
  WORKFLOW: "WORKFLOW";
1304
1362
  }>;
1305
1363
  entityIdentity: z.ZodOptional<z.ZodString>;
@@ -417,6 +417,83 @@ export const markSemanticTestsDistinctInput = z.object({
417
417
  focusTest: testLocatorSchema,
418
418
  distinctTest: testLocatorSchema,
419
419
  });
420
+ /** LinkedEntityType names for semantic nearby (embedding-capable). */
421
+ export const semanticNearbyEntityTypeSchema = z.enum([
422
+ "STORY",
423
+ "SCENARIO",
424
+ "TEST",
425
+ "ISSUE",
426
+ "EVENT",
427
+ ]);
428
+ export const listSemanticNearbyInput = z
429
+ .object({
430
+ sourceEntityType: semanticNearbyEntityTypeSchema,
431
+ sourceTest: testLocatorSchema.optional(),
432
+ sourceOrdinalId: z.union([z.number(), z.string()]).optional(),
433
+ sourceEventTitle: z.string().optional(),
434
+ targetEntityTypes: z.array(semanticNearbyEntityTypeSchema).optional(),
435
+ limit: z.number().int().positive().optional(),
436
+ })
437
+ .superRefine((val, ctx) => {
438
+ if (val.sourceEntityType === "TEST" && !val.sourceTest) {
439
+ ctx.addIssue({
440
+ code: z.ZodIssueCode.custom,
441
+ message: "TEST requires sourceTest (TestLocator)",
442
+ path: ["sourceTest"],
443
+ });
444
+ }
445
+ if ((val.sourceEntityType === "STORY" ||
446
+ val.sourceEntityType === "SCENARIO" ||
447
+ val.sourceEntityType === "ISSUE") &&
448
+ (val.sourceOrdinalId == null || String(val.sourceOrdinalId).trim() === "")) {
449
+ ctx.addIssue({
450
+ code: z.ZodIssueCode.custom,
451
+ message: `${val.sourceEntityType} requires sourceOrdinalId`,
452
+ path: ["sourceOrdinalId"],
453
+ });
454
+ }
455
+ if (val.sourceEntityType === "EVENT" && !(val.sourceEventTitle ?? "").trim()) {
456
+ ctx.addIssue({
457
+ code: z.ZodIssueCode.custom,
458
+ message: "EVENT requires sourceEventTitle",
459
+ path: ["sourceEventTitle"],
460
+ });
461
+ }
462
+ });
463
+ export const markEntityDistinctInput = z
464
+ .object({
465
+ entityType: semanticNearbyEntityTypeSchema,
466
+ focusTest: testLocatorSchema.optional(),
467
+ otherTest: testLocatorSchema.optional(),
468
+ focusOrdinalId: z.union([z.number(), z.string()]).optional(),
469
+ otherOrdinalId: z.union([z.number(), z.string()]).optional(),
470
+ focusEventTitle: z.string().optional(),
471
+ otherEventTitle: z.string().optional(),
472
+ })
473
+ .superRefine((val, ctx) => {
474
+ if (val.entityType === "TEST") {
475
+ if (!val.focusTest || !val.otherTest) {
476
+ ctx.addIssue({
477
+ code: z.ZodIssueCode.custom,
478
+ message: "TEST requires focusTest and otherTest",
479
+ });
480
+ }
481
+ }
482
+ else if (val.entityType === "EVENT") {
483
+ if (!(val.focusEventTitle ?? "").trim() || !(val.otherEventTitle ?? "").trim()) {
484
+ ctx.addIssue({
485
+ code: z.ZodIssueCode.custom,
486
+ message: "EVENT requires focusEventTitle and otherEventTitle",
487
+ });
488
+ }
489
+ }
490
+ else if (val.focusOrdinalId == null || val.otherOrdinalId == null) {
491
+ ctx.addIssue({
492
+ code: z.ZodIssueCode.custom,
493
+ message: `${val.entityType} requires focusOrdinalId and otherOrdinalId`,
494
+ });
495
+ }
496
+ });
420
497
  /** RequirementSubjectType — proto enum names (JsonFormat camelCase on wire). */
421
498
  export const requirementSubjectTypeSchema = z.enum(["STORY", "SCENARIO"]);
422
499
  /** RequirementFindingSeverity — proto enum names. */
@@ -328,6 +328,8 @@ export const TOOL_DEFINITIONS = [
328
328
  "Use simple fields for common creates, or pass the full curated contract via --json-input " +
329
329
  "(description, issueType, category, severity, status, reportedReleaseId, dueDateMillis, assignee, " +
330
330
  "linkTargets, labels, source, environment, attachments, artifactReference). " +
331
+ "For /testchimp implement TASK_ISSUE creates: set labels=[\"TestChimp Implement\"] (not source), " +
332
+ "severity from task priority, category (e.g. FUNCTIONAL), and linkTargets for STORY and/or SCENARIO ordinals. " +
331
333
  "Optional agentTraceability (or flat workflowId/policyFile/…) records CREATED Activity inline — " +
332
334
  "prefer this over a separate report-agent-action for issue creates. " +
333
335
  "Authenticated via project API key; project is resolved from the key.",
@@ -783,6 +785,75 @@ export const TOOL_DEFINITIONS = [
783
785
  });
784
786
  },
785
787
  },
788
+ {
789
+ kebab: "list-semantic-nearby",
790
+ description: "List semantically nearby entities across types (Story/Scenario/Test/Issue/Event). " +
791
+ "TEST uses TestLocator; STORY/SCENARIO/ISSUE use sourceOrdinalId; EVENT uses sourceEventTitle. " +
792
+ "Response TEST hits include TestLocator (never platform test_id).",
793
+ inputSchema: S.listSemanticNearbyInput,
794
+ execute: async (args, { postMcp }) => {
795
+ const a = args;
796
+ const body = {
797
+ sourceEntityType: a.sourceEntityType,
798
+ };
799
+ if (a.sourceTest)
800
+ body.sourceTest = a.sourceTest;
801
+ if (a.sourceOrdinalId != null)
802
+ body.sourceOrdinalId = Number(a.sourceOrdinalId);
803
+ if (a.sourceEventTitle)
804
+ body.sourceEventTitle = a.sourceEventTitle;
805
+ if (a.targetEntityTypes?.length)
806
+ body.targetEntityTypes = a.targetEntityTypes;
807
+ if (a.limit != null)
808
+ body.limit = a.limit;
809
+ return postMcp("/api/mcp/list_semantic_nearby", body);
810
+ },
811
+ },
812
+ {
813
+ kebab: "mark-entity-distinct",
814
+ description: "Mark two same-type entities as distinct. TEST uses TestLocators; " +
815
+ "STORY/SCENARIO/ISSUE use ordinals; EVENT uses titles.",
816
+ inputSchema: S.markEntityDistinctInput,
817
+ execute: async (args, { postMcp }) => {
818
+ const a = args;
819
+ const body = { entityType: a.entityType };
820
+ if (a.focusTest)
821
+ body.focusTest = a.focusTest;
822
+ if (a.otherTest)
823
+ body.otherTest = a.otherTest;
824
+ if (a.focusOrdinalId != null)
825
+ body.focusOrdinalId = Number(a.focusOrdinalId);
826
+ if (a.otherOrdinalId != null)
827
+ body.otherOrdinalId = Number(a.otherOrdinalId);
828
+ if (a.focusEventTitle)
829
+ body.focusEventTitle = a.focusEventTitle;
830
+ if (a.otherEventTitle)
831
+ body.otherEventTitle = a.otherEventTitle;
832
+ return postMcp("/api/mcp/mark_entity_distinct", body);
833
+ },
834
+ },
835
+ {
836
+ kebab: "unmark-entity-distinct",
837
+ description: "Remove a distinct mark between two same-type entities (same identity rules as mark-entity-distinct).",
838
+ inputSchema: S.markEntityDistinctInput,
839
+ execute: async (args, { postMcp }) => {
840
+ const a = args;
841
+ const body = { entityType: a.entityType };
842
+ if (a.focusTest)
843
+ body.focusTest = a.focusTest;
844
+ if (a.otherTest)
845
+ body.otherTest = a.otherTest;
846
+ if (a.focusOrdinalId != null)
847
+ body.focusOrdinalId = Number(a.focusOrdinalId);
848
+ if (a.otherOrdinalId != null)
849
+ body.otherOrdinalId = Number(a.otherOrdinalId);
850
+ if (a.focusEventTitle)
851
+ body.focusEventTitle = a.focusEventTitle;
852
+ if (a.otherEventTitle)
853
+ body.otherEventTitle = a.otherEventTitle;
854
+ return postMcp("/api/mcp/unmark_entity_distinct", body);
855
+ },
856
+ },
786
857
  {
787
858
  kebab: "get-requirement-quality-report",
788
859
  description: "Fetch the stored requirement quality report (metrics + findings with user states) for a user story or test scenario. " +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testchimp/cli",
3
- "version": "0.1.26",
3
+ "version": "0.1.27",
4
4
  "description": "TestChimp CLI and MCP server \u2014 coverage, plans, EaaS, TrueCoverage (calls /api/mcp/*)",
5
5
  "type": "module",
6
6
  "main": "dist/bin/testchimp.js",