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

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.
Files changed (3) hide show
  1. package/dist/index.cjs +159 -19
  2. package/dist/index.js +159 -19
  3. package/package.json +3 -2
package/dist/index.cjs CHANGED
@@ -705,6 +705,7 @@ async function requestGraphqlHttp(params) {
705
705
  "Content-Type": "application/json",
706
706
  "X-Origin": "wave-cli",
707
707
  "X-Request-Id": params.requestId,
708
+ ...params.input.config.requestId ? { "X-Wave-Trace-Id": params.input.config.requestId } : {},
708
709
  ...params.input.config.agentName ? { "X-Agent-Name": params.input.config.agentName } : {},
709
710
  ...params.input.config.agentRunId ? { "X-Agent-Run-Id": params.input.config.agentRunId } : {}
710
711
  },
@@ -1149,6 +1150,7 @@ function isEnvelopeEmittedSignal(error) {
1149
1150
 
1150
1151
  // src/commandRunner.ts
1151
1152
  var RESOURCE_QUERY_FIELDS = {
1153
+ tool_config: ["toolKey", "expectations"],
1152
1154
  task: [
1153
1155
  "summary",
1154
1156
  "slug",
@@ -1655,7 +1657,7 @@ function buildCliErrorEnvelope(params) {
1655
1657
  }
1656
1658
  function defaultQuerySelectionSet(field, isList) {
1657
1659
  if (field === "organization") {
1658
- return "{ id slug membersCount organizationDetail { title name description timezone workspaceName } }";
1660
+ return "{ id slug membersCount organizationDetail { title name description numberOfEmployees stage timezone companyUrl estimateType companyRevenuePeriod okrName workspaceName } }";
1659
1661
  }
1660
1662
  const canonicalField = RESOURCE_FIELD_ALIASES[field] ?? field;
1661
1663
  const explicitFields = RESOURCE_QUERY_FIELDS[canonicalField];
@@ -2611,6 +2613,7 @@ function applyMachineRuntimeAuth(resolved) {
2611
2613
  tokenSource: "machine",
2612
2614
  baseUrl: machineAuth.baseUrl,
2613
2615
  organizationId: machineAuth.organizationId,
2616
+ ...machineAuth.requestId === void 0 ? {} : { requestId: machineAuth.requestId },
2614
2617
  ...machineAuth.timeoutMs === void 0 ? {} : { timeoutMs: machineAuth.timeoutMs }
2615
2618
  }
2616
2619
  };
@@ -5995,6 +5998,19 @@ function registerOrganizationCommands(program) {
5995
5998
  isShow: true
5996
5999
  });
5997
6000
  });
