@wave-ai-os/wave-cli 0.1.86 → 0.1.88

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.js CHANGED
@@ -5,7 +5,226 @@ import { CommanderError, InvalidArgumentError } from "commander";
5
5
  import { ZodError } from "zod";
6
6
 
7
7
  // src/cli.ts
8
- import { Command } from "commander";
8
+ import { Command, Option as Option2 } from "commander";
9
+
10
+ // src/authStorage.ts
11
+ import { execFile } from "child_process";
12
+ import { constants, existsSync } from "fs";
13
+ import { access, mkdir, readFile, rm, stat, writeFile, chmod } from "fs/promises";
14
+ import { homedir } from "os";
15
+ import { dirname, join } from "path";
16
+ import { promisify } from "util";
17
+ var execFileAsync = promisify(execFile);
18
+ var KEYCHAIN_SERVICE = "wave-cli";
19
+ var FILE_NAME = "auth-token.json";
20
+ var DEFAULT_STORAGE_MODE = "auto";
21
+ var activeOptions = {};
22
+ function configureAuthStorage(options) {
23
+ activeOptions = { ...options };
24
+ }
25
+ async function withAuthStorageOptions(options, callback) {
26
+ const previous = activeOptions;
27
+ activeOptions = { ...options };
28
+ try {
29
+ return await callback();
30
+ } finally {
31
+ activeOptions = previous;
32
+ }
33
+ }
34
+ function normalize(raw) {
35
+ if (typeof raw !== "string") return void 0;
36
+ const trimmed = raw.trim();
37
+ return trimmed.length > 0 ? trimmed : void 0;
38
+ }
39
+ function authHome() {
40
+ return normalize(activeOptions.home) ?? join(homedir(), ".wave");
41
+ }
42
+ function tokenPath() {
43
+ return join(authHome(), FILE_NAME);
44
+ }
45
+ function configPath() {
46
+ return normalize(activeOptions.configPath) ?? join(authHome(), "config.json");
47
+ }
48
+ function storageMode() {
49
+ return activeOptions.mode ?? DEFAULT_STORAGE_MODE;
50
+ }
51
+ function accountForBaseUrl(baseUrl) {
52
+ return normalize(baseUrl) ?? "default";
53
+ }
54
+ async function commandExists(command) {
55
+ try {
56
+ await access(command, constants.X_OK);
57
+ return true;
58
+ } catch {
59
+ return false;
60
+ }
61
+ }
62
+ async function keychainAvailable() {
63
+ if (process.platform !== "darwin") return false;
64
+ if (storageMode() === "file" || storageMode() === "disabled") return false;
65
+ return commandExists("/usr/bin/security");
66
+ }
67
+ async function preferredStorage() {
68
+ const mode = storageMode();
69
+ if (mode === "disabled") return "disabled";
70
+ if (mode === "file") return "file";
71
+ if (mode === "keychain") return await keychainAvailable() ? "keychain" : "file";
72
+ return await keychainAvailable() ? "keychain" : "file";
73
+ }
74
+ async function readKeychainToken(baseUrl) {
75
+ try {
76
+ const { stdout } = await execFileAsync("/usr/bin/security", [
77
+ "find-generic-password",
78
+ "-a",
79
+ accountForBaseUrl(baseUrl),
80
+ "-s",
81
+ KEYCHAIN_SERVICE,
82
+ "-w"
83
+ ], { encoding: "utf8" });
84
+ return normalize(String(stdout)) ?? null;
85
+ } catch {
86
+ return null;
87
+ }
88
+ }
89
+ async function writeKeychainToken(token, baseUrl) {
90
+ await execFileAsync("/usr/bin/security", [
91
+ "add-generic-password",
92
+ "-a",
93
+ accountForBaseUrl(baseUrl),
94
+ "-s",
95
+ KEYCHAIN_SERVICE,
96
+ "-w",
97
+ token,
98
+ "-U"
99
+ ]);
100
+ }
101
+ async function deleteKeychainToken(baseUrl) {
102
+ try {
103
+ await execFileAsync("/usr/bin/security", [
104
+ "delete-generic-password",
105
+ "-a",
106
+ accountForBaseUrl(baseUrl),
107
+ "-s",
108
+ KEYCHAIN_SERVICE
109
+ ]);
110
+ return true;
111
+ } catch {
112
+ return false;
113
+ }
114
+ }
115
+ async function readFileToken(baseUrl) {
116
+ const path = tokenPath();
117
+ if (!existsSync(path)) return null;
118
+ try {
119
+ const raw = await readFile(path, "utf8");
120
+ const payload = JSON.parse(raw);
121
+ const token = normalize(payload.token);
122
+ const storedBaseUrl = normalize(payload.baseUrl);
123
+ const requestedBaseUrl = normalize(baseUrl);
124
+ if (!token) return null;
125
+ if (storedBaseUrl !== requestedBaseUrl) return null;
126
+ return token;
127
+ } catch {
128
+ return null;
129
+ }
130
+ }
131
+ async function writeFileToken(token, baseUrl) {
132
+ const home = authHome();
133
+ const path = tokenPath();
134
+ await mkdir(home, { recursive: true, mode: 448 });
135
+ await writeFile(
136
+ path,
137
+ `${JSON.stringify({ token, baseUrl: baseUrl ?? null, updatedAt: (/* @__PURE__ */ new Date()).toISOString() })}
138
+ `,
139
+ { mode: 384 }
140
+ );
141
+ await chmod(path, 384);
142
+ }
143
+ async function deleteFileToken() {
144
+ const path = tokenPath();
145
+ if (!existsSync(path)) return false;
146
+ await rm(path, { force: true });
147
+ return true;
148
+ }
149
+ async function readStoredToken(baseUrl) {
150
+ const mode = await preferredStorage();
151
+ if (mode === "disabled") return null;
152
+ if (mode === "keychain") {
153
+ const keychainToken = await readKeychainToken(baseUrl);
154
+ if (keychainToken) return { token: keychainToken, source: "keychain" };
155
+ }
156
+ const fileToken = await readFileToken(baseUrl);
157
+ return fileToken ? { token: fileToken, source: "file" } : null;
158
+ }
159
+ async function writeStoredToken(token, baseUrl) {
160
+ const mode = await preferredStorage();
161
+ if (mode === "disabled") {
162
+ return { kind: "disabled", available: false };
163
+ }
164
+ if (mode === "keychain") {
165
+ try {
166
+ await writeKeychainToken(token, baseUrl);
167
+ return {
168
+ kind: "keychain",
169
+ available: true,
170
+ service: KEYCHAIN_SERVICE,
171
+ account: accountForBaseUrl(baseUrl)
172
+ };
173
+ } catch {
174
+ await writeFileToken(token, baseUrl);
175
+ return { kind: "file", available: true, path: tokenPath() };
176
+ }
177
+ }
178
+ await writeFileToken(token, baseUrl);
179
+ return { kind: "file", available: true, path: tokenPath() };
180
+ }
181
+ async function persistBaseUrl(baseUrl) {
182
+ const path = configPath();
183
+ let existing = {};
184
+ if (existsSync(path)) {
185
+ const raw = await readFile(path, "utf8");
186
+ const parsed = JSON.parse(raw);
187
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
188
+ throw new Error(`Wave config file must contain a JSON object: ${path}`);
189
+ }
190
+ existing = parsed;
191
+ }
192
+ await mkdir(dirname(path), { recursive: true, mode: 448 });
193
+ await writeFile(path, `${JSON.stringify({ ...existing, baseUrl }, null, 2)}
194
+ `, {
195
+ mode: 384
196
+ });
197
+ await chmod(path, 384);
198
+ return path;
199
+ }
200
+ async function removeStoredToken(baseUrl) {
201
+ const removedKeychain = await deleteKeychainToken(baseUrl);
202
+ const removedFile = await deleteFileToken();
203
+ return removedKeychain || removedFile;
204
+ }
205
+ async function getAuthStorageInfo(baseUrl) {
206
+ const mode = await preferredStorage();
207
+ if (mode === "disabled") return { kind: "disabled", available: false };
208
+ if (mode === "keychain") {
209
+ return {
210
+ kind: "keychain",
211
+ available: true,
212
+ service: KEYCHAIN_SERVICE,
213
+ account: accountForBaseUrl(baseUrl)
214
+ };
215
+ }
216
+ const path = tokenPath();
217
+ let available = true;
218
+ if (existsSync(path)) {
219
+ try {
220
+ const modeBits = (await stat(path)).mode & 511;
221
+ available = modeBits === 384;
222
+ } catch {
223
+ available = false;
224
+ }
225
+ }
226
+ return { kind: "file", available, path };
227
+ }
9
228
 
10
229
  // src/commands/tasks.ts
11
230
  import { z as z3 } from "zod";
@@ -191,7 +410,7 @@ var ATLAS_LEDGER_VARIABLE_TYPES = {
191
410
  };
192
411
  var SECRET_KEY_PATTERN = /(authorization|password|passwd|secret|token|jwt|credential|api[_-]?key)/i;
193
412
  var MAX_EVIDENCE_DEPTH = 5;
