@wave-ai-os/wave-cli 0.1.73 → 0.1.75
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 +296 -25
- package/dist/index.js +296 -25
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2556,6 +2556,20 @@ function parseSearchQuery(raw) {
|
|
|
2556
2556
|
}
|
|
2557
2557
|
return raw.trim();
|
|
2558
2558
|
}
|
|
2559
|
+
function parseRequiredOption(raw, flag) {
|
|
2560
|
+
if (typeof raw !== "string" || raw.trim().length === 0) {
|
|
2561
|
+
throw new CliError({
|
|
2562
|
+
message: `Missing required option: --${flag}.`,
|
|
2563
|
+
kind: "invalid_args",
|
|
2564
|
+
status: 400,
|
|
2565
|
+
exitCode: EXIT_CODES.invalidArgs
|
|
2566
|
+
});
|
|
2567
|
+
}
|
|
2568
|
+
return raw.trim();
|
|
2569
|
+
}
|
|
2570
|
+
function optionKey(flag) {
|
|
2571
|
+
return flag.replace(/-([a-z])/g, (_, char) => char.toUpperCase());
|
|
2572
|
+
}
|
|
2559
2573
|
function asRecord2(value) {
|
|
2560
2574
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
2561
2575
|
}
|
|
@@ -2592,10 +2606,21 @@ function buildSearchTransform(query, transformData) {
|
|
|
2592
2606
|
};
|
|
2593
2607
|
}
|
|
2594
2608
|
function registerGraphqlSearchCommand(command, config) {
|
|
2595
|
-
|
|
2609
|
+
const requiredOptions = config.requiredOptions ?? [];
|
|
2610
|
+
const search = command.command("search").description("Search records through the existing list GraphQL contract").requiredOption("--query <query>", "Search query").option("--page <page>").option("--per <per>");
|
|
2611
|
+
for (const requiredOption of requiredOptions) {
|
|
2612
|
+
search.requiredOption(`--${requiredOption.flag} <${requiredOption.flag}>`, requiredOption.description);
|
|
2613
|
+
}
|
|
2614
|
+
search.action(async (opts, cmd) => {
|
|
2596
2615
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2597
2616
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2598
2617
|
const query = parseSearchQuery(opts.query);
|
|
2618
|
+
const requiredVariables = Object.fromEntries(
|
|
2619
|
+
requiredOptions.map((requiredOption) => [
|
|
2620
|
+
requiredOption.variable,
|
|
2621
|
+
parseRequiredOption(opts[optionKey(requiredOption.flag)], requiredOption.flag)
|
|
2622
|
+
])
|
|
2623
|
+
);
|
|
2599
2624
|
await runGraphqlQueryCommand({
|
|
2600
2625
|
command: `${config.command}.search`,
|
|
2601
2626
|
operationName: config.operationName,
|
|
@@ -2604,13 +2629,20 @@ function registerGraphqlSearchCommand(command, config) {
|
|
|
2604
2629
|
variables: normalizeGraphqlVariables2({
|
|
2605
2630
|
organization_id: organizationId,
|
|
2606
2631
|
page: opts.page,
|
|
2607
|
-
per: opts.per
|
|
2632
|
+
per: opts.per,
|
|
2633
|
+
...requiredVariables
|
|
2608
2634
|
}),
|
|
2609
2635
|
variableTypes: {
|
|
2610
2636
|
organization_id: "ID!",
|
|
2611
2637
|
page: "Int",
|
|
2612
2638
|
per: "Int",
|
|
2613
|
-
...config.variableTypes ?? {}
|
|
2639
|
+
...config.variableTypes ?? {},
|
|
2640
|
+
...Object.fromEntries(
|
|
2641
|
+
requiredOptions.map((requiredOption) => [
|
|
2642
|
+
requiredOption.variable,
|
|
2643
|
+
requiredOption.variableType
|
|
2644
|
+
])
|
|
2645
|
+
)
|
|
2614
2646
|
},
|
|
2615
2647
|
isList: true,
|
|
2616
2648
|
selectionSet: config.selectionSet,
|
|
@@ -3448,8 +3480,8 @@ function registerEntityCrudCommands(program, config) {
|
|
|
3448
3480
|
const extraQuery = allowQueryJson ? parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0) : {};
|
|
3449
3481
|
const mappedKnownParams = Object.fromEntries(
|
|
3450
3482
|
listParams.map((param) => {
|
|
3451
|
-
const
|
|
3452
|
-
return [param, opts[
|
|
3483
|
+
const optionKey2 = param.replace(/_([a-z])/g, (_, char) => char.toUpperCase());
|
|
3484
|
+
return [param, opts[optionKey2]];
|
|
3453
3485
|
})
|
|
3454
3486
|
);
|
|
3455
3487
|
const variables = normalizeGraphqlVariables2({
|
|
@@ -3488,8 +3520,8 @@ function registerEntityCrudCommands(program, config) {
|
|
|
3488
3520
|
const defaultField = config.showField ?? (config.resourcePath === "feedback" ? "feedback" : toSingularResourceName(config.resourcePath));
|
|
3489
3521
|
const mappedShowParams = Object.fromEntries(
|
|
3490
3522
|
showParams.map((param) => {
|
|
3491
|
-
const
|
|
3492
|
-
return [param, opts[
|
|
3523
|
+
const optionKey2 = param.replace(/_([a-z])/g, (_, char) => char.toUpperCase());
|
|
3524
|
+
return [param, opts[optionKey2]];
|
|
3493
3525
|
})
|
|
3494
3526
|
);
|
|
3495
3527
|
const defaultVariables = normalizeGraphqlVariables2({
|
|
@@ -5788,12 +5820,41 @@ function registerFoundationCommands(program) {
|
|
|
5788
5820
|
var import_zod13 = require("zod");
|
|
5789
5821
|
var idSchema12 = import_zod13.z.string().min(1);
|
|
5790
5822
|
var jsonObjectSchema = import_zod13.z.record(import_zod13.z.string(), import_zod13.z.unknown());
|
|
5791
|
-
|
|
5823
|
+
var NOTE_DETAIL_FIELDS = [
|
|
5824
|
+
"notes",
|
|
5825
|
+
"hasNotes",
|
|
5826
|
+
"hasUnreadNotes",
|
|
5827
|
+
"notesUpdatedAt",
|
|
5828
|
+
"notesLastReadAt",
|
|
5829
|
+
"estimateIds"
|
|
5830
|
+
];
|
|
5831
|
+
var PARENT_KIND_LABELS = {
|
|
5832
|
+
task: "task",
|
|
5833
|
+
rock: "rock",
|
|
5834
|
+
listItem: "list item",
|
|
5835
|
+
todo: "todo",
|
|
5836
|
+
issue: "issue",
|
|
5837
|
+
meeting: "meeting"
|
|
5838
|
+
};
|
|
5839
|
+
function requiredParentSearchOption(parentFlag, parentKind) {
|
|
5840
|
+
return [
|
|
5841
|
+
{
|
|
5842
|
+
flag: parentFlag,
|
|
5843
|
+
variable: parentFlag.replace(/-/g, "_"),
|
|
5844
|
+
variableType: "ID!",
|
|
5845
|
+
description: `Parent ${PARENT_KIND_LABELS[parentKind]} ID`
|
|
5846
|
+
}
|
|
5847
|
+
];
|
|
5848
|
+
}
|
|
5849
|
+
function buildChildResourceSelectionSet(parentField, extraFields = []) {
|
|
5792
5850
|
const fields = Array.from(
|
|
5793
5851
|
/* @__PURE__ */ new Set(["id", "type", "name", "status", "priority", "rank", "dueDate", "memberId", parentField, ...extraFields])
|
|
5794
5852
|
);
|
|
5795
5853
|
const attributeFields = fields.filter((field) => field !== "type");
|
|
5796
|
-
return `{
|
|
5854
|
+
return `{ ${fields.join(" ")} attributes { ${attributeFields.join(" ")} } }`;
|
|
5855
|
+
}
|
|
5856
|
+
function buildChildListSelectionSet(parentField, extraFields = []) {
|
|
5857
|
+
return `{ data ${buildChildResourceSelectionSet(parentField, extraFields)} count currentPage totalPages }`;
|
|
5797
5858
|
}
|
|
5798
5859
|
function parseJsonObject2(raw) {
|
|
5799
5860
|
try {
|
|
@@ -5937,7 +5998,31 @@ function registerChildCommands(program, config) {
|
|
|
5937
5998
|
)
|
|
5938
5999
|
});
|
|
5939
6000
|
});
|
|
5940
|
-
|
|
6001
|
+
if (config.showField) {
|
|
6002
|
+
const showField = config.showField;
|
|
6003
|
+
command.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
6004
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
6005
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
6006
|
+
const id = idSchema12.parse(opts.id);
|
|
6007
|
+
await runGraphqlQueryCommand({
|
|
6008
|
+
command: `${config.command}.show`,
|
|
6009
|
+
...config.showOperationName ? { operationName: config.showOperationName } : {},
|
|
6010
|
+
runtimeOptions: context.runtimeOptions,
|
|
6011
|
+
field: showField,
|
|
6012
|
+
variables: {
|
|
6013
|
+
organization_id: organizationId,
|
|
6014
|
+
id
|
|
6015
|
+
},
|
|
6016
|
+
variableTypes: {
|
|
6017
|
+
organization_id: "ID!",
|
|
6018
|
+
id: "ID!"
|
|
6019
|
+
},
|
|
6020
|
+
...config.showSelectionSet ? { selectionSet: config.showSelectionSet } : {},
|
|
6021
|
+
isShow: true
|
|
6022
|
+
});
|
|
6023
|
+
});
|
|
6024
|
+
}
|
|
6025
|
+
const searchConfig = {
|
|
5941
6026
|
command: config.command,
|
|
5942
6027
|
operationName: `${config.listOperationName.replace(/List$/, "")}Search`,
|
|
5943
6028
|
field: config.listField,
|
|
@@ -5947,8 +6032,10 @@ function registerChildCommands(program, config) {
|
|
|
5947
6032
|
config.parentKind,
|
|
5948
6033
|
void 0,
|
|
5949
6034
|
config.listParentTypedField
|
|
5950
|
-
)
|
|
5951
|
-
|
|
6035
|
+
),
|
|
6036
|
+
...config.searchRequiredOptions ? { requiredOptions: config.searchRequiredOptions } : {}
|
|
6037
|
+
};
|
|
6038
|
+
registerGraphqlSearchCommand(command, searchConfig);
|
|
5952
6039
|
command.command("create").requiredOption("--data-json <dataJson>").action(async (opts, cmd) => {
|
|
5953
6040
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
5954
6041
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
@@ -6019,6 +6106,10 @@ function registerChildEntityCommands(program) {
|
|
|
6019
6106
|
destroyOperationName: "SubtasksDestroy",
|
|
6020
6107
|
listSelectionSet: buildChildListSelectionSet("taskId"),
|
|
6021
6108
|
listParentTypedField: "taskId",
|
|
6109
|
+
searchRequiredOptions: requiredParentSearchOption("task-id", "task"),
|
|
6110
|
+
showField: "subtask",
|
|
6111
|
+
showOperationName: "SubtasksShow",
|
|
6112
|
+
showSelectionSet: buildChildResourceSelectionSet("taskId", NOTE_DETAIL_FIELDS),
|
|
6022
6113
|
normalizeCreateBody: normalizeSubtaskCreateBody
|
|
6023
6114
|
});
|
|
6024
6115
|
registerChildCommands(program, {
|
|
@@ -6036,7 +6127,12 @@ function registerChildEntityCommands(program) {
|
|
|
6036
6127
|
createOperationName: "MilestonesCreate",
|
|
6037
6128
|
updateOperationName: "MilestonesUpdate",
|
|
6038
6129
|
destroyOperationName: "MilestonesDestroy",
|
|
6039
|
-
listSelectionSet: buildChildListSelectionSet("rockId")
|
|
6130
|
+
listSelectionSet: buildChildListSelectionSet("rockId"),
|
|
6131
|
+
listParentTypedField: "rockId",
|
|
6132
|
+
searchRequiredOptions: requiredParentSearchOption("rock-id", "rock"),
|
|
6133
|
+
showField: "milestone",
|
|
6134
|
+
showOperationName: "MilestonesShow",
|
|
6135
|
+
showSelectionSet: buildChildResourceSelectionSet("rockId", NOTE_DETAIL_FIELDS)
|
|
6040
6136
|
});
|
|
6041
6137
|
registerChildCommands(program, {
|
|
6042
6138
|
command: "subitems",
|
|
@@ -6054,7 +6150,11 @@ function registerChildEntityCommands(program) {
|
|
|
6054
6150
|
updateOperationName: "SubitemsUpdate",
|
|
6055
6151
|
destroyOperationName: "SubitemsDestroy",
|
|
6056
6152
|
listSelectionSet: buildChildListSelectionSet("listItemId"),
|
|
6057
|
-
listParentTypedField: "listItemId"
|
|
6153
|
+
listParentTypedField: "listItemId",
|
|
6154
|
+
searchRequiredOptions: requiredParentSearchOption("list-item-id", "listItem"),
|
|
6155
|
+
showField: "subitem",
|
|
6156
|
+
showOperationName: "SubitemsShow",
|
|
6157
|
+
showSelectionSet: buildChildResourceSelectionSet("listItemId", NOTE_DETAIL_FIELDS)
|
|
6058
6158
|
});
|
|
6059
6159
|
registerChildCommands(program, {
|
|
6060
6160
|
command: "subtodos",
|
|
@@ -6072,7 +6172,11 @@ function registerChildEntityCommands(program) {
|
|
|
6072
6172
|
updateOperationName: "SubtodosUpdate",
|
|
6073
6173
|
destroyOperationName: "SubtodosDestroy",
|
|
6074
6174
|
listSelectionSet: buildChildListSelectionSet("todoId"),
|
|
6075
|
-
listParentTypedField: "todoId"
|
|
6175
|
+
listParentTypedField: "todoId",
|
|
6176
|
+
searchRequiredOptions: requiredParentSearchOption("todo-id", "todo"),
|
|
6177
|
+
showField: "sub_todo",
|
|
6178
|
+
showOperationName: "SubtodosShow",
|
|
6179
|
+
showSelectionSet: buildChildResourceSelectionSet("todoId", NOTE_DETAIL_FIELDS)
|
|
6076
6180
|
});
|
|
6077
6181
|
registerChildCommands(program, {
|
|
6078
6182
|
command: "subissues",
|
|
@@ -6090,7 +6194,11 @@ function registerChildEntityCommands(program) {
|
|
|
6090
6194
|
updateOperationName: "SubissuesUpdate",
|
|
6091
6195
|
destroyOperationName: "SubissuesDestroy",
|
|
6092
6196
|
listSelectionSet: buildChildListSelectionSet("issueId"),
|
|
6093
|
-
listParentTypedField: "issueId"
|
|
6197
|
+
listParentTypedField: "issueId",
|
|
6198
|
+
searchRequiredOptions: requiredParentSearchOption("issue-id", "issue"),
|
|
6199
|
+
showField: "sub_issue",
|
|
6200
|
+
showOperationName: "SubissuesShow",
|
|
6201
|
+
showSelectionSet: buildChildResourceSelectionSet("issueId", NOTE_DETAIL_FIELDS)
|
|
6094
6202
|
});
|
|
6095
6203
|
registerChildCommands(program, {
|
|
6096
6204
|
command: "talking-points",
|
|
@@ -14775,6 +14883,7 @@ var idempotencyKeySchema = import_zod19.z.string().min(1).refine((value) => valu
|
|
|
14775
14883
|
var skillScopeSchema = import_zod19.z.enum(["ADMIN_GLOBAL", "MEMBER_PERSONAL"]);
|
|
14776
14884
|
var isoDateSchema = import_zod19.z.iso.date();
|
|
14777
14885
|
var nonEmptyStringSchema = import_zod19.z.string().trim().min(1);
|
|
14886
|
+
var AUTOMATION_RUN_HTTP_TIMEOUT_MS = 6e4;
|
|
14778
14887
|
var agentToolAccessSchema = import_zod19.z.array(
|
|
14779
14888
|
import_zod19.z.object({
|
|
14780
14889
|
tool_key: nonEmptyStringSchema,
|
|
@@ -14910,10 +15019,33 @@ var AUTOMATION_SELECTION = `{
|
|
|
14910
15019
|
aiTaskConfig
|
|
14911
15020
|
organizationId
|
|
14912
15021
|
memberId
|
|
15022
|
+
agentId
|
|
14913
15023
|
createdAt
|
|
14914
15024
|
updatedAt
|
|
14915
15025
|
updateVersion
|
|
14916
15026
|
}`;
|
|
15027
|
+
var AUTOMATION_RUN_SELECTION = `{
|
|
15028
|
+
id
|
|
15029
|
+
type
|
|
15030
|
+
attributes {
|
|
15031
|
+
id
|
|
15032
|
+
title
|
|
15033
|
+
status
|
|
15034
|
+
errorMessage
|
|
15035
|
+
usedAt
|
|
15036
|
+
agentTriggerId
|
|
15037
|
+
executionId
|
|
15038
|
+
executionSlug
|
|
15039
|
+
traceId
|
|
15040
|
+
outputContentId
|
|
15041
|
+
outputContentSlug
|
|
15042
|
+
outputContent {
|
|
15043
|
+
id
|
|
15044
|
+
slug
|
|
15045
|
+
}
|
|
15046
|
+
targetId
|
|
15047
|
+
}
|
|
15048
|
+
}`;
|
|
14917
15049
|
function asRecord7(value) {
|
|
14918
15050
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
14919
15051
|
}
|
|
@@ -15021,12 +15153,92 @@ function normalizePersistedUpdatePayload(payload) {
|
|
|
15021
15153
|
persisted: { id, slug, update_version: updateVersion }
|
|
15022
15154
|
};
|
|
15023
15155
|
}
|
|
15156
|
+
function normalizeAutomationRunPayload(payload) {
|
|
15157
|
+
const mutation = asRecord7(payload);
|
|
15158
|
+
if (!mutation) {
|
|
15159
|
+
throw new CliError({
|
|
15160
|
+
message: "Automation run response did not include a mutation payload.",
|
|
15161
|
+
kind: "malformed_response",
|
|
15162
|
+
status: 502,
|
|
15163
|
+
exitCode: EXIT_CODES.networkOrUpstream
|
|
15164
|
+
});
|
|
15165
|
+
}
|
|
15166
|
+
if (mutation.ok !== true) {
|
|
15167
|
+
return {
|
|
15168
|
+
ok: mutation.ok,
|
|
15169
|
+
status: mutation.status,
|
|
15170
|
+
errorCode: mutation.errorCode ?? null,
|
|
15171
|
+
errors: mutation.errors ?? null,
|
|
15172
|
+
data: mutation.data ?? null
|
|
15173
|
+
};
|
|
15174
|
+
}
|
|
15175
|
+
const data = asRecord7(mutation.data);
|
|
15176
|
+
const automationTaskId = asRequiredString(data?.automation_task_id);
|
|
15177
|
+
const automationTaskSlug = asRequiredString(data?.automation_task_slug);
|
|
15178
|
+
const agentId = asRequiredString(data?.agent_id);
|
|
15179
|
+
const agentSlug = asRequiredString(data?.agent_slug);
|
|
15180
|
+
const agentTriggerId = asRequiredString(data?.agent_trigger_id);
|
|
15181
|
+
const executionId = asRequiredString(data?.execution_id);
|
|
15182
|
+
const executionSlug = asRequiredString(data?.execution_slug);
|
|
15183
|
+
const executionStatus = asRequiredString(data?.execution_status);
|
|
15184
|
+
const traceId = asRequiredString(data?.trace_id);
|
|
15185
|
+
if (!data || !automationTaskId || !automationTaskSlug || !agentId || !agentSlug || !agentTriggerId || !executionId || !executionSlug || !executionStatus || !traceId) {
|
|
15186
|
+
throw new CliError({
|
|
15187
|
+
message: "Automation run response did not include automation, execution, and trace evidence.",
|
|
15188
|
+
kind: "malformed_response",
|
|
15189
|
+
status: 502,
|
|
15190
|
+
exitCode: EXIT_CODES.networkOrUpstream
|
|
15191
|
+
});
|
|
15192
|
+
}
|
|
15193
|
+
return {
|
|
15194
|
+
ok: mutation.ok,
|
|
15195
|
+
status: mutation.status,
|
|
15196
|
+
errorCode: mutation.errorCode ?? null,
|
|
15197
|
+
errors: mutation.errors ?? null,
|
|
15198
|
+
run: {
|
|
15199
|
+
executed: data.executed === true,
|
|
15200
|
+
skipped_reason: asRequiredString(data.skipped_reason),
|
|
15201
|
+
automation: {
|
|
15202
|
+
id: automationTaskId,
|
|
15203
|
+
slug: automationTaskSlug
|
|
15204
|
+
},
|
|
15205
|
+
agent: {
|
|
15206
|
+
id: agentId,
|
|
15207
|
+
slug: agentSlug
|
|
15208
|
+
},
|
|
15209
|
+
trigger: {
|
|
15210
|
+
id: agentTriggerId,
|
|
15211
|
+
type: asRequiredString(data.trigger_type)
|
|
15212
|
+
},
|
|
15213
|
+
execution: {
|
|
15214
|
+
id: executionId,
|
|
15215
|
+
slug: executionSlug,
|
|
15216
|
+
status: executionStatus
|
|
15217
|
+
},
|
|
15218
|
+
output_content: {
|
|
15219
|
+
id: asRequiredString(data.output_content_id),
|
|
15220
|
+
slug: asRequiredString(data.output_content_slug)
|
|
15221
|
+
},
|
|
15222
|
+
trace_id: traceId,
|
|
15223
|
+
correlation_id: asRequiredString(data.correlation_id),
|
|
15224
|
+
readback_command: `wave automations run-show --agent-id ${agentSlug} --execution-slug ${executionSlug}`
|
|
15225
|
+
}
|
|
15226
|
+
};
|
|
15227
|
+
}
|
|
15024
15228
|
function parseAutomationConfig(value) {
|
|
15025
15229
|
return automationConfigSchema.parse(parseJson(String(value), "--ai-task-config"));
|
|
15026
15230
|
}
|
|
15027
15231
|
function parseExpectedUpdateVersion(value) {
|
|
15028
15232
|
return nonEmptyStringSchema.parse(String(value));
|
|
15029
15233
|
}
|
|
15234
|
+
function withAutomationRunTimeout(runtimeOptions) {
|
|
15235
|
+
const configuredTimeoutMs = Number(runtimeOptions.timeoutMs);
|
|
15236
|
+
const timeoutMs = Number.isFinite(configuredTimeoutMs) && configuredTimeoutMs > AUTOMATION_RUN_HTTP_TIMEOUT_MS ? configuredTimeoutMs : AUTOMATION_RUN_HTTP_TIMEOUT_MS;
|
|
15237
|
+
return {
|
|
15238
|
+
...runtimeOptions,
|
|
15239
|
+
timeoutMs
|
|
15240
|
+
};
|
|
15241
|
+
}
|
|
15030
15242
|
function registerAtlasAuthoringCommands(program) {
|
|
15031
15243
|
const agents = program.command("agents").description("Bounded Agent authoring operations");
|
|
15032
15244
|
agents.command("create").description("Create an Agent through the API-owned createAgent contract").requiredOption("--idempotency-key <key>", "Required create idempotency key").option("--name <name>").option("--description <description>").option("--notes <notes>").option("--member-id <memberId>").option("--status <status>").option("--visibility <visibility>").option("--model <model>").option("--run-when-mentioned <boolean>", "true or false").option("--web-access-enabled <boolean>", "true or false").option("--web-fetch-enabled <boolean>", "true or false").option("--search-past-conversations-enabled <boolean>", "true or false").option("--app-rules-creation-enabled <boolean>", "true or false").option("--tool-discovery-enabled <boolean>", "true or false").option("--self-updates-enabled <boolean>", "true or false").option("--trusted-urls <urls>", "Comma-separated trusted URLs").option("--tool-access <json>", "JSON array of canonical native Agent tool scopes").option(
|
|
@@ -15259,7 +15471,7 @@ function registerAtlasAuthoringCommands(program) {
|
|
|
15259
15471
|
...opts.description !== void 0 ? { description: String(opts.description) } : {},
|
|
15260
15472
|
...opts.notes !== void 0 ? { notes: String(opts.notes) } : {},
|
|
15261
15473
|
...opts.memberId !== void 0 ? { member_id: idSchema14.parse(opts.memberId) } : {},
|
|
15262
|
-
...opts.agentId !== void 0 ? {
|
|
15474
|
+
...opts.agentId !== void 0 ? { agent_id: idSchema14.parse(opts.agentId) } : {},
|
|
15263
15475
|
...opts.priority !== void 0 ? { priority: String(opts.priority) } : {},
|
|
15264
15476
|
...opts.dueDate !== void 0 ? { due_date: isoDateSchema.parse(opts.dueDate) } : {}
|
|
15265
15477
|
},
|
|
@@ -15283,6 +15495,44 @@ function registerAtlasAuthoringCommands(program) {
|
|
|
15283
15495
|
isShow: true
|
|
15284
15496
|
});
|
|
15285
15497
|
});
|
|
15498
|
+
automations.command("run").description("Run one scheduled Automation by id or slug and return execution trace evidence").requiredOption("--id <idOrSlug>", "Automation id or slug").action(async (opts, cmd) => {
|
|
15499
|
+
const automationId = idSchema14.parse(opts.id);
|
|
15500
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
15501
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
15502
|
+
await runGraphqlMutationCommand({
|
|
15503
|
+
command: "automations.run",
|
|
15504
|
+
operationName: "AutomationsRunNow",
|
|
15505
|
+
runtimeOptions: withAutomationRunTimeout(context.runtimeOptions),
|
|
15506
|
+
field: "run_automation_now",
|
|
15507
|
+
variableTypes: { organization_id: "ID!", automation_id: "ID!" },
|
|
15508
|
+
variables: { organization_id: organizationId, automation_id: automationId },
|
|
15509
|
+
transformMutationPayload: normalizeAutomationRunPayload
|
|
15510
|
+
});
|
|
15511
|
+
});
|
|
15512
|
+
automations.command("run-show").description("Read one Automation run artifact by Agent id and execution slug").requiredOption("--agent-id <agentIdOrSlug>", "Agent id or slug").requiredOption("--execution-slug <executionSlug>", "Execution slug returned by automations run").action(async (opts, cmd) => {
|
|
15513
|
+
const agentId = idSchema14.parse(opts.agentId);
|
|
15514
|
+
const executionSlug = idSchema14.parse(opts.executionSlug);
|
|
15515
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
15516
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
15517
|
+
await runGraphqlQueryCommand({
|
|
15518
|
+
command: "automations.run-show",
|
|
15519
|
+
operationName: "AutomationsRunShow",
|
|
15520
|
+
runtimeOptions: context.runtimeOptions,
|
|
15521
|
+
field: "agent_automation_run",
|
|
15522
|
+
variables: {
|
|
15523
|
+
organization_id: organizationId,
|
|
15524
|
+
agent_id: agentId,
|
|
15525
|
+
automation_id: executionSlug
|
|
15526
|
+
},
|
|
15527
|
+
variableTypes: {
|
|
15528
|
+
organization_id: "ID!",
|
|
15529
|
+
agent_id: "ID!",
|
|
15530
|
+
automation_id: "ID!"
|
|
15531
|
+
},
|
|
15532
|
+
selectionSet: AUTOMATION_RUN_SELECTION,
|
|
15533
|
+
isShow: true
|
|
15534
|
+
});
|
|
15535
|
+
});
|
|
15286
15536
|
automations.command("update").description("Update one task-backed Automation without changing its system-managed status").requiredOption("--id <idOrSlug>", "Automation id or slug").requiredOption(
|
|
15287
15537
|
"--expected-update-version <version>",
|
|
15288
15538
|
"Exact opaque updateVersion value from automations show; rejects stale writes"
|
|
@@ -15424,7 +15674,7 @@ var import_node_path4 = require("path");
|
|
|
15424
15674
|
var import_node_crypto3 = require("crypto");
|
|
15425
15675
|
|
|
15426
15676
|
// src/version.ts
|
|
15427
|
-
var CLI_VERSION = "0.1.
|
|
15677
|
+
var CLI_VERSION = "0.1.74";
|
|
15428
15678
|
|
|
15429
15679
|
// src/operationMetadata.ts
|
|
15430
15680
|
var DISCOVERY_OPERATION_IDS = [
|
|
@@ -15546,6 +15796,7 @@ var READ_OPERATION_IDS = [
|
|
|
15546
15796
|
"agents.plugin-catalog",
|
|
15547
15797
|
"agents.show",
|
|
15548
15798
|
"auth.status",
|
|
15799
|
+
"automations.run-show",
|
|
15549
15800
|
"automations.show",
|
|
15550
15801
|
"broadcast.community",
|
|
15551
15802
|
"broadcast.list",
|
|
@@ -15620,6 +15871,7 @@ var READ_OPERATION_IDS = [
|
|
|
15620
15871
|
"members.show",
|
|
15621
15872
|
"milestones.list",
|
|
15622
15873
|
"milestones.search",
|
|
15874
|
+
"milestones.show",
|
|
15623
15875
|
"news.list",
|
|
15624
15876
|
"news.search",
|
|
15625
15877
|
"news.show",
|
|
@@ -15690,12 +15942,16 @@ var READ_OPERATION_IDS = [
|
|
|
15690
15942
|
"stand-ups.show",
|
|
15691
15943
|
"subissues.list",
|
|
15692
15944
|
"subissues.search",
|
|
15945
|
+
"subissues.show",
|
|
15693
15946
|
"subitems.list",
|
|
15694
15947
|
"subitems.search",
|
|
15948
|
+
"subitems.show",
|
|
15695
15949
|
"subtasks.list",
|
|
15696
15950
|
"subtasks.search",
|
|
15951
|
+
"subtasks.show",
|
|
15697
15952
|
"subtodos.list",
|
|
15698
15953
|
"subtodos.search",
|
|
15954
|
+
"subtodos.show",
|
|
15699
15955
|
"support.counts",
|
|
15700
15956
|
"support.inbox",
|
|
15701
15957
|
"support.knowledge-articles",
|
|
@@ -15739,6 +15995,7 @@ var WRITE_OPERATION_IDS = [
|
|
|
15739
15995
|
"agents.create",
|
|
15740
15996
|
"agents.update",
|
|
15741
15997
|
"automations.create",
|
|
15998
|
+
"automations.run",
|
|
15742
15999
|
"automations.update",
|
|
15743
16000
|
"contacts.create",
|
|
15744
16001
|
"contacts.update",
|
|
@@ -16249,6 +16506,8 @@ var NAMESPACE_DOCS = {
|
|
|
16249
16506
|
examples: [
|
|
16250
16507
|
`wave automations create --summary "Weekly review" --agent-id 123 --ai-task-config '{"cycle":"repeat","repeatSchedule":{"interval":1,"frequency":"week","weekdays":[1,3],"at":"2:30 PM","starting":"2026-07-20T00:00:00.000Z","ending":"never","endingRuns":1,"endingDate":null,"timezone":"America/Phoenix"}}' --idempotency-key automation-create-001`,
|
|
16251
16508
|
"wave automations show --id ATK-01",
|
|
16509
|
+
"wave automations run --id ATK-01",
|
|
16510
|
+
"wave automations run-show --agent-id AGT-01 --execution-slug ART-1234567890",
|
|
16252
16511
|
'wave automations update --id ATK-01 --expected-update-version 2026-07-17T12:00:00.123456Z --summary "Weekly project review"'
|
|
16253
16512
|
],
|
|
16254
16513
|
schema: {
|
|
@@ -16260,10 +16519,11 @@ var NAMESPACE_DOCS = {
|
|
|
16260
16519
|
"Only the API-defined ai_task_config field accepts validated JSON.",
|
|
16261
16520
|
"Optional executor Agent linkage is sent only through the API-defined top-level agentId input.",
|
|
16262
16521
|
"Update calls only updateTask with an exact opaque updateVersion token; it cannot change status, task type, ownership, or project linkage.",
|
|
16263
|
-
"
|
|
16522
|
+
"Run calls only runAutomationNow for an existing scheduled Automation and returns execution/trace evidence.",
|
|
16523
|
+
"Run-show reads the persisted Automation run artifact through agentAutomationRun by Agent id and execution slug.",
|
|
16264
16524
|
"Show uses the API-owned automation query by id; no slug fallback is implemented."
|
|
16265
16525
|
],
|
|
16266
|
-
commands: ["create", "show", "update"]
|
|
16526
|
+
commands: ["create", "show", "run", "run-show", "update"]
|
|
16267
16527
|
}
|
|
16268
16528
|
},
|
|
16269
16529
|
broadcast: {
|
|
@@ -16743,10 +17003,14 @@ async function resolveDoctorAuthOrganization(params) {
|
|
|
16743
17003
|
}
|
|
16744
17004
|
const id = organization.id;
|
|
16745
17005
|
const slug = organization.slug;
|
|
16746
|
-
|
|
16747
|
-
|
|
16748
|
-
|
|
16749
|
-
}
|
|
17006
|
+
const result = {};
|
|
17007
|
+
if (typeof id === "string" && id.trim() !== "") {
|
|
17008
|
+
result.id = id;
|
|
17009
|
+
}
|
|
17010
|
+
if (typeof slug === "string" && slug.trim() !== "") {
|
|
17011
|
+
result.slug = slug;
|
|
17012
|
+
}
|
|
17013
|
+
return result;
|
|
16750
17014
|
} catch {
|
|
16751
17015
|
return null;
|
|
16752
17016
|
}
|
|
@@ -16759,7 +17023,14 @@ async function runDoctor(cmd, opts) {
|
|
|
16759
17023
|
const tokenSource = runtime.tokenSource ?? "none";
|
|
16760
17024
|
const organizationId = context.organizationId;
|
|
16761
17025
|
const authStorage = await getAuthStorageInfo(baseUrl);
|
|
16762
|
-
const
|
|
17026
|
+
const authOptions = {};
|
|
17027
|
+
if (baseUrl) {
|
|
17028
|
+
authOptions.baseUrl = baseUrl;
|
|
17029
|
+
}
|
|
17030
|
+
if (token) {
|
|
17031
|
+
authOptions.token = token;
|
|
17032
|
+
}
|
|
17033
|
+
const authOrganization = organizationId ? null : await resolveDoctorAuthOrganization(authOptions);
|
|
16763
17034
|
const checks = [
|
|
16764
17035
|
{
|
|
16765
17036
|
name: "auth_token",
|
package/dist/index.js
CHANGED
|
@@ -2555,6 +2555,20 @@ function parseSearchQuery(raw) {
|
|
|
2555
2555
|
}
|
|
2556
2556
|
return raw.trim();
|
|
2557
2557
|
}
|
|
2558
|
+
function parseRequiredOption(raw, flag) {
|
|
2559
|
+
if (typeof raw !== "string" || raw.trim().length === 0) {
|
|
2560
|
+
throw new CliError({
|
|
2561
|
+
message: `Missing required option: --${flag}.`,
|
|
2562
|
+
kind: "invalid_args",
|
|
2563
|
+
status: 400,
|
|
2564
|
+
exitCode: EXIT_CODES.invalidArgs
|
|
2565
|
+
});
|
|
2566
|
+
}
|
|
2567
|
+
return raw.trim();
|
|
2568
|
+
}
|
|
2569
|
+
function optionKey(flag) {
|
|
2570
|
+
return flag.replace(/-([a-z])/g, (_, char) => char.toUpperCase());
|
|
2571
|
+
}
|
|
2558
2572
|
function asRecord2(value) {
|
|
2559
2573
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
2560
2574
|
}
|
|
@@ -2591,10 +2605,21 @@ function buildSearchTransform(query, transformData) {
|
|
|
2591
2605
|
};
|
|
2592
2606
|
}
|
|
2593
2607
|
function registerGraphqlSearchCommand(command, config) {
|
|
2594
|
-
|
|
2608
|
+
const requiredOptions = config.requiredOptions ?? [];
|
|
2609
|
+
const search = command.command("search").description("Search records through the existing list GraphQL contract").requiredOption("--query <query>", "Search query").option("--page <page>").option("--per <per>");
|
|
2610
|
+
for (const requiredOption of requiredOptions) {
|
|
2611
|
+
search.requiredOption(`--${requiredOption.flag} <${requiredOption.flag}>`, requiredOption.description);
|
|
2612
|
+
}
|
|
2613
|
+
search.action(async (opts, cmd) => {
|
|
2595
2614
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2596
2615
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2597
2616
|
const query = parseSearchQuery(opts.query);
|
|
2617
|
+
const requiredVariables = Object.fromEntries(
|
|
2618
|
+
requiredOptions.map((requiredOption) => [
|
|
2619
|
+
requiredOption.variable,
|
|
2620
|
+
parseRequiredOption(opts[optionKey(requiredOption.flag)], requiredOption.flag)
|
|
2621
|
+
])
|
|
2622
|
+
);
|
|
2598
2623
|
await runGraphqlQueryCommand({
|
|
2599
2624
|
command: `${config.command}.search`,
|
|
2600
2625
|
operationName: config.operationName,
|
|
@@ -2603,13 +2628,20 @@ function registerGraphqlSearchCommand(command, config) {
|
|
|
2603
2628
|
variables: normalizeGraphqlVariables2({
|
|
2604
2629
|
organization_id: organizationId,
|
|
2605
2630
|
page: opts.page,
|
|
2606
|
-
per: opts.per
|
|
2631
|
+
per: opts.per,
|
|
2632
|
+
...requiredVariables
|
|
2607
2633
|
}),
|
|
2608
2634
|
variableTypes: {
|
|
2609
2635
|
organization_id: "ID!",
|
|
2610
2636
|
page: "Int",
|
|
2611
2637
|
per: "Int",
|
|
2612
|
-
...config.variableTypes ?? {}
|
|
2638
|
+
...config.variableTypes ?? {},
|
|
2639
|
+
...Object.fromEntries(
|
|
2640
|
+
requiredOptions.map((requiredOption) => [
|
|
2641
|
+
requiredOption.variable,
|
|
2642
|
+
requiredOption.variableType
|
|
2643
|
+
])
|
|
2644
|
+
)
|
|
2613
2645
|
},
|
|
2614
2646
|
isList: true,
|
|
2615
2647
|
selectionSet: config.selectionSet,
|
|
@@ -3447,8 +3479,8 @@ function registerEntityCrudCommands(program, config) {
|
|
|
3447
3479
|
const extraQuery = allowQueryJson ? parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0) : {};
|
|
3448
3480
|
const mappedKnownParams = Object.fromEntries(
|
|
3449
3481
|
listParams.map((param) => {
|
|
3450
|
-
const
|
|
3451
|
-
return [param, opts[
|
|
3482
|
+
const optionKey2 = param.replace(/_([a-z])/g, (_, char) => char.toUpperCase());
|
|
3483
|
+
return [param, opts[optionKey2]];
|
|
3452
3484
|
})
|
|
3453
3485
|
);
|
|
3454
3486
|
const variables = normalizeGraphqlVariables2({
|
|
@@ -3487,8 +3519,8 @@ function registerEntityCrudCommands(program, config) {
|
|
|
3487
3519
|
const defaultField = config.showField ?? (config.resourcePath === "feedback" ? "feedback" : toSingularResourceName(config.resourcePath));
|
|
3488
3520
|
const mappedShowParams = Object.fromEntries(
|
|
3489
3521
|
showParams.map((param) => {
|
|
3490
|
-
const
|
|
3491
|
-
return [param, opts[
|
|
3522
|
+
const optionKey2 = param.replace(/_([a-z])/g, (_, char) => char.toUpperCase());
|
|
3523
|
+
return [param, opts[optionKey2]];
|
|
3492
3524
|
})
|
|
3493
3525
|
);
|
|
3494
3526
|
const defaultVariables = normalizeGraphqlVariables2({
|
|
@@ -5787,12 +5819,41 @@ function registerFoundationCommands(program) {
|
|
|
5787
5819
|
import { z as z13 } from "zod";
|
|
5788
5820
|
var idSchema12 = z13.string().min(1);
|
|
5789
5821
|
var jsonObjectSchema = z13.record(z13.string(), z13.unknown());
|
|
5790
|
-
|
|
5822
|
+
var NOTE_DETAIL_FIELDS = [
|
|
5823
|
+
"notes",
|
|
5824
|
+
"hasNotes",
|
|
5825
|
+
"hasUnreadNotes",
|
|
5826
|
+
"notesUpdatedAt",
|
|
5827
|
+
"notesLastReadAt",
|
|
5828
|
+
"estimateIds"
|
|
5829
|
+
];
|
|
5830
|
+
var PARENT_KIND_LABELS = {
|
|
5831
|
+
task: "task",
|
|
5832
|
+
rock: "rock",
|
|
5833
|
+
listItem: "list item",
|
|
5834
|
+
todo: "todo",
|
|
5835
|
+
issue: "issue",
|
|
5836
|
+
meeting: "meeting"
|
|
5837
|
+
};
|
|
5838
|
+
function requiredParentSearchOption(parentFlag, parentKind) {
|
|
5839
|
+
return [
|
|
5840
|
+
{
|
|
5841
|
+
flag: parentFlag,
|
|
5842
|
+
variable: parentFlag.replace(/-/g, "_"),
|
|
5843
|
+
variableType: "ID!",
|
|
5844
|
+
description: `Parent ${PARENT_KIND_LABELS[parentKind]} ID`
|
|
5845
|
+
}
|
|
5846
|
+
];
|
|
5847
|
+
}
|
|
5848
|
+
function buildChildResourceSelectionSet(parentField, extraFields = []) {
|
|
5791
5849
|
const fields = Array.from(
|
|
5792
5850
|
/* @__PURE__ */ new Set(["id", "type", "name", "status", "priority", "rank", "dueDate", "memberId", parentField, ...extraFields])
|
|
5793
5851
|
);
|
|
5794
5852
|
const attributeFields = fields.filter((field) => field !== "type");
|
|
5795
|
-
return `{
|
|
5853
|
+
return `{ ${fields.join(" ")} attributes { ${attributeFields.join(" ")} } }`;
|
|
5854
|
+
}
|
|
5855
|
+
function buildChildListSelectionSet(parentField, extraFields = []) {
|
|
5856
|
+
return `{ data ${buildChildResourceSelectionSet(parentField, extraFields)} count currentPage totalPages }`;
|
|
5796
5857
|
}
|
|
5797
5858
|
function parseJsonObject2(raw) {
|
|
5798
5859
|
try {
|
|
@@ -5936,7 +5997,31 @@ function registerChildCommands(program, config) {
|
|
|
5936
5997
|
)
|
|
5937
5998
|
});
|
|
5938
5999
|
});
|
|
5939
|
-
|
|
6000
|
+
if (config.showField) {
|
|
6001
|
+
const showField = config.showField;
|
|
6002
|
+
command.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
6003
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
6004
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
6005
|
+
const id = idSchema12.parse(opts.id);
|
|
6006
|
+
await runGraphqlQueryCommand({
|
|
6007
|
+
command: `${config.command}.show`,
|
|
6008
|
+
...config.showOperationName ? { operationName: config.showOperationName } : {},
|
|
6009
|
+
runtimeOptions: context.runtimeOptions,
|
|
6010
|
+
field: showField,
|
|
6011
|
+
variables: {
|
|
6012
|
+
organization_id: organizationId,
|
|
6013
|
+
id
|
|
6014
|
+
},
|
|
6015
|
+
variableTypes: {
|
|
6016
|
+
organization_id: "ID!",
|
|
6017
|
+
id: "ID!"
|
|
6018
|
+
},
|
|
6019
|
+
...config.showSelectionSet ? { selectionSet: config.showSelectionSet } : {},
|
|
6020
|
+
isShow: true
|
|
6021
|
+
});
|
|
6022
|
+
});
|
|
6023
|
+
}
|
|
6024
|
+
const searchConfig = {
|
|
5940
6025
|
command: config.command,
|
|
5941
6026
|
operationName: `${config.listOperationName.replace(/List$/, "")}Search`,
|
|
5942
6027
|
field: config.listField,
|
|
@@ -5946,8 +6031,10 @@ function registerChildCommands(program, config) {
|
|
|
5946
6031
|
config.parentKind,
|
|
5947
6032
|
void 0,
|
|
5948
6033
|
config.listParentTypedField
|
|
5949
|
-
)
|
|
5950
|
-
|
|
6034
|
+
),
|
|
6035
|
+
...config.searchRequiredOptions ? { requiredOptions: config.searchRequiredOptions } : {}
|
|
6036
|
+
};
|
|
6037
|
+
registerGraphqlSearchCommand(command, searchConfig);
|
|
5951
6038
|
command.command("create").requiredOption("--data-json <dataJson>").action(async (opts, cmd) => {
|
|
5952
6039
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
5953
6040
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
@@ -6018,6 +6105,10 @@ function registerChildEntityCommands(program) {
|
|
|
6018
6105
|
destroyOperationName: "SubtasksDestroy",
|
|
6019
6106
|
listSelectionSet: buildChildListSelectionSet("taskId"),
|
|
6020
6107
|
listParentTypedField: "taskId",
|
|
6108
|
+
searchRequiredOptions: requiredParentSearchOption("task-id", "task"),
|
|
6109
|
+
showField: "subtask",
|
|
6110
|
+
showOperationName: "SubtasksShow",
|
|
6111
|
+
showSelectionSet: buildChildResourceSelectionSet("taskId", NOTE_DETAIL_FIELDS),
|
|
6021
6112
|
normalizeCreateBody: normalizeSubtaskCreateBody
|
|
6022
6113
|
});
|
|
6023
6114
|
registerChildCommands(program, {
|
|
@@ -6035,7 +6126,12 @@ function registerChildEntityCommands(program) {
|
|
|
6035
6126
|
createOperationName: "MilestonesCreate",
|
|
6036
6127
|
updateOperationName: "MilestonesUpdate",
|
|
6037
6128
|
destroyOperationName: "MilestonesDestroy",
|
|
6038
|
-
listSelectionSet: buildChildListSelectionSet("rockId")
|
|
6129
|
+
listSelectionSet: buildChildListSelectionSet("rockId"),
|
|
6130
|
+
listParentTypedField: "rockId",
|
|
6131
|
+
searchRequiredOptions: requiredParentSearchOption("rock-id", "rock"),
|
|
6132
|
+
showField: "milestone",
|
|
6133
|
+
showOperationName: "MilestonesShow",
|
|
6134
|
+
showSelectionSet: buildChildResourceSelectionSet("rockId", NOTE_DETAIL_FIELDS)
|
|
6039
6135
|
});
|
|
6040
6136
|
registerChildCommands(program, {
|
|
6041
6137
|
command: "subitems",
|
|
@@ -6053,7 +6149,11 @@ function registerChildEntityCommands(program) {
|
|
|
6053
6149
|
updateOperationName: "SubitemsUpdate",
|
|
6054
6150
|
destroyOperationName: "SubitemsDestroy",
|
|
6055
6151
|
listSelectionSet: buildChildListSelectionSet("listItemId"),
|
|
6056
|
-
listParentTypedField: "listItemId"
|
|
6152
|
+
listParentTypedField: "listItemId",
|
|
6153
|
+
searchRequiredOptions: requiredParentSearchOption("list-item-id", "listItem"),
|
|
6154
|
+
showField: "subitem",
|
|
6155
|
+
showOperationName: "SubitemsShow",
|
|
6156
|
+
showSelectionSet: buildChildResourceSelectionSet("listItemId", NOTE_DETAIL_FIELDS)
|
|
6057
6157
|
});
|
|
6058
6158
|
registerChildCommands(program, {
|
|
6059
6159
|
command: "subtodos",
|
|
@@ -6071,7 +6171,11 @@ function registerChildEntityCommands(program) {
|
|
|
6071
6171
|
updateOperationName: "SubtodosUpdate",
|
|
6072
6172
|
destroyOperationName: "SubtodosDestroy",
|
|
6073
6173
|
listSelectionSet: buildChildListSelectionSet("todoId"),
|
|
6074
|
-
listParentTypedField: "todoId"
|
|
6174
|
+
listParentTypedField: "todoId",
|
|
6175
|
+
searchRequiredOptions: requiredParentSearchOption("todo-id", "todo"),
|
|
6176
|
+
showField: "sub_todo",
|
|
6177
|
+
showOperationName: "SubtodosShow",
|
|
6178
|
+
showSelectionSet: buildChildResourceSelectionSet("todoId", NOTE_DETAIL_FIELDS)
|
|
6075
6179
|
});
|
|
6076
6180
|
registerChildCommands(program, {
|
|
6077
6181
|
command: "subissues",
|
|
@@ -6089,7 +6193,11 @@ function registerChildEntityCommands(program) {
|
|
|
6089
6193
|
updateOperationName: "SubissuesUpdate",
|
|
6090
6194
|
destroyOperationName: "SubissuesDestroy",
|
|
6091
6195
|
listSelectionSet: buildChildListSelectionSet("issueId"),
|
|
6092
|
-
listParentTypedField: "issueId"
|
|
6196
|
+
listParentTypedField: "issueId",
|
|
6197
|
+
searchRequiredOptions: requiredParentSearchOption("issue-id", "issue"),
|
|
6198
|
+
showField: "sub_issue",
|
|
6199
|
+
showOperationName: "SubissuesShow",
|
|
6200
|
+
showSelectionSet: buildChildResourceSelectionSet("issueId", NOTE_DETAIL_FIELDS)
|
|
6093
6201
|
});
|
|
6094
6202
|
registerChildCommands(program, {
|
|
6095
6203
|
command: "talking-points",
|
|
@@ -14774,6 +14882,7 @@ var idempotencyKeySchema = z19.string().min(1).refine((value) => value.trim() ==
|
|
|
14774
14882
|
var skillScopeSchema = z19.enum(["ADMIN_GLOBAL", "MEMBER_PERSONAL"]);
|
|
14775
14883
|
var isoDateSchema = z19.iso.date();
|
|
14776
14884
|
var nonEmptyStringSchema = z19.string().trim().min(1);
|
|
14885
|
+
var AUTOMATION_RUN_HTTP_TIMEOUT_MS = 6e4;
|
|
14777
14886
|
var agentToolAccessSchema = z19.array(
|
|
14778
14887
|
z19.object({
|
|
14779
14888
|
tool_key: nonEmptyStringSchema,
|
|
@@ -14909,10 +15018,33 @@ var AUTOMATION_SELECTION = `{
|
|
|
14909
15018
|
aiTaskConfig
|
|
14910
15019
|
organizationId
|
|
14911
15020
|
memberId
|
|
15021
|
+
agentId
|
|
14912
15022
|
createdAt
|
|
14913
15023
|
updatedAt
|
|
14914
15024
|
updateVersion
|
|
14915
15025
|
}`;
|
|
15026
|
+
var AUTOMATION_RUN_SELECTION = `{
|
|
15027
|
+
id
|
|
15028
|
+
type
|
|
15029
|
+
attributes {
|
|
15030
|
+
id
|
|
15031
|
+
title
|
|
15032
|
+
status
|
|
15033
|
+
errorMessage
|
|
15034
|
+
usedAt
|
|
15035
|
+
agentTriggerId
|
|
15036
|
+
executionId
|
|
15037
|
+
executionSlug
|
|
15038
|
+
traceId
|
|
15039
|
+
outputContentId
|
|
15040
|
+
outputContentSlug
|
|
15041
|
+
outputContent {
|
|
15042
|
+
id
|
|
15043
|
+
slug
|
|
15044
|
+
}
|
|
15045
|
+
targetId
|
|
15046
|
+
}
|
|
15047
|
+
}`;
|
|
14916
15048
|
function asRecord7(value) {
|
|
14917
15049
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
14918
15050
|
}
|
|
@@ -15020,12 +15152,92 @@ function normalizePersistedUpdatePayload(payload) {
|
|
|
15020
15152
|
persisted: { id, slug, update_version: updateVersion }
|
|
15021
15153
|
};
|
|
15022
15154
|
}
|
|
15155
|
+
function normalizeAutomationRunPayload(payload) {
|
|
15156
|
+
const mutation = asRecord7(payload);
|
|
15157
|
+
if (!mutation) {
|
|
15158
|
+
throw new CliError({
|
|
15159
|
+
message: "Automation run response did not include a mutation payload.",
|
|
15160
|
+
kind: "malformed_response",
|
|
15161
|
+
status: 502,
|
|
15162
|
+
exitCode: EXIT_CODES.networkOrUpstream
|
|
15163
|
+
});
|
|
15164
|
+
}
|
|
15165
|
+
if (mutation.ok !== true) {
|
|
15166
|
+
return {
|
|
15167
|
+
ok: mutation.ok,
|
|
15168
|
+
status: mutation.status,
|
|
15169
|
+
errorCode: mutation.errorCode ?? null,
|
|
15170
|
+
errors: mutation.errors ?? null,
|
|
15171
|
+
data: mutation.data ?? null
|
|
15172
|
+
};
|
|
15173
|
+
}
|
|
15174
|
+
const data = asRecord7(mutation.data);
|
|
15175
|
+
const automationTaskId = asRequiredString(data?.automation_task_id);
|
|
15176
|
+
const automationTaskSlug = asRequiredString(data?.automation_task_slug);
|
|
15177
|
+
const agentId = asRequiredString(data?.agent_id);
|
|
15178
|
+
const agentSlug = asRequiredString(data?.agent_slug);
|
|
15179
|
+
const agentTriggerId = asRequiredString(data?.agent_trigger_id);
|
|
15180
|
+
const executionId = asRequiredString(data?.execution_id);
|
|
15181
|
+
const executionSlug = asRequiredString(data?.execution_slug);
|
|
15182
|
+
const executionStatus = asRequiredString(data?.execution_status);
|
|
15183
|
+
const traceId = asRequiredString(data?.trace_id);
|
|
15184
|
+
if (!data || !automationTaskId || !automationTaskSlug || !agentId || !agentSlug || !agentTriggerId || !executionId || !executionSlug || !executionStatus || !traceId) {
|
|
15185
|
+
throw new CliError({
|
|
15186
|
+
message: "Automation run response did not include automation, execution, and trace evidence.",
|
|
15187
|
+
kind: "malformed_response",
|
|
15188
|
+
status: 502,
|
|
15189
|
+
exitCode: EXIT_CODES.networkOrUpstream
|
|
15190
|
+
});
|
|
15191
|
+
}
|
|
15192
|
+
return {
|
|
15193
|
+
ok: mutation.ok,
|
|
15194
|
+
status: mutation.status,
|
|
15195
|
+
errorCode: mutation.errorCode ?? null,
|
|
15196
|
+
errors: mutation.errors ?? null,
|
|
15197
|
+
run: {
|
|
15198
|
+
executed: data.executed === true,
|
|
15199
|
+
skipped_reason: asRequiredString(data.skipped_reason),
|
|
15200
|
+
automation: {
|
|
15201
|
+
id: automationTaskId,
|
|
15202
|
+
slug: automationTaskSlug
|
|
15203
|
+
},
|
|
15204
|
+
agent: {
|
|
15205
|
+
id: agentId,
|
|
15206
|
+
slug: agentSlug
|
|
15207
|
+
},
|
|
15208
|
+
trigger: {
|
|
15209
|
+
id: agentTriggerId,
|
|
15210
|
+
type: asRequiredString(data.trigger_type)
|
|
15211
|
+
},
|
|
15212
|
+
execution: {
|
|
15213
|
+
id: executionId,
|
|
15214
|
+
slug: executionSlug,
|
|
15215
|
+
status: executionStatus
|
|
15216
|
+
},
|
|
15217
|
+
output_content: {
|
|
15218
|
+
id: asRequiredString(data.output_content_id),
|
|
15219
|
+
slug: asRequiredString(data.output_content_slug)
|
|
15220
|
+
},
|
|
15221
|
+
trace_id: traceId,
|
|
15222
|
+
correlation_id: asRequiredString(data.correlation_id),
|
|
15223
|
+
readback_command: `wave automations run-show --agent-id ${agentSlug} --execution-slug ${executionSlug}`
|
|
15224
|
+
}
|
|
15225
|
+
};
|
|
15226
|
+
}
|
|
15023
15227
|
function parseAutomationConfig(value) {
|
|
15024
15228
|
return automationConfigSchema.parse(parseJson(String(value), "--ai-task-config"));
|
|
15025
15229
|
}
|
|
15026
15230
|
function parseExpectedUpdateVersion(value) {
|
|
15027
15231
|
return nonEmptyStringSchema.parse(String(value));
|
|
15028
15232
|
}
|
|
15233
|
+
function withAutomationRunTimeout(runtimeOptions) {
|
|
15234
|
+
const configuredTimeoutMs = Number(runtimeOptions.timeoutMs);
|
|
15235
|
+
const timeoutMs = Number.isFinite(configuredTimeoutMs) && configuredTimeoutMs > AUTOMATION_RUN_HTTP_TIMEOUT_MS ? configuredTimeoutMs : AUTOMATION_RUN_HTTP_TIMEOUT_MS;
|
|
15236
|
+
return {
|
|
15237
|
+
...runtimeOptions,
|
|
15238
|
+
timeoutMs
|
|
15239
|
+
};
|
|
15240
|
+
}
|
|
15029
15241
|
function registerAtlasAuthoringCommands(program) {
|
|
15030
15242
|
const agents = program.command("agents").description("Bounded Agent authoring operations");
|
|
15031
15243
|
agents.command("create").description("Create an Agent through the API-owned createAgent contract").requiredOption("--idempotency-key <key>", "Required create idempotency key").option("--name <name>").option("--description <description>").option("--notes <notes>").option("--member-id <memberId>").option("--status <status>").option("--visibility <visibility>").option("--model <model>").option("--run-when-mentioned <boolean>", "true or false").option("--web-access-enabled <boolean>", "true or false").option("--web-fetch-enabled <boolean>", "true or false").option("--search-past-conversations-enabled <boolean>", "true or false").option("--app-rules-creation-enabled <boolean>", "true or false").option("--tool-discovery-enabled <boolean>", "true or false").option("--self-updates-enabled <boolean>", "true or false").option("--trusted-urls <urls>", "Comma-separated trusted URLs").option("--tool-access <json>", "JSON array of canonical native Agent tool scopes").option(
|
|
@@ -15258,7 +15470,7 @@ function registerAtlasAuthoringCommands(program) {
|
|
|
15258
15470
|
...opts.description !== void 0 ? { description: String(opts.description) } : {},
|
|
15259
15471
|
...opts.notes !== void 0 ? { notes: String(opts.notes) } : {},
|
|
15260
15472
|
...opts.memberId !== void 0 ? { member_id: idSchema14.parse(opts.memberId) } : {},
|
|
15261
|
-
...opts.agentId !== void 0 ? {
|
|
15473
|
+
...opts.agentId !== void 0 ? { agent_id: idSchema14.parse(opts.agentId) } : {},
|
|
15262
15474
|
...opts.priority !== void 0 ? { priority: String(opts.priority) } : {},
|
|
15263
15475
|
...opts.dueDate !== void 0 ? { due_date: isoDateSchema.parse(opts.dueDate) } : {}
|
|
15264
15476
|
},
|
|
@@ -15282,6 +15494,44 @@ function registerAtlasAuthoringCommands(program) {
|
|
|
15282
15494
|
isShow: true
|
|
15283
15495
|
});
|
|
15284
15496
|
});
|
|
15497
|
+
automations.command("run").description("Run one scheduled Automation by id or slug and return execution trace evidence").requiredOption("--id <idOrSlug>", "Automation id or slug").action(async (opts, cmd) => {
|
|
15498
|
+
const automationId = idSchema14.parse(opts.id);
|
|
15499
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
15500
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
15501
|
+
await runGraphqlMutationCommand({
|
|
15502
|
+
command: "automations.run",
|
|
15503
|
+
operationName: "AutomationsRunNow",
|
|
15504
|
+
runtimeOptions: withAutomationRunTimeout(context.runtimeOptions),
|
|
15505
|
+
field: "run_automation_now",
|
|
15506
|
+
variableTypes: { organization_id: "ID!", automation_id: "ID!" },
|
|
15507
|
+
variables: { organization_id: organizationId, automation_id: automationId },
|
|
15508
|
+
transformMutationPayload: normalizeAutomationRunPayload
|
|
15509
|
+
});
|
|
15510
|
+
});
|
|
15511
|
+
automations.command("run-show").description("Read one Automation run artifact by Agent id and execution slug").requiredOption("--agent-id <agentIdOrSlug>", "Agent id or slug").requiredOption("--execution-slug <executionSlug>", "Execution slug returned by automations run").action(async (opts, cmd) => {
|
|
15512
|
+
const agentId = idSchema14.parse(opts.agentId);
|
|
15513
|
+
const executionSlug = idSchema14.parse(opts.executionSlug);
|
|
15514
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
15515
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
15516
|
+
await runGraphqlQueryCommand({
|
|
15517
|
+
command: "automations.run-show",
|
|
15518
|
+
operationName: "AutomationsRunShow",
|
|
15519
|
+
runtimeOptions: context.runtimeOptions,
|
|
15520
|
+
field: "agent_automation_run",
|
|
15521
|
+
variables: {
|
|
15522
|
+
organization_id: organizationId,
|
|
15523
|
+
agent_id: agentId,
|
|
15524
|
+
automation_id: executionSlug
|
|
15525
|
+
},
|
|
15526
|
+
variableTypes: {
|
|
15527
|
+
organization_id: "ID!",
|
|
15528
|
+
agent_id: "ID!",
|
|
15529
|
+
automation_id: "ID!"
|
|
15530
|
+
},
|
|
15531
|
+
selectionSet: AUTOMATION_RUN_SELECTION,
|
|
15532
|
+
isShow: true
|
|
15533
|
+
});
|
|
15534
|
+
});
|
|
15285
15535
|
automations.command("update").description("Update one task-backed Automation without changing its system-managed status").requiredOption("--id <idOrSlug>", "Automation id or slug").requiredOption(
|
|
15286
15536
|
"--expected-update-version <version>",
|
|
15287
15537
|
"Exact opaque updateVersion value from automations show; rejects stale writes"
|
|
@@ -15423,7 +15673,7 @@ import { join as join3 } from "path";
|
|
|
15423
15673
|
import { createHash } from "crypto";
|
|
15424
15674
|
|
|
15425
15675
|
// src/version.ts
|
|
15426
|
-
var CLI_VERSION = "0.1.
|
|
15676
|
+
var CLI_VERSION = "0.1.74";
|
|
15427
15677
|
|
|
15428
15678
|
// src/operationMetadata.ts
|
|
15429
15679
|
var DISCOVERY_OPERATION_IDS = [
|
|
@@ -15545,6 +15795,7 @@ var READ_OPERATION_IDS = [
|
|
|
15545
15795
|
"agents.plugin-catalog",
|
|
15546
15796
|
"agents.show",
|
|
15547
15797
|
"auth.status",
|
|
15798
|
+
"automations.run-show",
|
|
15548
15799
|
"automations.show",
|
|
15549
15800
|
"broadcast.community",
|
|
15550
15801
|
"broadcast.list",
|
|
@@ -15619,6 +15870,7 @@ var READ_OPERATION_IDS = [
|
|
|
15619
15870
|
"members.show",
|
|
15620
15871
|
"milestones.list",
|
|
15621
15872
|
"milestones.search",
|
|
15873
|
+
"milestones.show",
|
|
15622
15874
|
"news.list",
|
|
15623
15875
|
"news.search",
|
|
15624
15876
|
"news.show",
|
|
@@ -15689,12 +15941,16 @@ var READ_OPERATION_IDS = [
|
|
|
15689
15941
|
"stand-ups.show",
|
|
15690
15942
|
"subissues.list",
|
|
15691
15943
|
"subissues.search",
|
|
15944
|
+
"subissues.show",
|
|
15692
15945
|
"subitems.list",
|
|
15693
15946
|
"subitems.search",
|
|
15947
|
+
"subitems.show",
|
|
15694
15948
|
"subtasks.list",
|
|
15695
15949
|
"subtasks.search",
|
|
15950
|
+
"subtasks.show",
|
|
15696
15951
|
"subtodos.list",
|
|
15697
15952
|
"subtodos.search",
|
|
15953
|
+
"subtodos.show",
|
|
15698
15954
|
"support.counts",
|
|
15699
15955
|
"support.inbox",
|
|
15700
15956
|
"support.knowledge-articles",
|
|
@@ -15738,6 +15994,7 @@ var WRITE_OPERATION_IDS = [
|
|
|
15738
15994
|
"agents.create",
|
|
15739
15995
|
"agents.update",
|
|
15740
15996
|
"automations.create",
|
|
15997
|
+
"automations.run",
|
|
15741
15998
|
"automations.update",
|
|
15742
15999
|
"contacts.create",
|
|
15743
16000
|
"contacts.update",
|
|
@@ -16248,6 +16505,8 @@ var NAMESPACE_DOCS = {
|
|
|
16248
16505
|
examples: [
|
|
16249
16506
|
`wave automations create --summary "Weekly review" --agent-id 123 --ai-task-config '{"cycle":"repeat","repeatSchedule":{"interval":1,"frequency":"week","weekdays":[1,3],"at":"2:30 PM","starting":"2026-07-20T00:00:00.000Z","ending":"never","endingRuns":1,"endingDate":null,"timezone":"America/Phoenix"}}' --idempotency-key automation-create-001`,
|
|
16250
16507
|
"wave automations show --id ATK-01",
|
|
16508
|
+
"wave automations run --id ATK-01",
|
|
16509
|
+
"wave automations run-show --agent-id AGT-01 --execution-slug ART-1234567890",
|
|
16251
16510
|
'wave automations update --id ATK-01 --expected-update-version 2026-07-17T12:00:00.123456Z --summary "Weekly project review"'
|
|
16252
16511
|
],
|
|
16253
16512
|
schema: {
|
|
@@ -16259,10 +16518,11 @@ var NAMESPACE_DOCS = {
|
|
|
16259
16518
|
"Only the API-defined ai_task_config field accepts validated JSON.",
|
|
16260
16519
|
"Optional executor Agent linkage is sent only through the API-defined top-level agentId input.",
|
|
16261
16520
|
"Update calls only updateTask with an exact opaque updateVersion token; it cannot change status, task type, ownership, or project linkage.",
|
|
16262
|
-
"
|
|
16521
|
+
"Run calls only runAutomationNow for an existing scheduled Automation and returns execution/trace evidence.",
|
|
16522
|
+
"Run-show reads the persisted Automation run artifact through agentAutomationRun by Agent id and execution slug.",
|
|
16263
16523
|
"Show uses the API-owned automation query by id; no slug fallback is implemented."
|
|
16264
16524
|
],
|
|
16265
|
-
commands: ["create", "show", "update"]
|
|
16525
|
+
commands: ["create", "show", "run", "run-show", "update"]
|
|
16266
16526
|
}
|
|
16267
16527
|
},
|
|
16268
16528
|
broadcast: {
|
|
@@ -16742,10 +17002,14 @@ async function resolveDoctorAuthOrganization(params) {
|
|
|
16742
17002
|
}
|
|
16743
17003
|
const id = organization.id;
|
|
16744
17004
|
const slug = organization.slug;
|
|
16745
|
-
|
|
16746
|
-
|
|
16747
|
-
|
|
16748
|
-
}
|
|
17005
|
+
const result = {};
|
|
17006
|
+
if (typeof id === "string" && id.trim() !== "") {
|
|
17007
|
+
result.id = id;
|
|
17008
|
+
}
|
|
17009
|
+
if (typeof slug === "string" && slug.trim() !== "") {
|
|
17010
|
+
result.slug = slug;
|
|
17011
|
+
}
|
|
17012
|
+
return result;
|
|
16749
17013
|
} catch {
|
|
16750
17014
|
return null;
|
|
16751
17015
|
}
|
|
@@ -16758,7 +17022,14 @@ async function runDoctor(cmd, opts) {
|
|
|
16758
17022
|
const tokenSource = runtime.tokenSource ?? "none";
|
|
16759
17023
|
const organizationId = context.organizationId;
|
|
16760
17024
|
const authStorage = await getAuthStorageInfo(baseUrl);
|
|
16761
|
-
const
|
|
17025
|
+
const authOptions = {};
|
|
17026
|
+
if (baseUrl) {
|
|
17027
|
+
authOptions.baseUrl = baseUrl;
|
|
17028
|
+
}
|
|
17029
|
+
if (token) {
|
|
17030
|
+
authOptions.token = token;
|
|
17031
|
+
}
|
|
17032
|
+
const authOrganization = organizationId ? null : await resolveDoctorAuthOrganization(authOptions);
|
|
16762
17033
|
const checks = [
|
|
16763
17034
|
{
|
|
16764
17035
|
name: "auth_token",
|