6001
+ organizations.command("tool-config").description("Organization tool configuration operations").command("show").requiredOption("--tool-key <toolKey>", "Tool key").action(async (opts, cmd) => {
6002
+ const context = await resolveCommandContext(cmd.optsWithGlobals());
6003
+ await runGraphqlQueryCommand({
6004
+ command: "organizations.tool-config.show",
6005
+ runtimeOptions: context.runtimeOptions,
6006
+ field: "tool_config",
6007
+ variables: {
6008
+ organization_id: resolveOrganizationId(context.organizationId),
6009
+ tool_key: String(opts.toolKey)
6010
+ },
6011
+ isShow: true
6012
+ });
6013
+ });
5998
6014
  organizations.command("update").option("--id <id>", "Organization ID (defaults to resolved organization context)").requiredOption(
5999
6015
  "--data-json <dataJson>",
6000
6016
  'JSON object for organization or {"organization": {...}}'
@@ -7901,7 +7917,7 @@ var import_commander = require("commander");
7901
7917
  var import_node_crypto3 = require("crypto");
7902
7918
 
7903
7919
  // src/version.ts
7904
- var CLI_VERSION = "0.1.84";
7920
+ var CLI_VERSION = "0.1.85";
7905
7921
 
7906
7922
  // src/operationMetadata.ts
7907
7923
  var DISCOVERY_OPERATION_IDS = [
@@ -7930,6 +7946,8 @@ var DISCOVERY_OPERATION_IDS = [
7930
7946
  "customers.schema",
7931
7947
  "datasheets.examples",
7932
7948
  "datasheets.schema",
7949
+ "desktop-context.examples",
7950
+ "desktop-context.schema",
7933
7951
  "doctor",
7934
7952
  "doctor.examples",
7935
7953
  "doctor.schema",
@@ -8043,6 +8061,8 @@ var READ_OPERATION_IDS = [
8043
8061
  "datasheets.list",
8044
8062
  "datasheets.open",
8045
8063
  "datasheets.show",
8064
+ "desktop-context.recent",
8065
+ "desktop-context.status",
8046
8066
  "feedbacks.list",
8047
8067
  "feedbacks.search",
8048
8068
  "feedbacks.show",
@@ -8108,6 +8128,7 @@ var READ_OPERATION_IDS = [
8108
8128
  "organizations.key-metric-meta-profile.show",
8109
8129
  "organizations.meta-profile.show",
8110
8130
  "organizations.show",
8131
+ "organizations.tool-config.show",
8111
8132
  "osmd.agent.children",
8112
8133
  "osmd.agent.read",
8113
8134
  "osmd.agent.status",
@@ -8190,6 +8211,8 @@ var READ_OPERATION_IDS = [
8190
8211
  "support.settings",
8191
8212
  "support.ticket-counts",
8192
8213
  "support.tickets",
8214
+ "signatures.list",
8215
+ "signatures.show",
8193
8216
  "surveys.list",
8194
8217
  "surveys.search",
8195
8218
  "surveys.show",
@@ -8334,6 +8357,13 @@ var WRITE_OPERATION_IDS = [
8334
8357
  "smart-kpi-views.create",
8335
8358
  "stand-ups.create",
8336
8359
  "stand-ups.update",
8360
+ "signatures.archive",
8361
+ "signatures.create",
8362
+ "signatures.destroy",
8363
+ "signatures.send",
8364
+ "signatures.unarchive",
8365
+ "signatures.update",
8366
+ "signatures.void",
8337
8367
  "subissues.create",
8338
8368
  "subissues.destroy",
8339
8369
  "subissues.update",
@@ -8380,6 +8410,8 @@ var DESTRUCTIVE_OPERATION_IDS = /* @__PURE__ */ new Set([
8380
8410
  "datasheets.view.delete",
8381
8411
  "milestones.destroy",
8382
8412
  "project-content.destroy",
8413
+ "signatures.destroy",
8414
+ "signatures.void",
8383
8415
  "subissues.destroy",
8384
8416
  "subitems.destroy",
8385
8417
  "subtasks.destroy",
@@ -8575,7 +8607,12 @@ function buildOperationManifest(program) {
8575
8607
  }
8576
8608
 
8577
8609
  // src/commands/osmd.ts
8578
- var sourceSchema = import_zod18.z.enum(["canonical_osmd", "agent_overlay", "agent_wiki"]);
8610
+ var sourceSchema = import_zod18.z.enum([
8611
+ "canonical_osmd",
8612
+ "agent_overlay",
8613
+ "agent_wiki",
8614
+ "thread_workspace"
8615
+ ]);
8579
8616
  var accessSchema = import_zod18.z.enum(["read_only", "read_write", "append_only"]).catch("read_write");
8580
8617
  var ownerSchema = import_zod18.z.enum(["system", "atlas"]);
8581
8618
  var suggestedActionSchema = import_zod18.z.enum([
@@ -8661,7 +8698,14 @@ var agentMarkdownFileSchema = import_zod18.z.preprocess(
8661
8698
  suggestedAction: suggestedActionSchema,
8662
8699
  errorCode: agentMarkdownErrorCodeFieldSchema.optional(),
8663
8700
  content: import_zod18.z.string().nullable().optional(),
8664
- url: import_zod18.z.string().nullable().optional()
8701
+ url: import_zod18.z.string().nullable().optional(),
8702
+ workspaceId: import_zod18.z.string().nullable().optional(),
8703
+ fileId: import_zod18.z.string().nullable().optional(),
8704
+ name: import_zod18.z.string().nullable().optional(),
8705
+ displayName: import_zod18.z.string().nullable().optional(),
8706
+ contentSha: import_zod18.z.string().nullable().optional(),
8707
+ versionSha: import_zod18.z.string().nullable().optional(),
8708
+ mediaType: import_zod18.z.string().nullable().optional()
8665
8709
  }).transform((value) => ({
8666
8710
  ...value,
8667
8711
  wikiRole: value.wikiRole ?? null,
@@ -8674,7 +8718,14 @@ var agentMarkdownFileSchema = import_zod18.z.preprocess(
8674
8718
  parentRef: value.parentRef ?? null,
8675
8719
  errorCode: value.errorCode ?? null,
8676
8720
  content: value.content ?? null,
8677
- url: value.url ?? null
8721
+ url: value.url ?? null,
8722
+ workspaceId: value.workspaceId ?? null,
8723
+ fileId: value.fileId ?? null,
8724
+ name: value.name ?? null,
8725
+ displayName: value.displayName ?? null,
8726
+ contentSha: value.contentSha ?? null,
8727
+ versionSha: value.versionSha ?? null,
8728
+ mediaType: value.mediaType ?? null
8678
8729
  }))
8679
8730
  );
8680
8731
  var agentMarkdownFilesSchema = import_zod18.z.array(agentMarkdownFileSchema);
@@ -8979,6 +9030,13 @@ var AGENT_MARKDOWN_FILE_SELECTION = `{
8979
9030
  errorCode
8980
9031
  content
8981
9032
  url
9033
+ workspaceId
9034
+ fileId
9035
+ name
9036
+ displayName
9037
+ contentSha
9038
+ versionSha
9039
+ mediaType
8982
9040
  }`;
8983
9041
  var OSMD_SEARCH_SELECTION = `{
8984
9042
  query
@@ -9634,21 +9692,24 @@ async function runOsmdIngestFlow(params) {
9634
9692
  })
9635
9693
  });
9636
9694
  }
9637
- function normalizeAgentFilePath(file) {
9695
+ var atlasThreadWorkspaceParentRefPattern = /^Atlas Workspace\/ATL-[A-Z0-9][A-Z0-9-]*$/;
9696
+ function normalizeAgentFilePath(file, parentRef) {
9638
9697
  const trimmed = nonEmptyString3.parse(file).trim().replace(/^\/+|\/+$/g, "");
9639
9698
  const fileName = trimmed.startsWith(".agent/") ? trimmed.slice(".agent/".length) : trimmed;
9640
- if (fileName.includes("\\") || fileName.includes("/") || fileName === "." || fileName === ".." || !isSupportedAgentOverlayFileName(fileName)) {
9699
+ const isThreadWorkspace = atlasThreadWorkspaceParentRefPattern.test(parentRef);
9700
+ const isSupportedFile = isThreadWorkspace ? /^[a-z0-9][a-z0-9-]*\.(?:md|txt)$/.test(fileName) : isSupportedAgentOverlayFileName(fileName);
9701
+ if (fileName.includes("\\") || fileName.includes("/") || fileName === "." || fileName === ".." || !isSupportedFile) {
9641
9702
  throw new CliError({
9642
- message: ".agent supports only notes.md, summary.md, or <lowercase-kebab-slug>.md.",
9703
+ 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.",
9643
9704
  kind: "invalid_args",
9644
9705
  status: 400,
9645
9706
  exitCode: EXIT_CODES.invalidArgs,
9646
9707
  details: {
9647
- supportedFiles: [...supportedAgentOverlaySystemFiles, "<lowercase-kebab-slug>.md"]
9708
+ supportedFiles: isThreadWorkspace ? ["<lowercase-kebab-slug>.md", "<lowercase-kebab-slug>.txt"] : [...supportedAgentOverlaySystemFiles, "<lowercase-kebab-slug>.md"]
9648
9709
  }
9649
9710
  });
9650
9711
  }
9651
- return `.agent/${fileName}`;
9712
+ return isThreadWorkspace ? fileName : `.agent/${fileName}`;
9652
9713
  }
9653
9714
  function formatHumanList(items) {
9654
9715
  if (items.length <= 1) {
@@ -10875,12 +10936,13 @@ function registerOsmdCommands(program) {
10875
10936
  const agent = osmd.command("agent").description(".agent markdown attached to canonical OSMD parents");
10876
10937
  agent.command("status <parent-ref> <file>").description("Show .agent file metadata without creating files").action(async (parentRef, file, _opts, cmd) => {
10877
10938
  const { organizationId, runtimeOptions } = await resolveOsmdContext(cmd);
10939
+ const normalizedParentRef = nonEmptyString3.parse(parentRef).trim();
10878
10940
  const result = await requestAgentMarkdownStatus({
10879
10941
  command: "osmd.agent.status",
10880
10942
  runtimeOptions,
10881
10943
  organizationId,
10882
- path: normalizeAgentFilePath(file),
10883
- parentRef: nonEmptyString3.parse(parentRef).trim()
10944
+ path: normalizeAgentFilePath(file, normalizedParentRef),
10945
+ parentRef: normalizedParentRef
10884
10946
  });
10885
10947
  return printEnvelopeAndExit({
10886
10948
  envelope: buildSuccessEnvelope({
@@ -10907,12 +10969,13 @@ function registerOsmdCommands(program) {
10907
10969
  });
10908
10970
  agent.command("read <parent-ref> <file>").description("Read a .agent file without creating files").action(async (parentRef, file, _opts, cmd) => {
10909
10971
  const { organizationId, runtimeOptions } = await resolveOsmdContext(cmd);
10972
+ const normalizedParentRef = nonEmptyString3.parse(parentRef).trim();
10910
10973
  const result = await requestAgentMarkdownFile({
10911
10974
  command: "osmd.agent.read",
10912
10975
  runtimeOptions,
10913
10976
  organizationId,
10914
- path: normalizeAgentFilePath(file),
10915
- parentRef: nonEmptyString3.parse(parentRef).trim()
10977
+ path: normalizeAgentFilePath(file, normalizedParentRef),
10978
+ parentRef: normalizedParentRef
10916
10979
  });
10917
10980
  return printEnvelopeAndExit({
10918
10981
  envelope: buildSuccessEnvelope({
@@ -10930,13 +10993,14 @@ function registerOsmdCommands(program) {
10930
10993
  const globals = cmd.optsWithGlobals();
10931
10994
  const content = await resolveContentInput(opts, globals);
10932
10995
  const { organizationId, runtimeOptions } = await resolveOsmdContext(cmd);
10996
+ const normalizedParentRef = nonEmptyString3.parse(parentRef).trim();
10933
10997
  return runWriteFlow({
10934
10998
  command: "osmd.agent.create",
10935
10999
  action: "create",
10936
11000
  runtimeOptions,
10937
11001
  organizationId,
10938
- path: normalizeAgentFilePath(file),
10939
- parentRef: nonEmptyString3.parse(parentRef).trim(),
11002
+ path: normalizeAgentFilePath(file, normalizedParentRef),
11003
+ parentRef: normalizedParentRef,
10940
11004
  content
10941
11005
  });
10942
11006
  }
@@ -10948,13 +11012,14 @@ function registerOsmdCommands(program) {
10948
11012
  const globals = cmd.optsWithGlobals();
10949
11013
  const content = await resolveContentInput(opts, globals);
10950
11014
  const { organizationId, runtimeOptions } = await resolveOsmdContext(cmd);
11015
+ const normalizedParentRef = nonEmptyString3.parse(parentRef).trim();
10951
11016
  return runWriteFlow({
10952
11017
  command: "osmd.agent.update",
10953
11018
  action: "update",
10954
11019
  runtimeOptions,
10955
11020
  organizationId,
10956
- path: normalizeAgentFilePath(file),
10957
- parentRef: nonEmptyString3.parse(parentRef).trim(),
11021
+ path: normalizeAgentFilePath(file, normalizedParentRef),
11022
+ parentRef: normalizedParentRef,
10958
11023
  content
10959
11024
  });
10960
11025
  }
@@ -17227,6 +17292,59 @@ function registerAtlasAuthoringCommands(program) {
17227
17292
  });
17228
17293
  }
17229
17294
 
17295
+ // src/commands/desktopContext.ts
17296
+ var VARIABLE_TYPES = {
17297
+ organization_id: "ID!",
17298
+ member_id: "ID"
17299
+ };
17300
+ function parseRecentLimit(value) {
17301
+ const limit = Number(value);
17302
+ if (!Number.isInteger(limit) || limit < 1 || limit > 50) {
17303
+ throw new Error("limit must be an integer between 1 and 50");
17304
+ }
17305
+ return limit;
17306
+ }
17307
+ async function runDesktopContextQuery(cmd, params) {
17308
+ const context = await resolveCommandContext(cmd.optsWithGlobals());
17309
+ await runGraphqlQueryCommand({
17310
+ command: params.command,
17311
+ operationName: params.operationName,
17312
+ runtimeOptions: context.runtimeOptions,
17313
+ field: params.field,
17314
+ variables: normalizeGraphqlVariables2({
17315
+ organization_id: resolveOrganizationId(context.organizationId),
17316
+ member_id: params.memberId,
17317
+ limit: params.limit
17318
+ }),
17319
+ variableTypes: {
17320
+ ...VARIABLE_TYPES,
17321
+ ...params.command === "desktop-context.recent" ? { limit: "Int" } : {}
17322
+ },
17323
+ isShow: true,
17324
+ selectionSet: ""
17325
+ });
17326
+ }
17327
+ function registerDesktopContextCommands(program) {
17328
+ const desktopContext = program.command("desktop-context").description("Read sanitized, bounded desktop context and capture health");
17329
+ desktopContext.command("status").description("Read capture freshness and synchronization status").option("--member-id <memberId>", "Member scope; defaults to the authenticated member").action(async (opts, cmd) => {
17330
+ await runDesktopContextQuery(cmd, {
17331
+ command: "desktop-context.status",
17332
+ operationName: "DesktopContextStatus",
17333
+ field: "desktop_context_status",
17334
+ memberId: opts.memberId
17335
+ });
17336
+ });
17337
+ 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) => {
17338
+ await runDesktopContextQuery(cmd, {
17339
+ command: "desktop-context.recent",
17340
+ operationName: "DesktopContextRecent",
17341
+ field: "desktop_context_recent",
17342
+ memberId: opts.memberId,
17343
+ limit: opts.limit
17344
+ });
17345
+ });
17346
+ }
17347
+
17230
17348
  // src/commands/discovery.ts
17231
17349
  var import_node_fs4 = require("fs");
17232
17350
  var import_node_path5 = require("path");
@@ -17240,6 +17358,7 @@ var PRIMARY_NAMESPACES = [
17240
17358
  "planner",
17241
17359
  "mail",
17242
17360
  "datasheets",
17361
+ "desktop-context",
17243
17362
  "phantom",
17244
17363
  "tasks",
17245
17364
  "projects",
@@ -17321,6 +17440,26 @@ var NAMESPACE_DOCS = {
17321
17440
  commands: ["tree", "status", "read", "children", "search", "lint", "memory-quality", "ingest", "agent", "wiki"]
17322
17441
  }
17323
17442
  },
17443
+ "desktop-context": {
17444
+ name: "desktop-context",
17445
+ tier: "primary",
17446
+ description: "Sanitized desktop capture health and recent evidence for Atlas grounding.",
17447
+ examples: [
17448
+ "wave desktop-context status",
17449
+ "wave desktop-context recent --limit 20",
17450
+ "wave desktop-context status --member-id 123"
17451
+ ],
17452
+ schema: {
17453
+ output: "json-envelope-default",
17454
+ readOnly: true,
17455
+ safety: [
17456
+ "Reads only API-sanitized status metadata and bounded evidence excerpts.",
17457
+ "Does not expose screenshots, raw audio, accessibility trees, clipboard contents, keystrokes, URLs, or filesystem paths.",
17458
+ "Cross-member reads remain subject to backend organization policy and every response carries backend trace correlation when available."
17459
+ ],
17460
+ commands: ["status", "recent"]
17461
+ }
17462
+ },
17324
17463
  phantom: {
17325
17464
  name: "phantom",
17326
17465
  tier: "primary",
@@ -18287,6 +18426,7 @@ function buildCli(options) {
18287
18426
  registerPhantomCommands(program);
18288
18427
  registerDatasheetsCommands(program);
18289
18428
  registerSignatureCommands(program);
18429
+ registerDesktopContextCommands(program);
18290
18430
  registerAuthCommands(program);
18291
18431
  registerDiscoveryCommands(program);
18292
18432
  attachNamespaceDiscovery(program);
@@ -18435,7 +18575,7 @@ function parseTrustedJsonFromFd(fd, predicate) {
18435
18575
  }
18436
18576
  }
18437
18577
  function isTrustedAuth(value) {
18438
- return isPlainObject2(value) && typeof value.token === "string" && value.token.trim() !== "" && typeof value.baseUrl === "string" && value.baseUrl.trim() !== "" && typeof value.organizationId === "string" && value.organizationId.trim() !== "" && typeof value.actorId === "string" && value.actorId.trim() !== "" && (value.timeoutMs === void 0 || typeof value.timeoutMs === "number" && Number.isInteger(value.timeoutMs) && value.timeoutMs > 0);
18578
+ return isPlainObject2(value) && typeof value.token === "string" && value.token.trim() !== "" && typeof value.baseUrl === "string" && value.baseUrl.trim() !== "" && typeof value.organizationId === "string" && value.organizationId.trim() !== "" && typeof value.actorId === "string" && value.actorId.trim() !== "" && (value.requestId === void 0 || typeof value.requestId === "string" && value.requestId.trim() !== "" && Buffer.byteLength(value.requestId, "utf8") <= 255 && /^[\x21-\x7E]+$/.test(value.requestId)) && (value.timeoutMs === void 0 || typeof value.timeoutMs === "number" && Number.isInteger(value.timeoutMs) && value.timeoutMs > 0);
18439
18579
  }
18440
18580
  function isTrustedApproval(value) {
18441
18581
  return isPlainObject2(value) && typeof value.operation === "string" && typeof value.inputDigest === "string" && typeof value.cliVersion === "string" && typeof value.registryDigest === "string" && typeof value.organizationId === "string" && value.organizationId.trim() !== "" && typeof value.actorId === "string" && value.actorId.trim() !== "";
package/dist/index.js CHANGED
@@ -704,6 +704,7 @@ async function requestGraphqlHttp(params) {
704
704
  "Content-Type": "application/json",
705
705
  "X-Origin": "wave-cli",
706
706
  "X-Request-Id": params.requestId,
707
+ ...params.input.config.requestId ? { "X-Wave-Trace-Id": params.input.config.requestId } : {},
707
708
  ...params.input.config.agentName ? { "X-Agent-Name": params.input.config.agentName } : {},
708
709
  ...params.input.config.agentRunId ? { "X-Agent-Run-Id": params.input.config.agentRunId } : {}
709
710
  },
@@ -1148,6 +1149,7 @@ function isEnvelopeEmittedSignal(error) {
1148
1149
 
1149
1150
  // src/commandRunner.ts
1150
1151
  var RESOURCE_QUERY_FIELDS = {
1152
+ tool_config: ["toolKey", "expectations"],
1151
1153
  task: [
1152
1154
  "summary",
1153
1155
  "slug",
@@ -1654,7 +1656,7 @@ function buildCliErrorEnvelope(params) {
1654
1656
  }
1655
1657
  function defaultQuerySelectionSet(field, isList) {
1656
1658
  if (field === "organization") {
1657
- return "{ id slug membersCount organizationDetail { title name description timezone workspaceName } }";
1659
+ return "{ id slug membersCount organizationDetail { title name description numberOfEmployees stage timezone companyUrl estimateType companyRevenuePeriod okrName workspaceName } }";
1658
1660
  }
1659
1661
  const canonicalField = RESOURCE_FIELD_ALIASES[field] ?? field;
1660
1662
  const explicitFields = RESOURCE_QUERY_FIELDS[canonicalField];
@@ -2610,6 +2612,7 @@ function applyMachineRuntimeAuth(resolved) {
2610
2612
  tokenSource: "machine",
2611
2613
  baseUrl: machineAuth.baseUrl,
2612
2614
  organizationId: machineAuth.organizationId,
2615
+ ...machineAuth.requestId === void 0 ? {} : { requestId: machineAuth.requestId },
2613
2616
  ...machineAuth.timeoutMs === void 0 ? {} : { timeoutMs: machineAuth.timeoutMs }
2614
2617
  }
2615
2618
  };
@@ -5994,6 +5997,19 @@ function registerOrganizationCommands(program) {
5994
5997
  isShow: true
5995
5998
  });
5996
5999
  });
6000
+ organizations.command("tool-config").description("Organization tool configuration operations").command("show").requiredOption("--tool-key <toolKey>", "Tool key").action(async (opts, cmd) => {
6001
+ const context = await resolveCommandContext(cmd.optsWithGlobals());
6002
+ await runGraphqlQueryCommand({
6003
+ command: "organizations.tool-config.show",
6004
+ runtimeOptions: context.runtimeOptions,
6005
+ field: "tool_config",
6006
+ variables: {
6007
+ organization_id: resolveOrganizationId(context.organizationId),
6008
+ tool_key: String(opts.toolKey)
6009
+ },
6010
+ isShow: true
6011
+ });
6012
+ });
5997
6013
  organizations.command("update").option("--id <id>", "Organization ID (defaults to resolved organization context)").requiredOption(
5998
6014
  "--data-json <dataJson>",
5999
6015
  'JSON object for organization or {"organization": {...}}'
@@ -7900,7 +7916,7 @@ import { Option } from "commander";
7900
7916
  import { createHash } from "crypto";
7901
7917
 
7902
7918
  // src/version.ts
7903
- var CLI_VERSION = "0.1.84";
7919
+ var CLI_VERSION = "0.1.85";
7904
7920
 
7905
7921
  // src/operationMetadata.ts
7906
7922
  var DISCOVERY_OPERATION_IDS = [
@@ -7929,6 +7945,8 @@ var DISCOVERY_OPERATION_IDS = [
7929
7945
  "customers.schema",
7930
7946
  "datasheets.examples",
7931
7947
  "datasheets.schema",
7948
+ "desktop-context.examples",
7949
+ "desktop-context.schema",
7932
7950
  "doctor",
7933
7951
  "doctor.examples",
7934
7952
  "doctor.schema",
@@ -8042,6 +8060,8 @@ var READ_OPERATION_IDS = [
8042
8060
  "datasheets.list",
8043
8061
  "datasheets.open",
8044
8062
  "datasheets.show",
8063
+ "desktop-context.recent",
8064
+ "desktop-context.status",
8045
8065
  "feedbacks.list",
8046
8066
  "feedbacks.search",
8047
8067
  "feedbacks.show",
@@ -8107,6 +8127,7 @@ var READ_OPERATION_IDS = [
8107
8127
  "organizations.key-metric-meta-profile.show",
8108
8128
  "organizations.meta-profile.show",
8109
8129
  "organizations.show",
8130
+ "organizations.tool-config.show",
8110
8131
  "osmd.agent.children",
8111
8132
  "osmd.agent.read",
8112
8133
  "osmd.agent.status",
@@ -8189,6 +8210,8 @@ var READ_OPERATION_IDS = [
8189
8210
  "support.settings",
8190
8211
  "support.ticket-counts",
8191
8212
  "support.tickets",
8213
+ "signatures.list",
8214
+ "signatures.show",
8192
8215
  "surveys.list",
8193
8216
  "surveys.search",
8194
8217
  "surveys.show",
@@ -8333,6 +8356,13 @@ var WRITE_OPERATION_IDS = [
8333
8356
  "smart-kpi-views.create",
8334
8357
  "stand-ups.create",
8335
8358
  "stand-ups.update",
8359
+ "signatures.archive",
8360
+ "signatures.create",
8361
+ "signatures.destroy",
8362
+ "signatures.send",
8363
+ "signatures.unarchive",
8364
+ "signatures.update",
8365
+ "signatures.void",
8336
8366
  "subissues.create",
8337
8367
  "subissues.destroy",
8338
8368
  "subissues.update",
@@ -8379,6 +8409,8 @@ var DESTRUCTIVE_OPERATION_IDS = /* @__PURE__ */ new Set([
8379
8409
  "datasheets.view.delete",
8380
8410
  "milestones.destroy",
8381
8411
  "project-content.destroy",
8412
+ "signatures.destroy",
8413
+ "signatures.void",
8382
8414
  "subissues.destroy",
8383
8415
  "subitems.destroy",
8384
8416
  "subtasks.destroy",
@@ -8574,7 +8606,12 @@ function buildOperationManifest(program) {
8574
8606
  }
8575
8607
 
8576
8608
  // src/commands/osmd.ts
8577
- var sourceSchema = z18.enum(["canonical_osmd", "agent_overlay", "agent_wiki"]);
8609
+ var sourceSchema = z18.enum([
8610
+ "canonical_osmd",
8611
+ "agent_overlay",
8612
+ "agent_wiki",
8613
+ "thread_workspace"
8614
+ ]);
8578
8615
  var accessSchema = z18.enum(["read_only", "read_write", "append_only"]).catch("read_write");
8579
8616
  var ownerSchema = z18.enum(["system", "atlas"]);
8580
8617
  var suggestedActionSchema = z18.enum([
@@ -8660,7 +8697,14 @@ var agentMarkdownFileSchema = z18.preprocess(
8660
8697
  suggestedAction: suggestedActionSchema,
8661
8698
  errorCode: agentMarkdownErrorCodeFieldSchema.optional(),
8662
8699
  content: z18.string().nullable().optional(),
8663
- url: 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()
8664
8708
  }).transform((value) => ({
8665
8709
  ...value,
8666
8710
  wikiRole: value.wikiRole ?? null,
@@ -8673,7 +8717,14 @@ var agentMarkdownFileSchema = z18.preprocess(
8673
8717
  parentRef: value.parentRef ?? null,
8674
8718
  errorCode: value.errorCode ?? null,
8675
8719
  content: value.content ?? null,
8676
- url: value.url ?? null
8720
+ url: value.url ?? null,
8721
+ workspaceId: value.workspaceId ?? null,
8722
+ fileId: value.fileId ?? null,
8723
+ name: value.name ?? null,
8724
+ displayName: value.displayName ?? null,
8725
+ contentSha: value.contentSha ?? null,
8726
+ versionSha: value.versionSha ?? null,
8727
+ mediaType: value.mediaType ?? null
8677
8728
  }))
8678
8729
  );
8679
8730
  var agentMarkdownFilesSchema = z18.array(agentMarkdownFileSchema);
@@ -8978,6 +9029,13 @@ var AGENT_MARKDOWN_FILE_SELECTION = `{
8978
9029
  errorCode
8979
9030
  content
8980
9031
  url
9032
+ workspaceId
9033
+ fileId
9034
+ name
9035
+ displayName
9036
+ contentSha
9037
+ versionSha
9038
+ mediaType
8981
9039
  }`;
8982
9040
  var OSMD_SEARCH_SELECTION = `{
8983
9041
  query
@@ -9633,21 +9691,24 @@ async function runOsmdIngestFlow(params) {
9633
9691
  })
9634
9692
  });
9635
9693
  }
9636
- function normalizeAgentFilePath(file) {
9694
+ var atlasThreadWorkspaceParentRefPattern = /^Atlas Workspace\/ATL-[A-Z0-9][A-Z0-9-]*$/;
9695
+ function normalizeAgentFilePath(file, parentRef) {
9637
9696
  const trimmed = nonEmptyString3.parse(file).trim().replace(/^\/+|\/+$/g, "");
9638
9697
  const fileName = trimmed.startsWith(".agent/") ? trimmed.slice(".agent/".length) : trimmed;
9639
- if (fileName.includes("\\") || fileName.includes("/") || fileName === "." || fileName === ".." || !isSupportedAgentOverlayFileName(fileName)) {
9698
+ const isThreadWorkspace = atlasThreadWorkspaceParentRefPattern.test(parentRef);
9699
+ const isSupportedFile = isThreadWorkspace ? /^[a-z0-9][a-z0-9-]*\.(?:md|txt)$/.test(fileName) : isSupportedAgentOverlayFileName(fileName);
9700
+ if (fileName.includes("\\") || fileName.includes("/") || fileName === "." || fileName === ".." || !isSupportedFile) {
9640
9701
  throw new CliError({
9641
- message: ".agent supports only notes.md, summary.md, or <lowercase-kebab-slug>.md.",
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.",
9642
9703
  kind: "invalid_args",
9643
9704
  status: 400,
9644
9705
  exitCode: EXIT_CODES.invalidArgs,
9645
9706
  details: {
9646
- supportedFiles: [...supportedAgentOverlaySystemFiles, "<lowercase-kebab-slug>.md"]
9707
+ supportedFiles: isThreadWorkspace ? ["<lowercase-kebab-slug>.md", "<lowercase-kebab-slug>.txt"] : [...supportedAgentOverlaySystemFiles, "<lowercase-kebab-slug>.md"]
9647
9708
  }
9648
9709
  });
9649
9710
  }
9650
- return `.agent/${fileName}`;
9711
+ return isThreadWorkspace ? fileName : `.agent/${fileName}`;
9651
9712
  }
9652
9713
  function formatHumanList(items) {
9653
9714
  if (items.length <= 1) {
@@ -10874,12 +10935,13 @@ function registerOsmdCommands(program) {
10874
10935
  const agent = osmd.command("agent").description(".agent markdown attached to canonical OSMD parents");
10875
10936
  agent.command("status <parent-ref> <file>").description("Show .agent file metadata without creating files").action(async (parentRef, file, _opts, cmd) => {
10876
10937
  const { organizationId, runtimeOptions } = await resolveOsmdContext(cmd);
10938
+ const normalizedParentRef = nonEmptyString3.parse(parentRef).trim();
10877
10939
  const result = await requestAgentMarkdownStatus({
10878
10940
  command: "osmd.agent.status",
10879
10941
  runtimeOptions,
10880
10942
  organizationId,
10881
- path: normalizeAgentFilePath(file),
10882
- parentRef: nonEmptyString3.parse(parentRef).trim()
10943
+ path: normalizeAgentFilePath(file, normalizedParentRef),
10944
+ parentRef: normalizedParentRef
10883
10945
  });
10884
10946
  return printEnvelopeAndExit({
10885
10947
  envelope: buildSuccessEnvelope({
@@ -10906,12 +10968,13 @@ function registerOsmdCommands(program) {
10906
10968
  });
10907
10969
  agent.command("read <parent-ref> <file>").description("Read a .agent file without creating files").action(async (parentRef, file, _opts, cmd) => {
10908
10970
  const { organizationId, runtimeOptions } = await resolveOsmdContext(cmd);
10971
+ const normalizedParentRef = nonEmptyString3.parse(parentRef).trim();
10909
10972
  const result = await requestAgentMarkdownFile({
10910
10973
  command: "osmd.agent.read",
10911
10974
  runtimeOptions,
10912
10975
  organizationId,
10913
- path: normalizeAgentFilePath(file),
10914
- parentRef: nonEmptyString3.parse(parentRef).trim()
10976
+ path: normalizeAgentFilePath(file, normalizedParentRef),
10977
+ parentRef: normalizedParentRef
10915
10978
  });
10916
10979
  return printEnvelopeAndExit({
10917
10980
  envelope: buildSuccessEnvelope({
@@ -10929,13 +10992,14 @@ function registerOsmdCommands(program) {
10929
10992
  const globals = cmd.optsWithGlobals();
10930
10993
  const content = await resolveContentInput(opts, globals);
10931
10994
  const { organizationId, runtimeOptions } = await resolveOsmdContext(cmd);
10995
+ const normalizedParentRef = nonEmptyString3.parse(parentRef).trim();
10932
10996
  return runWriteFlow({
10933
10997
  command: "osmd.agent.create",
10934
10998
  action: "create",
10935
10999
  runtimeOptions,
10936
11000
  organizationId,
10937
- path: normalizeAgentFilePath(file),
10938
- parentRef: nonEmptyString3.parse(parentRef).trim(),
11001
+ path: normalizeAgentFilePath(file, normalizedParentRef),
11002
+ parentRef: normalizedParentRef,
10939
11003
  content
10940
11004
  });
10941
11005
  }
@@ -10947,13 +11011,14 @@ function registerOsmdCommands(program) {
10947
11011
  const globals = cmd.optsWithGlobals();
10948
11012
  const content = await resolveContentInput(opts, globals);
10949
11013
  const { organizationId, runtimeOptions } = await resolveOsmdContext(cmd);
11014
+ const normalizedParentRef = nonEmptyString3.parse(parentRef).trim();
10950
11015
  return runWriteFlow({
10951
11016
  command: "osmd.agent.update",
10952
11017
  action: "update",
10953
11018
  runtimeOptions,
10954
11019
  organizationId,
10955
- path: normalizeAgentFilePath(file),
10956
- parentRef: nonEmptyString3.parse(parentRef).trim(),
11020
+ path: normalizeAgentFilePath(file, normalizedParentRef),
11021
+ parentRef: normalizedParentRef,
10957
11022
  content
10958
11023
  });
10959
11024
  }
@@ -17226,6 +17291,59 @@ function registerAtlasAuthoringCommands(program) {
17226
17291
  });
17227
17292
  }
17228
17293
 
17294
+ // src/commands/desktopContext.ts
17295
+ var VARIABLE_TYPES = {
17296
+ organization_id: "ID!",
17297
+ member_id: "ID"
17298
+ };
17299
+ function parseRecentLimit(value) {
17300
+ const limit = Number(value);
17301
+ if (!Number.isInteger(limit) || limit < 1 || limit > 50) {
17302
+ throw new Error("limit must be an integer between 1 and 50");
17303
+ }
17304
+ return limit;
17305
+ }
17306
+ async function runDesktopContextQuery(cmd, params) {
17307
+ const context = await resolveCommandContext(cmd.optsWithGlobals());
17308
+ await runGraphqlQueryCommand({
17309
+ command: params.command,
17310
+ operationName: params.operationName,
17311
+ runtimeOptions: context.runtimeOptions,
17312
+ field: params.field,
17313
+ variables: normalizeGraphqlVariables2({
17314
+ organization_id: resolveOrganizationId(context.organizationId),
17315
+ member_id: params.memberId,
17316
+ limit: params.limit
17317
+ }),
17318
+ variableTypes: {
17319
+ ...VARIABLE_TYPES,
17320
+ ...params.command === "desktop-context.recent" ? { limit: "Int" } : {}
17321
+ },
17322
+ isShow: true,
17323
+ selectionSet: ""
17324
+ });
17325
+ }
17326
+ function registerDesktopContextCommands(program) {
17327
+ const desktopContext = program.command("desktop-context").description("Read sanitized, bounded desktop context and capture health");
17328
+ desktopContext.command("status").description("Read capture freshness and synchronization status").option("--member-id <memberId>", "Member scope; defaults to the authenticated member").action(async (opts, cmd) => {
17329
+ await runDesktopContextQuery(cmd, {
17330
+ command: "desktop-context.status",
17331
+ operationName: "DesktopContextStatus",
17332
+ field: "desktop_context_status",
17333
+ memberId: opts.memberId
17334
+ });
17335
+ });
17336
+ 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
+ await runDesktopContextQuery(cmd, {
17338
+ command: "desktop-context.recent",
17339
+ operationName: "DesktopContextRecent",
17340
+ field: "desktop_context_recent",
17341
+ memberId: opts.memberId,
17342
+ limit: opts.limit
17343
+ });
17344
+ });
17345
+ }
17346
+
17229
17347
  // src/commands/discovery.ts
17230
17348
  import { existsSync as existsSync3, readFileSync } from "fs";
17231
17349
  import { join as join3 } from "path";
@@ -17239,6 +17357,7 @@ var PRIMARY_NAMESPACES = [
17239
17357
  "planner",
17240
17358
  "mail",
17241
17359
  "datasheets",
17360
+ "desktop-context",
17242
17361
  "phantom",
17243
17362
  "tasks",
17244
17363
  "projects",
@@ -17320,6 +17439,26 @@ var NAMESPACE_DOCS = {
17320
17439
  commands: ["tree", "status", "read", "children", "search", "lint", "memory-quality", "ingest", "agent", "wiki"]
17321
17440
  }
17322
17441
  },
17442
+ "desktop-context": {
17443
+ name: "desktop-context",
17444
+ tier: "primary",
17445
+ description: "Sanitized desktop capture health and recent evidence for Atlas grounding.",
17446
+ examples: [
17447
+ "wave desktop-context status",
17448
+ "wave desktop-context recent --limit 20",
17449
+ "wave desktop-context status --member-id 123"
17450
+ ],
17451
+ schema: {
17452
+ output: "json-envelope-default",
17453
+ readOnly: true,
17454
+ safety: [
17455
+ "Reads only API-sanitized status metadata and bounded evidence excerpts.",
17456
+ "Does not expose screenshots, raw audio, accessibility trees, clipboard contents, keystrokes, URLs, or filesystem paths.",
17457
+ "Cross-member reads remain subject to backend organization policy and every response carries backend trace correlation when available."
17458
+ ],
17459
+ commands: ["status", "recent"]
17460
+ }
17461
+ },
17323
17462
  phantom: {
17324
17463
  name: "phantom",
17325
17464
  tier: "primary",
@@ -18286,6 +18425,7 @@ function buildCli(options) {
18286
18425
  registerPhantomCommands(program);
18287
18426
  registerDatasheetsCommands(program);
18288
18427
  registerSignatureCommands(program);
18428
+ registerDesktopContextCommands(program);
18289
18429
  registerAuthCommands(program);
18290
18430
  registerDiscoveryCommands(program);
18291
18431
  attachNamespaceDiscovery(program);
@@ -18434,7 +18574,7 @@ function parseTrustedJsonFromFd(fd, predicate) {
18434
18574
  }
18435
18575
  }
18436
18576
  function isTrustedAuth(value) {
18437
- return isPlainObject2(value) && typeof value.token === "string" && value.token.trim() !== "" && typeof value.baseUrl === "string" && value.baseUrl.trim() !== "" && typeof value.organizationId === "string" && value.organizationId.trim() !== "" && typeof value.actorId === "string" && value.actorId.trim() !== "" && (value.timeoutMs === void 0 || typeof value.timeoutMs === "number" && Number.isInteger(value.timeoutMs) && value.timeoutMs > 0);
18577
+ return isPlainObject2(value) && typeof value.token === "string" && value.token.trim() !== "" && typeof value.baseUrl === "string" && value.baseUrl.trim() !== "" && typeof value.organizationId === "string" && value.organizationId.trim() !== "" && typeof value.actorId === "string" && value.actorId.trim() !== "" && (value.requestId === void 0 || typeof value.requestId === "string" && value.requestId.trim() !== "" && Buffer.byteLength(value.requestId, "utf8") <= 255 && /^[\x21-\x7E]+$/.test(value.requestId)) && (value.timeoutMs === void 0 || typeof value.timeoutMs === "number" && Number.isInteger(value.timeoutMs) && value.timeoutMs > 0);
18438
18578
  }
18439
18579
  function isTrustedApproval(value) {
18440
18580
  return isPlainObject2(value) && typeof value.operation === "string" && typeof value.inputDigest === "string" && typeof value.cliVersion === "string" && typeof value.registryDigest === "string" && typeof value.organizationId === "string" && value.organizationId.trim() !== "" && typeof value.actorId === "string" && value.actorId.trim() !== "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wave-ai-os/wave-cli",
3
- "version": "0.1.84",
3
+ "version": "0.1.86",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "wave": "dist/index.js"
@@ -31,5 +31,6 @@
31
31
  "tsx": "^4.20.6",
32
32
  "typescript": "^5.9.3",
33
33
  "vitest": "^3.2.4"
34
- }
34
+ },
35
+ "packageManager": "pnpm@11.18.0+sha512.33d83c77da82f49fba836925c6f1b841181ec3132b670639bd012f7075f5c7cf634c5f870147c19aae7478fac01df09d8892e880454896edd23ee9b33757563c"
35
36
  }