194
- function normalize(raw) {
413
+ function normalize2(raw) {
195
414
  if (typeof raw !== "string") {
196
415
  return void 0;
197
416
  }
@@ -199,12 +418,12 @@ function normalize(raw) {
199
418
  return trimmed.length > 0 ? trimmed : void 0;
200
419
  }
201
420
  function atlasContextFromConfig(config) {
202
- const organizationId = normalize(config.organizationId);
203
- const memberId = normalize(config.atlasMemberId);
204
- const chatId = normalize(config.atlasChatId);
205
- const assistantMessageId = normalize(config.atlasAssistantMessageId);
206
- const activeTool = normalize(config.atlasActiveTool);
207
- const targetTool = normalize(config.atlasTargetTool);
421
+ const organizationId = normalize2(config.organizationId);
422
+ const memberId = normalize2(config.atlasMemberId);
423
+ const chatId = normalize2(config.atlasChatId);
424
+ const assistantMessageId = normalize2(config.atlasAssistantMessageId);
425
+ const activeTool = normalize2(config.atlasActiveTool);
426
+ const targetTool = normalize2(config.atlasTargetTool);
208
427
  if (!organizationId || !memberId || !chatId || !assistantMessageId || !activeTool || !targetTool) {
209
428
  return null;
210
429
  }
@@ -215,8 +434,8 @@ function atlasContextFromConfig(config) {
215
434
  assistantMessageId,
216
435
  activeTool,
217
436
  targetTool,
218
- routeReason: normalize(config.atlasRouteReason),
219
- actionId: normalize(config.atlasActionId)
437
+ routeReason: normalize2(config.atlasRouteReason),
438
+ actionId: normalize2(config.atlasActionId)
220
439
  };
221
440
  }
222
441
  function summarizeVariableShape(value, key = void 0, depth = 0) {
@@ -252,7 +471,7 @@ function shouldReportAtlasActionLedgerEvent(input) {
252
471
  return input.operationType === "mutation" && input.field !== ATLAS_LEDGER_FIELD;
253
472
  }
254
473
  function deterministicAtlasActionId(input, config) {
255
- const requestSegment = normalize(config.requestId) ? `:${config.requestId}` : "";
474
+ const requestSegment = normalize2(config.requestId) ? `:${config.requestId}` : "";
256
475
  return `cli:${input.command}:${input.field}${requestSegment}`;
257
476
  }
258
477
  function buildAtlasEvidenceRefs(params) {
@@ -583,118 +802,6 @@ function buildSparse422Diagnostic(input) {
583
802
  }
584
803
  };
585
804
  }
586
- function isFeedbackCreateCommand(input) {
587
- return input.operationType === "mutation" && input.command === "feedbacks.create";
588
- }
589
- function asRecord(value) {
590
- if (!value || typeof value !== "object" || Array.isArray(value)) {
591
- return null;
592
- }
593
- return value;
594
- }
595
- function asNonEmptyString(value) {
596
- if (typeof value !== "string") {
597
- return null;
598
- }
599
- const trimmed = value.trim();
600
- return trimmed.length > 0 ? trimmed : null;
601
- }
602
- function extractFeedbackIdentity(variables) {
603
- const organizationId = asNonEmptyString(variables.organization_id) ?? asNonEmptyString(variables.organizationId);
604
- const params = asRecord(variables.params);
605
- const feedback = params ? asRecord(params.feedback) : null;
606
- const name = feedback ? asNonEmptyString(feedback.name) : null;
607
- const quarter = feedback ? asNonEmptyString(feedback.quarter) : null;
608
- const year = feedback ? asNonEmptyString(feedback.year) : null;
609
- if (!organizationId || !name || !quarter || !year) {
610
- return null;
611
- }
612
- return {
613
- organizationId,
614
- name,
615
- quarter,
616
- year
617
- };
618
- }
619
- function collectMessageStrings(value) {
620
- if (typeof value === "string") {
621
- return [value];
622
- }
623
- if (Array.isArray(value)) {
624
- return value.flatMap((entry2) => collectMessageStrings(entry2));
625
- }
626
- if (!value || typeof value !== "object") {
627
- return [];
628
- }
629
- return Object.values(value).flatMap(
630
- (entry2) => collectMessageStrings(entry2)
631
- );
632
- }
633
- function isDuplicateFeedbackMutationError(mutationPayload) {
634
- const messages = collectMessageStrings(mutationPayload.errors);
635
- return messages.some(
636
- (message) => message.toLowerCase().includes("already been taken")
637
- );
638
- }
639
- function extractFeedbackListNode(graph) {
640
- const data = asRecord(graph.data);
641
- const feedbacks = data ? asRecord(data.feedbacks) : null;
642
- if (!feedbacks) {
643
- return null;
644
- }
645
- const rows = Array.isArray(feedbacks.data) ? feedbacks.data : [];
646
- const first = rows.find((entry2) => asRecord(entry2));
647
- return first ? first : null;
648
- }
649
- function buildFeedbackReuseEnvelope(params) {
650
- return {
651
- envelope: buildEnvelope({
652
- ok: true,
653
- command: params.command,
654
- status: params.status,
655
- data: {
656
- [params.field]: {
657
- ok: true,
658
- status: params.status,
659
- errorCode: null,
660
- data: {
661
- data: params.feedbackNode
662
- },
663
- errors: null,
664
- reusedExisting: true,
665
- idempotency: {
666
- reason: params.reason
667
- }
668
- }
669
- },
670
- error: null,
671
- requestId: params.requestId
672
- }),
673
- exitCode: EXIT_CODES.success
674
- };
675
- }
676
- function buildFeedbackFindRequestBody(command, identity) {
677
- return buildGraphqlBody({
678
- config: {
679
- baseUrl: "http://localhost",
680
- token: "placeholder",
681
- timeoutMs: 1e3,
682
- debug: false
683
- },
684
- command,
685
- operationType: "query",
686
- field: "feedbacks",
687
- variables: {
688
- organization_id: identity.organizationId,
689
- name: identity.name,
690
- quarter: identity.quarter,
691
- year: identity.year,
692
- page: 1,
693
- per: 1
694
- },
695
- selectionSet: "{ data { id type attributes { id name slug year quarter organizationId memberIds } } count currentPage totalPages }"
696
- });
697
- }
698
805
  async function requestGraphqlHttp(params) {
699
806
  const response = await fetch(params.url, {
700
807
  method: "POST",
@@ -786,29 +893,6 @@ async function finalizeGraphqlResult(input, url, result) {
786
893
  }
787
894
  return result;
788
895
  }
789
- async function findExistingFeedback(params) {
790
- const command = `${params.input.command}.find-existing`;
791
- const body = buildFeedbackFindRequestBody(command, params.identity);
792
- const http = await requestGraphqlHttp({
793
- input: params.input,
794
- url: params.url,
795
- requestId: params.requestId,
796
- body,
797
- controller: params.controller
798
- });
799
- const gqlErrors = http.graph.errors;
800
- if (Array.isArray(gqlErrors) && gqlErrors.length > 0) {
801
- return null;
802
- }
803
- const feedbackNode = extractFeedbackListNode(http.graph);
804
- if (!feedbackNode) {
805
- return null;
806
- }
807
- return {
808
- feedbackNode,
809
- requestId: http.requestId
810
- };
811
- }
812
896
  function graphqlTypeForValue(value) {
813
897
  if (Array.isArray(value)) {
814
898
  const firstNonNull = value.find((item) => item !== null && item !== void 0);
@@ -908,32 +992,6 @@ async function graphqlRequest(input) {
908
992
  const controller = new AbortController();
909
993
  const timeoutId = setTimeout(() => controller.abort(), input.config.timeoutMs);
910
994
  try {
911
- if (isFeedbackCreateCommand(input)) {
912
- const feedbackIdentity = extractFeedbackIdentity(input.variables);
913
- if (feedbackIdentity) {
914
- const existing = await findExistingFeedback({
915
- input,
916
- url,
917
- requestId,
918
- controller,
919
- identity: feedbackIdentity
920
- });
921
- if (existing) {
922
- return finalizeGraphqlResult(
923
- input,
924
- url,
925
- buildFeedbackReuseEnvelope({
926
- command: input.command,
927
- field: input.field,
928
- status: 200,
929
- requestId: existing.requestId,
930
- feedbackNode: existing.feedbackNode,
931
- reason: "preexisting"
932
- })
933
- );
934
- }
935
- }
936
- }
937
995
  const http = await requestGraphqlHttpWithRetry({
938
996
  input,
939
997
  url,
@@ -978,32 +1036,6 @@ async function graphqlRequest(input) {
978
1036
  const ok = Boolean(mutationPayload.ok);
979
1037
  const status = typeof mutationPayload.status === "number" ? mutationPayload.status : ok ? 200 : 400;
980
1038
  if (!ok) {
981
- if (isFeedbackCreateCommand(input) && isDuplicateFeedbackMutationError(mutationPayload)) {
982
- const feedbackIdentity = extractFeedbackIdentity(input.variables);
983
- if (feedbackIdentity) {
984
- const existing = await findExistingFeedback({
985
- input,
986
- url,
987
- requestId: responseRequestId,
988
- controller,
989
- identity: feedbackIdentity
990
- });
991
- if (existing) {
992
- return finalizeGraphqlResult(
993
- input,
994
- url,
995
- buildFeedbackReuseEnvelope({
996
- command: input.command,
997
- field: input.field,
998
- status: 200,
999
- requestId: existing.requestId,
1000
- feedbackNode: existing.feedbackNode,
1001
- reason: "duplicate_race"
1002
- })
1003
- );
1004
- }
1005
- }
1006
- }
1007
1039
  const mutationErrors = mutationPayload.errors ?? null;
1008
1040
  const details = {
1009
1041
  errors: mutationErrors,
@@ -1164,6 +1196,8 @@ var RESOURCE_QUERY_FIELDS = {
1164
1196
  "archivedAt",
1165
1197
  "organizationId",
1166
1198
  "memberId",
1199
+ "member",
1200
+ "assignee",
1167
1201
  "creatorId",
1168
1202
  "projectId",
1169
1203
  "projectSlug",
@@ -1211,6 +1245,7 @@ var RESOURCE_QUERY_FIELDS = {
1211
1245
  "role",
1212
1246
  "status",
1213
1247
  "title",
1248
+ "rolePurpose",
1214
1249
  "firstName",
1215
1250
  "lastName",
1216
1251
  "createdAt",
@@ -1456,14 +1491,6 @@ var RESOURCE_QUERY_FIELDS = {
1456
1491
  "acceptedAnswerIds",
1457
1492
  "labelIds"
1458
1493
  ],
1459
- feedback: [
1460
- "name",
1461
- "slug",
1462
- "year",
1463
- "quarter",
1464
- "organizationId",
1465
- "memberIds"
1466
- ],
1467
1494
  survey: [
1468
1495
  "name",
1469
1496
  "slug",
@@ -1625,7 +1652,6 @@ var RESOURCE_FIELD_ALIASES = {
1625
1652
  stand_ups: "stand_up",
1626
1653
  headlines: "headline",
1627
1654
  questions: "question",
1628
- feedbacks: "feedback",
1629
1655
  surveys: "survey",
1630
1656
  responsibilities: "responsibility",
1631
1657
  smart_kpi_views: "smart_kpi_view",
@@ -1661,7 +1687,8 @@ function defaultQuerySelectionSet(field, isList) {
1661
1687
  const canonicalField = RESOURCE_FIELD_ALIASES[field] ?? field;
1662
1688
  const explicitFields = RESOURCE_QUERY_FIELDS[canonicalField];
1663
1689
  if (explicitFields) {
1664
- const attributes = explicitFields.length > 0 ? `attributes { ${Array.from(/* @__PURE__ */ new Set(["id", ...explicitFields])).join(" ")} }` : "attributes";
1690
+ const detailFields = canonicalField === "smart_kpi" && !isList ? ["smartKpiMetrics { id date value }", "smartKpiGoals { id date value }"] : [];
1691
+ const attributes = explicitFields.length > 0 ? `attributes { ${Array.from(/* @__PURE__ */ new Set(["id", ...explicitFields, ...detailFields])).join(" ")} }` : "attributes";
1665
1692
  if (isList) {
1666
1693
  return `{ data { id type ${attributes} } count currentPage totalPages }`;
1667
1694
  }
@@ -1880,213 +1907,6 @@ import { existsSync as existsSync2 } from "fs";
1880
1907
  import { readFile as readFile2 } from "fs/promises";
1881
1908
  import { join as join2 } from "path";
1882
1909
 
1883
- // src/authStorage.ts
1884
- import { execFile } from "child_process";
1885
- import { constants, existsSync } from "fs";
1886
- import { access, mkdir, readFile, rm, stat, writeFile, chmod } from "fs/promises";
1887
- import { homedir } from "os";
1888
- import { dirname, join } from "path";
1889
- import { promisify } from "util";
1890
- var execFileAsync = promisify(execFile);
1891
- var KEYCHAIN_SERVICE = "wave-cli";
1892
- var FILE_NAME = "auth-token.json";
1893
- function normalize2(raw) {
1894
- if (typeof raw !== "string") return void 0;
1895
- const trimmed = raw.trim();
1896
- return trimmed.length > 0 ? trimmed : void 0;
1897
- }
1898
- function authHome(env = process.env) {
1899
- return normalize2(env.WAVE_CLI_HOME) ?? join(homedir(), ".wave");
1900
- }
1901
- function tokenPath(env = process.env) {
1902
- return join(authHome(env), FILE_NAME);
1903
- }
1904
- function configPath(env = process.env) {
1905
- return normalize2(env.WAVE_CONFIG_PATH) ?? join(authHome(env), "config.json");
1906
- }
1907
- function storageMode(env = process.env) {
1908
- const raw = normalize2(env.WAVE_CLI_AUTH_STORAGE)?.toLowerCase();
1909
- if (raw === "keychain" || raw === "file" || raw === "disabled") return raw;
1910
- return "auto";
1911
- }
1912
- function accountForBaseUrl(baseUrl) {
1913
- return normalize2(baseUrl) ?? "default";
1914
- }
1915
- async function commandExists(command) {
1916
- try {
1917
- await access(command, constants.X_OK);
1918
- return true;
1919
- } catch {
1920
- return false;
1921
- }
1922
- }
1923
- async function keychainAvailable(env = process.env) {
1924
- if (process.platform !== "darwin") return false;
1925
- if (storageMode(env) === "file" || storageMode(env) === "disabled") return false;
1926
- return commandExists("/usr/bin/security");
1927
- }
1928
- async function preferredStorage(env = process.env) {
1929
- const mode = storageMode(env);
1930
- if (mode === "disabled") return "disabled";
1931
- if (mode === "file") return "file";
1932
- if (mode === "keychain") return await keychainAvailable(env) ? "keychain" : "file";
1933
- return await keychainAvailable(env) ? "keychain" : "file";
1934
- }
1935
- async function readKeychainToken(baseUrl) {
1936
- try {
1937
- const { stdout } = await execFileAsync("/usr/bin/security", [
1938
- "find-generic-password",
1939
- "-a",
1940
- accountForBaseUrl(baseUrl),
1941
- "-s",
1942
- KEYCHAIN_SERVICE,
1943
- "-w"
1944
- ], { encoding: "utf8" });
1945
- return normalize2(String(stdout)) ?? null;
1946
- } catch {
1947
- return null;
1948
- }
1949
- }
1950
- async function writeKeychainToken(token, baseUrl) {
1951
- await execFileAsync("/usr/bin/security", [
1952
- "add-generic-password",
1953
- "-a",
1954
- accountForBaseUrl(baseUrl),
1955
- "-s",
1956
- KEYCHAIN_SERVICE,
1957
- "-w",
1958
- token,
1959
- "-U"
1960
- ]);
1961
- }
1962
- async function deleteKeychainToken(baseUrl) {
1963
- try {
1964
- await execFileAsync("/usr/bin/security", [
1965
- "delete-generic-password",
1966
- "-a",
1967
- accountForBaseUrl(baseUrl),
1968
- "-s",
1969
- KEYCHAIN_SERVICE
1970
- ]);
1971
- return true;
1972
- } catch {
1973
- return false;
1974
- }
1975
- }
1976
- async function readFileToken(baseUrl, env = process.env) {
1977
- const path = tokenPath(env);
1978
- if (!existsSync(path)) return null;
1979
- try {
1980
- const raw = await readFile(path, "utf8");
1981
- const payload = JSON.parse(raw);
1982
- const token = normalize2(payload.token);
1983
- const storedBaseUrl = normalize2(payload.baseUrl);
1984
- const requestedBaseUrl = normalize2(baseUrl);
1985
- if (!token) return null;
1986
- if (storedBaseUrl !== requestedBaseUrl) return null;
1987
- return token;
1988
- } catch {
1989
- return null;
1990
- }
1991
- }
1992
- async function writeFileToken(token, baseUrl, env = process.env) {
1993
- const home = authHome(env);
1994
- const path = tokenPath(env);
1995
- await mkdir(home, { recursive: true, mode: 448 });
1996
- await writeFile(
1997
- path,
1998
- `${JSON.stringify({ token, baseUrl: baseUrl ?? null, updatedAt: (/* @__PURE__ */ new Date()).toISOString() })}
1999
- `,
2000
- { mode: 384 }
2001
- );
2002
- await chmod(path, 384);
2003
- }
2004
- async function deleteFileToken(env = process.env) {
2005
- const path = tokenPath(env);
2006
- if (!existsSync(path)) return false;
2007
- await rm(path, { force: true });
2008
- return true;
2009
- }
2010
- async function readStoredToken(baseUrl) {
2011
- const mode = await preferredStorage();
2012
- if (mode === "disabled") return null;
2013
- if (mode === "keychain") {
2014
- const keychainToken = await readKeychainToken(baseUrl);
2015
- if (keychainToken) return { token: keychainToken, source: "keychain" };
2016
- }
2017
- const fileToken = await readFileToken(baseUrl);
2018
- return fileToken ? { token: fileToken, source: "file" } : null;
2019
- }
2020
- async function writeStoredToken(token, baseUrl) {
2021
- const mode = await preferredStorage();
2022
- if (mode === "disabled") {
2023
- return { kind: "disabled", available: false };
2024
- }
2025
- if (mode === "keychain") {
2026
- try {
2027
- await writeKeychainToken(token, baseUrl);
2028
- return {
2029
- kind: "keychain",
2030
- available: true,
2031
- service: KEYCHAIN_SERVICE,
2032
- account: accountForBaseUrl(baseUrl)
2033
- };
2034
- } catch {
2035
- await writeFileToken(token, baseUrl);
2036
- return { kind: "file", available: true, path: tokenPath() };
2037
- }
2038
- }
2039
- await writeFileToken(token, baseUrl);
2040
- return { kind: "file", available: true, path: tokenPath() };
2041
- }
2042
- async function persistBaseUrl(baseUrl, env = process.env) {
2043
- const path = configPath(env);
2044
- let existing = {};
2045
- if (existsSync(path)) {
2046
- const raw = await readFile(path, "utf8");
2047
- const parsed = JSON.parse(raw);
2048
- if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
2049
- throw new Error(`Wave config file must contain a JSON object: ${path}`);
2050
- }
2051
- existing = parsed;
2052
- }
2053
- await mkdir(dirname(path), { recursive: true, mode: 448 });
2054
- await writeFile(path, `${JSON.stringify({ ...existing, baseUrl }, null, 2)}
2055
- `, {
2056
- mode: 384
2057
- });
2058
- await chmod(path, 384);
2059
- return path;
2060
- }
2061
- async function removeStoredToken(baseUrl) {
2062
- const removedKeychain = await deleteKeychainToken(baseUrl);
2063
- const removedFile = await deleteFileToken();
2064
- return removedKeychain || removedFile;
2065
- }
2066
- async function getAuthStorageInfo(baseUrl) {
2067
- const mode = await preferredStorage();
2068
- if (mode === "disabled") return { kind: "disabled", available: false };
2069
- if (mode === "keychain") {
2070
- return {
2071
- kind: "keychain",
2072
- available: true,
2073
- service: KEYCHAIN_SERVICE,
2074
- account: accountForBaseUrl(baseUrl)
2075
- };
2076
- }
2077
- const path = tokenPath();
2078
- let available = true;
2079
- if (existsSync(path)) {
2080
- try {
2081
- const modeBits = (await stat(path)).mode & 511;
2082
- available = modeBits === 384;
2083
- } catch {
2084
- available = false;
2085
- }
2086
- }
2087
- return { kind: "file", available, path };
2088
- }
2089
-
2090
1910
  // src/authClient.ts
2091
1911
  import { randomUUID as randomUUID2 } from "crypto";
2092
1912
 
@@ -2533,17 +2353,15 @@ async function resolveWithAuthenticatedOrganization(context) {
2533
2353
  if (organizationId) resolved.organizationId = organizationId;
2534
2354
  return resolved;
2535
2355
  }
2536
- function defaultConfigPath(env) {
2537
- const explicitEnv = normalize3(env.WAVE_CONFIG_PATH);
2538
- if (explicitEnv) return explicitEnv;
2539
- const candidate = join2(authHome(env), "config.json");
2356
+ function defaultConfigPath() {
2357
+ const candidate = join2(authHome(), "config.json");
2540
2358
  return existsSync2(candidate) ? candidate : void 0;
2541
2359
  }
2542
2360
  async function resolveConfigFileContext(options, env) {
2543
2361
  const path = firstDefined(
2544
2362
  normalize3(options.configPath),
2545
2363
  normalize3(options.config),
2546
- defaultConfigPath(env)
2364
+ defaultConfigPath()
2547
2365
  );
2548
2366
  if (!path) return {};
2549
2367
  if (!existsSync2(path)) {
@@ -2688,13 +2506,13 @@ function parseRequiredOption(raw, flag) {
2688
2506
  function optionKey(flag) {
2689
2507
  return flag.replace(/-([a-z])/g, (_, char) => char.toUpperCase());
2690
2508
  }
2691
- function asRecord2(value) {
2509
+ function asRecord(value) {
2692
2510
  return value && typeof value === "object" && !Array.isArray(value) ? value : null;
2693
2511
  }
2694
2512
  function visibleSearchText(row) {
2695
- const record = asRecord2(row);
2513
+ const record = asRecord(row);
2696
2514
  if (!record) return "";
2697
- const attributes = asRecord2(record.attributes);
2515
+ const attributes = asRecord(record.attributes);
2698
2516
  const values = [];
2699
2517
  for (const field of SEARCHABLE_VISIBLE_FIELDS) {
2700
2518
  const topLevelValue = record[field];
@@ -2708,7 +2526,7 @@ function matchesSearchQuery(row, query) {
2708
2526
  return visibleSearchText(row).includes(query.toLowerCase());
2709
2527
  }
2710
2528
  function filterListEnvelopeByQuery(payload, query) {
2711
- const record = asRecord2(payload);
2529
+ const record = asRecord(payload);
2712
2530
  if (!record || !Array.isArray(record.data)) return payload;
2713
2531
  const filteredData = record.data.filter((row) => matchesSearchQuery(row, query));
2714
2532
  return {
@@ -3635,9 +3453,65 @@ var subitemUpdateContract = {
3635
3453
  rootKey: "subitem",
3636
3454
  fields: subitemFields
3637
3455
  };
3456
+ var reminderFields = {
3457
+ title: { type: "string", example: "Follow up with customer" },
3458
+ description: { type: "string" },
3459
+ due_at: { type: "string" },
3460
+ starts_at: { type: "string" },
3461
+ timezone: { type: "string", example: "America/Phoenix" },
3462
+ schedule: {
3463
+ type: "object",
3464
+ example: { type: "once", due_at: "2026-09-01T09:00:00-07:00" }
3465
+ },
3466
+ notification: {
3467
+ type: "object",
3468
+ example: { channels: ["in_app"], lead_minutes: 15 }
3469
+ },
3470
+ resources_attributes: { type: "array" },
3471
+ reminder_delegates_attributes: { type: "array" }
3472
+ };
3473
+ var reminderCreateContract = {
3474
+ rootKey: "reminder",
3475
+ fields: reminderFields,
3476
+ required: ["title", "schedule", "notification"],
3477
+ additionalProperties: false
3478
+ };
3479
+ var reminderUpdateContract = {
3480
+ rootKey: "reminder",
3481
+ fields: reminderFields,
3482
+ additionalProperties: false
3483
+ };
3484
+ var sketchFields = {
3485
+ name: { type: "string" },
3486
+ creation_key: { type: "string" },
3487
+ member_id: { type: "string" },
3488
+ teams_ids: { type: "array", items: { type: "string" } },
3489
+ status: {
3490
+ type: "string",
3491
+ enum: ["backlog", "planned", "in_progress", "completed", "cancelled", "ready_for_qa", "blocked"]
3492
+ },
3493
+ priority: { type: "string", enum: PRIORITIES }
3494
+ };
3495
+ var sketchCreateContract = {
3496
+ rootKey: "sketch",
3497
+ fields: sketchFields,
3498
+ required: ["name", "teams_ids", "creation_key"],
3499
+ additionalProperties: false
3500
+ };
3501
+ var sketchMetadataUpdateContract = {
3502
+ rootKey: "sketch",
3503
+ fields: Object.fromEntries(
3504
+ Object.entries(sketchFields).filter(([field]) => field !== "creation_key")
3505
+ ),
3506
+ additionalProperties: false
3507
+ };
3638
3508
  var CONTRACTS = {
3639
3509
  "list-items.create": listItemCreateContract,
3640
3510
  "list-items.update": listItemUpdateContract,
3511
+ "reminders.create": reminderCreateContract,
3512
+ "reminders.update": reminderUpdateContract,
3513
+ "sketches.create": sketchCreateContract,
3514
+ "sketches.update-metadata": sketchMetadataUpdateContract,
3641
3515
  "subitems.create": subitemCreateContract,
3642
3516
  "subitems.update": subitemUpdateContract
3643
3517
  };
@@ -3709,8 +3583,10 @@ function validateOperationDataJson(operationId2, value) {
3709
3583
  const missing = (contract.required ?? []).filter(
3710
3584
  (field) => entity[field] === void 0 || entity[field] === null || entity[field] === ""
3711
3585
  );
3586
+ const unsupported = contract.additionalProperties === false ? Object.keys(entity).filter((field) => !Object.prototype.hasOwnProperty.call(contract.fields, field)) : [];
3712
3587
  return [
3713
3588
  ...missing.map((field) => `${contract.rootKey}.${field} is required.`),
3589
+ ...unsupported.map((field) => `${contract.rootKey}.${field} is not permitted.`),
3714
3590
  ...validateFields(contract.fields, entity, [contract.rootKey])
3715
3591
  ].map(
3716
3592
  (error) => `Invalid input value for dataJson: ${error}`
@@ -3754,14 +3630,25 @@ function entitySchema(contract) {
3754
3630
  ])
3755
3631
  ),
3756
3632
  ...contract.required ? { required: [...contract.required] } : {},
3757
- additionalProperties: true
3633
+ additionalProperties: contract.additionalProperties ?? true
3758
3634
  };
3759
3635
  }
3636
+ function exampleValue2(contract) {
3637
+ if (contract.example !== void 0) return contract.example;
3638
+ if (contract.type === "array") return [];
3639
+ if (contract.type === "object") return {};
3640
+ if (contract.type === "number") return 0;
3641
+ if (contract.type === "boolean") return false;
3642
+ return "example";
3643
+ }
3760
3644
  function exampleDataJsonForOperation(operationId2) {
3761
3645
  const contract = CONTRACTS[operationId2];
3762
3646
  if (!contract) return null;
3763
3647
  const entity = Object.fromEntries(
3764
- (contract.required ?? []).map((field) => [field, "example"])
3648
+ (contract.required ?? []).map((field) => {
3649
+ const fieldContract = contract.fields[field];
3650
+ return [field, fieldContract ? exampleValue2(fieldContract) : "example"];
3651
+ })
3765
3652
  );
3766
3653
  return { [contract.rootKey]: entity };
3767
3654
  }
@@ -3867,7 +3754,7 @@ function registerEntityCrudCommands(program, config) {
3867
3754
  const entityCommand = program.command(config.command).description(config.description);
3868
3755
  const createHelp4 = buildDataJsonHelp(config.rootKey, "create") ?? "JSON object, optionally wrapped with root key";
3869
3756
  const updateHelp5 = buildDataJsonHelp(config.rootKey, "update") ?? "JSON object, optionally wrapped with root key";
3870
- const listField2 = config.listField ?? (config.resourcePath === "feedback" ? "feedbacks" : config.resourcePath);
3757
+ const listField2 = config.listField ?? config.resourcePath;
3871
3758
  const list = entityCommand.command("list").option("--page <page>").option("--per <per>");
3872
3759
  const listParams = config.listParams ?? [];
3873
3760
  const listParamHelp = config.listParamHelp ?? {};
@@ -3907,12 +3794,14 @@ function registerEntityCrudCommands(program, config) {
3907
3794
  isList: true
3908
3795
  });
3909
3796
  });
3910
- registerGraphqlSearchCommand(entityCommand, {
3911
- command: config.command,
3912
- field: listField2,
3913
- variableTypes: config.listVariableTypes,
3914
- selectionSet: config.listSelectionSet
3915
- });
3797
+ if (config.registerSearch !== false) {
3798
+ registerGraphqlSearchCommand(entityCommand, {
3799
+ command: config.command,
3800
+ field: listField2,
3801
+ variableTypes: config.listVariableTypes,
3802
+ selectionSet: config.listSelectionSet
3803
+ });
3804
+ }
3916
3805
  const show = entityCommand.command("show").requiredOption("--id <id>");
3917
3806
  showParams.forEach((param) => {
3918
3807
  const cliParam = param.replace(/_/g, "-");
@@ -3923,7 +3812,7 @@ function registerEntityCrudCommands(program, config) {
3923
3812
  const context = await resolveCommandContext(cmd.optsWithGlobals());
3924
3813
  const organizationId = resolveOrganizationId(context.organizationId);
3925
3814
  const defaultCommand = `${config.command}.show`;
3926
- const defaultField = config.showField ?? (config.resourcePath === "feedback" ? "feedback" : toSingularResourceName(config.resourcePath));
3815
+ const defaultField = config.showField ?? toSingularResourceName(config.resourcePath);
3927
3816
  const mappedShowParams = Object.fromEntries(
3928
3817
  showParams.map((param) => {
3929
3818
  const optionKey2 = param.replace(/_([a-z])/g, (_, char) => char.toUpperCase());
@@ -4007,6 +3896,22 @@ function registerEntityCrudCommands(program, config) {
4007
3896
  }
4008
3897
  });
4009
3898
  });
3899
+ for (const mutation of config.idMutationCommands ?? []) {
3900
+ entityCommand.command(mutation.command).description(mutation.description).requiredOption("--id <id>").action(async (opts, cmd) => {
3901
+ const id = idSchema2.parse(opts.id);
3902
+ const context = await resolveCommandContext(cmd.optsWithGlobals());
3903
+ const organizationId = resolveOrganizationId(context.organizationId);
3904
+ await runGraphqlMutationCommand({
3905
+ command: `${config.command}.${mutation.command}`,
3906
+ runtimeOptions: context.runtimeOptions,
3907
+ field: mutation.field,
3908
+ variables: {
3909
+ organization_id: organizationId,
3910
+ [mutation.idVariable]: id
3911
+ }
3912
+ });
3913
+ });
3914
+ }
4010
3915
  }
4011
3916
  var __testables = {
4012
3917
  toSingularResourceName,
@@ -4037,13 +3942,13 @@ var projectPriorityValues = projectPrioritySchema.options.join(", ");
4037
3942
  var projectCreateDataJsonHelp = buildDataJsonHelp("project", "create") ?? 'JSON object for project or {"project": {...}}';
4038
3943
  var projectUpdateDataJsonHelp = buildDataJsonHelp("project", "update") ?? 'JSON object for project or {"project": {...}}';
4039
3944
  function projectsIndexMinimalSelectionSet(includeProjectTypes = false) {
4040
- return `{ count currentPage totalPages data { id type attributes { name slug status priority${includeProjectTypes ? " projectType" : ""} } } }`;
3945
+ return `{ count currentPage totalPages data { id type attributes { name slug status priority createdAt updatedAt${includeProjectTypes ? " projectType" : ""} } } }`;
4041
3946
  }
4042
3947
  var displayPreferenceAttributesSelectionSet = "attributes { id viewType favorite groupingField groupToggleState memberId focusMemberId focusTeamId displayableId displayableType preferenceType agendaItemId }";
4043
3948
  var filterPreferenceAttributesSelectionSet = "attributes { id filterType filter memberId focusMemberId focusTeamId filterableId filterableType preferenceType agendaItemId }";
4044
3949
  var healthUpdateSummarySelectionSet = "id type value memberId status createdAt updatedAt updatableType updatableId parentUpdateId emojis { id name memberId } resources { ...ResourceSummaryFull }";
4045
3950
  var projectShowFullSelectionSet = `{ id type name slug description status priority createdAt updatedAt startDate targetDate archivedAt memberId organizationId teamIds emoji { id name memberId } backgroundImage { backgroundType gradientStart gradientEnd gradientDegrees color imageUrl image { url lowUrl } } favorites { id memberId } resources { ...ResourceSummaryFull } displayPreference { id type ${displayPreferenceAttributesSelectionSet} viewType favorite groupingField groupToggleState memberId focusMemberId focusTeamId displayableId displayableType preferenceType agendaItemId } filterPreferences { id type ${filterPreferenceAttributesSelectionSet} filterType filter memberId focusMemberId focusTeamId filterableId filterableType preferenceType agendaItemId } healthUpdates { ${healthUpdateSummarySelectionSet} replies { ${healthUpdateSummarySelectionSet} replies { id type } } } } fragment ResourceSummaryFull on ResourceSummary { id resourceType slug url skillId skill { id name slug emoji scope description } metadata { urlName imageUrl siteName providerName mediaType skillId skillName skillSlug skillScope skillEmoji skillDescription } attachment { id fileKey filename url } content { id name slug type firstChildSlug childCount } }`;
4046
- function asRecord3(value) {
3951
+ function asRecord2(value) {
4047
3952
  return value && typeof value === "object" ? value : null;
4048
3953
  }
4049
3954
  function toNonEmptyString(value) {
@@ -4076,9 +3981,9 @@ function parseProjectPriority(value) {
4076
3981
  return parsed.data.toUpperCase();
4077
3982
  }
4078
3983
  function normalizeProjectRowForDisplay(row) {
4079
- const record = asRecord3(row);
3984
+ const record = asRecord2(row);
4080
3985
  if (!record) return row;
4081
- const attributes = asRecord3(record.attributes);
3986
+ const attributes = asRecord2(record.attributes);
4082
3987
  const topLevelName = toNonEmptyString(record.name);
4083
3988
  const topLevelTitle = toNonEmptyString(record.title);
4084
3989
  const attributeName = toNonEmptyString(attributes?.name);
@@ -4093,7 +3998,7 @@ function normalizeProjectRowForDisplay(row) {
4093
3998
  };
4094
3999
  }
4095
4000
  function normalizeProjectsListForDisplay(payload) {
4096
- const record = asRecord3(payload);
4001
+ const record = asRecord2(payload);
4097
4002
  if (!record || !Array.isArray(record.data)) return payload;
4098
4003
  return {
4099
4004
  ...record,
@@ -4311,7 +4216,7 @@ var MEETING_STATUSES = /* @__PURE__ */ new Set(["upcoming", "active", "completed
4311
4216
  var MEETING_REPEATS = /* @__PURE__ */ new Set(["never", "weekly", "biweekly", "monthly", "quarterly"]);
4312
4217
  var createHelp2 = buildDataJsonHelp("meeting", "create") ?? 'JSON object for meeting or {"meeting": {...}}';
4313
4218
  var updateHelp2 = buildDataJsonHelp("meeting", "update") ?? 'JSON object for meeting or {"meeting": {...}}';
4314
- function asNonEmptyString2(value) {
4219
+ function asNonEmptyString(value) {
4315
4220
  if (typeof value !== "string") {
4316
4221
  return void 0;
4317
4222
  }
@@ -4369,7 +4274,7 @@ function normalizeMeetingCreateBody(body) {
4369
4274
  });
4370
4275
  }
4371
4276
  const meeting = { ...entity };
4372
- const type = asNonEmptyString2(meeting.type);
4277
+ const type = asNonEmptyString(meeting.type);
4373
4278
  if (!type || !MEETING_TYPES.has(type)) {
4374
4279
  throw new CliError({
4375
4280
  message: "Invalid meeting.type. Use one of: TeamMeeting, OneOnOneMeeting.",
@@ -4379,8 +4284,8 @@ function normalizeMeetingCreateBody(body) {
4379
4284
  details: { field: "meeting.type", allowed: Array.from(MEETING_TYPES) }
4380
4285
  });
4381
4286
  }
4382
- const memberId = asNonEmptyString2(meeting.member_id);
4383
- const date = asNonEmptyString2(meeting.date);
4287
+ const memberId = asNonEmptyString(meeting.member_id);
4288
+ const date = asNonEmptyString(meeting.date);
4384
4289
  const startTime = toFiniteNumber(meeting.start_time, "meeting.start_time");
4385
4290
  const missingRequired = [];
4386
4291
  if (!memberId) missingRequired.push("member_id");
@@ -4395,7 +4300,7 @@ function normalizeMeetingCreateBody(body) {
4395
4300
  details: { requiredFields: ["member_id", "date", "start_time"], rootKey: "meeting" }
4396
4301
  });
4397
4302
  }
4398
- const status = asNonEmptyString2(meeting.status);
4303
+ const status = asNonEmptyString(meeting.status);
4399
4304
  if (status && !MEETING_STATUSES.has(status)) {
4400
4305
  throw new CliError({
4401
4306
  message: "Invalid meeting.status. Use one of: upcoming, active, completed.",
@@ -4405,7 +4310,7 @@ function normalizeMeetingCreateBody(body) {
4405
4310
  details: { field: "meeting.status", allowed: Array.from(MEETING_STATUSES) }
4406
4311
  });
4407
4312
  }
4408
- const repeats = asNonEmptyString2(meeting.repeats) ?? "never";
4313
+ const repeats = asNonEmptyString(meeting.repeats) ?? "never";
4409
4314
  if (!MEETING_REPEATS.has(repeats)) {
4410
4315
  throw new CliError({
4411
4316
  message: "Invalid meeting.repeats. Use one of: never, weekly, biweekly, monthly, quarterly.",
@@ -4484,6 +4389,22 @@ function registerMeetingCommands(program) {
4484
4389
  isShow: true
4485
4390
  });
4486
4391
  });
4392
+ meetings.command("note-show").description("Read the authorized AI note context for a meeting").requiredOption("--id <id>").action(async (opts, cmd) => {
4393
+ const meetingId = idSchema5.parse(opts.id);
4394
+ const context = await resolveCommandContext(cmd.optsWithGlobals());
4395
+ const organizationId = resolveOrganizationId(context.organizationId);
4396
+ await runGraphqlQueryCommand({
4397
+ command: "meetings.note-show",
4398
+ runtimeOptions: context.runtimeOptions,
4399
+ field: "meeting_note_by_meeting",
4400
+ variables: {
4401
+ organization_id: organizationId,
4402
+ meeting_id: meetingId
4403
+ },
4404
+ selectionSet: "{ answerContext }",
4405
+ isShow: true
4406
+ });
4407
+ });
4487
4408
  meetings.command("notes").requiredOption("--id <id>").requiredOption("--content <content>").action(async (opts, cmd) => {
4488
4409
  const id = idSchema5.parse(opts.id);
4489
4410
  const notes = notesSchema.parse(opts.content);
@@ -4539,10 +4460,25 @@ function registerMeetingCommands(program) {
4539
4460
 
4540
4461
  // src/commands/members.ts
4541
4462
  import { z as z8 } from "zod";
4542
- var idSchema6 = z8.string().min(1);
4463
+ var idSchema6 = z8.string().trim().min(1);
4543
4464
  var createHelp3 = buildDataJsonHelp("member", "create") ?? 'JSON object for member or {"member": {...}}';
4544
4465
  var updateHelp3 = buildDataJsonHelp("member", "update") ?? 'JSON object for member or {"member": {...}}';
4545
4466
  var MEMBER_META_PROFILE_SELECTION = "{ id type memberId summary profile attributes { id memberId summary profile } }";
4467
+ var MEMBER_REFERENCE_RESOLUTION_SELECTION = `{
4468
+ status
4469
+ reasonCode
4470
+ organizationId
4471
+ reference
4472
+ eligibilityPolicy
4473
+ complete
4474
+ source
4475
+ asOf
4476
+ traceId
4477
+ receiptId
4478
+ memberId
4479
+ memberName
4480
+ candidates { memberId memberName status eligible }
4481
+ }`;
4546
4482
  function parseStrictBooleanOption(value, optionName) {
4547
4483
  if (typeof value === "boolean") {
4548
4484
  return value;
@@ -4599,6 +4535,29 @@ function registerMemberCommands(program) {
4599
4535
  command: "members",
4600
4536
  field: "members"
4601
4537
  });
4538
+ members.command("resolve").description("Resolve a member reference within the authenticated organization").requiredOption("--query <query>", "Member name or email reference").action(async (opts, cmd) => {
4539
+ const reference = idSchema6.parse(opts.query);
4540
+ const context = await resolveCommandContext(cmd.optsWithGlobals());
4541
+ const organizationId = resolveOrganizationId(context.organizationId);
4542
+ await runGraphqlQueryCommand({
4543
+ command: "members.resolve",
4544
+ runtimeOptions: context.runtimeOptions,
4545
+ operationName: "MemberReferenceResolution",
4546
+ field: "member_reference_resolution",
4547
+ variables: normalizeGraphqlVariables2({
4548
+ organization_id: organizationId,
4549
+ reference,
4550
+ trace_id: context.runtimeOptions.requestId
4551
+ }),
4552
+ variableTypes: {
4553
+ organization_id: "ID!",
4554
+ reference: "String!",
4555
+ trace_id: "String"
4556
+ },
4557
+ selectionSet: MEMBER_REFERENCE_RESOLUTION_SELECTION,
4558
+ isShow: true
4559
+ });
4560
+ });
4602
4561
  members.command("meta-profile").description("Read a member meta profile by member id").requiredOption("--member-id <memberId>", "Member id").requiredOption("--json", "Emit the stable JSON envelope").action(async (opts, cmd) => {
4603
4562
  const memberId = idSchema6.parse(opts.memberId);
4604
4563
  const context = await resolveCommandContext(cmd.optsWithGlobals());
@@ -4667,10 +4626,69 @@ function registerMemberCommands(program) {
4667
4626
  });
4668
4627
  }
4669
4628
 
4670
- // src/commands/skills.ts
4629
+ // src/commands/resources.ts
4671
4630
  import { z as z9 } from "zod";
4672
- var idSchema7 = z9.string().min(1);
4673
- var limitSchema = z9.coerce.number().int().positive();
4631
+ var resourceTypeSchema = z9.enum([
4632
+ "project",
4633
+ "team",
4634
+ "agent",
4635
+ "automation",
4636
+ "file"
4637
+ ]);
4638
+ var referenceSchema = z9.string().trim().min(1);
4639
+ var RESOURCE_REFERENCE_RESOLUTION_SELECTION = `{
4640
+ status
4641
+ reasonCode
4642
+ organizationId
4643
+ resourceType
4644
+ reference
4645
+ eligibilityPolicy
4646
+ complete
4647
+ source
4648
+ asOf
4649
+ traceId
4650
+ receiptId
4651
+ resourceId
4652
+ resourceName
4653
+ candidates { resourceId resourceName resourceType status eligible }
4654
+ }`;
4655
+ function registerResourceCommands(program) {
4656
+ const resources = program.command("resources").description("Organization-scoped resource resolution");
4657
+ resources.command("resolve").description("Resolve a project, team, agent, automation, or file reference").requiredOption(
4658
+ "--type <type>",
4659
+ "Resource type: project, team, agent, automation, or file"
4660
+ ).requiredOption("--query <query>", "Resource name or reference").action(async (opts, cmd) => {
4661
+ const resourceType = resourceTypeSchema.parse(opts.type);
4662
+ const reference = referenceSchema.parse(opts.query);
4663
+ const context = await resolveCommandContext(cmd.optsWithGlobals());
4664
+ const organizationId = resolveOrganizationId(context.organizationId);
4665
+ await runGraphqlQueryCommand({
4666
+ command: "resources.resolve",
4667
+ runtimeOptions: context.runtimeOptions,
4668
+ operationName: "OrganizationResourceReferenceResolution",
4669
+ field: "organization_resource_reference_resolution",
4670
+ variables: normalizeGraphqlVariables2({
4671
+ organization_id: organizationId,
4672
+ resource_type: resourceType,
4673
+ reference,
4674
+ trace_id: context.runtimeOptions.requestId
4675
+ }),
4676
+ variableTypes: {
4677
+ organization_id: "ID!",
4678
+ resource_type: "String!",
4679
+ reference: "String!",
4680
+ trace_id: "String"
4681
+ },
4682
+ selectionSet: RESOURCE_REFERENCE_RESOLUTION_SELECTION,
4683
+ isShow: true
4684
+ });
4685
+ });
4686
+ }
4687
+
4688
+ // src/commands/skills.ts
4689
+ import { z as z10 } from "zod";
4690
+ var idSchema7 = z10.string().min(1);
4691
+ var limitSchema = z10.coerce.number().int().positive();
4674
4692
  var SKILL_SELECTION = `{
4675
4693
  id
4676
4694
  type
@@ -4746,14 +4764,14 @@ function registerSkillCommands(program) {
4746
4764
  }
4747
4765
 
4748
4766
  // src/commands/issues.ts
4749
- import { z as z10 } from "zod";
4750
- var issueGroupIdSchema = z10.string().min(1);
4751
- var idSchema8 = z10.string().min(1);
4752
- var nameSchema = z10.string().min(1);
4753
- var issueTypeSchema = z10.string().min(1).refine((value) => value === "short_term" || value === "long_term", {
4767
+ import { z as z11 } from "zod";
4768
+ var issueGroupIdSchema = z11.string().min(1);
4769
+ var idSchema8 = z11.string().min(1);
4770
+ var nameSchema = z11.string().min(1);
4771
+ var issueTypeSchema = z11.string().min(1).refine((value) => value === "short_term" || value === "long_term", {
4754
4772
  message: "Invalid issue type. Use one of: short_term, long_term."
4755
4773
  });
4756
- var issueStatusSchema = z10.string().min(1).refine((value) => value === "open" || value === "completed", {
4774
+ var issueStatusSchema = z11.string().min(1).refine((value) => value === "open" || value === "completed", {
4757
4775
  message: "Invalid issue status. Use one of: open, completed."
4758
4776
  });
4759
4777
  var updateHelp4 = buildDataJsonHelp("issue", "update") ?? 'JSON object for issue or {"issue": {...}}';
@@ -5021,13 +5039,35 @@ var SMART_KPI_NAMES = [
5021
5039
  var SMART_KPI_NAME_SET = new Set(SMART_KPI_NAMES);
5022
5040
 
5023
5041
  // src/commands/systemTools.ts
5042
+ var REMINDER_ATTRIBUTES_SELECTION = `
5043
+ id
5044
+ organizationId
5045
+ creatorId
5046
+ title
5047
+ description
5048
+ dueAt
5049
+ startsAt
5050
+ timezone
5051
+ schedule
5052
+ notification
5053
+ status
5054
+ nextTriggerAt
5055
+ lastTriggeredAt
5056
+ clearedAt
5057
+ reminderDelegates { id memberId organizationId }
5058
+ delegateMembers { id email firstName lastName organizationId }
5059
+ resources { id resourceType url creatorId attachment { id fileKey filename } }
5060
+ createdAt
5061
+ updatedAt
5062
+ `;
5063
+ var REMINDER_LIST_SELECTION = `{ data { id type attributes { ${REMINDER_ATTRIBUTES_SELECTION} } } count currentPage totalPages }`;
5064
+ var REMINDER_SHOW_SELECTION = `{ id type attributes { ${REMINDER_ATTRIBUTES_SELECTION} } }`;
5024
5065
  var TODO_STATUSES = /* @__PURE__ */ new Set(["open", "completed"]);
5025
5066
  var KNOWLEDGE_CONTENT_TYPES = /* @__PURE__ */ new Set(["company", "policy", "process"]);
5026
5067
  var KNOWLEDGE_STATUSES = /* @__PURE__ */ new Set(["draft", "published"]);
5027
5068
  var NEWS_STATUSES = /* @__PURE__ */ new Set(["active", "completed"]);
5028
5069
  var NEWS_HEADLINE_TYPES = /* @__PURE__ */ new Set(["team", "org_wide"]);
5029
5070
  var QUESTION_STATUSES = /* @__PURE__ */ new Set(["asked", "answered"]);
5030
- var PULSE_STATUSES = /* @__PURE__ */ new Set(["on_track", "at_risk", "off_track"]);
5031
5071
  var SURVEY_RECIPIENT_TYPES = /* @__PURE__ */ new Set(["member", "team", "org_wide"]);
5032
5072
  var SURVEY_NAMES = /* @__PURE__ */ new Set([
5033
5073
  "employee_net_promoter_score",
@@ -5040,21 +5080,6 @@ var SURVEY_NAMES = /* @__PURE__ */ new Set([
5040
5080
  "manager_review",
5041
5081
  "onboarding"
5042
5082
  ]);
5043
- var FEEDBACK_QUARTERS = /* @__PURE__ */ new Set(["q1", "q2", "q3", "q4"]);
5044
- var FEEDBACK_NAMES = /* @__PURE__ */ new Set([
5045
- "productivity_and_focus",
5046
- "company_collaboration",
5047
- "project_management",
5048
- "employee_engagement",
5049
- "training_and_development",
5050
- "innovation_and_creativity",
5051
- "customer_insights",
5052
- "process_improvement",
5053
- "leadership_and_management",
5054
- "company_culture",
5055
- "roadmap_and_strategy",
5056
- "customer_testing_and_feedback"
5057
- ]);
5058
5083
  var SCORECARD_INTERVALS = /* @__PURE__ */ new Set([
5059
5084
  "daily",
5060
5085
  "weekly",
@@ -5105,7 +5130,7 @@ function normalizeTodosCreateBody(body) {
5105
5130
  }
5106
5131
  return { ...body, todo };
5107
5132
  }
5108
- function asNonEmptyString3(value) {
5133
+ function asNonEmptyString2(value) {
5109
5134
  if (typeof value !== "string") {
5110
5135
  return void 0;
5111
5136
  }
@@ -5113,7 +5138,7 @@ function asNonEmptyString3(value) {
5113
5138
  return trimmed.length > 0 ? trimmed : void 0;
5114
5139
  }
5115
5140
  function validateEnumField(params) {
5116
- const value = asNonEmptyString3(params.rawValue);
5141
+ const value = asNonEmptyString2(params.rawValue);
5117
5142
  if (!value) {
5118
5143
  return void 0;
5119
5144
  }
@@ -5147,7 +5172,7 @@ function normalizeKnowledgeCreateBody(body) {
5147
5172
  message: "Invalid content.status. Use one of: draft, published."
5148
5173
  });
5149
5174
  content.status = status ?? "draft";
5150
- const memberId = asNonEmptyString3(content.member_id);
5175
+ const memberId = asNonEmptyString2(content.member_id);
5151
5176
  if (!memberId) {
5152
5177
  throwMissingRequiredCreateFields("content", ["member_id"]);
5153
5178
  }
@@ -5156,7 +5181,7 @@ function normalizeKnowledgeCreateBody(body) {
5156
5181
  }
5157
5182
  function normalizeNewsCreateBody(body) {
5158
5183
  const headline = ensureEntityObject(body, "headline");
5159
- const memberId = asNonEmptyString3(headline.member_id);
5184
+ const memberId = asNonEmptyString2(headline.member_id);
5160
5185
  if (!memberId) {
5161
5186
  throwMissingRequiredCreateFields("headline", ["member_id"]);
5162
5187
  }
@@ -5185,14 +5210,14 @@ function normalizeNewsCreateBody(body) {
5185
5210
  }
5186
5211
  function normalizeQuestionsCreateBody(body) {
5187
5212
  const question = ensureEntityObject(body, "question");
5188
- const summary = asNonEmptyString3(question.summary);
5189
- const currentName = asNonEmptyString3(question.name);
5213
+ const summary = asNonEmptyString2(question.summary);
5214
+ const currentName = asNonEmptyString2(question.name);
5190
5215
  if (!currentName && summary) {
5191
5216
  question.name = summary;
5192
5217
  }
5193
5218
  delete question.summary;
5194
- const name = asNonEmptyString3(question.name);
5195
- const memberId = asNonEmptyString3(question.member_id);
5219
+ const name = asNonEmptyString2(question.name);
5220
+ const memberId = asNonEmptyString2(question.member_id);
5196
5221
  const missing = [];
5197
5222
  if (!name) missing.push("name");
5198
5223
  if (!memberId) missing.push("member_id");
@@ -5214,13 +5239,13 @@ function normalizeQuestionsCreateBody(body) {
5214
5239
  }
5215
5240
  function normalizeQuestionsUpdateBody(body) {
5216
5241
  const question = ensureEntityObject(body, "question");
5217
- const summary = asNonEmptyString3(question.summary);
5218
- const currentName = asNonEmptyString3(question.name);
5242
+ const summary = asNonEmptyString2(question.summary);
5243
+ const currentName = asNonEmptyString2(question.name);
5219
5244
  if (!currentName && summary) {
5220
5245
  question.name = summary;
5221
5246
  }
5222
5247
  delete question.summary;
5223
- const name = asNonEmptyString3(question.name);
5248
+ const name = asNonEmptyString2(question.name);
5224
5249
  if (name) {
5225
5250
  question.name = name;
5226
5251
  }
@@ -5235,37 +5260,10 @@ function normalizeQuestionsUpdateBody(body) {
5235
5260
  }
5236
5261
  return { ...body, question };
5237
5262
  }
5238
- function normalizePulseCreateBody(body) {
5239
- const healthUpdate = ensureEntityObject(body, "health_update");
5240
- const healthUpdatableId = asNonEmptyString3(healthUpdate.health_updatable_id) ?? asNonEmptyString3(healthUpdate.updatable_id);
5241
- const healthUpdatableType = asNonEmptyString3(healthUpdate.health_updatable_type) ?? asNonEmptyString3(healthUpdate.updatable_type);
5242
- const memberId = asNonEmptyString3(healthUpdate.member_id);
5243
- const status = validateEnumField({
5244
- rawValue: healthUpdate.status,
5245
- field: "health_update.status",
5246
- allowed: PULSE_STATUSES,
5247
- message: "Invalid health_update.status. Use one of: on_track, at_risk, off_track."
5248
- });
5249
- const missing = [];
5250
- if (!healthUpdatableId) missing.push("health_updatable_id");
5251
- if (!healthUpdatableType) missing.push("health_updatable_type");
5252
- if (!memberId) missing.push("member_id");
5253
- if (!status) missing.push("status");
5254
- if (missing.length > 0) {
5255
- throwMissingRequiredCreateFields("health_update", missing);
5256
- }
5257
- healthUpdate.health_updatable_id = healthUpdatableId;
5258
- healthUpdate.health_updatable_type = healthUpdatableType;
5259
- healthUpdate.member_id = memberId;
5260
- healthUpdate.status = status;
5261
- delete healthUpdate.updatable_id;
5262
- delete healthUpdate.updatable_type;
5263
- return { ...body, health_update: healthUpdate };
5264
- }
5265
5263
  function normalizeSurveysCreateBody(body) {
5266
5264
  const survey = ensureEntityObject(body, "survey");
5267
- const title = asNonEmptyString3(survey.title);
5268
- const currentName = asNonEmptyString3(survey.name);
5265
+ const title = asNonEmptyString2(survey.title);
5266
+ const currentName = asNonEmptyString2(survey.name);
5269
5267
  if (!currentName && title) {
5270
5268
  survey.name = title;
5271
5269
  }
@@ -5294,8 +5292,8 @@ function normalizeSurveysCreateBody(body) {
5294
5292
  }
5295
5293
  function normalizeSurveysUpdateBody(body) {
5296
5294
  const survey = ensureEntityObject(body, "survey");
5297
- const title = asNonEmptyString3(survey.title);
5298
- const currentName = asNonEmptyString3(survey.name);
5295
+ const title = asNonEmptyString2(survey.title);
5296
+ const currentName = asNonEmptyString2(survey.name);
5299
5297
  if (!currentName && title) {
5300
5298
  survey.name = title;
5301
5299
  }
@@ -5320,77 +5318,16 @@ function normalizeSurveysUpdateBody(body) {
5320
5318
  }
5321
5319
  return { ...body, survey };
5322
5320
  }
5323
- function normalizeFeedbacksCreateBody(body) {
5324
- const feedback = ensureEntityObject(body, "feedback");
5325
- const title = asNonEmptyString3(feedback.title);
5326
- const currentName = asNonEmptyString3(feedback.name);
5327
- if (!currentName && title) {
5328
- feedback.name = title;
5329
- }
5330
- delete feedback.title;
5331
- const name = validateEnumField({
5332
- rawValue: feedback.name,
5333
- field: "feedback.name",
5334
- allowed: FEEDBACK_NAMES,
5335
- message: "Invalid feedback.name. Use one of: productivity_and_focus, company_collaboration, project_management, employee_engagement, training_and_development, innovation_and_creativity, customer_insights, process_improvement, leadership_and_management, company_culture, roadmap_and_strategy, customer_testing_and_feedback."
5336
- });
5337
- const quarter = validateEnumField({
5338
- rawValue: feedback.quarter,
5339
- field: "feedback.quarter",
5340
- allowed: FEEDBACK_QUARTERS,
5341
- message: "Invalid feedback.quarter. Use one of: q1, q2, q3, q4."
5342
- });
5343
- const year = asNonEmptyString3(feedback.year);
5344
- const missing = [];
5345
- if (!name) missing.push("name");
5346
- if (!quarter) missing.push("quarter");
5347
- if (!year) missing.push("year");
5348
- if (missing.length > 0) {
5349
- throwMissingRequiredCreateFields("feedback", missing);
5350
- }
5351
- feedback.name = name;
5352
- feedback.quarter = quarter;
5353
- feedback.year = year;
5354
- return { ...body, feedback };
5355
- }
5356
- function normalizeFeedbacksUpdateBody(body) {
5357
- const feedback = ensureEntityObject(body, "feedback");
5358
- const title = asNonEmptyString3(feedback.title);
5359
- const currentName = asNonEmptyString3(feedback.name);
5360
- if (!currentName && title) {
5361
- feedback.name = title;
5362
- }
5363
- delete feedback.title;
5364
- const name = validateEnumField({
5365
- rawValue: feedback.name,
5366
- field: "feedback.name",
5367
- allowed: FEEDBACK_NAMES,
5368
- message: "Invalid feedback.name. Use one of: productivity_and_focus, company_collaboration, project_management, employee_engagement, training_and_development, innovation_and_creativity, customer_insights, process_improvement, leadership_and_management, company_culture, roadmap_and_strategy, customer_testing_and_feedback."
5369
- });
5370
- if (name) {
5371
- feedback.name = name;
5372
- }
5373
- const quarter = validateEnumField({
5374
- rawValue: feedback.quarter,
5375
- field: "feedback.quarter",
5376
- allowed: FEEDBACK_QUARTERS,
5377
- message: "Invalid feedback.quarter. Use one of: q1, q2, q3, q4."
5378
- });
5379
- if (quarter) {
5380
- feedback.quarter = quarter;
5381
- }
5382
- return { ...body, feedback };
5383
- }
5384
5321
  function normalizeAccountabilityCreateBody(body) {
5385
5322
  const responsibility = ensureEntityObject(body, "responsibility");
5386
- const summary = asNonEmptyString3(responsibility.summary);
5387
- const currentName = asNonEmptyString3(responsibility.name);
5323
+ const summary = asNonEmptyString2(responsibility.summary);
5324
+ const currentName = asNonEmptyString2(responsibility.name);
5388
5325
  if (!currentName && summary) {
5389
5326
  responsibility.name = summary;
5390
5327
  }
5391
5328
  delete responsibility.summary;
5392
- const name = asNonEmptyString3(responsibility.name);
5393
- const memberId = asNonEmptyString3(responsibility.member_id);
5329
+ const name = asNonEmptyString2(responsibility.name);
5330
+ const memberId = asNonEmptyString2(responsibility.member_id);
5394
5331
  const missing = [];
5395
5332
  if (!name) missing.push("name");
5396
5333
  if (!memberId) missing.push("member_id");
@@ -5405,8 +5342,8 @@ function normalizeAccountabilityCreateBody(body) {
5405
5342
  }
5406
5343
  function normalizeAccountabilityUpdateBody(body) {
5407
5344
  const responsibility = ensureEntityObject(body, "responsibility");
5408
- const summary = asNonEmptyString3(responsibility.summary);
5409
- const currentName = asNonEmptyString3(responsibility.name);
5345
+ const summary = asNonEmptyString2(responsibility.summary);
5346
+ const currentName = asNonEmptyString2(responsibility.name);
5410
5347
  if (!currentName && summary) {
5411
5348
  responsibility.name = summary;
5412
5349
  }
@@ -5438,7 +5375,7 @@ function parseSmartKpiViewCreateBody(raw) {
5438
5375
  }
5439
5376
  function normalizeSmartKpiViewCreateBody(body) {
5440
5377
  const smartKpiView = ensureEntityObject(body, "smart_kpi_view");
5441
- const name = asNonEmptyString3(smartKpiView.name);
5378
+ const name = asNonEmptyString2(smartKpiView.name);
5442
5379
  if (!name) {
5443
5380
  throwMissingRequiredCreateFields("smart_kpi_view", ["name"]);
5444
5381
  }
@@ -5476,9 +5413,9 @@ function buildKpisCreateMutation(params) {
5476
5413
  });
5477
5414
  }
5478
5415
  const smartKpi = { ...entity };
5479
- const name = asNonEmptyString3(smartKpi.name);
5480
- const smartKpiViewId = asNonEmptyString3(smartKpi.smart_kpi_view_id);
5481
- const measurableGroupId = asNonEmptyString3(smartKpi.measurable_group_id);
5416
+ const name = asNonEmptyString2(smartKpi.name);
5417
+ const smartKpiViewId = asNonEmptyString2(smartKpi.smart_kpi_view_id);
5418
+ const measurableGroupId = asNonEmptyString2(smartKpi.measurable_group_id);
5482
5419
  const hasAllowedName = typeof name === "string" && SMART_KPI_NAME_SET.has(name);
5483
5420
  if (!name) {
5484
5421
  throw new CliError({
@@ -5498,7 +5435,7 @@ function buildKpisCreateMutation(params) {
5498
5435
  measurable_type: "number",
5499
5436
  condition: "greater_than_or_equal_to"
5500
5437
  };
5501
- const notes = asNonEmptyString3(smartKpi.notes);
5438
+ const notes = asNonEmptyString2(smartKpi.notes);
5502
5439
  if (notes) {
5503
5440
  measurable.notes = notes;
5504
5441
  }
@@ -5567,6 +5504,32 @@ function registerSmartKpiViewCommands(program) {
5567
5504
  });
5568
5505
  }
5569
5506
  function registerSystemToolCommands(program) {
5507
+ registerEntityCrudCommands(program, {
5508
+ command: "reminders",
5509
+ description: "Reminder operations",
5510
+ resourcePath: "reminders",
5511
+ rootKey: "reminder",
5512
+ requiredCreateFields: ["title"],
5513
+ listParams: ["status", "sort"],
5514
+ allowQueryJson: false,
5515
+ registerSearch: false,
5516
+ listSelectionSet: REMINDER_LIST_SELECTION,
5517
+ showSelectionSet: REMINDER_SHOW_SELECTION,
5518
+ idMutationCommands: [
5519
+ {
5520
+ command: "clear",
5521
+ description: "Clear a reminder while retaining its history",
5522
+ field: "clear_reminder",
5523
+ idVariable: "reminder_id"
5524
+ },
5525
+ {
5526
+ command: "destroy",
5527
+ description: "Cancel a reminder while retaining its history",
5528
+ field: "destroy_reminder",
5529
+ idVariable: "reminder_id"
5530
+ }
5531
+ ]
5532
+ });
5570
5533
  registerEntityCrudCommands(program, {
5571
5534
  command: "lists",
5572
5535
  description: "List operations",
@@ -5711,18 +5674,6 @@ function registerSystemToolCommands(program) {
5711
5674
  listParams: ["answered", "asked"],
5712
5675
  allowQueryJson: false
5713
5676
  });
5714
- registerEntityCrudCommands(program, {
5715
- command: "pulse",
5716
- description: "Pulse operations",
5717
- resourcePath: "health_updates",
5718
- rootKey: "health_update",
5719
- listField: "feedbacks",
5720
- showField: "feedback",
5721
- requiredCreateFields: ["health_updatable_id", "health_updatable_type", "member_id", "status"],
5722
- normalizeCreateBody: normalizePulseCreateBody,
5723
- listParams: ["last", "latest", "start_date", "name", "quarter", "year"],
5724
- allowQueryJson: false
5725
- });
5726
5677
  registerEntityCrudCommands(program, {
5727
5678
  command: "surveys",
5728
5679
  description: "Survey operations",
@@ -5734,17 +5685,6 @@ function registerSystemToolCommands(program) {
5734
5685
  listParams: ["completed", "current_member", "due", "exclude_completed", "sent"],
5735
5686
  allowQueryJson: false
5736
5687
  });
5737
- registerEntityCrudCommands(program, {
5738
- command: "feedbacks",
5739
- description: "Feedback operations",
5740
- resourcePath: "feedback",
5741
- rootKey: "feedback",
5742
- requiredCreateFields: ["name", "quarter", "year"],
5743
- normalizeCreateBody: normalizeFeedbacksCreateBody,
5744
- normalizeUpdateBody: normalizeFeedbacksUpdateBody,
5745
- listParams: ["last", "latest", "start_date"],
5746
- allowQueryJson: false
5747
- });
5748
5688
  registerEntityCrudCommands(program, {
5749
5689
  command: "accountability",
5750
5690
  description: "Accountability operations",
@@ -5817,8 +5757,8 @@ function registerSystemToolCommands(program) {
5817
5757
  }
5818
5758
 
5819
5759
  // src/commands/teams.ts
5820
- import { z as z11 } from "zod";
5821
- var idSchema9 = z11.string().min(1);
5760
+ import { z as z12 } from "zod";
5761
+ var idSchema9 = z12.string().min(1);
5822
5762
  function registerTeamCommands(program) {
5823
5763
  const teams = program.command("teams").description("Team operations");
5824
5764
  teams.command("list").option("--page <page>").option("--per <per>").action(async (opts, cmd) => {
@@ -5884,8 +5824,8 @@ function registerTeamCommands(program) {
5884
5824
  }
5885
5825
 
5886
5826
  // src/commands/organizations.ts
5887
- import { z as z12 } from "zod";
5888
- var idSchema10 = z12.string().min(1);
5827
+ import { z as z13 } from "zod";
5828
+ var idSchema10 = z13.string().min(1);
5889
5829
  function isRecord3(value) {
5890
5830
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
5891
5831
  }
@@ -5901,7 +5841,7 @@ function ensureRootObject(body, rootKey) {
5901
5841
  }
5902
5842
  return { ...root };
5903
5843
  }
5904
- function asNonEmptyString4(value) {
5844
+ function asNonEmptyString3(value) {
5905
5845
  if (typeof value !== "string") {
5906
5846
  return void 0;
5907
5847
  }
@@ -5911,7 +5851,7 @@ function asNonEmptyString4(value) {
5911
5851
  function normalizeOrganizationUpdateBody(body) {
5912
5852
  const organization = ensureRootObject(body, "organization");
5913
5853
  const detail = isRecord3(organization.organization_detail_attributes) ? { ...organization.organization_detail_attributes } : {};
5914
- const workspaceName = asNonEmptyString4(organization.workspace_name);
5854
+ const workspaceName = asNonEmptyString3(organization.workspace_name);
5915
5855
  if (workspaceName) {
5916
5856
  detail.workspace_name = workspaceName;
5917
5857
  }
@@ -5924,7 +5864,7 @@ function normalizeOrganizationUpdateBody(body) {
5924
5864
  function normalizeOrganizationMetaProfileUpdateBody(body) {
5925
5865
  const root = ensureRootObject(body, "organization_meta_profile");
5926
5866
  const profile = isRecord3(root.profile) ? { ...root.profile } : {};
5927
- const title = asNonEmptyString4(root.title);
5867
+ const title = asNonEmptyString3(root.title);
5928
5868
  if (title) {
5929
5869
  const companyIdentity = isRecord3(profile.company_identity) ? { ...profile.company_identity } : {};
5930
5870
  companyIdentity.one_sentence_summary = title;
@@ -5954,7 +5894,7 @@ function normalizeOrganizationMetaProfileUpdateBody(body) {
5954
5894
  function normalizeKeyMetricMetaProfileUpdateBody(body) {
5955
5895
  const root = ensureRootObject(body, "key_metric_meta_profile");
5956
5896
  const profile = isRecord3(root.profile) ? { ...root.profile } : {};
5957
- const annualRevenue = asNonEmptyString4(root.annual_revenue);
5897
+ const annualRevenue = asNonEmptyString3(root.annual_revenue);
5958
5898
  if (annualRevenue) {
5959
5899
  const financial = isRecord3(profile.financial) ? { ...profile.financial } : {};
5960
5900
  financial.revenue = annualRevenue;
@@ -6110,8 +6050,8 @@ function registerOrganizationCommands(program) {
6110
6050
  }
6111
6051
 
6112
6052
  // src/commands/foundation.ts
6113
- import { z as z13 } from "zod";
6114
- var idSchema11 = z13.string().min(1);
6053
+ import { z as z14 } from "zod";
6054
+ var idSchema11 = z14.string().min(1);
6115
6055
  var STRATEGIC_PLAN_ALLOWED_UPDATE_KEYS = /* @__PURE__ */ new Set([
6116
6056
  "published_at",
6117
6057
  "profile",
@@ -6138,7 +6078,7 @@ function ensureRootObject2(body, rootKey) {
6138
6078
  }
6139
6079
  return { ...root };
6140
6080
  }
6141
- function asNonEmptyString5(value) {
6081
+ function asNonEmptyString4(value) {
6142
6082
  if (typeof value !== "string") {
6143
6083
  return void 0;
6144
6084
  }
@@ -6166,8 +6106,8 @@ function normalizeStrategicPlanUpdateBody(body) {
6166
6106
  }
6167
6107
  function normalizeStrategicObjectiveUpdateBody(body) {
6168
6108
  const strategicObjective = ensureRootObject2(body, "strategic_objective");
6169
- const title = asNonEmptyString5(strategicObjective.title);
6170
- if (!asNonEmptyString5(strategicObjective.summary) && title) {
6109
+ const title = asNonEmptyString4(strategicObjective.title);
6110
+ if (!asNonEmptyString4(strategicObjective.summary) && title) {
6171
6111
  strategicObjective.summary = title;
6172
6112
  }
6173
6113
  delete strategicObjective.title;
@@ -6190,8 +6130,8 @@ function normalizeStrategicObjectiveUpdateBody(body) {
6190
6130
  }
6191
6131
  function normalizeAnnualObjectiveCreateBody(body) {
6192
6132
  const annualObjective = ensureRootObject2(body, "annual_objective");
6193
- const title = asNonEmptyString5(annualObjective.title);
6194
- if (!asNonEmptyString5(annualObjective.name) && title) {
6133
+ const title = asNonEmptyString4(annualObjective.title);
6134
+ if (!asNonEmptyString4(annualObjective.name) && title) {
6195
6135
  annualObjective.name = title;
6196
6136
  }
6197
6137
  delete annualObjective.title;
@@ -6199,8 +6139,8 @@ function normalizeAnnualObjectiveCreateBody(body) {
6199
6139
  }
6200
6140
  function normalizeQuarterlyObjectiveCreateBody(body) {
6201
6141
  const quarterlyObjective = ensureRootObject2(body, "quarterly_objective");
6202
- const title = asNonEmptyString5(quarterlyObjective.title);
6203
- if (!asNonEmptyString5(quarterlyObjective.name) && title) {
6142
+ const title = asNonEmptyString4(quarterlyObjective.title);
6143
+ if (!asNonEmptyString4(quarterlyObjective.name) && title) {
6204
6144
  quarterlyObjective.name = title;
6205
6145
  }
6206
6146
  delete quarterlyObjective.title;
@@ -6312,9 +6252,9 @@ function registerFoundationCommands(program) {
6312
6252
  }
6313
6253
 
6314
6254
  // src/commands/childEntities.ts
6315
- import { z as z14 } from "zod";
6316
- var idSchema12 = z14.string().min(1);
6317
- var jsonObjectSchema = z14.record(z14.string(), z14.unknown());
6255
+ import { z as z15 } from "zod";
6256
+ var idSchema12 = z15.string().min(1);
6257
+ var jsonObjectSchema = z15.record(z15.string(), z15.unknown());
6318
6258
  var NOTE_DETAIL_FIELDS = [
6319
6259
  "notes",
6320
6260
  "hasNotes",
@@ -6343,7 +6283,18 @@ function requiredParentSearchOption(parentFlag, parentKind) {
6343
6283
  }
6344
6284
  function buildChildResourceSelectionSet(parentField, extraFields = []) {
6345
6285
  const fields = Array.from(
6346
- /* @__PURE__ */ new Set(["id", "type", "name", "status", "priority", "rank", "dueDate", "memberId", parentField, ...extraFields])
6286
+ /* @__PURE__ */ new Set([
6287
+ "id",
6288
+ "type",
6289
+ "name",
6290
+ "status",
6291
+ "priority",
6292
+ "rank",
6293
+ "dueDate",
6294
+ "memberId",
6295
+ parentField,
6296
+ ...extraFields
6297
+ ])
6347
6298
  );
6348
6299
  const attributeFields = fields.filter((field) => field !== "type");
6349
6300
  return `{ ${fields.join(" ")} attributes { ${attributeFields.join(" ")} } }`;
@@ -6351,6 +6302,30 @@ function buildChildResourceSelectionSet(parentField, extraFields = []) {
6351
6302
  function buildChildListSelectionSet(parentField, extraFields = []) {
6352
6303
  return `{ data ${buildChildResourceSelectionSet(parentField, extraFields)} count currentPage totalPages }`;
6353
6304
  }
6305
+ function buildChildShowSelectionSet(parentField, extraFields = []) {
6306
+ const fields = Array.from(
6307
+ /* @__PURE__ */ new Set([
6308
+ "id",
6309
+ "type",
6310
+ "name",
6311
+ "status",
6312
+ "priority",
6313
+ "rank",
6314
+ "dueDate",
6315
+ "memberId",
6316
+ parentField,
6317
+ "notes",
6318
+ "hasNotes",
6319
+ "hasUnreadNotes",
6320
+ "notesUpdatedAt",
6321
+ "notesLastReadAt",
6322
+ "estimateIds",
6323
+ ...extraFields
6324
+ ])
6325
+ );
6326
+ const attributeFields = fields.filter((field) => field !== "type");
6327
+ return `{ ${fields.join(" ")} attributes { ${attributeFields.join(" ")} } }`;
6328
+ }
6354
6329
  function parseJsonObject2(raw) {
6355
6330
  try {
6356
6331
  const parsed = JSON.parse(raw);
@@ -6728,19 +6703,22 @@ function registerChildEntityCommands(program) {
6728
6703
  updateField: "update_talking_point",
6729
6704
  destroyField: "destroy_talking_point",
6730
6705
  idVariable: "talking_point_id",
6706
+ showField: "talking_point",
6731
6707
  listOperationName: "TalkingPointsList",
6708
+ showOperationName: "TalkingPointsShow",
6732
6709
  createOperationName: "TalkingPointsCreate",
6733
6710
  updateOperationName: "TalkingPointsUpdate",
6734
6711
  destroyOperationName: "TalkingPointsDestroy",
6735
6712
  listSelectionSet: buildChildListSelectionSet("meetingId", ["description", "creatorId", "slug"]),
6713
+ showSelectionSet: buildChildShowSelectionSet("meetingId", ["description", "creatorId", "slug"]),
6736
6714
  listParentTypedField: "meetingId"
6737
6715
  });
6738
6716
  }
6739
6717
 
6740
6718
  // src/commands/content.ts
6741
- import { z as z15 } from "zod";
6742
- var idSchema13 = z15.string().min(1);
6743
- var nonEmptyString = z15.string().min(1);
6719
+ import { z as z16 } from "zod";
6720
+ var idSchema13 = z16.string().min(1);
6721
+ var nonEmptyString = z16.string().min(1);
6744
6722
  var contentAttributesSelection = "attributes { id type name slug content firstChildSlug rootParentSlug status contentType lastEdited organizationId memberId focusMemberId focusTeamId teamId creatorId createdAt updatedAt childCount assignmentType contentableId contentableSlug contentableType votesTotal labelIds rootContentId parentContentId }";
6745
6723
  function assertUpdateFields(params) {
6746
6724
  if (!params.name && !params.content && !params.status) {
@@ -6928,9 +6906,9 @@ function registerContentCommands(program) {
6928
6906
  }
6929
6907
 
6930
6908
  // src/commands/markdownTree.ts
6931
- import { z as z16 } from "zod";
6932
- var nonEmptyString2 = z16.string().min(1);
6933
- var nonNegativeInt = z16.coerce.number().int().min(0);
6909
+ import { z as z17 } from "zod";
6910
+ var nonEmptyString2 = z17.string().min(1);
6911
+ var nonNegativeInt = z17.coerce.number().int().min(0);
6934
6912
  function addScopeOptions(command) {
6935
6913
  return command.requiredOption("--tool-key <toolKey>").requiredOption("--node-key <nodeKey>").option("--parent-id <parentId>").option("--record-id <recordId>").option("--member-id <memberId>").option("--team-id <teamId>").option("--content-type <contentType>").option("--tree-view");
6936
6914
  }
@@ -7095,11 +7073,11 @@ function registerMarkdownTreeCommands(program) {
7095
7073
  }
7096
7074
 
7097
7075
  // src/commands/navigation.ts
7098
- import { z as z17 } from "zod";
7076
+ import { z as z18 } from "zod";
7099
7077
 
7100
7078
  // src/internalOptions.ts
7101
7079
  var INTERNAL_OPTIONS_KEY = "__waveInternalOptions";
7102
- function asRecord4(value) {
7080
+ function asRecord3(value) {
7103
7081
  if (!value || typeof value !== "object" || Array.isArray(value)) {
7104
7082
  return null;
7105
7083
  }
@@ -7113,7 +7091,7 @@ function setInternalCliOptions(program, options) {
7113
7091
  function getInternalCliOptions(command) {
7114
7092
  let current = command;
7115
7093
  while (current) {
7116
- const record = asRecord4(current[INTERNAL_OPTIONS_KEY]);
7094
+ const record = asRecord3(current[INTERNAL_OPTIONS_KEY]);
7117
7095
  if (record) {
7118
7096
  return {
7119
7097
  enableRetryOnEmptyPhrase: record.enableRetryOnEmptyPhrase === true
@@ -7125,8 +7103,8 @@ function getInternalCliOptions(command) {
7125
7103
  }
7126
7104
 
7127
7105
  // src/commands/navigation.ts
7128
- var nonEmpty = z17.string().min(1);
7129
- var nonNegativeInt2 = z17.coerce.number().int().min(0);
7106
+ var nonEmpty = z18.string().min(1);
7107
+ var nonNegativeInt2 = z18.coerce.number().int().min(0);
7130
7108
  var MIGRATED_BRANCHES = ["directory", "projects", "knowledge"];
7131
7109
  function normalizeText(input) {
7132
7110
  if (typeof input !== "string") return "";
@@ -7909,14 +7887,14 @@ function registerMutationCapabilityCommands(program) {
7909
7887
  // src/commands/osmd.ts
7910
7888
  import { readFile as readFile3 } from "fs/promises";
7911
7889
  import { basename } from "path";
7912
- import { z as z18 } from "zod";
7890
+ import { z as z19 } from "zod";
7913
7891
  import { Option } from "commander";
7914
7892
 
7915
7893
  // src/operationManifest.ts
7916
7894
  import { createHash } from "crypto";
7917
7895
 
7918
7896
  // src/version.ts
7919
- var CLI_VERSION = "0.1.85";
7897
+ var CLI_VERSION = "0.1.88";
7920
7898
 
7921
7899
  // src/operationMetadata.ts
7922
7900
  var DISCOVERY_OPERATION_IDS = [
@@ -7944,14 +7922,14 @@ var DISCOVERY_OPERATION_IDS = [
7944
7922
  "customers.examples",
7945
7923
  "customers.schema",
7946
7924
  "datasheets.examples",
7925
+ "data-pipeline.examples",
7926
+ "data-pipeline.schema",
7947
7927
  "datasheets.schema",
7948
7928
  "desktop-context.examples",
7949
7929
  "desktop-context.schema",
7950
7930
  "doctor",
7951
7931
  "doctor.examples",
7952
7932
  "doctor.schema",
7953
- "feedbacks.examples",
7954
- "feedbacks.schema",
7955
7933
  "foundation.examples",
7956
7934
  "foundation.schema",
7957
7935
  "issue-groups.examples",
@@ -7988,8 +7966,6 @@ var DISCOVERY_OPERATION_IDS = [
7988
7966
  "project-content.schema",
7989
7967
  "projects.examples",
7990
7968
  "projects.schema",
7991
- "pulse.examples",
7992
- "pulse.schema",
7993
7969
  "questions.examples",
7994
7970
  "questions.schema",
7995
7971
  "recognition.examples",
@@ -8031,7 +8007,9 @@ var DISCOVERY_OPERATION_IDS = [
8031
8007
  "todos.examples",
8032
8008
  "todos.schema",
8033
8009
  "whiteboards.examples",
8034
- "whiteboards.schema"
8010
+ "whiteboards.schema",
8011
+ "sketches.examples",
8012
+ "sketches.schema"
8035
8013
  ];
8036
8014
  var READ_OPERATION_IDS = [
8037
8015
  "accountability.list",
@@ -8059,12 +8037,15 @@ var READ_OPERATION_IDS = [
8059
8037
  "customers.show",
8060
8038
  "datasheets.list",
8061
8039
  "datasheets.open",
8040
+ "data-pipeline.execute-source-action",
8041
+ "data-pipeline.overview",
8042
+ "data-pipeline.source-actions",
8043
+ "data-pipeline.sources",
8062
8044
  "datasheets.show",
8045
+ "desktop-context.activity",
8046
+ "desktop-context.member-statuses",
8063
8047
  "desktop-context.recent",
8064
8048
  "desktop-context.status",
8065
- "feedbacks.list",
8066
- "feedbacks.search",
8067
- "feedbacks.show",
8068
8049
  "find",
8069
8050
  "foundation.annual-objectives.list",
8070
8051
  "foundation.annual-objectives.search",
@@ -8100,6 +8081,7 @@ var READ_OPERATION_IDS = [
8100
8081
  "mail.message",
8101
8082
  "mail.messages",
8102
8083
  "mail.open",
8084
+ "mail.relay-evidence",
8103
8085
  "mail.settings",
8104
8086
  "mail.snippets",
8105
8087
  "mail.sync-status",
@@ -8111,12 +8093,15 @@ var READ_OPERATION_IDS = [
8111
8093
  "markdown-tree.root",
8112
8094
  "markdown-tree.subtree",
8113
8095
  "meetings.list",
8096
+ "meetings.note-show",
8114
8097
  "meetings.search",
8115
8098
  "meetings.show",
8116
8099
  "members.list",
8117
8100
  "members.meta-profile",
8101
+ "members.resolve",
8118
8102
  "members.search",
8119
8103
  "members.show",
8104
+ "resources.resolve",
8120
8105
  "milestones.list",
8121
8106
  "milestones.search",
8122
8107
  "milestones.show",
@@ -8161,9 +8146,6 @@ var READ_OPERATION_IDS = [
8161
8146
  "projects.list",
8162
8147
  "projects.search",
8163
8148
  "projects.show",
8164
- "pulse.list",
8165
- "pulse.search",
8166
- "pulse.show",
8167
8149
  "questions.list",
8168
8150
  "questions.search",
8169
8151
  "questions.show",
@@ -8175,6 +8157,8 @@ var READ_OPERATION_IDS = [
8175
8157
  "rock-collections.list",
8176
8158
  "rock-collections.search",
8177
8159
  "rock-collections.show",
8160
+ "reminders.list",
8161
+ "reminders.show",
8178
8162
  "rocks.list",
8179
8163
  "rocks.search",
8180
8164
  "rocks.show",
@@ -8187,6 +8171,8 @@ var READ_OPERATION_IDS = [
8187
8171
  "skills.list",
8188
8172
  "skills.show",
8189
8173
  "stand-ups.list",
8174
+ "signatures.list",
8175
+ "signatures.show",
8190
8176
  "stand-ups.search",
8191
8177
  "stand-ups.show",
8192
8178
  "subissues.list",
@@ -8210,13 +8196,12 @@ var READ_OPERATION_IDS = [
8210
8196
  "support.settings",
8211
8197
  "support.ticket-counts",
8212
8198
  "support.tickets",
8213
- "signatures.list",
8214
- "signatures.show",
8215
8199
  "surveys.list",
8216
8200
  "surveys.search",
8217
8201
  "surveys.show",
8218
8202
  "talking-points.list",
8219
8203
  "talking-points.search",
8204
+ "talking-points.show",
8220
8205
  "tasks.list",
8221
8206
  "tasks.search",
8222
8207
  "tasks.show",
@@ -8238,7 +8223,10 @@ var READ_OPERATION_IDS = [
8238
8223
  "tree",
8239
8224
  "whiteboards.list",
8240
8225
  "whiteboards.open",
8241
- "whiteboards.show"
8226
+ "whiteboards.show",
8227
+ "sketches.list",
8228
+ "sketches.open",
8229
+ "sketches.show"
8242
8230
  ];
8243
8231
  var WRITE_OPERATION_IDS = [
8244
8232
  "accountability.create",
@@ -8289,8 +8277,6 @@ var WRITE_OPERATION_IDS = [
8289
8277
  "datasheets.view.delete",
8290
8278
  "datasheets.view.reorder",
8291
8279
  "datasheets.view.update",
8292
- "feedbacks.create",
8293
- "feedbacks.update",
8294
8280
  "foundation.annual-objectives.create",
8295
8281
  "foundation.annual-objectives.update",
8296
8282
  "foundation.quarterly-objectives.create",
@@ -8338,8 +8324,6 @@ var WRITE_OPERATION_IDS = [
8338
8324
  "project-content.update",
8339
8325
  "projects.create",
8340
8326
  "projects.update",
8341
- "pulse.create",
8342
- "pulse.update",
8343
8327
  "questions.create",
8344
8328
  "questions.update",
8345
8329
  "rock-collections.create",
@@ -8347,6 +8331,10 @@ var WRITE_OPERATION_IDS = [
8347
8331
  "rocks.create",
8348
8332
  "rocks.update",
8349
8333
  "rocks.update-status",
8334
+ "reminders.clear",
8335
+ "reminders.create",
8336
+ "reminders.destroy",
8337
+ "reminders.update",
8350
8338
  "scorecard-groups.create",
8351
8339
  "scorecard-groups.update",
8352
8340
  "scorecards.create",
@@ -8388,7 +8376,9 @@ var WRITE_OPERATION_IDS = [
8388
8376
  "todo-groups.create",
8389
8377
  "todo-groups.update",
8390
8378
  "todos.create",
8391
- "todos.update"
8379
+ "todos.update",
8380
+ "sketches.create",
8381
+ "sketches.update-metadata"
8392
8382
  ];
8393
8383
  var DIRECT_MACHINE_WRITE_OPERATION_IDS = /* @__PURE__ */ new Set(["automations.create"]);
8394
8384
  var AUTH_OPERATION_IDS = ["login", "logout"];
@@ -8409,6 +8399,8 @@ var DESTRUCTIVE_OPERATION_IDS = /* @__PURE__ */ new Set([
8409
8399
  "datasheets.view.delete",
8410
8400
  "milestones.destroy",
8411
8401
  "project-content.destroy",
8402
+ "reminders.clear",
8403
+ "reminders.destroy",
8412
8404
  "signatures.destroy",
8413
8405
  "signatures.void",
8414
8406
  "subissues.destroy",
@@ -8425,6 +8417,14 @@ var OPERATION_IDS_BY_CLASSIFICATION = {
8425
8417
  auth: AUTH_OPERATION_IDS
8426
8418
  };
8427
8419
  var metadataByOperationId = /* @__PURE__ */ new Map();
8420
+ function assertDataPipelineReadOnlyRegistration(id, metadata) {
8421
+ if (!id.startsWith("data-pipeline.")) return;
8422
+ const isReadOnlyOperation = metadata.classification === "read" && metadata.atlasSafetyClass === "read_only" || metadata.classification === "discovery" && metadata.atlasSafetyClass === "discovery";
8423
+ if (isReadOnlyOperation && !metadata.requiresApproval && !metadata.machine.supportsPreview) {
8424
+ return;
8425
+ }
8426
+ throw new Error(`Data Pipeline operations must remain read-only: ${id}`);
8427
+ }
8428
8428
  for (const [classification, operationIds] of Object.entries(OPERATION_IDS_BY_CLASSIFICATION)) {
8429
8429
  for (const id of operationIds) {
8430
8430
  if (metadataByOperationId.has(id)) {
@@ -8434,7 +8434,7 @@ for (const [classification, operationIds] of Object.entries(OPERATION_IDS_BY_CLA
8434
8434
  if (DESTRUCTIVE_OPERATION_IDS.has(id) && classification !== "write") {
8435
8435
  throw new Error(`Destructive Wave CLI operation must be a write: ${id}`);
8436
8436
  }
8437
- metadataByOperationId.set(id, {
8437
+ const metadata = {
8438
8438
  classification,
8439
8439
  requiresApproval: classification === "write" && !DIRECT_MACHINE_WRITE_OPERATION_IDS.has(id),
8440
8440
  atlasSafetyClass,
@@ -8444,7 +8444,9 @@ for (const [classification, operationIds] of Object.entries(OPERATION_IDS_BY_CLA
8444
8444
  supportsExecute: true,
8445
8445
  executionMode: "sync"
8446
8446
  }
8447
- });
8447
+ };
8448
+ assertDataPipelineReadOnlyRegistration(id, metadata);
8449
+ metadataByOperationId.set(id, metadata);
8448
8450
  }
8449
8451
  }
8450
8452
  function registeredOperationMetadata(id) {
@@ -8606,15 +8608,15 @@ function buildOperationManifest(program) {
8606
8608
  }
8607
8609
 
8608
8610
  // src/commands/osmd.ts
8609
- var sourceSchema = z18.enum([
8611
+ var sourceSchema = z19.enum([
8610
8612
  "canonical_osmd",
8611
8613
  "agent_overlay",
8612
8614
  "agent_wiki",
8613
8615
  "thread_workspace"
8614
8616
  ]);
8615
- var accessSchema = z18.enum(["read_only", "read_write", "append_only"]).catch("read_write");
8616
- var ownerSchema = z18.enum(["system", "atlas"]);
8617
- var suggestedActionSchema = z18.enum([
8617
+ var accessSchema = z19.enum(["read_only", "read_write", "append_only"]).catch("read_write");
8618
+ var ownerSchema = z19.enum(["system", "atlas"]);
8619
+ var suggestedActionSchema = z19.enum([
8618
8620
  "read",
8619
8621
  "create",
8620
8622
  "init",
@@ -8623,7 +8625,7 @@ var suggestedActionSchema = z18.enum([
8623
8625
  "forbidden",
8624
8626
  "invalid_parent"
8625
8627
  ]).catch("update");
8626
- var agentMarkdownErrorCodeSchema = z18.enum([
8628
+ var agentMarkdownErrorCodeSchema = z19.enum([
8627
8629
  "canonical_osmd_read_only",
8628
8630
  "agent_parent_not_found",
8629
8631
  "agent_file_not_found",
@@ -8634,9 +8636,9 @@ var agentMarkdownErrorCodeSchema = z18.enum([
8634
8636
  "invalid_agent_wiki_path"
8635
8637
  ]);
8636
8638
  var agentMarkdownErrorCodeFieldSchema = agentMarkdownErrorCodeSchema.nullable().catch(null);
8637
- var nonEmptyString3 = z18.string().min(1);
8638
- var nonNegativeInt3 = z18.coerce.number().int().min(0);
8639
- var positiveInt = z18.coerce.number().int().min(1);
8639
+ var nonEmptyString3 = z19.string().min(1);
8640
+ var nonNegativeInt3 = z19.coerce.number().int().min(0);
8641
+ var positiveInt = z19.coerce.number().int().min(1);
8640
8642
  var supportedAgentOverlaySystemFiles = ["notes.md", "summary.md"];
8641
8643
  var supportedWikiIndexFile = "index.md";
8642
8644
  var supportedWikiLogFile = "log.md";
@@ -8652,20 +8654,20 @@ var supportedWikiControlledPatterns = supportedWikiControlledFolders.map(
8652
8654
  );
8653
8655
  var controlledWikiSlugPattern = /^[a-z0-9][a-z0-9-]*$/;
8654
8656
  var agentMarkdownSlugPattern = /^[a-z0-9][a-z0-9-]*$/;
8655
- var osmdSearchScopeSchema = z18.enum([
8657
+ var osmdSearchScopeSchema = z19.enum([
8656
8658
  "os-only",
8657
8659
  "agent-overlay-only",
8658
8660
  "agent-wiki-only",
8659
8661
  "combined"
8660
8662
  ]);
8661
- var osmdLintScopeSchema = z18.enum([
8663
+ var osmdLintScopeSchema = z19.enum([
8662
8664
  "combined",
8663
8665
  "agent-overlay-only",
8664
8666
  "agent-wiki-only"
8665
8667
  ]);
8666
- var osmdMemoryQualityScopeSchema = z18.enum(["agent-overlay-only"]);
8667
- var osmdIngestKindSchema = z18.enum(["text", "file", "url", "transcript"]);
8668
- var osmdRawSourceTypeSchema = z18.enum([
8668
+ var osmdMemoryQualityScopeSchema = z19.enum(["agent-overlay-only"]);
8669
+ var osmdIngestKindSchema = z19.enum(["text", "file", "url", "transcript"]);
8670
+ var osmdRawSourceTypeSchema = z19.enum([
8669
8671
  "pasted_text",
8670
8672
  "uploaded_markdown",
8671
8673
  "uploaded_text",
@@ -8674,37 +8676,37 @@ var osmdRawSourceTypeSchema = z18.enum([
8674
8676
  "meeting_transcript",
8675
8677
  "url"
8676
8678
  ]);
8677
- var agentMarkdownFileSchema = z18.preprocess(
8679
+ var agentMarkdownFileSchema = z19.preprocess(
8678
8680
  normalizeAgentMarkdownJsonKeys,
8679
- z18.object({
8680
- path: z18.string(),
8681
+ z19.object({
8682
+ path: z19.string(),
8681
8683
  source: sourceSchema,
8682
8684
  access: accessSchema,
8683
8685
  owner: ownerSchema,
8684
- exists: z18.boolean(),
8685
- canCreate: z18.boolean(),
8686
- canUpdate: z18.boolean(),
8687
- canAppend: z18.boolean(),
8688
- wikiRole: z18.string().nullable().optional(),
8689
- formatVersion: z18.string().nullable().optional(),
8690
- createdAt: z18.string().nullable().optional(),
8691
- updatedAt: z18.string().nullable().optional(),
8692
- ingestedAt: z18.string().nullable().optional(),
8693
- lastSeenAt: z18.string().nullable().optional(),
8694
- canonicalParentUpdatedAt: z18.string().nullable().optional(),
8695
- parentRef: z18.string().nullable().optional(),
8696
- agentChildrenAllowed: z18.boolean(),
8686
+ exists: z19.boolean(),
8687
+ canCreate: z19.boolean(),
8688
+ canUpdate: z19.boolean(),
8689
+ canAppend: z19.boolean(),
8690
+ wikiRole: z19.string().nullable().optional(),
8691
+ formatVersion: z19.string().nullable().optional(),
8692
+ createdAt: z19.string().nullable().optional(),
8693
+ updatedAt: z19.string().nullable().optional(),
8694
+ ingestedAt: z19.string().nullable().optional(),
8695
+ lastSeenAt: z19.string().nullable().optional(),
8696
+ canonicalParentUpdatedAt: z19.string().nullable().optional(),
8697
+ parentRef: z19.string().nullable().optional(),
8698
+ agentChildrenAllowed: z19.boolean(),
8697
8699
  suggestedAction: suggestedActionSchema,
8698
8700
  errorCode: agentMarkdownErrorCodeFieldSchema.optional(),
8699
- content: z18.string().nullable().optional(),
8700
- url: z18.string().nullable().optional(),
8701
- workspaceId: z18.string().nullable().optional(),
8702
- fileId: z18.string().nullable().optional(),
8703
- name: z18.string().nullable().optional(),
8704
- displayName: z18.string().nullable().optional(),
8705
- contentSha: z18.string().nullable().optional(),
8706
- versionSha: z18.string().nullable().optional(),
8707
- mediaType: z18.string().nullable().optional()
8701
+ content: z19.string().nullable().optional(),
8702
+ url: z19.string().nullable().optional(),
8703
+ workspaceId: z19.string().nullable().optional(),
8704
+ fileId: z19.string().nullable().optional(),
8705
+ name: z19.string().nullable().optional(),
8706
+ displayName: z19.string().nullable().optional(),
8707
+ contentSha: z19.string().nullable().optional(),
8708
+ versionSha: z19.string().nullable().optional(),
8709
+ mediaType: z19.string().nullable().optional()
8708
8710
  }).transform((value) => ({
8709
8711
  ...value,
8710
8712
  wikiRole: value.wikiRole ?? null,
@@ -8727,31 +8729,31 @@ var agentMarkdownFileSchema = z18.preprocess(
8727
8729
  mediaType: value.mediaType ?? null
8728
8730
  }))
8729
8731
  );
8730
- var agentMarkdownFilesSchema = z18.array(agentMarkdownFileSchema);
8731
- var agentMarkdownMutationDataSchema = z18.union([
8732
+ var agentMarkdownFilesSchema = z19.array(agentMarkdownFileSchema);
8733
+ var agentMarkdownMutationDataSchema = z19.union([
8732
8734
  agentMarkdownFileSchema,
8733
- z18.object({ files: agentMarkdownFilesSchema })
8735
+ z19.object({ files: agentMarkdownFilesSchema })
8734
8736
  ]);
8735
- var osmdSearchCandidateSchema = z18.preprocess(
8737
+ var osmdSearchCandidateSchema = z19.preprocess(
8736
8738
  normalizeAgentMarkdownJsonKeys,
8737
- z18.object({
8738
- path: z18.string(),
8739
+ z19.object({
8740
+ path: z19.string(),
8739
8741
  source: sourceSchema,
8740
8742
  access: accessSchema,
8741
8743
  owner: ownerSchema,
8742
- wikiRole: z18.string().nullable().optional(),
8743
- formatVersion: z18.string().nullable().optional(),
8744
- parentRef: z18.string().nullable().optional(),
8745
- exists: z18.boolean(),
8746
- agentChildrenAllowed: z18.boolean(),
8747
- title: z18.string(),
8748
- label: z18.string(),
8749
- snippet: z18.string().nullable().optional(),
8750
- rank: z18.number().int(),
8751
- matchReason: z18.string().nullable().optional(),
8752
- toolKey: z18.string().nullable().optional(),
8753
- nodeKey: z18.string().nullable().optional(),
8754
- nodeKind: z18.string().nullable().optional()
8744
+ wikiRole: z19.string().nullable().optional(),
8745
+ formatVersion: z19.string().nullable().optional(),
8746
+ parentRef: z19.string().nullable().optional(),
8747
+ exists: z19.boolean(),
8748
+ agentChildrenAllowed: z19.boolean(),
8749
+ title: z19.string(),
8750
+ label: z19.string(),
8751
+ snippet: z19.string().nullable().optional(),
8752
+ rank: z19.number().int(),
8753
+ matchReason: z19.string().nullable().optional(),
8754
+ toolKey: z19.string().nullable().optional(),
8755
+ nodeKey: z19.string().nullable().optional(),
8756
+ nodeKind: z19.string().nullable().optional()
8755
8757
  }).transform((value) => ({
8756
8758
  ...value,
8757
8759
  wikiRole: value.wikiRole ?? null,
@@ -8764,26 +8766,26 @@ var osmdSearchCandidateSchema = z18.preprocess(
8764
8766
  nodeKind: value.nodeKind ?? null
8765
8767
  }))
8766
8768
  );
8767
- var osmdSearchResultSchema = z18.preprocess(
8769
+ var osmdSearchResultSchema = z19.preprocess(
8768
8770
  normalizeAgentMarkdownJsonKeys,
8769
- z18.object({
8770
- query: z18.string(),
8771
- scope: z18.string(),
8772
- count: z18.number().int().min(0),
8773
- candidates: z18.array(osmdSearchCandidateSchema)
8771
+ z19.object({
8772
+ query: z19.string(),
8773
+ scope: z19.string(),
8774
+ count: z19.number().int().min(0),
8775
+ candidates: z19.array(osmdSearchCandidateSchema)
8774
8776
  })
8775
8777
  );
8776
- var osmdWikiLintIssueSchema = z18.preprocess(
8778
+ var osmdWikiLintIssueSchema = z19.preprocess(
8777
8779
  normalizeAgentMarkdownJsonKeys,
8778
- z18.object({
8779
- code: z18.string(),
8780
- severity: z18.string(),
8781
- path: z18.string(),
8782
- source: z18.string().nullable().optional(),
8783
- parentRef: z18.string().nullable().optional(),
8784
- message: z18.string(),
8785
- suggestedAction: z18.string().nullable().optional(),
8786
- canAutoFix: z18.boolean()
8780
+ z19.object({
8781
+ code: z19.string(),
8782
+ severity: z19.string(),
8783
+ path: z19.string(),
8784
+ source: z19.string().nullable().optional(),
8785
+ parentRef: z19.string().nullable().optional(),
8786
+ message: z19.string(),
8787
+ suggestedAction: z19.string().nullable().optional(),
8788
+ canAutoFix: z19.boolean()
8787
8789
  }).transform((value) => ({
8788
8790
  ...value,
8789
8791
  source: value.source ?? null,
@@ -8791,37 +8793,37 @@ var osmdWikiLintIssueSchema = z18.preprocess(
8791
8793
  suggestedAction: value.suggestedAction ?? null
8792
8794
  }))
8793
8795
  );
8794
- var osmdWikiLintResultSchema = z18.preprocess(
8796
+ var osmdWikiLintResultSchema = z19.preprocess(
8795
8797
  normalizeAgentMarkdownJsonKeys,
8796
- z18.object({
8797
- status: z18.string(),
8798
- summary: z18.object({
8799
- totalIssues: z18.number().int().min(0),
8800
- errors: z18.number().int().min(0),
8801
- warnings: z18.number().int().min(0),
8802
- suggestions: z18.number().int().min(0)
8798
+ z19.object({
8799
+ status: z19.string(),
8800
+ summary: z19.object({
8801
+ totalIssues: z19.number().int().min(0),
8802
+ errors: z19.number().int().min(0),
8803
+ warnings: z19.number().int().min(0),
8804
+ suggestions: z19.number().int().min(0)
8803
8805
  }),
8804
- issues: z18.array(osmdWikiLintIssueSchema)
8806
+ issues: z19.array(osmdWikiLintIssueSchema)
8805
8807
  })
8806
8808
  );
8807
- var nullableCountSchema = z18.preprocess(
8809
+ var nullableCountSchema = z19.preprocess(
8808
8810
  (value) => value === void 0 || value === null || value === "" ? null : value,
8809
- z18.coerce.number().int().min(0).nullable()
8811
+ z19.coerce.number().int().min(0).nullable()
8810
8812
  ).catch(null);
8811
- var osmdMemoryQualityIssueSchema = z18.preprocess(
8813
+ var osmdMemoryQualityIssueSchema = z19.preprocess(
8812
8814
  normalizeAgentMarkdownJsonKeys,
8813
- z18.object({
8814
- code: z18.string().nullable().optional(),
8815
- issueCode: z18.string().nullable().optional(),
8816
- path: z18.string().nullable().optional(),
8817
- parentRef: z18.string().nullable().optional(),
8818
- dimension: z18.string().nullable().optional(),
8819
- evidence: z18.string().nullable().optional(),
8820
- evidenceSnippet: z18.string().nullable().optional(),
8821
- message: z18.string().nullable().optional(),
8822
- severity: z18.string().nullable().optional(),
8823
- suggestedAction: z18.string().nullable().optional(),
8824
- canAutoFix: z18.boolean().nullable().optional()
8815
+ z19.object({
8816
+ code: z19.string().nullable().optional(),
8817
+ issueCode: z19.string().nullable().optional(),
8818
+ path: z19.string().nullable().optional(),
8819
+ parentRef: z19.string().nullable().optional(),
8820
+ dimension: z19.string().nullable().optional(),
8821
+ evidence: z19.string().nullable().optional(),
8822
+ evidenceSnippet: z19.string().nullable().optional(),
8823
+ message: z19.string().nullable().optional(),
8824
+ severity: z19.string().nullable().optional(),
8825
+ suggestedAction: z19.string().nullable().optional(),
8826
+ canAutoFix: z19.boolean().nullable().optional()
8825
8827
  }).passthrough().transform((value) => ({
8826
8828
  ...value,
8827
8829
  code: value.code ?? value.issueCode ?? "unknown_issue",
@@ -8836,16 +8838,16 @@ var osmdMemoryQualityIssueSchema = z18.preprocess(
8836
8838
  canAutoFix: value.canAutoFix === true ? true : false
8837
8839
  }))
8838
8840
  );
8839
- var osmdMemoryQualityOverlaySchema = z18.preprocess(
8841
+ var osmdMemoryQualityOverlaySchema = z19.preprocess(
8840
8842
  normalizeAgentMarkdownJsonKeys,
8841
- z18.object({
8842
- path: z18.string().nullable().optional(),
8843
- parentRef: z18.string().nullable().optional(),
8844
- status: z18.string().nullable().optional(),
8845
- score: z18.union([z18.number(), z18.string()]).nullable().optional(),
8846
- overallScore: z18.union([z18.number(), z18.string()]).nullable().optional(),
8847
- dimensions: z18.unknown().nullable().optional(),
8848
- issues: z18.array(osmdMemoryQualityIssueSchema).optional()
8843
+ z19.object({
8844
+ path: z19.string().nullable().optional(),
8845
+ parentRef: z19.string().nullable().optional(),
8846
+ status: z19.string().nullable().optional(),
8847
+ score: z19.union([z19.number(), z19.string()]).nullable().optional(),
8848
+ overallScore: z19.union([z19.number(), z19.string()]).nullable().optional(),
8849
+ dimensions: z19.unknown().nullable().optional(),
8850
+ issues: z19.array(osmdMemoryQualityIssueSchema).optional()
8849
8851
  }).passthrough().transform((value) => ({
8850
8852
  ...value,
8851
8853
  path: value.path ?? null,
@@ -8857,9 +8859,9 @@ var osmdMemoryQualityOverlaySchema = z18.preprocess(
8857
8859
  issues: value.issues ?? []
8858
8860
  }))
8859
8861
  );
8860
- var osmdMemoryQualitySummarySchema = z18.preprocess(
8862
+ var osmdMemoryQualitySummarySchema = z19.preprocess(
8861
8863
  normalizeAgentMarkdownJsonKeys,
8862
- z18.object({
8864
+ z19.object({
8863
8865
  evaluatedCount: nullableCountSchema.optional(),
8864
8866
  passCount: nullableCountSchema.optional(),
8865
8867
  warnCount: nullableCountSchema.optional(),
@@ -8877,19 +8879,19 @@ var osmdMemoryQualitySummarySchema = z18.preprocess(
8877
8879
  failCount: value.failCount ?? value.failures ?? null
8878
8880
  }))
8879
8881
  );
8880
- var osmdMemoryQualityResultSchema = z18.preprocess(
8882
+ var osmdMemoryQualityResultSchema = z19.preprocess(
8881
8883
  normalizeAgentMarkdownJsonKeys,
8882
- z18.object({
8883
- status: z18.string(),
8884
- scope: z18.string().nullable().optional(),
8884
+ z19.object({
8885
+ status: z19.string(),
8886
+ scope: z19.string().nullable().optional(),
8885
8887
  evaluatedCount: nullableCountSchema.optional(),
8886
8888
  passCount: nullableCountSchema.optional(),
8887
8889
  warnCount: nullableCountSchema.optional(),
8888
8890
  failCount: nullableCountSchema.optional(),
8889
8891
  summary: osmdMemoryQualitySummarySchema.optional(),
8890
- weakestOverlays: z18.array(osmdMemoryQualityOverlaySchema).optional(),
8891
- issues: z18.array(osmdMemoryQualityIssueSchema).optional(),
8892
- scores: z18.array(osmdMemoryQualityOverlaySchema).optional()
8892
+ weakestOverlays: z19.array(osmdMemoryQualityOverlaySchema).optional(),
8893
+ issues: z19.array(osmdMemoryQualityIssueSchema).optional(),
8894
+ scores: z19.array(osmdMemoryQualityOverlaySchema).optional()
8893
8895
  }).passthrough().transform((value) => {
8894
8896
  const summary = isRecord5(value.summary) ? value.summary : null;
8895
8897
  return {
@@ -8913,24 +8915,24 @@ function normalizeOsmdIngestFileRecordInput(value) {
8913
8915
  }
8914
8916
  return normalized;
8915
8917
  }
8916
- var osmdIngestFileRecordSchema = z18.preprocess(
8918
+ var osmdIngestFileRecordSchema = z19.preprocess(
8917
8919
  normalizeOsmdIngestFileRecordInput,
8918
- z18.object({
8919
- path: z18.string(),
8920
- source: z18.string().nullable().optional(),
8921
- access: z18.string().nullable().optional(),
8922
- owner: z18.string().nullable().optional(),
8923
- parentRef: z18.string().nullable().optional(),
8924
- exists: z18.boolean().nullable().optional(),
8925
- canCreate: z18.boolean().nullable().optional(),
8926
- canUpdate: z18.boolean().nullable().optional(),
8927
- canAppend: z18.boolean().nullable().optional(),
8928
- wikiRole: z18.string().nullable().optional(),
8929
- formatVersion: z18.string().nullable().optional(),
8930
- createdAt: z18.string().nullable().optional(),
8931
- updatedAt: z18.string().nullable().optional(),
8932
- suggestedAction: z18.string().nullable().optional(),
8933
- errorCode: z18.string().nullable().optional()
8920
+ z19.object({
8921
+ path: z19.string(),
8922
+ source: z19.string().nullable().optional(),
8923
+ access: z19.string().nullable().optional(),
8924
+ owner: z19.string().nullable().optional(),
8925
+ parentRef: z19.string().nullable().optional(),
8926
+ exists: z19.boolean().nullable().optional(),
8927
+ canCreate: z19.boolean().nullable().optional(),
8928
+ canUpdate: z19.boolean().nullable().optional(),
8929
+ canAppend: z19.boolean().nullable().optional(),
8930
+ wikiRole: z19.string().nullable().optional(),
8931
+ formatVersion: z19.string().nullable().optional(),
8932
+ createdAt: z19.string().nullable().optional(),
8933
+ updatedAt: z19.string().nullable().optional(),
8934
+ suggestedAction: z19.string().nullable().optional(),
8935
+ errorCode: z19.string().nullable().optional()
8934
8936
  }).passthrough().transform((value) => ({
8935
8937
  ...value,
8936
8938
  source: value.source ?? null,
@@ -8949,17 +8951,17 @@ var osmdIngestFileRecordSchema = z18.preprocess(
8949
8951
  errorCode: value.errorCode ?? null
8950
8952
  }))
8951
8953
  );
8952
- var osmdIngestResultSchema = z18.preprocess(
8954
+ var osmdIngestResultSchema = z19.preprocess(
8953
8955
  normalizeAgentMarkdownJsonKeys,
8954
- z18.object({
8955
- rawSourceId: z18.union([z18.string(), z18.number()]).nullable().optional(),
8956
- sourceSummaryPath: z18.string().nullable().optional(),
8956
+ z19.object({
8957
+ rawSourceId: z19.union([z19.string(), z19.number()]).nullable().optional(),
8958
+ sourceSummaryPath: z19.string().nullable().optional(),
8957
8959
  sourceSummaryFile: osmdIngestFileRecordSchema.nullable().optional(),
8958
- slug: z18.string().nullable().optional(),
8959
- runLint: z18.boolean().nullable().optional(),
8960
- createdFiles: z18.array(osmdIngestFileRecordSchema).optional(),
8961
- updatedFiles: z18.array(osmdIngestFileRecordSchema).optional(),
8962
- skippedUpdates: z18.array(z18.unknown()).optional(),
8960
+ slug: z19.string().nullable().optional(),
8961
+ runLint: z19.boolean().nullable().optional(),
8962
+ createdFiles: z19.array(osmdIngestFileRecordSchema).optional(),
8963
+ updatedFiles: z19.array(osmdIngestFileRecordSchema).optional(),
8964
+ skippedUpdates: z19.array(z19.unknown()).optional(),
8963
8965
  lintResult: osmdWikiLintResultSchema.nullable().optional()
8964
8966
  }).passthrough().transform((value) => ({
8965
8967
  ...value,
@@ -8974,37 +8976,37 @@ var osmdIngestResultSchema = z18.preprocess(
8974
8976
  lintResult: value.lintResult ?? null
8975
8977
  }))
8976
8978
  );
8977
- var mutationPayloadSchema = z18.object({
8978
- ok: z18.boolean(),
8979
- status: z18.number(),
8980
- errorCode: z18.string().nullable().optional(),
8981
- data: z18.unknown().nullable().optional(),
8982
- errors: z18.unknown().nullable().optional()
8979
+ var mutationPayloadSchema = z19.object({
8980
+ ok: z19.boolean(),
8981
+ status: z19.number(),
8982
+ errorCode: z19.string().nullable().optional(),
8983
+ data: z19.unknown().nullable().optional(),
8984
+ errors: z19.unknown().nullable().optional()
8983
8985
  });
8984
- var markdownTreeNodeSchema = z18.lazy(
8985
- () => z18.object({
8986
- toolKey: z18.string(),
8987
- nodeKey: z18.string(),
8988
- nodeKind: z18.string(),
8989
- runtimeLabel: z18.string(),
8990
- path: z18.string().nullable().optional().transform((value) => value ?? null),
8986
+ var markdownTreeNodeSchema = z19.lazy(
8987
+ () => z19.object({
8988
+ toolKey: z19.string(),
8989
+ nodeKey: z19.string(),
8990
+ nodeKind: z19.string(),
8991
+ runtimeLabel: z19.string(),
8992
+ path: z19.string().nullable().optional().transform((value) => value ?? null),
8991
8993
  source: sourceSchema,
8992
8994
  access: accessSchema,
8993
8995
  owner: ownerSchema,
8994
- parentRef: z18.string().nullable().optional().transform((value) => value ?? null),
8995
- agentChildrenAllowed: z18.boolean(),
8996
- exists: z18.boolean(),
8997
- resolvedScope: z18.object({
8998
- parentId: z18.string().nullable().optional().transform((value) => value ?? null),
8999
- recordId: z18.string().nullable().optional().transform((value) => value ?? null),
9000
- memberId: z18.string().nullable().optional().transform((value) => value ?? null),
9001
- teamId: z18.string().nullable().optional().transform((value) => value ?? null),
9002
- contentType: z18.string().nullable().optional().transform((value) => value ?? null)
8996
+ parentRef: z19.string().nullable().optional().transform((value) => value ?? null),
8997
+ agentChildrenAllowed: z19.boolean(),
8998
+ exists: z19.boolean(),
8999
+ resolvedScope: z19.object({
9000
+ parentId: z19.string().nullable().optional().transform((value) => value ?? null),
9001
+ recordId: z19.string().nullable().optional().transform((value) => value ?? null),
9002
+ memberId: z19.string().nullable().optional().transform((value) => value ?? null),
9003
+ teamId: z19.string().nullable().optional().transform((value) => value ?? null),
9004
+ contentType: z19.string().nullable().optional().transform((value) => value ?? null)
9003
9005
  }),
9004
- isLeaf: z18.boolean(),
9005
- treeView: z18.boolean(),
9006
- details: z18.unknown().nullable(),
9007
- children: z18.array(markdownTreeNodeSchema).optional().transform((value) => value ?? [])
9006
+ isLeaf: z19.boolean(),
9007
+ treeView: z19.boolean(),
9008
+ details: z19.unknown().nullable(),
9009
+ children: z19.array(markdownTreeNodeSchema).optional().transform((value) => value ?? [])
9008
9010
  })
9009
9011
  );
9010
9012
  var AGENT_MARKDOWN_FILE_SELECTION = `{
@@ -9696,15 +9698,15 @@ function normalizeAgentFilePath(file, parentRef) {
9696
9698
  const trimmed = nonEmptyString3.parse(file).trim().replace(/^\/+|\/+$/g, "");
9697
9699
  const fileName = trimmed.startsWith(".agent/") ? trimmed.slice(".agent/".length) : trimmed;
9698
9700
  const isThreadWorkspace = atlasThreadWorkspaceParentRefPattern.test(parentRef);
9699
- const isSupportedFile = isThreadWorkspace ? /^[a-z0-9][a-z0-9-]*\.(?:md|txt)$/.test(fileName) : isSupportedAgentOverlayFileName(fileName);
9701
+ const isSupportedFile = isThreadWorkspace ? /^[a-z0-9][a-z0-9-]*\.(?:md|txt|csv)$/.test(fileName) : isSupportedAgentOverlayFileName(fileName);
9700
9702
  if (fileName.includes("\\") || fileName.includes("/") || fileName === "." || fileName === ".." || !isSupportedFile) {
9701
9703
  throw new CliError({
9702
- message: isThreadWorkspace ? "Atlas task workspaces support only lowercase kebab-case .md or .txt basenames." : ".agent supports only notes.md, summary.md, or <lowercase-kebab-slug>.md.",
9704
+ message: isThreadWorkspace ? "Atlas task workspaces support only lowercase kebab-case .md, .txt, or .csv basenames." : ".agent supports only notes.md, summary.md, or <lowercase-kebab-slug>.md.",
9703
9705
  kind: "invalid_args",
9704
9706
  status: 400,
9705
9707
  exitCode: EXIT_CODES.invalidArgs,
9706
9708
  details: {
9707
- supportedFiles: isThreadWorkspace ? ["<lowercase-kebab-slug>.md", "<lowercase-kebab-slug>.txt"] : [...supportedAgentOverlaySystemFiles, "<lowercase-kebab-slug>.md"]
9709
+ supportedFiles: isThreadWorkspace ? ["<lowercase-kebab-slug>.md", "<lowercase-kebab-slug>.txt", "<lowercase-kebab-slug>.csv"] : [...supportedAgentOverlaySystemFiles, "<lowercase-kebab-slug>.md"]
9708
9710
  }
9709
9711
  });
9710
9712
  }
@@ -11187,7 +11189,7 @@ function positiveInt2(raw, fallback) {
11187
11189
  function requestTimeoutMs(totalTimeoutMs) {
11188
11190
  return Math.max(1e3, Math.min(totalTimeoutMs, 1e4));
11189
11191
  }
11190
- function asRecord5(value) {
11192
+ function asRecord4(value) {
11191
11193
  return value && typeof value === "object" && !Array.isArray(value) ? value : null;
11192
11194
  }
11193
11195
  function asString(value) {
@@ -11237,9 +11239,9 @@ function cliTokenFromPoll(payload) {
11237
11239
  return asString(payload.cliToken) ?? asString(payload.cli_token) ?? asString(payload.token);
11238
11240
  }
11239
11241
  function unwrapMutationResult(value) {
11240
- const record = asRecord5(value);
11242
+ const record = asRecord4(value);
11241
11243
  if (!record) return null;
11242
- const data = asRecord5(record.data);
11244
+ const data = asRecord4(record.data);
11243
11245
  if (data && (Object.prototype.hasOwnProperty.call(record, "ok") || Object.prototype.hasOwnProperty.call(record, "errors") || Object.prototype.hasOwnProperty.call(record, "errorCode") || Object.prototype.hasOwnProperty.call(record, "error_code"))) {
11244
11246
  return data;
11245
11247
  }
@@ -11304,7 +11306,7 @@ async function runTokenLogin(cmd, opts) {
11304
11306
  exitCode: mapStatusToExitCode(status.error.status)
11305
11307
  });
11306
11308
  }
11307
- const statusData = asRecord5(status.result.data.cliAuthStatus) ?? {};
11309
+ const statusData = asRecord4(status.result.data.cliAuthStatus) ?? {};
11308
11310
  const storage = await writeStoredToken(token, baseUrl);
11309
11311
  const configPath2 = opts.saveBaseUrl ? await persistBaseUrl(baseUrl) : void 0;
11310
11312
  return printEnvelopeAndExit({
@@ -11521,7 +11523,7 @@ async function runLogout(cmd) {
11521
11523
  });
11522
11524
  if (result.ok) {
11523
11525
  requestId = result.result.requestId;
11524
- const payload = asRecord5(result.result.data.revokeCliToken) ?? {};
11526
+ const payload = asRecord4(result.result.data.revokeCliToken) ?? {};
11525
11527
  revokedRemote = payload.ok !== false;
11526
11528
  } else {
11527
11529
  requestId = result.requestId;
@@ -11584,7 +11586,7 @@ async function runAuthStatus(cmd) {
11584
11586
  exitCode: mapStatusToExitCode(result.error.status)
11585
11587
  });
11586
11588
  }
11587
- const status = asRecord5(result.result.data.cliAuthStatus) ?? {};
11589
+ const status = asRecord4(result.result.data.cliAuthStatus) ?? {};
11588
11590
  const baseAuthStatus = status.baseAuthStatus;
11589
11591
  return printEnvelopeAndExit({
11590
11592
  envelope: envelope({
@@ -11851,6 +11853,26 @@ var RECENT_TOOL_SUPPORT_REGISTRY = [
11851
11853
  ]
11852
11854
  }
11853
11855
  }),
11856
+ entry({
11857
+ cliKey: "sketches",
11858
+ displayName: "Sketches",
11859
+ backend: backendToolKey("sketches"),
11860
+ routes: ["/sketches", "/sketches/[sketchId]"],
11861
+ capabilityCategories: ["collaboration", "design", "metadata", "read_only_discovery"],
11862
+ sensitiveOutputNotes: [
11863
+ "Sketch commands must not print document bytes, collaboration updates, embedded files, comments, or auth material."
11864
+ ],
11865
+ implementation: {
11866
+ milestone: "WAVE-12",
11867
+ status: "implemented_command_surface",
11868
+ enabledCommands: ["open", "list", "show", "create", "update-metadata"],
11869
+ forbiddenCommands: ["save-document", "render", "export", "import"],
11870
+ notes: [
11871
+ "The Sketch surface is limited to metadata and does not provide an editor, renderer, binary transport, or provider connector.",
11872
+ "Create and metadata update use the existing typed GraphQL mutations."
11873
+ ]
11874
+ }
11875
+ }),
11854
11876
  entry({
11855
11877
  cliKey: "time-tracking",
11856
11878
  displayName: "Time Tracking",
@@ -12854,36 +12876,188 @@ function registerWhiteboardsCommands(program) {
12854
12876
  return printEnvelopeAndExit({
12855
12877
  envelope: {
12856
12878
  ok: true,
12857
- command: "whiteboards.open",
12879
+ command: "whiteboards.open",
12880
+ status: 200,
12881
+ data,
12882
+ error: null,
12883
+ meta: { requestId: "local_whiteboards" }
12884
+ }
12885
+ });
12886
+ });
12887
+ addListFilterOptions2(
12888
+ whiteboards.command("list").description("Read safe Whiteboards metadata")
12889
+ ).action(async (opts, cmd) => {
12890
+ await runWhiteboardsQuery(cmd, {
12891
+ command: "whiteboards.list",
12892
+ operationName: "Whiteboards",
12893
+ field: "whiteboards",
12894
+ variables: listFilters2(opts),
12895
+ variableTypes: listVariableTypes2(),
12896
+ isList: true,
12897
+ selectionSet: WHITEBOARDS_SELECTION
12898
+ });
12899
+ });
12900
+ whiteboards.command("show").description("Read safe Whiteboard detail metadata").requiredOption("--slug <slug>").action(async (opts, cmd) => {
12901
+ await runWhiteboardsQuery(cmd, {
12902
+ command: "whiteboards.show",
12903
+ operationName: "Whiteboard",
12904
+ field: "whiteboard",
12905
+ variables: { slug: opts.slug },
12906
+ variableTypes: { organization_id: "ID!", slug: "ID!" },
12907
+ isShow: true,
12908
+ selectionSet: WHITEBOARD_SELECTION
12909
+ });
12910
+ });
12911
+ }
12912
+
12913
+ // src/commands/sketches.ts
12914
+ var SKETCH_METADATA_SELECTION = "id name slug status priority archivedAt organizationId memberId teamIds documentGeneration documentVersion partytimeRoomId partytimeRoomVersion createdAt updatedAt";
12915
+ var SKETCHES_SELECTION = `{ count currentPage totalPages data { ${SKETCH_METADATA_SELECTION} } }`;
12916
+ var SKETCH_SELECTION = `{ ${SKETCH_METADATA_SELECTION} }`;
12917
+ function baseVariables4(contextOrganizationId) {
12918
+ return { organization_id: resolveOrganizationId(contextOrganizationId) };
12919
+ }
12920
+ function listFilters3(opts) {
12921
+ return {
12922
+ page: opts.page,
12923
+ per: opts.per,
12924
+ team_id: opts.teamId,
12925
+ member_id: opts.memberId,
12926
+ include_archived: opts.includeArchived
12927
+ };
12928
+ }
12929
+ function listVariableTypes3() {
12930
+ return {
12931
+ organization_id: "ID!",
12932
+ page: "Int",
12933
+ per: "Int",
12934
+ team_id: "ID",
12935
+ member_id: "ID",
12936
+ include_archived: "Boolean"
12937
+ };
12938
+ }
12939
+ async function runSketchQuery(cmd, config) {
12940
+ const context = await resolveCommandContext(cmd.optsWithGlobals());
12941
+ await runGraphqlQueryCommand({
12942
+ command: config.command,
12943
+ operationName: config.operationName,
12944
+ runtimeOptions: context.runtimeOptions,
12945
+ field: config.field,
12946
+ variables: normalizeGraphqlVariables2({
12947
+ ...baseVariables4(context.organizationId),
12948
+ ...config.variables
12949
+ }),
12950
+ ...config.variableTypes ? { variableTypes: config.variableTypes } : {},
12951
+ ...config.isList ? { isList: true } : {},
12952
+ ...config.isShow ? { isShow: true } : {},
12953
+ selectionSet: config.selectionSet
12954
+ });
12955
+ }
12956
+ function addListFilterOptions3(command) {
12957
+ return command.option("--page <page>").option("--per <per>").option("--team-id <teamId>").option("--member-id <memberId>").option("--include-archived <includeArchived>");
12958
+ }
12959
+ function sketchOpenData() {
12960
+ const tool = getRecentToolSupport("sketches");
12961
+ return {
12962
+ cliKey: "sketches",
12963
+ displayName: "Sketches",
12964
+ backend: {
12965
+ toolKey: tool?.backend.toolKey ?? "sketches",
12966
+ status: tool?.backend.status ?? "verified_wave_02",
12967
+ sourceMilestone: tool?.backend.sourceMilestone ?? "WAVE-02"
12968
+ },
12969
+ route: tool?.safeRouteTargets.primaryRoute ?? "/sketches",
12970
+ safeRouteTargets: tool?.safeRouteTargets ?? {
12971
+ primaryRoute: "/sketches",
12972
+ deepLinkTemplates: ["/sketches", "/sketches/[sketchId]"],
12973
+ status: "verified_wave_03",
12974
+ sourceMilestone: "WAVE-03"
12975
+ },
12976
+ implementation: {
12977
+ enabledCommands: ["open", "list", "show", "create", "update-metadata"],
12978
+ excludedCommands: ["save-document", "render", "export", "import"]
12979
+ },
12980
+ sensitiveOutputNotes: tool?.sensitiveOutputNotes ?? [
12981
+ "Sketch commands return metadata only and never return document bytes, collaboration updates, embedded files, comments, or tokens."
12982
+ ]
12983
+ };
12984
+ }
12985
+ function registerSketchCommands(program) {
12986
+ const sketches = program.command("sketches").description("Sketch metadata operations with bounded create and update support");
12987
+ sketches.command("open").description("Return verified Sketches app routes without opening a browser").option("--readable", "Print the primary route path only").option("--json", "Emit the stable JSON envelope").action((opts) => {
12988
+ const data = sketchOpenData();
12989
+ if (opts.readable && !opts.json) return printTextAndExit({ text: String(data.route) });
12990
+ return printEnvelopeAndExit({
12991
+ envelope: {
12992
+ ok: true,
12993
+ command: "sketches.open",
12858
12994
  status: 200,
12859
12995
  data,
12860
12996
  error: null,
12861
- meta: { requestId: "local_whiteboards" }
12997
+ meta: { requestId: "local_sketches" }
12862
12998
  }
12863
12999
  });
12864
13000
  });
12865
- addListFilterOptions2(
12866
- whiteboards.command("list").description("Read safe Whiteboards metadata")
12867
- ).action(async (opts, cmd) => {
12868
- await runWhiteboardsQuery(cmd, {
12869
- command: "whiteboards.list",
12870
- operationName: "Whiteboards",
12871
- field: "whiteboards",
12872
- variables: listFilters2(opts),
12873
- variableTypes: listVariableTypes2(),
12874
- isList: true,
12875
- selectionSet: WHITEBOARDS_SELECTION
12876
- });
12877
- });
12878
- whiteboards.command("show").description("Read safe Whiteboard detail metadata").requiredOption("--slug <slug>").action(async (opts, cmd) => {
12879
- await runWhiteboardsQuery(cmd, {
12880
- command: "whiteboards.show",
12881
- operationName: "Whiteboard",
12882
- field: "whiteboard",
13001
+ addListFilterOptions3(sketches.command("list").description("Read safe Sketch metadata")).action(
13002
+ async (opts, cmd) => {
13003
+ await runSketchQuery(cmd, {
13004
+ command: "sketches.list",
13005
+ operationName: "Sketches",
13006
+ field: "sketches",
13007
+ variables: listFilters3(opts),
13008
+ variableTypes: listVariableTypes3(),
13009
+ isList: true,
13010
+ selectionSet: SKETCHES_SELECTION
13011
+ });
13012
+ }
13013
+ );
13014
+ sketches.command("show").description("Read safe Sketch detail metadata").requiredOption("--slug <slug>").action(async (opts, cmd) => {
13015
+ await runSketchQuery(cmd, {
13016
+ command: "sketches.show",
13017
+ operationName: "Sketch",
13018
+ field: "sketch",
12883
13019
  variables: { slug: opts.slug },
12884
13020
  variableTypes: { organization_id: "ID!", slug: "ID!" },
12885
13021
  isShow: true,
12886
- selectionSet: WHITEBOARD_SELECTION
13022
+ selectionSet: SKETCH_SELECTION
13023
+ });
13024
+ });
13025
+ sketches.command("create").description("Create a Sketch with a required team and idempotency key").requiredOption("--data-json <dataJson>", 'Sketch JSON or {"sketch": {...}}').action(async (opts, cmd) => {
13026
+ const context = await resolveCommandContext(cmd.optsWithGlobals());
13027
+ const body = __testables.normalizeBody(String(opts.dataJson), "sketch");
13028
+ assertOperationPayload("sketches.create", body);
13029
+ await runGraphqlMutationCommand({
13030
+ command: "sketches.create",
13031
+ runtimeOptions: context.runtimeOptions,
13032
+ field: "create_sketch",
13033
+ variables: {
13034
+ organization_id: resolveOrganizationId(context.organizationId),
13035
+ params: body
13036
+ },
13037
+ variableTypes: {
13038
+ organization_id: "ID!",
13039
+ params: "CreateSketchParamsInput!"
13040
+ }
13041
+ });
13042
+ });
13043
+ sketches.command("update-metadata").description("Update bounded Sketch metadata; document content is never accepted").requiredOption("--id <id>").requiredOption("--data-json <dataJson>", 'Sketch metadata JSON or {"sketch": {...}}').action(async (opts, cmd) => {
13044
+ const context = await resolveCommandContext(cmd.optsWithGlobals());
13045
+ const body = __testables.normalizeBody(String(opts.dataJson), "sketch");
13046
+ assertOperationPayload("sketches.update-metadata", body);
13047
+ await runGraphqlMutationCommand({
13048
+ command: "sketches.update-metadata",
13049
+ runtimeOptions: context.runtimeOptions,
13050
+ field: "update_sketch",
13051
+ variables: {
13052
+ organization_id: resolveOrganizationId(context.organizationId),
13053
+ sketch_id: String(opts.id),
13054
+ params: body
13055
+ },
13056
+ variableTypes: {
13057
+ organization_id: "ID!",
13058
+ sketch_id: "ID!",
13059
+ params: "UpdateSketchParamsInput!"
13060
+ }
12887
13061
  });
12888
13062
  });
12889
13063
  }
@@ -12918,7 +13092,7 @@ var TIME_TRACKING_FORBIDDEN_COMMANDS = [
12918
13092
  "payroll",
12919
13093
  "billing"
12920
13094
  ];
12921
- function baseVariables4(contextOrganizationId) {
13095
+ function baseVariables5(contextOrganizationId) {
12922
13096
  return {
12923
13097
  organization_id: resolveOrganizationId(contextOrganizationId)
12924
13098
  };
@@ -12973,7 +13147,7 @@ async function runTimeTrackingQuery(cmd, config) {
12973
13147
  runtimeOptions: context.runtimeOptions,
12974
13148
  field: config.field,
12975
13149
  variables: normalizeGraphqlVariables2({
12976
- ...baseVariables4(context.organizationId),
13150
+ ...baseVariables5(context.organizationId),
12977
13151
  ...config.variables
12978
13152
  }),
12979
13153
  variableTypes: config.variableTypes,
@@ -13235,11 +13409,11 @@ function sanitizePlannerJson(value) {
13235
13409
  }
13236
13410
  return output;
13237
13411
  }
13238
- function asRecord6(value) {
13412
+ function asRecord5(value) {
13239
13413
  return value && typeof value === "object" && !Array.isArray(value) ? value : null;
13240
13414
  }
13241
13415
  function readPlannerStateKey(value, keys) {
13242
- const record = asRecord6(value);
13416
+ const record = asRecord5(value);
13243
13417
  if (!record) {
13244
13418
  return null;
13245
13419
  }
@@ -13434,6 +13608,7 @@ var MAIL_ENABLED_COMMANDS = [
13434
13608
  "open",
13435
13609
  "validate-provider",
13436
13610
  "workspace",
13611
+ "relay-evidence",
13437
13612
  "accounts",
13438
13613
  "messages",
13439
13614
  "conversations",
@@ -13499,6 +13674,9 @@ var MAIL_SETTINGS_SELECTION = "{ id organizationId memberId defaultMailAccountId
13499
13674
  var MAIL_UNREAD_COUNT_SELECTION = "{ total byAccount byLabel }";
13500
13675
  var MAIL_SYNC_STATUS_SELECTION = "{ id status operationStatus operationToolKey accountId accountIds page per view importedCount updatedCount providerCount counts errorCode statusCode queuedAt startedAt completedAt createdAt updatedAt }";
13501
13676
  var MAIL_WORKSPACE_SELECTION = `{ accounts ${MAIL_ACCOUNT_SELECTION} messages ${MAIL_MESSAGES_SELECTION} labels ${MAIL_LABEL_SELECTION} snippets ${MAIL_SNIPPET_SELECTION} settings ${MAIL_SETTINGS_SELECTION} unreadCount ${MAIL_UNREAD_COUNT_SELECTION} }`;
13677
+ var MAIL_RELAY_EVIDENCE_ACCOUNT_SELECTION = "{ id provider service status connectionState syncStatus emailAddress displayName lastSyncedAt }";
13678
+ var MAIL_RELAY_EVIDENCE_MESSAGE_SELECTION = "{ id mailAccountId subject from status direction sentAt receivedAt snippet createdAt updatedAt }";
13679
+ var MAIL_RELAY_EVIDENCE_SELECTION = `{ accounts ${MAIL_RELAY_EVIDENCE_ACCOUNT_SELECTION} messages { count currentPage totalPages data ${MAIL_RELAY_EVIDENCE_MESSAGE_SELECTION} } }`;
13502
13680
  var OUTLOOK_PROVIDER_VALIDATION_EVIDENCE = {
13503
13681
  provider: "microsoft",
13504
13682
  oauthProviderId: "wave-microsoft-outlook",
@@ -13663,7 +13841,8 @@ function buildMailOpenData() {
13663
13841
  forbiddenCommands: [...MAIL_FORBIDDEN_COMMANDS]
13664
13842
  },
13665
13843
  sensitiveOutputNotes: tool?.sensitiveOutputNotes ?? [
13666
- "Mail commands are metadata-only and must not print message bodies, subjects, snippets, contacts, attachments, provider payloads, token material, account addresses/display names, label names/colors, snippet content, preferences, signatures, sync search text, sync error bodies, or user-authored mail content."
13844
+ "Default Mail commands are metadata-only and must not print message bodies, subjects, snippets, contacts, attachments, provider payloads, token material, account addresses/display names, label names/colors, snippet content, preferences, signatures, sync search text, sync error bodies, or user-authored mail content.",
13845
+ "mail relay-evidence is the explicit bounded exception for an authenticated, user-authorized relay: it exposes mailbox identity plus sender, subject, date, and snippet metadata, but never bodies, recipients, attachments, provider IDs, or token material."
13667
13846
  ]
13668
13847
  };
13669
13848
  }
@@ -13776,6 +13955,26 @@ function registerMailCommands(program) {
13776
13955
  isShow: true
13777
13956
  });
13778
13957
  });
13958
+ addPaginationOptions(
13959
+ mail.command("relay-evidence").description(
13960
+ "Read bounded mailbox identity and recent message metadata for an explicitly authorized relay"
13961
+ ).option("--account-id <accountId>")
13962
+ ).action(async (opts, cmd) => {
13963
+ await runMailQuery(cmd, opts, {
13964
+ command: "mail.relay-evidence",
13965
+ operationName: "MailRelayEvidence",
13966
+ field: "mail_workspace",
13967
+ variables: mailWorkspaceVariables,
13968
+ variableTypes: {
13969
+ organization_id: "ID!",
13970
+ account_id: "ID",
13971
+ page: "Int",
13972
+ per: "Int"
13973
+ },
13974
+ selectionSet: MAIL_RELAY_EVIDENCE_SELECTION,
13975
+ isShow: true
13976
+ });
13977
+ });
13779
13978
  mail.command("accounts").description("Read safe Mail account metadata").action(async (opts, cmd) => {
13780
13979
  await runMailQuery(cmd, opts, {
13781
13980
  command: "mail.accounts",
@@ -13931,14 +14130,14 @@ function registerMailCommands(program) {
13931
14130
  }
13932
14131
 
13933
14132
  // src/commands/phantom.ts
13934
- import { z as z19 } from "zod";
13935
- var nonNegativeInt4 = z19.coerce.number().int().min(0);
13936
- var nullableString = z19.string().nullable().optional().transform((value) => value ?? null);
13937
- var idString = z19.union([z19.string(), z19.number()]).transform((value) => String(value));
13938
- var nullableIdString = z19.union([z19.string(), z19.number()]).nullable().optional().transform(
14133
+ import { z as z20 } from "zod";
14134
+ var nonNegativeInt4 = z20.coerce.number().int().min(0);
14135
+ var nullableString = z20.string().nullable().optional().transform((value) => value ?? null);
14136
+ var idString = z20.union([z20.string(), z20.number()]).transform((value) => String(value));
14137
+ var nullableIdString = z20.union([z20.string(), z20.number()]).nullable().optional().transform(
13939
14138
  (value) => value === void 0 || value === null ? null : String(value)
13940
14139
  );
13941
- var jsonObject = z19.record(z19.string(), z19.unknown());
14140
+ var jsonObject = z20.record(z20.string(), z20.unknown());
13942
14141
  var PHANTOM_LEDGER_INVENTORY_SELECTION = `{
13943
14142
  schemaVersion
13944
14143
  runsCount
@@ -14151,10 +14350,10 @@ var PHANTOM_LEDGER_KEY_ALIASES = {
14151
14350
  content_hash: "contentHash",
14152
14351
  observed_at: "observedAt"
14153
14352
  };
14154
- var phantomLedgerInventorySchema = z19.preprocess(
14353
+ var phantomLedgerInventorySchema = z20.preprocess(
14155
14354
  normalizePhantomLedgerKeys,
14156
- z19.object({
14157
- schemaVersion: z19.string(),
14355
+ z20.object({
14356
+ schemaVersion: z20.string(),
14158
14357
  runsCount: nonNegativeInt4,
14159
14358
  observationsCount: nonNegativeInt4,
14160
14359
  candidatesCount: nonNegativeInt4,
@@ -14164,16 +14363,16 @@ var phantomLedgerInventorySchema = z19.preprocess(
14164
14363
  reportsCount: nonNegativeInt4
14165
14364
  })
14166
14365
  );
14167
- var phantomRunSchema = z19.preprocess(
14366
+ var phantomRunSchema = z20.preprocess(
14168
14367
  normalizePhantomLedgerKeys,
14169
- z19.object({
14368
+ z20.object({
14170
14369
  id: idString,
14171
14370
  organizationId: idString,
14172
- notificationId: z19.union([z19.string(), z19.number()]).nullable().optional().transform(
14371
+ notificationId: z20.union([z20.string(), z20.number()]).nullable().optional().transform(
14173
14372
  (value) => value === void 0 || value === null ? null : String(value)
14174
14373
  ),
14175
- status: z19.string(),
14176
- triggerType: z19.string(),
14374
+ status: z20.string(),
14375
+ triggerType: z20.string(),
14177
14376
  startedAt: nullableString,
14178
14377
  completedAt: nullableString,
14179
14378
  scannedFileCount: nonNegativeInt4,
@@ -14183,163 +14382,163 @@ var phantomRunSchema = z19.preprocess(
14183
14382
  errorCount: nonNegativeInt4,
14184
14383
  warningCount: nonNegativeInt4,
14185
14384
  errorMessage: nullableString,
14186
- dryRun: z19.boolean(),
14187
- schemaVersion: z19.string(),
14385
+ dryRun: z20.boolean(),
14386
+ schemaVersion: z20.string(),
14188
14387
  testRunId: nullableString,
14189
14388
  idempotencyKey: nullableString,
14190
14389
  ledgerMetadata: jsonObject.catch({}),
14191
- createdAt: z19.string(),
14192
- updatedAt: z19.string()
14390
+ createdAt: z20.string(),
14391
+ updatedAt: z20.string()
14193
14392
  })
14194
14393
  );
14195
- var phantomRunListItemSchema = z19.preprocess(
14394
+ var phantomRunListItemSchema = z20.preprocess(
14196
14395
  normalizePhantomLedgerKeys,
14197
- z19.object({
14396
+ z20.object({
14198
14397
  id: idString,
14199
14398
  organizationId: idString,
14200
- status: z19.string(),
14201
- triggerType: z19.string(),
14202
- dryRun: z19.boolean(),
14203
- schemaVersion: z19.string(),
14399
+ status: z20.string(),
14400
+ triggerType: z20.string(),
14401
+ dryRun: z20.boolean(),
14402
+ schemaVersion: z20.string(),
14204
14403
  testRunId: nullableString,
14205
- createdAt: z19.string(),
14206
- updatedAt: z19.string()
14404
+ createdAt: z20.string(),
14405
+ updatedAt: z20.string()
14207
14406
  })
14208
14407
  );
14209
- var phantomReportSchema = z19.preprocess(
14408
+ var phantomReportSchema = z20.preprocess(
14210
14409
  normalizePhantomLedgerKeys,
14211
- z19.object({
14410
+ z20.object({
14212
14411
  id: idString,
14213
14412
  organizationId: idString,
14214
14413
  phantomRunId: idString,
14215
- status: z19.string(),
14216
- reportType: z19.string(),
14217
- schemaVersion: z19.string(),
14414
+ status: z20.string(),
14415
+ reportType: z20.string(),
14416
+ schemaVersion: z20.string(),
14218
14417
  markdownPath: nullableString,
14219
14418
  payload: jsonObject.catch({}),
14220
14419
  testRunId: nullableString,
14221
- idempotencyKey: z19.string(),
14222
- createdAt: z19.string(),
14223
- updatedAt: z19.string()
14420
+ idempotencyKey: z20.string(),
14421
+ createdAt: z20.string(),
14422
+ updatedAt: z20.string()
14224
14423
  })
14225
14424
  );
14226
- var phantomObservationSchema = z19.preprocess(
14425
+ var phantomObservationSchema = z20.preprocess(
14227
14426
  normalizePhantomLedgerKeys,
14228
- z19.object({
14427
+ z20.object({
14229
14428
  id: idString,
14230
14429
  organizationId: idString,
14231
14430
  phantomRunId: idString,
14232
- status: z19.string(),
14233
- observationType: z19.string(),
14431
+ status: z20.string(),
14432
+ observationType: z20.string(),
14234
14433
  targetType: nullableString,
14235
14434
  targetId: nullableString,
14236
14435
  sourceTable: nullableString,
14237
14436
  sourceRecordId: nullableString,
14238
14437
  sourceEventId: nullableString,
14239
14438
  contentHash: nullableString,
14240
- observedAt: z19.string(),
14241
- confidence: z19.coerce.number(),
14439
+ observedAt: z20.string(),
14440
+ confidence: z20.coerce.number(),
14242
14441
  payload: jsonObject.catch({}),
14243
- schemaVersion: z19.string(),
14442
+ schemaVersion: z20.string(),
14244
14443
  testRunId: nullableString,
14245
- idempotencyKey: z19.string(),
14246
- createdAt: z19.string(),
14247
- updatedAt: z19.string()
14444
+ idempotencyKey: z20.string(),
14445
+ createdAt: z20.string(),
14446
+ updatedAt: z20.string()
14248
14447
  })
14249
14448
  );
14250
- var phantomCandidateSchema = z19.preprocess(
14449
+ var phantomCandidateSchema = z20.preprocess(
14251
14450
  normalizePhantomLedgerKeys,
14252
- z19.object({
14451
+ z20.object({
14253
14452
  id: idString,
14254
14453
  organizationId: idString,
14255
14454
  phantomRunId: idString,
14256
14455
  phantomObservationId: nullableString,
14257
- status: z19.string(),
14258
- candidateType: z19.string(),
14456
+ status: z20.string(),
14457
+ candidateType: z20.string(),
14259
14458
  targetType: nullableString,
14260
14459
  targetId: nullableString,
14261
14460
  title: nullableString,
14262
- dryRun: z19.boolean(),
14461
+ dryRun: z20.boolean(),
14263
14462
  payload: jsonObject.catch({}),
14264
- approvalStatus: z19.string(),
14463
+ approvalStatus: z20.string(),
14265
14464
  approvedById: nullableIdString,
14266
14465
  approvedAt: nullableString,
14267
14466
  approvalSource: nullableString,
14268
14467
  approvalReason: nullableString,
14269
14468
  approvalMetadata: jsonObject.catch({}),
14270
- schemaVersion: z19.string(),
14469
+ schemaVersion: z20.string(),
14271
14470
  testRunId: nullableString,
14272
- idempotencyKey: z19.string(),
14273
- createdAt: z19.string(),
14274
- updatedAt: z19.string()
14471
+ idempotencyKey: z20.string(),
14472
+ createdAt: z20.string(),
14473
+ updatedAt: z20.string()
14275
14474
  })
14276
14475
  );
14277
- var phantomCandidateEvidenceSchema = z19.preprocess(
14476
+ var phantomCandidateEvidenceSchema = z20.preprocess(
14278
14477
  normalizePhantomLedgerKeys,
14279
- z19.object({
14478
+ z20.object({
14280
14479
  id: idString,
14281
14480
  organizationId: idString,
14282
14481
  phantomCandidateId: idString,
14283
14482
  phantomObservationId: nullableString,
14284
- evidenceType: z19.string(),
14483
+ evidenceType: z20.string(),
14285
14484
  sourceType: nullableString,
14286
14485
  sourceId: nullableString,
14287
14486
  contentHash: nullableString,
14288
14487
  payload: jsonObject.catch({}),
14289
- schemaVersion: z19.string(),
14488
+ schemaVersion: z20.string(),
14290
14489
  testRunId: nullableString,
14291
- idempotencyKey: z19.string(),
14292
- createdAt: z19.string(),
14293
- updatedAt: z19.string()
14490
+ idempotencyKey: z20.string(),
14491
+ createdAt: z20.string(),
14492
+ updatedAt: z20.string()
14294
14493
  })
14295
14494
  );
14296
- var phantomValidationSchema = z19.preprocess(
14495
+ var phantomValidationSchema = z20.preprocess(
14297
14496
  normalizePhantomLedgerKeys,
14298
- z19.object({
14497
+ z20.object({
14299
14498
  id: idString,
14300
14499
  organizationId: idString,
14301
14500
  phantomRunId: idString,
14302
14501
  phantomCandidateId: idString,
14303
- status: z19.string(),
14304
- validationType: z19.string(),
14305
- dryRun: z19.boolean(),
14502
+ status: z20.string(),
14503
+ validationType: z20.string(),
14504
+ dryRun: z20.boolean(),
14306
14505
  payload: jsonObject.catch({}),
14307
14506
  resultPayload: jsonObject.catch({}),
14308
- schemaVersion: z19.string(),
14507
+ schemaVersion: z20.string(),
14309
14508
  testRunId: nullableString,
14310
- idempotencyKey: z19.string(),
14311
- createdAt: z19.string(),
14312
- updatedAt: z19.string()
14509
+ idempotencyKey: z20.string(),
14510
+ createdAt: z20.string(),
14511
+ updatedAt: z20.string()
14313
14512
  })
14314
14513
  );
14315
- var phantomApplyOperationSchema = z19.preprocess(
14514
+ var phantomApplyOperationSchema = z20.preprocess(
14316
14515
  normalizePhantomLedgerKeys,
14317
- z19.object({
14516
+ z20.object({
14318
14517
  id: idString,
14319
14518
  organizationId: idString,
14320
14519
  phantomRunId: idString,
14321
14520
  phantomCandidateId: idString,
14322
- status: z19.string(),
14323
- operationType: z19.string(),
14324
- dryRun: z19.boolean(),
14521
+ status: z20.string(),
14522
+ operationType: z20.string(),
14523
+ dryRun: z20.boolean(),
14325
14524
  targetType: nullableString,
14326
14525
  targetId: nullableString,
14327
14526
  payload: jsonObject.catch({}),
14328
14527
  resultPayload: jsonObject.catch({}),
14329
- schemaVersion: z19.string(),
14528
+ schemaVersion: z20.string(),
14330
14529
  testRunId: nullableString,
14331
- idempotencyKey: z19.string(),
14332
- createdAt: z19.string(),
14333
- updatedAt: z19.string()
14530
+ idempotencyKey: z20.string(),
14531
+ createdAt: z20.string(),
14532
+ updatedAt: z20.string()
14334
14533
  })
14335
14534
  );
14336
- var phantomRunsSchema = z19.array(phantomRunListItemSchema);
14337
- var phantomReportsSchema = z19.array(phantomReportSchema);
14338
- var phantomObservationsSchema = z19.array(phantomObservationSchema);
14339
- var phantomCandidatesSchema = z19.array(phantomCandidateSchema);
14340
- var phantomCandidateEvidencesSchema = z19.array(phantomCandidateEvidenceSchema);
14341
- var phantomValidationsSchema = z19.array(phantomValidationSchema);
14342
- var phantomApplyOperationsSchema = z19.array(phantomApplyOperationSchema);
14535
+ var phantomRunsSchema = z20.array(phantomRunListItemSchema);
14536
+ var phantomReportsSchema = z20.array(phantomReportSchema);
14537
+ var phantomObservationsSchema = z20.array(phantomObservationSchema);
14538
+ var phantomCandidatesSchema = z20.array(phantomCandidateSchema);
14539
+ var phantomCandidateEvidencesSchema = z20.array(phantomCandidateEvidenceSchema);
14540
+ var phantomValidationsSchema = z20.array(phantomValidationSchema);
14541
+ var phantomApplyOperationsSchema = z20.array(phantomApplyOperationSchema);
14343
14542
  function isRecord6(value) {
14344
14543
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
14345
14544
  }
@@ -15817,7 +16016,7 @@ var URL_OR_TRANSPORT_KEY = /(?:^|_)(?:url|uri|token|nonce|post_fields|postfields
15817
16016
  function isRecord7(value) {
15818
16017
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
15819
16018
  }
15820
- function asNonEmptyString6(value) {
16019
+ function asNonEmptyString5(value) {
15821
16020
  if (typeof value !== "string") return null;
15822
16021
  const trimmed = value.trim();
15823
16022
  return trimmed.length > 0 ? trimmed : null;
@@ -15862,7 +16061,7 @@ function parseCreatePayload(raw, mode) {
15862
16061
  ["name", "subject", "message", "expires_at", "visibility", "metadata", "recipients"],
15863
16062
  "--data-json"
15864
16063
  );
15865
- const parsedMode = asNonEmptyString6(mode);
16064
+ const parsedMode = asNonEmptyString5(mode);
15866
16065
  if (parsedMode !== "request" && parsedMode !== "self_sign") {
15867
16066
  throw new CliError({
15868
16067
  message: "signatures create requires --mode request or --mode self_sign.",
@@ -15880,9 +16079,9 @@ function parseUpdatePayload(raw, options) {
15880
16079
  ["name", "subject", "message", "expires_at", "visibility", "recipients", "fields"],
15881
16080
  "--data-json"
15882
16081
  );
15883
- const name = asNonEmptyString6(options.name);
15884
- const subject = asNonEmptyString6(options.subject);
15885
- const message = asNonEmptyString6(options.message);
16082
+ const name = asNonEmptyString5(options.name);
16083
+ const subject = asNonEmptyString5(options.subject);
16084
+ const message = asNonEmptyString5(options.message);
15886
16085
  const patch = {
15887
16086
  ...data,
15888
16087
  ...name ? { name } : {},
@@ -16017,8 +16216,8 @@ function requireUploadTarget(payload) {
16017
16216
  exitCode: EXIT_CODES.networkOrUpstream
16018
16217
  });
16019
16218
  }
16020
- const postUrl = asNonEmptyString6(attributes.postUrl);
16021
- const fileKey = asNonEmptyString6(attributes.getUrl);
16219
+ const postUrl = asNonEmptyString5(attributes.postUrl);
16220
+ const fileKey = asNonEmptyString5(attributes.getUrl);
16022
16221
  const rawPostFields = attributes.postFields;
16023
16222
  if (!postUrl || !fileKey || !isRecord7(rawPostFields) || !fileKey.startsWith("uploads/signatures/")) {
16024
16223
  throw new CliError({
@@ -16268,72 +16467,72 @@ function registerSignatureCommands(program) {
16268
16467
  }
16269
16468
 
16270
16469
  // src/commands/atlasAuthoring.ts
16271
- import { z as z20 } from "zod";
16272
- var idSchema15 = z20.string().trim().min(1);
16273
- var idempotencyKeySchema = z20.string().min(1).refine((value) => value.trim() === value, "Idempotency key must not have leading or trailing whitespace.");
16274
- var skillScopeSchema = z20.enum(["ADMIN_GLOBAL", "MEMBER_PERSONAL"]);
16275
- var isoDateSchema = z20.iso.date();
16276
- var nonEmptyStringSchema = z20.string().trim().min(1);
16470
+ import { z as z21 } from "zod";
16471
+ var idSchema15 = z21.string().trim().min(1);
16472
+ var idempotencyKeySchema = z21.string().min(1).refine((value) => value.trim() === value, "Idempotency key must not have leading or trailing whitespace.");
16473
+ var skillScopeSchema = z21.enum(["ADMIN_GLOBAL", "MEMBER_PERSONAL"]);
16474
+ var isoDateSchema = z21.iso.date();
16475
+ var nonEmptyStringSchema = z21.string().trim().min(1);
16277
16476
  var AUTOMATION_RUN_HTTP_TIMEOUT_MS = 6e4;
16278
- var agentToolAccessSchema = z20.array(
16279
- z20.object({
16477
+ var agentToolAccessSchema = z21.array(
16478
+ z21.object({
16280
16479
  tool_key: nonEmptyStringSchema,
16281
16480
  scope_value: nonEmptyStringSchema
16282
16481
  }).strict()
16283
16482
  ).min(1);
16284
16483
  var agentToolAccessUpdateSchema = agentToolAccessSchema.min(0);
16285
- var agentPluginConnectionsSchema = z20.array(
16286
- z20.object({
16484
+ var agentPluginConnectionsSchema = z21.array(
16485
+ z21.object({
16287
16486
  external_tool_connection_id: nonEmptyStringSchema,
16288
16487
  tool_key: nonEmptyStringSchema,
16289
16488
  scope_value: nonEmptyStringSchema.optional(),
16290
- allowed_tools: z20.array(nonEmptyStringSchema).optional(),
16291
- allowed_scopes: z20.array(nonEmptyStringSchema).optional(),
16292
- requires_confirmation: z20.boolean().optional(),
16293
- enabled: z20.boolean().optional()
16489
+ allowed_tools: z21.array(nonEmptyStringSchema).optional(),
16490
+ allowed_scopes: z21.array(nonEmptyStringSchema).optional(),
16491
+ requires_confirmation: z21.boolean().optional(),
16492
+ enabled: z21.boolean().optional()
16294
16493
  }).strict()
16295
16494
  ).min(1);
16296
- var agentPluginConnectionUpdateSchema = z20.array(
16297
- z20.union([
16298
- z20.object({
16495
+ var agentPluginConnectionUpdateSchema = z21.array(
16496
+ z21.union([
16497
+ z21.object({
16299
16498
  id: nonEmptyStringSchema,
16300
- _destroy: z20.literal(true)
16499
+ _destroy: z21.literal(true)
16301
16500
  }).strict(),
16302
- z20.object({
16501
+ z21.object({
16303
16502
  id: nonEmptyStringSchema.optional(),
16304
16503
  external_tool_connection_id: nonEmptyStringSchema.optional(),
16305
16504
  tool_key: nonEmptyStringSchema.optional(),
16306
16505
  scope_value: nonEmptyStringSchema.optional(),
16307
- allowed_tools: z20.array(nonEmptyStringSchema).optional(),
16308
- allowed_scopes: z20.array(nonEmptyStringSchema).optional(),
16309
- requires_confirmation: z20.boolean().optional(),
16310
- enabled: z20.boolean().optional()
16506
+ allowed_tools: z21.array(nonEmptyStringSchema).optional(),
16507
+ allowed_scopes: z21.array(nonEmptyStringSchema).optional(),
16508
+ requires_confirmation: z21.boolean().optional(),
16509
+ enabled: z21.boolean().optional()
16311
16510
  }).strict().superRefine((value, context) => {
16312
16511
  if (value.id || value.external_tool_connection_id && value.tool_key) return;
16313
16512
  context.addIssue({
16314
- code: z20.ZodIssueCode.custom,
16513
+ code: z21.ZodIssueCode.custom,
16315
16514
  message: "Plugin updates require an id, or both external_tool_connection_id and tool_key for a new grant."
16316
16515
  });
16317
16516
  })
16318
16517
  ])
16319
16518
  );
16320
- var agentTriggerSchema = z20.object({
16321
- trigger_type: z20.literal("cron"),
16519
+ var agentTriggerSchema = z21.object({
16520
+ trigger_type: z21.literal("cron"),
16322
16521
  cron_expression: nonEmptyStringSchema,
16323
16522
  timezone: nonEmptyStringSchema,
16324
- starts_at: z20.iso.datetime({ offset: true }).nullable().optional(),
16325
- ends_at: z20.iso.datetime({ offset: true }).nullable().optional(),
16326
- max_runs: z20.number().int().positive().nullable().optional(),
16327
- enabled: z20.boolean().optional()
16523
+ starts_at: z21.iso.datetime({ offset: true }).nullable().optional(),
16524
+ ends_at: z21.iso.datetime({ offset: true }).nullable().optional(),
16525
+ max_runs: z21.number().int().positive().nullable().optional(),
16526
+ enabled: z21.boolean().optional()
16328
16527
  }).strict();
16329
- var agentTriggerUpdateSchema = z20.union([
16528
+ var agentTriggerUpdateSchema = z21.union([
16330
16529
  agentTriggerSchema.extend({ id: nonEmptyStringSchema.optional() }).strict(),
16331
- z20.object({
16530
+ z21.object({
16332
16531
  id: nonEmptyStringSchema,
16333
- _destroy: z20.literal(true)
16532
+ _destroy: z21.literal(true)
16334
16533
  }).strict()
16335
16534
  ]);
16336
- var automationConfigSchema = z20.record(z20.string(), z20.unknown());
16535
+ var automationConfigSchema = z21.record(z21.string(), z21.unknown());
16337
16536
  var AGENT_SELECTION = `{
16338
16537
  id
16339
16538
  type
@@ -16489,7 +16688,7 @@ var AUTOMATION_RUN_STATUS_SELECTION = `{
16489
16688
  queuedAt
16490
16689
  completedAt
16491
16690
  }`;
16492
- function asRecord7(value) {
16691
+ function asRecord6(value) {
16493
16692
  return value && typeof value === "object" && !Array.isArray(value) ? value : null;
16494
16693
  }
16495
16694
  function asRequiredString(value) {
@@ -16520,7 +16719,7 @@ function requirePaginationInteger(value, key, minimum) {
16520
16719
  });
16521
16720
  }
16522
16721
  function normalizeAutomationList(payload) {
16523
- const page = asRecord7(payload);
16722
+ const page = asRecord6(payload);
16524
16723
  if (!page || !Array.isArray(page.data)) {
16525
16724
  throw new CliError({
16526
16725
  message: "Automation list response did not include a paginated data collection.",
@@ -16531,8 +16730,8 @@ function normalizeAutomationList(payload) {
16531
16730
  }
16532
16731
  const rows = page.data;
16533
16732
  const data = rows.map((value) => {
16534
- const row = asRecord7(value);
16535
- const attributes = asRecord7(row?.attributes);
16733
+ const row = asRecord6(value);
16734
+ const attributes = asRecord6(row?.attributes);
16536
16735
  if (!row || !attributes) {
16537
16736
  throw new CliError({
16538
16737
  message: "Automation list response included a malformed automation record.",
@@ -16617,13 +16816,13 @@ function parseJsonOption(value, optionName, schema) {
16617
16816
  return schema.parse(parseJson(String(value), optionName));
16618
16817
  }
16619
16818
  function normalizePersistedCreatePayload(payload) {
16620
- const mutation = asRecord7(payload);
16621
- const mutationData = asRecord7(mutation?.data);
16622
- const persisted = asRecord7(mutationData?.data) ?? mutationData;
16623
- const attributes = asRecord7(persisted?.attributes);
16624
- const automationExecution = asRecord7(attributes?.automation_execution) ?? asRecord7(attributes?.automationExecution);
16625
- const meta = asRecord7(mutationData?.meta);
16626
- const idempotency = asRecord7(meta?.atlas_idempotency);
16819
+ const mutation = asRecord6(payload);
16820
+ const mutationData = asRecord6(mutation?.data);
16821
+ const persisted = asRecord6(mutationData?.data) ?? mutationData;
16822
+ const attributes = asRecord6(persisted?.attributes);
16823
+ const automationExecution = asRecord6(attributes?.automation_execution) ?? asRecord6(attributes?.automationExecution);
16824
+ const meta = asRecord6(mutationData?.meta);
16825
+ const idempotency = asRecord6(meta?.atlas_idempotency);
16627
16826
  const id = asRequiredString(persisted?.id);
16628
16827
  const slug = asRequiredString(persisted?.slug) ?? asRequiredString(attributes?.slug);
16629
16828
  const replay = idempotency?.replay;
@@ -16654,10 +16853,10 @@ function normalizePersistedCreatePayload(payload) {
16654
16853
  };
16655
16854
  }
16656
16855
  function normalizePersistedUpdatePayload(payload) {
16657
- const mutation = asRecord7(payload);
16658
- const mutationData = asRecord7(mutation?.data);
16659
- const persisted = asRecord7(mutationData?.data) ?? mutationData;
16660
- const attributes = asRecord7(persisted?.attributes);
16856
+ const mutation = asRecord6(payload);
16857
+ const mutationData = asRecord6(mutation?.data);
16858
+ const persisted = asRecord6(mutationData?.data) ?? mutationData;
16859
+ const attributes = asRecord6(persisted?.attributes);
16661
16860
  const id = asRequiredString(persisted?.id);
16662
16861
  const slug = asRequiredString(persisted?.slug) ?? asRequiredString(attributes?.slug);
16663
16862
  const updateVersion = asRequiredString(persisted?.updateVersion) ?? asRequiredString(attributes?.updateVersion) ?? asRequiredString(attributes?.update_version);
@@ -16678,7 +16877,7 @@ function normalizePersistedUpdatePayload(payload) {
16678
16877
  };
16679
16878
  }
16680
16879
  function normalizeAutomationRunPayload(payload) {
16681
- const mutation = asRecord7(payload);
16880
+ const mutation = asRecord6(payload);
16682
16881
  if (!mutation) {
16683
16882
  throw new CliError({
16684
16883
  message: "Automation run response did not include a mutation payload.",
@@ -16696,7 +16895,7 @@ function normalizeAutomationRunPayload(payload) {
16696
16895
  data: mutation.data ?? null
16697
16896
  };
16698
16897
  }
16699
- const data = asRecord7(mutation.data);
16898
+ const data = asRecord6(mutation.data);
16700
16899
  const automationTaskId = asRequiredString(data?.automation_task_id);
16701
16900
  const automationTaskSlug = asRequiredString(data?.automation_task_slug);
16702
16901
  const agentId = asRequiredString(data?.agent_id);
@@ -17011,7 +17210,7 @@ function registerAtlasAuthoringCommands(program) {
17011
17210
  "--service <service>",
17012
17211
  "Supported service: gmail, calendar, slack, or stripe"
17013
17212
  ).action(async (opts, cmd) => {
17014
- const service = z20.enum(["gmail", "calendar", "slack", "stripe"]).parse(opts.service);
17213
+ const service = z21.enum(["gmail", "calendar", "slack", "stripe"]).parse(opts.service);
17015
17214
  const context = await resolveCommandContext(cmd.optsWithGlobals());
17016
17215
  const organizationId = resolveOrganizationId(context.organizationId);
17017
17216
  await runGraphqlQueryCommand({
@@ -17296,6 +17495,15 @@ var VARIABLE_TYPES = {
17296
17495
  organization_id: "ID!",
17297
17496
  member_id: "ID"
17298
17497
  };
17498
+ var ACTIVITY_VARIABLE_TYPES = {
17499
+ ...VARIABLE_TYPES,
17500
+ start_at: "ISO8601DateTime!",
17501
+ end_at: "ISO8601DateTime!"
17502
+ };
17503
+ var MEMBER_STATUSES_VARIABLE_TYPES = {
17504
+ organization_id: "ID!",
17505
+ member_ids: "[ID!]!"
17506
+ };
17299
17507
  function parseRecentLimit(value) {
17300
17508
  const limit = Number(value);
17301
17509
  if (!Number.isInteger(limit) || limit < 1 || limit > 50) {
@@ -17303,6 +17511,25 @@ function parseRecentLimit(value) {
17303
17511
  }
17304
17512
  return limit;
17305
17513
  }
17514
+ function parseIsoDateTime(optionName, value) {
17515
+ const timestamp = Date.parse(value);
17516
+ if (!Number.isFinite(timestamp) || !value.includes("T")) {
17517
+ throw new Error(`${optionName} must be an ISO 8601 date-time`);
17518
+ }
17519
+ return value;
17520
+ }
17521
+ function validateActivityRange(startAt, endAt) {
17522
+ if (Date.parse(endAt) <= Date.parse(startAt)) {
17523
+ throw new Error("end-at must be after start-at");
17524
+ }
17525
+ }
17526
+ function parseMemberIds(value) {
17527
+ const memberIds = [...new Set(value.split(",").map((id) => id.trim()).filter(Boolean))];
17528
+ if (memberIds.length < 1 || memberIds.length > 100) {
17529
+ throw new Error("member-ids must contain between 1 and 100 unique member IDs");
17530
+ }
17531
+ return memberIds;
17532
+ }
17306
17533
  async function runDesktopContextQuery(cmd, params) {
17307
17534
  const context = await resolveCommandContext(cmd.optsWithGlobals());
17308
17535
  await runGraphqlQueryCommand({
@@ -17313,9 +17540,12 @@ async function runDesktopContextQuery(cmd, params) {
17313
17540
  variables: normalizeGraphqlVariables2({
17314
17541
  organization_id: resolveOrganizationId(context.organizationId),
17315
17542
  member_id: params.memberId,
17316
- limit: params.limit
17543
+ member_ids: params.memberIds,
17544
+ limit: params.limit,
17545
+ start_at: params.startAt,
17546
+ end_at: params.endAt
17317
17547
  }),
17318
- variableTypes: {
17548
+ variableTypes: params.command === "desktop-context.activity" ? ACTIVITY_VARIABLE_TYPES : params.command === "desktop-context.member-statuses" ? MEMBER_STATUSES_VARIABLE_TYPES : {
17319
17549
  ...VARIABLE_TYPES,
17320
17550
  ...params.command === "desktop-context.recent" ? { limit: "Int" } : {}
17321
17551
  },
@@ -17333,6 +17563,18 @@ function registerDesktopContextCommands(program) {
17333
17563
  memberId: opts.memberId
17334
17564
  });
17335
17565
  });
17566
+ desktopContext.command("member-statuses").description("Read capture and enrollment status for up to 100 organization members").requiredOption(
17567
+ "--member-ids <memberIds>",
17568
+ "Comma-separated organization member IDs (1-100)",
17569
+ parseMemberIds
17570
+ ).action(async (opts, cmd) => {
17571
+ await runDesktopContextQuery(cmd, {
17572
+ command: "desktop-context.member-statuses",
17573
+ operationName: "DesktopContextMemberStatuses",
17574
+ field: "desktop_context_member_statuses",
17575
+ memberIds: opts.memberIds
17576
+ });
17577
+ });
17336
17578
  desktopContext.command("recent").description("Read recent sanitized evidence excerpts").option("--member-id <memberId>", "Member scope; defaults to the authenticated member").option("--limit <limit>", "Maximum observations (1-50)", parseRecentLimit).action(async (opts, cmd) => {
17337
17579
  await runDesktopContextQuery(cmd, {
17338
17580
  command: "desktop-context.recent",
@@ -17342,6 +17584,380 @@ function registerDesktopContextCommands(program) {
17342
17584
  limit: opts.limit
17343
17585
  });
17344
17586
  });
17587
+ desktopContext.command("activity").description("Read canonical active, AFK, gap, and app duration for a bounded range").requiredOption(
17588
+ "--start-at <dateTime>",
17589
+ "Inclusive ISO 8601 range start",
17590
+ (value) => parseIsoDateTime("start-at", value)
17591
+ ).requiredOption(
17592
+ "--end-at <dateTime>",
17593
+ "Exclusive ISO 8601 range end",
17594
+ (value) => parseIsoDateTime("end-at", value)
17595
+ ).option("--member-id <memberId>", "Member scope; defaults to the authenticated member").action(async (opts, cmd) => {
17596
+ validateActivityRange(opts.startAt, opts.endAt);
17597
+ await runDesktopContextQuery(cmd, {
17598
+ command: "desktop-context.activity",
17599
+ operationName: "DesktopContextActivity",
17600
+ field: "desktop_context_activity_summary",
17601
+ memberId: opts.memberId,
17602
+ startAt: opts.startAt,
17603
+ endAt: opts.endAt
17604
+ });
17605
+ });
17606
+ }
17607
+
17608
+ // src/commands/dataPipeline.ts
17609
+ var MAX_PARAMETERS_JSON_BYTES = 16384;
17610
+ var SECRET_LIKE_PARAMETER_KEY = /(?:^|_)(?:api_?key|authorization|credential|password|secret|token)(?:$|_)/i;
17611
+ var UNSAFE_PARAMETER_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
17612
+ var ORGANIZATION_VARIABLE_TYPES = {
17613
+ organization_id: "ID!"
17614
+ };
17615
+ var SOURCES_VARIABLE_TYPES = {
17616
+ ...ORGANIZATION_VARIABLE_TYPES,
17617
+ category_key: "String!"
17618
+ };
17619
+ var SOURCE_ACTIONS_VARIABLE_TYPES = {
17620
+ ...ORGANIZATION_VARIABLE_TYPES,
17621
+ source_id: "ID!"
17622
+ };
17623
+ var EXECUTE_SOURCE_ACTION_VARIABLE_TYPES = {
17624
+ ...SOURCE_ACTIONS_VARIABLE_TYPES,
17625
+ category_key: "String!",
17626
+ provider_key: "String!",
17627
+ action_key: "String!",
17628
+ parameters: "JSON"
17629
+ };
17630
+ var PROVIDER_SELECTION = `
17631
+ organizationPluginId
17632
+ key
17633
+ name
17634
+ categories
17635
+ availability
17636
+ integrationKey
17637
+ connectorProvider
17638
+ connectorService
17639
+ logoAssetPath
17640
+ `.trim();
17641
+ var OVERVIEW_SELECTION = `
17642
+ {
17643
+ totalSourceCount
17644
+ connectedSourceCount
17645
+ categoriesConfiguredCount
17646
+ actionRequiredCount
17647
+ categories {
17648
+ key
17649
+ name
17650
+ description
17651
+ iconKey
17652
+ sortOrder
17653
+ allowedSourceTypes
17654
+ suggestedSourceLabels
17655
+ sourceCount
17656
+ activeSourceCount
17657
+ attentionSourceCount
17658
+ status
17659
+ providers {
17660
+ ${PROVIDER_SELECTION}
17661
+ }
17662
+ }
17663
+ }
17664
+ `.trim();
17665
+ var SOURCE_SELECTION = `
17666
+ {
17667
+ id
17668
+ type
17669
+ organizationId
17670
+ categoryKey
17671
+ sourceType
17672
+ providerKey
17673
+ organizationPluginId
17674
+ name
17675
+ url
17676
+ status
17677
+ connection
17678
+ configuration
17679
+ metadata
17680
+ lastSyncedAt
17681
+ lastSuccessfulSyncAt
17682
+ lastErrorAt
17683
+ lastErrorMessage
17684
+ createdById
17685
+ createdAt
17686
+ updatedAt
17687
+ }
17688
+ `.trim();
17689
+ var SOURCE_ACTION_SELECTION = `
17690
+ {
17691
+ key
17692
+ displayName
17693
+ inputSchema
17694
+ safetyClass
17695
+ requiresApproval
17696
+ }
17697
+ `.trim();
17698
+ var SOURCE_ACTION_RESULT_SELECTION = `
17699
+ {
17700
+ ok
17701
+ status
17702
+ errorCode
17703
+ errors
17704
+ traceId
17705
+ organizationId
17706
+ categoryKey
17707
+ providerKey
17708
+ sourceId
17709
+ actionKey
17710
+ records
17711
+ pageInfo
17712
+ metadata
17713
+ }
17714
+ `.trim();
17715
+ function invalidParameters(message, details = {}) {
17716
+ return new CliError({
17717
+ message,
17718
+ kind: "invalid_args",
17719
+ status: 400,
17720
+ exitCode: EXIT_CODES.invalidArgs,
17721
+ details
17722
+ });
17723
+ }
17724
+ function parseNonBlank(value, optionName) {
17725
+ const parsed = value.trim();
17726
+ if (!parsed) {
17727
+ throw invalidParameters(`${optionName} must not be blank`);
17728
+ }
17729
+ return parsed;
17730
+ }
17731
+ function parseCategoryKey(value) {
17732
+ return parseNonBlank(value, "category-key");
17733
+ }
17734
+ function secretLikeParameterPath(value, path = []) {
17735
+ if (!value || typeof value !== "object") return null;
17736
+ if (Array.isArray(value)) {
17737
+ for (let index = 0; index < value.length; index += 1) {
17738
+ const nestedPath = secretLikeParameterPath(value[index], [...path, String(index)]);
17739
+ if (nestedPath) return nestedPath;
17740
+ }
17741
+ return null;
17742
+ }
17743
+ for (const [key, nestedValue] of Object.entries(value)) {
17744
+ const keyPath = [...path, key];
17745
+ if (UNSAFE_PARAMETER_KEYS.has(key) || SECRET_LIKE_PARAMETER_KEY.test(key)) {
17746
+ return keyPath.join(".");
17747
+ }
17748
+ const nestedPath = secretLikeParameterPath(nestedValue, keyPath);
17749
+ if (nestedPath) return nestedPath;
17750
+ }
17751
+ return null;
17752
+ }
17753
+ function parseSourceActionParameters(raw) {
17754
+ if (Buffer.byteLength(raw, "utf8") > MAX_PARAMETERS_JSON_BYTES) {
17755
+ throw invalidParameters(
17756
+ `parameters-json must not exceed ${MAX_PARAMETERS_JSON_BYTES} bytes`
17757
+ );
17758
+ }
17759
+ let parsed;
17760
+ try {
17761
+ parsed = JSON.parse(raw);
17762
+ } catch {
17763
+ throw invalidParameters("parameters-json must be a valid JSON object");
17764
+ }
17765
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
17766
+ throw invalidParameters("parameters-json must be a JSON object");
17767
+ }
17768
+ const secretPath = secretLikeParameterPath(parsed);
17769
+ if (secretPath) {
17770
+ throw invalidParameters(
17771
+ `parameters-json contains a secret-like parameter key: ${secretPath}`,
17772
+ { parameterPath: secretPath }
17773
+ );
17774
+ }
17775
+ return parsed;
17776
+ }
17777
+ function isJsonRecord(value) {
17778
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
17779
+ }
17780
+ function sourceActionFailureKind(errorCode, status) {
17781
+ if (errorCode === "AUTH_REQUIRED" || errorCode === "UNAUTHORIZED") return "missing_auth";
17782
+ if (errorCode === "NOT_FOUND") return "not_found";
17783
+ if (errorCode === "PROVIDER_ERROR") return "upstream_error";
17784
+ if (errorCode === "ACTION_NOT_ALLOWED") return "forbidden";
17785
+ if (errorCode === "INVALID_INPUT" || errorCode === "INVALID_SOURCE") {
17786
+ return "validation";
17787
+ }
17788
+ if (status === 403) return "forbidden";
17789
+ if (status === 404) return "not_found";
17790
+ if (status >= 500) return "upstream_error";
17791
+ if (status === 400 || status === 422) return "validation";
17792
+ return "generic_error";
17793
+ }
17794
+ function sourceActionFailureExitCode(kind, status) {
17795
+ if (kind === "missing_auth") return EXIT_CODES.missingOrInvalidAuth;
17796
+ if (kind === "forbidden") return EXIT_CODES.forbidden;
17797
+ if (kind === "not_found") return EXIT_CODES.notFound;
17798
+ if (kind === "validation") return EXIT_CODES.validationFailure;
17799
+ if (kind === "upstream_error" || kind === "malformed_response") {
17800
+ return EXIT_CODES.networkOrUpstream;
17801
+ }
17802
+ return mapStatusToExitCode(status);
17803
+ }
17804
+ function transformSourceActionResult(value) {
17805
+ if (!isJsonRecord(value) || typeof value.ok !== "boolean") {
17806
+ throw new CliError({
17807
+ message: "Data Pipeline source action returned a malformed response",
17808
+ kind: "malformed_response",
17809
+ status: 502,
17810
+ exitCode: EXIT_CODES.networkOrUpstream
17811
+ });
17812
+ }
17813
+ if (value.ok) return value;
17814
+ const status = typeof value.status === "number" && Number.isInteger(value.status) ? value.status : 500;
17815
+ const errorCode = typeof value.errorCode === "string" && value.errorCode.length > 0 ? value.errorCode.toUpperCase() : "SOURCE_ACTION_FAILED";
17816
+ const errors = Array.isArray(value.errors) ? value.errors.filter((error) => typeof error === "string") : [];
17817
+ const traceId = typeof value.traceId === "string" ? value.traceId : null;
17818
+ const kind = sourceActionFailureKind(errorCode, status);
17819
+ throw new CliError({
17820
+ message: errors.find((error) => error.trim().length > 0) ?? "Data Pipeline source action failed",
17821
+ kind,
17822
+ status,
17823
+ exitCode: sourceActionFailureExitCode(kind, status),
17824
+ details: { errorCode, traceId, errors }
17825
+ });
17826
+ }
17827
+ function transformSourceActions(value) {
17828
+ if (!Array.isArray(value)) {
17829
+ throw new CliError({
17830
+ message: "Data Pipeline source action discovery returned a malformed response",
17831
+ kind: "malformed_response",
17832
+ status: 502,
17833
+ exitCode: EXIT_CODES.networkOrUpstream
17834
+ });
17835
+ }
17836
+ for (const action of value) {
17837
+ if (!isJsonRecord(action) || typeof action.key !== "string") {
17838
+ throw new CliError({
17839
+ message: "Data Pipeline source action discovery returned a malformed action",
17840
+ kind: "malformed_response",
17841
+ status: 502,
17842
+ exitCode: EXIT_CODES.networkOrUpstream
17843
+ });
17844
+ }
17845
+ if (action.safetyClass !== "read_only" || action.requiresApproval !== false) {
17846
+ throw new CliError({
17847
+ message: `Data Pipeline source action discovery returned a non-read-only action: ${action.key}`,
17848
+ kind: "malformed_response",
17849
+ status: 502,
17850
+ exitCode: EXIT_CODES.networkOrUpstream,
17851
+ details: {
17852
+ actionKey: action.key,
17853
+ safetyClass: action.safetyClass,
17854
+ requiresApproval: action.requiresApproval
17855
+ }
17856
+ });
17857
+ }
17858
+ }
17859
+ return value;
17860
+ }
17861
+ function registerDataPipelineCommands(program) {
17862
+ const dataPipeline = program.command("data-pipeline").description("Inspect the organization's configured Data Pipeline control plane");
17863
+ dataPipeline.command("overview").description("Read source counts, category status, and available organization plugins").action(async (_opts, cmd) => {
17864
+ const context = await resolveCommandContext(cmd.optsWithGlobals());
17865
+ await runGraphqlQueryCommand({
17866
+ command: "data-pipeline.overview",
17867
+ operationName: "DataPipelineOverview",
17868
+ runtimeOptions: context.runtimeOptions,
17869
+ field: "data_pipeline_overview",
17870
+ variables: {
17871
+ organization_id: resolveOrganizationId(context.organizationId)
17872
+ },
17873
+ variableTypes: ORGANIZATION_VARIABLE_TYPES,
17874
+ isShow: true,
17875
+ selectionSet: OVERVIEW_SELECTION
17876
+ });
17877
+ });
17878
+ dataPipeline.command("sources").description("Read the saved source records configured for one Data Pipeline category").requiredOption(
17879
+ "--category-key <categoryKey>",
17880
+ "Data Pipeline category key from the overview response",
17881
+ parseCategoryKey
17882
+ ).action(async (opts, cmd) => {
17883
+ const context = await resolveCommandContext(cmd.optsWithGlobals());
17884
+ await runGraphqlQueryCommand({
17885
+ command: "data-pipeline.sources",
17886
+ operationName: "DataPipelineSources",
17887
+ runtimeOptions: context.runtimeOptions,
17888
+ field: "data_pipeline_sources",
17889
+ variables: {
17890
+ organization_id: resolveOrganizationId(context.organizationId),
17891
+ category_key: opts.categoryKey
17892
+ },
17893
+ variableTypes: SOURCES_VARIABLE_TYPES,
17894
+ isList: true,
17895
+ selectionSet: SOURCE_SELECTION
17896
+ });
17897
+ });
17898
+ dataPipeline.command("source-actions").description("Read the certified provider actions available for one configured source").requiredOption(
17899
+ "--source-id <sourceId>",
17900
+ "Configured Data Pipeline source ID",
17901
+ (value) => parseNonBlank(value, "source-id")
17902
+ ).action(async (opts, cmd) => {
17903
+ const context = await resolveCommandContext(cmd.optsWithGlobals());
17904
+ await runGraphqlQueryCommand({
17905
+ command: "data-pipeline.source-actions",
17906
+ operationName: "DataPipelineSourceActions",
17907
+ runtimeOptions: context.runtimeOptions,
17908
+ field: "data_pipeline_source_actions",
17909
+ variables: {
17910
+ organization_id: resolveOrganizationId(context.organizationId),
17911
+ source_id: opts.sourceId
17912
+ },
17913
+ variableTypes: SOURCE_ACTIONS_VARIABLE_TYPES,
17914
+ isList: true,
17915
+ transformData: transformSourceActions,
17916
+ selectionSet: SOURCE_ACTION_SELECTION
17917
+ });
17918
+ });
17919
+ dataPipeline.command("execute-source-action").description("Execute one backend-certified read-only action for a configured source").requiredOption(
17920
+ "--category-key <categoryKey>",
17921
+ "Data Pipeline category key",
17922
+ parseCategoryKey
17923
+ ).requiredOption(
17924
+ "--provider-key <providerKey>",
17925
+ "Provider key from the configured source",
17926
+ (value) => parseNonBlank(value, "provider-key")
17927
+ ).requiredOption(
17928
+ "--source-id <sourceId>",
17929
+ "Configured Data Pipeline source ID",
17930
+ (value) => parseNonBlank(value, "source-id")
17931
+ ).requiredOption(
17932
+ "--action-key <actionKey>",
17933
+ "Action key returned by source-actions",
17934
+ (value) => parseNonBlank(value, "action-key")
17935
+ ).option(
17936
+ "--parameters-json <parametersJson>",
17937
+ "Bounded JSON object matching the discovered action input schema",
17938
+ parseSourceActionParameters,
17939
+ {}
17940
+ ).action(async (opts, cmd) => {
17941
+ const context = await resolveCommandContext(cmd.optsWithGlobals());
17942
+ await runGraphqlQueryCommand({
17943
+ command: "data-pipeline.execute-source-action",
17944
+ operationName: "DataPipelineExecuteSourceAction",
17945
+ runtimeOptions: context.runtimeOptions,
17946
+ field: "data_pipeline_execute_source_action",
17947
+ variables: {
17948
+ organization_id: resolveOrganizationId(context.organizationId),
17949
+ category_key: opts.categoryKey,
17950
+ provider_key: opts.providerKey,
17951
+ source_id: opts.sourceId,
17952
+ action_key: opts.actionKey,
17953
+ parameters: opts.parametersJson
17954
+ },
17955
+ variableTypes: EXECUTE_SOURCE_ACTION_VARIABLE_TYPES,
17956
+ isShow: true,
17957
+ transformData: transformSourceActionResult,
17958
+ selectionSet: SOURCE_ACTION_RESULT_SELECTION
17959
+ });
17960
+ });
17345
17961
  }
17346
17962
 
17347
17963
  // src/commands/discovery.ts
@@ -17353,10 +17969,12 @@ var PRIMARY_NAMESPACES = [
17353
17969
  "support",
17354
17970
  "recognition",
17355
17971
  "whiteboards",
17972
+ "sketches",
17356
17973
  "time-tracking",
17357
17974
  "planner",
17358
17975
  "mail",
17359
17976
  "datasheets",
17977
+ "data-pipeline",
17360
17978
  "desktop-context",
17361
17979
  "phantom",
17362
17980
  "tasks",
@@ -17383,9 +18001,7 @@ var ADVANCED_NAMESPACES = [
17383
18001
  "stand-ups",
17384
18002
  "news",
17385
18003
  "questions",
17386
- "pulse",
17387
18004
  "surveys",
17388
- "feedbacks",
17389
18005
  "accountability",
17390
18006
  "kpis",
17391
18007
  "scorecard-groups",
@@ -17445,7 +18061,9 @@ var NAMESPACE_DOCS = {
17445
18061
  description: "Sanitized desktop capture health and recent evidence for Atlas grounding.",
17446
18062
  examples: [
17447
18063
  "wave desktop-context status",
18064
+ "wave desktop-context member-statuses --member-ids 123,456",
17448
18065
  "wave desktop-context recent --limit 20",
18066
+ "wave desktop-context activity --start-at 2026-08-18T08:00:00Z --end-at 2026-08-18T09:00:00Z",
17449
18067
  "wave desktop-context status --member-id 123"
17450
18068
  ],
17451
18069
  schema: {
@@ -17456,7 +18074,28 @@ var NAMESPACE_DOCS = {
17456
18074
  "Does not expose screenshots, raw audio, accessibility trees, clipboard contents, keystrokes, URLs, or filesystem paths.",
17457
18075
  "Cross-member reads remain subject to backend organization policy and every response carries backend trace correlation when available."
17458
18076
  ],
17459
- commands: ["status", "recent"]
18077
+ commands: ["status", "member-statuses", "recent", "activity"]
18078
+ }
18079
+ },
18080
+ "data-pipeline": {
18081
+ name: "data-pipeline",
18082
+ tier: "primary",
18083
+ description: "Organization Data Pipeline configuration, saved sources, and certified provider reads.",
18084
+ examples: [
18085
+ "wave data-pipeline overview",
18086
+ "wave data-pipeline sources --category-key communication_meetings",
18087
+ "wave data-pipeline source-actions --source-id 123",
18088
+ `wave data-pipeline execute-source-action --category-key marketing_analytics --provider-key posthog --source-id 123 --action-key posthog.list_dashboards --parameters-json '{"limit":10,"offset":0}'`
18089
+ ],
18090
+ schema: {
18091
+ output: "json-envelope-default",
18092
+ readOnly: true,
18093
+ safety: [
18094
+ "Reads organization-scoped Data Pipeline configuration and backend-certified provider records only.",
18095
+ "Provider actions are discovered from the backend and remain read-only and approval-free.",
18096
+ "Does not install, enable, disable, or uninstall plugins; manage credentials; or create, update, or delete sources."
18097
+ ],
18098
+ commands: ["overview", "sources", "source-actions", "execute-source-action"]
17460
18099
  }
17461
18100
  },
17462
18101
  phantom: {
@@ -17676,6 +18315,28 @@ var NAMESPACE_DOCS = {
17676
18315
  commands: ["open", "list", "show"]
17677
18316
  }
17678
18317
  },
18318
+ sketches: {
18319
+ name: "sketches",
18320
+ tier: "primary",
18321
+ description: "Sketch metadata, bounded create/update operations, and verified app-route metadata.",
18322
+ examples: [
18323
+ "wave sketches list --page 1 --per 20",
18324
+ "wave sketches show --slug SKT-02",
18325
+ `wave sketches create --data-json '{"name":"Design review","teams_ids":["team-1"],"creation_key":"design-review-1"}'`,
18326
+ `wave sketches update-metadata --id 123 --data-json '{"name":"Design review"}'`,
18327
+ "wave sketches open"
18328
+ ],
18329
+ schema: {
18330
+ output: "json-envelope-default",
18331
+ mutates: true,
18332
+ safety: [
18333
+ "Uses verified GraphQL fields sketches, sketch, createSketch, and updateSketch.",
18334
+ "Create requires a team and an idempotency creation key; update accepts only bounded metadata fields.",
18335
+ "Never accepts or emits native document bytes, collaboration updates, render/export data, embedded files, comments, or tokens."
18336
+ ],
18337
+ commands: ["open", "list", "show", "create", "update-metadata"]
18338
+ }
18339
+ },
17679
18340
  "time-tracking": {
17680
18341
  name: "time-tracking",
17681
18342
  tier: "primary",
@@ -17736,9 +18397,10 @@ var NAMESPACE_DOCS = {
17736
18397
  mail: {
17737
18398
  name: "mail",
17738
18399
  tier: "primary",
17739
- description: "Mail read-only metadata for workspace, accounts, messages, conversations, labels, snippets, settings, sync status, and verified app route metadata.",
18400
+ description: "Mail read-only metadata for workspace, explicitly authorized relay evidence, accounts, messages, conversations, labels, snippets, settings, sync status, and verified app route metadata.",
17740
18401
  examples: [
17741
18402
  "wave mail workspace --page 1 --per 20",
18403
+ "wave mail relay-evidence --account-id 123 --page 1 --per 20",
17742
18404
  "wave mail accounts",
17743
18405
  "wave mail messages --account-id 123 --view inbox --page 1 --per 20",
17744
18406
  "wave mail conversations --account-id 123 --view inbox --page 1 --per 20",
@@ -17760,7 +18422,8 @@ var NAMESPACE_DOCS = {
17760
18422
  "Microsoft Outlook Mail maps to service outlook_mail and Outlook Calendar maps to service outlook_calendar with custom OAuth provider wave-microsoft-outlook.",
17761
18423
  "Uses the verified WAVE-03 safe app route /mail.",
17762
18424
  "Account output is limited to ids, provider/service, status, connection state, sync status, and timestamps.",
17763
- "Message and conversation output omits bodies, subjects, snippets, contacts, attachments, provider payloads, provider ids, raw thread ids, and user-authored mail content.",
18425
+ "Default message and conversation output omits bodies, subjects, snippets, contacts, attachments, provider payloads, provider ids, raw thread ids, and user-authored mail content.",
18426
+ "relay-evidence is an explicit authenticated relay surface limited to mailbox identity plus sender, subject, date, and snippet metadata; it still omits bodies, recipients, attachments, provider ids, and token material.",
17764
18427
  "Label, snippet, settings, and sync-status output omits user label names/colors, snippet title/shortcut/body, signatures, preferences, sync search text, operation reasons, error bodies, and token material.",
17765
18428
  "Does not expose send, reply, reply-all, forward, draft, provider-action, sync/connect/disconnect, mark, archive, trash, star, label/snippet CRUD, export, print, or write commands."
17766
18429
  ],
@@ -17768,6 +18431,7 @@ var NAMESPACE_DOCS = {
17768
18431
  "open",
17769
18432
  "validate-provider",
17770
18433
  "workspace",
18434
+ "relay-evidence",
17771
18435
  "accounts",
17772
18436
  "messages",
17773
18437
  "conversations",
@@ -18364,7 +19028,11 @@ function buildCli(options) {
18364
19028
  "Explicit organization ID override"
18365
19029
  ).option(
18366
19030
  "--config <configPath>",
18367
- "Optional JSON config file (default: WAVE_CONFIG_PATH or ~/.wave/config.json when present)"
19031
+ "Optional JSON config file (default: ~/.wave/config.json when present)"
19032
+ ).addOption(
19033
+ new Option2("--auth-home <path>", "Credential storage directory (default: ~/.wave)")
19034
+ ).addOption(
19035
+ new Option2("--auth-storage <mode>", "Credential storage mode").choices(["auto", "keychain", "file", "disabled"]).default("auto")
18368
19036
  ).option("--timeout-ms <timeoutMs>", "HTTP timeout in milliseconds").option("--agent-name <agentName>", "Agent name for tracing").option("--agent-run-id <agentRunId>", "Agent run identifier for tracing").option("--request-id <requestId>", "Request identifier").option(
18369
19037
  "--atlas-member-id <memberId>",
18370
19038
  "Atlas ledger member ID (prefer WAVE_ATLAS_MEMBER_ID env var)"
@@ -18396,12 +19064,21 @@ function buildCli(options) {
18396
19064
  "--openapi-version <openapiVersion>",
18397
19065
  "Optional pinned OpenAPI version/hash"
18398
19066
  ).exitOverride();
19067
+ program.hook("preAction", (_thisCommand, actionCommand) => {
19068
+ const runtimeOptions = actionCommand.optsWithGlobals();
19069
+ configureAuthStorage({
19070
+ ...runtimeOptions.authHome ? { home: runtimeOptions.authHome } : {},
19071
+ ...runtimeOptions.config ? { configPath: runtimeOptions.config } : {},
19072
+ ...runtimeOptions.authStorage ? { mode: runtimeOptions.authStorage } : {}
19073
+ });
19074
+ });
18399
19075
  setInternalCliOptions(program, options?.internal);
18400
19076
  registerTaskCommands(program);
18401
19077
  registerProjectCommands(program);
18402
19078
  registerRockCommands(program);
18403
19079
  registerMeetingCommands(program);
18404
19080
  registerMemberCommands(program);
19081
+ registerResourceCommands(program);
18405
19082
  registerSkillCommands(program);
18406
19083
  registerAtlasAuthoringCommands(program);
18407
19084
  registerTeamCommands(program);
@@ -18419,6 +19096,7 @@ function buildCli(options) {
18419
19096
  registerSupportCommands(program);
18420
19097
  registerRecognitionCommands(program);
18421
19098
  registerWhiteboardsCommands(program);
19099
+ registerSketchCommands(program);
18422
19100
  registerTimeTrackingCommands(program);
18423
19101
  registerPlannerCommands(program);
18424
19102
  registerMailCommands(program);
@@ -18426,6 +19104,7 @@ function buildCli(options) {
18426
19104
  registerDatasheetsCommands(program);
18427
19105
  registerSignatureCommands(program);
18428
19106
  registerDesktopContextCommands(program);
19107
+ registerDataPipelineCommands(program);
18429
19108
  registerAuthCommands(program);
18430
19109
  registerDiscoveryCommands(program);
18431
19110
  attachNamespaceDiscovery(program);
@@ -18682,9 +19361,10 @@ function withTrustedMachineAuth(auth, callback) {
18682
19361
  for (const key of Object.keys(process.env)) {
18683
19362
  if (key.startsWith("WAVE_")) delete process.env[key];
18684
19363
  }
18685
- process.env.WAVE_CLI_AUTH_STORAGE = "disabled";
18686
- process.env.WAVE_CLI_HOME = "/dev/null";
18687
- return withMachineRuntimeAuth(auth, callback).finally(() => {
19364
+ return withAuthStorageOptions(
19365
+ { home: "/dev/null", mode: "disabled" },
19366
+ () => withMachineRuntimeAuth(auth, callback)
19367
+ ).finally(() => {
18688
19368
  for (const key of Object.keys(process.env)) {
18689
19369
  if (key.startsWith("WAVE_")) delete process.env[key];
18690
19370
  }
@@ -18891,7 +19571,15 @@ async function maybeRunMachineExecute(argv, program) {
18891
19571
  }
18892
19572
  try {
18893
19573
  await withTrustedMachineAuth(auth, async () => {
18894
- await program.parseAsync([process.execPath, "wave", ...commandArgs(resolved.command, normalizedInput)]);
19574
+ await program.parseAsync([
19575
+ process.execPath,
19576
+ "wave",
19577
+ "--auth-storage",
19578
+ "disabled",
19579
+ "--auth-home",
19580
+ "/dev/null",
19581
+ ...commandArgs(resolved.command, normalizedInput)
19582
+ ]);
18895
19583
  });
18896
19584
  } catch (error) {
18897
19585
  if (isEnvelopeEmittedSignal(error)) return true;