@wave-ai-os/wave-cli 0.1.71 → 0.1.72
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 +310 -46
- package/dist/index.js +310 -46
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4199,18 +4199,8 @@ var SKILL_SELECTION = `{
|
|
|
4199
4199
|
}
|
|
4200
4200
|
createdAt
|
|
4201
4201
|
updatedAt
|
|
4202
|
+
updateVersion
|
|
4202
4203
|
}`;
|
|
4203
|
-
function asRecord4(value) {
|
|
4204
|
-
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
4205
|
-
}
|
|
4206
|
-
function findSkillById(id) {
|
|
4207
|
-
return (payload) => {
|
|
4208
|
-
if (!Array.isArray(payload)) {
|
|
4209
|
-
return null;
|
|
4210
|
-
}
|
|
4211
|
-
return payload.find((entry2) => String(asRecord4(entry2)?.id ?? "") === id) ?? null;
|
|
4212
|
-
};
|
|
4213
|
-
}
|
|
4214
4204
|
function registerSkillCommands(program) {
|
|
4215
4205
|
const skills = program.command("skills").description("Skill record operations");
|
|
4216
4206
|
skills.command("list").description("List Skill records").option("--scope <scope>", "Filter skills by scope").option("--query <query>", "Filter skills by search query").option("--limit <limit>", "Limit skills returned").requiredOption("--json", "Emit the stable JSON envelope").action(async (opts, cmd) => {
|
|
@@ -4238,7 +4228,7 @@ function registerSkillCommands(program) {
|
|
|
4238
4228
|
isList: true
|
|
4239
4229
|
});
|
|
4240
4230
|
});
|
|
4241
|
-
skills.command("show").description("Read one persisted Skill record by id").requiredOption("--id <
|
|
4231
|
+
skills.command("show").description("Read one persisted Skill record by id or slug").requiredOption("--id <idOrSlug>", "Skill id or slug").option("--json", "Emit the stable JSON envelope").action(async (opts, cmd) => {
|
|
4242
4232
|
const id = idSchema7.parse(opts.id);
|
|
4243
4233
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
4244
4234
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
@@ -4246,16 +4236,17 @@ function registerSkillCommands(program) {
|
|
|
4246
4236
|
command: "skills.show",
|
|
4247
4237
|
operationName: "SkillsShow",
|
|
4248
4238
|
runtimeOptions: context.runtimeOptions,
|
|
4249
|
-
field: "
|
|
4239
|
+
field: "skill",
|
|
4250
4240
|
variables: {
|
|
4251
|
-
organization_id: organizationId
|
|
4241
|
+
organization_id: organizationId,
|
|
4242
|
+
id
|
|
4252
4243
|
},
|
|
4253
4244
|
variableTypes: {
|
|
4254
|
-
organization_id: "ID!"
|
|
4245
|
+
organization_id: "ID!",
|
|
4246
|
+
id: "ID!"
|
|
4255
4247
|
},
|
|
4256
4248
|
selectionSet: SKILL_SELECTION,
|
|
4257
|
-
isShow: true
|
|
4258
|
-
transformData: findSkillById(id)
|
|
4249
|
+
isShow: true
|
|
4259
4250
|
});
|
|
4260
4251
|
});
|
|
4261
4252
|
}
|
|
@@ -6483,7 +6474,7 @@ var import_zod16 = require("zod");
|
|
|
6483
6474
|
|
|
6484
6475
|
// src/internalOptions.ts
|
|
6485
6476
|
var INTERNAL_OPTIONS_KEY = "__waveInternalOptions";
|
|
6486
|
-
function
|
|
6477
|
+
function asRecord4(value) {
|
|
6487
6478
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
6488
6479
|
return null;
|
|
6489
6480
|
}
|
|
@@ -6497,7 +6488,7 @@ function setInternalCliOptions(program, options) {
|
|
|
6497
6488
|
function getInternalCliOptions(command) {
|
|
6498
6489
|
let current = command;
|
|
6499
6490
|
while (current) {
|
|
6500
|
-
const record =
|
|
6491
|
+
const record = asRecord4(current[INTERNAL_OPTIONS_KEY]);
|
|
6501
6492
|
if (record) {
|
|
6502
6493
|
return {
|
|
6503
6494
|
enableRetryOnEmptyPhrase: record.enableRetryOnEmptyPhrase === true
|
|
@@ -10169,7 +10160,7 @@ function positiveInt2(raw, fallback) {
|
|
|
10169
10160
|
function requestTimeoutMs(totalTimeoutMs) {
|
|
10170
10161
|
return Math.max(1e3, Math.min(totalTimeoutMs, 1e4));
|
|
10171
10162
|
}
|
|
10172
|
-
function
|
|
10163
|
+
function asRecord5(value) {
|
|
10173
10164
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
10174
10165
|
}
|
|
10175
10166
|
function asString(value) {
|
|
@@ -10216,9 +10207,9 @@ function cliTokenFromPoll(payload) {
|
|
|
10216
10207
|
return asString(payload.cliToken) ?? asString(payload.cli_token) ?? asString(payload.token);
|
|
10217
10208
|
}
|
|
10218
10209
|
function unwrapMutationResult(value) {
|
|
10219
|
-
const record =
|
|
10210
|
+
const record = asRecord5(value);
|
|
10220
10211
|
if (!record) return null;
|
|
10221
|
-
const data =
|
|
10212
|
+
const data = asRecord5(record.data);
|
|
10222
10213
|
if (data && (Object.prototype.hasOwnProperty.call(record, "ok") || Object.prototype.hasOwnProperty.call(record, "errors") || Object.prototype.hasOwnProperty.call(record, "errorCode") || Object.prototype.hasOwnProperty.call(record, "error_code"))) {
|
|
10223
10214
|
return data;
|
|
10224
10215
|
}
|
|
@@ -10282,7 +10273,7 @@ async function runTokenLogin(cmd, opts) {
|
|
|
10282
10273
|
exitCode: mapStatusToExitCode(status.error.status)
|
|
10283
10274
|
});
|
|
10284
10275
|
}
|
|
10285
|
-
const statusData =
|
|
10276
|
+
const statusData = asRecord5(status.result.data.cliAuthStatus) ?? {};
|
|
10286
10277
|
const storage = await writeStoredToken(token, baseUrl);
|
|
10287
10278
|
const configPath2 = opts.saveBaseUrl ? await persistBaseUrl(baseUrl) : void 0;
|
|
10288
10279
|
return printEnvelopeAndExit({
|
|
@@ -10499,7 +10490,7 @@ async function runLogout(cmd) {
|
|
|
10499
10490
|
});
|
|
10500
10491
|
if (result.ok) {
|
|
10501
10492
|
requestId = result.result.requestId;
|
|
10502
|
-
const payload =
|
|
10493
|
+
const payload = asRecord5(result.result.data.revokeCliToken) ?? {};
|
|
10503
10494
|
revokedRemote = payload.ok !== false;
|
|
10504
10495
|
} else {
|
|
10505
10496
|
requestId = result.requestId;
|
|
@@ -10562,7 +10553,7 @@ async function runAuthStatus(cmd) {
|
|
|
10562
10553
|
exitCode: mapStatusToExitCode(result.error.status)
|
|
10563
10554
|
});
|
|
10564
10555
|
}
|
|
10565
|
-
const status =
|
|
10556
|
+
const status = asRecord5(result.result.data.cliAuthStatus) ?? {};
|
|
10566
10557
|
const baseAuthStatus = status.baseAuthStatus;
|
|
10567
10558
|
return printEnvelopeAndExit({
|
|
10568
10559
|
envelope: envelope({
|
|
@@ -12213,11 +12204,11 @@ function sanitizePlannerJson(value) {
|
|
|
12213
12204
|
}
|
|
12214
12205
|
return output;
|
|
12215
12206
|
}
|
|
12216
|
-
function
|
|
12207
|
+
function asRecord6(value) {
|
|
12217
12208
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
12218
12209
|
}
|
|
12219
12210
|
function readPlannerStateKey(value, keys) {
|
|
12220
|
-
const record =
|
|
12211
|
+
const record = asRecord6(value);
|
|
12221
12212
|
if (!record) {
|
|
12222
12213
|
return null;
|
|
12223
12214
|
}
|
|
@@ -14786,6 +14777,7 @@ var agentToolAccessSchema = import_zod19.z.array(
|
|
|
14786
14777
|
scope_value: nonEmptyStringSchema
|
|
14787
14778
|
}).strict()
|
|
14788
14779
|
).min(1);
|
|
14780
|
+
var agentToolAccessUpdateSchema = agentToolAccessSchema.min(0);
|
|
14789
14781
|
var agentPluginConnectionsSchema = import_zod19.z.array(
|
|
14790
14782
|
import_zod19.z.object({
|
|
14791
14783
|
external_tool_connection_id: nonEmptyStringSchema,
|
|
@@ -14797,6 +14789,30 @@ var agentPluginConnectionsSchema = import_zod19.z.array(
|
|
|
14797
14789
|
enabled: import_zod19.z.boolean().optional()
|
|
14798
14790
|
}).strict()
|
|
14799
14791
|
).min(1);
|
|
14792
|
+
var agentPluginConnectionUpdateSchema = import_zod19.z.array(
|
|
14793
|
+
import_zod19.z.union([
|
|
14794
|
+
import_zod19.z.object({
|
|
14795
|
+
id: nonEmptyStringSchema,
|
|
14796
|
+
_destroy: import_zod19.z.literal(true)
|
|
14797
|
+
}).strict(),
|
|
14798
|
+
import_zod19.z.object({
|
|
14799
|
+
id: nonEmptyStringSchema.optional(),
|
|
14800
|
+
external_tool_connection_id: nonEmptyStringSchema.optional(),
|
|
14801
|
+
tool_key: nonEmptyStringSchema.optional(),
|
|
14802
|
+
scope_value: nonEmptyStringSchema.optional(),
|
|
14803
|
+
allowed_tools: import_zod19.z.array(nonEmptyStringSchema).optional(),
|
|
14804
|
+
allowed_scopes: import_zod19.z.array(nonEmptyStringSchema).optional(),
|
|
14805
|
+
requires_confirmation: import_zod19.z.boolean().optional(),
|
|
14806
|
+
enabled: import_zod19.z.boolean().optional()
|
|
14807
|
+
}).strict().superRefine((value, context) => {
|
|
14808
|
+
if (value.id || value.external_tool_connection_id && value.tool_key) return;
|
|
14809
|
+
context.addIssue({
|
|
14810
|
+
code: import_zod19.z.ZodIssueCode.custom,
|
|
14811
|
+
message: "Plugin updates require an id, or both external_tool_connection_id and tool_key for a new grant."
|
|
14812
|
+
});
|
|
14813
|
+
})
|
|
14814
|
+
])
|
|
14815
|
+
);
|
|
14800
14816
|
var agentTriggerSchema = import_zod19.z.object({
|
|
14801
14817
|
trigger_type: import_zod19.z.literal("cron"),
|
|
14802
14818
|
cron_expression: nonEmptyStringSchema,
|
|
@@ -14806,6 +14822,14 @@ var agentTriggerSchema = import_zod19.z.object({
|
|
|
14806
14822
|
max_runs: import_zod19.z.number().int().positive().nullable().optional(),
|
|
14807
14823
|
enabled: import_zod19.z.boolean().optional()
|
|
14808
14824
|
}).strict();
|
|
14825
|
+
var agentTriggerUpdateSchema = import_zod19.z.union([
|
|
14826
|
+
agentTriggerSchema.extend({ id: nonEmptyStringSchema.optional() }).strict(),
|
|
14827
|
+
import_zod19.z.object({
|
|
14828
|
+
id: nonEmptyStringSchema,
|
|
14829
|
+
_destroy: import_zod19.z.literal(true)
|
|
14830
|
+
}).strict()
|
|
14831
|
+
]);
|
|
14832
|
+
var automationConfigSchema = import_zod19.z.record(import_zod19.z.string(), import_zod19.z.unknown());
|
|
14809
14833
|
var AGENT_SELECTION = `{
|
|
14810
14834
|
id
|
|
14811
14835
|
type
|
|
@@ -14856,6 +14880,7 @@ var AGENT_SELECTION = `{
|
|
|
14856
14880
|
memberId
|
|
14857
14881
|
createdAt
|
|
14858
14882
|
updatedAt
|
|
14883
|
+
updateVersion
|
|
14859
14884
|
}`;
|
|
14860
14885
|
var AGENT_PLUGIN_CATALOG_SELECTION = `{
|
|
14861
14886
|
externalToolConnectionId
|
|
@@ -14883,8 +14908,9 @@ var AUTOMATION_SELECTION = `{
|
|
|
14883
14908
|
memberId
|
|
14884
14909
|
createdAt
|
|
14885
14910
|
updatedAt
|
|
14911
|
+
updateVersion
|
|
14886
14912
|
}`;
|
|
14887
|
-
function
|
|
14913
|
+
function asRecord7(value) {
|
|
14888
14914
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
14889
14915
|
}
|
|
14890
14916
|
function asRequiredString(value) {
|
|
@@ -14933,12 +14959,12 @@ function parseJsonOption(value, optionName, schema) {
|
|
|
14933
14959
|
return schema.parse(parseJson(String(value), optionName));
|
|
14934
14960
|
}
|
|
14935
14961
|
function normalizePersistedCreatePayload(payload) {
|
|
14936
|
-
const mutation =
|
|
14937
|
-
const mutationData =
|
|
14938
|
-
const persisted =
|
|
14939
|
-
const attributes =
|
|
14940
|
-
const meta =
|
|
14941
|
-
const idempotency =
|
|
14962
|
+
const mutation = asRecord7(payload);
|
|
14963
|
+
const mutationData = asRecord7(mutation?.data);
|
|
14964
|
+
const persisted = asRecord7(mutationData?.data) ?? mutationData;
|
|
14965
|
+
const attributes = asRecord7(persisted?.attributes);
|
|
14966
|
+
const meta = asRecord7(mutationData?.meta);
|
|
14967
|
+
const idempotency = asRecord7(meta?.atlas_idempotency);
|
|
14942
14968
|
const id = asRequiredString(persisted?.id);
|
|
14943
14969
|
const slug = asRequiredString(persisted?.slug) ?? asRequiredString(attributes?.slug);
|
|
14944
14970
|
const replay = idempotency?.replay;
|
|
@@ -14967,6 +14993,36 @@ function normalizePersistedCreatePayload(payload) {
|
|
|
14967
14993
|
}
|
|
14968
14994
|
};
|
|
14969
14995
|
}
|
|
14996
|
+
function normalizePersistedUpdatePayload(payload) {
|
|
14997
|
+
const mutation = asRecord7(payload);
|
|
14998
|
+
const mutationData = asRecord7(mutation?.data);
|
|
14999
|
+
const persisted = asRecord7(mutationData?.data) ?? mutationData;
|
|
15000
|
+
const attributes = asRecord7(persisted?.attributes);
|
|
15001
|
+
const id = asRequiredString(persisted?.id);
|
|
15002
|
+
const slug = asRequiredString(persisted?.slug) ?? asRequiredString(attributes?.slug);
|
|
15003
|
+
const updateVersion = asRequiredString(persisted?.updateVersion) ?? asRequiredString(attributes?.updateVersion) ?? asRequiredString(attributes?.update_version);
|
|
15004
|
+
if (!mutation || !mutationData || !persisted || !id || !slug || !updateVersion) {
|
|
15005
|
+
throw new CliError({
|
|
15006
|
+
message: "Update response did not include persisted id, slug, and updateVersion.",
|
|
15007
|
+
kind: "malformed_response",
|
|
15008
|
+
status: 502,
|
|
15009
|
+
exitCode: EXIT_CODES.networkOrUpstream
|
|
15010
|
+
});
|
|
15011
|
+
}
|
|
15012
|
+
return {
|
|
15013
|
+
ok: mutation.ok,
|
|
15014
|
+
status: mutation.status,
|
|
15015
|
+
errorCode: mutation.errorCode ?? null,
|
|
15016
|
+
errors: mutation.errors ?? null,
|
|
15017
|
+
persisted: { id, slug, update_version: updateVersion }
|
|
15018
|
+
};
|
|
15019
|
+
}
|
|
15020
|
+
function parseAutomationConfig(value) {
|
|
15021
|
+
return automationConfigSchema.parse(parseJson(String(value), "--ai-task-config"));
|
|
15022
|
+
}
|
|
15023
|
+
function parseExpectedUpdateVersion(value) {
|
|
15024
|
+
return nonEmptyStringSchema.parse(String(value));
|
|
15025
|
+
}
|
|
14970
15026
|
function registerAtlasAuthoringCommands(program) {
|
|
14971
15027
|
const agents = program.command("agents").description("Bounded Agent authoring operations");
|
|
14972
15028
|
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(
|
|
@@ -15046,7 +15102,7 @@ function registerAtlasAuthoringCommands(program) {
|
|
|
15046
15102
|
transformMutationPayload: normalizePersistedCreatePayload
|
|
15047
15103
|
});
|
|
15048
15104
|
});
|
|
15049
|
-
agents.command("show").description("Read one persisted Agent by id").requiredOption("--id <
|
|
15105
|
+
agents.command("show").description("Read one persisted Agent by id or slug").requiredOption("--id <idOrSlug>", "Agent id or slug").action(async (opts, cmd) => {
|
|
15050
15106
|
const id = idSchema14.parse(opts.id);
|
|
15051
15107
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
15052
15108
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
@@ -15061,6 +15117,104 @@ function registerAtlasAuthoringCommands(program) {
|
|
|
15061
15117
|
isShow: true
|
|
15062
15118
|
});
|
|
15063
15119
|
});
|
|
15120
|
+
agents.command("update").description("Update one persisted Agent through the API-owned updateAgent contract").requiredOption("--id <idOrSlug>", "Agent id or slug").requiredOption(
|
|
15121
|
+
"--expected-update-version <version>",
|
|
15122
|
+
"Exact opaque updateVersion value from agents show; rejects stale writes"
|
|
15123
|
+
).option("--name <name>").option("--description <description>").option("--notes <notes>").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("--clear-trusted-urls", "Clear all trusted URLs").option("--tool-access <json>", "JSON array of the complete canonical native Agent tool scopes").option(
|
|
15124
|
+
"--plugin-connections <json>",
|
|
15125
|
+
"JSON array of Agent connector grant patches; removals require id and _destroy:true"
|
|
15126
|
+
).option(
|
|
15127
|
+
"--trigger <json>",
|
|
15128
|
+
"Canonical Agent trigger patch; use the trigger id from agents show to replace or remove it"
|
|
15129
|
+
).action(async (opts, cmd) => {
|
|
15130
|
+
if (opts.clearTrustedUrls && opts.trustedUrls !== void 0) {
|
|
15131
|
+
throw new CliError({
|
|
15132
|
+
message: "Use either --trusted-urls or --clear-trusted-urls, not both.",
|
|
15133
|
+
kind: "invalid_args",
|
|
15134
|
+
status: 400,
|
|
15135
|
+
exitCode: EXIT_CODES.invalidArgs
|
|
15136
|
+
});
|
|
15137
|
+
}
|
|
15138
|
+
const runWhenMentioned = parseBooleanOption(opts.runWhenMentioned, "--run-when-mentioned");
|
|
15139
|
+
const webAccessEnabled = parseBooleanOption(opts.webAccessEnabled, "--web-access-enabled");
|
|
15140
|
+
const webFetchEnabled = parseBooleanOption(opts.webFetchEnabled, "--web-fetch-enabled");
|
|
15141
|
+
const searchPastConversationsEnabled = parseBooleanOption(
|
|
15142
|
+
opts.searchPastConversationsEnabled,
|
|
15143
|
+
"--search-past-conversations-enabled"
|
|
15144
|
+
);
|
|
15145
|
+
const appRulesCreationEnabled = parseBooleanOption(
|
|
15146
|
+
opts.appRulesCreationEnabled,
|
|
15147
|
+
"--app-rules-creation-enabled"
|
|
15148
|
+
);
|
|
15149
|
+
const toolDiscoveryEnabled = parseBooleanOption(
|
|
15150
|
+
opts.toolDiscoveryEnabled,
|
|
15151
|
+
"--tool-discovery-enabled"
|
|
15152
|
+
);
|
|
15153
|
+
const selfUpdatesEnabled = parseBooleanOption(opts.selfUpdatesEnabled, "--self-updates-enabled");
|
|
15154
|
+
const trustedUrls = parseCommaSeparatedStrings(opts.trustedUrls);
|
|
15155
|
+
const toolAccess = parseJsonOption(
|
|
15156
|
+
opts.toolAccess,
|
|
15157
|
+
"--tool-access",
|
|
15158
|
+
agentToolAccessUpdateSchema
|
|
15159
|
+
);
|
|
15160
|
+
const pluginConnections = parseJsonOption(
|
|
15161
|
+
opts.pluginConnections,
|
|
15162
|
+
"--plugin-connections",
|
|
15163
|
+
agentPluginConnectionUpdateSchema
|
|
15164
|
+
);
|
|
15165
|
+
const trigger = parseJsonOption(opts.trigger, "--trigger", agentTriggerUpdateSchema);
|
|
15166
|
+
const patch = {
|
|
15167
|
+
...opts.name !== void 0 ? { name: String(opts.name) } : {},
|
|
15168
|
+
...opts.description !== void 0 ? { description: String(opts.description) } : {},
|
|
15169
|
+
...opts.notes !== void 0 ? { notes: String(opts.notes) } : {},
|
|
15170
|
+
...opts.status !== void 0 ? { status: String(opts.status) } : {},
|
|
15171
|
+
...opts.visibility !== void 0 ? { visibility: String(opts.visibility) } : {},
|
|
15172
|
+
...opts.model !== void 0 ? { model: String(opts.model) } : {},
|
|
15173
|
+
...runWhenMentioned !== void 0 ? { run_when_mentioned: runWhenMentioned } : {},
|
|
15174
|
+
...webAccessEnabled !== void 0 ? { web_access_enabled: webAccessEnabled } : {},
|
|
15175
|
+
...webFetchEnabled !== void 0 ? { web_fetch_enabled: webFetchEnabled } : {},
|
|
15176
|
+
...searchPastConversationsEnabled !== void 0 ? { search_past_conversations_enabled: searchPastConversationsEnabled } : {},
|
|
15177
|
+
...appRulesCreationEnabled !== void 0 ? { app_rules_creation_enabled: appRulesCreationEnabled } : {},
|
|
15178
|
+
...toolDiscoveryEnabled !== void 0 ? { tool_discovery_enabled: toolDiscoveryEnabled } : {},
|
|
15179
|
+
...selfUpdatesEnabled !== void 0 ? { self_updates_enabled: selfUpdatesEnabled } : {},
|
|
15180
|
+
...trustedUrls !== void 0 ? { trusted_urls: trustedUrls } : {},
|
|
15181
|
+
...opts.clearTrustedUrls ? { trusted_urls: [] } : {},
|
|
15182
|
+
...toolAccess !== void 0 ? { tool_access: toolAccess } : {},
|
|
15183
|
+
...pluginConnections !== void 0 ? { agent_tool_connections_attributes: pluginConnections } : {},
|
|
15184
|
+
...trigger !== void 0 ? { trigger_attributes: trigger } : {}
|
|
15185
|
+
};
|
|
15186
|
+
if (Object.keys(patch).length === 0) {
|
|
15187
|
+
throw new CliError({
|
|
15188
|
+
message: "agents update requires at least one mutable Agent field.",
|
|
15189
|
+
kind: "invalid_args",
|
|
15190
|
+
status: 400,
|
|
15191
|
+
exitCode: EXIT_CODES.invalidArgs
|
|
15192
|
+
});
|
|
15193
|
+
}
|
|
15194
|
+
const id = idSchema14.parse(opts.id);
|
|
15195
|
+
const expectedUpdateVersion = parseExpectedUpdateVersion(opts.expectedUpdateVersion);
|
|
15196
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
15197
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
15198
|
+
await runGraphqlMutationCommand({
|
|
15199
|
+
command: "agents.update",
|
|
15200
|
+
operationName: "AgentsUpdate",
|
|
15201
|
+
runtimeOptions: context.runtimeOptions,
|
|
15202
|
+
field: "update_agent",
|
|
15203
|
+
variableTypes: {
|
|
15204
|
+
organization_id: "ID!",
|
|
15205
|
+
agent_id: "ID!",
|
|
15206
|
+
params: "UpdateAgentParamsInput!",
|
|
15207
|
+
expected_update_version: "String!"
|
|
15208
|
+
},
|
|
15209
|
+
variables: {
|
|
15210
|
+
organization_id: organizationId,
|
|
15211
|
+
agent_id: id,
|
|
15212
|
+
params: { agent: patch },
|
|
15213
|
+
expected_update_version: expectedUpdateVersion
|
|
15214
|
+
},
|
|
15215
|
+
transformMutationPayload: normalizePersistedUpdatePayload
|
|
15216
|
+
});
|
|
15217
|
+
});
|
|
15064
15218
|
agents.command("plugin-catalog").description("Read connected Agent plugin capabilities for one supported service").requiredOption(
|
|
15065
15219
|
"--service <service>",
|
|
15066
15220
|
"Supported service: gmail, calendar, slack, or stripe"
|
|
@@ -15111,7 +15265,7 @@ function registerAtlasAuthoringCommands(program) {
|
|
|
15111
15265
|
transformMutationPayload: normalizePersistedCreatePayload
|
|
15112
15266
|
});
|
|
15113
15267
|
});
|
|
15114
|
-
automations.command("show").description("Read one persisted Automation by id").requiredOption("--id <
|
|
15268
|
+
automations.command("show").description("Read one persisted Automation by id or slug").requiredOption("--id <idOrSlug>", "Automation id or slug").action(async (opts, cmd) => {
|
|
15115
15269
|
const id = idSchema14.parse(opts.id);
|
|
15116
15270
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
15117
15271
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
@@ -15126,6 +15280,66 @@ function registerAtlasAuthoringCommands(program) {
|
|
|
15126
15280
|
isShow: true
|
|
15127
15281
|
});
|
|
15128
15282
|
});
|
|
15283
|
+
automations.command("update").description("Update one task-backed Automation through the API-owned updateTask contract").requiredOption("--id <idOrSlug>", "Automation id or slug").requiredOption(
|
|
15284
|
+
"--expected-update-version <version>",
|
|
15285
|
+
"Exact opaque updateVersion value from automations show; rejects stale writes"
|
|
15286
|
+
).option("--summary <summary>").option("--description <description>").option("--notes <notes>").option("--status <status>").option("--priority <priority>").option("--due-date <date>", "ISO-8601 date (YYYY-MM-DD)").option("--ai-task-config <json>", "Complete replacement ai_task_config JSON object").option(
|
|
15287
|
+
"--agent-id <agentId>",
|
|
15288
|
+
"Executor Agent id; requires --ai-task-config and is stored in that config"
|
|
15289
|
+
).action(async (opts, cmd) => {
|
|
15290
|
+
if (opts.agentId !== void 0 && opts.aiTaskConfig === void 0) {
|
|
15291
|
+
throw new CliError({
|
|
15292
|
+
message: "automations update requires --ai-task-config whenever --agent-id is supplied.",
|
|
15293
|
+
kind: "invalid_args",
|
|
15294
|
+
status: 400,
|
|
15295
|
+
exitCode: EXIT_CODES.invalidArgs
|
|
15296
|
+
});
|
|
15297
|
+
}
|
|
15298
|
+
const aiTaskConfig = opts.aiTaskConfig === void 0 ? void 0 : {
|
|
15299
|
+
...parseAutomationConfig(opts.aiTaskConfig),
|
|
15300
|
+
...opts.agentId !== void 0 ? { agent_id: idSchema14.parse(opts.agentId) } : {}
|
|
15301
|
+
};
|
|
15302
|
+
const patch = {
|
|
15303
|
+
...opts.summary !== void 0 ? { summary: String(opts.summary) } : {},
|
|
15304
|
+
...opts.description !== void 0 ? { description: String(opts.description) } : {},
|
|
15305
|
+
...opts.notes !== void 0 ? { notes: String(opts.notes) } : {},
|
|
15306
|
+
...opts.status !== void 0 ? { status: String(opts.status) } : {},
|
|
15307
|
+
...opts.priority !== void 0 ? { priority: String(opts.priority) } : {},
|
|
15308
|
+
...opts.dueDate !== void 0 ? { due_date: isoDateSchema.parse(opts.dueDate) } : {},
|
|
15309
|
+
...aiTaskConfig !== void 0 ? { ai_task_config: aiTaskConfig } : {}
|
|
15310
|
+
};
|
|
15311
|
+
if (Object.keys(patch).length === 0) {
|
|
15312
|
+
throw new CliError({
|
|
15313
|
+
message: "automations update requires at least one mutable Automation field.",
|
|
15314
|
+
kind: "invalid_args",
|
|
15315
|
+
status: 400,
|
|
15316
|
+
exitCode: EXIT_CODES.invalidArgs
|
|
15317
|
+
});
|
|
15318
|
+
}
|
|
15319
|
+
const id = idSchema14.parse(opts.id);
|
|
15320
|
+
const expectedUpdateVersion = parseExpectedUpdateVersion(opts.expectedUpdateVersion);
|
|
15321
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
15322
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
15323
|
+
await runGraphqlMutationCommand({
|
|
15324
|
+
command: "automations.update",
|
|
15325
|
+
operationName: "AutomationsUpdate",
|
|
15326
|
+
runtimeOptions: context.runtimeOptions,
|
|
15327
|
+
field: "update_task",
|
|
15328
|
+
variableTypes: {
|
|
15329
|
+
organization_id: "ID!",
|
|
15330
|
+
task_id: "ID!",
|
|
15331
|
+
params: "UpdateTaskParamsInput!",
|
|
15332
|
+
expected_update_version: "String!"
|
|
15333
|
+
},
|
|
15334
|
+
variables: {
|
|
15335
|
+
organization_id: organizationId,
|
|
15336
|
+
task_id: id,
|
|
15337
|
+
params: { task: patch },
|
|
15338
|
+
expected_update_version: expectedUpdateVersion
|
|
15339
|
+
},
|
|
15340
|
+
transformMutationPayload: normalizePersistedUpdatePayload
|
|
15341
|
+
});
|
|
15342
|
+
});
|
|
15129
15343
|
const skills = program.commands.find((command) => command.name() === "skills");
|
|
15130
15344
|
if (!skills) {
|
|
15131
15345
|
throw new Error("Skills command must be registered before Atlas authoring commands.");
|
|
@@ -15157,6 +15371,47 @@ function registerAtlasAuthoringCommands(program) {
|
|
|
15157
15371
|
transformMutationPayload: normalizePersistedCreatePayload
|
|
15158
15372
|
});
|
|
15159
15373
|
});
|
|
15374
|
+
skills.command("update").description("Update one persisted Skill through the API-owned updateSkill contract").requiredOption("--id <idOrSlug>", "Skill id or slug").requiredOption(
|
|
15375
|
+
"--expected-update-version <version>",
|
|
15376
|
+
"Exact opaque updateVersion value from skills show; rejects stale writes"
|
|
15377
|
+
).option("--name <name>").option("--emoji <emoji>").option("--description <description>").action(async (opts, cmd) => {
|
|
15378
|
+
const patch = {
|
|
15379
|
+
...opts.name !== void 0 ? { name: String(opts.name) } : {},
|
|
15380
|
+
...opts.emoji !== void 0 ? { emoji: String(opts.emoji) } : {},
|
|
15381
|
+
...opts.description !== void 0 ? { description: String(opts.description) } : {}
|
|
15382
|
+
};
|
|
15383
|
+
if (Object.keys(patch).length === 0) {
|
|
15384
|
+
throw new CliError({
|
|
15385
|
+
message: "skills update requires at least one mutable Skill field.",
|
|
15386
|
+
kind: "invalid_args",
|
|
15387
|
+
status: 400,
|
|
15388
|
+
exitCode: EXIT_CODES.invalidArgs
|
|
15389
|
+
});
|
|
15390
|
+
}
|
|
15391
|
+
const id = idSchema14.parse(opts.id);
|
|
15392
|
+
const expectedUpdateVersion = parseExpectedUpdateVersion(opts.expectedUpdateVersion);
|
|
15393
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
15394
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
15395
|
+
await runGraphqlMutationCommand({
|
|
15396
|
+
command: "skills.update",
|
|
15397
|
+
operationName: "SkillsUpdate",
|
|
15398
|
+
runtimeOptions: context.runtimeOptions,
|
|
15399
|
+
field: "update_skill",
|
|
15400
|
+
variableTypes: {
|
|
15401
|
+
organization_id: "ID!",
|
|
15402
|
+
id: "ID!",
|
|
15403
|
+
input: "UpdateSkillInput!",
|
|
15404
|
+
expected_update_version: "String!"
|
|
15405
|
+
},
|
|
15406
|
+
variables: {
|
|
15407
|
+
organization_id: organizationId,
|
|
15408
|
+
id,
|
|
15409
|
+
input: patch,
|
|
15410
|
+
expected_update_version: expectedUpdateVersion
|
|
15411
|
+
},
|
|
15412
|
+
transformMutationPayload: normalizePersistedUpdatePayload
|
|
15413
|
+
});
|
|
15414
|
+
});
|
|
15160
15415
|
}
|
|
15161
15416
|
|
|
15162
15417
|
// src/commands/discovery.ts
|
|
@@ -15167,7 +15422,7 @@ var import_node_path4 = require("path");
|
|
|
15167
15422
|
var import_node_crypto3 = require("crypto");
|
|
15168
15423
|
|
|
15169
15424
|
// src/version.ts
|
|
15170
|
-
var CLI_VERSION = "0.1.
|
|
15425
|
+
var CLI_VERSION = "0.1.72";
|
|
15171
15426
|
|
|
15172
15427
|
// src/operationMetadata.ts
|
|
15173
15428
|
var DISCOVERY_OPERATION_IDS = [
|
|
@@ -15480,7 +15735,9 @@ var WRITE_OPERATION_IDS = [
|
|
|
15480
15735
|
"accountability.create",
|
|
15481
15736
|
"accountability.update",
|
|
15482
15737
|
"agents.create",
|
|
15738
|
+
"agents.update",
|
|
15483
15739
|
"automations.create",
|
|
15740
|
+
"automations.update",
|
|
15484
15741
|
"contacts.create",
|
|
15485
15742
|
"contacts.update",
|
|
15486
15743
|
"content.create-contact",
|
|
@@ -15586,6 +15843,7 @@ var WRITE_OPERATION_IDS = [
|
|
|
15586
15843
|
"scorecards.create",
|
|
15587
15844
|
"scorecards.update",
|
|
15588
15845
|
"skills.create",
|
|
15846
|
+
"skills.update",
|
|
15589
15847
|
"smart-kpi-views.create",
|
|
15590
15848
|
"stand-ups.create",
|
|
15591
15849
|
"stand-ups.update",
|
|
@@ -15937,12 +16195,13 @@ var NAMESPACE_DOCS = {
|
|
|
15937
16195
|
skills: {
|
|
15938
16196
|
name: "skills",
|
|
15939
16197
|
tier: "primary",
|
|
15940
|
-
description: "Skill record readback and bounded create operations.",
|
|
16198
|
+
description: "Skill record readback and bounded create/update operations.",
|
|
15941
16199
|
examples: [
|
|
15942
16200
|
"wave skills list --json",
|
|
15943
16201
|
"wave skills list --scope ADMIN_GLOBAL --json",
|
|
15944
16202
|
"wave skills show --id 123 --json",
|
|
15945
|
-
'wave skills create --name "Weekly planning" --scope MEMBER_PERSONAL --idempotency-key skill-create-001'
|
|
16203
|
+
'wave skills create --name "Weekly planning" --scope MEMBER_PERSONAL --idempotency-key skill-create-001',
|
|
16204
|
+
'wave skills update --id SKL-01 --expected-update-version 2026-07-17T12:00:00.123456Z --description "Review my projects."'
|
|
15946
16205
|
],
|
|
15947
16206
|
schema: {
|
|
15948
16207
|
output: "json-envelope-default",
|
|
@@ -15950,20 +16209,22 @@ var NAMESPACE_DOCS = {
|
|
|
15950
16209
|
safety: [
|
|
15951
16210
|
"Uses API-owned Skill GraphQL read fields only.",
|
|
15952
16211
|
"Create calls only createSkill with an explicit idempotency key.",
|
|
16212
|
+
"Update calls only updateSkill with an exact opaque updateVersion token and does not change scope or ownership.",
|
|
15953
16213
|
"Skill create supports the API-defined ADMIN_GLOBAL and MEMBER_PERSONAL scopes.",
|
|
15954
16214
|
"Does not update, destroy, archive, approve, or apply Skill records."
|
|
15955
16215
|
],
|
|
15956
|
-
commands: ["list", "show", "create"]
|
|
16216
|
+
commands: ["list", "show", "create", "update"]
|
|
15957
16217
|
}
|
|
15958
16218
|
},
|
|
15959
16219
|
agents: {
|
|
15960
16220
|
name: "agents",
|
|
15961
16221
|
tier: "primary",
|
|
15962
|
-
description: "Bounded Agent create and
|
|
16222
|
+
description: "Bounded Agent create, readback, and stale-write-protected update operations.",
|
|
15963
16223
|
examples: [
|
|
15964
16224
|
'wave agents create --name "Planning helper" --idempotency-key agent-create-001',
|
|
15965
16225
|
`wave agents create --name "Project summary" --notes "Summarize my projects." --tool-access '[{"tool_key":"projects","scope_value":"all"}]' --trigger '{"trigger_type":"cron","cron_expression":"0 14 * * 2","timezone":"America/Phoenix","enabled":true}' --idempotency-key agent-create-002`,
|
|
15966
|
-
"wave agents show --id
|
|
16226
|
+
"wave agents show --id AGT-01",
|
|
16227
|
+
'wave agents update --id AGT-01 --expected-update-version 2026-07-17T12:00:00.123456Z --notes "Summarize my projects."'
|
|
15967
16228
|
],
|
|
15968
16229
|
schema: {
|
|
15969
16230
|
output: "json-envelope-default",
|
|
@@ -15971,20 +16232,22 @@ var NAMESPACE_DOCS = {
|
|
|
15971
16232
|
safety: [
|
|
15972
16233
|
"Create calls only createAgent with an explicit idempotency key.",
|
|
15973
16234
|
"Create preserves API-owned defaults by sending only supplied typed Agent fields.",
|
|
16235
|
+
"Update calls only updateAgent with an exact opaque updateVersion token and cannot change ownership.",
|
|
15974
16236
|
"Native tools, plugin connector grants, and the cron trigger use strict canonical JSON shapes.",
|
|
15975
16237
|
"Outlook Calendar and Outlook Mail are not supported Agent plugin families in this release.",
|
|
15976
16238
|
"Show uses the API-owned agent query by id; no slug fallback is implemented."
|
|
15977
16239
|
],
|
|
15978
|
-
commands: ["create", "show"]
|
|
16240
|
+
commands: ["create", "show", "update"]
|
|
15979
16241
|
}
|
|
15980
16242
|
},
|
|
15981
16243
|
automations: {
|
|
15982
16244
|
name: "automations",
|
|
15983
16245
|
tier: "primary",
|
|
15984
|
-
description: "Bounded Automation create and
|
|
16246
|
+
description: "Bounded task-backed Automation create, readback, and stale-write-protected update operations.",
|
|
15985
16247
|
examples: [
|
|
15986
16248
|
`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`,
|
|
15987
|
-
"wave automations show --id
|
|
16249
|
+
"wave automations show --id ATK-01",
|
|
16250
|
+
'wave automations update --id ATK-01 --expected-update-version 2026-07-17T12:00:00.123456Z --summary "Weekly project review"'
|
|
15988
16251
|
],
|
|
15989
16252
|
schema: {
|
|
15990
16253
|
output: "json-envelope-default",
|
|
@@ -15993,10 +16256,11 @@ var NAMESPACE_DOCS = {
|
|
|
15993
16256
|
"Create calls only createAutomation with an explicit idempotency key.",
|
|
15994
16257
|
"Only the API-defined ai_task_config field accepts validated JSON.",
|
|
15995
16258
|
"Optional executor Agent linkage is sent only through the API-defined top-level agentId input.",
|
|
16259
|
+
"Update calls only updateTask with an exact opaque updateVersion token; it cannot change task type, ownership, or project linkage.",
|
|
15996
16260
|
"Does not create a project Task, run an Automation, or invoke AI OS actions.",
|
|
15997
16261
|
"Show uses the API-owned automation query by id; no slug fallback is implemented."
|
|
15998
16262
|
],
|
|
15999
|
-
commands: ["create", "show"]
|
|
16263
|
+
commands: ["create", "show", "update"]
|
|
16000
16264
|
}
|
|
16001
16265
|
},
|
|
16002
16266
|
broadcast: {
|
package/dist/index.js
CHANGED
|
@@ -4198,18 +4198,8 @@ var SKILL_SELECTION = `{
|
|
|
4198
4198
|
}
|
|
4199
4199
|
createdAt
|
|
4200
4200
|
updatedAt
|
|
4201
|
+
updateVersion
|
|
4201
4202
|
}`;
|
|
4202
|
-
function asRecord4(value) {
|
|
4203
|
-
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
4204
|
-
}
|
|
4205
|
-
function findSkillById(id) {
|
|
4206
|
-
return (payload) => {
|
|
4207
|
-
if (!Array.isArray(payload)) {
|
|
4208
|
-
return null;
|
|
4209
|
-
}
|
|
4210
|
-
return payload.find((entry2) => String(asRecord4(entry2)?.id ?? "") === id) ?? null;
|
|
4211
|
-
};
|
|
4212
|
-
}
|
|
4213
4203
|
function registerSkillCommands(program) {
|
|
4214
4204
|
const skills = program.command("skills").description("Skill record operations");
|
|
4215
4205
|
skills.command("list").description("List Skill records").option("--scope <scope>", "Filter skills by scope").option("--query <query>", "Filter skills by search query").option("--limit <limit>", "Limit skills returned").requiredOption("--json", "Emit the stable JSON envelope").action(async (opts, cmd) => {
|
|
@@ -4237,7 +4227,7 @@ function registerSkillCommands(program) {
|
|
|
4237
4227
|
isList: true
|
|
4238
4228
|
});
|
|
4239
4229
|
});
|
|
4240
|
-
skills.command("show").description("Read one persisted Skill record by id").requiredOption("--id <
|
|
4230
|
+
skills.command("show").description("Read one persisted Skill record by id or slug").requiredOption("--id <idOrSlug>", "Skill id or slug").option("--json", "Emit the stable JSON envelope").action(async (opts, cmd) => {
|
|
4241
4231
|
const id = idSchema7.parse(opts.id);
|
|
4242
4232
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
4243
4233
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
@@ -4245,16 +4235,17 @@ function registerSkillCommands(program) {
|
|
|
4245
4235
|
command: "skills.show",
|
|
4246
4236
|
operationName: "SkillsShow",
|
|
4247
4237
|
runtimeOptions: context.runtimeOptions,
|
|
4248
|
-
field: "
|
|
4238
|
+
field: "skill",
|
|
4249
4239
|
variables: {
|
|
4250
|
-
organization_id: organizationId
|
|
4240
|
+
organization_id: organizationId,
|
|
4241
|
+
id
|
|
4251
4242
|
},
|
|
4252
4243
|
variableTypes: {
|
|
4253
|
-
organization_id: "ID!"
|
|
4244
|
+
organization_id: "ID!",
|
|
4245
|
+
id: "ID!"
|
|
4254
4246
|
},
|
|
4255
4247
|
selectionSet: SKILL_SELECTION,
|
|
4256
|
-
isShow: true
|
|
4257
|
-
transformData: findSkillById(id)
|
|
4248
|
+
isShow: true
|
|
4258
4249
|
});
|
|
4259
4250
|
});
|
|
4260
4251
|
}
|
|
@@ -6482,7 +6473,7 @@ import { z as z16 } from "zod";
|
|
|
6482
6473
|
|
|
6483
6474
|
// src/internalOptions.ts
|
|
6484
6475
|
var INTERNAL_OPTIONS_KEY = "__waveInternalOptions";
|
|
6485
|
-
function
|
|
6476
|
+
function asRecord4(value) {
|
|
6486
6477
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
6487
6478
|
return null;
|
|
6488
6479
|
}
|
|
@@ -6496,7 +6487,7 @@ function setInternalCliOptions(program, options) {
|
|
|
6496
6487
|
function getInternalCliOptions(command) {
|
|
6497
6488
|
let current = command;
|
|
6498
6489
|
while (current) {
|
|
6499
|
-
const record =
|
|
6490
|
+
const record = asRecord4(current[INTERNAL_OPTIONS_KEY]);
|
|
6500
6491
|
if (record) {
|
|
6501
6492
|
return {
|
|
6502
6493
|
enableRetryOnEmptyPhrase: record.enableRetryOnEmptyPhrase === true
|
|
@@ -10168,7 +10159,7 @@ function positiveInt2(raw, fallback) {
|
|
|
10168
10159
|
function requestTimeoutMs(totalTimeoutMs) {
|
|
10169
10160
|
return Math.max(1e3, Math.min(totalTimeoutMs, 1e4));
|
|
10170
10161
|
}
|
|
10171
|
-
function
|
|
10162
|
+
function asRecord5(value) {
|
|
10172
10163
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
10173
10164
|
}
|
|
10174
10165
|
function asString(value) {
|
|
@@ -10215,9 +10206,9 @@ function cliTokenFromPoll(payload) {
|
|
|
10215
10206
|
return asString(payload.cliToken) ?? asString(payload.cli_token) ?? asString(payload.token);
|
|
10216
10207
|
}
|
|
10217
10208
|
function unwrapMutationResult(value) {
|
|
10218
|
-
const record =
|
|
10209
|
+
const record = asRecord5(value);
|
|
10219
10210
|
if (!record) return null;
|
|
10220
|
-
const data =
|
|
10211
|
+
const data = asRecord5(record.data);
|
|
10221
10212
|
if (data && (Object.prototype.hasOwnProperty.call(record, "ok") || Object.prototype.hasOwnProperty.call(record, "errors") || Object.prototype.hasOwnProperty.call(record, "errorCode") || Object.prototype.hasOwnProperty.call(record, "error_code"))) {
|
|
10222
10213
|
return data;
|
|
10223
10214
|
}
|
|
@@ -10281,7 +10272,7 @@ async function runTokenLogin(cmd, opts) {
|
|
|
10281
10272
|
exitCode: mapStatusToExitCode(status.error.status)
|
|
10282
10273
|
});
|
|
10283
10274
|
}
|
|
10284
|
-
const statusData =
|
|
10275
|
+
const statusData = asRecord5(status.result.data.cliAuthStatus) ?? {};
|
|
10285
10276
|
const storage = await writeStoredToken(token, baseUrl);
|
|
10286
10277
|
const configPath2 = opts.saveBaseUrl ? await persistBaseUrl(baseUrl) : void 0;
|
|
10287
10278
|
return printEnvelopeAndExit({
|
|
@@ -10498,7 +10489,7 @@ async function runLogout(cmd) {
|
|
|
10498
10489
|
});
|
|
10499
10490
|
if (result.ok) {
|
|
10500
10491
|
requestId = result.result.requestId;
|
|
10501
|
-
const payload =
|
|
10492
|
+
const payload = asRecord5(result.result.data.revokeCliToken) ?? {};
|
|
10502
10493
|
revokedRemote = payload.ok !== false;
|
|
10503
10494
|
} else {
|
|
10504
10495
|
requestId = result.requestId;
|
|
@@ -10561,7 +10552,7 @@ async function runAuthStatus(cmd) {
|
|
|
10561
10552
|
exitCode: mapStatusToExitCode(result.error.status)
|
|
10562
10553
|
});
|
|
10563
10554
|
}
|
|
10564
|
-
const status =
|
|
10555
|
+
const status = asRecord5(result.result.data.cliAuthStatus) ?? {};
|
|
10565
10556
|
const baseAuthStatus = status.baseAuthStatus;
|
|
10566
10557
|
return printEnvelopeAndExit({
|
|
10567
10558
|
envelope: envelope({
|
|
@@ -12212,11 +12203,11 @@ function sanitizePlannerJson(value) {
|
|
|
12212
12203
|
}
|
|
12213
12204
|
return output;
|
|
12214
12205
|
}
|
|
12215
|
-
function
|
|
12206
|
+
function asRecord6(value) {
|
|
12216
12207
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
12217
12208
|
}
|
|
12218
12209
|
function readPlannerStateKey(value, keys) {
|
|
12219
|
-
const record =
|
|
12210
|
+
const record = asRecord6(value);
|
|
12220
12211
|
if (!record) {
|
|
12221
12212
|
return null;
|
|
12222
12213
|
}
|
|
@@ -14785,6 +14776,7 @@ var agentToolAccessSchema = z19.array(
|
|
|
14785
14776
|
scope_value: nonEmptyStringSchema
|
|
14786
14777
|
}).strict()
|
|
14787
14778
|
).min(1);
|
|
14779
|
+
var agentToolAccessUpdateSchema = agentToolAccessSchema.min(0);
|
|
14788
14780
|
var agentPluginConnectionsSchema = z19.array(
|
|
14789
14781
|
z19.object({
|
|
14790
14782
|
external_tool_connection_id: nonEmptyStringSchema,
|
|
@@ -14796,6 +14788,30 @@ var agentPluginConnectionsSchema = z19.array(
|
|
|
14796
14788
|
enabled: z19.boolean().optional()
|
|
14797
14789
|
}).strict()
|
|
14798
14790
|
).min(1);
|
|
14791
|
+
var agentPluginConnectionUpdateSchema = z19.array(
|
|
14792
|
+
z19.union([
|
|
14793
|
+
z19.object({
|
|
14794
|
+
id: nonEmptyStringSchema,
|
|
14795
|
+
_destroy: z19.literal(true)
|
|
14796
|
+
}).strict(),
|
|
14797
|
+
z19.object({
|
|
14798
|
+
id: nonEmptyStringSchema.optional(),
|
|
14799
|
+
external_tool_connection_id: nonEmptyStringSchema.optional(),
|
|
14800
|
+
tool_key: nonEmptyStringSchema.optional(),
|
|
14801
|
+
scope_value: nonEmptyStringSchema.optional(),
|
|
14802
|
+
allowed_tools: z19.array(nonEmptyStringSchema).optional(),
|
|
14803
|
+
allowed_scopes: z19.array(nonEmptyStringSchema).optional(),
|
|
14804
|
+
requires_confirmation: z19.boolean().optional(),
|
|
14805
|
+
enabled: z19.boolean().optional()
|
|
14806
|
+
}).strict().superRefine((value, context) => {
|
|
14807
|
+
if (value.id || value.external_tool_connection_id && value.tool_key) return;
|
|
14808
|
+
context.addIssue({
|
|
14809
|
+
code: z19.ZodIssueCode.custom,
|
|
14810
|
+
message: "Plugin updates require an id, or both external_tool_connection_id and tool_key for a new grant."
|
|
14811
|
+
});
|
|
14812
|
+
})
|
|
14813
|
+
])
|
|
14814
|
+
);
|
|
14799
14815
|
var agentTriggerSchema = z19.object({
|
|
14800
14816
|
trigger_type: z19.literal("cron"),
|
|
14801
14817
|
cron_expression: nonEmptyStringSchema,
|
|
@@ -14805,6 +14821,14 @@ var agentTriggerSchema = z19.object({
|
|
|
14805
14821
|
max_runs: z19.number().int().positive().nullable().optional(),
|
|
14806
14822
|
enabled: z19.boolean().optional()
|
|
14807
14823
|
}).strict();
|
|
14824
|
+
var agentTriggerUpdateSchema = z19.union([
|
|
14825
|
+
agentTriggerSchema.extend({ id: nonEmptyStringSchema.optional() }).strict(),
|
|
14826
|
+
z19.object({
|
|
14827
|
+
id: nonEmptyStringSchema,
|
|
14828
|
+
_destroy: z19.literal(true)
|
|
14829
|
+
}).strict()
|
|
14830
|
+
]);
|
|
14831
|
+
var automationConfigSchema = z19.record(z19.string(), z19.unknown());
|
|
14808
14832
|
var AGENT_SELECTION = `{
|
|
14809
14833
|
id
|
|
14810
14834
|
type
|
|
@@ -14855,6 +14879,7 @@ var AGENT_SELECTION = `{
|
|
|
14855
14879
|
memberId
|
|
14856
14880
|
createdAt
|
|
14857
14881
|
updatedAt
|
|
14882
|
+
updateVersion
|
|
14858
14883
|
}`;
|
|
14859
14884
|
var AGENT_PLUGIN_CATALOG_SELECTION = `{
|
|
14860
14885
|
externalToolConnectionId
|
|
@@ -14882,8 +14907,9 @@ var AUTOMATION_SELECTION = `{
|
|
|
14882
14907
|
memberId
|
|
14883
14908
|
createdAt
|
|
14884
14909
|
updatedAt
|
|
14910
|
+
updateVersion
|
|
14885
14911
|
}`;
|
|
14886
|
-
function
|
|
14912
|
+
function asRecord7(value) {
|
|
14887
14913
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
14888
14914
|
}
|
|
14889
14915
|
function asRequiredString(value) {
|
|
@@ -14932,12 +14958,12 @@ function parseJsonOption(value, optionName, schema) {
|
|
|
14932
14958
|
return schema.parse(parseJson(String(value), optionName));
|
|
14933
14959
|
}
|
|
14934
14960
|
function normalizePersistedCreatePayload(payload) {
|
|
14935
|
-
const mutation =
|
|
14936
|
-
const mutationData =
|
|
14937
|
-
const persisted =
|
|
14938
|
-
const attributes =
|
|
14939
|
-
const meta =
|
|
14940
|
-
const idempotency =
|
|
14961
|
+
const mutation = asRecord7(payload);
|
|
14962
|
+
const mutationData = asRecord7(mutation?.data);
|
|
14963
|
+
const persisted = asRecord7(mutationData?.data) ?? mutationData;
|
|
14964
|
+
const attributes = asRecord7(persisted?.attributes);
|
|
14965
|
+
const meta = asRecord7(mutationData?.meta);
|
|
14966
|
+
const idempotency = asRecord7(meta?.atlas_idempotency);
|
|
14941
14967
|
const id = asRequiredString(persisted?.id);
|
|
14942
14968
|
const slug = asRequiredString(persisted?.slug) ?? asRequiredString(attributes?.slug);
|
|
14943
14969
|
const replay = idempotency?.replay;
|
|
@@ -14966,6 +14992,36 @@ function normalizePersistedCreatePayload(payload) {
|
|
|
14966
14992
|
}
|
|
14967
14993
|
};
|
|
14968
14994
|
}
|
|
14995
|
+
function normalizePersistedUpdatePayload(payload) {
|
|
14996
|
+
const mutation = asRecord7(payload);
|
|
14997
|
+
const mutationData = asRecord7(mutation?.data);
|
|
14998
|
+
const persisted = asRecord7(mutationData?.data) ?? mutationData;
|
|
14999
|
+
const attributes = asRecord7(persisted?.attributes);
|
|
15000
|
+
const id = asRequiredString(persisted?.id);
|
|
15001
|
+
const slug = asRequiredString(persisted?.slug) ?? asRequiredString(attributes?.slug);
|
|
15002
|
+
const updateVersion = asRequiredString(persisted?.updateVersion) ?? asRequiredString(attributes?.updateVersion) ?? asRequiredString(attributes?.update_version);
|
|
15003
|
+
if (!mutation || !mutationData || !persisted || !id || !slug || !updateVersion) {
|
|
15004
|
+
throw new CliError({
|
|
15005
|
+
message: "Update response did not include persisted id, slug, and updateVersion.",
|
|
15006
|
+
kind: "malformed_response",
|
|
15007
|
+
status: 502,
|
|
15008
|
+
exitCode: EXIT_CODES.networkOrUpstream
|
|
15009
|
+
});
|
|
15010
|
+
}
|
|
15011
|
+
return {
|
|
15012
|
+
ok: mutation.ok,
|
|
15013
|
+
status: mutation.status,
|
|
15014
|
+
errorCode: mutation.errorCode ?? null,
|
|
15015
|
+
errors: mutation.errors ?? null,
|
|
15016
|
+
persisted: { id, slug, update_version: updateVersion }
|
|
15017
|
+
};
|
|
15018
|
+
}
|
|
15019
|
+
function parseAutomationConfig(value) {
|
|
15020
|
+
return automationConfigSchema.parse(parseJson(String(value), "--ai-task-config"));
|
|
15021
|
+
}
|
|
15022
|
+
function parseExpectedUpdateVersion(value) {
|
|
15023
|
+
return nonEmptyStringSchema.parse(String(value));
|
|
15024
|
+
}
|
|
14969
15025
|
function registerAtlasAuthoringCommands(program) {
|
|
14970
15026
|
const agents = program.command("agents").description("Bounded Agent authoring operations");
|
|
14971
15027
|
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(
|
|
@@ -15045,7 +15101,7 @@ function registerAtlasAuthoringCommands(program) {
|
|
|
15045
15101
|
transformMutationPayload: normalizePersistedCreatePayload
|
|
15046
15102
|
});
|
|
15047
15103
|
});
|
|
15048
|
-
agents.command("show").description("Read one persisted Agent by id").requiredOption("--id <
|
|
15104
|
+
agents.command("show").description("Read one persisted Agent by id or slug").requiredOption("--id <idOrSlug>", "Agent id or slug").action(async (opts, cmd) => {
|
|
15049
15105
|
const id = idSchema14.parse(opts.id);
|
|
15050
15106
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
15051
15107
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
@@ -15060,6 +15116,104 @@ function registerAtlasAuthoringCommands(program) {
|
|
|
15060
15116
|
isShow: true
|
|
15061
15117
|
});
|
|
15062
15118
|
});
|
|
15119
|
+
agents.command("update").description("Update one persisted Agent through the API-owned updateAgent contract").requiredOption("--id <idOrSlug>", "Agent id or slug").requiredOption(
|
|
15120
|
+
"--expected-update-version <version>",
|
|
15121
|
+
"Exact opaque updateVersion value from agents show; rejects stale writes"
|
|
15122
|
+
).option("--name <name>").option("--description <description>").option("--notes <notes>").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("--clear-trusted-urls", "Clear all trusted URLs").option("--tool-access <json>", "JSON array of the complete canonical native Agent tool scopes").option(
|
|
15123
|
+
"--plugin-connections <json>",
|
|
15124
|
+
"JSON array of Agent connector grant patches; removals require id and _destroy:true"
|
|
15125
|
+
).option(
|
|
15126
|
+
"--trigger <json>",
|
|
15127
|
+
"Canonical Agent trigger patch; use the trigger id from agents show to replace or remove it"
|
|
15128
|
+
).action(async (opts, cmd) => {
|
|
15129
|
+
if (opts.clearTrustedUrls && opts.trustedUrls !== void 0) {
|
|
15130
|
+
throw new CliError({
|
|
15131
|
+
message: "Use either --trusted-urls or --clear-trusted-urls, not both.",
|
|
15132
|
+
kind: "invalid_args",
|
|
15133
|
+
status: 400,
|
|
15134
|
+
exitCode: EXIT_CODES.invalidArgs
|
|
15135
|
+
});
|
|
15136
|
+
}
|
|
15137
|
+
const runWhenMentioned = parseBooleanOption(opts.runWhenMentioned, "--run-when-mentioned");
|
|
15138
|
+
const webAccessEnabled = parseBooleanOption(opts.webAccessEnabled, "--web-access-enabled");
|
|
15139
|
+
const webFetchEnabled = parseBooleanOption(opts.webFetchEnabled, "--web-fetch-enabled");
|
|
15140
|
+
const searchPastConversationsEnabled = parseBooleanOption(
|
|
15141
|
+
opts.searchPastConversationsEnabled,
|
|
15142
|
+
"--search-past-conversations-enabled"
|
|
15143
|
+
);
|
|
15144
|
+
const appRulesCreationEnabled = parseBooleanOption(
|
|
15145
|
+
opts.appRulesCreationEnabled,
|
|
15146
|
+
"--app-rules-creation-enabled"
|
|
15147
|
+
);
|
|
15148
|
+
const toolDiscoveryEnabled = parseBooleanOption(
|
|
15149
|
+
opts.toolDiscoveryEnabled,
|
|
15150
|
+
"--tool-discovery-enabled"
|
|
15151
|
+
);
|
|
15152
|
+
const selfUpdatesEnabled = parseBooleanOption(opts.selfUpdatesEnabled, "--self-updates-enabled");
|
|
15153
|
+
const trustedUrls = parseCommaSeparatedStrings(opts.trustedUrls);
|
|
15154
|
+
const toolAccess = parseJsonOption(
|
|
15155
|
+
opts.toolAccess,
|
|
15156
|
+
"--tool-access",
|
|
15157
|
+
agentToolAccessUpdateSchema
|
|
15158
|
+
);
|
|
15159
|
+
const pluginConnections = parseJsonOption(
|
|
15160
|
+
opts.pluginConnections,
|
|
15161
|
+
"--plugin-connections",
|
|
15162
|
+
agentPluginConnectionUpdateSchema
|
|
15163
|
+
);
|
|
15164
|
+
const trigger = parseJsonOption(opts.trigger, "--trigger", agentTriggerUpdateSchema);
|
|
15165
|
+
const patch = {
|
|
15166
|
+
...opts.name !== void 0 ? { name: String(opts.name) } : {},
|
|
15167
|
+
...opts.description !== void 0 ? { description: String(opts.description) } : {},
|
|
15168
|
+
...opts.notes !== void 0 ? { notes: String(opts.notes) } : {},
|
|
15169
|
+
...opts.status !== void 0 ? { status: String(opts.status) } : {},
|
|
15170
|
+
...opts.visibility !== void 0 ? { visibility: String(opts.visibility) } : {},
|
|
15171
|
+
...opts.model !== void 0 ? { model: String(opts.model) } : {},
|
|
15172
|
+
...runWhenMentioned !== void 0 ? { run_when_mentioned: runWhenMentioned } : {},
|
|
15173
|
+
...webAccessEnabled !== void 0 ? { web_access_enabled: webAccessEnabled } : {},
|
|
15174
|
+
...webFetchEnabled !== void 0 ? { web_fetch_enabled: webFetchEnabled } : {},
|
|
15175
|
+
...searchPastConversationsEnabled !== void 0 ? { search_past_conversations_enabled: searchPastConversationsEnabled } : {},
|
|
15176
|
+
...appRulesCreationEnabled !== void 0 ? { app_rules_creation_enabled: appRulesCreationEnabled } : {},
|
|
15177
|
+
...toolDiscoveryEnabled !== void 0 ? { tool_discovery_enabled: toolDiscoveryEnabled } : {},
|
|
15178
|
+
...selfUpdatesEnabled !== void 0 ? { self_updates_enabled: selfUpdatesEnabled } : {},
|
|
15179
|
+
...trustedUrls !== void 0 ? { trusted_urls: trustedUrls } : {},
|
|
15180
|
+
...opts.clearTrustedUrls ? { trusted_urls: [] } : {},
|
|
15181
|
+
...toolAccess !== void 0 ? { tool_access: toolAccess } : {},
|
|
15182
|
+
...pluginConnections !== void 0 ? { agent_tool_connections_attributes: pluginConnections } : {},
|
|
15183
|
+
...trigger !== void 0 ? { trigger_attributes: trigger } : {}
|
|
15184
|
+
};
|
|
15185
|
+
if (Object.keys(patch).length === 0) {
|
|
15186
|
+
throw new CliError({
|
|
15187
|
+
message: "agents update requires at least one mutable Agent field.",
|
|
15188
|
+
kind: "invalid_args",
|
|
15189
|
+
status: 400,
|
|
15190
|
+
exitCode: EXIT_CODES.invalidArgs
|
|
15191
|
+
});
|
|
15192
|
+
}
|
|
15193
|
+
const id = idSchema14.parse(opts.id);
|
|
15194
|
+
const expectedUpdateVersion = parseExpectedUpdateVersion(opts.expectedUpdateVersion);
|
|
15195
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
15196
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
15197
|
+
await runGraphqlMutationCommand({
|
|
15198
|
+
command: "agents.update",
|
|
15199
|
+
operationName: "AgentsUpdate",
|
|
15200
|
+
runtimeOptions: context.runtimeOptions,
|
|
15201
|
+
field: "update_agent",
|
|
15202
|
+
variableTypes: {
|
|
15203
|
+
organization_id: "ID!",
|
|
15204
|
+
agent_id: "ID!",
|
|
15205
|
+
params: "UpdateAgentParamsInput!",
|
|
15206
|
+
expected_update_version: "String!"
|
|
15207
|
+
},
|
|
15208
|
+
variables: {
|
|
15209
|
+
organization_id: organizationId,
|
|
15210
|
+
agent_id: id,
|
|
15211
|
+
params: { agent: patch },
|
|
15212
|
+
expected_update_version: expectedUpdateVersion
|
|
15213
|
+
},
|
|
15214
|
+
transformMutationPayload: normalizePersistedUpdatePayload
|
|
15215
|
+
});
|
|
15216
|
+
});
|
|
15063
15217
|
agents.command("plugin-catalog").description("Read connected Agent plugin capabilities for one supported service").requiredOption(
|
|
15064
15218
|
"--service <service>",
|
|
15065
15219
|
"Supported service: gmail, calendar, slack, or stripe"
|
|
@@ -15110,7 +15264,7 @@ function registerAtlasAuthoringCommands(program) {
|
|
|
15110
15264
|
transformMutationPayload: normalizePersistedCreatePayload
|
|
15111
15265
|
});
|
|
15112
15266
|
});
|
|
15113
|
-
automations.command("show").description("Read one persisted Automation by id").requiredOption("--id <
|
|
15267
|
+
automations.command("show").description("Read one persisted Automation by id or slug").requiredOption("--id <idOrSlug>", "Automation id or slug").action(async (opts, cmd) => {
|
|
15114
15268
|
const id = idSchema14.parse(opts.id);
|
|
15115
15269
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
15116
15270
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
@@ -15125,6 +15279,66 @@ function registerAtlasAuthoringCommands(program) {
|
|
|
15125
15279
|
isShow: true
|
|
15126
15280
|
});
|
|
15127
15281
|
});
|
|
15282
|
+
automations.command("update").description("Update one task-backed Automation through the API-owned updateTask contract").requiredOption("--id <idOrSlug>", "Automation id or slug").requiredOption(
|
|
15283
|
+
"--expected-update-version <version>",
|
|
15284
|
+
"Exact opaque updateVersion value from automations show; rejects stale writes"
|
|
15285
|
+
).option("--summary <summary>").option("--description <description>").option("--notes <notes>").option("--status <status>").option("--priority <priority>").option("--due-date <date>", "ISO-8601 date (YYYY-MM-DD)").option("--ai-task-config <json>", "Complete replacement ai_task_config JSON object").option(
|
|
15286
|
+
"--agent-id <agentId>",
|
|
15287
|
+
"Executor Agent id; requires --ai-task-config and is stored in that config"
|
|
15288
|
+
).action(async (opts, cmd) => {
|
|
15289
|
+
if (opts.agentId !== void 0 && opts.aiTaskConfig === void 0) {
|
|
15290
|
+
throw new CliError({
|
|
15291
|
+
message: "automations update requires --ai-task-config whenever --agent-id is supplied.",
|
|
15292
|
+
kind: "invalid_args",
|
|
15293
|
+
status: 400,
|
|
15294
|
+
exitCode: EXIT_CODES.invalidArgs
|
|
15295
|
+
});
|
|
15296
|
+
}
|
|
15297
|
+
const aiTaskConfig = opts.aiTaskConfig === void 0 ? void 0 : {
|
|
15298
|
+
...parseAutomationConfig(opts.aiTaskConfig),
|
|
15299
|
+
...opts.agentId !== void 0 ? { agent_id: idSchema14.parse(opts.agentId) } : {}
|
|
15300
|
+
};
|
|
15301
|
+
const patch = {
|
|
15302
|
+
...opts.summary !== void 0 ? { summary: String(opts.summary) } : {},
|
|
15303
|
+
...opts.description !== void 0 ? { description: String(opts.description) } : {},
|
|
15304
|
+
...opts.notes !== void 0 ? { notes: String(opts.notes) } : {},
|
|
15305
|
+
...opts.status !== void 0 ? { status: String(opts.status) } : {},
|
|
15306
|
+
...opts.priority !== void 0 ? { priority: String(opts.priority) } : {},
|
|
15307
|
+
...opts.dueDate !== void 0 ? { due_date: isoDateSchema.parse(opts.dueDate) } : {},
|
|
15308
|
+
...aiTaskConfig !== void 0 ? { ai_task_config: aiTaskConfig } : {}
|
|
15309
|
+
};
|
|
15310
|
+
if (Object.keys(patch).length === 0) {
|
|
15311
|
+
throw new CliError({
|
|
15312
|
+
message: "automations update requires at least one mutable Automation field.",
|
|
15313
|
+
kind: "invalid_args",
|
|
15314
|
+
status: 400,
|
|
15315
|
+
exitCode: EXIT_CODES.invalidArgs
|
|
15316
|
+
});
|
|
15317
|
+
}
|
|
15318
|
+
const id = idSchema14.parse(opts.id);
|
|
15319
|
+
const expectedUpdateVersion = parseExpectedUpdateVersion(opts.expectedUpdateVersion);
|
|
15320
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
15321
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
15322
|
+
await runGraphqlMutationCommand({
|
|
15323
|
+
command: "automations.update",
|
|
15324
|
+
operationName: "AutomationsUpdate",
|
|
15325
|
+
runtimeOptions: context.runtimeOptions,
|
|
15326
|
+
field: "update_task",
|
|
15327
|
+
variableTypes: {
|
|
15328
|
+
organization_id: "ID!",
|
|
15329
|
+
task_id: "ID!",
|
|
15330
|
+
params: "UpdateTaskParamsInput!",
|
|
15331
|
+
expected_update_version: "String!"
|
|
15332
|
+
},
|
|
15333
|
+
variables: {
|
|
15334
|
+
organization_id: organizationId,
|
|
15335
|
+
task_id: id,
|
|
15336
|
+
params: { task: patch },
|
|
15337
|
+
expected_update_version: expectedUpdateVersion
|
|
15338
|
+
},
|
|
15339
|
+
transformMutationPayload: normalizePersistedUpdatePayload
|
|
15340
|
+
});
|
|
15341
|
+
});
|
|
15128
15342
|
const skills = program.commands.find((command) => command.name() === "skills");
|
|
15129
15343
|
if (!skills) {
|
|
15130
15344
|
throw new Error("Skills command must be registered before Atlas authoring commands.");
|
|
@@ -15156,6 +15370,47 @@ function registerAtlasAuthoringCommands(program) {
|
|
|
15156
15370
|
transformMutationPayload: normalizePersistedCreatePayload
|
|
15157
15371
|
});
|
|
15158
15372
|
});
|
|
15373
|
+
skills.command("update").description("Update one persisted Skill through the API-owned updateSkill contract").requiredOption("--id <idOrSlug>", "Skill id or slug").requiredOption(
|
|
15374
|
+
"--expected-update-version <version>",
|
|
15375
|
+
"Exact opaque updateVersion value from skills show; rejects stale writes"
|
|
15376
|
+
).option("--name <name>").option("--emoji <emoji>").option("--description <description>").action(async (opts, cmd) => {
|
|
15377
|
+
const patch = {
|
|
15378
|
+
...opts.name !== void 0 ? { name: String(opts.name) } : {},
|
|
15379
|
+
...opts.emoji !== void 0 ? { emoji: String(opts.emoji) } : {},
|
|
15380
|
+
...opts.description !== void 0 ? { description: String(opts.description) } : {}
|
|
15381
|
+
};
|
|
15382
|
+
if (Object.keys(patch).length === 0) {
|
|
15383
|
+
throw new CliError({
|
|
15384
|
+
message: "skills update requires at least one mutable Skill field.",
|
|
15385
|
+
kind: "invalid_args",
|
|
15386
|
+
status: 400,
|
|
15387
|
+
exitCode: EXIT_CODES.invalidArgs
|
|
15388
|
+
});
|
|
15389
|
+
}
|
|
15390
|
+
const id = idSchema14.parse(opts.id);
|
|
15391
|
+
const expectedUpdateVersion = parseExpectedUpdateVersion(opts.expectedUpdateVersion);
|
|
15392
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
15393
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
15394
|
+
await runGraphqlMutationCommand({
|
|
15395
|
+
command: "skills.update",
|
|
15396
|
+
operationName: "SkillsUpdate",
|
|
15397
|
+
runtimeOptions: context.runtimeOptions,
|
|
15398
|
+
field: "update_skill",
|
|
15399
|
+
variableTypes: {
|
|
15400
|
+
organization_id: "ID!",
|
|
15401
|
+
id: "ID!",
|
|
15402
|
+
input: "UpdateSkillInput!",
|
|
15403
|
+
expected_update_version: "String!"
|
|
15404
|
+
},
|
|
15405
|
+
variables: {
|
|
15406
|
+
organization_id: organizationId,
|
|
15407
|
+
id,
|
|
15408
|
+
input: patch,
|
|
15409
|
+
expected_update_version: expectedUpdateVersion
|
|
15410
|
+
},
|
|
15411
|
+
transformMutationPayload: normalizePersistedUpdatePayload
|
|
15412
|
+
});
|
|
15413
|
+
});
|
|
15159
15414
|
}
|
|
15160
15415
|
|
|
15161
15416
|
// src/commands/discovery.ts
|
|
@@ -15166,7 +15421,7 @@ import { join as join3 } from "path";
|
|
|
15166
15421
|
import { createHash } from "crypto";
|
|
15167
15422
|
|
|
15168
15423
|
// src/version.ts
|
|
15169
|
-
var CLI_VERSION = "0.1.
|
|
15424
|
+
var CLI_VERSION = "0.1.72";
|
|
15170
15425
|
|
|
15171
15426
|
// src/operationMetadata.ts
|
|
15172
15427
|
var DISCOVERY_OPERATION_IDS = [
|
|
@@ -15479,7 +15734,9 @@ var WRITE_OPERATION_IDS = [
|
|
|
15479
15734
|
"accountability.create",
|
|
15480
15735
|
"accountability.update",
|
|
15481
15736
|
"agents.create",
|
|
15737
|
+
"agents.update",
|
|
15482
15738
|
"automations.create",
|
|
15739
|
+
"automations.update",
|
|
15483
15740
|
"contacts.create",
|
|
15484
15741
|
"contacts.update",
|
|
15485
15742
|
"content.create-contact",
|
|
@@ -15585,6 +15842,7 @@ var WRITE_OPERATION_IDS = [
|
|
|
15585
15842
|
"scorecards.create",
|
|
15586
15843
|
"scorecards.update",
|
|
15587
15844
|
"skills.create",
|
|
15845
|
+
"skills.update",
|
|
15588
15846
|
"smart-kpi-views.create",
|
|
15589
15847
|
"stand-ups.create",
|
|
15590
15848
|
"stand-ups.update",
|
|
@@ -15936,12 +16194,13 @@ var NAMESPACE_DOCS = {
|
|
|
15936
16194
|
skills: {
|
|
15937
16195
|
name: "skills",
|
|
15938
16196
|
tier: "primary",
|
|
15939
|
-
description: "Skill record readback and bounded create operations.",
|
|
16197
|
+
description: "Skill record readback and bounded create/update operations.",
|
|
15940
16198
|
examples: [
|
|
15941
16199
|
"wave skills list --json",
|
|
15942
16200
|
"wave skills list --scope ADMIN_GLOBAL --json",
|
|
15943
16201
|
"wave skills show --id 123 --json",
|
|
15944
|
-
'wave skills create --name "Weekly planning" --scope MEMBER_PERSONAL --idempotency-key skill-create-001'
|
|
16202
|
+
'wave skills create --name "Weekly planning" --scope MEMBER_PERSONAL --idempotency-key skill-create-001',
|
|
16203
|
+
'wave skills update --id SKL-01 --expected-update-version 2026-07-17T12:00:00.123456Z --description "Review my projects."'
|
|
15945
16204
|
],
|
|
15946
16205
|
schema: {
|
|
15947
16206
|
output: "json-envelope-default",
|
|
@@ -15949,20 +16208,22 @@ var NAMESPACE_DOCS = {
|
|
|
15949
16208
|
safety: [
|
|
15950
16209
|
"Uses API-owned Skill GraphQL read fields only.",
|
|
15951
16210
|
"Create calls only createSkill with an explicit idempotency key.",
|
|
16211
|
+
"Update calls only updateSkill with an exact opaque updateVersion token and does not change scope or ownership.",
|
|
15952
16212
|
"Skill create supports the API-defined ADMIN_GLOBAL and MEMBER_PERSONAL scopes.",
|
|
15953
16213
|
"Does not update, destroy, archive, approve, or apply Skill records."
|
|
15954
16214
|
],
|
|
15955
|
-
commands: ["list", "show", "create"]
|
|
16215
|
+
commands: ["list", "show", "create", "update"]
|
|
15956
16216
|
}
|
|
15957
16217
|
},
|
|
15958
16218
|
agents: {
|
|
15959
16219
|
name: "agents",
|
|
15960
16220
|
tier: "primary",
|
|
15961
|
-
description: "Bounded Agent create and
|
|
16221
|
+
description: "Bounded Agent create, readback, and stale-write-protected update operations.",
|
|
15962
16222
|
examples: [
|
|
15963
16223
|
'wave agents create --name "Planning helper" --idempotency-key agent-create-001',
|
|
15964
16224
|
`wave agents create --name "Project summary" --notes "Summarize my projects." --tool-access '[{"tool_key":"projects","scope_value":"all"}]' --trigger '{"trigger_type":"cron","cron_expression":"0 14 * * 2","timezone":"America/Phoenix","enabled":true}' --idempotency-key agent-create-002`,
|
|
15965
|
-
"wave agents show --id
|
|
16225
|
+
"wave agents show --id AGT-01",
|
|
16226
|
+
'wave agents update --id AGT-01 --expected-update-version 2026-07-17T12:00:00.123456Z --notes "Summarize my projects."'
|
|
15966
16227
|
],
|
|
15967
16228
|
schema: {
|
|
15968
16229
|
output: "json-envelope-default",
|
|
@@ -15970,20 +16231,22 @@ var NAMESPACE_DOCS = {
|
|
|
15970
16231
|
safety: [
|
|
15971
16232
|
"Create calls only createAgent with an explicit idempotency key.",
|
|
15972
16233
|
"Create preserves API-owned defaults by sending only supplied typed Agent fields.",
|
|
16234
|
+
"Update calls only updateAgent with an exact opaque updateVersion token and cannot change ownership.",
|
|
15973
16235
|
"Native tools, plugin connector grants, and the cron trigger use strict canonical JSON shapes.",
|
|
15974
16236
|
"Outlook Calendar and Outlook Mail are not supported Agent plugin families in this release.",
|
|
15975
16237
|
"Show uses the API-owned agent query by id; no slug fallback is implemented."
|
|
15976
16238
|
],
|
|
15977
|
-
commands: ["create", "show"]
|
|
16239
|
+
commands: ["create", "show", "update"]
|
|
15978
16240
|
}
|
|
15979
16241
|
},
|
|
15980
16242
|
automations: {
|
|
15981
16243
|
name: "automations",
|
|
15982
16244
|
tier: "primary",
|
|
15983
|
-
description: "Bounded Automation create and
|
|
16245
|
+
description: "Bounded task-backed Automation create, readback, and stale-write-protected update operations.",
|
|
15984
16246
|
examples: [
|
|
15985
16247
|
`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`,
|
|
15986
|
-
"wave automations show --id
|
|
16248
|
+
"wave automations show --id ATK-01",
|
|
16249
|
+
'wave automations update --id ATK-01 --expected-update-version 2026-07-17T12:00:00.123456Z --summary "Weekly project review"'
|
|
15987
16250
|
],
|
|
15988
16251
|
schema: {
|
|
15989
16252
|
output: "json-envelope-default",
|
|
@@ -15992,10 +16255,11 @@ var NAMESPACE_DOCS = {
|
|
|
15992
16255
|
"Create calls only createAutomation with an explicit idempotency key.",
|
|
15993
16256
|
"Only the API-defined ai_task_config field accepts validated JSON.",
|
|
15994
16257
|
"Optional executor Agent linkage is sent only through the API-defined top-level agentId input.",
|
|
16258
|
+
"Update calls only updateTask with an exact opaque updateVersion token; it cannot change task type, ownership, or project linkage.",
|
|
15995
16259
|
"Does not create a project Task, run an Automation, or invoke AI OS actions.",
|
|
15996
16260
|
"Show uses the API-owned automation query by id; no slug fallback is implemented."
|
|
15997
16261
|
],
|
|
15998
|
-
commands: ["create", "show"]
|
|
16262
|
+
commands: ["create", "show", "update"]
|
|
15999
16263
|
}
|
|
16000
16264
|
},
|
|
16001
16265
|
broadcast: {
|