@wave-ai-os/wave-cli 0.1.85 → 0.1.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +949 -335
- package/dist/index.js +946 -332
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
// src/index.ts
|
|
5
5
|
var import_commander3 = require("commander");
|
|
6
|
-
var
|
|
6
|
+
var import_zod22 = require("zod");
|
|
7
7
|
|
|
8
8
|
// src/cli.ts
|
|
9
9
|
var import_commander2 = require("commander");
|
|
@@ -1165,6 +1165,8 @@ var RESOURCE_QUERY_FIELDS = {
|
|
|
1165
1165
|
"archivedAt",
|
|
1166
1166
|
"organizationId",
|
|
1167
1167
|
"memberId",
|
|
1168
|
+
"member",
|
|
1169
|
+
"assignee",
|
|
1168
1170
|
"creatorId",
|
|
1169
1171
|
"projectId",
|
|
1170
1172
|
"projectSlug",
|
|
@@ -1212,6 +1214,7 @@ var RESOURCE_QUERY_FIELDS = {
|
|
|
1212
1214
|
"role",
|
|
1213
1215
|
"status",
|
|
1214
1216
|
"title",
|
|
1217
|
+
"rolePurpose",
|
|
1215
1218
|
"firstName",
|
|
1216
1219
|
"lastName",
|
|
1217
1220
|
"createdAt",
|
|
@@ -1662,7 +1665,8 @@ function defaultQuerySelectionSet(field, isList) {
|
|
|
1662
1665
|
const canonicalField = RESOURCE_FIELD_ALIASES[field] ?? field;
|
|
1663
1666
|
const explicitFields = RESOURCE_QUERY_FIELDS[canonicalField];
|
|
1664
1667
|
if (explicitFields) {
|
|
1665
|
-
const
|
|
1668
|
+
const detailFields = canonicalField === "smart_kpi" && !isList ? ["smartKpiMetrics { id date value }", "smartKpiGoals { id date value }"] : [];
|
|
1669
|
+
const attributes = explicitFields.length > 0 ? `attributes { ${Array.from(/* @__PURE__ */ new Set(["id", ...explicitFields, ...detailFields])).join(" ")} }` : "attributes";
|
|
1666
1670
|
if (isList) {
|
|
1667
1671
|
return `{ data { id type ${attributes} } count currentPage totalPages }`;
|
|
1668
1672
|
}
|
|
@@ -4038,7 +4042,7 @@ var projectPriorityValues = projectPrioritySchema.options.join(", ");
|
|
|
4038
4042
|
var projectCreateDataJsonHelp = buildDataJsonHelp("project", "create") ?? 'JSON object for project or {"project": {...}}';
|
|
4039
4043
|
var projectUpdateDataJsonHelp = buildDataJsonHelp("project", "update") ?? 'JSON object for project or {"project": {...}}';
|
|
4040
4044
|
function projectsIndexMinimalSelectionSet(includeProjectTypes = false) {
|
|
4041
|
-
return `{ count currentPage totalPages data { id type attributes { name slug status priority${includeProjectTypes ? " projectType" : ""} } } }`;
|
|
4045
|
+
return `{ count currentPage totalPages data { id type attributes { name slug status priority createdAt updatedAt${includeProjectTypes ? " projectType" : ""} } } }`;
|
|
4042
4046
|
}
|
|
4043
4047
|
var displayPreferenceAttributesSelectionSet = "attributes { id viewType favorite groupingField groupToggleState memberId focusMemberId focusTeamId displayableId displayableType preferenceType agendaItemId }";
|
|
4044
4048
|
var filterPreferenceAttributesSelectionSet = "attributes { id filterType filter memberId focusMemberId focusTeamId filterableId filterableType preferenceType agendaItemId }";
|
|
@@ -4485,6 +4489,22 @@ function registerMeetingCommands(program) {
|
|
|
4485
4489
|
isShow: true
|
|
4486
4490
|
});
|
|
4487
4491
|
});
|
|
4492
|
+
meetings.command("note-show").description("Read the authorized AI note context for a meeting").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
4493
|
+
const meetingId = idSchema5.parse(opts.id);
|
|
4494
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
4495
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
4496
|
+
await runGraphqlQueryCommand({
|
|
4497
|
+
command: "meetings.note-show",
|
|
4498
|
+
runtimeOptions: context.runtimeOptions,
|
|
4499
|
+
field: "meeting_note_by_meeting",
|
|
4500
|
+
variables: {
|
|
4501
|
+
organization_id: organizationId,
|
|
4502
|
+
meeting_id: meetingId
|
|
4503
|
+
},
|
|
4504
|
+
selectionSet: "{ answerContext }",
|
|
4505
|
+
isShow: true
|
|
4506
|
+
});
|
|
4507
|
+
});
|
|
4488
4508
|
meetings.command("notes").requiredOption("--id <id>").requiredOption("--content <content>").action(async (opts, cmd) => {
|
|
4489
4509
|
const id = idSchema5.parse(opts.id);
|
|
4490
4510
|
const notes = notesSchema.parse(opts.content);
|
|
@@ -4540,10 +4560,25 @@ function registerMeetingCommands(program) {
|
|
|
4540
4560
|
|
|
4541
4561
|
// src/commands/members.ts
|
|
4542
4562
|
var import_zod8 = require("zod");
|
|
4543
|
-
var idSchema6 = import_zod8.z.string().min(1);
|
|
4563
|
+
var idSchema6 = import_zod8.z.string().trim().min(1);
|
|
4544
4564
|
var createHelp3 = buildDataJsonHelp("member", "create") ?? 'JSON object for member or {"member": {...}}';
|
|
4545
4565
|
var updateHelp3 = buildDataJsonHelp("member", "update") ?? 'JSON object for member or {"member": {...}}';
|
|
4546
4566
|
var MEMBER_META_PROFILE_SELECTION = "{ id type memberId summary profile attributes { id memberId summary profile } }";
|
|
4567
|
+
var MEMBER_REFERENCE_RESOLUTION_SELECTION = `{
|
|
4568
|
+
status
|
|
4569
|
+
reasonCode
|
|
4570
|
+
organizationId
|
|
4571
|
+
reference
|
|
4572
|
+
eligibilityPolicy
|
|
4573
|
+
complete
|
|
4574
|
+
source
|
|
4575
|
+
asOf
|
|
4576
|
+
traceId
|
|
4577
|
+
receiptId
|
|
4578
|
+
memberId
|
|
4579
|
+
memberName
|
|
4580
|
+
candidates { memberId memberName status eligible }
|
|
4581
|
+
}`;
|
|
4547
4582
|
function parseStrictBooleanOption(value, optionName) {
|
|
4548
4583
|
if (typeof value === "boolean") {
|
|
4549
4584
|
return value;
|
|
@@ -4600,6 +4635,29 @@ function registerMemberCommands(program) {
|
|
|
4600
4635
|
command: "members",
|
|
4601
4636
|
field: "members"
|
|
4602
4637
|
});
|
|
4638
|
+
members.command("resolve").description("Resolve a member reference within the authenticated organization").requiredOption("--query <query>", "Member name or email reference").action(async (opts, cmd) => {
|
|
4639
|
+
const reference = idSchema6.parse(opts.query);
|
|
4640
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
4641
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
4642
|
+
await runGraphqlQueryCommand({
|
|
4643
|
+
command: "members.resolve",
|
|
4644
|
+
runtimeOptions: context.runtimeOptions,
|
|
4645
|
+
operationName: "MemberReferenceResolution",
|
|
4646
|
+
field: "member_reference_resolution",
|
|
4647
|
+
variables: normalizeGraphqlVariables2({
|
|
4648
|
+
organization_id: organizationId,
|
|
4649
|
+
reference,
|
|
4650
|
+
trace_id: context.runtimeOptions.requestId
|
|
4651
|
+
}),
|
|
4652
|
+
variableTypes: {
|
|
4653
|
+
organization_id: "ID!",
|
|
4654
|
+
reference: "String!",
|
|
4655
|
+
trace_id: "String"
|
|
4656
|
+
},
|
|
4657
|
+
selectionSet: MEMBER_REFERENCE_RESOLUTION_SELECTION,
|
|
4658
|
+
isShow: true
|
|
4659
|
+
});
|
|
4660
|
+
});
|
|
4603
4661
|
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) => {
|
|
4604
4662
|
const memberId = idSchema6.parse(opts.memberId);
|
|
4605
4663
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
@@ -4668,10 +4726,69 @@ function registerMemberCommands(program) {
|
|
|
4668
4726
|
});
|
|
4669
4727
|
}
|
|
4670
4728
|
|
|
4671
|
-
// src/commands/
|
|
4729
|
+
// src/commands/resources.ts
|
|
4672
4730
|
var import_zod9 = require("zod");
|
|
4673
|
-
var
|
|
4674
|
-
|
|
4731
|
+
var resourceTypeSchema = import_zod9.z.enum([
|
|
4732
|
+
"project",
|
|
4733
|
+
"team",
|
|
4734
|
+
"agent",
|
|
4735
|
+
"automation",
|
|
4736
|
+
"file"
|
|
4737
|
+
]);
|
|
4738
|
+
var referenceSchema = import_zod9.z.string().trim().min(1);
|
|
4739
|
+
var RESOURCE_REFERENCE_RESOLUTION_SELECTION = `{
|
|
4740
|
+
status
|
|
4741
|
+
reasonCode
|
|
4742
|
+
organizationId
|
|
4743
|
+
resourceType
|
|
4744
|
+
reference
|
|
4745
|
+
eligibilityPolicy
|
|
4746
|
+
complete
|
|
4747
|
+
source
|
|
4748
|
+
asOf
|
|
4749
|
+
traceId
|
|
4750
|
+
receiptId
|
|
4751
|
+
resourceId
|
|
4752
|
+
resourceName
|
|
4753
|
+
candidates { resourceId resourceName resourceType status eligible }
|
|
4754
|
+
}`;
|
|
4755
|
+
function registerResourceCommands(program) {
|
|
4756
|
+
const resources = program.command("resources").description("Organization-scoped resource resolution");
|
|
4757
|
+
resources.command("resolve").description("Resolve a project, team, agent, automation, or file reference").requiredOption(
|
|
4758
|
+
"--type <type>",
|
|
4759
|
+
"Resource type: project, team, agent, automation, or file"
|
|
4760
|
+
).requiredOption("--query <query>", "Resource name or reference").action(async (opts, cmd) => {
|
|
4761
|
+
const resourceType = resourceTypeSchema.parse(opts.type);
|
|
4762
|
+
const reference = referenceSchema.parse(opts.query);
|
|
4763
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
4764
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
4765
|
+
await runGraphqlQueryCommand({
|
|
4766
|
+
command: "resources.resolve",
|
|
4767
|
+
runtimeOptions: context.runtimeOptions,
|
|
4768
|
+
operationName: "OrganizationResourceReferenceResolution",
|
|
4769
|
+
field: "organization_resource_reference_resolution",
|
|
4770
|
+
variables: normalizeGraphqlVariables2({
|
|
4771
|
+
organization_id: organizationId,
|
|
4772
|
+
resource_type: resourceType,
|
|
4773
|
+
reference,
|
|
4774
|
+
trace_id: context.runtimeOptions.requestId
|
|
4775
|
+
}),
|
|
4776
|
+
variableTypes: {
|
|
4777
|
+
organization_id: "ID!",
|
|
4778
|
+
resource_type: "String!",
|
|
4779
|
+
reference: "String!",
|
|
4780
|
+
trace_id: "String"
|
|
4781
|
+
},
|
|
4782
|
+
selectionSet: RESOURCE_REFERENCE_RESOLUTION_SELECTION,
|
|
4783
|
+
isShow: true
|
|
4784
|
+
});
|
|
4785
|
+
});
|
|
4786
|
+
}
|
|
4787
|
+
|
|
4788
|
+
// src/commands/skills.ts
|
|
4789
|
+
var import_zod10 = require("zod");
|
|
4790
|
+
var idSchema7 = import_zod10.z.string().min(1);
|
|
4791
|
+
var limitSchema = import_zod10.z.coerce.number().int().positive();
|
|
4675
4792
|
var SKILL_SELECTION = `{
|
|
4676
4793
|
id
|
|
4677
4794
|
type
|
|
@@ -4747,14 +4864,14 @@ function registerSkillCommands(program) {
|
|
|
4747
4864
|
}
|
|
4748
4865
|
|
|
4749
4866
|
// src/commands/issues.ts
|
|
4750
|
-
var
|
|
4751
|
-
var issueGroupIdSchema =
|
|
4752
|
-
var idSchema8 =
|
|
4753
|
-
var nameSchema =
|
|
4754
|
-
var issueTypeSchema =
|
|
4867
|
+
var import_zod11 = require("zod");
|
|
4868
|
+
var issueGroupIdSchema = import_zod11.z.string().min(1);
|
|
4869
|
+
var idSchema8 = import_zod11.z.string().min(1);
|
|
4870
|
+
var nameSchema = import_zod11.z.string().min(1);
|
|
4871
|
+
var issueTypeSchema = import_zod11.z.string().min(1).refine((value) => value === "short_term" || value === "long_term", {
|
|
4755
4872
|
message: "Invalid issue type. Use one of: short_term, long_term."
|
|
4756
4873
|
});
|
|
4757
|
-
var issueStatusSchema =
|
|
4874
|
+
var issueStatusSchema = import_zod11.z.string().min(1).refine((value) => value === "open" || value === "completed", {
|
|
4758
4875
|
message: "Invalid issue status. Use one of: open, completed."
|
|
4759
4876
|
});
|
|
4760
4877
|
var updateHelp4 = buildDataJsonHelp("issue", "update") ?? 'JSON object for issue or {"issue": {...}}';
|
|
@@ -5818,8 +5935,8 @@ function registerSystemToolCommands(program) {
|
|
|
5818
5935
|
}
|
|
5819
5936
|
|
|
5820
5937
|
// src/commands/teams.ts
|
|
5821
|
-
var
|
|
5822
|
-
var idSchema9 =
|
|
5938
|
+
var import_zod12 = require("zod");
|
|
5939
|
+
var idSchema9 = import_zod12.z.string().min(1);
|
|
5823
5940
|
function registerTeamCommands(program) {
|
|
5824
5941
|
const teams = program.command("teams").description("Team operations");
|
|
5825
5942
|
teams.command("list").option("--page <page>").option("--per <per>").action(async (opts, cmd) => {
|
|
@@ -5885,8 +6002,8 @@ function registerTeamCommands(program) {
|
|
|
5885
6002
|
}
|
|
5886
6003
|
|
|
5887
6004
|
// src/commands/organizations.ts
|
|
5888
|
-
var
|
|
5889
|
-
var idSchema10 =
|
|
6005
|
+
var import_zod13 = require("zod");
|
|
6006
|
+
var idSchema10 = import_zod13.z.string().min(1);
|
|
5890
6007
|
function isRecord3(value) {
|
|
5891
6008
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
5892
6009
|
}
|
|
@@ -6111,8 +6228,8 @@ function registerOrganizationCommands(program) {
|
|
|
6111
6228
|
}
|
|
6112
6229
|
|
|
6113
6230
|
// src/commands/foundation.ts
|
|
6114
|
-
var
|
|
6115
|
-
var idSchema11 =
|
|
6231
|
+
var import_zod14 = require("zod");
|
|
6232
|
+
var idSchema11 = import_zod14.z.string().min(1);
|
|
6116
6233
|
var STRATEGIC_PLAN_ALLOWED_UPDATE_KEYS = /* @__PURE__ */ new Set([
|
|
6117
6234
|
"published_at",
|
|
6118
6235
|
"profile",
|
|
@@ -6313,9 +6430,9 @@ function registerFoundationCommands(program) {
|
|
|
6313
6430
|
}
|
|
6314
6431
|
|
|
6315
6432
|
// src/commands/childEntities.ts
|
|
6316
|
-
var
|
|
6317
|
-
var idSchema12 =
|
|
6318
|
-
var jsonObjectSchema =
|
|
6433
|
+
var import_zod15 = require("zod");
|
|
6434
|
+
var idSchema12 = import_zod15.z.string().min(1);
|
|
6435
|
+
var jsonObjectSchema = import_zod15.z.record(import_zod15.z.string(), import_zod15.z.unknown());
|
|
6319
6436
|
var NOTE_DETAIL_FIELDS = [
|
|
6320
6437
|
"notes",
|
|
6321
6438
|
"hasNotes",
|
|
@@ -6739,9 +6856,9 @@ function registerChildEntityCommands(program) {
|
|
|
6739
6856
|
}
|
|
6740
6857
|
|
|
6741
6858
|
// src/commands/content.ts
|
|
6742
|
-
var
|
|
6743
|
-
var idSchema13 =
|
|
6744
|
-
var nonEmptyString =
|
|
6859
|
+
var import_zod16 = require("zod");
|
|
6860
|
+
var idSchema13 = import_zod16.z.string().min(1);
|
|
6861
|
+
var nonEmptyString = import_zod16.z.string().min(1);
|
|
6745
6862
|
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 }";
|
|
6746
6863
|
function assertUpdateFields(params) {
|
|
6747
6864
|
if (!params.name && !params.content && !params.status) {
|
|
@@ -6929,9 +7046,9 @@ function registerContentCommands(program) {
|
|
|
6929
7046
|
}
|
|
6930
7047
|
|
|
6931
7048
|
// src/commands/markdownTree.ts
|
|
6932
|
-
var
|
|
6933
|
-
var nonEmptyString2 =
|
|
6934
|
-
var nonNegativeInt =
|
|
7049
|
+
var import_zod17 = require("zod");
|
|
7050
|
+
var nonEmptyString2 = import_zod17.z.string().min(1);
|
|
7051
|
+
var nonNegativeInt = import_zod17.z.coerce.number().int().min(0);
|
|
6935
7052
|
function addScopeOptions(command) {
|
|
6936
7053
|
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");
|
|
6937
7054
|
}
|
|
@@ -7096,7 +7213,7 @@ function registerMarkdownTreeCommands(program) {
|
|
|
7096
7213
|
}
|
|
7097
7214
|
|
|
7098
7215
|
// src/commands/navigation.ts
|
|
7099
|
-
var
|
|
7216
|
+
var import_zod18 = require("zod");
|
|
7100
7217
|
|
|
7101
7218
|
// src/internalOptions.ts
|
|
7102
7219
|
var INTERNAL_OPTIONS_KEY = "__waveInternalOptions";
|
|
@@ -7126,8 +7243,8 @@ function getInternalCliOptions(command) {
|
|
|
7126
7243
|
}
|
|
7127
7244
|
|
|
7128
7245
|
// src/commands/navigation.ts
|
|
7129
|
-
var nonEmpty =
|
|
7130
|
-
var nonNegativeInt2 =
|
|
7246
|
+
var nonEmpty = import_zod18.z.string().min(1);
|
|
7247
|
+
var nonNegativeInt2 = import_zod18.z.coerce.number().int().min(0);
|
|
7131
7248
|
var MIGRATED_BRANCHES = ["directory", "projects", "knowledge"];
|
|
7132
7249
|
function normalizeText(input) {
|
|
7133
7250
|
if (typeof input !== "string") return "";
|
|
@@ -7910,14 +8027,14 @@ function registerMutationCapabilityCommands(program) {
|
|
|
7910
8027
|
// src/commands/osmd.ts
|
|
7911
8028
|
var import_promises3 = require("fs/promises");
|
|
7912
8029
|
var import_node_path3 = require("path");
|
|
7913
|
-
var
|
|
8030
|
+
var import_zod19 = require("zod");
|
|
7914
8031
|
var import_commander = require("commander");
|
|
7915
8032
|
|
|
7916
8033
|
// src/operationManifest.ts
|
|
7917
8034
|
var import_node_crypto3 = require("crypto");
|
|
7918
8035
|
|
|
7919
8036
|
// src/version.ts
|
|
7920
|
-
var CLI_VERSION = "0.1.
|
|
8037
|
+
var CLI_VERSION = "0.1.87";
|
|
7921
8038
|
|
|
7922
8039
|
// src/operationMetadata.ts
|
|
7923
8040
|
var DISCOVERY_OPERATION_IDS = [
|
|
@@ -7945,6 +8062,8 @@ var DISCOVERY_OPERATION_IDS = [
|
|
|
7945
8062
|
"customers.examples",
|
|
7946
8063
|
"customers.schema",
|
|
7947
8064
|
"datasheets.examples",
|
|
8065
|
+
"data-pipeline.examples",
|
|
8066
|
+
"data-pipeline.schema",
|
|
7948
8067
|
"datasheets.schema",
|
|
7949
8068
|
"desktop-context.examples",
|
|
7950
8069
|
"desktop-context.schema",
|
|
@@ -8060,7 +8179,13 @@ var READ_OPERATION_IDS = [
|
|
|
8060
8179
|
"customers.show",
|
|
8061
8180
|
"datasheets.list",
|
|
8062
8181
|
"datasheets.open",
|
|
8182
|
+
"data-pipeline.execute-source-action",
|
|
8183
|
+
"data-pipeline.overview",
|
|
8184
|
+
"data-pipeline.source-actions",
|
|
8185
|
+
"data-pipeline.sources",
|
|
8063
8186
|
"datasheets.show",
|
|
8187
|
+
"desktop-context.activity",
|
|
8188
|
+
"desktop-context.member-statuses",
|
|
8064
8189
|
"desktop-context.recent",
|
|
8065
8190
|
"desktop-context.status",
|
|
8066
8191
|
"feedbacks.list",
|
|
@@ -8112,12 +8237,15 @@ var READ_OPERATION_IDS = [
|
|
|
8112
8237
|
"markdown-tree.root",
|
|
8113
8238
|
"markdown-tree.subtree",
|
|
8114
8239
|
"meetings.list",
|
|
8240
|
+
"meetings.note-show",
|
|
8115
8241
|
"meetings.search",
|
|
8116
8242
|
"meetings.show",
|
|
8117
8243
|
"members.list",
|
|
8118
8244
|
"members.meta-profile",
|
|
8245
|
+
"members.resolve",
|
|
8119
8246
|
"members.search",
|
|
8120
8247
|
"members.show",
|
|
8248
|
+
"resources.resolve",
|
|
8121
8249
|
"milestones.list",
|
|
8122
8250
|
"milestones.search",
|
|
8123
8251
|
"milestones.show",
|
|
@@ -8426,6 +8554,14 @@ var OPERATION_IDS_BY_CLASSIFICATION = {
|
|
|
8426
8554
|
auth: AUTH_OPERATION_IDS
|
|
8427
8555
|
};
|
|
8428
8556
|
var metadataByOperationId = /* @__PURE__ */ new Map();
|
|
8557
|
+
function assertDataPipelineReadOnlyRegistration(id, metadata) {
|
|
8558
|
+
if (!id.startsWith("data-pipeline.")) return;
|
|
8559
|
+
const isReadOnlyOperation = metadata.classification === "read" && metadata.atlasSafetyClass === "read_only" || metadata.classification === "discovery" && metadata.atlasSafetyClass === "discovery";
|
|
8560
|
+
if (isReadOnlyOperation && !metadata.requiresApproval && !metadata.machine.supportsPreview) {
|
|
8561
|
+
return;
|
|
8562
|
+
}
|
|
8563
|
+
throw new Error(`Data Pipeline operations must remain read-only: ${id}`);
|
|
8564
|
+
}
|
|
8429
8565
|
for (const [classification, operationIds] of Object.entries(OPERATION_IDS_BY_CLASSIFICATION)) {
|
|
8430
8566
|
for (const id of operationIds) {
|
|
8431
8567
|
if (metadataByOperationId.has(id)) {
|
|
@@ -8435,7 +8571,7 @@ for (const [classification, operationIds] of Object.entries(OPERATION_IDS_BY_CLA
|
|
|
8435
8571
|
if (DESTRUCTIVE_OPERATION_IDS.has(id) && classification !== "write") {
|
|
8436
8572
|
throw new Error(`Destructive Wave CLI operation must be a write: ${id}`);
|
|
8437
8573
|
}
|
|
8438
|
-
|
|
8574
|
+
const metadata = {
|
|
8439
8575
|
classification,
|
|
8440
8576
|
requiresApproval: classification === "write" && !DIRECT_MACHINE_WRITE_OPERATION_IDS.has(id),
|
|
8441
8577
|
atlasSafetyClass,
|
|
@@ -8445,7 +8581,9 @@ for (const [classification, operationIds] of Object.entries(OPERATION_IDS_BY_CLA
|
|
|
8445
8581
|
supportsExecute: true,
|
|
8446
8582
|
executionMode: "sync"
|
|
8447
8583
|
}
|
|
8448
|
-
}
|
|
8584
|
+
};
|
|
8585
|
+
assertDataPipelineReadOnlyRegistration(id, metadata);
|
|
8586
|
+
metadataByOperationId.set(id, metadata);
|
|
8449
8587
|
}
|
|
8450
8588
|
}
|
|
8451
8589
|
function registeredOperationMetadata(id) {
|
|
@@ -8607,10 +8745,15 @@ function buildOperationManifest(program) {
|
|
|
8607
8745
|
}
|
|
8608
8746
|
|
|
8609
8747
|
// src/commands/osmd.ts
|
|
8610
|
-
var sourceSchema =
|
|
8611
|
-
|
|
8612
|
-
|
|
8613
|
-
|
|
8748
|
+
var sourceSchema = import_zod19.z.enum([
|
|
8749
|
+
"canonical_osmd",
|
|
8750
|
+
"agent_overlay",
|
|
8751
|
+
"agent_wiki",
|
|
8752
|
+
"thread_workspace"
|
|
8753
|
+
]);
|
|
8754
|
+
var accessSchema = import_zod19.z.enum(["read_only", "read_write", "append_only"]).catch("read_write");
|
|
8755
|
+
var ownerSchema = import_zod19.z.enum(["system", "atlas"]);
|
|
8756
|
+
var suggestedActionSchema = import_zod19.z.enum([
|
|
8614
8757
|
"read",
|
|
8615
8758
|
"create",
|
|
8616
8759
|
"init",
|
|
@@ -8619,7 +8762,7 @@ var suggestedActionSchema = import_zod18.z.enum([
|
|
|
8619
8762
|
"forbidden",
|
|
8620
8763
|
"invalid_parent"
|
|
8621
8764
|
]).catch("update");
|
|
8622
|
-
var agentMarkdownErrorCodeSchema =
|
|
8765
|
+
var agentMarkdownErrorCodeSchema = import_zod19.z.enum([
|
|
8623
8766
|
"canonical_osmd_read_only",
|
|
8624
8767
|
"agent_parent_not_found",
|
|
8625
8768
|
"agent_file_not_found",
|
|
@@ -8630,9 +8773,9 @@ var agentMarkdownErrorCodeSchema = import_zod18.z.enum([
|
|
|
8630
8773
|
"invalid_agent_wiki_path"
|
|
8631
8774
|
]);
|
|
8632
8775
|
var agentMarkdownErrorCodeFieldSchema = agentMarkdownErrorCodeSchema.nullable().catch(null);
|
|
8633
|
-
var nonEmptyString3 =
|
|
8634
|
-
var nonNegativeInt3 =
|
|
8635
|
-
var positiveInt =
|
|
8776
|
+
var nonEmptyString3 = import_zod19.z.string().min(1);
|
|
8777
|
+
var nonNegativeInt3 = import_zod19.z.coerce.number().int().min(0);
|
|
8778
|
+
var positiveInt = import_zod19.z.coerce.number().int().min(1);
|
|
8636
8779
|
var supportedAgentOverlaySystemFiles = ["notes.md", "summary.md"];
|
|
8637
8780
|
var supportedWikiIndexFile = "index.md";
|
|
8638
8781
|
var supportedWikiLogFile = "log.md";
|
|
@@ -8648,20 +8791,20 @@ var supportedWikiControlledPatterns = supportedWikiControlledFolders.map(
|
|
|
8648
8791
|
);
|
|
8649
8792
|
var controlledWikiSlugPattern = /^[a-z0-9][a-z0-9-]*$/;
|
|
8650
8793
|
var agentMarkdownSlugPattern = /^[a-z0-9][a-z0-9-]*$/;
|
|
8651
|
-
var osmdSearchScopeSchema =
|
|
8794
|
+
var osmdSearchScopeSchema = import_zod19.z.enum([
|
|
8652
8795
|
"os-only",
|
|
8653
8796
|
"agent-overlay-only",
|
|
8654
8797
|
"agent-wiki-only",
|
|
8655
8798
|
"combined"
|
|
8656
8799
|
]);
|
|
8657
|
-
var osmdLintScopeSchema =
|
|
8800
|
+
var osmdLintScopeSchema = import_zod19.z.enum([
|
|
8658
8801
|
"combined",
|
|
8659
8802
|
"agent-overlay-only",
|
|
8660
8803
|
"agent-wiki-only"
|
|
8661
8804
|
]);
|
|
8662
|
-
var osmdMemoryQualityScopeSchema =
|
|
8663
|
-
var osmdIngestKindSchema =
|
|
8664
|
-
var osmdRawSourceTypeSchema =
|
|
8805
|
+
var osmdMemoryQualityScopeSchema = import_zod19.z.enum(["agent-overlay-only"]);
|
|
8806
|
+
var osmdIngestKindSchema = import_zod19.z.enum(["text", "file", "url", "transcript"]);
|
|
8807
|
+
var osmdRawSourceTypeSchema = import_zod19.z.enum([
|
|
8665
8808
|
"pasted_text",
|
|
8666
8809
|
"uploaded_markdown",
|
|
8667
8810
|
"uploaded_text",
|
|
@@ -8670,30 +8813,37 @@ var osmdRawSourceTypeSchema = import_zod18.z.enum([
|
|
|
8670
8813
|
"meeting_transcript",
|
|
8671
8814
|
"url"
|
|
8672
8815
|
]);
|
|
8673
|
-
var agentMarkdownFileSchema =
|
|
8816
|
+
var agentMarkdownFileSchema = import_zod19.z.preprocess(
|
|
8674
8817
|
normalizeAgentMarkdownJsonKeys,
|
|
8675
|
-
|
|
8676
|
-
path:
|
|
8818
|
+
import_zod19.z.object({
|
|
8819
|
+
path: import_zod19.z.string(),
|
|
8677
8820
|
source: sourceSchema,
|
|
8678
8821
|
access: accessSchema,
|
|
8679
8822
|
owner: ownerSchema,
|
|
8680
|
-
exists:
|
|
8681
|
-
canCreate:
|
|
8682
|
-
canUpdate:
|
|
8683
|
-
canAppend:
|
|
8684
|
-
wikiRole:
|
|
8685
|
-
formatVersion:
|
|
8686
|
-
createdAt:
|
|
8687
|
-
updatedAt:
|
|
8688
|
-
ingestedAt:
|
|
8689
|
-
lastSeenAt:
|
|
8690
|
-
canonicalParentUpdatedAt:
|
|
8691
|
-
parentRef:
|
|
8692
|
-
agentChildrenAllowed:
|
|
8823
|
+
exists: import_zod19.z.boolean(),
|
|
8824
|
+
canCreate: import_zod19.z.boolean(),
|
|
8825
|
+
canUpdate: import_zod19.z.boolean(),
|
|
8826
|
+
canAppend: import_zod19.z.boolean(),
|
|
8827
|
+
wikiRole: import_zod19.z.string().nullable().optional(),
|
|
8828
|
+
formatVersion: import_zod19.z.string().nullable().optional(),
|
|
8829
|
+
createdAt: import_zod19.z.string().nullable().optional(),
|
|
8830
|
+
updatedAt: import_zod19.z.string().nullable().optional(),
|
|
8831
|
+
ingestedAt: import_zod19.z.string().nullable().optional(),
|
|
8832
|
+
lastSeenAt: import_zod19.z.string().nullable().optional(),
|
|
8833
|
+
canonicalParentUpdatedAt: import_zod19.z.string().nullable().optional(),
|
|
8834
|
+
parentRef: import_zod19.z.string().nullable().optional(),
|
|
8835
|
+
agentChildrenAllowed: import_zod19.z.boolean(),
|
|
8693
8836
|
suggestedAction: suggestedActionSchema,
|
|
8694
8837
|
errorCode: agentMarkdownErrorCodeFieldSchema.optional(),
|
|
8695
|
-
content:
|
|
8696
|
-
url:
|
|
8838
|
+
content: import_zod19.z.string().nullable().optional(),
|
|
8839
|
+
url: import_zod19.z.string().nullable().optional(),
|
|
8840
|
+
workspaceId: import_zod19.z.string().nullable().optional(),
|
|
8841
|
+
fileId: import_zod19.z.string().nullable().optional(),
|
|
8842
|
+
name: import_zod19.z.string().nullable().optional(),
|
|
8843
|
+
displayName: import_zod19.z.string().nullable().optional(),
|
|
8844
|
+
contentSha: import_zod19.z.string().nullable().optional(),
|
|
8845
|
+
versionSha: import_zod19.z.string().nullable().optional(),
|
|
8846
|
+
mediaType: import_zod19.z.string().nullable().optional()
|
|
8697
8847
|
}).transform((value) => ({
|
|
8698
8848
|
...value,
|
|
8699
8849
|
wikiRole: value.wikiRole ?? null,
|
|
@@ -8706,34 +8856,41 @@ var agentMarkdownFileSchema = import_zod18.z.preprocess(
|
|
|
8706
8856
|
parentRef: value.parentRef ?? null,
|
|
8707
8857
|
errorCode: value.errorCode ?? null,
|
|
8708
8858
|
content: value.content ?? null,
|
|
8709
|
-
url: value.url ?? null
|
|
8859
|
+
url: value.url ?? null,
|
|
8860
|
+
workspaceId: value.workspaceId ?? null,
|
|
8861
|
+
fileId: value.fileId ?? null,
|
|
8862
|
+
name: value.name ?? null,
|
|
8863
|
+
displayName: value.displayName ?? null,
|
|
8864
|
+
contentSha: value.contentSha ?? null,
|
|
8865
|
+
versionSha: value.versionSha ?? null,
|
|
8866
|
+
mediaType: value.mediaType ?? null
|
|
8710
8867
|
}))
|
|
8711
8868
|
);
|
|
8712
|
-
var agentMarkdownFilesSchema =
|
|
8713
|
-
var agentMarkdownMutationDataSchema =
|
|
8869
|
+
var agentMarkdownFilesSchema = import_zod19.z.array(agentMarkdownFileSchema);
|
|
8870
|
+
var agentMarkdownMutationDataSchema = import_zod19.z.union([
|
|
8714
8871
|
agentMarkdownFileSchema,
|
|
8715
|
-
|
|
8872
|
+
import_zod19.z.object({ files: agentMarkdownFilesSchema })
|
|
8716
8873
|
]);
|
|
8717
|
-
var osmdSearchCandidateSchema =
|
|
8874
|
+
var osmdSearchCandidateSchema = import_zod19.z.preprocess(
|
|
8718
8875
|
normalizeAgentMarkdownJsonKeys,
|
|
8719
|
-
|
|
8720
|
-
path:
|
|
8876
|
+
import_zod19.z.object({
|
|
8877
|
+
path: import_zod19.z.string(),
|
|
8721
8878
|
source: sourceSchema,
|
|
8722
8879
|
access: accessSchema,
|
|
8723
8880
|
owner: ownerSchema,
|
|
8724
|
-
wikiRole:
|
|
8725
|
-
formatVersion:
|
|
8726
|
-
parentRef:
|
|
8727
|
-
exists:
|
|
8728
|
-
agentChildrenAllowed:
|
|
8729
|
-
title:
|
|
8730
|
-
label:
|
|
8731
|
-
snippet:
|
|
8732
|
-
rank:
|
|
8733
|
-
matchReason:
|
|
8734
|
-
toolKey:
|
|
8735
|
-
nodeKey:
|
|
8736
|
-
nodeKind:
|
|
8881
|
+
wikiRole: import_zod19.z.string().nullable().optional(),
|
|
8882
|
+
formatVersion: import_zod19.z.string().nullable().optional(),
|
|
8883
|
+
parentRef: import_zod19.z.string().nullable().optional(),
|
|
8884
|
+
exists: import_zod19.z.boolean(),
|
|
8885
|
+
agentChildrenAllowed: import_zod19.z.boolean(),
|
|
8886
|
+
title: import_zod19.z.string(),
|
|
8887
|
+
label: import_zod19.z.string(),
|
|
8888
|
+
snippet: import_zod19.z.string().nullable().optional(),
|
|
8889
|
+
rank: import_zod19.z.number().int(),
|
|
8890
|
+
matchReason: import_zod19.z.string().nullable().optional(),
|
|
8891
|
+
toolKey: import_zod19.z.string().nullable().optional(),
|
|
8892
|
+
nodeKey: import_zod19.z.string().nullable().optional(),
|
|
8893
|
+
nodeKind: import_zod19.z.string().nullable().optional()
|
|
8737
8894
|
}).transform((value) => ({
|
|
8738
8895
|
...value,
|
|
8739
8896
|
wikiRole: value.wikiRole ?? null,
|
|
@@ -8746,26 +8903,26 @@ var osmdSearchCandidateSchema = import_zod18.z.preprocess(
|
|
|
8746
8903
|
nodeKind: value.nodeKind ?? null
|
|
8747
8904
|
}))
|
|
8748
8905
|
);
|
|
8749
|
-
var osmdSearchResultSchema =
|
|
8906
|
+
var osmdSearchResultSchema = import_zod19.z.preprocess(
|
|
8750
8907
|
normalizeAgentMarkdownJsonKeys,
|
|
8751
|
-
|
|
8752
|
-
query:
|
|
8753
|
-
scope:
|
|
8754
|
-
count:
|
|
8755
|
-
candidates:
|
|
8908
|
+
import_zod19.z.object({
|
|
8909
|
+
query: import_zod19.z.string(),
|
|
8910
|
+
scope: import_zod19.z.string(),
|
|
8911
|
+
count: import_zod19.z.number().int().min(0),
|
|
8912
|
+
candidates: import_zod19.z.array(osmdSearchCandidateSchema)
|
|
8756
8913
|
})
|
|
8757
8914
|
);
|
|
8758
|
-
var osmdWikiLintIssueSchema =
|
|
8915
|
+
var osmdWikiLintIssueSchema = import_zod19.z.preprocess(
|
|
8759
8916
|
normalizeAgentMarkdownJsonKeys,
|
|
8760
|
-
|
|
8761
|
-
code:
|
|
8762
|
-
severity:
|
|
8763
|
-
path:
|
|
8764
|
-
source:
|
|
8765
|
-
parentRef:
|
|
8766
|
-
message:
|
|
8767
|
-
suggestedAction:
|
|
8768
|
-
canAutoFix:
|
|
8917
|
+
import_zod19.z.object({
|
|
8918
|
+
code: import_zod19.z.string(),
|
|
8919
|
+
severity: import_zod19.z.string(),
|
|
8920
|
+
path: import_zod19.z.string(),
|
|
8921
|
+
source: import_zod19.z.string().nullable().optional(),
|
|
8922
|
+
parentRef: import_zod19.z.string().nullable().optional(),
|
|
8923
|
+
message: import_zod19.z.string(),
|
|
8924
|
+
suggestedAction: import_zod19.z.string().nullable().optional(),
|
|
8925
|
+
canAutoFix: import_zod19.z.boolean()
|
|
8769
8926
|
}).transform((value) => ({
|
|
8770
8927
|
...value,
|
|
8771
8928
|
source: value.source ?? null,
|
|
@@ -8773,37 +8930,37 @@ var osmdWikiLintIssueSchema = import_zod18.z.preprocess(
|
|
|
8773
8930
|
suggestedAction: value.suggestedAction ?? null
|
|
8774
8931
|
}))
|
|
8775
8932
|
);
|
|
8776
|
-
var osmdWikiLintResultSchema =
|
|
8933
|
+
var osmdWikiLintResultSchema = import_zod19.z.preprocess(
|
|
8777
8934
|
normalizeAgentMarkdownJsonKeys,
|
|
8778
|
-
|
|
8779
|
-
status:
|
|
8780
|
-
summary:
|
|
8781
|
-
totalIssues:
|
|
8782
|
-
errors:
|
|
8783
|
-
warnings:
|
|
8784
|
-
suggestions:
|
|
8935
|
+
import_zod19.z.object({
|
|
8936
|
+
status: import_zod19.z.string(),
|
|
8937
|
+
summary: import_zod19.z.object({
|
|
8938
|
+
totalIssues: import_zod19.z.number().int().min(0),
|
|
8939
|
+
errors: import_zod19.z.number().int().min(0),
|
|
8940
|
+
warnings: import_zod19.z.number().int().min(0),
|
|
8941
|
+
suggestions: import_zod19.z.number().int().min(0)
|
|
8785
8942
|
}),
|
|
8786
|
-
issues:
|
|
8943
|
+
issues: import_zod19.z.array(osmdWikiLintIssueSchema)
|
|
8787
8944
|
})
|
|
8788
8945
|
);
|
|
8789
|
-
var nullableCountSchema =
|
|
8946
|
+
var nullableCountSchema = import_zod19.z.preprocess(
|
|
8790
8947
|
(value) => value === void 0 || value === null || value === "" ? null : value,
|
|
8791
|
-
|
|
8948
|
+
import_zod19.z.coerce.number().int().min(0).nullable()
|
|
8792
8949
|
).catch(null);
|
|
8793
|
-
var osmdMemoryQualityIssueSchema =
|
|
8950
|
+
var osmdMemoryQualityIssueSchema = import_zod19.z.preprocess(
|
|
8794
8951
|
normalizeAgentMarkdownJsonKeys,
|
|
8795
|
-
|
|
8796
|
-
code:
|
|
8797
|
-
issueCode:
|
|
8798
|
-
path:
|
|
8799
|
-
parentRef:
|
|
8800
|
-
dimension:
|
|
8801
|
-
evidence:
|
|
8802
|
-
evidenceSnippet:
|
|
8803
|
-
message:
|
|
8804
|
-
severity:
|
|
8805
|
-
suggestedAction:
|
|
8806
|
-
canAutoFix:
|
|
8952
|
+
import_zod19.z.object({
|
|
8953
|
+
code: import_zod19.z.string().nullable().optional(),
|
|
8954
|
+
issueCode: import_zod19.z.string().nullable().optional(),
|
|
8955
|
+
path: import_zod19.z.string().nullable().optional(),
|
|
8956
|
+
parentRef: import_zod19.z.string().nullable().optional(),
|
|
8957
|
+
dimension: import_zod19.z.string().nullable().optional(),
|
|
8958
|
+
evidence: import_zod19.z.string().nullable().optional(),
|
|
8959
|
+
evidenceSnippet: import_zod19.z.string().nullable().optional(),
|
|
8960
|
+
message: import_zod19.z.string().nullable().optional(),
|
|
8961
|
+
severity: import_zod19.z.string().nullable().optional(),
|
|
8962
|
+
suggestedAction: import_zod19.z.string().nullable().optional(),
|
|
8963
|
+
canAutoFix: import_zod19.z.boolean().nullable().optional()
|
|
8807
8964
|
}).passthrough().transform((value) => ({
|
|
8808
8965
|
...value,
|
|
8809
8966
|
code: value.code ?? value.issueCode ?? "unknown_issue",
|
|
@@ -8818,16 +8975,16 @@ var osmdMemoryQualityIssueSchema = import_zod18.z.preprocess(
|
|
|
8818
8975
|
canAutoFix: value.canAutoFix === true ? true : false
|
|
8819
8976
|
}))
|
|
8820
8977
|
);
|
|
8821
|
-
var osmdMemoryQualityOverlaySchema =
|
|
8978
|
+
var osmdMemoryQualityOverlaySchema = import_zod19.z.preprocess(
|
|
8822
8979
|
normalizeAgentMarkdownJsonKeys,
|
|
8823
|
-
|
|
8824
|
-
path:
|
|
8825
|
-
parentRef:
|
|
8826
|
-
status:
|
|
8827
|
-
score:
|
|
8828
|
-
overallScore:
|
|
8829
|
-
dimensions:
|
|
8830
|
-
issues:
|
|
8980
|
+
import_zod19.z.object({
|
|
8981
|
+
path: import_zod19.z.string().nullable().optional(),
|
|
8982
|
+
parentRef: import_zod19.z.string().nullable().optional(),
|
|
8983
|
+
status: import_zod19.z.string().nullable().optional(),
|
|
8984
|
+
score: import_zod19.z.union([import_zod19.z.number(), import_zod19.z.string()]).nullable().optional(),
|
|
8985
|
+
overallScore: import_zod19.z.union([import_zod19.z.number(), import_zod19.z.string()]).nullable().optional(),
|
|
8986
|
+
dimensions: import_zod19.z.unknown().nullable().optional(),
|
|
8987
|
+
issues: import_zod19.z.array(osmdMemoryQualityIssueSchema).optional()
|
|
8831
8988
|
}).passthrough().transform((value) => ({
|
|
8832
8989
|
...value,
|
|
8833
8990
|
path: value.path ?? null,
|
|
@@ -8839,9 +8996,9 @@ var osmdMemoryQualityOverlaySchema = import_zod18.z.preprocess(
|
|
|
8839
8996
|
issues: value.issues ?? []
|
|
8840
8997
|
}))
|
|
8841
8998
|
);
|
|
8842
|
-
var osmdMemoryQualitySummarySchema =
|
|
8999
|
+
var osmdMemoryQualitySummarySchema = import_zod19.z.preprocess(
|
|
8843
9000
|
normalizeAgentMarkdownJsonKeys,
|
|
8844
|
-
|
|
9001
|
+
import_zod19.z.object({
|
|
8845
9002
|
evaluatedCount: nullableCountSchema.optional(),
|
|
8846
9003
|
passCount: nullableCountSchema.optional(),
|
|
8847
9004
|
warnCount: nullableCountSchema.optional(),
|
|
@@ -8859,19 +9016,19 @@ var osmdMemoryQualitySummarySchema = import_zod18.z.preprocess(
|
|
|
8859
9016
|
failCount: value.failCount ?? value.failures ?? null
|
|
8860
9017
|
}))
|
|
8861
9018
|
);
|
|
8862
|
-
var osmdMemoryQualityResultSchema =
|
|
9019
|
+
var osmdMemoryQualityResultSchema = import_zod19.z.preprocess(
|
|
8863
9020
|
normalizeAgentMarkdownJsonKeys,
|
|
8864
|
-
|
|
8865
|
-
status:
|
|
8866
|
-
scope:
|
|
9021
|
+
import_zod19.z.object({
|
|
9022
|
+
status: import_zod19.z.string(),
|
|
9023
|
+
scope: import_zod19.z.string().nullable().optional(),
|
|
8867
9024
|
evaluatedCount: nullableCountSchema.optional(),
|
|
8868
9025
|
passCount: nullableCountSchema.optional(),
|
|
8869
9026
|
warnCount: nullableCountSchema.optional(),
|
|
8870
9027
|
failCount: nullableCountSchema.optional(),
|
|
8871
9028
|
summary: osmdMemoryQualitySummarySchema.optional(),
|
|
8872
|
-
weakestOverlays:
|
|
8873
|
-
issues:
|
|
8874
|
-
scores:
|
|
9029
|
+
weakestOverlays: import_zod19.z.array(osmdMemoryQualityOverlaySchema).optional(),
|
|
9030
|
+
issues: import_zod19.z.array(osmdMemoryQualityIssueSchema).optional(),
|
|
9031
|
+
scores: import_zod19.z.array(osmdMemoryQualityOverlaySchema).optional()
|
|
8875
9032
|
}).passthrough().transform((value) => {
|
|
8876
9033
|
const summary = isRecord5(value.summary) ? value.summary : null;
|
|
8877
9034
|
return {
|
|
@@ -8895,24 +9052,24 @@ function normalizeOsmdIngestFileRecordInput(value) {
|
|
|
8895
9052
|
}
|
|
8896
9053
|
return normalized;
|
|
8897
9054
|
}
|
|
8898
|
-
var osmdIngestFileRecordSchema =
|
|
9055
|
+
var osmdIngestFileRecordSchema = import_zod19.z.preprocess(
|
|
8899
9056
|
normalizeOsmdIngestFileRecordInput,
|
|
8900
|
-
|
|
8901
|
-
path:
|
|
8902
|
-
source:
|
|
8903
|
-
access:
|
|
8904
|
-
owner:
|
|
8905
|
-
parentRef:
|
|
8906
|
-
exists:
|
|
8907
|
-
canCreate:
|
|
8908
|
-
canUpdate:
|
|
8909
|
-
canAppend:
|
|
8910
|
-
wikiRole:
|
|
8911
|
-
formatVersion:
|
|
8912
|
-
createdAt:
|
|
8913
|
-
updatedAt:
|
|
8914
|
-
suggestedAction:
|
|
8915
|
-
errorCode:
|
|
9057
|
+
import_zod19.z.object({
|
|
9058
|
+
path: import_zod19.z.string(),
|
|
9059
|
+
source: import_zod19.z.string().nullable().optional(),
|
|
9060
|
+
access: import_zod19.z.string().nullable().optional(),
|
|
9061
|
+
owner: import_zod19.z.string().nullable().optional(),
|
|
9062
|
+
parentRef: import_zod19.z.string().nullable().optional(),
|
|
9063
|
+
exists: import_zod19.z.boolean().nullable().optional(),
|
|
9064
|
+
canCreate: import_zod19.z.boolean().nullable().optional(),
|
|
9065
|
+
canUpdate: import_zod19.z.boolean().nullable().optional(),
|
|
9066
|
+
canAppend: import_zod19.z.boolean().nullable().optional(),
|
|
9067
|
+
wikiRole: import_zod19.z.string().nullable().optional(),
|
|
9068
|
+
formatVersion: import_zod19.z.string().nullable().optional(),
|
|
9069
|
+
createdAt: import_zod19.z.string().nullable().optional(),
|
|
9070
|
+
updatedAt: import_zod19.z.string().nullable().optional(),
|
|
9071
|
+
suggestedAction: import_zod19.z.string().nullable().optional(),
|
|
9072
|
+
errorCode: import_zod19.z.string().nullable().optional()
|
|
8916
9073
|
}).passthrough().transform((value) => ({
|
|
8917
9074
|
...value,
|
|
8918
9075
|
source: value.source ?? null,
|
|
@@ -8931,17 +9088,17 @@ var osmdIngestFileRecordSchema = import_zod18.z.preprocess(
|
|
|
8931
9088
|
errorCode: value.errorCode ?? null
|
|
8932
9089
|
}))
|
|
8933
9090
|
);
|
|
8934
|
-
var osmdIngestResultSchema =
|
|
9091
|
+
var osmdIngestResultSchema = import_zod19.z.preprocess(
|
|
8935
9092
|
normalizeAgentMarkdownJsonKeys,
|
|
8936
|
-
|
|
8937
|
-
rawSourceId:
|
|
8938
|
-
sourceSummaryPath:
|
|
9093
|
+
import_zod19.z.object({
|
|
9094
|
+
rawSourceId: import_zod19.z.union([import_zod19.z.string(), import_zod19.z.number()]).nullable().optional(),
|
|
9095
|
+
sourceSummaryPath: import_zod19.z.string().nullable().optional(),
|
|
8939
9096
|
sourceSummaryFile: osmdIngestFileRecordSchema.nullable().optional(),
|
|
8940
|
-
slug:
|
|
8941
|
-
runLint:
|
|
8942
|
-
createdFiles:
|
|
8943
|
-
updatedFiles:
|
|
8944
|
-
skippedUpdates:
|
|
9097
|
+
slug: import_zod19.z.string().nullable().optional(),
|
|
9098
|
+
runLint: import_zod19.z.boolean().nullable().optional(),
|
|
9099
|
+
createdFiles: import_zod19.z.array(osmdIngestFileRecordSchema).optional(),
|
|
9100
|
+
updatedFiles: import_zod19.z.array(osmdIngestFileRecordSchema).optional(),
|
|
9101
|
+
skippedUpdates: import_zod19.z.array(import_zod19.z.unknown()).optional(),
|
|
8945
9102
|
lintResult: osmdWikiLintResultSchema.nullable().optional()
|
|
8946
9103
|
}).passthrough().transform((value) => ({
|
|
8947
9104
|
...value,
|
|
@@ -8956,37 +9113,37 @@ var osmdIngestResultSchema = import_zod18.z.preprocess(
|
|
|
8956
9113
|
lintResult: value.lintResult ?? null
|
|
8957
9114
|
}))
|
|
8958
9115
|
);
|
|
8959
|
-
var mutationPayloadSchema =
|
|
8960
|
-
ok:
|
|
8961
|
-
status:
|
|
8962
|
-
errorCode:
|
|
8963
|
-
data:
|
|
8964
|
-
errors:
|
|
9116
|
+
var mutationPayloadSchema = import_zod19.z.object({
|
|
9117
|
+
ok: import_zod19.z.boolean(),
|
|
9118
|
+
status: import_zod19.z.number(),
|
|
9119
|
+
errorCode: import_zod19.z.string().nullable().optional(),
|
|
9120
|
+
data: import_zod19.z.unknown().nullable().optional(),
|
|
9121
|
+
errors: import_zod19.z.unknown().nullable().optional()
|
|
8965
9122
|
});
|
|
8966
|
-
var markdownTreeNodeSchema =
|
|
8967
|
-
() =>
|
|
8968
|
-
toolKey:
|
|
8969
|
-
nodeKey:
|
|
8970
|
-
nodeKind:
|
|
8971
|
-
runtimeLabel:
|
|
8972
|
-
path:
|
|
9123
|
+
var markdownTreeNodeSchema = import_zod19.z.lazy(
|
|
9124
|
+
() => import_zod19.z.object({
|
|
9125
|
+
toolKey: import_zod19.z.string(),
|
|
9126
|
+
nodeKey: import_zod19.z.string(),
|
|
9127
|
+
nodeKind: import_zod19.z.string(),
|
|
9128
|
+
runtimeLabel: import_zod19.z.string(),
|
|
9129
|
+
path: import_zod19.z.string().nullable().optional().transform((value) => value ?? null),
|
|
8973
9130
|
source: sourceSchema,
|
|
8974
9131
|
access: accessSchema,
|
|
8975
9132
|
owner: ownerSchema,
|
|
8976
|
-
parentRef:
|
|
8977
|
-
agentChildrenAllowed:
|
|
8978
|
-
exists:
|
|
8979
|
-
resolvedScope:
|
|
8980
|
-
parentId:
|
|
8981
|
-
recordId:
|
|
8982
|
-
memberId:
|
|
8983
|
-
teamId:
|
|
8984
|
-
contentType:
|
|
9133
|
+
parentRef: import_zod19.z.string().nullable().optional().transform((value) => value ?? null),
|
|
9134
|
+
agentChildrenAllowed: import_zod19.z.boolean(),
|
|
9135
|
+
exists: import_zod19.z.boolean(),
|
|
9136
|
+
resolvedScope: import_zod19.z.object({
|
|
9137
|
+
parentId: import_zod19.z.string().nullable().optional().transform((value) => value ?? null),
|
|
9138
|
+
recordId: import_zod19.z.string().nullable().optional().transform((value) => value ?? null),
|
|
9139
|
+
memberId: import_zod19.z.string().nullable().optional().transform((value) => value ?? null),
|
|
9140
|
+
teamId: import_zod19.z.string().nullable().optional().transform((value) => value ?? null),
|
|
9141
|
+
contentType: import_zod19.z.string().nullable().optional().transform((value) => value ?? null)
|
|
8985
9142
|
}),
|
|
8986
|
-
isLeaf:
|
|
8987
|
-
treeView:
|
|
8988
|
-
details:
|
|
8989
|
-
children:
|
|
9143
|
+
isLeaf: import_zod19.z.boolean(),
|
|
9144
|
+
treeView: import_zod19.z.boolean(),
|
|
9145
|
+
details: import_zod19.z.unknown().nullable(),
|
|
9146
|
+
children: import_zod19.z.array(markdownTreeNodeSchema).optional().transform((value) => value ?? [])
|
|
8990
9147
|
})
|
|
8991
9148
|
);
|
|
8992
9149
|
var AGENT_MARKDOWN_FILE_SELECTION = `{
|
|
@@ -9011,6 +9168,13 @@ var AGENT_MARKDOWN_FILE_SELECTION = `{
|
|
|
9011
9168
|
errorCode
|
|
9012
9169
|
content
|
|
9013
9170
|
url
|
|
9171
|
+
workspaceId
|
|
9172
|
+
fileId
|
|
9173
|
+
name
|
|
9174
|
+
displayName
|
|
9175
|
+
contentSha
|
|
9176
|
+
versionSha
|
|
9177
|
+
mediaType
|
|
9014
9178
|
}`;
|
|
9015
9179
|
var OSMD_SEARCH_SELECTION = `{
|
|
9016
9180
|
query
|
|
@@ -9666,21 +9830,24 @@ async function runOsmdIngestFlow(params) {
|
|
|
9666
9830
|
})
|
|
9667
9831
|
});
|
|
9668
9832
|
}
|
|
9669
|
-
|
|
9833
|
+
var atlasThreadWorkspaceParentRefPattern = /^Atlas Workspace\/ATL-[A-Z0-9][A-Z0-9-]*$/;
|
|
9834
|
+
function normalizeAgentFilePath(file, parentRef) {
|
|
9670
9835
|
const trimmed = nonEmptyString3.parse(file).trim().replace(/^\/+|\/+$/g, "");
|
|
9671
9836
|
const fileName = trimmed.startsWith(".agent/") ? trimmed.slice(".agent/".length) : trimmed;
|
|
9672
|
-
|
|
9837
|
+
const isThreadWorkspace = atlasThreadWorkspaceParentRefPattern.test(parentRef);
|
|
9838
|
+
const isSupportedFile = isThreadWorkspace ? /^[a-z0-9][a-z0-9-]*\.(?:md|txt)$/.test(fileName) : isSupportedAgentOverlayFileName(fileName);
|
|
9839
|
+
if (fileName.includes("\\") || fileName.includes("/") || fileName === "." || fileName === ".." || !isSupportedFile) {
|
|
9673
9840
|
throw new CliError({
|
|
9674
|
-
message: ".agent supports only notes.md, summary.md, or <lowercase-kebab-slug>.md.",
|
|
9841
|
+
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.",
|
|
9675
9842
|
kind: "invalid_args",
|
|
9676
9843
|
status: 400,
|
|
9677
9844
|
exitCode: EXIT_CODES.invalidArgs,
|
|
9678
9845
|
details: {
|
|
9679
|
-
supportedFiles: [...supportedAgentOverlaySystemFiles, "<lowercase-kebab-slug>.md"]
|
|
9846
|
+
supportedFiles: isThreadWorkspace ? ["<lowercase-kebab-slug>.md", "<lowercase-kebab-slug>.txt"] : [...supportedAgentOverlaySystemFiles, "<lowercase-kebab-slug>.md"]
|
|
9680
9847
|
}
|
|
9681
9848
|
});
|
|
9682
9849
|
}
|
|
9683
|
-
return `.agent/${fileName}`;
|
|
9850
|
+
return isThreadWorkspace ? fileName : `.agent/${fileName}`;
|
|
9684
9851
|
}
|
|
9685
9852
|
function formatHumanList(items) {
|
|
9686
9853
|
if (items.length <= 1) {
|
|
@@ -10907,12 +11074,13 @@ function registerOsmdCommands(program) {
|
|
|
10907
11074
|
const agent = osmd.command("agent").description(".agent markdown attached to canonical OSMD parents");
|
|
10908
11075
|
agent.command("status <parent-ref> <file>").description("Show .agent file metadata without creating files").action(async (parentRef, file, _opts, cmd) => {
|
|
10909
11076
|
const { organizationId, runtimeOptions } = await resolveOsmdContext(cmd);
|
|
11077
|
+
const normalizedParentRef = nonEmptyString3.parse(parentRef).trim();
|
|
10910
11078
|
const result = await requestAgentMarkdownStatus({
|
|
10911
11079
|
command: "osmd.agent.status",
|
|
10912
11080
|
runtimeOptions,
|
|
10913
11081
|
organizationId,
|
|
10914
|
-
path: normalizeAgentFilePath(file),
|
|
10915
|
-
parentRef:
|
|
11082
|
+
path: normalizeAgentFilePath(file, normalizedParentRef),
|
|
11083
|
+
parentRef: normalizedParentRef
|
|
10916
11084
|
});
|
|
10917
11085
|
return printEnvelopeAndExit({
|
|
10918
11086
|
envelope: buildSuccessEnvelope({
|
|
@@ -10939,12 +11107,13 @@ function registerOsmdCommands(program) {
|
|
|
10939
11107
|
});
|
|
10940
11108
|
agent.command("read <parent-ref> <file>").description("Read a .agent file without creating files").action(async (parentRef, file, _opts, cmd) => {
|
|
10941
11109
|
const { organizationId, runtimeOptions } = await resolveOsmdContext(cmd);
|
|
11110
|
+
const normalizedParentRef = nonEmptyString3.parse(parentRef).trim();
|
|
10942
11111
|
const result = await requestAgentMarkdownFile({
|
|
10943
11112
|
command: "osmd.agent.read",
|
|
10944
11113
|
runtimeOptions,
|
|
10945
11114
|
organizationId,
|
|
10946
|
-
path: normalizeAgentFilePath(file),
|
|
10947
|
-
parentRef:
|
|
11115
|
+
path: normalizeAgentFilePath(file, normalizedParentRef),
|
|
11116
|
+
parentRef: normalizedParentRef
|
|
10948
11117
|
});
|
|
10949
11118
|
return printEnvelopeAndExit({
|
|
10950
11119
|
envelope: buildSuccessEnvelope({
|
|
@@ -10962,13 +11131,14 @@ function registerOsmdCommands(program) {
|
|
|
10962
11131
|
const globals = cmd.optsWithGlobals();
|
|
10963
11132
|
const content = await resolveContentInput(opts, globals);
|
|
10964
11133
|
const { organizationId, runtimeOptions } = await resolveOsmdContext(cmd);
|
|
11134
|
+
const normalizedParentRef = nonEmptyString3.parse(parentRef).trim();
|
|
10965
11135
|
return runWriteFlow({
|
|
10966
11136
|
command: "osmd.agent.create",
|
|
10967
11137
|
action: "create",
|
|
10968
11138
|
runtimeOptions,
|
|
10969
11139
|
organizationId,
|
|
10970
|
-
path: normalizeAgentFilePath(file),
|
|
10971
|
-
parentRef:
|
|
11140
|
+
path: normalizeAgentFilePath(file, normalizedParentRef),
|
|
11141
|
+
parentRef: normalizedParentRef,
|
|
10972
11142
|
content
|
|
10973
11143
|
});
|
|
10974
11144
|
}
|
|
@@ -10980,13 +11150,14 @@ function registerOsmdCommands(program) {
|
|
|
10980
11150
|
const globals = cmd.optsWithGlobals();
|
|
10981
11151
|
const content = await resolveContentInput(opts, globals);
|
|
10982
11152
|
const { organizationId, runtimeOptions } = await resolveOsmdContext(cmd);
|
|
11153
|
+
const normalizedParentRef = nonEmptyString3.parse(parentRef).trim();
|
|
10983
11154
|
return runWriteFlow({
|
|
10984
11155
|
command: "osmd.agent.update",
|
|
10985
11156
|
action: "update",
|
|
10986
11157
|
runtimeOptions,
|
|
10987
11158
|
organizationId,
|
|
10988
|
-
path: normalizeAgentFilePath(file),
|
|
10989
|
-
parentRef:
|
|
11159
|
+
path: normalizeAgentFilePath(file, normalizedParentRef),
|
|
11160
|
+
parentRef: normalizedParentRef,
|
|
10990
11161
|
content
|
|
10991
11162
|
});
|
|
10992
11163
|
}
|
|
@@ -13899,14 +14070,14 @@ function registerMailCommands(program) {
|
|
|
13899
14070
|
}
|
|
13900
14071
|
|
|
13901
14072
|
// src/commands/phantom.ts
|
|
13902
|
-
var
|
|
13903
|
-
var nonNegativeInt4 =
|
|
13904
|
-
var nullableString =
|
|
13905
|
-
var idString =
|
|
13906
|
-
var nullableIdString =
|
|
14073
|
+
var import_zod20 = require("zod");
|
|
14074
|
+
var nonNegativeInt4 = import_zod20.z.coerce.number().int().min(0);
|
|
14075
|
+
var nullableString = import_zod20.z.string().nullable().optional().transform((value) => value ?? null);
|
|
14076
|
+
var idString = import_zod20.z.union([import_zod20.z.string(), import_zod20.z.number()]).transform((value) => String(value));
|
|
14077
|
+
var nullableIdString = import_zod20.z.union([import_zod20.z.string(), import_zod20.z.number()]).nullable().optional().transform(
|
|
13907
14078
|
(value) => value === void 0 || value === null ? null : String(value)
|
|
13908
14079
|
);
|
|
13909
|
-
var jsonObject =
|
|
14080
|
+
var jsonObject = import_zod20.z.record(import_zod20.z.string(), import_zod20.z.unknown());
|
|
13910
14081
|
var PHANTOM_LEDGER_INVENTORY_SELECTION = `{
|
|
13911
14082
|
schemaVersion
|
|
13912
14083
|
runsCount
|
|
@@ -14119,10 +14290,10 @@ var PHANTOM_LEDGER_KEY_ALIASES = {
|
|
|
14119
14290
|
content_hash: "contentHash",
|
|
14120
14291
|
observed_at: "observedAt"
|
|
14121
14292
|
};
|
|
14122
|
-
var phantomLedgerInventorySchema =
|
|
14293
|
+
var phantomLedgerInventorySchema = import_zod20.z.preprocess(
|
|
14123
14294
|
normalizePhantomLedgerKeys,
|
|
14124
|
-
|
|
14125
|
-
schemaVersion:
|
|
14295
|
+
import_zod20.z.object({
|
|
14296
|
+
schemaVersion: import_zod20.z.string(),
|
|
14126
14297
|
runsCount: nonNegativeInt4,
|
|
14127
14298
|
observationsCount: nonNegativeInt4,
|
|
14128
14299
|
candidatesCount: nonNegativeInt4,
|
|
@@ -14132,16 +14303,16 @@ var phantomLedgerInventorySchema = import_zod19.z.preprocess(
|
|
|
14132
14303
|
reportsCount: nonNegativeInt4
|
|
14133
14304
|
})
|
|
14134
14305
|
);
|
|
14135
|
-
var phantomRunSchema =
|
|
14306
|
+
var phantomRunSchema = import_zod20.z.preprocess(
|
|
14136
14307
|
normalizePhantomLedgerKeys,
|
|
14137
|
-
|
|
14308
|
+
import_zod20.z.object({
|
|
14138
14309
|
id: idString,
|
|
14139
14310
|
organizationId: idString,
|
|
14140
|
-
notificationId:
|
|
14311
|
+
notificationId: import_zod20.z.union([import_zod20.z.string(), import_zod20.z.number()]).nullable().optional().transform(
|
|
14141
14312
|
(value) => value === void 0 || value === null ? null : String(value)
|
|
14142
14313
|
),
|
|
14143
|
-
status:
|
|
14144
|
-
triggerType:
|
|
14314
|
+
status: import_zod20.z.string(),
|
|
14315
|
+
triggerType: import_zod20.z.string(),
|
|
14145
14316
|
startedAt: nullableString,
|
|
14146
14317
|
completedAt: nullableString,
|
|
14147
14318
|
scannedFileCount: nonNegativeInt4,
|
|
@@ -14151,163 +14322,163 @@ var phantomRunSchema = import_zod19.z.preprocess(
|
|
|
14151
14322
|
errorCount: nonNegativeInt4,
|
|
14152
14323
|
warningCount: nonNegativeInt4,
|
|
14153
14324
|
errorMessage: nullableString,
|
|
14154
|
-
dryRun:
|
|
14155
|
-
schemaVersion:
|
|
14325
|
+
dryRun: import_zod20.z.boolean(),
|
|
14326
|
+
schemaVersion: import_zod20.z.string(),
|
|
14156
14327
|
testRunId: nullableString,
|
|
14157
14328
|
idempotencyKey: nullableString,
|
|
14158
14329
|
ledgerMetadata: jsonObject.catch({}),
|
|
14159
|
-
createdAt:
|
|
14160
|
-
updatedAt:
|
|
14330
|
+
createdAt: import_zod20.z.string(),
|
|
14331
|
+
updatedAt: import_zod20.z.string()
|
|
14161
14332
|
})
|
|
14162
14333
|
);
|
|
14163
|
-
var phantomRunListItemSchema =
|
|
14334
|
+
var phantomRunListItemSchema = import_zod20.z.preprocess(
|
|
14164
14335
|
normalizePhantomLedgerKeys,
|
|
14165
|
-
|
|
14336
|
+
import_zod20.z.object({
|
|
14166
14337
|
id: idString,
|
|
14167
14338
|
organizationId: idString,
|
|
14168
|
-
status:
|
|
14169
|
-
triggerType:
|
|
14170
|
-
dryRun:
|
|
14171
|
-
schemaVersion:
|
|
14339
|
+
status: import_zod20.z.string(),
|
|
14340
|
+
triggerType: import_zod20.z.string(),
|
|
14341
|
+
dryRun: import_zod20.z.boolean(),
|
|
14342
|
+
schemaVersion: import_zod20.z.string(),
|
|
14172
14343
|
testRunId: nullableString,
|
|
14173
|
-
createdAt:
|
|
14174
|
-
updatedAt:
|
|
14344
|
+
createdAt: import_zod20.z.string(),
|
|
14345
|
+
updatedAt: import_zod20.z.string()
|
|
14175
14346
|
})
|
|
14176
14347
|
);
|
|
14177
|
-
var phantomReportSchema =
|
|
14348
|
+
var phantomReportSchema = import_zod20.z.preprocess(
|
|
14178
14349
|
normalizePhantomLedgerKeys,
|
|
14179
|
-
|
|
14350
|
+
import_zod20.z.object({
|
|
14180
14351
|
id: idString,
|
|
14181
14352
|
organizationId: idString,
|
|
14182
14353
|
phantomRunId: idString,
|
|
14183
|
-
status:
|
|
14184
|
-
reportType:
|
|
14185
|
-
schemaVersion:
|
|
14354
|
+
status: import_zod20.z.string(),
|
|
14355
|
+
reportType: import_zod20.z.string(),
|
|
14356
|
+
schemaVersion: import_zod20.z.string(),
|
|
14186
14357
|
markdownPath: nullableString,
|
|
14187
14358
|
payload: jsonObject.catch({}),
|
|
14188
14359
|
testRunId: nullableString,
|
|
14189
|
-
idempotencyKey:
|
|
14190
|
-
createdAt:
|
|
14191
|
-
updatedAt:
|
|
14360
|
+
idempotencyKey: import_zod20.z.string(),
|
|
14361
|
+
createdAt: import_zod20.z.string(),
|
|
14362
|
+
updatedAt: import_zod20.z.string()
|
|
14192
14363
|
})
|
|
14193
14364
|
);
|
|
14194
|
-
var phantomObservationSchema =
|
|
14365
|
+
var phantomObservationSchema = import_zod20.z.preprocess(
|
|
14195
14366
|
normalizePhantomLedgerKeys,
|
|
14196
|
-
|
|
14367
|
+
import_zod20.z.object({
|
|
14197
14368
|
id: idString,
|
|
14198
14369
|
organizationId: idString,
|
|
14199
14370
|
phantomRunId: idString,
|
|
14200
|
-
status:
|
|
14201
|
-
observationType:
|
|
14371
|
+
status: import_zod20.z.string(),
|
|
14372
|
+
observationType: import_zod20.z.string(),
|
|
14202
14373
|
targetType: nullableString,
|
|
14203
14374
|
targetId: nullableString,
|
|
14204
14375
|
sourceTable: nullableString,
|
|
14205
14376
|
sourceRecordId: nullableString,
|
|
14206
14377
|
sourceEventId: nullableString,
|
|
14207
14378
|
contentHash: nullableString,
|
|
14208
|
-
observedAt:
|
|
14209
|
-
confidence:
|
|
14379
|
+
observedAt: import_zod20.z.string(),
|
|
14380
|
+
confidence: import_zod20.z.coerce.number(),
|
|
14210
14381
|
payload: jsonObject.catch({}),
|
|
14211
|
-
schemaVersion:
|
|
14382
|
+
schemaVersion: import_zod20.z.string(),
|
|
14212
14383
|
testRunId: nullableString,
|
|
14213
|
-
idempotencyKey:
|
|
14214
|
-
createdAt:
|
|
14215
|
-
updatedAt:
|
|
14384
|
+
idempotencyKey: import_zod20.z.string(),
|
|
14385
|
+
createdAt: import_zod20.z.string(),
|
|
14386
|
+
updatedAt: import_zod20.z.string()
|
|
14216
14387
|
})
|
|
14217
14388
|
);
|
|
14218
|
-
var phantomCandidateSchema =
|
|
14389
|
+
var phantomCandidateSchema = import_zod20.z.preprocess(
|
|
14219
14390
|
normalizePhantomLedgerKeys,
|
|
14220
|
-
|
|
14391
|
+
import_zod20.z.object({
|
|
14221
14392
|
id: idString,
|
|
14222
14393
|
organizationId: idString,
|
|
14223
14394
|
phantomRunId: idString,
|
|
14224
14395
|
phantomObservationId: nullableString,
|
|
14225
|
-
status:
|
|
14226
|
-
candidateType:
|
|
14396
|
+
status: import_zod20.z.string(),
|
|
14397
|
+
candidateType: import_zod20.z.string(),
|
|
14227
14398
|
targetType: nullableString,
|
|
14228
14399
|
targetId: nullableString,
|
|
14229
14400
|
title: nullableString,
|
|
14230
|
-
dryRun:
|
|
14401
|
+
dryRun: import_zod20.z.boolean(),
|
|
14231
14402
|
payload: jsonObject.catch({}),
|
|
14232
|
-
approvalStatus:
|
|
14403
|
+
approvalStatus: import_zod20.z.string(),
|
|
14233
14404
|
approvedById: nullableIdString,
|
|
14234
14405
|
approvedAt: nullableString,
|
|
14235
14406
|
approvalSource: nullableString,
|
|
14236
14407
|
approvalReason: nullableString,
|
|
14237
14408
|
approvalMetadata: jsonObject.catch({}),
|
|
14238
|
-
schemaVersion:
|
|
14409
|
+
schemaVersion: import_zod20.z.string(),
|
|
14239
14410
|
testRunId: nullableString,
|
|
14240
|
-
idempotencyKey:
|
|
14241
|
-
createdAt:
|
|
14242
|
-
updatedAt:
|
|
14411
|
+
idempotencyKey: import_zod20.z.string(),
|
|
14412
|
+
createdAt: import_zod20.z.string(),
|
|
14413
|
+
updatedAt: import_zod20.z.string()
|
|
14243
14414
|
})
|
|
14244
14415
|
);
|
|
14245
|
-
var phantomCandidateEvidenceSchema =
|
|
14416
|
+
var phantomCandidateEvidenceSchema = import_zod20.z.preprocess(
|
|
14246
14417
|
normalizePhantomLedgerKeys,
|
|
14247
|
-
|
|
14418
|
+
import_zod20.z.object({
|
|
14248
14419
|
id: idString,
|
|
14249
14420
|
organizationId: idString,
|
|
14250
14421
|
phantomCandidateId: idString,
|
|
14251
14422
|
phantomObservationId: nullableString,
|
|
14252
|
-
evidenceType:
|
|
14423
|
+
evidenceType: import_zod20.z.string(),
|
|
14253
14424
|
sourceType: nullableString,
|
|
14254
14425
|
sourceId: nullableString,
|
|
14255
14426
|
contentHash: nullableString,
|
|
14256
14427
|
payload: jsonObject.catch({}),
|
|
14257
|
-
schemaVersion:
|
|
14428
|
+
schemaVersion: import_zod20.z.string(),
|
|
14258
14429
|
testRunId: nullableString,
|
|
14259
|
-
idempotencyKey:
|
|
14260
|
-
createdAt:
|
|
14261
|
-
updatedAt:
|
|
14430
|
+
idempotencyKey: import_zod20.z.string(),
|
|
14431
|
+
createdAt: import_zod20.z.string(),
|
|
14432
|
+
updatedAt: import_zod20.z.string()
|
|
14262
14433
|
})
|
|
14263
14434
|
);
|
|
14264
|
-
var phantomValidationSchema =
|
|
14435
|
+
var phantomValidationSchema = import_zod20.z.preprocess(
|
|
14265
14436
|
normalizePhantomLedgerKeys,
|
|
14266
|
-
|
|
14437
|
+
import_zod20.z.object({
|
|
14267
14438
|
id: idString,
|
|
14268
14439
|
organizationId: idString,
|
|
14269
14440
|
phantomRunId: idString,
|
|
14270
14441
|
phantomCandidateId: idString,
|
|
14271
|
-
status:
|
|
14272
|
-
validationType:
|
|
14273
|
-
dryRun:
|
|
14442
|
+
status: import_zod20.z.string(),
|
|
14443
|
+
validationType: import_zod20.z.string(),
|
|
14444
|
+
dryRun: import_zod20.z.boolean(),
|
|
14274
14445
|
payload: jsonObject.catch({}),
|
|
14275
14446
|
resultPayload: jsonObject.catch({}),
|
|
14276
|
-
schemaVersion:
|
|
14447
|
+
schemaVersion: import_zod20.z.string(),
|
|
14277
14448
|
testRunId: nullableString,
|
|
14278
|
-
idempotencyKey:
|
|
14279
|
-
createdAt:
|
|
14280
|
-
updatedAt:
|
|
14449
|
+
idempotencyKey: import_zod20.z.string(),
|
|
14450
|
+
createdAt: import_zod20.z.string(),
|
|
14451
|
+
updatedAt: import_zod20.z.string()
|
|
14281
14452
|
})
|
|
14282
14453
|
);
|
|
14283
|
-
var phantomApplyOperationSchema =
|
|
14454
|
+
var phantomApplyOperationSchema = import_zod20.z.preprocess(
|
|
14284
14455
|
normalizePhantomLedgerKeys,
|
|
14285
|
-
|
|
14456
|
+
import_zod20.z.object({
|
|
14286
14457
|
id: idString,
|
|
14287
14458
|
organizationId: idString,
|
|
14288
14459
|
phantomRunId: idString,
|
|
14289
14460
|
phantomCandidateId: idString,
|
|
14290
|
-
status:
|
|
14291
|
-
operationType:
|
|
14292
|
-
dryRun:
|
|
14461
|
+
status: import_zod20.z.string(),
|
|
14462
|
+
operationType: import_zod20.z.string(),
|
|
14463
|
+
dryRun: import_zod20.z.boolean(),
|
|
14293
14464
|
targetType: nullableString,
|
|
14294
14465
|
targetId: nullableString,
|
|
14295
14466
|
payload: jsonObject.catch({}),
|
|
14296
14467
|
resultPayload: jsonObject.catch({}),
|
|
14297
|
-
schemaVersion:
|
|
14468
|
+
schemaVersion: import_zod20.z.string(),
|
|
14298
14469
|
testRunId: nullableString,
|
|
14299
|
-
idempotencyKey:
|
|
14300
|
-
createdAt:
|
|
14301
|
-
updatedAt:
|
|
14470
|
+
idempotencyKey: import_zod20.z.string(),
|
|
14471
|
+
createdAt: import_zod20.z.string(),
|
|
14472
|
+
updatedAt: import_zod20.z.string()
|
|
14302
14473
|
})
|
|
14303
14474
|
);
|
|
14304
|
-
var phantomRunsSchema =
|
|
14305
|
-
var phantomReportsSchema =
|
|
14306
|
-
var phantomObservationsSchema =
|
|
14307
|
-
var phantomCandidatesSchema =
|
|
14308
|
-
var phantomCandidateEvidencesSchema =
|
|
14309
|
-
var phantomValidationsSchema =
|
|
14310
|
-
var phantomApplyOperationsSchema =
|
|
14475
|
+
var phantomRunsSchema = import_zod20.z.array(phantomRunListItemSchema);
|
|
14476
|
+
var phantomReportsSchema = import_zod20.z.array(phantomReportSchema);
|
|
14477
|
+
var phantomObservationsSchema = import_zod20.z.array(phantomObservationSchema);
|
|
14478
|
+
var phantomCandidatesSchema = import_zod20.z.array(phantomCandidateSchema);
|
|
14479
|
+
var phantomCandidateEvidencesSchema = import_zod20.z.array(phantomCandidateEvidenceSchema);
|
|
14480
|
+
var phantomValidationsSchema = import_zod20.z.array(phantomValidationSchema);
|
|
14481
|
+
var phantomApplyOperationsSchema = import_zod20.z.array(phantomApplyOperationSchema);
|
|
14311
14482
|
function isRecord6(value) {
|
|
14312
14483
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
14313
14484
|
}
|
|
@@ -16236,72 +16407,72 @@ function registerSignatureCommands(program) {
|
|
|
16236
16407
|
}
|
|
16237
16408
|
|
|
16238
16409
|
// src/commands/atlasAuthoring.ts
|
|
16239
|
-
var
|
|
16240
|
-
var idSchema15 =
|
|
16241
|
-
var idempotencyKeySchema =
|
|
16242
|
-
var skillScopeSchema =
|
|
16243
|
-
var isoDateSchema =
|
|
16244
|
-
var nonEmptyStringSchema =
|
|
16410
|
+
var import_zod21 = require("zod");
|
|
16411
|
+
var idSchema15 = import_zod21.z.string().trim().min(1);
|
|
16412
|
+
var idempotencyKeySchema = import_zod21.z.string().min(1).refine((value) => value.trim() === value, "Idempotency key must not have leading or trailing whitespace.");
|
|
16413
|
+
var skillScopeSchema = import_zod21.z.enum(["ADMIN_GLOBAL", "MEMBER_PERSONAL"]);
|
|
16414
|
+
var isoDateSchema = import_zod21.z.iso.date();
|
|
16415
|
+
var nonEmptyStringSchema = import_zod21.z.string().trim().min(1);
|
|
16245
16416
|
var AUTOMATION_RUN_HTTP_TIMEOUT_MS = 6e4;
|
|
16246
|
-
var agentToolAccessSchema =
|
|
16247
|
-
|
|
16417
|
+
var agentToolAccessSchema = import_zod21.z.array(
|
|
16418
|
+
import_zod21.z.object({
|
|
16248
16419
|
tool_key: nonEmptyStringSchema,
|
|
16249
16420
|
scope_value: nonEmptyStringSchema
|
|
16250
16421
|
}).strict()
|
|
16251
16422
|
).min(1);
|
|
16252
16423
|
var agentToolAccessUpdateSchema = agentToolAccessSchema.min(0);
|
|
16253
|
-
var agentPluginConnectionsSchema =
|
|
16254
|
-
|
|
16424
|
+
var agentPluginConnectionsSchema = import_zod21.z.array(
|
|
16425
|
+
import_zod21.z.object({
|
|
16255
16426
|
external_tool_connection_id: nonEmptyStringSchema,
|
|
16256
16427
|
tool_key: nonEmptyStringSchema,
|
|
16257
16428
|
scope_value: nonEmptyStringSchema.optional(),
|
|
16258
|
-
allowed_tools:
|
|
16259
|
-
allowed_scopes:
|
|
16260
|
-
requires_confirmation:
|
|
16261
|
-
enabled:
|
|
16429
|
+
allowed_tools: import_zod21.z.array(nonEmptyStringSchema).optional(),
|
|
16430
|
+
allowed_scopes: import_zod21.z.array(nonEmptyStringSchema).optional(),
|
|
16431
|
+
requires_confirmation: import_zod21.z.boolean().optional(),
|
|
16432
|
+
enabled: import_zod21.z.boolean().optional()
|
|
16262
16433
|
}).strict()
|
|
16263
16434
|
).min(1);
|
|
16264
|
-
var agentPluginConnectionUpdateSchema =
|
|
16265
|
-
|
|
16266
|
-
|
|
16435
|
+
var agentPluginConnectionUpdateSchema = import_zod21.z.array(
|
|
16436
|
+
import_zod21.z.union([
|
|
16437
|
+
import_zod21.z.object({
|
|
16267
16438
|
id: nonEmptyStringSchema,
|
|
16268
|
-
_destroy:
|
|
16439
|
+
_destroy: import_zod21.z.literal(true)
|
|
16269
16440
|
}).strict(),
|
|
16270
|
-
|
|
16441
|
+
import_zod21.z.object({
|
|
16271
16442
|
id: nonEmptyStringSchema.optional(),
|
|
16272
16443
|
external_tool_connection_id: nonEmptyStringSchema.optional(),
|
|
16273
16444
|
tool_key: nonEmptyStringSchema.optional(),
|
|
16274
16445
|
scope_value: nonEmptyStringSchema.optional(),
|
|
16275
|
-
allowed_tools:
|
|
16276
|
-
allowed_scopes:
|
|
16277
|
-
requires_confirmation:
|
|
16278
|
-
enabled:
|
|
16446
|
+
allowed_tools: import_zod21.z.array(nonEmptyStringSchema).optional(),
|
|
16447
|
+
allowed_scopes: import_zod21.z.array(nonEmptyStringSchema).optional(),
|
|
16448
|
+
requires_confirmation: import_zod21.z.boolean().optional(),
|
|
16449
|
+
enabled: import_zod21.z.boolean().optional()
|
|
16279
16450
|
}).strict().superRefine((value, context) => {
|
|
16280
16451
|
if (value.id || value.external_tool_connection_id && value.tool_key) return;
|
|
16281
16452
|
context.addIssue({
|
|
16282
|
-
code:
|
|
16453
|
+
code: import_zod21.z.ZodIssueCode.custom,
|
|
16283
16454
|
message: "Plugin updates require an id, or both external_tool_connection_id and tool_key for a new grant."
|
|
16284
16455
|
});
|
|
16285
16456
|
})
|
|
16286
16457
|
])
|
|
16287
16458
|
);
|
|
16288
|
-
var agentTriggerSchema =
|
|
16289
|
-
trigger_type:
|
|
16459
|
+
var agentTriggerSchema = import_zod21.z.object({
|
|
16460
|
+
trigger_type: import_zod21.z.literal("cron"),
|
|
16290
16461
|
cron_expression: nonEmptyStringSchema,
|
|
16291
16462
|
timezone: nonEmptyStringSchema,
|
|
16292
|
-
starts_at:
|
|
16293
|
-
ends_at:
|
|
16294
|
-
max_runs:
|
|
16295
|
-
enabled:
|
|
16463
|
+
starts_at: import_zod21.z.iso.datetime({ offset: true }).nullable().optional(),
|
|
16464
|
+
ends_at: import_zod21.z.iso.datetime({ offset: true }).nullable().optional(),
|
|
16465
|
+
max_runs: import_zod21.z.number().int().positive().nullable().optional(),
|
|
16466
|
+
enabled: import_zod21.z.boolean().optional()
|
|
16296
16467
|
}).strict();
|
|
16297
|
-
var agentTriggerUpdateSchema =
|
|
16468
|
+
var agentTriggerUpdateSchema = import_zod21.z.union([
|
|
16298
16469
|
agentTriggerSchema.extend({ id: nonEmptyStringSchema.optional() }).strict(),
|
|
16299
|
-
|
|
16470
|
+
import_zod21.z.object({
|
|
16300
16471
|
id: nonEmptyStringSchema,
|
|
16301
|
-
_destroy:
|
|
16472
|
+
_destroy: import_zod21.z.literal(true)
|
|
16302
16473
|
}).strict()
|
|
16303
16474
|
]);
|
|
16304
|
-
var automationConfigSchema =
|
|
16475
|
+
var automationConfigSchema = import_zod21.z.record(import_zod21.z.string(), import_zod21.z.unknown());
|
|
16305
16476
|
var AGENT_SELECTION = `{
|
|
16306
16477
|
id
|
|
16307
16478
|
type
|
|
@@ -16979,7 +17150,7 @@ function registerAtlasAuthoringCommands(program) {
|
|
|
16979
17150
|
"--service <service>",
|
|
16980
17151
|
"Supported service: gmail, calendar, slack, or stripe"
|
|
16981
17152
|
).action(async (opts, cmd) => {
|
|
16982
|
-
const service =
|
|
17153
|
+
const service = import_zod21.z.enum(["gmail", "calendar", "slack", "stripe"]).parse(opts.service);
|
|
16983
17154
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
16984
17155
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
16985
17156
|
await runGraphqlQueryCommand({
|
|
@@ -17264,6 +17435,15 @@ var VARIABLE_TYPES = {
|
|
|
17264
17435
|
organization_id: "ID!",
|
|
17265
17436
|
member_id: "ID"
|
|
17266
17437
|
};
|
|
17438
|
+
var ACTIVITY_VARIABLE_TYPES = {
|
|
17439
|
+
...VARIABLE_TYPES,
|
|
17440
|
+
start_at: "ISO8601DateTime!",
|
|
17441
|
+
end_at: "ISO8601DateTime!"
|
|
17442
|
+
};
|
|
17443
|
+
var MEMBER_STATUSES_VARIABLE_TYPES = {
|
|
17444
|
+
organization_id: "ID!",
|
|
17445
|
+
member_ids: "[ID!]!"
|
|
17446
|
+
};
|
|
17267
17447
|
function parseRecentLimit(value) {
|
|
17268
17448
|
const limit = Number(value);
|
|
17269
17449
|
if (!Number.isInteger(limit) || limit < 1 || limit > 50) {
|
|
@@ -17271,6 +17451,25 @@ function parseRecentLimit(value) {
|
|
|
17271
17451
|
}
|
|
17272
17452
|
return limit;
|
|
17273
17453
|
}
|
|
17454
|
+
function parseIsoDateTime(optionName, value) {
|
|
17455
|
+
const timestamp = Date.parse(value);
|
|
17456
|
+
if (!Number.isFinite(timestamp) || !value.includes("T")) {
|
|
17457
|
+
throw new Error(`${optionName} must be an ISO 8601 date-time`);
|
|
17458
|
+
}
|
|
17459
|
+
return value;
|
|
17460
|
+
}
|
|
17461
|
+
function validateActivityRange(startAt, endAt) {
|
|
17462
|
+
if (Date.parse(endAt) <= Date.parse(startAt)) {
|
|
17463
|
+
throw new Error("end-at must be after start-at");
|
|
17464
|
+
}
|
|
17465
|
+
}
|
|
17466
|
+
function parseMemberIds(value) {
|
|
17467
|
+
const memberIds = [...new Set(value.split(",").map((id) => id.trim()).filter(Boolean))];
|
|
17468
|
+
if (memberIds.length < 1 || memberIds.length > 100) {
|
|
17469
|
+
throw new Error("member-ids must contain between 1 and 100 unique member IDs");
|
|
17470
|
+
}
|
|
17471
|
+
return memberIds;
|
|
17472
|
+
}
|
|
17274
17473
|
async function runDesktopContextQuery(cmd, params) {
|
|
17275
17474
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
17276
17475
|
await runGraphqlQueryCommand({
|
|
@@ -17281,9 +17480,12 @@ async function runDesktopContextQuery(cmd, params) {
|
|
|
17281
17480
|
variables: normalizeGraphqlVariables2({
|
|
17282
17481
|
organization_id: resolveOrganizationId(context.organizationId),
|
|
17283
17482
|
member_id: params.memberId,
|
|
17284
|
-
|
|
17483
|
+
member_ids: params.memberIds,
|
|
17484
|
+
limit: params.limit,
|
|
17485
|
+
start_at: params.startAt,
|
|
17486
|
+
end_at: params.endAt
|
|
17285
17487
|
}),
|
|
17286
|
-
variableTypes: {
|
|
17488
|
+
variableTypes: params.command === "desktop-context.activity" ? ACTIVITY_VARIABLE_TYPES : params.command === "desktop-context.member-statuses" ? MEMBER_STATUSES_VARIABLE_TYPES : {
|
|
17287
17489
|
...VARIABLE_TYPES,
|
|
17288
17490
|
...params.command === "desktop-context.recent" ? { limit: "Int" } : {}
|
|
17289
17491
|
},
|
|
@@ -17301,6 +17503,18 @@ function registerDesktopContextCommands(program) {
|
|
|
17301
17503
|
memberId: opts.memberId
|
|
17302
17504
|
});
|
|
17303
17505
|
});
|
|
17506
|
+
desktopContext.command("member-statuses").description("Read capture and enrollment status for up to 100 organization members").requiredOption(
|
|
17507
|
+
"--member-ids <memberIds>",
|
|
17508
|
+
"Comma-separated organization member IDs (1-100)",
|
|
17509
|
+
parseMemberIds
|
|
17510
|
+
).action(async (opts, cmd) => {
|
|
17511
|
+
await runDesktopContextQuery(cmd, {
|
|
17512
|
+
command: "desktop-context.member-statuses",
|
|
17513
|
+
operationName: "DesktopContextMemberStatuses",
|
|
17514
|
+
field: "desktop_context_member_statuses",
|
|
17515
|
+
memberIds: opts.memberIds
|
|
17516
|
+
});
|
|
17517
|
+
});
|
|
17304
17518
|
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) => {
|
|
17305
17519
|
await runDesktopContextQuery(cmd, {
|
|
17306
17520
|
command: "desktop-context.recent",
|
|
@@ -17310,6 +17524,380 @@ function registerDesktopContextCommands(program) {
|
|
|
17310
17524
|
limit: opts.limit
|
|
17311
17525
|
});
|
|
17312
17526
|
});
|
|
17527
|
+
desktopContext.command("activity").description("Read canonical active, AFK, gap, and app duration for a bounded range").requiredOption(
|
|
17528
|
+
"--start-at <dateTime>",
|
|
17529
|
+
"Inclusive ISO 8601 range start",
|
|
17530
|
+
(value) => parseIsoDateTime("start-at", value)
|
|
17531
|
+
).requiredOption(
|
|
17532
|
+
"--end-at <dateTime>",
|
|
17533
|
+
"Exclusive ISO 8601 range end",
|
|
17534
|
+
(value) => parseIsoDateTime("end-at", value)
|
|
17535
|
+
).option("--member-id <memberId>", "Member scope; defaults to the authenticated member").action(async (opts, cmd) => {
|
|
17536
|
+
validateActivityRange(opts.startAt, opts.endAt);
|
|
17537
|
+
await runDesktopContextQuery(cmd, {
|
|
17538
|
+
command: "desktop-context.activity",
|
|
17539
|
+
operationName: "DesktopContextActivity",
|
|
17540
|
+
field: "desktop_context_activity_summary",
|
|
17541
|
+
memberId: opts.memberId,
|
|
17542
|
+
startAt: opts.startAt,
|
|
17543
|
+
endAt: opts.endAt
|
|
17544
|
+
});
|
|
17545
|
+
});
|
|
17546
|
+
}
|
|
17547
|
+
|
|
17548
|
+
// src/commands/dataPipeline.ts
|
|
17549
|
+
var MAX_PARAMETERS_JSON_BYTES = 16384;
|
|
17550
|
+
var SECRET_LIKE_PARAMETER_KEY = /(?:^|_)(?:api_?key|authorization|credential|password|secret|token)(?:$|_)/i;
|
|
17551
|
+
var UNSAFE_PARAMETER_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
17552
|
+
var ORGANIZATION_VARIABLE_TYPES = {
|
|
17553
|
+
organization_id: "ID!"
|
|
17554
|
+
};
|
|
17555
|
+
var SOURCES_VARIABLE_TYPES = {
|
|
17556
|
+
...ORGANIZATION_VARIABLE_TYPES,
|
|
17557
|
+
category_key: "String!"
|
|
17558
|
+
};
|
|
17559
|
+
var SOURCE_ACTIONS_VARIABLE_TYPES = {
|
|
17560
|
+
...ORGANIZATION_VARIABLE_TYPES,
|
|
17561
|
+
source_id: "ID!"
|
|
17562
|
+
};
|
|
17563
|
+
var EXECUTE_SOURCE_ACTION_VARIABLE_TYPES = {
|
|
17564
|
+
...SOURCE_ACTIONS_VARIABLE_TYPES,
|
|
17565
|
+
category_key: "String!",
|
|
17566
|
+
provider_key: "String!",
|
|
17567
|
+
action_key: "String!",
|
|
17568
|
+
parameters: "JSON"
|
|
17569
|
+
};
|
|
17570
|
+
var PROVIDER_SELECTION = `
|
|
17571
|
+
organizationPluginId
|
|
17572
|
+
key
|
|
17573
|
+
name
|
|
17574
|
+
categories
|
|
17575
|
+
availability
|
|
17576
|
+
integrationKey
|
|
17577
|
+
arcadeProvider
|
|
17578
|
+
arcadeService
|
|
17579
|
+
logoAssetPath
|
|
17580
|
+
`.trim();
|
|
17581
|
+
var OVERVIEW_SELECTION = `
|
|
17582
|
+
{
|
|
17583
|
+
totalSourceCount
|
|
17584
|
+
connectedSourceCount
|
|
17585
|
+
categoriesConfiguredCount
|
|
17586
|
+
actionRequiredCount
|
|
17587
|
+
categories {
|
|
17588
|
+
key
|
|
17589
|
+
name
|
|
17590
|
+
description
|
|
17591
|
+
iconKey
|
|
17592
|
+
sortOrder
|
|
17593
|
+
allowedSourceTypes
|
|
17594
|
+
suggestedSourceLabels
|
|
17595
|
+
sourceCount
|
|
17596
|
+
activeSourceCount
|
|
17597
|
+
attentionSourceCount
|
|
17598
|
+
status
|
|
17599
|
+
providers {
|
|
17600
|
+
${PROVIDER_SELECTION}
|
|
17601
|
+
}
|
|
17602
|
+
}
|
|
17603
|
+
}
|
|
17604
|
+
`.trim();
|
|
17605
|
+
var SOURCE_SELECTION = `
|
|
17606
|
+
{
|
|
17607
|
+
id
|
|
17608
|
+
type
|
|
17609
|
+
organizationId
|
|
17610
|
+
categoryKey
|
|
17611
|
+
sourceType
|
|
17612
|
+
providerKey
|
|
17613
|
+
organizationPluginId
|
|
17614
|
+
name
|
|
17615
|
+
url
|
|
17616
|
+
status
|
|
17617
|
+
connection
|
|
17618
|
+
configuration
|
|
17619
|
+
metadata
|
|
17620
|
+
lastSyncedAt
|
|
17621
|
+
lastSuccessfulSyncAt
|
|
17622
|
+
lastErrorAt
|
|
17623
|
+
lastErrorMessage
|
|
17624
|
+
createdById
|
|
17625
|
+
createdAt
|
|
17626
|
+
updatedAt
|
|
17627
|
+
}
|
|
17628
|
+
`.trim();
|
|
17629
|
+
var SOURCE_ACTION_SELECTION = `
|
|
17630
|
+
{
|
|
17631
|
+
key
|
|
17632
|
+
displayName
|
|
17633
|
+
inputSchema
|
|
17634
|
+
safetyClass
|
|
17635
|
+
requiresApproval
|
|
17636
|
+
}
|
|
17637
|
+
`.trim();
|
|
17638
|
+
var SOURCE_ACTION_RESULT_SELECTION = `
|
|
17639
|
+
{
|
|
17640
|
+
ok
|
|
17641
|
+
status
|
|
17642
|
+
errorCode
|
|
17643
|
+
errors
|
|
17644
|
+
traceId
|
|
17645
|
+
organizationId
|
|
17646
|
+
categoryKey
|
|
17647
|
+
providerKey
|
|
17648
|
+
sourceId
|
|
17649
|
+
actionKey
|
|
17650
|
+
records
|
|
17651
|
+
pageInfo
|
|
17652
|
+
metadata
|
|
17653
|
+
}
|
|
17654
|
+
`.trim();
|
|
17655
|
+
function invalidParameters(message, details = {}) {
|
|
17656
|
+
return new CliError({
|
|
17657
|
+
message,
|
|
17658
|
+
kind: "invalid_args",
|
|
17659
|
+
status: 400,
|
|
17660
|
+
exitCode: EXIT_CODES.invalidArgs,
|
|
17661
|
+
details
|
|
17662
|
+
});
|
|
17663
|
+
}
|
|
17664
|
+
function parseNonBlank(value, optionName) {
|
|
17665
|
+
const parsed = value.trim();
|
|
17666
|
+
if (!parsed) {
|
|
17667
|
+
throw invalidParameters(`${optionName} must not be blank`);
|
|
17668
|
+
}
|
|
17669
|
+
return parsed;
|
|
17670
|
+
}
|
|
17671
|
+
function parseCategoryKey(value) {
|
|
17672
|
+
return parseNonBlank(value, "category-key");
|
|
17673
|
+
}
|
|
17674
|
+
function secretLikeParameterPath(value, path = []) {
|
|
17675
|
+
if (!value || typeof value !== "object") return null;
|
|
17676
|
+
if (Array.isArray(value)) {
|
|
17677
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
17678
|
+
const nestedPath = secretLikeParameterPath(value[index], [...path, String(index)]);
|
|
17679
|
+
if (nestedPath) return nestedPath;
|
|
17680
|
+
}
|
|
17681
|
+
return null;
|
|
17682
|
+
}
|
|
17683
|
+
for (const [key, nestedValue] of Object.entries(value)) {
|
|
17684
|
+
const keyPath = [...path, key];
|
|
17685
|
+
if (UNSAFE_PARAMETER_KEYS.has(key) || SECRET_LIKE_PARAMETER_KEY.test(key)) {
|
|
17686
|
+
return keyPath.join(".");
|
|
17687
|
+
}
|
|
17688
|
+
const nestedPath = secretLikeParameterPath(nestedValue, keyPath);
|
|
17689
|
+
if (nestedPath) return nestedPath;
|
|
17690
|
+
}
|
|
17691
|
+
return null;
|
|
17692
|
+
}
|
|
17693
|
+
function parseSourceActionParameters(raw) {
|
|
17694
|
+
if (Buffer.byteLength(raw, "utf8") > MAX_PARAMETERS_JSON_BYTES) {
|
|
17695
|
+
throw invalidParameters(
|
|
17696
|
+
`parameters-json must not exceed ${MAX_PARAMETERS_JSON_BYTES} bytes`
|
|
17697
|
+
);
|
|
17698
|
+
}
|
|
17699
|
+
let parsed;
|
|
17700
|
+
try {
|
|
17701
|
+
parsed = JSON.parse(raw);
|
|
17702
|
+
} catch {
|
|
17703
|
+
throw invalidParameters("parameters-json must be a valid JSON object");
|
|
17704
|
+
}
|
|
17705
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
17706
|
+
throw invalidParameters("parameters-json must be a JSON object");
|
|
17707
|
+
}
|
|
17708
|
+
const secretPath = secretLikeParameterPath(parsed);
|
|
17709
|
+
if (secretPath) {
|
|
17710
|
+
throw invalidParameters(
|
|
17711
|
+
`parameters-json contains a secret-like parameter key: ${secretPath}`,
|
|
17712
|
+
{ parameterPath: secretPath }
|
|
17713
|
+
);
|
|
17714
|
+
}
|
|
17715
|
+
return parsed;
|
|
17716
|
+
}
|
|
17717
|
+
function isJsonRecord(value) {
|
|
17718
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
17719
|
+
}
|
|
17720
|
+
function sourceActionFailureKind(errorCode, status) {
|
|
17721
|
+
if (errorCode === "AUTH_REQUIRED" || errorCode === "UNAUTHORIZED") return "missing_auth";
|
|
17722
|
+
if (errorCode === "NOT_FOUND") return "not_found";
|
|
17723
|
+
if (errorCode === "PROVIDER_ERROR") return "upstream_error";
|
|
17724
|
+
if (errorCode === "ACTION_NOT_ALLOWED") return "forbidden";
|
|
17725
|
+
if (errorCode === "INVALID_INPUT" || errorCode === "INVALID_SOURCE") {
|
|
17726
|
+
return "validation";
|
|
17727
|
+
}
|
|
17728
|
+
if (status === 403) return "forbidden";
|
|
17729
|
+
if (status === 404) return "not_found";
|
|
17730
|
+
if (status >= 500) return "upstream_error";
|
|
17731
|
+
if (status === 400 || status === 422) return "validation";
|
|
17732
|
+
return "generic_error";
|
|
17733
|
+
}
|
|
17734
|
+
function sourceActionFailureExitCode(kind, status) {
|
|
17735
|
+
if (kind === "missing_auth") return EXIT_CODES.missingOrInvalidAuth;
|
|
17736
|
+
if (kind === "forbidden") return EXIT_CODES.forbidden;
|
|
17737
|
+
if (kind === "not_found") return EXIT_CODES.notFound;
|
|
17738
|
+
if (kind === "validation") return EXIT_CODES.validationFailure;
|
|
17739
|
+
if (kind === "upstream_error" || kind === "malformed_response") {
|
|
17740
|
+
return EXIT_CODES.networkOrUpstream;
|
|
17741
|
+
}
|
|
17742
|
+
return mapStatusToExitCode(status);
|
|
17743
|
+
}
|
|
17744
|
+
function transformSourceActionResult(value) {
|
|
17745
|
+
if (!isJsonRecord(value) || typeof value.ok !== "boolean") {
|
|
17746
|
+
throw new CliError({
|
|
17747
|
+
message: "Data Pipeline source action returned a malformed response",
|
|
17748
|
+
kind: "malformed_response",
|
|
17749
|
+
status: 502,
|
|
17750
|
+
exitCode: EXIT_CODES.networkOrUpstream
|
|
17751
|
+
});
|
|
17752
|
+
}
|
|
17753
|
+
if (value.ok) return value;
|
|
17754
|
+
const status = typeof value.status === "number" && Number.isInteger(value.status) ? value.status : 500;
|
|
17755
|
+
const errorCode = typeof value.errorCode === "string" && value.errorCode.length > 0 ? value.errorCode.toUpperCase() : "SOURCE_ACTION_FAILED";
|
|
17756
|
+
const errors = Array.isArray(value.errors) ? value.errors.filter((error) => typeof error === "string") : [];
|
|
17757
|
+
const traceId = typeof value.traceId === "string" ? value.traceId : null;
|
|
17758
|
+
const kind = sourceActionFailureKind(errorCode, status);
|
|
17759
|
+
throw new CliError({
|
|
17760
|
+
message: errors.find((error) => error.trim().length > 0) ?? "Data Pipeline source action failed",
|
|
17761
|
+
kind,
|
|
17762
|
+
status,
|
|
17763
|
+
exitCode: sourceActionFailureExitCode(kind, status),
|
|
17764
|
+
details: { errorCode, traceId, errors }
|
|
17765
|
+
});
|
|
17766
|
+
}
|
|
17767
|
+
function transformSourceActions(value) {
|
|
17768
|
+
if (!Array.isArray(value)) {
|
|
17769
|
+
throw new CliError({
|
|
17770
|
+
message: "Data Pipeline source action discovery returned a malformed response",
|
|
17771
|
+
kind: "malformed_response",
|
|
17772
|
+
status: 502,
|
|
17773
|
+
exitCode: EXIT_CODES.networkOrUpstream
|
|
17774
|
+
});
|
|
17775
|
+
}
|
|
17776
|
+
for (const action of value) {
|
|
17777
|
+
if (!isJsonRecord(action) || typeof action.key !== "string") {
|
|
17778
|
+
throw new CliError({
|
|
17779
|
+
message: "Data Pipeline source action discovery returned a malformed action",
|
|
17780
|
+
kind: "malformed_response",
|
|
17781
|
+
status: 502,
|
|
17782
|
+
exitCode: EXIT_CODES.networkOrUpstream
|
|
17783
|
+
});
|
|
17784
|
+
}
|
|
17785
|
+
if (action.safetyClass !== "read_only" || action.requiresApproval !== false) {
|
|
17786
|
+
throw new CliError({
|
|
17787
|
+
message: `Data Pipeline source action discovery returned a non-read-only action: ${action.key}`,
|
|
17788
|
+
kind: "malformed_response",
|
|
17789
|
+
status: 502,
|
|
17790
|
+
exitCode: EXIT_CODES.networkOrUpstream,
|
|
17791
|
+
details: {
|
|
17792
|
+
actionKey: action.key,
|
|
17793
|
+
safetyClass: action.safetyClass,
|
|
17794
|
+
requiresApproval: action.requiresApproval
|
|
17795
|
+
}
|
|
17796
|
+
});
|
|
17797
|
+
}
|
|
17798
|
+
}
|
|
17799
|
+
return value;
|
|
17800
|
+
}
|
|
17801
|
+
function registerDataPipelineCommands(program) {
|
|
17802
|
+
const dataPipeline = program.command("data-pipeline").description("Inspect the organization's configured Data Pipeline control plane");
|
|
17803
|
+
dataPipeline.command("overview").description("Read source counts, category status, and available organization plugins").action(async (_opts, cmd) => {
|
|
17804
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
17805
|
+
await runGraphqlQueryCommand({
|
|
17806
|
+
command: "data-pipeline.overview",
|
|
17807
|
+
operationName: "DataPipelineOverview",
|
|
17808
|
+
runtimeOptions: context.runtimeOptions,
|
|
17809
|
+
field: "data_pipeline_overview",
|
|
17810
|
+
variables: {
|
|
17811
|
+
organization_id: resolveOrganizationId(context.organizationId)
|
|
17812
|
+
},
|
|
17813
|
+
variableTypes: ORGANIZATION_VARIABLE_TYPES,
|
|
17814
|
+
isShow: true,
|
|
17815
|
+
selectionSet: OVERVIEW_SELECTION
|
|
17816
|
+
});
|
|
17817
|
+
});
|
|
17818
|
+
dataPipeline.command("sources").description("Read the saved source records configured for one Data Pipeline category").requiredOption(
|
|
17819
|
+
"--category-key <categoryKey>",
|
|
17820
|
+
"Data Pipeline category key from the overview response",
|
|
17821
|
+
parseCategoryKey
|
|
17822
|
+
).action(async (opts, cmd) => {
|
|
17823
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
17824
|
+
await runGraphqlQueryCommand({
|
|
17825
|
+
command: "data-pipeline.sources",
|
|
17826
|
+
operationName: "DataPipelineSources",
|
|
17827
|
+
runtimeOptions: context.runtimeOptions,
|
|
17828
|
+
field: "data_pipeline_sources",
|
|
17829
|
+
variables: {
|
|
17830
|
+
organization_id: resolveOrganizationId(context.organizationId),
|
|
17831
|
+
category_key: opts.categoryKey
|
|
17832
|
+
},
|
|
17833
|
+
variableTypes: SOURCES_VARIABLE_TYPES,
|
|
17834
|
+
isList: true,
|
|
17835
|
+
selectionSet: SOURCE_SELECTION
|
|
17836
|
+
});
|
|
17837
|
+
});
|
|
17838
|
+
dataPipeline.command("source-actions").description("Read the certified provider actions available for one configured source").requiredOption(
|
|
17839
|
+
"--source-id <sourceId>",
|
|
17840
|
+
"Configured Data Pipeline source ID",
|
|
17841
|
+
(value) => parseNonBlank(value, "source-id")
|
|
17842
|
+
).action(async (opts, cmd) => {
|
|
17843
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
17844
|
+
await runGraphqlQueryCommand({
|
|
17845
|
+
command: "data-pipeline.source-actions",
|
|
17846
|
+
operationName: "DataPipelineSourceActions",
|
|
17847
|
+
runtimeOptions: context.runtimeOptions,
|
|
17848
|
+
field: "data_pipeline_source_actions",
|
|
17849
|
+
variables: {
|
|
17850
|
+
organization_id: resolveOrganizationId(context.organizationId),
|
|
17851
|
+
source_id: opts.sourceId
|
|
17852
|
+
},
|
|
17853
|
+
variableTypes: SOURCE_ACTIONS_VARIABLE_TYPES,
|
|
17854
|
+
isList: true,
|
|
17855
|
+
transformData: transformSourceActions,
|
|
17856
|
+
selectionSet: SOURCE_ACTION_SELECTION
|
|
17857
|
+
});
|
|
17858
|
+
});
|
|
17859
|
+
dataPipeline.command("execute-source-action").description("Execute one backend-certified read-only action for a configured source").requiredOption(
|
|
17860
|
+
"--category-key <categoryKey>",
|
|
17861
|
+
"Data Pipeline category key",
|
|
17862
|
+
parseCategoryKey
|
|
17863
|
+
).requiredOption(
|
|
17864
|
+
"--provider-key <providerKey>",
|
|
17865
|
+
"Provider key from the configured source",
|
|
17866
|
+
(value) => parseNonBlank(value, "provider-key")
|
|
17867
|
+
).requiredOption(
|
|
17868
|
+
"--source-id <sourceId>",
|
|
17869
|
+
"Configured Data Pipeline source ID",
|
|
17870
|
+
(value) => parseNonBlank(value, "source-id")
|
|
17871
|
+
).requiredOption(
|
|
17872
|
+
"--action-key <actionKey>",
|
|
17873
|
+
"Action key returned by source-actions",
|
|
17874
|
+
(value) => parseNonBlank(value, "action-key")
|
|
17875
|
+
).option(
|
|
17876
|
+
"--parameters-json <parametersJson>",
|
|
17877
|
+
"Bounded JSON object matching the discovered action input schema",
|
|
17878
|
+
parseSourceActionParameters,
|
|
17879
|
+
{}
|
|
17880
|
+
).action(async (opts, cmd) => {
|
|
17881
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
17882
|
+
await runGraphqlQueryCommand({
|
|
17883
|
+
command: "data-pipeline.execute-source-action",
|
|
17884
|
+
operationName: "DataPipelineExecuteSourceAction",
|
|
17885
|
+
runtimeOptions: context.runtimeOptions,
|
|
17886
|
+
field: "data_pipeline_execute_source_action",
|
|
17887
|
+
variables: {
|
|
17888
|
+
organization_id: resolveOrganizationId(context.organizationId),
|
|
17889
|
+
category_key: opts.categoryKey,
|
|
17890
|
+
provider_key: opts.providerKey,
|
|
17891
|
+
source_id: opts.sourceId,
|
|
17892
|
+
action_key: opts.actionKey,
|
|
17893
|
+
parameters: opts.parametersJson
|
|
17894
|
+
},
|
|
17895
|
+
variableTypes: EXECUTE_SOURCE_ACTION_VARIABLE_TYPES,
|
|
17896
|
+
isShow: true,
|
|
17897
|
+
transformData: transformSourceActionResult,
|
|
17898
|
+
selectionSet: SOURCE_ACTION_RESULT_SELECTION
|
|
17899
|
+
});
|
|
17900
|
+
});
|
|
17313
17901
|
}
|
|
17314
17902
|
|
|
17315
17903
|
// src/commands/discovery.ts
|
|
@@ -17325,6 +17913,7 @@ var PRIMARY_NAMESPACES = [
|
|
|
17325
17913
|
"planner",
|
|
17326
17914
|
"mail",
|
|
17327
17915
|
"datasheets",
|
|
17916
|
+
"data-pipeline",
|
|
17328
17917
|
"desktop-context",
|
|
17329
17918
|
"phantom",
|
|
17330
17919
|
"tasks",
|
|
@@ -17413,7 +18002,9 @@ var NAMESPACE_DOCS = {
|
|
|
17413
18002
|
description: "Sanitized desktop capture health and recent evidence for Atlas grounding.",
|
|
17414
18003
|
examples: [
|
|
17415
18004
|
"wave desktop-context status",
|
|
18005
|
+
"wave desktop-context member-statuses --member-ids 123,456",
|
|
17416
18006
|
"wave desktop-context recent --limit 20",
|
|
18007
|
+
"wave desktop-context activity --start-at 2026-08-18T08:00:00Z --end-at 2026-08-18T09:00:00Z",
|
|
17417
18008
|
"wave desktop-context status --member-id 123"
|
|
17418
18009
|
],
|
|
17419
18010
|
schema: {
|
|
@@ -17424,7 +18015,28 @@ var NAMESPACE_DOCS = {
|
|
|
17424
18015
|
"Does not expose screenshots, raw audio, accessibility trees, clipboard contents, keystrokes, URLs, or filesystem paths.",
|
|
17425
18016
|
"Cross-member reads remain subject to backend organization policy and every response carries backend trace correlation when available."
|
|
17426
18017
|
],
|
|
17427
|
-
commands: ["status", "recent"]
|
|
18018
|
+
commands: ["status", "member-statuses", "recent", "activity"]
|
|
18019
|
+
}
|
|
18020
|
+
},
|
|
18021
|
+
"data-pipeline": {
|
|
18022
|
+
name: "data-pipeline",
|
|
18023
|
+
tier: "primary",
|
|
18024
|
+
description: "Organization Data Pipeline configuration, saved sources, and certified provider reads.",
|
|
18025
|
+
examples: [
|
|
18026
|
+
"wave data-pipeline overview",
|
|
18027
|
+
"wave data-pipeline sources --category-key communication_meetings",
|
|
18028
|
+
"wave data-pipeline source-actions --source-id 123",
|
|
18029
|
+
`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}'`
|
|
18030
|
+
],
|
|
18031
|
+
schema: {
|
|
18032
|
+
output: "json-envelope-default",
|
|
18033
|
+
readOnly: true,
|
|
18034
|
+
safety: [
|
|
18035
|
+
"Reads organization-scoped Data Pipeline configuration and backend-certified provider records only.",
|
|
18036
|
+
"Provider actions are discovered from the backend and remain read-only and approval-free.",
|
|
18037
|
+
"Does not install, enable, disable, or uninstall plugins; manage credentials; or create, update, or delete sources."
|
|
18038
|
+
],
|
|
18039
|
+
commands: ["overview", "sources", "source-actions", "execute-source-action"]
|
|
17428
18040
|
}
|
|
17429
18041
|
},
|
|
17430
18042
|
phantom: {
|
|
@@ -18370,6 +18982,7 @@ function buildCli(options) {
|
|
|
18370
18982
|
registerRockCommands(program);
|
|
18371
18983
|
registerMeetingCommands(program);
|
|
18372
18984
|
registerMemberCommands(program);
|
|
18985
|
+
registerResourceCommands(program);
|
|
18373
18986
|
registerSkillCommands(program);
|
|
18374
18987
|
registerAtlasAuthoringCommands(program);
|
|
18375
18988
|
registerTeamCommands(program);
|
|
@@ -18394,6 +19007,7 @@ function buildCli(options) {
|
|
|
18394
19007
|
registerDatasheetsCommands(program);
|
|
18395
19008
|
registerSignatureCommands(program);
|
|
18396
19009
|
registerDesktopContextCommands(program);
|
|
19010
|
+
registerDataPipelineCommands(program);
|
|
18397
19011
|
registerAuthCommands(program);
|
|
18398
19012
|
registerDiscoveryCommands(program);
|
|
18399
19013
|
attachNamespaceDiscovery(program);
|
|
@@ -18920,13 +19534,13 @@ main().catch((error) => {
|
|
|
18920
19534
|
});
|
|
18921
19535
|
return;
|
|
18922
19536
|
}
|
|
18923
|
-
if (error instanceof
|
|
19537
|
+
if (error instanceof import_zod22.ZodError || error instanceof import_commander3.InvalidArgumentError) {
|
|
18924
19538
|
printCliFailure({
|
|
18925
19539
|
status: 400,
|
|
18926
19540
|
code: "invalid_args",
|
|
18927
19541
|
message: "Invalid command arguments.",
|
|
18928
19542
|
details: {
|
|
18929
|
-
issues: error instanceof
|
|
19543
|
+
issues: error instanceof import_zod22.ZodError ? error.issues : [{ message: error.message, code: "invalid_argument" }]
|
|
18930
19544
|
},
|
|
18931
19545
|
exitCode: EXIT_CODES.invalidArgs
|
|
18932
19546
|
});
|