@ted-galago/wave-cli 0.1.9 → 0.1.10

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/index.cjs CHANGED
@@ -723,8 +723,37 @@ async function graphqlRequest(input) {
723
723
  }
724
724
 
725
725
  // src/output.ts
726
+ var import_node_fs = require("fs");
727
+ var RETRYABLE_WRITE_CODES = /* @__PURE__ */ new Set(["EAGAIN", "EINTR"]);
728
+ var RETRY_BACKOFF_MS = 1;
729
+ function sleepBriefly(ms) {
730
+ const lock = new Int32Array(new SharedArrayBuffer(4));
731
+ Atomics.wait(lock, 0, 0, ms);
732
+ }
733
+ function writeStdoutFully(text) {
734
+ const fd = typeof process.stdout.fd === "number" ? process.stdout.fd : 1;
735
+ const buffer = Buffer.from(text, "utf8");
736
+ let offset = 0;
737
+ while (offset < buffer.length) {
738
+ try {
739
+ const bytesWritten = (0, import_node_fs.writeSync)(fd, buffer, offset, buffer.length - offset);
740
+ if (bytesWritten <= 0) {
741
+ sleepBriefly(RETRY_BACKOFF_MS);
742
+ continue;
743
+ }
744
+ offset += bytesWritten;
745
+ } catch (error) {
746
+ const code = typeof error === "object" && error && "code" in error ? String(error.code ?? "") : "";
747
+ if (RETRYABLE_WRITE_CODES.has(code)) {
748
+ sleepBriefly(RETRY_BACKOFF_MS);
749
+ continue;
750
+ }
751
+ throw error;
752
+ }
753
+ }
754
+ }
726
755
  function printEnvelope(envelope) {
727
- process.stdout.write(`${JSON.stringify(envelope)}
756
+ writeStdoutFully(`${JSON.stringify(envelope)}
728
757
  `);
729
758
  }
730
759
  function printEnvelopeAndExit(params) {
@@ -2594,7 +2623,7 @@ function registerProjectCommands(program) {
2594
2623
  const organizationId = resolveOrganizationId(context.organizationId);
2595
2624
  await runGraphqlQueryCommand({
2596
2625
  command: "projects.list",
2597
- operationName: "ProjectsIndexSlim",
2626
+ operationName: "ProjectsList",
2598
2627
  runtimeOptions: context.runtimeOptions,
2599
2628
  field: "projects",
2600
2629
  variables: normalizeGraphqlVariables2({
@@ -2622,7 +2651,7 @@ function registerProjectCommands(program) {
2622
2651
  const organizationId = resolveOrganizationId(context.organizationId);
2623
2652
  await runGraphqlQueryCommand({
2624
2653
  command: "projects.show",
2625
- operationName: "ProjectShowDeepV2",
2654
+ operationName: "ProjectsShow",
2626
2655
  runtimeOptions: context.runtimeOptions,
2627
2656
  field: "project",
2628
2657
  variables: {
@@ -4537,6 +4566,7 @@ function registerFoundationCommands(program) {
4537
4566
  var import_zod12 = require("zod");
4538
4567
  var idSchema11 = import_zod12.z.string().min(1);
4539
4568
  var jsonObjectSchema = import_zod12.z.record(import_zod12.z.string(), import_zod12.z.unknown());
4569
+ var childListMinimalSelectionSet = "{ data { id type attributes } count currentPage totalPages }";
4540
4570
  function parseJsonObject2(raw) {
4541
4571
  try {
4542
4572
  const parsed = JSON.parse(raw);
@@ -4737,11 +4767,11 @@ function registerChildEntityCommands(program) {
4737
4767
  updateField: "update_subtask",
4738
4768
  destroyField: "destroy_subtask",
4739
4769
  idVariable: "subtask_id",
4740
- listOperationName: "SubtasksForTask",
4741
- createOperationName: "CreateSubtask",
4742
- updateOperationName: "UpdateSubtask",
4743
- destroyOperationName: "DestroySubtask",
4744
- listSelectionSet: "{ data { id type name status taskId attributes } count currentPage totalPages }",
4770
+ listOperationName: "SubtasksList",
4771
+ createOperationName: "SubtasksCreate",
4772
+ updateOperationName: "SubtasksUpdate",
4773
+ destroyOperationName: "SubtasksDestroy",
4774
+ listSelectionSet: childListMinimalSelectionSet,
4745
4775
  listParentTypedField: "taskId",
4746
4776
  normalizeCreateBody: normalizeSubtaskCreateBody
4747
4777
  });
@@ -4756,11 +4786,11 @@ function registerChildEntityCommands(program) {
4756
4786
  updateField: "update_milestone",
4757
4787
  destroyField: "destroy_milestone",
4758
4788
  idVariable: "milestone_id",
4759
- listOperationName: "MilestonesForRock",
4760
- createOperationName: "CreateMilestone",
4761
- updateOperationName: "UpdateMilestone",
4762
- destroyOperationName: "DestroyMilestone",
4763
- listSelectionSet: "{ data { id type name slug status attributes } count currentPage totalPages }"
4789
+ listOperationName: "MilestonesList",
4790
+ createOperationName: "MilestonesCreate",
4791
+ updateOperationName: "MilestonesUpdate",
4792
+ destroyOperationName: "MilestonesDestroy",
4793
+ listSelectionSet: childListMinimalSelectionSet
4764
4794
  });
4765
4795
  registerChildCommands(program, {
4766
4796
  command: "subitems",
@@ -4773,11 +4803,11 @@ function registerChildEntityCommands(program) {
4773
4803
  updateField: "update_subitem",
4774
4804
  destroyField: "destroy_subitem",
4775
4805
  idVariable: "subitem_id",
4776
- listOperationName: "SubitemsForListItem",
4777
- createOperationName: "CreateSubitem",
4778
- updateOperationName: "UpdateSubitem",
4779
- destroyOperationName: "DestroySubitem",
4780
- listSelectionSet: "{ data { id type name status listItemId attributes } count currentPage totalPages }",
4806
+ listOperationName: "SubitemsList",
4807
+ createOperationName: "SubitemsCreate",
4808
+ updateOperationName: "SubitemsUpdate",
4809
+ destroyOperationName: "SubitemsDestroy",
4810
+ listSelectionSet: childListMinimalSelectionSet,
4781
4811
  listParentTypedField: "listItemId"
4782
4812
  });
4783
4813
  registerChildCommands(program, {
@@ -4791,11 +4821,11 @@ function registerChildEntityCommands(program) {
4791
4821
  updateField: "update_sub_todo",
4792
4822
  destroyField: "destroy_sub_todo",
4793
4823
  idVariable: "sub_todo_id",
4794
- listOperationName: "SubtodosForTodo",
4795
- createOperationName: "CreateSubTodo",
4796
- updateOperationName: "UpdateSubTodo",
4797
- destroyOperationName: "DestroySubTodo",
4798
- listSelectionSet: "{ data { id type name status todoId attributes } count currentPage totalPages }",
4824
+ listOperationName: "SubtodosList",
4825
+ createOperationName: "SubtodosCreate",
4826
+ updateOperationName: "SubtodosUpdate",
4827
+ destroyOperationName: "SubtodosDestroy",
4828
+ listSelectionSet: childListMinimalSelectionSet,
4799
4829
  listParentTypedField: "todoId"
4800
4830
  });
4801
4831
  registerChildCommands(program, {
@@ -4809,11 +4839,11 @@ function registerChildEntityCommands(program) {
4809
4839
  updateField: "update_sub_issue",
4810
4840
  destroyField: "destroy_sub_issue",
4811
4841
  idVariable: "sub_issue_id",
4812
- listOperationName: "SubissuesForIssue",
4813
- createOperationName: "CreateSubIssue",
4814
- updateOperationName: "UpdateSubIssue",
4815
- destroyOperationName: "DestroySubIssue",
4816
- listSelectionSet: "{ data { id type name status issueId attributes } count currentPage totalPages }",
4842
+ listOperationName: "SubissuesList",
4843
+ createOperationName: "SubissuesCreate",
4844
+ updateOperationName: "SubissuesUpdate",
4845
+ destroyOperationName: "SubissuesDestroy",
4846
+ listSelectionSet: childListMinimalSelectionSet,
4817
4847
  listParentTypedField: "issueId"
4818
4848
  });
4819
4849
  registerChildCommands(program, {
@@ -4827,23 +4857,23 @@ function registerChildEntityCommands(program) {
4827
4857
  updateField: "update_talking_point",
4828
4858
  destroyField: "destroy_talking_point",
4829
4859
  idVariable: "talking_point_id",
4830
- listOperationName: "TalkingPointsForMeeting",
4831
- createOperationName: "CreateTalkingPoint",
4832
- updateOperationName: "UpdateTalkingPoint",
4833
- destroyOperationName: "DestroyTalkingPoint",
4834
- listSelectionSet: "{ data { id type name description status priority rank dueDate memberId creatorId meetingId attributes } count currentPage totalPages }",
4860
+ listOperationName: "TalkingPointsList",
4861
+ createOperationName: "TalkingPointsCreate",
4862
+ updateOperationName: "TalkingPointsUpdate",
4863
+ destroyOperationName: "TalkingPointsDestroy",
4864
+ listSelectionSet: childListMinimalSelectionSet,
4835
4865
  listParentTypedField: "meetingId"
4836
4866
  });
4837
4867
  }
4838
4868
 
4839
- // src/commands/notes.ts
4869
+ // src/commands/content.ts
4840
4870
  var import_zod13 = require("zod");
4841
4871
  var idSchema12 = import_zod13.z.string().min(1);
4842
4872
  var nonEmptyString = import_zod13.z.string().min(1);
4843
4873
  function assertUpdateFields(params) {
4844
4874
  if (!params.name && !params.content && !params.status) {
4845
4875
  throw new CliError({
4846
- message: "notes update requires at least one of --name, --body, or --status.",
4876
+ message: "content update requires at least one of --name, --body, or --status.",
4847
4877
  kind: "invalid_args",
4848
4878
  status: 400,
4849
4879
  exitCode: EXIT_CODES.invalidArgs
@@ -4866,13 +4896,13 @@ async function createContent(command, cmd, payload) {
4866
4896
  })
4867
4897
  });
4868
4898
  }
4869
- function registerNoteCommands(program) {
4870
- const notes = program.command("notes").description("Content note operations");
4871
- notes.command("list").option("--contentable-type <contentableType>").option("--contentable-id <contentableId>").option("--member-id <memberId>").option("--focus-member-id <focusMemberId>").option("--focus-team-id <focusTeamId>").option("--page <page>").option("--per <per>").action(async (opts, cmd) => {
4899
+ function registerContentCommands(program) {
4900
+ const content = program.command("content").description("Content note operations");
4901
+ content.command("list").option("--contentable-type <contentableType>").option("--contentable-id <contentableId>").option("--member-id <memberId>").option("--focus-member-id <focusMemberId>").option("--focus-team-id <focusTeamId>").option("--page <page>").option("--per <per>").action(async (opts, cmd) => {
4872
4902
  const context = await resolveCommandContext(cmd.optsWithGlobals());
4873
4903
  const organizationId = resolveOrganizationId(context.organizationId);
4874
4904
  await runGraphqlQueryCommand({
4875
- command: "notes.list",
4905
+ command: "content.list",
4876
4906
  operationName: "ContentsIndex",
4877
4907
  runtimeOptions: context.runtimeOptions,
4878
4908
  field: "contents",
@@ -4887,15 +4917,15 @@ function registerNoteCommands(program) {
4887
4917
  per: opts.per
4888
4918
  }),
4889
4919
  isList: true,
4890
- selectionSet: "{ count currentPage totalPages data { id type name slug firstChildSlug rootParentSlug status contentType lastEdited organizationId memberId focusMemberId focusTeamId teamId creatorId createdAt updatedAt childCount assignmentType contentableId contentableSlug contentableType votesTotal labelIds rootContentId parentContentId attributes } }"
4920
+ selectionSet: "{ count currentPage totalPages data { id type attributes } }"
4891
4921
  });
4892
4922
  });
4893
- notes.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
4923
+ content.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
4894
4924
  const context = await resolveCommandContext(cmd.optsWithGlobals());
4895
4925
  const organizationId = resolveOrganizationId(context.organizationId);
4896
4926
  const id = idSchema12.parse(opts.id);
4897
4927
  await runGraphqlQueryCommand({
4898
- command: "notes.show",
4928
+ command: "content.show",
4899
4929
  operationName: "ContentShow",
4900
4930
  runtimeOptions: context.runtimeOptions,
4901
4931
  field: "content",
@@ -4907,7 +4937,7 @@ function registerNoteCommands(program) {
4907
4937
  selectionSet: "{ id type name slug firstChildSlug rootParentSlug status contentType lastEdited organizationId memberId focusMemberId focusTeamId teamId creatorId createdAt updatedAt childCount assignmentType contentableId contentableSlug contentableType votesTotal labelIds rootContentId parentContentId attributes }"
4908
4938
  });
4909
4939
  });
4910
- notes.command("update").requiredOption("--id <id>").option("--name <name>").option("--body <body>").option("--status <status>").action(async (opts, cmd) => {
4940
+ content.command("update").requiredOption("--id <id>").option("--name <name>").option("--body <body>").option("--status <status>").action(async (opts, cmd) => {
4911
4941
  assertUpdateFields({
4912
4942
  name: opts.name,
4913
4943
  content: opts.body,
@@ -4917,7 +4947,7 @@ function registerNoteCommands(program) {
4917
4947
  const organizationId = resolveOrganizationId(context.organizationId);
4918
4948
  const contentId = idSchema12.parse(opts.id);
4919
4949
  await runGraphqlMutationCommand({
4920
- command: "notes.update",
4950
+ command: "content.update",
4921
4951
  operationName: "UpdateContent",
4922
4952
  runtimeOptions: context.runtimeOptions,
4923
4953
  field: "update_content",
@@ -4934,12 +4964,12 @@ function registerNoteCommands(program) {
4934
4964
  })
4935
4965
  });
4936
4966
  });
4937
- notes.command("destroy").requiredOption("--id <id>").action(async (opts, cmd) => {
4967
+ content.command("destroy").requiredOption("--id <id>").action(async (opts, cmd) => {
4938
4968
  const context = await resolveCommandContext(cmd.optsWithGlobals());
4939
4969
  const organizationId = resolveOrganizationId(context.organizationId);
4940
4970
  const contentId = idSchema12.parse(opts.id);
4941
4971
  await runGraphqlMutationCommand({
4942
- command: "notes.destroy",
4972
+ command: "content.destroy",
4943
4973
  operationName: "DestroyContent",
4944
4974
  runtimeOptions: context.runtimeOptions,
4945
4975
  field: "destroy_content",
@@ -4949,9 +4979,9 @@ function registerNoteCommands(program) {
4949
4979
  })
4950
4980
  });
4951
4981
  });
4952
- notes.command("create-member").requiredOption("--target-member-id <targetMemberId>").requiredOption("--name <name>").requiredOption("--body <body>").option("--status <status>", "draft").action(async (opts, cmd) => {
4982
+ content.command("create-member").requiredOption("--target-member-id <targetMemberId>").requiredOption("--name <name>").requiredOption("--body <body>").option("--status <status>", "draft").action(async (opts, cmd) => {
4953
4983
  const targetMemberId = nonEmptyString.parse(opts.targetMemberId);
4954
- await createContent("notes.create-member", cmd, {
4984
+ await createContent("content.create-member", cmd, {
4955
4985
  type: "WrittenContent",
4956
4986
  name: nonEmptyString.parse(opts.name),
4957
4987
  content: nonEmptyString.parse(opts.body),
@@ -4963,9 +4993,9 @@ function registerNoteCommands(program) {
4963
4993
  focus_team_id: null
4964
4994
  });
4965
4995
  });
4966
- notes.command("create-manager").requiredOption("--actor-member-id <actorMemberId>").requiredOption("--target-member-id <targetMemberId>").requiredOption("--name <name>").requiredOption("--body <body>").option("--status <status>", "draft").action(async (opts, cmd) => {
4996
+ content.command("create-manager").requiredOption("--actor-member-id <actorMemberId>").requiredOption("--target-member-id <targetMemberId>").requiredOption("--name <name>").requiredOption("--body <body>").option("--status <status>", "draft").action(async (opts, cmd) => {
4967
4997
  const actorMemberId = nonEmptyString.parse(opts.actorMemberId);
4968
- await createContent("notes.create-manager", cmd, {
4998
+ await createContent("content.create-manager", cmd, {
4969
4999
  type: "WrittenContent",
4970
5000
  name: nonEmptyString.parse(opts.name),
4971
5001
  content: nonEmptyString.parse(opts.body),
@@ -4976,10 +5006,10 @@ function registerNoteCommands(program) {
4976
5006
  focus_member_id: nonEmptyString.parse(opts.targetMemberId)
4977
5007
  });
4978
5008
  });
4979
- notes.command("create-team").requiredOption("--actor-member-id <actorMemberId>").requiredOption("--team-id <teamId>").requiredOption("--name <name>").requiredOption("--body <body>").option("--status <status>", "draft").action(async (opts, cmd) => {
5009
+ content.command("create-team").requiredOption("--actor-member-id <actorMemberId>").requiredOption("--team-id <teamId>").requiredOption("--name <name>").requiredOption("--body <body>").option("--status <status>", "draft").action(async (opts, cmd) => {
4980
5010
  const actorMemberId = nonEmptyString.parse(opts.actorMemberId);
4981
5011
  const teamId = nonEmptyString.parse(opts.teamId);
4982
- await createContent("notes.create-team", cmd, {
5012
+ await createContent("content.create-team", cmd, {
4983
5013
  type: "WrittenContent",
4984
5014
  name: nonEmptyString.parse(opts.name),
4985
5015
  content: nonEmptyString.parse(opts.body),
@@ -4990,8 +5020,8 @@ function registerNoteCommands(program) {
4990
5020
  focus_team_id: teamId
4991
5021
  });
4992
5022
  });
4993
- notes.command("create-project").requiredOption("--actor-member-id <actorMemberId>").requiredOption("--project-id <projectId>").requiredOption("--name <name>").requiredOption("--body <body>").option("--status <status>", "draft").action(async (opts, cmd) => {
4994
- await createContent("notes.create-project", cmd, {
5023
+ content.command("create-project").requiredOption("--actor-member-id <actorMemberId>").requiredOption("--project-id <projectId>").requiredOption("--name <name>").requiredOption("--body <body>").option("--status <status>", "draft").action(async (opts, cmd) => {
5024
+ await createContent("content.create-project", cmd, {
4995
5025
  type: "WrittenContent",
4996
5026
  name: nonEmptyString.parse(opts.name),
4997
5027
  content: nonEmptyString.parse(opts.body),
@@ -5001,8 +5031,8 @@ function registerNoteCommands(program) {
5001
5031
  member_id: nonEmptyString.parse(opts.actorMemberId)
5002
5032
  });
5003
5033
  });
5004
- notes.command("create-customer").requiredOption("--actor-member-id <actorMemberId>").requiredOption("--customer-id <customerId>").requiredOption("--name <name>").requiredOption("--body <body>").option("--status <status>", "draft").action(async (opts, cmd) => {
5005
- await createContent("notes.create-customer", cmd, {
5034
+ content.command("create-customer").requiredOption("--actor-member-id <actorMemberId>").requiredOption("--customer-id <customerId>").requiredOption("--name <name>").requiredOption("--body <body>").option("--status <status>", "draft").action(async (opts, cmd) => {
5035
+ await createContent("content.create-customer", cmd, {
5006
5036
  type: "WrittenContent",
5007
5037
  name: nonEmptyString.parse(opts.name),
5008
5038
  content: nonEmptyString.parse(opts.body),
@@ -5012,8 +5042,8 @@ function registerNoteCommands(program) {
5012
5042
  member_id: nonEmptyString.parse(opts.actorMemberId)
5013
5043
  });
5014
5044
  });
5015
- notes.command("create-contact").requiredOption("--actor-member-id <actorMemberId>").requiredOption("--contact-id <contactId>").requiredOption("--name <name>").requiredOption("--body <body>").option("--status <status>", "draft").action(async (opts, cmd) => {
5016
- await createContent("notes.create-contact", cmd, {
5045
+ content.command("create-contact").requiredOption("--actor-member-id <actorMemberId>").requiredOption("--contact-id <contactId>").requiredOption("--name <name>").requiredOption("--body <body>").option("--status <status>", "draft").action(async (opts, cmd) => {
5046
+ await createContent("content.create-contact", cmd, {
5017
5047
  type: "WrittenContent",
5018
5048
  name: nonEmptyString.parse(opts.name),
5019
5049
  content: nonEmptyString.parse(opts.body),
@@ -5970,26 +6000,26 @@ function emitUnsupportedMutation(params) {
5970
6000
  });
5971
6001
  }
5972
6002
  function registerMutationCapabilityCommands(program) {
5973
- const projectNotes = program.command("project-notes").description("Project notes node (read-only in CLI mutation surface)");
5974
- projectNotes.command("create").option("--path <path>", "Canonical path for the selected node").action((opts) => {
6003
+ const projectContent = program.command("project-content").description("Project content node (read-only in CLI mutation surface)");
6004
+ projectContent.command("create").option("--path <path>", "Canonical path for the selected node").action((opts) => {
5975
6005
  emitUnsupportedMutation({
5976
- command: "project-notes.create",
6006
+ command: "project-content.create",
5977
6007
  toolKey: "projects",
5978
6008
  nodeKey: "project_notes",
5979
6009
  canonicalPath: opts.path
5980
6010
  });
5981
6011
  });
5982
- projectNotes.command("update").option("--path <path>", "Canonical path for the selected node").action((opts) => {
6012
+ projectContent.command("update").option("--path <path>", "Canonical path for the selected node").action((opts) => {
5983
6013
  emitUnsupportedMutation({
5984
- command: "project-notes.update",
6014
+ command: "project-content.update",
5985
6015
  toolKey: "projects",
5986
6016
  nodeKey: "project_notes",
5987
6017
  canonicalPath: opts.path
5988
6018
  });
5989
6019
  });
5990
- projectNotes.command("destroy").option("--path <path>", "Canonical path for the selected node").action((opts) => {
6020
+ projectContent.command("destroy").option("--path <path>", "Canonical path for the selected node").action((opts) => {
5991
6021
  emitUnsupportedMutation({
5992
- command: "project-notes.destroy",
6022
+ command: "project-content.destroy",
5993
6023
  toolKey: "projects",
5994
6024
  nodeKey: "project_notes",
5995
6025
  canonicalPath: opts.path
@@ -6031,7 +6061,7 @@ function buildCli(options) {
6031
6061
  registerSystemToolCommands(program);
6032
6062
  registerFoundationCommands(program);
6033
6063
  registerChildEntityCommands(program);
6034
- registerNoteCommands(program);
6064
+ registerContentCommands(program);
6035
6065
  registerMutationCapabilityCommands(program);
6036
6066
  registerMarkdownTreeCommands(program);
6037
6067
  registerNavigationCommands(program);
package/dist/index.js CHANGED
@@ -722,8 +722,37 @@ async function graphqlRequest(input) {
722
722
  }
723
723
 
724
724
  // src/output.ts
725
+ import { writeSync } from "fs";
726
+ var RETRYABLE_WRITE_CODES = /* @__PURE__ */ new Set(["EAGAIN", "EINTR"]);
727
+ var RETRY_BACKOFF_MS = 1;
728
+ function sleepBriefly(ms) {
729
+ const lock = new Int32Array(new SharedArrayBuffer(4));
730
+ Atomics.wait(lock, 0, 0, ms);
731
+ }
732
+ function writeStdoutFully(text) {
733
+ const fd = typeof process.stdout.fd === "number" ? process.stdout.fd : 1;
734
+ const buffer = Buffer.from(text, "utf8");
735
+ let offset = 0;
736
+ while (offset < buffer.length) {
737
+ try {
738
+ const bytesWritten = writeSync(fd, buffer, offset, buffer.length - offset);
739
+ if (bytesWritten <= 0) {
740
+ sleepBriefly(RETRY_BACKOFF_MS);
741
+ continue;
742
+ }
743
+ offset += bytesWritten;
744
+ } catch (error) {
745
+ const code = typeof error === "object" && error && "code" in error ? String(error.code ?? "") : "";
746
+ if (RETRYABLE_WRITE_CODES.has(code)) {
747
+ sleepBriefly(RETRY_BACKOFF_MS);
748
+ continue;
749
+ }
750
+ throw error;
751
+ }
752
+ }
753
+ }
725
754
  function printEnvelope(envelope) {
726
- process.stdout.write(`${JSON.stringify(envelope)}
755
+ writeStdoutFully(`${JSON.stringify(envelope)}
727
756
  `);
728
757
  }
729
758
  function printEnvelopeAndExit(params) {
@@ -2593,7 +2622,7 @@ function registerProjectCommands(program) {
2593
2622
  const organizationId = resolveOrganizationId(context.organizationId);
2594
2623
  await runGraphqlQueryCommand({
2595
2624
  command: "projects.list",
2596
- operationName: "ProjectsIndexSlim",
2625
+ operationName: "ProjectsList",
2597
2626
  runtimeOptions: context.runtimeOptions,
2598
2627
  field: "projects",
2599
2628
  variables: normalizeGraphqlVariables2({
@@ -2621,7 +2650,7 @@ function registerProjectCommands(program) {
2621
2650
  const organizationId = resolveOrganizationId(context.organizationId);
2622
2651
  await runGraphqlQueryCommand({
2623
2652
  command: "projects.show",
2624
- operationName: "ProjectShowDeepV2",
2653
+ operationName: "ProjectsShow",
2625
2654
  runtimeOptions: context.runtimeOptions,
2626
2655
  field: "project",
2627
2656
  variables: {
@@ -4536,6 +4565,7 @@ function registerFoundationCommands(program) {
4536
4565
  import { z as z12 } from "zod";
4537
4566
  var idSchema11 = z12.string().min(1);
4538
4567
  var jsonObjectSchema = z12.record(z12.string(), z12.unknown());
4568
+ var childListMinimalSelectionSet = "{ data { id type attributes } count currentPage totalPages }";
4539
4569
  function parseJsonObject2(raw) {
4540
4570
  try {
4541
4571
  const parsed = JSON.parse(raw);
@@ -4736,11 +4766,11 @@ function registerChildEntityCommands(program) {
4736
4766
  updateField: "update_subtask",
4737
4767
  destroyField: "destroy_subtask",
4738
4768
  idVariable: "subtask_id",
4739
- listOperationName: "SubtasksForTask",
4740
- createOperationName: "CreateSubtask",
4741
- updateOperationName: "UpdateSubtask",
4742
- destroyOperationName: "DestroySubtask",
4743
- listSelectionSet: "{ data { id type name status taskId attributes } count currentPage totalPages }",
4769
+ listOperationName: "SubtasksList",
4770
+ createOperationName: "SubtasksCreate",
4771
+ updateOperationName: "SubtasksUpdate",
4772
+ destroyOperationName: "SubtasksDestroy",
4773
+ listSelectionSet: childListMinimalSelectionSet,
4744
4774
  listParentTypedField: "taskId",
4745
4775
  normalizeCreateBody: normalizeSubtaskCreateBody
4746
4776
  });
@@ -4755,11 +4785,11 @@ function registerChildEntityCommands(program) {
4755
4785
  updateField: "update_milestone",
4756
4786
  destroyField: "destroy_milestone",
4757
4787
  idVariable: "milestone_id",
4758
- listOperationName: "MilestonesForRock",
4759
- createOperationName: "CreateMilestone",
4760
- updateOperationName: "UpdateMilestone",
4761
- destroyOperationName: "DestroyMilestone",
4762
- listSelectionSet: "{ data { id type name slug status attributes } count currentPage totalPages }"
4788
+ listOperationName: "MilestonesList",
4789
+ createOperationName: "MilestonesCreate",
4790
+ updateOperationName: "MilestonesUpdate",
4791
+ destroyOperationName: "MilestonesDestroy",
4792
+ listSelectionSet: childListMinimalSelectionSet
4763
4793
  });
4764
4794
  registerChildCommands(program, {
4765
4795
  command: "subitems",
@@ -4772,11 +4802,11 @@ function registerChildEntityCommands(program) {
4772
4802
  updateField: "update_subitem",
4773
4803
  destroyField: "destroy_subitem",
4774
4804
  idVariable: "subitem_id",
4775
- listOperationName: "SubitemsForListItem",
4776
- createOperationName: "CreateSubitem",
4777
- updateOperationName: "UpdateSubitem",
4778
- destroyOperationName: "DestroySubitem",
4779
- listSelectionSet: "{ data { id type name status listItemId attributes } count currentPage totalPages }",
4805
+ listOperationName: "SubitemsList",
4806
+ createOperationName: "SubitemsCreate",
4807
+ updateOperationName: "SubitemsUpdate",
4808
+ destroyOperationName: "SubitemsDestroy",
4809
+ listSelectionSet: childListMinimalSelectionSet,
4780
4810
  listParentTypedField: "listItemId"
4781
4811
  });
4782
4812
  registerChildCommands(program, {
@@ -4790,11 +4820,11 @@ function registerChildEntityCommands(program) {
4790
4820
  updateField: "update_sub_todo",
4791
4821
  destroyField: "destroy_sub_todo",
4792
4822
  idVariable: "sub_todo_id",
4793
- listOperationName: "SubtodosForTodo",
4794
- createOperationName: "CreateSubTodo",
4795
- updateOperationName: "UpdateSubTodo",
4796
- destroyOperationName: "DestroySubTodo",
4797
- listSelectionSet: "{ data { id type name status todoId attributes } count currentPage totalPages }",
4823
+ listOperationName: "SubtodosList",
4824
+ createOperationName: "SubtodosCreate",
4825
+ updateOperationName: "SubtodosUpdate",
4826
+ destroyOperationName: "SubtodosDestroy",
4827
+ listSelectionSet: childListMinimalSelectionSet,
4798
4828
  listParentTypedField: "todoId"
4799
4829
  });
4800
4830
  registerChildCommands(program, {
@@ -4808,11 +4838,11 @@ function registerChildEntityCommands(program) {
4808
4838
  updateField: "update_sub_issue",
4809
4839
  destroyField: "destroy_sub_issue",
4810
4840
  idVariable: "sub_issue_id",
4811
- listOperationName: "SubissuesForIssue",
4812
- createOperationName: "CreateSubIssue",
4813
- updateOperationName: "UpdateSubIssue",
4814
- destroyOperationName: "DestroySubIssue",
4815
- listSelectionSet: "{ data { id type name status issueId attributes } count currentPage totalPages }",
4841
+ listOperationName: "SubissuesList",
4842
+ createOperationName: "SubissuesCreate",
4843
+ updateOperationName: "SubissuesUpdate",
4844
+ destroyOperationName: "SubissuesDestroy",
4845
+ listSelectionSet: childListMinimalSelectionSet,
4816
4846
  listParentTypedField: "issueId"
4817
4847
  });
4818
4848
  registerChildCommands(program, {
@@ -4826,23 +4856,23 @@ function registerChildEntityCommands(program) {
4826
4856
  updateField: "update_talking_point",
4827
4857
  destroyField: "destroy_talking_point",
4828
4858
  idVariable: "talking_point_id",
4829
- listOperationName: "TalkingPointsForMeeting",
4830
- createOperationName: "CreateTalkingPoint",
4831
- updateOperationName: "UpdateTalkingPoint",
4832
- destroyOperationName: "DestroyTalkingPoint",
4833
- listSelectionSet: "{ data { id type name description status priority rank dueDate memberId creatorId meetingId attributes } count currentPage totalPages }",
4859
+ listOperationName: "TalkingPointsList",
4860
+ createOperationName: "TalkingPointsCreate",
4861
+ updateOperationName: "TalkingPointsUpdate",
4862
+ destroyOperationName: "TalkingPointsDestroy",
4863
+ listSelectionSet: childListMinimalSelectionSet,
4834
4864
  listParentTypedField: "meetingId"
4835
4865
  });
4836
4866
  }
4837
4867
 
4838
- // src/commands/notes.ts
4868
+ // src/commands/content.ts
4839
4869
  import { z as z13 } from "zod";
4840
4870
  var idSchema12 = z13.string().min(1);
4841
4871
  var nonEmptyString = z13.string().min(1);
4842
4872
  function assertUpdateFields(params) {
4843
4873
  if (!params.name && !params.content && !params.status) {
4844
4874
  throw new CliError({
4845
- message: "notes update requires at least one of --name, --body, or --status.",
4875
+ message: "content update requires at least one of --name, --body, or --status.",
4846
4876
  kind: "invalid_args",
4847
4877
  status: 400,
4848
4878
  exitCode: EXIT_CODES.invalidArgs
@@ -4865,13 +4895,13 @@ async function createContent(command, cmd, payload) {
4865
4895
  })
4866
4896
  });
4867
4897
  }
4868
- function registerNoteCommands(program) {
4869
- const notes = program.command("notes").description("Content note operations");
4870
- notes.command("list").option("--contentable-type <contentableType>").option("--contentable-id <contentableId>").option("--member-id <memberId>").option("--focus-member-id <focusMemberId>").option("--focus-team-id <focusTeamId>").option("--page <page>").option("--per <per>").action(async (opts, cmd) => {
4898
+ function registerContentCommands(program) {
4899
+ const content = program.command("content").description("Content note operations");
4900
+ content.command("list").option("--contentable-type <contentableType>").option("--contentable-id <contentableId>").option("--member-id <memberId>").option("--focus-member-id <focusMemberId>").option("--focus-team-id <focusTeamId>").option("--page <page>").option("--per <per>").action(async (opts, cmd) => {
4871
4901
  const context = await resolveCommandContext(cmd.optsWithGlobals());
4872
4902
  const organizationId = resolveOrganizationId(context.organizationId);
4873
4903
  await runGraphqlQueryCommand({
4874
- command: "notes.list",
4904
+ command: "content.list",
4875
4905
  operationName: "ContentsIndex",
4876
4906
  runtimeOptions: context.runtimeOptions,
4877
4907
  field: "contents",
@@ -4886,15 +4916,15 @@ function registerNoteCommands(program) {
4886
4916
  per: opts.per
4887
4917
  }),
4888
4918
  isList: true,
4889
- selectionSet: "{ count currentPage totalPages data { id type name slug firstChildSlug rootParentSlug status contentType lastEdited organizationId memberId focusMemberId focusTeamId teamId creatorId createdAt updatedAt childCount assignmentType contentableId contentableSlug contentableType votesTotal labelIds rootContentId parentContentId attributes } }"
4919
+ selectionSet: "{ count currentPage totalPages data { id type attributes } }"
4890
4920
  });
4891
4921
  });
4892
- notes.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
4922
+ content.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
4893
4923
  const context = await resolveCommandContext(cmd.optsWithGlobals());
4894
4924
  const organizationId = resolveOrganizationId(context.organizationId);
4895
4925
  const id = idSchema12.parse(opts.id);
4896
4926
  await runGraphqlQueryCommand({
4897
- command: "notes.show",
4927
+ command: "content.show",
4898
4928
  operationName: "ContentShow",
4899
4929
  runtimeOptions: context.runtimeOptions,
4900
4930
  field: "content",
@@ -4906,7 +4936,7 @@ function registerNoteCommands(program) {
4906
4936
  selectionSet: "{ id type name slug firstChildSlug rootParentSlug status contentType lastEdited organizationId memberId focusMemberId focusTeamId teamId creatorId createdAt updatedAt childCount assignmentType contentableId contentableSlug contentableType votesTotal labelIds rootContentId parentContentId attributes }"
4907
4937
  });
4908
4938
  });
4909
- notes.command("update").requiredOption("--id <id>").option("--name <name>").option("--body <body>").option("--status <status>").action(async (opts, cmd) => {
4939
+ content.command("update").requiredOption("--id <id>").option("--name <name>").option("--body <body>").option("--status <status>").action(async (opts, cmd) => {
4910
4940
  assertUpdateFields({
4911
4941
  name: opts.name,
4912
4942
  content: opts.body,
@@ -4916,7 +4946,7 @@ function registerNoteCommands(program) {
4916
4946
  const organizationId = resolveOrganizationId(context.organizationId);
4917
4947
  const contentId = idSchema12.parse(opts.id);
4918
4948
  await runGraphqlMutationCommand({
4919
- command: "notes.update",
4949
+ command: "content.update",
4920
4950
  operationName: "UpdateContent",
4921
4951
  runtimeOptions: context.runtimeOptions,
4922
4952
  field: "update_content",
@@ -4933,12 +4963,12 @@ function registerNoteCommands(program) {
4933
4963
  })
4934
4964
  });
4935
4965
  });
4936
- notes.command("destroy").requiredOption("--id <id>").action(async (opts, cmd) => {
4966
+ content.command("destroy").requiredOption("--id <id>").action(async (opts, cmd) => {
4937
4967
  const context = await resolveCommandContext(cmd.optsWithGlobals());
4938
4968
  const organizationId = resolveOrganizationId(context.organizationId);
4939
4969
  const contentId = idSchema12.parse(opts.id);
4940
4970
  await runGraphqlMutationCommand({
4941
- command: "notes.destroy",
4971
+ command: "content.destroy",
4942
4972
  operationName: "DestroyContent",
4943
4973
  runtimeOptions: context.runtimeOptions,
4944
4974
  field: "destroy_content",
@@ -4948,9 +4978,9 @@ function registerNoteCommands(program) {
4948
4978
  })
4949
4979
  });
4950
4980
  });
4951
- notes.command("create-member").requiredOption("--target-member-id <targetMemberId>").requiredOption("--name <name>").requiredOption("--body <body>").option("--status <status>", "draft").action(async (opts, cmd) => {
4981
+ content.command("create-member").requiredOption("--target-member-id <targetMemberId>").requiredOption("--name <name>").requiredOption("--body <body>").option("--status <status>", "draft").action(async (opts, cmd) => {
4952
4982
  const targetMemberId = nonEmptyString.parse(opts.targetMemberId);
4953
- await createContent("notes.create-member", cmd, {
4983
+ await createContent("content.create-member", cmd, {
4954
4984
  type: "WrittenContent",
4955
4985
  name: nonEmptyString.parse(opts.name),
4956
4986
  content: nonEmptyString.parse(opts.body),
@@ -4962,9 +4992,9 @@ function registerNoteCommands(program) {
4962
4992
  focus_team_id: null
4963
4993
  });
4964
4994
  });
4965
- notes.command("create-manager").requiredOption("--actor-member-id <actorMemberId>").requiredOption("--target-member-id <targetMemberId>").requiredOption("--name <name>").requiredOption("--body <body>").option("--status <status>", "draft").action(async (opts, cmd) => {
4995
+ content.command("create-manager").requiredOption("--actor-member-id <actorMemberId>").requiredOption("--target-member-id <targetMemberId>").requiredOption("--name <name>").requiredOption("--body <body>").option("--status <status>", "draft").action(async (opts, cmd) => {
4966
4996
  const actorMemberId = nonEmptyString.parse(opts.actorMemberId);
4967
- await createContent("notes.create-manager", cmd, {
4997
+ await createContent("content.create-manager", cmd, {
4968
4998
  type: "WrittenContent",
4969
4999
  name: nonEmptyString.parse(opts.name),
4970
5000
  content: nonEmptyString.parse(opts.body),
@@ -4975,10 +5005,10 @@ function registerNoteCommands(program) {
4975
5005
  focus_member_id: nonEmptyString.parse(opts.targetMemberId)
4976
5006
  });
4977
5007
  });
4978
- notes.command("create-team").requiredOption("--actor-member-id <actorMemberId>").requiredOption("--team-id <teamId>").requiredOption("--name <name>").requiredOption("--body <body>").option("--status <status>", "draft").action(async (opts, cmd) => {
5008
+ content.command("create-team").requiredOption("--actor-member-id <actorMemberId>").requiredOption("--team-id <teamId>").requiredOption("--name <name>").requiredOption("--body <body>").option("--status <status>", "draft").action(async (opts, cmd) => {
4979
5009
  const actorMemberId = nonEmptyString.parse(opts.actorMemberId);
4980
5010
  const teamId = nonEmptyString.parse(opts.teamId);
4981
- await createContent("notes.create-team", cmd, {
5011
+ await createContent("content.create-team", cmd, {
4982
5012
  type: "WrittenContent",
4983
5013
  name: nonEmptyString.parse(opts.name),
4984
5014
  content: nonEmptyString.parse(opts.body),
@@ -4989,8 +5019,8 @@ function registerNoteCommands(program) {
4989
5019
  focus_team_id: teamId
4990
5020
  });
4991
5021
  });
4992
- notes.command("create-project").requiredOption("--actor-member-id <actorMemberId>").requiredOption("--project-id <projectId>").requiredOption("--name <name>").requiredOption("--body <body>").option("--status <status>", "draft").action(async (opts, cmd) => {
4993
- await createContent("notes.create-project", cmd, {
5022
+ content.command("create-project").requiredOption("--actor-member-id <actorMemberId>").requiredOption("--project-id <projectId>").requiredOption("--name <name>").requiredOption("--body <body>").option("--status <status>", "draft").action(async (opts, cmd) => {
5023
+ await createContent("content.create-project", cmd, {
4994
5024
  type: "WrittenContent",
4995
5025
  name: nonEmptyString.parse(opts.name),
4996
5026
  content: nonEmptyString.parse(opts.body),
@@ -5000,8 +5030,8 @@ function registerNoteCommands(program) {
5000
5030
  member_id: nonEmptyString.parse(opts.actorMemberId)
5001
5031
  });
5002
5032
  });
5003
- notes.command("create-customer").requiredOption("--actor-member-id <actorMemberId>").requiredOption("--customer-id <customerId>").requiredOption("--name <name>").requiredOption("--body <body>").option("--status <status>", "draft").action(async (opts, cmd) => {
5004
- await createContent("notes.create-customer", cmd, {
5033
+ content.command("create-customer").requiredOption("--actor-member-id <actorMemberId>").requiredOption("--customer-id <customerId>").requiredOption("--name <name>").requiredOption("--body <body>").option("--status <status>", "draft").action(async (opts, cmd) => {
5034
+ await createContent("content.create-customer", cmd, {
5005
5035
  type: "WrittenContent",
5006
5036
  name: nonEmptyString.parse(opts.name),
5007
5037
  content: nonEmptyString.parse(opts.body),
@@ -5011,8 +5041,8 @@ function registerNoteCommands(program) {
5011
5041
  member_id: nonEmptyString.parse(opts.actorMemberId)
5012
5042
  });
5013
5043
  });
5014
- notes.command("create-contact").requiredOption("--actor-member-id <actorMemberId>").requiredOption("--contact-id <contactId>").requiredOption("--name <name>").requiredOption("--body <body>").option("--status <status>", "draft").action(async (opts, cmd) => {
5015
- await createContent("notes.create-contact", cmd, {
5044
+ content.command("create-contact").requiredOption("--actor-member-id <actorMemberId>").requiredOption("--contact-id <contactId>").requiredOption("--name <name>").requiredOption("--body <body>").option("--status <status>", "draft").action(async (opts, cmd) => {
5045
+ await createContent("content.create-contact", cmd, {
5016
5046
  type: "WrittenContent",
5017
5047
  name: nonEmptyString.parse(opts.name),
5018
5048
  content: nonEmptyString.parse(opts.body),
@@ -5969,26 +5999,26 @@ function emitUnsupportedMutation(params) {
5969
5999
  });
5970
6000
  }
5971
6001
  function registerMutationCapabilityCommands(program) {
5972
- const projectNotes = program.command("project-notes").description("Project notes node (read-only in CLI mutation surface)");
5973
- projectNotes.command("create").option("--path <path>", "Canonical path for the selected node").action((opts) => {
6002
+ const projectContent = program.command("project-content").description("Project content node (read-only in CLI mutation surface)");
6003
+ projectContent.command("create").option("--path <path>", "Canonical path for the selected node").action((opts) => {
5974
6004
  emitUnsupportedMutation({
5975
- command: "project-notes.create",
6005
+ command: "project-content.create",
5976
6006
  toolKey: "projects",
5977
6007
  nodeKey: "project_notes",
5978
6008
  canonicalPath: opts.path
5979
6009
  });
5980
6010
  });
5981
- projectNotes.command("update").option("--path <path>", "Canonical path for the selected node").action((opts) => {
6011
+ projectContent.command("update").option("--path <path>", "Canonical path for the selected node").action((opts) => {
5982
6012
  emitUnsupportedMutation({
5983
- command: "project-notes.update",
6013
+ command: "project-content.update",
5984
6014
  toolKey: "projects",
5985
6015
  nodeKey: "project_notes",
5986
6016
  canonicalPath: opts.path
5987
6017
  });
5988
6018
  });
5989
- projectNotes.command("destroy").option("--path <path>", "Canonical path for the selected node").action((opts) => {
6019
+ projectContent.command("destroy").option("--path <path>", "Canonical path for the selected node").action((opts) => {
5990
6020
  emitUnsupportedMutation({
5991
- command: "project-notes.destroy",
6021
+ command: "project-content.destroy",
5992
6022
  toolKey: "projects",
5993
6023
  nodeKey: "project_notes",
5994
6024
  canonicalPath: opts.path
@@ -6030,7 +6060,7 @@ function buildCli(options) {
6030
6060
  registerSystemToolCommands(program);
6031
6061
  registerFoundationCommands(program);
6032
6062
  registerChildEntityCommands(program);
6033
- registerNoteCommands(program);
6063
+ registerContentCommands(program);
6034
6064
  registerMutationCapabilityCommands(program);
6035
6065
  registerMarkdownTreeCommands(program);
6036
6066
  registerNavigationCommands(program);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ted-galago/wave-cli",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "wave": "dist/index.js"