@wave-ai-os/wave-cli 0.1.75 → 0.1.77
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/README.md +7 -7
- package/dist/index.cjs +584 -747
- package/dist/index.js +581 -744
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
|
|
4
4
|
// src/index.ts
|
|
5
5
|
var import_commander2 = require("commander");
|
|
6
|
-
var
|
|
6
|
+
var import_zod21 = require("zod");
|
|
7
7
|
|
|
8
8
|
// src/cli.ts
|
|
9
9
|
var import_commander = require("commander");
|
|
10
10
|
|
|
11
11
|
// src/commands/tasks.ts
|
|
12
|
-
var
|
|
12
|
+
var import_zod3 = require("zod");
|
|
13
13
|
|
|
14
14
|
// src/config.ts
|
|
15
15
|
var import_zod = require("zod");
|
|
@@ -2144,6 +2144,17 @@ async function authGraphqlRequest(params) {
|
|
|
2144
2144
|
}
|
|
2145
2145
|
}
|
|
2146
2146
|
|
|
2147
|
+
// src/machineRuntimeContext.ts
|
|
2148
|
+
var import_node_async_hooks = require("async_hooks");
|
|
2149
|
+
var machineRuntimeAuthStorage = new import_node_async_hooks.AsyncLocalStorage();
|
|
2150
|
+
function currentMachineRuntimeAuth() {
|
|
2151
|
+
return machineRuntimeAuthStorage.getStore();
|
|
2152
|
+
}
|
|
2153
|
+
function withMachineRuntimeAuth(auth, callback) {
|
|
2154
|
+
if (!auth) return callback();
|
|
2155
|
+
return machineRuntimeAuthStorage.run(auth, callback);
|
|
2156
|
+
}
|
|
2157
|
+
|
|
2147
2158
|
// src/commands/runtimeOptions.ts
|
|
2148
2159
|
var CLI_AUTH_STATUS_QUERY = "query WaveCliAuthenticatedOrganization { cliAuthStatus { authenticated baseAuthStatus organization { id slug } } }";
|
|
2149
2160
|
var stdinPromise = null;
|
|
@@ -2170,6 +2181,11 @@ function parseBool(raw) {
|
|
|
2170
2181
|
}
|
|
2171
2182
|
return void 0;
|
|
2172
2183
|
}
|
|
2184
|
+
function omitUndefined(values) {
|
|
2185
|
+
return Object.fromEntries(
|
|
2186
|
+
Object.entries(values).filter(([, value]) => value !== void 0)
|
|
2187
|
+
);
|
|
2188
|
+
}
|
|
2173
2189
|
function parseAuthJson(raw) {
|
|
2174
2190
|
try {
|
|
2175
2191
|
const parsed = JSON.parse(raw);
|
|
@@ -2177,7 +2193,7 @@ function parseAuthJson(raw) {
|
|
|
2177
2193
|
throw new Error("Expected JSON object.");
|
|
2178
2194
|
}
|
|
2179
2195
|
const obj = parsed;
|
|
2180
|
-
return {
|
|
2196
|
+
return omitUndefined({
|
|
2181
2197
|
token: normalize3(obj.token),
|
|
2182
2198
|
baseUrl: normalize3(obj.baseUrl ?? obj.base_url),
|
|
2183
2199
|
timeoutMs: typeof obj.timeoutMs === "number" || typeof obj.timeoutMs === "string" ? obj.timeoutMs : typeof obj.timeout_ms === "number" || typeof obj.timeout_ms === "string" ? obj.timeout_ms : void 0,
|
|
@@ -2210,7 +2226,7 @@ function parseAuthJson(raw) {
|
|
|
2210
2226
|
openapiPath: normalize3(obj.openapiPath ?? obj.openapi_path),
|
|
2211
2227
|
openapiUrl: normalize3(obj.openapiUrl ?? obj.openapi_url),
|
|
2212
2228
|
openapiVersion: normalize3(obj.openapiVersion ?? obj.openapi_version)
|
|
2213
|
-
};
|
|
2229
|
+
});
|
|
2214
2230
|
} catch (error) {
|
|
2215
2231
|
throw new CliError({
|
|
2216
2232
|
message: error instanceof Error ? `Invalid --auth-json-stdin payload: ${error.message}` : "Invalid --auth-json-stdin payload.",
|
|
@@ -2258,13 +2274,14 @@ function firstDefined(...values) {
|
|
|
2258
2274
|
return values.find((value) => value !== void 0);
|
|
2259
2275
|
}
|
|
2260
2276
|
function resolveAuthToken(options, stdin, config, env) {
|
|
2277
|
+
const candidate = (source, token) => token ? { token, source } : { source };
|
|
2261
2278
|
const candidates = [
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2279
|
+
candidate("flag", normalize3(options.token)),
|
|
2280
|
+
candidate("stdin", normalize3(stdin.token)),
|
|
2281
|
+
candidate("env", normalize3(env.WAVE_API_TOKEN)),
|
|
2282
|
+
candidate("config", normalize3(config.token))
|
|
2266
2283
|
];
|
|
2267
|
-
return candidates.find((
|
|
2284
|
+
return candidates.find((candidate2) => candidate2.token) ?? { source: "none" };
|
|
2268
2285
|
}
|
|
2269
2286
|
function resolveFromSources(options, stdin, config, env) {
|
|
2270
2287
|
const baseUrl = firstDefined(
|
|
@@ -2363,10 +2380,9 @@ function resolveFromSources(options, stdin, config, env) {
|
|
|
2363
2380
|
normalize3(config.openapiVersion)
|
|
2364
2381
|
);
|
|
2365
2382
|
const resolvedAuth = resolveAuthToken(options, stdin, config, env);
|
|
2366
|
-
|
|
2367
|
-
organizationId,
|
|
2383
|
+
const resolved = {
|
|
2368
2384
|
organizationIdSource,
|
|
2369
|
-
runtimeOptions: {
|
|
2385
|
+
runtimeOptions: omitUndefined({
|
|
2370
2386
|
token: resolvedAuth.token,
|
|
2371
2387
|
tokenSource: resolvedAuth.token ? resolvedAuth.source : "none",
|
|
2372
2388
|
baseUrl,
|
|
@@ -2386,8 +2402,10 @@ function resolveFromSources(options, stdin, config, env) {
|
|
|
2386
2402
|
openapiPath,
|
|
2387
2403
|
openapiUrl,
|
|
2388
2404
|
openapiVersion
|
|
2389
|
-
}
|
|
2405
|
+
})
|
|
2390
2406
|
};
|
|
2407
|
+
if (organizationId) resolved.organizationId = organizationId;
|
|
2408
|
+
return resolved;
|
|
2391
2409
|
}
|
|
2392
2410
|
async function resolveWithStoredToken(context) {
|
|
2393
2411
|
if (context.runtimeOptions.token || !context.runtimeOptions.baseUrl) {
|
|
@@ -2411,11 +2429,11 @@ async function resolveWithAuthenticatedOrganization(context) {
|
|
|
2411
2429
|
const baseUrl = normalize3(context.runtimeOptions.baseUrl);
|
|
2412
2430
|
const token = normalize3(context.runtimeOptions.token);
|
|
2413
2431
|
if (!baseUrl || !token) {
|
|
2432
|
+
const runtimeOptions2 = { ...context.runtimeOptions };
|
|
2433
|
+
delete runtimeOptions2.organizationId;
|
|
2414
2434
|
return {
|
|
2415
|
-
...context,
|
|
2416
|
-
organizationId: void 0,
|
|
2417
2435
|
organizationIdSource: "none",
|
|
2418
|
-
runtimeOptions:
|
|
2436
|
+
runtimeOptions: runtimeOptions2
|
|
2419
2437
|
};
|
|
2420
2438
|
}
|
|
2421
2439
|
const response = await authGraphqlRequest({
|
|
@@ -2425,12 +2443,18 @@ async function resolveWithAuthenticatedOrganization(context) {
|
|
|
2425
2443
|
query: CLI_AUTH_STATUS_QUERY
|
|
2426
2444
|
});
|
|
2427
2445
|
const organizationId = response.ok ? organizationIdFromCliAuthStatus(response.result.data) : void 0;
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
organizationId
|
|
2446
|
+
const runtimeOptions = { ...context.runtimeOptions };
|
|
2447
|
+
if (organizationId) {
|
|
2448
|
+
runtimeOptions.organizationId = organizationId;
|
|
2449
|
+
} else {
|
|
2450
|
+
delete runtimeOptions.organizationId;
|
|
2451
|
+
}
|
|
2452
|
+
const resolved = {
|
|
2431
2453
|
organizationIdSource: organizationId ? "token" : "none",
|
|
2432
|
-
runtimeOptions
|
|
2454
|
+
runtimeOptions
|
|
2433
2455
|
};
|
|
2456
|
+
if (organizationId) resolved.organizationId = organizationId;
|
|
2457
|
+
return resolved;
|
|
2434
2458
|
}
|
|
2435
2459
|
function defaultConfigPath(env) {
|
|
2436
2460
|
const explicitEnv = normalize3(env.WAVE_CONFIG_PATH);
|
|
@@ -2497,7 +2521,22 @@ async function resolveStdinContext(options) {
|
|
|
2497
2521
|
async function resolveUnscopedCommandContext(options) {
|
|
2498
2522
|
const stdin = await resolveStdinContext(options);
|
|
2499
2523
|
const config = await resolveConfigFileContext(options, process.env);
|
|
2500
|
-
return resolveWithStoredToken(resolveFromSources(options, stdin, config, process.env));
|
|
2524
|
+
return resolveWithStoredToken(applyMachineRuntimeAuth(resolveFromSources(options, stdin, config, process.env)));
|
|
2525
|
+
}
|
|
2526
|
+
function applyMachineRuntimeAuth(resolved) {
|
|
2527
|
+
const machineAuth = currentMachineRuntimeAuth();
|
|
2528
|
+
if (!machineAuth) return resolved;
|
|
2529
|
+
return {
|
|
2530
|
+
organizationId: machineAuth.organizationId,
|
|
2531
|
+
organizationIdSource: "flag",
|
|
2532
|
+
runtimeOptions: {
|
|
2533
|
+
...resolved.runtimeOptions,
|
|
2534
|
+
token: machineAuth.token,
|
|
2535
|
+
tokenSource: "machine",
|
|
2536
|
+
baseUrl: machineAuth.baseUrl,
|
|
2537
|
+
organizationId: machineAuth.organizationId
|
|
2538
|
+
}
|
|
2539
|
+
};
|
|
2501
2540
|
}
|
|
2502
2541
|
async function resolveCommandContext(options) {
|
|
2503
2542
|
return resolveWithAuthenticatedOrganization(await resolveUnscopedCommandContext(options));
|
|
@@ -2651,10 +2690,29 @@ function registerGraphqlSearchCommand(command, config) {
|
|
|
2651
2690
|
});
|
|
2652
2691
|
}
|
|
2653
2692
|
|
|
2693
|
+
// src/commands/taskPriority.ts
|
|
2694
|
+
var import_zod2 = require("zod");
|
|
2695
|
+
var taskPrioritySchema = import_zod2.z.enum(["no_priority", "urgent", "high", "medium", "low"]);
|
|
2696
|
+
var taskPriorityValues = taskPrioritySchema.options.join(", ");
|
|
2697
|
+
var taskPriorityHelp = `Filter by priority: ${taskPriorityValues}.`;
|
|
2698
|
+
function parseTaskPriority(value) {
|
|
2699
|
+
if (value === void 0) return void 0;
|
|
2700
|
+
const parsed = taskPrioritySchema.safeParse(value);
|
|
2701
|
+
if (!parsed.success) {
|
|
2702
|
+
throw new CliError({
|
|
2703
|
+
message: `Invalid task priority. Use one of: ${taskPriorityValues}.`,
|
|
2704
|
+
kind: "invalid_args",
|
|
2705
|
+
status: 400,
|
|
2706
|
+
exitCode: EXIT_CODES.invalidArgs
|
|
2707
|
+
});
|
|
2708
|
+
}
|
|
2709
|
+
return parsed.data.toUpperCase();
|
|
2710
|
+
}
|
|
2711
|
+
|
|
2654
2712
|
// src/commands/tasks.ts
|
|
2655
|
-
var projectIdSchema =
|
|
2656
|
-
var idSchema =
|
|
2657
|
-
var summarySchema =
|
|
2713
|
+
var projectIdSchema = import_zod3.z.string().min(1);
|
|
2714
|
+
var idSchema = import_zod3.z.string().min(1);
|
|
2715
|
+
var summarySchema = import_zod3.z.string().min(1);
|
|
2658
2716
|
function parseTaskUpdateJson(raw) {
|
|
2659
2717
|
try {
|
|
2660
2718
|
const parsed = JSON.parse(raw);
|
|
@@ -2681,7 +2739,7 @@ function parseLabelIds(raw) {
|
|
|
2681
2739
|
}
|
|
2682
2740
|
function registerTaskCommands(program) {
|
|
2683
2741
|
const tasks = program.command("tasks").description("Task operations");
|
|
2684
|
-
tasks.command("list").option("--project-id <projectId>").option("--page <page>").option("--per <per>").option("--team-id <teamId>").option("--team-ids <teamIds>").option("--member-id <memberId>").option("--meeting-id <meetingId>").option("--field-name <fieldName>").option("--field-value <fieldValue>").option("--field-blank <fieldBlank>").option("--open <open>").option("--rank-direction <rankDirection>").option("--include-archived <includeArchived>").action(async (opts, cmd) => {
|
|
2742
|
+
tasks.command("list").option("--project-id <projectId>").option("--page <page>").option("--per <per>").option("--team-id <teamId>").option("--team-ids <teamIds>").option("--member-id <memberId>").option("--meeting-id <meetingId>").option("--field-name <fieldName>").option("--field-value <fieldValue>").option("--field-blank <fieldBlank>").option("--open <open>").option("--priority <priority>", taskPriorityHelp).option("--rank-direction <rankDirection>").option("--include-archived <includeArchived>").action(async (opts, cmd) => {
|
|
2685
2743
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2686
2744
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2687
2745
|
const projectId = opts.projectId ? projectIdSchema.parse(opts.projectId) : void 0;
|
|
@@ -2702,9 +2760,27 @@ function registerTaskCommands(program) {
|
|
|
2702
2760
|
field_value: opts.fieldValue,
|
|
2703
2761
|
field_blank: opts.fieldBlank,
|
|
2704
2762
|
open: opts.open,
|
|
2763
|
+
priority: parseTaskPriority(opts.priority),
|
|
2705
2764
|
rank_direction: opts.rankDirection,
|
|
2706
2765
|
include_archived: opts.includeArchived
|
|
2707
2766
|
}),
|
|
2767
|
+
variableTypes: {
|
|
2768
|
+
organization_id: "ID!",
|
|
2769
|
+
page: "Int",
|
|
2770
|
+
per: "Int",
|
|
2771
|
+
project_id: "ID",
|
|
2772
|
+
team_id: "ID",
|
|
2773
|
+
team_ids: "[ID!]",
|
|
2774
|
+
member_id: "ID",
|
|
2775
|
+
meeting_id: "ID",
|
|
2776
|
+
field_name: "String",
|
|
2777
|
+
field_value: "String",
|
|
2778
|
+
field_blank: "Boolean",
|
|
2779
|
+
open: "Boolean",
|
|
2780
|
+
priority: "TaskPriority",
|
|
2781
|
+
rank_direction: "String",
|
|
2782
|
+
include_archived: "Boolean"
|
|
2783
|
+
},
|
|
2708
2784
|
isList: true
|
|
2709
2785
|
});
|
|
2710
2786
|
});
|
|
@@ -2799,10 +2875,10 @@ function registerTaskCommands(program) {
|
|
|
2799
2875
|
}
|
|
2800
2876
|
|
|
2801
2877
|
// src/commands/projects.ts
|
|
2802
|
-
var
|
|
2878
|
+
var import_zod5 = require("zod");
|
|
2803
2879
|
|
|
2804
2880
|
// src/commands/entityCrud.ts
|
|
2805
|
-
var
|
|
2881
|
+
var import_zod4 = require("zod");
|
|
2806
2882
|
|
|
2807
2883
|
// src/commands/dtoHelpCatalog.ts
|
|
2808
2884
|
var dtoHelpCatalog = {
|
|
@@ -3383,7 +3459,7 @@ function buildDataJsonHelp(rootKey, mode) {
|
|
|
3383
3459
|
}
|
|
3384
3460
|
|
|
3385
3461
|
// src/commands/entityCrud.ts
|
|
3386
|
-
var idSchema2 =
|
|
3462
|
+
var idSchema2 = import_zod4.z.string().min(1);
|
|
3387
3463
|
function toSingularResourceName(resourcePath) {
|
|
3388
3464
|
if (resourcePath === "organization_meta_profiles") {
|
|
3389
3465
|
return "organization_meta_profile";
|
|
@@ -3609,10 +3685,28 @@ var __testables = {
|
|
|
3609
3685
|
};
|
|
3610
3686
|
|
|
3611
3687
|
// src/commands/projects.ts
|
|
3612
|
-
var idSchema3 =
|
|
3688
|
+
var idSchema3 = import_zod5.z.string().min(1);
|
|
3689
|
+
var projectStatusSchema = import_zod5.z.enum([
|
|
3690
|
+
"backlog",
|
|
3691
|
+
"planned",
|
|
3692
|
+
"in_progress",
|
|
3693
|
+
"completed",
|
|
3694
|
+
"cancelled"
|
|
3695
|
+
]);
|
|
3696
|
+
var projectStatusValues = projectStatusSchema.options.join(", ");
|
|
3697
|
+
var projectPrioritySchema = import_zod5.z.enum([
|
|
3698
|
+
"no_priority",
|
|
3699
|
+
"urgent",
|
|
3700
|
+
"high",
|
|
3701
|
+
"medium",
|
|
3702
|
+
"low"
|
|
3703
|
+
]);
|
|
3704
|
+
var projectPriorityValues = projectPrioritySchema.options.join(", ");
|
|
3613
3705
|
var projectCreateDataJsonHelp = buildDataJsonHelp("project", "create") ?? 'JSON object for project or {"project": {...}}';
|
|
3614
3706
|
var projectUpdateDataJsonHelp = buildDataJsonHelp("project", "update") ?? 'JSON object for project or {"project": {...}}';
|
|
3615
|
-
|
|
3707
|
+
function projectsIndexMinimalSelectionSet(includeProjectTypes = false) {
|
|
3708
|
+
return `{ count currentPage totalPages data { id type attributes { name slug status priority${includeProjectTypes ? " projectType" : ""} } } }`;
|
|
3709
|
+
}
|
|
3616
3710
|
var displayPreferenceAttributesSelectionSet = "attributes { id viewType favorite groupingField groupToggleState memberId focusMemberId focusTeamId displayableId displayableType preferenceType agendaItemId }";
|
|
3617
3711
|
var filterPreferenceAttributesSelectionSet = "attributes { id filterType filter memberId focusMemberId focusTeamId filterableId filterableType preferenceType agendaItemId }";
|
|
3618
3712
|
var healthUpdateSummarySelectionSet = "id type value memberId status createdAt updatedAt updatableType updatableId parentUpdateId emojis { id name memberId } resources { ...ResourceSummaryFull }";
|
|
@@ -3623,6 +3717,32 @@ function asRecord3(value) {
|
|
|
3623
3717
|
function toNonEmptyString(value) {
|
|
3624
3718
|
return typeof value === "string" && value.trim() !== "" ? value : void 0;
|
|
3625
3719
|
}
|
|
3720
|
+
function parseProjectStatus(value) {
|
|
3721
|
+
if (value === void 0) return void 0;
|
|
3722
|
+
const parsed = projectStatusSchema.safeParse(value);
|
|
3723
|
+
if (!parsed.success) {
|
|
3724
|
+
throw new CliError({
|
|
3725
|
+
message: `Invalid project status. Use one of: ${projectStatusValues}.`,
|
|
3726
|
+
kind: "invalid_args",
|
|
3727
|
+
status: 400,
|
|
3728
|
+
exitCode: EXIT_CODES.invalidArgs
|
|
3729
|
+
});
|
|
3730
|
+
}
|
|
3731
|
+
return parsed.data.toUpperCase();
|
|
3732
|
+
}
|
|
3733
|
+
function parseProjectPriority(value) {
|
|
3734
|
+
if (value === void 0) return void 0;
|
|
3735
|
+
const parsed = projectPrioritySchema.safeParse(value);
|
|
3736
|
+
if (!parsed.success) {
|
|
3737
|
+
throw new CliError({
|
|
3738
|
+
message: `Invalid project priority. Use one of: ${projectPriorityValues}.`,
|
|
3739
|
+
kind: "invalid_args",
|
|
3740
|
+
status: 400,
|
|
3741
|
+
exitCode: EXIT_CODES.invalidArgs
|
|
3742
|
+
});
|
|
3743
|
+
}
|
|
3744
|
+
return parsed.data.toUpperCase();
|
|
3745
|
+
}
|
|
3626
3746
|
function normalizeProjectRowForDisplay(row) {
|
|
3627
3747
|
const record = asRecord3(row);
|
|
3628
3748
|
if (!record) return row;
|
|
@@ -3650,7 +3770,13 @@ function normalizeProjectsListForDisplay(payload) {
|
|
|
3650
3770
|
}
|
|
3651
3771
|
function registerProjectCommands(program) {
|
|
3652
3772
|
const projects = program.command("projects").description("Project operations");
|
|
3653
|
-
projects.command("list").option("--page <page>").option("--per <per>").option("--team-ids <teamIds>").option("--member-id <memberId>").
|
|
3773
|
+
projects.command("list").option("--page <page>").option("--per <per>").option("--team-ids <teamIds>").option("--member-id <memberId>").option(
|
|
3774
|
+
"--status <status>",
|
|
3775
|
+
"Filter by status: backlog, planned, in_progress, completed, cancelled."
|
|
3776
|
+
).option(
|
|
3777
|
+
"--priority <priority>",
|
|
3778
|
+
"Filter by priority: no_priority, urgent, high, medium, low."
|
|
3779
|
+
).option("--include-project-types", "Include projectType in the list response (opt-in).").action(async (opts, cmd) => {
|
|
3654
3780
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
3655
3781
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
3656
3782
|
await runGraphqlQueryCommand({
|
|
@@ -3663,17 +3789,21 @@ function registerProjectCommands(program) {
|
|
|
3663
3789
|
page: opts.page,
|
|
3664
3790
|
per: opts.per,
|
|
3665
3791
|
team_ids: opts.teamIds,
|
|
3666
|
-
member_id: opts.memberId
|
|
3792
|
+
member_id: opts.memberId,
|
|
3793
|
+
status: parseProjectStatus(opts.status),
|
|
3794
|
+
priority: parseProjectPriority(opts.priority)
|
|
3667
3795
|
}),
|
|
3668
3796
|
variableTypes: {
|
|
3669
3797
|
organization_id: "ID!",
|
|
3670
3798
|
page: "Int",
|
|
3671
3799
|
per: "Int",
|
|
3672
3800
|
team_ids: "[ID!]",
|
|
3673
|
-
member_id: "ID"
|
|
3801
|
+
member_id: "ID",
|
|
3802
|
+
status: "ProjectStatus",
|
|
3803
|
+
priority: "ProjectPriority"
|
|
3674
3804
|
},
|
|
3675
3805
|
isList: true,
|
|
3676
|
-
selectionSet: projectsIndexMinimalSelectionSet,
|
|
3806
|
+
selectionSet: projectsIndexMinimalSelectionSet(opts.includeProjectTypes === true),
|
|
3677
3807
|
transformData: normalizeProjectsListForDisplay
|
|
3678
3808
|
});
|
|
3679
3809
|
});
|
|
@@ -3681,7 +3811,7 @@ function registerProjectCommands(program) {
|
|
|
3681
3811
|
command: "projects",
|
|
3682
3812
|
operationName: "ProjectsSearch",
|
|
3683
3813
|
field: "projects",
|
|
3684
|
-
selectionSet: projectsIndexMinimalSelectionSet,
|
|
3814
|
+
selectionSet: projectsIndexMinimalSelectionSet(),
|
|
3685
3815
|
transformData: normalizeProjectsListForDisplay
|
|
3686
3816
|
});
|
|
3687
3817
|
projects.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
@@ -3740,10 +3870,10 @@ function registerProjectCommands(program) {
|
|
|
3740
3870
|
}
|
|
3741
3871
|
|
|
3742
3872
|
// src/commands/rocks.ts
|
|
3743
|
-
var
|
|
3744
|
-
var idSchema4 =
|
|
3745
|
-
var rockCollectionIdSchema =
|
|
3746
|
-
var statusSchema =
|
|
3873
|
+
var import_zod6 = require("zod");
|
|
3874
|
+
var idSchema4 = import_zod6.z.string().min(1);
|
|
3875
|
+
var rockCollectionIdSchema = import_zod6.z.string().min(1);
|
|
3876
|
+
var statusSchema = import_zod6.z.enum(["on_track", "at_risk", "off_track"]);
|
|
3747
3877
|
var createHelp = buildDataJsonHelp("rock", "create") ?? 'JSON object for rock or {"rock": {...}}';
|
|
3748
3878
|
var updateHelp = buildDataJsonHelp("rock", "update") ?? 'JSON object for rock or {"rock": {...}}';
|
|
3749
3879
|
function registerRockCommands(program) {
|
|
@@ -3841,9 +3971,9 @@ function registerRockCommands(program) {
|
|
|
3841
3971
|
}
|
|
3842
3972
|
|
|
3843
3973
|
// src/commands/meetings.ts
|
|
3844
|
-
var
|
|
3845
|
-
var idSchema5 =
|
|
3846
|
-
var notesSchema =
|
|
3974
|
+
var import_zod7 = require("zod");
|
|
3975
|
+
var idSchema5 = import_zod7.z.string().min(1);
|
|
3976
|
+
var notesSchema = import_zod7.z.string().min(1);
|
|
3847
3977
|
var MEETING_TYPES = /* @__PURE__ */ new Set(["TeamMeeting", "OneOnOneMeeting"]);
|
|
3848
3978
|
var MEETING_STATUSES = /* @__PURE__ */ new Set(["upcoming", "active", "completed"]);
|
|
3849
3979
|
var MEETING_REPEATS = /* @__PURE__ */ new Set(["never", "weekly", "biweekly", "monthly", "quarterly"]);
|
|
@@ -4076,8 +4206,8 @@ function registerMeetingCommands(program) {
|
|
|
4076
4206
|
}
|
|
4077
4207
|
|
|
4078
4208
|
// src/commands/members.ts
|
|
4079
|
-
var
|
|
4080
|
-
var idSchema6 =
|
|
4209
|
+
var import_zod8 = require("zod");
|
|
4210
|
+
var idSchema6 = import_zod8.z.string().min(1);
|
|
4081
4211
|
var createHelp3 = buildDataJsonHelp("member", "create") ?? 'JSON object for member or {"member": {...}}';
|
|
4082
4212
|
var updateHelp3 = buildDataJsonHelp("member", "update") ?? 'JSON object for member or {"member": {...}}';
|
|
4083
4213
|
var MEMBER_META_PROFILE_SELECTION = "{ id type memberId summary profile attributes { id memberId summary profile } }";
|
|
@@ -4206,9 +4336,9 @@ function registerMemberCommands(program) {
|
|
|
4206
4336
|
}
|
|
4207
4337
|
|
|
4208
4338
|
// src/commands/skills.ts
|
|
4209
|
-
var
|
|
4210
|
-
var idSchema7 =
|
|
4211
|
-
var limitSchema =
|
|
4339
|
+
var import_zod9 = require("zod");
|
|
4340
|
+
var idSchema7 = import_zod9.z.string().min(1);
|
|
4341
|
+
var limitSchema = import_zod9.z.coerce.number().int().positive();
|
|
4212
4342
|
var SKILL_SELECTION = `{
|
|
4213
4343
|
id
|
|
4214
4344
|
type
|
|
@@ -4284,11 +4414,11 @@ function registerSkillCommands(program) {
|
|
|
4284
4414
|
}
|
|
4285
4415
|
|
|
4286
4416
|
// src/commands/issues.ts
|
|
4287
|
-
var
|
|
4288
|
-
var issueGroupIdSchema =
|
|
4289
|
-
var idSchema8 =
|
|
4290
|
-
var nameSchema =
|
|
4291
|
-
var issueTypeSchema =
|
|
4417
|
+
var import_zod10 = require("zod");
|
|
4418
|
+
var issueGroupIdSchema = import_zod10.z.string().min(1);
|
|
4419
|
+
var idSchema8 = import_zod10.z.string().min(1);
|
|
4420
|
+
var nameSchema = import_zod10.z.string().min(1);
|
|
4421
|
+
var issueTypeSchema = import_zod10.z.string().min(1).refine((value) => value === "short_term" || value === "long_term", {
|
|
4292
4422
|
message: "Invalid issue type. Use one of: short_term, long_term."
|
|
4293
4423
|
});
|
|
4294
4424
|
var updateHelp4 = buildDataJsonHelp("issue", "update") ?? 'JSON object for issue or {"issue": {...}}';
|
|
@@ -5335,8 +5465,8 @@ function registerSystemToolCommands(program) {
|
|
|
5335
5465
|
}
|
|
5336
5466
|
|
|
5337
5467
|
// src/commands/teams.ts
|
|
5338
|
-
var
|
|
5339
|
-
var idSchema9 =
|
|
5468
|
+
var import_zod11 = require("zod");
|
|
5469
|
+
var idSchema9 = import_zod11.z.string().min(1);
|
|
5340
5470
|
function registerTeamCommands(program) {
|
|
5341
5471
|
const teams = program.command("teams").description("Team operations");
|
|
5342
5472
|
teams.command("list").option("--page <page>").option("--per <per>").action(async (opts, cmd) => {
|
|
@@ -5402,8 +5532,8 @@ function registerTeamCommands(program) {
|
|
|
5402
5532
|
}
|
|
5403
5533
|
|
|
5404
5534
|
// src/commands/organizations.ts
|
|
5405
|
-
var
|
|
5406
|
-
var idSchema10 =
|
|
5535
|
+
var import_zod12 = require("zod");
|
|
5536
|
+
var idSchema10 = import_zod12.z.string().min(1);
|
|
5407
5537
|
function isRecord3(value) {
|
|
5408
5538
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
5409
5539
|
}
|
|
@@ -5615,8 +5745,8 @@ function registerOrganizationCommands(program) {
|
|
|
5615
5745
|
}
|
|
5616
5746
|
|
|
5617
5747
|
// src/commands/foundation.ts
|
|
5618
|
-
var
|
|
5619
|
-
var idSchema11 =
|
|
5748
|
+
var import_zod13 = require("zod");
|
|
5749
|
+
var idSchema11 = import_zod13.z.string().min(1);
|
|
5620
5750
|
var STRATEGIC_PLAN_ALLOWED_UPDATE_KEYS = /* @__PURE__ */ new Set([
|
|
5621
5751
|
"published_at",
|
|
5622
5752
|
"profile",
|
|
@@ -5817,9 +5947,9 @@ function registerFoundationCommands(program) {
|
|
|
5817
5947
|
}
|
|
5818
5948
|
|
|
5819
5949
|
// src/commands/childEntities.ts
|
|
5820
|
-
var
|
|
5821
|
-
var idSchema12 =
|
|
5822
|
-
var jsonObjectSchema =
|
|
5950
|
+
var import_zod14 = require("zod");
|
|
5951
|
+
var idSchema12 = import_zod14.z.string().min(1);
|
|
5952
|
+
var jsonObjectSchema = import_zod14.z.record(import_zod14.z.string(), import_zod14.z.unknown());
|
|
5823
5953
|
var NOTE_DETAIL_FIELDS = [
|
|
5824
5954
|
"notes",
|
|
5825
5955
|
"hasNotes",
|
|
@@ -5967,10 +6097,17 @@ function normalizeSubtaskCreateBody(body) {
|
|
|
5967
6097
|
}
|
|
5968
6098
|
function registerChildCommands(program, config) {
|
|
5969
6099
|
const command = program.command(config.command).description(config.description);
|
|
5970
|
-
command.command("list").requiredOption(`--${config.parentFlag} <${config.parentFlag}>`).option("--page <page>").option("--per <per>")
|
|
6100
|
+
const listCommand = command.command("list").requiredOption(`--${config.parentFlag} <${config.parentFlag}>`).option("--page <page>").option("--per <per>");
|
|
6101
|
+
if (config.priorityFilter) {
|
|
6102
|
+
listCommand.option("--priority <priority>", config.priorityFilter.help);
|
|
6103
|
+
}
|
|
6104
|
+
listCommand.action(async (opts, cmd) => {
|
|
5971
6105
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
5972
6106
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
5973
6107
|
const parentId = idSchema12.parse(opts[config.parentFlag.replace(/-([a-z])/g, (_, c) => c.toUpperCase())]);
|
|
6108
|
+
const priority = config.priorityFilter?.parse(opts.priority);
|
|
6109
|
+
const priorityVariables = priority === void 0 ? {} : { priority };
|
|
6110
|
+
const priorityVariableTypes = priority === void 0 || !config.priorityFilter ? {} : { priority: config.priorityFilter.variableType };
|
|
5974
6111
|
await runGraphqlQueryCommand({
|
|
5975
6112
|
command: `${config.command}.list`,
|
|
5976
6113
|
operationName: config.listOperationName,
|
|
@@ -5980,13 +6117,15 @@ function registerChildCommands(program, config) {
|
|
|
5980
6117
|
organization_id: organizationId,
|
|
5981
6118
|
[config.parentFlag.replace(/-/g, "_")]: parentId,
|
|
5982
6119
|
page: opts.page,
|
|
5983
|
-
per: opts.per
|
|
6120
|
+
per: opts.per,
|
|
6121
|
+
...priorityVariables
|
|
5984
6122
|
}),
|
|
5985
6123
|
variableTypes: {
|
|
5986
6124
|
organization_id: "ID!",
|
|
5987
6125
|
[config.parentFlag.replace(/-/g, "_")]: "ID!",
|
|
5988
6126
|
page: "Int",
|
|
5989
|
-
per: "Int"
|
|
6127
|
+
per: "Int",
|
|
6128
|
+
...priorityVariableTypes
|
|
5990
6129
|
},
|
|
5991
6130
|
isList: true,
|
|
5992
6131
|
selectionSet: config.listSelectionSet,
|
|
@@ -6106,6 +6245,11 @@ function registerChildEntityCommands(program) {
|
|
|
6106
6245
|
destroyOperationName: "SubtasksDestroy",
|
|
6107
6246
|
listSelectionSet: buildChildListSelectionSet("taskId"),
|
|
6108
6247
|
listParentTypedField: "taskId",
|
|
6248
|
+
priorityFilter: {
|
|
6249
|
+
variableType: "TaskPriority",
|
|
6250
|
+
help: taskPriorityHelp,
|
|
6251
|
+
parse: parseTaskPriority
|
|
6252
|
+
},
|
|
6109
6253
|
searchRequiredOptions: requiredParentSearchOption("task-id", "task"),
|
|
6110
6254
|
showField: "subtask",
|
|
6111
6255
|
showOperationName: "SubtasksShow",
|
|
@@ -6221,9 +6365,9 @@ function registerChildEntityCommands(program) {
|
|
|
6221
6365
|
}
|
|
6222
6366
|
|
|
6223
6367
|
// src/commands/content.ts
|
|
6224
|
-
var
|
|
6225
|
-
var idSchema13 =
|
|
6226
|
-
var nonEmptyString =
|
|
6368
|
+
var import_zod15 = require("zod");
|
|
6369
|
+
var idSchema13 = import_zod15.z.string().min(1);
|
|
6370
|
+
var nonEmptyString = import_zod15.z.string().min(1);
|
|
6227
6371
|
var contentAttributesSelection = "attributes { id type name slug content firstChildSlug rootParentSlug status contentType lastEdited organizationId memberId focusMemberId focusTeamId teamId creatorId createdAt updatedAt childCount assignmentType contentableId contentableSlug contentableType votesTotal labelIds rootContentId parentContentId }";
|
|
6228
6372
|
function assertUpdateFields(params) {
|
|
6229
6373
|
if (!params.name && !params.content && !params.status) {
|
|
@@ -6411,9 +6555,9 @@ function registerContentCommands(program) {
|
|
|
6411
6555
|
}
|
|
6412
6556
|
|
|
6413
6557
|
// src/commands/markdownTree.ts
|
|
6414
|
-
var
|
|
6415
|
-
var nonEmptyString2 =
|
|
6416
|
-
var nonNegativeInt =
|
|
6558
|
+
var import_zod16 = require("zod");
|
|
6559
|
+
var nonEmptyString2 = import_zod16.z.string().min(1);
|
|
6560
|
+
var nonNegativeInt = import_zod16.z.coerce.number().int().min(0);
|
|
6417
6561
|
function addScopeOptions(command) {
|
|
6418
6562
|
return command.requiredOption("--tool-key <toolKey>").requiredOption("--node-key <nodeKey>").option("--parent-id <parentId>").option("--record-id <recordId>").option("--member-id <memberId>").option("--team-id <teamId>").option("--content-type <contentType>").option("--tree-view");
|
|
6419
6563
|
}
|
|
@@ -6578,7 +6722,7 @@ function registerMarkdownTreeCommands(program) {
|
|
|
6578
6722
|
}
|
|
6579
6723
|
|
|
6580
6724
|
// src/commands/navigation.ts
|
|
6581
|
-
var
|
|
6725
|
+
var import_zod17 = require("zod");
|
|
6582
6726
|
|
|
6583
6727
|
// src/internalOptions.ts
|
|
6584
6728
|
var INTERNAL_OPTIONS_KEY = "__waveInternalOptions";
|
|
@@ -6608,8 +6752,8 @@ function getInternalCliOptions(command) {
|
|
|
6608
6752
|
}
|
|
6609
6753
|
|
|
6610
6754
|
// src/commands/navigation.ts
|
|
6611
|
-
var nonEmpty =
|
|
6612
|
-
var nonNegativeInt2 =
|
|
6755
|
+
var nonEmpty = import_zod17.z.string().min(1);
|
|
6756
|
+
var nonNegativeInt2 = import_zod17.z.coerce.number().int().min(0);
|
|
6613
6757
|
var MIGRATED_BRANCHES = ["directory", "projects", "knowledge"];
|
|
6614
6758
|
function normalizeText(input) {
|
|
6615
6759
|
if (typeof input !== "string") return "";
|
|
@@ -7392,11 +7536,11 @@ function registerMutationCapabilityCommands(program) {
|
|
|
7392
7536
|
// src/commands/osmd.ts
|
|
7393
7537
|
var import_promises3 = require("fs/promises");
|
|
7394
7538
|
var import_node_path3 = require("path");
|
|
7395
|
-
var
|
|
7396
|
-
var sourceSchema =
|
|
7397
|
-
var accessSchema =
|
|
7398
|
-
var ownerSchema =
|
|
7399
|
-
var suggestedActionSchema =
|
|
7539
|
+
var import_zod18 = require("zod");
|
|
7540
|
+
var sourceSchema = import_zod18.z.enum(["canonical_osmd", "agent_overlay", "agent_wiki"]);
|
|
7541
|
+
var accessSchema = import_zod18.z.enum(["read_only", "read_write", "append_only"]).catch("read_write");
|
|
7542
|
+
var ownerSchema = import_zod18.z.enum(["system", "atlas"]);
|
|
7543
|
+
var suggestedActionSchema = import_zod18.z.enum([
|
|
7400
7544
|
"read",
|
|
7401
7545
|
"create",
|
|
7402
7546
|
"init",
|
|
@@ -7405,7 +7549,7 @@ var suggestedActionSchema = import_zod17.z.enum([
|
|
|
7405
7549
|
"forbidden",
|
|
7406
7550
|
"invalid_parent"
|
|
7407
7551
|
]).catch("update");
|
|
7408
|
-
var agentMarkdownErrorCodeSchema =
|
|
7552
|
+
var agentMarkdownErrorCodeSchema = import_zod18.z.enum([
|
|
7409
7553
|
"canonical_osmd_read_only",
|
|
7410
7554
|
"agent_parent_not_found",
|
|
7411
7555
|
"agent_file_not_found",
|
|
@@ -7416,9 +7560,9 @@ var agentMarkdownErrorCodeSchema = import_zod17.z.enum([
|
|
|
7416
7560
|
"invalid_agent_wiki_path"
|
|
7417
7561
|
]);
|
|
7418
7562
|
var agentMarkdownErrorCodeFieldSchema = agentMarkdownErrorCodeSchema.nullable().catch(null);
|
|
7419
|
-
var nonEmptyString3 =
|
|
7420
|
-
var nonNegativeInt3 =
|
|
7421
|
-
var positiveInt =
|
|
7563
|
+
var nonEmptyString3 = import_zod18.z.string().min(1);
|
|
7564
|
+
var nonNegativeInt3 = import_zod18.z.coerce.number().int().min(0);
|
|
7565
|
+
var positiveInt = import_zod18.z.coerce.number().int().min(1);
|
|
7422
7566
|
var supportedAgentOverlaySystemFiles = ["notes.md", "summary.md"];
|
|
7423
7567
|
var supportedWikiIndexFile = "index.md";
|
|
7424
7568
|
var supportedWikiLogFile = "log.md";
|
|
@@ -7434,20 +7578,20 @@ var supportedWikiControlledPatterns = supportedWikiControlledFolders.map(
|
|
|
7434
7578
|
);
|
|
7435
7579
|
var controlledWikiSlugPattern = /^[a-z0-9][a-z0-9-]*$/;
|
|
7436
7580
|
var agentMarkdownSlugPattern = /^[a-z0-9][a-z0-9-]*$/;
|
|
7437
|
-
var osmdSearchScopeSchema =
|
|
7581
|
+
var osmdSearchScopeSchema = import_zod18.z.enum([
|
|
7438
7582
|
"os-only",
|
|
7439
7583
|
"agent-overlay-only",
|
|
7440
7584
|
"agent-wiki-only",
|
|
7441
7585
|
"combined"
|
|
7442
7586
|
]);
|
|
7443
|
-
var osmdLintScopeSchema =
|
|
7587
|
+
var osmdLintScopeSchema = import_zod18.z.enum([
|
|
7444
7588
|
"combined",
|
|
7445
7589
|
"agent-overlay-only",
|
|
7446
7590
|
"agent-wiki-only"
|
|
7447
7591
|
]);
|
|
7448
|
-
var osmdMemoryQualityScopeSchema =
|
|
7449
|
-
var osmdIngestKindSchema =
|
|
7450
|
-
var osmdRawSourceTypeSchema =
|
|
7592
|
+
var osmdMemoryQualityScopeSchema = import_zod18.z.enum(["agent-overlay-only"]);
|
|
7593
|
+
var osmdIngestKindSchema = import_zod18.z.enum(["text", "file", "url", "transcript"]);
|
|
7594
|
+
var osmdRawSourceTypeSchema = import_zod18.z.enum([
|
|
7451
7595
|
"pasted_text",
|
|
7452
7596
|
"uploaded_markdown",
|
|
7453
7597
|
"uploaded_text",
|
|
@@ -7456,31 +7600,30 @@ var osmdRawSourceTypeSchema = import_zod17.z.enum([
|
|
|
7456
7600
|
"meeting_transcript",
|
|
7457
7601
|
"url"
|
|
7458
7602
|
]);
|
|
7459
|
-
var
|
|
7460
|
-
var agentMarkdownFileSchema = import_zod17.z.preprocess(
|
|
7603
|
+
var agentMarkdownFileSchema = import_zod18.z.preprocess(
|
|
7461
7604
|
normalizeAgentMarkdownJsonKeys,
|
|
7462
|
-
|
|
7463
|
-
path:
|
|
7605
|
+
import_zod18.z.object({
|
|
7606
|
+
path: import_zod18.z.string(),
|
|
7464
7607
|
source: sourceSchema,
|
|
7465
7608
|
access: accessSchema,
|
|
7466
7609
|
owner: ownerSchema,
|
|
7467
|
-
exists:
|
|
7468
|
-
canCreate:
|
|
7469
|
-
canUpdate:
|
|
7470
|
-
canAppend:
|
|
7471
|
-
wikiRole:
|
|
7472
|
-
formatVersion:
|
|
7473
|
-
createdAt:
|
|
7474
|
-
updatedAt:
|
|
7475
|
-
ingestedAt:
|
|
7476
|
-
lastSeenAt:
|
|
7477
|
-
canonicalParentUpdatedAt:
|
|
7478
|
-
parentRef:
|
|
7479
|
-
agentChildrenAllowed:
|
|
7610
|
+
exists: import_zod18.z.boolean(),
|
|
7611
|
+
canCreate: import_zod18.z.boolean(),
|
|
7612
|
+
canUpdate: import_zod18.z.boolean(),
|
|
7613
|
+
canAppend: import_zod18.z.boolean(),
|
|
7614
|
+
wikiRole: import_zod18.z.string().nullable().optional(),
|
|
7615
|
+
formatVersion: import_zod18.z.string().nullable().optional(),
|
|
7616
|
+
createdAt: import_zod18.z.string().nullable().optional(),
|
|
7617
|
+
updatedAt: import_zod18.z.string().nullable().optional(),
|
|
7618
|
+
ingestedAt: import_zod18.z.string().nullable().optional(),
|
|
7619
|
+
lastSeenAt: import_zod18.z.string().nullable().optional(),
|
|
7620
|
+
canonicalParentUpdatedAt: import_zod18.z.string().nullable().optional(),
|
|
7621
|
+
parentRef: import_zod18.z.string().nullable().optional(),
|
|
7622
|
+
agentChildrenAllowed: import_zod18.z.boolean(),
|
|
7480
7623
|
suggestedAction: suggestedActionSchema,
|
|
7481
7624
|
errorCode: agentMarkdownErrorCodeFieldSchema.optional(),
|
|
7482
|
-
content:
|
|
7483
|
-
url:
|
|
7625
|
+
content: import_zod18.z.string().nullable().optional(),
|
|
7626
|
+
url: import_zod18.z.string().nullable().optional()
|
|
7484
7627
|
}).transform((value) => ({
|
|
7485
7628
|
...value,
|
|
7486
7629
|
wikiRole: value.wikiRole ?? null,
|
|
@@ -7496,31 +7639,31 @@ var agentMarkdownFileSchema = import_zod17.z.preprocess(
|
|
|
7496
7639
|
url: value.url ?? null
|
|
7497
7640
|
}))
|
|
7498
7641
|
);
|
|
7499
|
-
var agentMarkdownFilesSchema =
|
|
7500
|
-
var agentMarkdownMutationDataSchema =
|
|
7642
|
+
var agentMarkdownFilesSchema = import_zod18.z.array(agentMarkdownFileSchema);
|
|
7643
|
+
var agentMarkdownMutationDataSchema = import_zod18.z.union([
|
|
7501
7644
|
agentMarkdownFileSchema,
|
|
7502
|
-
|
|
7645
|
+
import_zod18.z.object({ files: agentMarkdownFilesSchema })
|
|
7503
7646
|
]);
|
|
7504
|
-
var osmdSearchCandidateSchema =
|
|
7647
|
+
var osmdSearchCandidateSchema = import_zod18.z.preprocess(
|
|
7505
7648
|
normalizeAgentMarkdownJsonKeys,
|
|
7506
|
-
|
|
7507
|
-
path:
|
|
7649
|
+
import_zod18.z.object({
|
|
7650
|
+
path: import_zod18.z.string(),
|
|
7508
7651
|
source: sourceSchema,
|
|
7509
7652
|
access: accessSchema,
|
|
7510
7653
|
owner: ownerSchema,
|
|
7511
|
-
wikiRole:
|
|
7512
|
-
formatVersion:
|
|
7513
|
-
parentRef:
|
|
7514
|
-
exists:
|
|
7515
|
-
agentChildrenAllowed:
|
|
7516
|
-
title:
|
|
7517
|
-
label:
|
|
7518
|
-
snippet:
|
|
7519
|
-
rank:
|
|
7520
|
-
matchReason:
|
|
7521
|
-
toolKey:
|
|
7522
|
-
nodeKey:
|
|
7523
|
-
nodeKind:
|
|
7654
|
+
wikiRole: import_zod18.z.string().nullable().optional(),
|
|
7655
|
+
formatVersion: import_zod18.z.string().nullable().optional(),
|
|
7656
|
+
parentRef: import_zod18.z.string().nullable().optional(),
|
|
7657
|
+
exists: import_zod18.z.boolean(),
|
|
7658
|
+
agentChildrenAllowed: import_zod18.z.boolean(),
|
|
7659
|
+
title: import_zod18.z.string(),
|
|
7660
|
+
label: import_zod18.z.string(),
|
|
7661
|
+
snippet: import_zod18.z.string().nullable().optional(),
|
|
7662
|
+
rank: import_zod18.z.number().int(),
|
|
7663
|
+
matchReason: import_zod18.z.string().nullable().optional(),
|
|
7664
|
+
toolKey: import_zod18.z.string().nullable().optional(),
|
|
7665
|
+
nodeKey: import_zod18.z.string().nullable().optional(),
|
|
7666
|
+
nodeKind: import_zod18.z.string().nullable().optional()
|
|
7524
7667
|
}).transform((value) => ({
|
|
7525
7668
|
...value,
|
|
7526
7669
|
wikiRole: value.wikiRole ?? null,
|
|
@@ -7533,26 +7676,26 @@ var osmdSearchCandidateSchema = import_zod17.z.preprocess(
|
|
|
7533
7676
|
nodeKind: value.nodeKind ?? null
|
|
7534
7677
|
}))
|
|
7535
7678
|
);
|
|
7536
|
-
var osmdSearchResultSchema =
|
|
7679
|
+
var osmdSearchResultSchema = import_zod18.z.preprocess(
|
|
7537
7680
|
normalizeAgentMarkdownJsonKeys,
|
|
7538
|
-
|
|
7539
|
-
query:
|
|
7540
|
-
scope:
|
|
7541
|
-
count:
|
|
7542
|
-
candidates:
|
|
7681
|
+
import_zod18.z.object({
|
|
7682
|
+
query: import_zod18.z.string(),
|
|
7683
|
+
scope: import_zod18.z.string(),
|
|
7684
|
+
count: import_zod18.z.number().int().min(0),
|
|
7685
|
+
candidates: import_zod18.z.array(osmdSearchCandidateSchema)
|
|
7543
7686
|
})
|
|
7544
7687
|
);
|
|
7545
|
-
var osmdWikiLintIssueSchema =
|
|
7688
|
+
var osmdWikiLintIssueSchema = import_zod18.z.preprocess(
|
|
7546
7689
|
normalizeAgentMarkdownJsonKeys,
|
|
7547
|
-
|
|
7548
|
-
code:
|
|
7549
|
-
severity:
|
|
7550
|
-
path:
|
|
7551
|
-
source:
|
|
7552
|
-
parentRef:
|
|
7553
|
-
message:
|
|
7554
|
-
suggestedAction:
|
|
7555
|
-
canAutoFix:
|
|
7690
|
+
import_zod18.z.object({
|
|
7691
|
+
code: import_zod18.z.string(),
|
|
7692
|
+
severity: import_zod18.z.string(),
|
|
7693
|
+
path: import_zod18.z.string(),
|
|
7694
|
+
source: import_zod18.z.string().nullable().optional(),
|
|
7695
|
+
parentRef: import_zod18.z.string().nullable().optional(),
|
|
7696
|
+
message: import_zod18.z.string(),
|
|
7697
|
+
suggestedAction: import_zod18.z.string().nullable().optional(),
|
|
7698
|
+
canAutoFix: import_zod18.z.boolean()
|
|
7556
7699
|
}).transform((value) => ({
|
|
7557
7700
|
...value,
|
|
7558
7701
|
source: value.source ?? null,
|
|
@@ -7560,37 +7703,37 @@ var osmdWikiLintIssueSchema = import_zod17.z.preprocess(
|
|
|
7560
7703
|
suggestedAction: value.suggestedAction ?? null
|
|
7561
7704
|
}))
|
|
7562
7705
|
);
|
|
7563
|
-
var osmdWikiLintResultSchema =
|
|
7706
|
+
var osmdWikiLintResultSchema = import_zod18.z.preprocess(
|
|
7564
7707
|
normalizeAgentMarkdownJsonKeys,
|
|
7565
|
-
|
|
7566
|
-
status:
|
|
7567
|
-
summary:
|
|
7568
|
-
totalIssues:
|
|
7569
|
-
errors:
|
|
7570
|
-
warnings:
|
|
7571
|
-
suggestions:
|
|
7708
|
+
import_zod18.z.object({
|
|
7709
|
+
status: import_zod18.z.string(),
|
|
7710
|
+
summary: import_zod18.z.object({
|
|
7711
|
+
totalIssues: import_zod18.z.number().int().min(0),
|
|
7712
|
+
errors: import_zod18.z.number().int().min(0),
|
|
7713
|
+
warnings: import_zod18.z.number().int().min(0),
|
|
7714
|
+
suggestions: import_zod18.z.number().int().min(0)
|
|
7572
7715
|
}),
|
|
7573
|
-
issues:
|
|
7716
|
+
issues: import_zod18.z.array(osmdWikiLintIssueSchema)
|
|
7574
7717
|
})
|
|
7575
7718
|
);
|
|
7576
|
-
var nullableCountSchema =
|
|
7719
|
+
var nullableCountSchema = import_zod18.z.preprocess(
|
|
7577
7720
|
(value) => value === void 0 || value === null || value === "" ? null : value,
|
|
7578
|
-
|
|
7721
|
+
import_zod18.z.coerce.number().int().min(0).nullable()
|
|
7579
7722
|
).catch(null);
|
|
7580
|
-
var osmdMemoryQualityIssueSchema =
|
|
7723
|
+
var osmdMemoryQualityIssueSchema = import_zod18.z.preprocess(
|
|
7581
7724
|
normalizeAgentMarkdownJsonKeys,
|
|
7582
|
-
|
|
7583
|
-
code:
|
|
7584
|
-
issueCode:
|
|
7585
|
-
path:
|
|
7586
|
-
parentRef:
|
|
7587
|
-
dimension:
|
|
7588
|
-
evidence:
|
|
7589
|
-
evidenceSnippet:
|
|
7590
|
-
message:
|
|
7591
|
-
severity:
|
|
7592
|
-
suggestedAction:
|
|
7593
|
-
canAutoFix:
|
|
7725
|
+
import_zod18.z.object({
|
|
7726
|
+
code: import_zod18.z.string().nullable().optional(),
|
|
7727
|
+
issueCode: import_zod18.z.string().nullable().optional(),
|
|
7728
|
+
path: import_zod18.z.string().nullable().optional(),
|
|
7729
|
+
parentRef: import_zod18.z.string().nullable().optional(),
|
|
7730
|
+
dimension: import_zod18.z.string().nullable().optional(),
|
|
7731
|
+
evidence: import_zod18.z.string().nullable().optional(),
|
|
7732
|
+
evidenceSnippet: import_zod18.z.string().nullable().optional(),
|
|
7733
|
+
message: import_zod18.z.string().nullable().optional(),
|
|
7734
|
+
severity: import_zod18.z.string().nullable().optional(),
|
|
7735
|
+
suggestedAction: import_zod18.z.string().nullable().optional(),
|
|
7736
|
+
canAutoFix: import_zod18.z.boolean().nullable().optional()
|
|
7594
7737
|
}).passthrough().transform((value) => ({
|
|
7595
7738
|
...value,
|
|
7596
7739
|
code: value.code ?? value.issueCode ?? "unknown_issue",
|
|
@@ -7605,16 +7748,16 @@ var osmdMemoryQualityIssueSchema = import_zod17.z.preprocess(
|
|
|
7605
7748
|
canAutoFix: value.canAutoFix === true ? true : false
|
|
7606
7749
|
}))
|
|
7607
7750
|
);
|
|
7608
|
-
var osmdMemoryQualityOverlaySchema =
|
|
7751
|
+
var osmdMemoryQualityOverlaySchema = import_zod18.z.preprocess(
|
|
7609
7752
|
normalizeAgentMarkdownJsonKeys,
|
|
7610
|
-
|
|
7611
|
-
path:
|
|
7612
|
-
parentRef:
|
|
7613
|
-
status:
|
|
7614
|
-
score:
|
|
7615
|
-
overallScore:
|
|
7616
|
-
dimensions:
|
|
7617
|
-
issues:
|
|
7753
|
+
import_zod18.z.object({
|
|
7754
|
+
path: import_zod18.z.string().nullable().optional(),
|
|
7755
|
+
parentRef: import_zod18.z.string().nullable().optional(),
|
|
7756
|
+
status: import_zod18.z.string().nullable().optional(),
|
|
7757
|
+
score: import_zod18.z.union([import_zod18.z.number(), import_zod18.z.string()]).nullable().optional(),
|
|
7758
|
+
overallScore: import_zod18.z.union([import_zod18.z.number(), import_zod18.z.string()]).nullable().optional(),
|
|
7759
|
+
dimensions: import_zod18.z.unknown().nullable().optional(),
|
|
7760
|
+
issues: import_zod18.z.array(osmdMemoryQualityIssueSchema).optional()
|
|
7618
7761
|
}).passthrough().transform((value) => ({
|
|
7619
7762
|
...value,
|
|
7620
7763
|
path: value.path ?? null,
|
|
@@ -7626,9 +7769,9 @@ var osmdMemoryQualityOverlaySchema = import_zod17.z.preprocess(
|
|
|
7626
7769
|
issues: value.issues ?? []
|
|
7627
7770
|
}))
|
|
7628
7771
|
);
|
|
7629
|
-
var osmdMemoryQualitySummarySchema =
|
|
7772
|
+
var osmdMemoryQualitySummarySchema = import_zod18.z.preprocess(
|
|
7630
7773
|
normalizeAgentMarkdownJsonKeys,
|
|
7631
|
-
|
|
7774
|
+
import_zod18.z.object({
|
|
7632
7775
|
evaluatedCount: nullableCountSchema.optional(),
|
|
7633
7776
|
passCount: nullableCountSchema.optional(),
|
|
7634
7777
|
warnCount: nullableCountSchema.optional(),
|
|
@@ -7646,19 +7789,19 @@ var osmdMemoryQualitySummarySchema = import_zod17.z.preprocess(
|
|
|
7646
7789
|
failCount: value.failCount ?? value.failures ?? null
|
|
7647
7790
|
}))
|
|
7648
7791
|
);
|
|
7649
|
-
var osmdMemoryQualityResultSchema =
|
|
7792
|
+
var osmdMemoryQualityResultSchema = import_zod18.z.preprocess(
|
|
7650
7793
|
normalizeAgentMarkdownJsonKeys,
|
|
7651
|
-
|
|
7652
|
-
status:
|
|
7653
|
-
scope:
|
|
7794
|
+
import_zod18.z.object({
|
|
7795
|
+
status: import_zod18.z.string(),
|
|
7796
|
+
scope: import_zod18.z.string().nullable().optional(),
|
|
7654
7797
|
evaluatedCount: nullableCountSchema.optional(),
|
|
7655
7798
|
passCount: nullableCountSchema.optional(),
|
|
7656
7799
|
warnCount: nullableCountSchema.optional(),
|
|
7657
7800
|
failCount: nullableCountSchema.optional(),
|
|
7658
7801
|
summary: osmdMemoryQualitySummarySchema.optional(),
|
|
7659
|
-
weakestOverlays:
|
|
7660
|
-
issues:
|
|
7661
|
-
scores:
|
|
7802
|
+
weakestOverlays: import_zod18.z.array(osmdMemoryQualityOverlaySchema).optional(),
|
|
7803
|
+
issues: import_zod18.z.array(osmdMemoryQualityIssueSchema).optional(),
|
|
7804
|
+
scores: import_zod18.z.array(osmdMemoryQualityOverlaySchema).optional()
|
|
7662
7805
|
}).passthrough().transform((value) => {
|
|
7663
7806
|
const summary = isRecord5(value.summary) ? value.summary : null;
|
|
7664
7807
|
return {
|
|
@@ -7682,24 +7825,24 @@ function normalizeOsmdIngestFileRecordInput(value) {
|
|
|
7682
7825
|
}
|
|
7683
7826
|
return normalized;
|
|
7684
7827
|
}
|
|
7685
|
-
var osmdIngestFileRecordSchema =
|
|
7828
|
+
var osmdIngestFileRecordSchema = import_zod18.z.preprocess(
|
|
7686
7829
|
normalizeOsmdIngestFileRecordInput,
|
|
7687
|
-
|
|
7688
|
-
path:
|
|
7689
|
-
source:
|
|
7690
|
-
access:
|
|
7691
|
-
owner:
|
|
7692
|
-
parentRef:
|
|
7693
|
-
exists:
|
|
7694
|
-
canCreate:
|
|
7695
|
-
canUpdate:
|
|
7696
|
-
canAppend:
|
|
7697
|
-
wikiRole:
|
|
7698
|
-
formatVersion:
|
|
7699
|
-
createdAt:
|
|
7700
|
-
updatedAt:
|
|
7701
|
-
suggestedAction:
|
|
7702
|
-
errorCode:
|
|
7830
|
+
import_zod18.z.object({
|
|
7831
|
+
path: import_zod18.z.string(),
|
|
7832
|
+
source: import_zod18.z.string().nullable().optional(),
|
|
7833
|
+
access: import_zod18.z.string().nullable().optional(),
|
|
7834
|
+
owner: import_zod18.z.string().nullable().optional(),
|
|
7835
|
+
parentRef: import_zod18.z.string().nullable().optional(),
|
|
7836
|
+
exists: import_zod18.z.boolean().nullable().optional(),
|
|
7837
|
+
canCreate: import_zod18.z.boolean().nullable().optional(),
|
|
7838
|
+
canUpdate: import_zod18.z.boolean().nullable().optional(),
|
|
7839
|
+
canAppend: import_zod18.z.boolean().nullable().optional(),
|
|
7840
|
+
wikiRole: import_zod18.z.string().nullable().optional(),
|
|
7841
|
+
formatVersion: import_zod18.z.string().nullable().optional(),
|
|
7842
|
+
createdAt: import_zod18.z.string().nullable().optional(),
|
|
7843
|
+
updatedAt: import_zod18.z.string().nullable().optional(),
|
|
7844
|
+
suggestedAction: import_zod18.z.string().nullable().optional(),
|
|
7845
|
+
errorCode: import_zod18.z.string().nullable().optional()
|
|
7703
7846
|
}).passthrough().transform((value) => ({
|
|
7704
7847
|
...value,
|
|
7705
7848
|
source: value.source ?? null,
|
|
@@ -7718,17 +7861,17 @@ var osmdIngestFileRecordSchema = import_zod17.z.preprocess(
|
|
|
7718
7861
|
errorCode: value.errorCode ?? null
|
|
7719
7862
|
}))
|
|
7720
7863
|
);
|
|
7721
|
-
var osmdIngestResultSchema =
|
|
7864
|
+
var osmdIngestResultSchema = import_zod18.z.preprocess(
|
|
7722
7865
|
normalizeAgentMarkdownJsonKeys,
|
|
7723
|
-
|
|
7724
|
-
rawSourceId:
|
|
7725
|
-
sourceSummaryPath:
|
|
7866
|
+
import_zod18.z.object({
|
|
7867
|
+
rawSourceId: import_zod18.z.union([import_zod18.z.string(), import_zod18.z.number()]).nullable().optional(),
|
|
7868
|
+
sourceSummaryPath: import_zod18.z.string().nullable().optional(),
|
|
7726
7869
|
sourceSummaryFile: osmdIngestFileRecordSchema.nullable().optional(),
|
|
7727
|
-
slug:
|
|
7728
|
-
runLint:
|
|
7729
|
-
createdFiles:
|
|
7730
|
-
updatedFiles:
|
|
7731
|
-
skippedUpdates:
|
|
7870
|
+
slug: import_zod18.z.string().nullable().optional(),
|
|
7871
|
+
runLint: import_zod18.z.boolean().nullable().optional(),
|
|
7872
|
+
createdFiles: import_zod18.z.array(osmdIngestFileRecordSchema).optional(),
|
|
7873
|
+
updatedFiles: import_zod18.z.array(osmdIngestFileRecordSchema).optional(),
|
|
7874
|
+
skippedUpdates: import_zod18.z.array(import_zod18.z.unknown()).optional(),
|
|
7732
7875
|
lintResult: osmdWikiLintResultSchema.nullable().optional()
|
|
7733
7876
|
}).passthrough().transform((value) => ({
|
|
7734
7877
|
...value,
|
|
@@ -7743,127 +7886,37 @@ var osmdIngestResultSchema = import_zod17.z.preprocess(
|
|
|
7743
7886
|
lintResult: value.lintResult ?? null
|
|
7744
7887
|
}))
|
|
7745
7888
|
);
|
|
7746
|
-
var
|
|
7747
|
-
|
|
7748
|
-
|
|
7749
|
-
|
|
7750
|
-
|
|
7751
|
-
|
|
7752
|
-
...value,
|
|
7753
|
-
id: value.id === void 0 || value.id === null ? null : String(value.id),
|
|
7754
|
-
status: value.status ?? null
|
|
7755
|
-
}))
|
|
7756
|
-
);
|
|
7757
|
-
var osmdPhantomResultSchema = import_zod17.z.preprocess(
|
|
7758
|
-
normalizeOsmdPhantomResultKeys,
|
|
7759
|
-
import_zod17.z.object({
|
|
7760
|
-
runId: import_zod17.z.union([import_zod17.z.string(), import_zod17.z.number()]).nullable().optional(),
|
|
7761
|
-
organizationId: import_zod17.z.union([import_zod17.z.string(), import_zod17.z.number()]).nullable().optional(),
|
|
7762
|
-
triggerType: import_zod17.z.string().nullable().optional(),
|
|
7763
|
-
scope: import_zod17.z.string().nullable().optional(),
|
|
7764
|
-
subtree: import_zod17.z.string().nullable().optional(),
|
|
7765
|
-
status: import_zod17.z.string().nullable().optional(),
|
|
7766
|
-
createdAt: import_zod17.z.string().nullable().optional(),
|
|
7767
|
-
updatedAt: import_zod17.z.string().nullable().optional(),
|
|
7768
|
-
startedAt: import_zod17.z.string().nullable().optional(),
|
|
7769
|
-
completedAt: import_zod17.z.string().nullable().optional(),
|
|
7770
|
-
countSemantics: import_zod17.z.unknown().nullable().optional(),
|
|
7771
|
-
scannedFileCount: nullableCountSchema,
|
|
7772
|
-
changedFileCount: nullableCountSchema,
|
|
7773
|
-
unchangedFileCount: nullableCountSchema,
|
|
7774
|
-
updatedFileCount: nullableCountSchema,
|
|
7775
|
-
skippedFileCount: nullableCountSchema,
|
|
7776
|
-
lintStatus: import_zod17.z.string().nullable().optional(),
|
|
7777
|
-
errorCount: nullableCountSchema,
|
|
7778
|
-
warningCount: nullableCountSchema,
|
|
7779
|
-
reportPath: import_zod17.z.string().nullable().optional(),
|
|
7780
|
-
plannedReads: import_zod17.z.array(osmdIngestFileRecordSchema).optional(),
|
|
7781
|
-
plannedReadFiles: import_zod17.z.array(osmdIngestFileRecordSchema).optional(),
|
|
7782
|
-
plannedWrites: import_zod17.z.array(osmdIngestFileRecordSchema).optional(),
|
|
7783
|
-
plannedWriteFiles: import_zod17.z.array(osmdIngestFileRecordSchema).optional(),
|
|
7784
|
-
changedFiles: import_zod17.z.array(osmdIngestFileRecordSchema).optional(),
|
|
7785
|
-
unchangedFiles: import_zod17.z.array(osmdIngestFileRecordSchema).optional(),
|
|
7786
|
-
updatedFiles: import_zod17.z.array(osmdIngestFileRecordSchema).optional(),
|
|
7787
|
-
skippedFiles: import_zod17.z.array(osmdIngestFileRecordSchema).optional(),
|
|
7788
|
-
lintPlan: import_zod17.z.unknown().nullable().optional(),
|
|
7789
|
-
lintSummary: import_zod17.z.unknown().nullable().optional(),
|
|
7790
|
-
lintResult: osmdWikiLintResultSchema.nullable().optional(),
|
|
7791
|
-
notification: osmdPhantomNotificationSchema.nullable().optional(),
|
|
7792
|
-
notificationId: import_zod17.z.union([import_zod17.z.string(), import_zod17.z.number()]).nullable().optional(),
|
|
7793
|
-
notificationStatus: import_zod17.z.string().nullable().optional()
|
|
7794
|
-
}).passthrough().transform((value) => {
|
|
7795
|
-
const lintResultSummary = isRecord5(value.lintResult?.summary) ? value.lintResult.summary : null;
|
|
7796
|
-
const lintSummary = isRecord5(value.lintSummary) ? value.lintSummary : null;
|
|
7797
|
-
const notification = value.notification ?? (value.notificationId !== void 0 || value.notificationStatus !== void 0 ? {
|
|
7798
|
-
id: value.notificationId === void 0 || value.notificationId === null ? null : String(value.notificationId),
|
|
7799
|
-
status: value.notificationStatus ?? null
|
|
7800
|
-
} : null);
|
|
7801
|
-
return {
|
|
7802
|
-
...value,
|
|
7803
|
-
runId: value.runId === void 0 || value.runId === null ? null : String(value.runId),
|
|
7804
|
-
organizationId: value.organizationId === void 0 || value.organizationId === null ? null : String(value.organizationId),
|
|
7805
|
-
triggerType: value.triggerType ?? null,
|
|
7806
|
-
scope: value.scope ?? null,
|
|
7807
|
-
subtree: value.subtree ?? null,
|
|
7808
|
-
status: value.status ?? null,
|
|
7809
|
-
createdAt: value.createdAt ?? null,
|
|
7810
|
-
updatedAt: value.updatedAt ?? null,
|
|
7811
|
-
startedAt: value.startedAt ?? null,
|
|
7812
|
-
completedAt: value.completedAt ?? null,
|
|
7813
|
-
countSemantics: value.countSemantics ?? null,
|
|
7814
|
-
scannedFileCount: value.scannedFileCount,
|
|
7815
|
-
changedFileCount: value.changedFileCount,
|
|
7816
|
-
unchangedFileCount: value.unchangedFileCount,
|
|
7817
|
-
updatedFileCount: value.updatedFileCount,
|
|
7818
|
-
skippedFileCount: value.skippedFileCount,
|
|
7819
|
-
lintStatus: value.lintStatus ?? (typeof value.lintResult?.status === "string" ? value.lintResult.status : null) ?? (typeof lintSummary?.status === "string" ? lintSummary.status : null),
|
|
7820
|
-
errorCount: value.errorCount ?? countFromRecord(lintResultSummary, "errors") ?? countFromRecord(lintSummary, "errors"),
|
|
7821
|
-
warningCount: value.warningCount ?? countFromRecord(lintResultSummary, "warnings") ?? countFromRecord(lintSummary, "warnings"),
|
|
7822
|
-
reportPath: value.reportPath ?? null,
|
|
7823
|
-
plannedReads: value.plannedReads ?? value.plannedReadFiles ?? [],
|
|
7824
|
-
plannedWrites: value.plannedWrites ?? value.plannedWriteFiles ?? [],
|
|
7825
|
-
changedFiles: value.changedFiles ?? [],
|
|
7826
|
-
unchangedFiles: dedupeOsmdFileRecords(value.unchangedFiles ?? []),
|
|
7827
|
-
updatedFiles: value.updatedFiles ?? [],
|
|
7828
|
-
skippedFiles: dedupeOsmdFileRecords(value.skippedFiles ?? []),
|
|
7829
|
-
lintPlan: value.lintPlan ?? null,
|
|
7830
|
-
lintSummary: value.lintSummary ?? null,
|
|
7831
|
-
lintResult: value.lintResult ?? null,
|
|
7832
|
-
notification
|
|
7833
|
-
};
|
|
7834
|
-
})
|
|
7835
|
-
);
|
|
7836
|
-
var mutationPayloadSchema = import_zod17.z.object({
|
|
7837
|
-
ok: import_zod17.z.boolean(),
|
|
7838
|
-
status: import_zod17.z.number(),
|
|
7839
|
-
errorCode: import_zod17.z.string().nullable().optional(),
|
|
7840
|
-
data: import_zod17.z.unknown().nullable().optional(),
|
|
7841
|
-
errors: import_zod17.z.unknown().nullable().optional()
|
|
7889
|
+
var mutationPayloadSchema = import_zod18.z.object({
|
|
7890
|
+
ok: import_zod18.z.boolean(),
|
|
7891
|
+
status: import_zod18.z.number(),
|
|
7892
|
+
errorCode: import_zod18.z.string().nullable().optional(),
|
|
7893
|
+
data: import_zod18.z.unknown().nullable().optional(),
|
|
7894
|
+
errors: import_zod18.z.unknown().nullable().optional()
|
|
7842
7895
|
});
|
|
7843
|
-
var markdownTreeNodeSchema =
|
|
7844
|
-
() =>
|
|
7845
|
-
toolKey:
|
|
7846
|
-
nodeKey:
|
|
7847
|
-
nodeKind:
|
|
7848
|
-
runtimeLabel:
|
|
7849
|
-
path:
|
|
7896
|
+
var markdownTreeNodeSchema = import_zod18.z.lazy(
|
|
7897
|
+
() => import_zod18.z.object({
|
|
7898
|
+
toolKey: import_zod18.z.string(),
|
|
7899
|
+
nodeKey: import_zod18.z.string(),
|
|
7900
|
+
nodeKind: import_zod18.z.string(),
|
|
7901
|
+
runtimeLabel: import_zod18.z.string(),
|
|
7902
|
+
path: import_zod18.z.string().nullable().optional().transform((value) => value ?? null),
|
|
7850
7903
|
source: sourceSchema,
|
|
7851
7904
|
access: accessSchema,
|
|
7852
7905
|
owner: ownerSchema,
|
|
7853
|
-
parentRef:
|
|
7854
|
-
agentChildrenAllowed:
|
|
7855
|
-
exists:
|
|
7856
|
-
resolvedScope:
|
|
7857
|
-
parentId:
|
|
7858
|
-
recordId:
|
|
7859
|
-
memberId:
|
|
7860
|
-
teamId:
|
|
7861
|
-
contentType:
|
|
7906
|
+
parentRef: import_zod18.z.string().nullable().optional().transform((value) => value ?? null),
|
|
7907
|
+
agentChildrenAllowed: import_zod18.z.boolean(),
|
|
7908
|
+
exists: import_zod18.z.boolean(),
|
|
7909
|
+
resolvedScope: import_zod18.z.object({
|
|
7910
|
+
parentId: import_zod18.z.string().nullable().optional().transform((value) => value ?? null),
|
|
7911
|
+
recordId: import_zod18.z.string().nullable().optional().transform((value) => value ?? null),
|
|
7912
|
+
memberId: import_zod18.z.string().nullable().optional().transform((value) => value ?? null),
|
|
7913
|
+
teamId: import_zod18.z.string().nullable().optional().transform((value) => value ?? null),
|
|
7914
|
+
contentType: import_zod18.z.string().nullable().optional().transform((value) => value ?? null)
|
|
7862
7915
|
}),
|
|
7863
|
-
isLeaf:
|
|
7864
|
-
treeView:
|
|
7865
|
-
details:
|
|
7866
|
-
children:
|
|
7916
|
+
isLeaf: import_zod18.z.boolean(),
|
|
7917
|
+
treeView: import_zod18.z.boolean(),
|
|
7918
|
+
details: import_zod18.z.unknown().nullable(),
|
|
7919
|
+
children: import_zod18.z.array(markdownTreeNodeSchema).optional().transform((value) => value ?? [])
|
|
7867
7920
|
})
|
|
7868
7921
|
);
|
|
7869
7922
|
var AGENT_MARKDOWN_FILE_SELECTION = `{
|
|
@@ -8124,86 +8177,6 @@ function normalizeAgentMarkdownJsonKeys(value) {
|
|
|
8124
8177
|
}
|
|
8125
8178
|
return normalized;
|
|
8126
8179
|
}
|
|
8127
|
-
function firstPresent(...values) {
|
|
8128
|
-
for (const value of values) {
|
|
8129
|
-
if (value !== void 0 && value !== null) {
|
|
8130
|
-
return value;
|
|
8131
|
-
}
|
|
8132
|
-
}
|
|
8133
|
-
return void 0;
|
|
8134
|
-
}
|
|
8135
|
-
function normalizeOsmdPhantomResultKeys(value) {
|
|
8136
|
-
const normalized = normalizeAgentMarkdownJsonKeys(value);
|
|
8137
|
-
if (!isRecord5(normalized)) {
|
|
8138
|
-
return normalized;
|
|
8139
|
-
}
|
|
8140
|
-
const run = isRecord5(normalized.run) ? normalizeAgentMarkdownJsonKeys(normalized.run) : null;
|
|
8141
|
-
const result = run ? { ...run, ...normalized } : { ...normalized };
|
|
8142
|
-
const runField = (key) => run ? run[key] : void 0;
|
|
8143
|
-
const assignFirstPresent = (target, ...values) => {
|
|
8144
|
-
const value2 = firstPresent(result[target], ...values);
|
|
8145
|
-
if (value2 !== void 0) {
|
|
8146
|
-
result[target] = value2;
|
|
8147
|
-
}
|
|
8148
|
-
};
|
|
8149
|
-
assignFirstPresent("runId", normalized.id, runField("runId"), runField("id"));
|
|
8150
|
-
assignFirstPresent("organizationId", runField("organizationId"));
|
|
8151
|
-
assignFirstPresent("triggerType", runField("triggerType"));
|
|
8152
|
-
assignFirstPresent("scope", runField("scope"));
|
|
8153
|
-
assignFirstPresent("status", runField("status"));
|
|
8154
|
-
assignFirstPresent("createdAt", runField("createdAt"));
|
|
8155
|
-
assignFirstPresent("updatedAt", runField("updatedAt"));
|
|
8156
|
-
assignFirstPresent("startedAt", runField("startedAt"));
|
|
8157
|
-
assignFirstPresent("completedAt", runField("completedAt"));
|
|
8158
|
-
assignFirstPresent("countSemantics", runField("countSemantics"));
|
|
8159
|
-
assignFirstPresent(
|
|
8160
|
-
"scannedFileCount",
|
|
8161
|
-
normalized.scanned,
|
|
8162
|
-
runField("scannedFileCount"),
|
|
8163
|
-
runField("scanned")
|
|
8164
|
-
);
|
|
8165
|
-
assignFirstPresent(
|
|
8166
|
-
"changedFileCount",
|
|
8167
|
-
normalized.changed,
|
|
8168
|
-
runField("changedFileCount"),
|
|
8169
|
-
runField("changed")
|
|
8170
|
-
);
|
|
8171
|
-
assignFirstPresent(
|
|
8172
|
-
"unchangedFileCount",
|
|
8173
|
-
normalized.unchanged,
|
|
8174
|
-
runField("unchangedFileCount"),
|
|
8175
|
-
runField("unchanged")
|
|
8176
|
-
);
|
|
8177
|
-
assignFirstPresent(
|
|
8178
|
-
"updatedFileCount",
|
|
8179
|
-
normalized.updated,
|
|
8180
|
-
runField("updatedFileCount"),
|
|
8181
|
-
runField("updated")
|
|
8182
|
-
);
|
|
8183
|
-
assignFirstPresent(
|
|
8184
|
-
"skippedFileCount",
|
|
8185
|
-
normalized.skipped,
|
|
8186
|
-
runField("skippedFileCount"),
|
|
8187
|
-
runField("skipped")
|
|
8188
|
-
);
|
|
8189
|
-
assignFirstPresent("lintStatus", runField("lintStatus"));
|
|
8190
|
-
assignFirstPresent("errorCount", runField("errorCount"));
|
|
8191
|
-
assignFirstPresent("warningCount", runField("warningCount"));
|
|
8192
|
-
assignFirstPresent("reportPath", runField("reportPath"));
|
|
8193
|
-
assignFirstPresent("plannedReads", runField("plannedReads"), runField("plannedReadFiles"));
|
|
8194
|
-
assignFirstPresent("plannedWrites", runField("plannedWrites"), runField("plannedWriteFiles"));
|
|
8195
|
-
assignFirstPresent("changedFiles", runField("changedFiles"));
|
|
8196
|
-
assignFirstPresent("unchangedFiles", runField("unchangedFiles"));
|
|
8197
|
-
assignFirstPresent("updatedFiles", runField("updatedFiles"));
|
|
8198
|
-
assignFirstPresent("skippedFiles", runField("skippedFiles"));
|
|
8199
|
-
assignFirstPresent("lintPlan", runField("lintPlan"));
|
|
8200
|
-
assignFirstPresent("lintSummary", runField("lintSummary"));
|
|
8201
|
-
assignFirstPresent("lintResult", runField("lintResult"));
|
|
8202
|
-
assignFirstPresent("notification", runField("notification"));
|
|
8203
|
-
assignFirstPresent("notificationId", runField("notificationId"));
|
|
8204
|
-
assignFirstPresent("notificationStatus", runField("notificationStatus"));
|
|
8205
|
-
return result;
|
|
8206
|
-
}
|
|
8207
8180
|
function buildSuccessEnvelope(params) {
|
|
8208
8181
|
return {
|
|
8209
8182
|
ok: true,
|
|
@@ -8623,51 +8596,6 @@ async function runOsmdIngestFlow(params) {
|
|
|
8623
8596
|
})
|
|
8624
8597
|
});
|
|
8625
8598
|
}
|
|
8626
|
-
async function runOsmdPhantomPhaseOne(params) {
|
|
8627
|
-
const runtimeOptions = {
|
|
8628
|
-
...params.runtimeOptions,
|
|
8629
|
-
timeoutMs: params.runtimeOptions.timeoutMs ?? defaultOsmdPhantomTimeoutMs
|
|
8630
|
-
};
|
|
8631
|
-
const result = await requestOsmdMutationPayload({
|
|
8632
|
-
command: params.command,
|
|
8633
|
-
operationName: "RunPhantomOsmdMaintenance",
|
|
8634
|
-
operationType: "mutation",
|
|
8635
|
-
runtimeOptions,
|
|
8636
|
-
field: "run_phantom_osmd_maintenance",
|
|
8637
|
-
variables: {
|
|
8638
|
-
organization_id: params.organizationId,
|
|
8639
|
-
dry_run: params.dryRun
|
|
8640
|
-
}
|
|
8641
|
-
});
|
|
8642
|
-
const parsedData = osmdPhantomResultSchema.safeParse(
|
|
8643
|
-
normalizeAgentMarkdownJsonKeys(result.payload.data)
|
|
8644
|
-
);
|
|
8645
|
-
if (!parsedData.success) {
|
|
8646
|
-
return printInvalidPayloadError({
|
|
8647
|
-
command: params.command,
|
|
8648
|
-
requestId: result.requestId,
|
|
8649
|
-
issues: parsedData.error.issues
|
|
8650
|
-
});
|
|
8651
|
-
}
|
|
8652
|
-
const data = {
|
|
8653
|
-
...parsedData.data,
|
|
8654
|
-
organizationId: parsedData.data.organizationId ?? params.organizationId,
|
|
8655
|
-
triggerType: parsedData.data.triggerType ?? "manual"
|
|
8656
|
-
};
|
|
8657
|
-
if (params.readable) {
|
|
8658
|
-
return printTextAndExit({
|
|
8659
|
-
text: formatOsmdPhantomHuman(data, params.dryRun)
|
|
8660
|
-
});
|
|
8661
|
-
}
|
|
8662
|
-
return printEnvelopeAndExit({
|
|
8663
|
-
envelope: buildSuccessEnvelope({
|
|
8664
|
-
command: params.command,
|
|
8665
|
-
status: result.payload.status,
|
|
8666
|
-
data,
|
|
8667
|
-
requestId: result.requestId
|
|
8668
|
-
})
|
|
8669
|
-
});
|
|
8670
|
-
}
|
|
8671
8599
|
function normalizeAgentFilePath(file) {
|
|
8672
8600
|
const trimmed = nonEmptyString3.parse(file).trim().replace(/^\/+|\/+$/g, "");
|
|
8673
8601
|
const fileName = trimmed.startsWith(".agent/") ? trimmed.slice(".agent/".length) : trimmed;
|
|
@@ -9078,62 +9006,6 @@ function formatIngestFileList(files) {
|
|
|
9078
9006
|
return `- ${path}${action}`;
|
|
9079
9007
|
});
|
|
9080
9008
|
}
|
|
9081
|
-
function fileRecordPath(file) {
|
|
9082
|
-
return typeof file.path === "string" && file.path.trim() !== "" ? file.path : null;
|
|
9083
|
-
}
|
|
9084
|
-
function isAgentNotesWrite(file) {
|
|
9085
|
-
const path = fileRecordPath(file);
|
|
9086
|
-
return path !== null && /(?:^|\/)\.agent\/notes\.md$/.test(path);
|
|
9087
|
-
}
|
|
9088
|
-
function formatNotesWriteSummary(files) {
|
|
9089
|
-
const notesWrites = files.filter(isAgentNotesWrite);
|
|
9090
|
-
if (notesWrites.length === 0) {
|
|
9091
|
-
return ["notes.md writes: none"];
|
|
9092
|
-
}
|
|
9093
|
-
return ["notes.md writes:", ...formatIngestFileList(notesWrites)];
|
|
9094
|
-
}
|
|
9095
|
-
function skippedReasonForFile(file) {
|
|
9096
|
-
for (const key of ["reason", "skipReason", "errorCode", "suggestedAction", "status"]) {
|
|
9097
|
-
const value = file[key];
|
|
9098
|
-
if (typeof value === "string" && value.trim() !== "") {
|
|
9099
|
-
return value;
|
|
9100
|
-
}
|
|
9101
|
-
}
|
|
9102
|
-
return "unspecified";
|
|
9103
|
-
}
|
|
9104
|
-
function formatSkippedFilesByReason(files) {
|
|
9105
|
-
if (files.length === 0) {
|
|
9106
|
-
return ["- none"];
|
|
9107
|
-
}
|
|
9108
|
-
const groups = /* @__PURE__ */ new Map();
|
|
9109
|
-
for (const file of files) {
|
|
9110
|
-
const reason = skippedReasonForFile(file);
|
|
9111
|
-
const existing = groups.get(reason) ?? [];
|
|
9112
|
-
existing.push(file);
|
|
9113
|
-
groups.set(reason, existing);
|
|
9114
|
-
}
|
|
9115
|
-
const lines = [];
|
|
9116
|
-
for (const [reason, records] of groups.entries()) {
|
|
9117
|
-
lines.push(`- ${reason}`);
|
|
9118
|
-
for (const record of records) {
|
|
9119
|
-
lines.push(` - ${fileRecordPath(record) ?? "-"}`);
|
|
9120
|
-
}
|
|
9121
|
-
}
|
|
9122
|
-
return lines;
|
|
9123
|
-
}
|
|
9124
|
-
function dedupeOsmdFileRecords(files) {
|
|
9125
|
-
const seen = /* @__PURE__ */ new Set();
|
|
9126
|
-
const deduped = [];
|
|
9127
|
-
for (const file of files) {
|
|
9128
|
-
const key = file.path;
|
|
9129
|
-
if (typeof key !== "string" || key.trim() === "" || seen.has(key)) {
|
|
9130
|
-
continue;
|
|
9131
|
-
}
|
|
9132
|
-
seen.add(key);
|
|
9133
|
-
deduped.push(file);
|
|
9134
|
-
}
|
|
9135
|
-
return deduped;
|
|
9136
|
-
}
|
|
9137
9009
|
function formatSkippedUpdateList(skippedUpdates) {
|
|
9138
9010
|
if (skippedUpdates.length === 0) {
|
|
9139
9011
|
return ["- none"];
|
|
@@ -9172,72 +9044,6 @@ function formatOsmdIngestHuman(data) {
|
|
|
9172
9044
|
function formatNullableNumberHumanField(value) {
|
|
9173
9045
|
return typeof value === "number" ? String(value) : "-";
|
|
9174
9046
|
}
|
|
9175
|
-
function formatNotificationHuman(notification) {
|
|
9176
|
-
if (!notification) {
|
|
9177
|
-
return "-";
|
|
9178
|
-
}
|
|
9179
|
-
const id = formatNullableHumanField(notification.id);
|
|
9180
|
-
const status = formatNullableHumanField(notification.status);
|
|
9181
|
-
return `id=${id} status=${status}`;
|
|
9182
|
-
}
|
|
9183
|
-
function formatPhantomTimestampLines(data) {
|
|
9184
|
-
const lines = [];
|
|
9185
|
-
if (data.startedAt) {
|
|
9186
|
-
lines.push(`Started at: ${data.startedAt}`);
|
|
9187
|
-
}
|
|
9188
|
-
if (data.completedAt) {
|
|
9189
|
-
lines.push(`Completed at: ${data.completedAt}`);
|
|
9190
|
-
}
|
|
9191
|
-
if (data.createdAt) {
|
|
9192
|
-
lines.push(`Created at: ${data.createdAt}`);
|
|
9193
|
-
}
|
|
9194
|
-
if (data.updatedAt) {
|
|
9195
|
-
lines.push(`Updated at: ${data.updatedAt}`);
|
|
9196
|
-
}
|
|
9197
|
-
return lines;
|
|
9198
|
-
}
|
|
9199
|
-
function formatOsmdPhantomHuman(data, dryRun) {
|
|
9200
|
-
const lines = [
|
|
9201
|
-
dryRun ? "Phantom Phase 1 plan" : "Phantom Phase 1 run",
|
|
9202
|
-
`Run ID: ${formatNullableHumanField(data.runId)}`,
|
|
9203
|
-
`Status: ${formatNullableHumanField(data.status)}`,
|
|
9204
|
-
...formatPhantomTimestampLines(data),
|
|
9205
|
-
`Organization ID: ${formatNullableHumanField(data.organizationId)}`,
|
|
9206
|
-
`Trigger type: ${formatNullableHumanField(data.triggerType)}`,
|
|
9207
|
-
`Scope: ${formatNullableHumanField(data.scope ?? data.subtree)}`,
|
|
9208
|
-
...data.countSemantics === null || data.countSemantics === void 0 ? [] : [`Count semantics: ${formatUnknownHuman(data.countSemantics)}`],
|
|
9209
|
-
`Reviewed OSMD/agent markdown entries: ${formatNullableNumberHumanField(data.scannedFileCount)}`,
|
|
9210
|
-
`Changed entries: ${formatNullableNumberHumanField(data.changedFileCount)}`,
|
|
9211
|
-
`Unchanged entries: ${formatNullableNumberHumanField(data.unchangedFileCount)}`,
|
|
9212
|
-
`Updated files: ${formatNullableNumberHumanField(data.updatedFileCount)}`,
|
|
9213
|
-
`Skipped entries: ${formatNullableNumberHumanField(data.skippedFileCount)}`,
|
|
9214
|
-
`Lint status: ${formatNullableHumanField(data.lintStatus)}`,
|
|
9215
|
-
`Errors: ${formatNullableNumberHumanField(data.errorCount)}`,
|
|
9216
|
-
`Warnings: ${formatNullableNumberHumanField(data.warningCount)}`,
|
|
9217
|
-
`Report path: ${formatNullableHumanField(data.reportPath)}`,
|
|
9218
|
-
`Notification: ${formatNotificationHuman(data.notification)}`,
|
|
9219
|
-
"",
|
|
9220
|
-
"Planned reads:",
|
|
9221
|
-
...formatIngestFileList(data.plannedReads),
|
|
9222
|
-
"",
|
|
9223
|
-
"Planned semantic memory writes:",
|
|
9224
|
-
...formatIngestFileList(data.plannedWrites),
|
|
9225
|
-
...dryRun ? formatNotesWriteSummary(data.plannedWrites) : [],
|
|
9226
|
-
"",
|
|
9227
|
-
"Changed entries:",
|
|
9228
|
-
...formatIngestFileList(data.changedFiles),
|
|
9229
|
-
"",
|
|
9230
|
-
"Updated files:",
|
|
9231
|
-
...formatIngestFileList(data.updatedFiles),
|
|
9232
|
-
"",
|
|
9233
|
-
"Skipped nodes by reason:",
|
|
9234
|
-
...formatSkippedFilesByReason(data.skippedFiles),
|
|
9235
|
-
"",
|
|
9236
|
-
"Lint plan:",
|
|
9237
|
-
formatUnknownHuman(data.lintPlan)
|
|
9238
|
-
];
|
|
9239
|
-
return lines.join("\n");
|
|
9240
|
-
}
|
|
9241
9047
|
function parseSearchLimit(value) {
|
|
9242
9048
|
const raw = value === void 0 || value === null || value === "" ? "10" : value;
|
|
9243
9049
|
const parsed = positiveInt.safeParse(raw);
|
|
@@ -10005,18 +9811,6 @@ function registerOsmdCommands(program) {
|
|
|
10005
9811
|
throw error;
|
|
10006
9812
|
}
|
|
10007
9813
|
});
|
|
10008
|
-
const phantom = osmd.command("phantom").description("Backend-owned Phantom Phase 1 manual operations");
|
|
10009
|
-
phantom.command("run").description("Manually run or plan Phantom Phase 1 for OSMD/agent semantic memory").option("--dry-run", "Ask backend for the Phantom Phase 1 plan without mutating").option("--readable", "Print a human-readable Phantom summary instead of JSON").action(async (opts, cmd) => {
|
|
10010
|
-
const command = "osmd.phantom.run";
|
|
10011
|
-
const { organizationId, runtimeOptions } = await resolveOsmdContext(cmd);
|
|
10012
|
-
return runOsmdPhantomPhaseOne({
|
|
10013
|
-
command,
|
|
10014
|
-
runtimeOptions,
|
|
10015
|
-
organizationId,
|
|
10016
|
-
dryRun: opts.dryRun === true,
|
|
10017
|
-
readable: opts.readable === true
|
|
10018
|
-
});
|
|
10019
|
-
});
|
|
10020
9814
|
const agent = osmd.command("agent").description(".agent markdown attached to canonical OSMD parents");
|
|
10021
9815
|
agent.command("status <parent-ref> <file>").description("Show .agent file metadata without creating files").action(async (parentRef, file, _opts, cmd) => {
|
|
10022
9816
|
const { organizationId, runtimeOptions } = await resolveOsmdContext(cmd);
|
|
@@ -13012,14 +12806,14 @@ function registerMailCommands(program) {
|
|
|
13012
12806
|
}
|
|
13013
12807
|
|
|
13014
12808
|
// src/commands/phantom.ts
|
|
13015
|
-
var
|
|
13016
|
-
var nonNegativeInt4 =
|
|
13017
|
-
var nullableString =
|
|
13018
|
-
var idString =
|
|
13019
|
-
var nullableIdString =
|
|
12809
|
+
var import_zod19 = require("zod");
|
|
12810
|
+
var nonNegativeInt4 = import_zod19.z.coerce.number().int().min(0);
|
|
12811
|
+
var nullableString = import_zod19.z.string().nullable().optional().transform((value) => value ?? null);
|
|
12812
|
+
var idString = import_zod19.z.union([import_zod19.z.string(), import_zod19.z.number()]).transform((value) => String(value));
|
|
12813
|
+
var nullableIdString = import_zod19.z.union([import_zod19.z.string(), import_zod19.z.number()]).nullable().optional().transform(
|
|
13020
12814
|
(value) => value === void 0 || value === null ? null : String(value)
|
|
13021
12815
|
);
|
|
13022
|
-
var jsonObject =
|
|
12816
|
+
var jsonObject = import_zod19.z.record(import_zod19.z.string(), import_zod19.z.unknown());
|
|
13023
12817
|
var PHANTOM_LEDGER_INVENTORY_SELECTION = `{
|
|
13024
12818
|
schemaVersion
|
|
13025
12819
|
runsCount
|
|
@@ -13232,10 +13026,10 @@ var PHANTOM_LEDGER_KEY_ALIASES = {
|
|
|
13232
13026
|
content_hash: "contentHash",
|
|
13233
13027
|
observed_at: "observedAt"
|
|
13234
13028
|
};
|
|
13235
|
-
var phantomLedgerInventorySchema =
|
|
13029
|
+
var phantomLedgerInventorySchema = import_zod19.z.preprocess(
|
|
13236
13030
|
normalizePhantomLedgerKeys,
|
|
13237
|
-
|
|
13238
|
-
schemaVersion:
|
|
13031
|
+
import_zod19.z.object({
|
|
13032
|
+
schemaVersion: import_zod19.z.string(),
|
|
13239
13033
|
runsCount: nonNegativeInt4,
|
|
13240
13034
|
observationsCount: nonNegativeInt4,
|
|
13241
13035
|
candidatesCount: nonNegativeInt4,
|
|
@@ -13245,16 +13039,16 @@ var phantomLedgerInventorySchema = import_zod18.z.preprocess(
|
|
|
13245
13039
|
reportsCount: nonNegativeInt4
|
|
13246
13040
|
})
|
|
13247
13041
|
);
|
|
13248
|
-
var phantomRunSchema =
|
|
13042
|
+
var phantomRunSchema = import_zod19.z.preprocess(
|
|
13249
13043
|
normalizePhantomLedgerKeys,
|
|
13250
|
-
|
|
13044
|
+
import_zod19.z.object({
|
|
13251
13045
|
id: idString,
|
|
13252
13046
|
organizationId: idString,
|
|
13253
|
-
notificationId:
|
|
13047
|
+
notificationId: import_zod19.z.union([import_zod19.z.string(), import_zod19.z.number()]).nullable().optional().transform(
|
|
13254
13048
|
(value) => value === void 0 || value === null ? null : String(value)
|
|
13255
13049
|
),
|
|
13256
|
-
status:
|
|
13257
|
-
triggerType:
|
|
13050
|
+
status: import_zod19.z.string(),
|
|
13051
|
+
triggerType: import_zod19.z.string(),
|
|
13258
13052
|
startedAt: nullableString,
|
|
13259
13053
|
completedAt: nullableString,
|
|
13260
13054
|
scannedFileCount: nonNegativeInt4,
|
|
@@ -13264,163 +13058,163 @@ var phantomRunSchema = import_zod18.z.preprocess(
|
|
|
13264
13058
|
errorCount: nonNegativeInt4,
|
|
13265
13059
|
warningCount: nonNegativeInt4,
|
|
13266
13060
|
errorMessage: nullableString,
|
|
13267
|
-
dryRun:
|
|
13268
|
-
schemaVersion:
|
|
13061
|
+
dryRun: import_zod19.z.boolean(),
|
|
13062
|
+
schemaVersion: import_zod19.z.string(),
|
|
13269
13063
|
testRunId: nullableString,
|
|
13270
13064
|
idempotencyKey: nullableString,
|
|
13271
13065
|
ledgerMetadata: jsonObject.catch({}),
|
|
13272
|
-
createdAt:
|
|
13273
|
-
updatedAt:
|
|
13066
|
+
createdAt: import_zod19.z.string(),
|
|
13067
|
+
updatedAt: import_zod19.z.string()
|
|
13274
13068
|
})
|
|
13275
13069
|
);
|
|
13276
|
-
var phantomRunListItemSchema =
|
|
13070
|
+
var phantomRunListItemSchema = import_zod19.z.preprocess(
|
|
13277
13071
|
normalizePhantomLedgerKeys,
|
|
13278
|
-
|
|
13072
|
+
import_zod19.z.object({
|
|
13279
13073
|
id: idString,
|
|
13280
13074
|
organizationId: idString,
|
|
13281
|
-
status:
|
|
13282
|
-
triggerType:
|
|
13283
|
-
dryRun:
|
|
13284
|
-
schemaVersion:
|
|
13075
|
+
status: import_zod19.z.string(),
|
|
13076
|
+
triggerType: import_zod19.z.string(),
|
|
13077
|
+
dryRun: import_zod19.z.boolean(),
|
|
13078
|
+
schemaVersion: import_zod19.z.string(),
|
|
13285
13079
|
testRunId: nullableString,
|
|
13286
|
-
createdAt:
|
|
13287
|
-
updatedAt:
|
|
13080
|
+
createdAt: import_zod19.z.string(),
|
|
13081
|
+
updatedAt: import_zod19.z.string()
|
|
13288
13082
|
})
|
|
13289
13083
|
);
|
|
13290
|
-
var phantomReportSchema =
|
|
13084
|
+
var phantomReportSchema = import_zod19.z.preprocess(
|
|
13291
13085
|
normalizePhantomLedgerKeys,
|
|
13292
|
-
|
|
13086
|
+
import_zod19.z.object({
|
|
13293
13087
|
id: idString,
|
|
13294
13088
|
organizationId: idString,
|
|
13295
13089
|
phantomRunId: idString,
|
|
13296
|
-
status:
|
|
13297
|
-
reportType:
|
|
13298
|
-
schemaVersion:
|
|
13090
|
+
status: import_zod19.z.string(),
|
|
13091
|
+
reportType: import_zod19.z.string(),
|
|
13092
|
+
schemaVersion: import_zod19.z.string(),
|
|
13299
13093
|
markdownPath: nullableString,
|
|
13300
13094
|
payload: jsonObject.catch({}),
|
|
13301
13095
|
testRunId: nullableString,
|
|
13302
|
-
idempotencyKey:
|
|
13303
|
-
createdAt:
|
|
13304
|
-
updatedAt:
|
|
13096
|
+
idempotencyKey: import_zod19.z.string(),
|
|
13097
|
+
createdAt: import_zod19.z.string(),
|
|
13098
|
+
updatedAt: import_zod19.z.string()
|
|
13305
13099
|
})
|
|
13306
13100
|
);
|
|
13307
|
-
var phantomObservationSchema =
|
|
13101
|
+
var phantomObservationSchema = import_zod19.z.preprocess(
|
|
13308
13102
|
normalizePhantomLedgerKeys,
|
|
13309
|
-
|
|
13103
|
+
import_zod19.z.object({
|
|
13310
13104
|
id: idString,
|
|
13311
13105
|
organizationId: idString,
|
|
13312
13106
|
phantomRunId: idString,
|
|
13313
|
-
status:
|
|
13314
|
-
observationType:
|
|
13107
|
+
status: import_zod19.z.string(),
|
|
13108
|
+
observationType: import_zod19.z.string(),
|
|
13315
13109
|
targetType: nullableString,
|
|
13316
13110
|
targetId: nullableString,
|
|
13317
13111
|
sourceTable: nullableString,
|
|
13318
13112
|
sourceRecordId: nullableString,
|
|
13319
13113
|
sourceEventId: nullableString,
|
|
13320
13114
|
contentHash: nullableString,
|
|
13321
|
-
observedAt:
|
|
13322
|
-
confidence:
|
|
13115
|
+
observedAt: import_zod19.z.string(),
|
|
13116
|
+
confidence: import_zod19.z.coerce.number(),
|
|
13323
13117
|
payload: jsonObject.catch({}),
|
|
13324
|
-
schemaVersion:
|
|
13118
|
+
schemaVersion: import_zod19.z.string(),
|
|
13325
13119
|
testRunId: nullableString,
|
|
13326
|
-
idempotencyKey:
|
|
13327
|
-
createdAt:
|
|
13328
|
-
updatedAt:
|
|
13120
|
+
idempotencyKey: import_zod19.z.string(),
|
|
13121
|
+
createdAt: import_zod19.z.string(),
|
|
13122
|
+
updatedAt: import_zod19.z.string()
|
|
13329
13123
|
})
|
|
13330
13124
|
);
|
|
13331
|
-
var phantomCandidateSchema =
|
|
13125
|
+
var phantomCandidateSchema = import_zod19.z.preprocess(
|
|
13332
13126
|
normalizePhantomLedgerKeys,
|
|
13333
|
-
|
|
13127
|
+
import_zod19.z.object({
|
|
13334
13128
|
id: idString,
|
|
13335
13129
|
organizationId: idString,
|
|
13336
13130
|
phantomRunId: idString,
|
|
13337
13131
|
phantomObservationId: nullableString,
|
|
13338
|
-
status:
|
|
13339
|
-
candidateType:
|
|
13132
|
+
status: import_zod19.z.string(),
|
|
13133
|
+
candidateType: import_zod19.z.string(),
|
|
13340
13134
|
targetType: nullableString,
|
|
13341
13135
|
targetId: nullableString,
|
|
13342
13136
|
title: nullableString,
|
|
13343
|
-
dryRun:
|
|
13137
|
+
dryRun: import_zod19.z.boolean(),
|
|
13344
13138
|
payload: jsonObject.catch({}),
|
|
13345
|
-
approvalStatus:
|
|
13139
|
+
approvalStatus: import_zod19.z.string(),
|
|
13346
13140
|
approvedById: nullableIdString,
|
|
13347
13141
|
approvedAt: nullableString,
|
|
13348
13142
|
approvalSource: nullableString,
|
|
13349
13143
|
approvalReason: nullableString,
|
|
13350
13144
|
approvalMetadata: jsonObject.catch({}),
|
|
13351
|
-
schemaVersion:
|
|
13145
|
+
schemaVersion: import_zod19.z.string(),
|
|
13352
13146
|
testRunId: nullableString,
|
|
13353
|
-
idempotencyKey:
|
|
13354
|
-
createdAt:
|
|
13355
|
-
updatedAt:
|
|
13147
|
+
idempotencyKey: import_zod19.z.string(),
|
|
13148
|
+
createdAt: import_zod19.z.string(),
|
|
13149
|
+
updatedAt: import_zod19.z.string()
|
|
13356
13150
|
})
|
|
13357
13151
|
);
|
|
13358
|
-
var phantomCandidateEvidenceSchema =
|
|
13152
|
+
var phantomCandidateEvidenceSchema = import_zod19.z.preprocess(
|
|
13359
13153
|
normalizePhantomLedgerKeys,
|
|
13360
|
-
|
|
13154
|
+
import_zod19.z.object({
|
|
13361
13155
|
id: idString,
|
|
13362
13156
|
organizationId: idString,
|
|
13363
13157
|
phantomCandidateId: idString,
|
|
13364
13158
|
phantomObservationId: nullableString,
|
|
13365
|
-
evidenceType:
|
|
13159
|
+
evidenceType: import_zod19.z.string(),
|
|
13366
13160
|
sourceType: nullableString,
|
|
13367
13161
|
sourceId: nullableString,
|
|
13368
13162
|
contentHash: nullableString,
|
|
13369
13163
|
payload: jsonObject.catch({}),
|
|
13370
|
-
schemaVersion:
|
|
13164
|
+
schemaVersion: import_zod19.z.string(),
|
|
13371
13165
|
testRunId: nullableString,
|
|
13372
|
-
idempotencyKey:
|
|
13373
|
-
createdAt:
|
|
13374
|
-
updatedAt:
|
|
13166
|
+
idempotencyKey: import_zod19.z.string(),
|
|
13167
|
+
createdAt: import_zod19.z.string(),
|
|
13168
|
+
updatedAt: import_zod19.z.string()
|
|
13375
13169
|
})
|
|
13376
13170
|
);
|
|
13377
|
-
var phantomValidationSchema =
|
|
13171
|
+
var phantomValidationSchema = import_zod19.z.preprocess(
|
|
13378
13172
|
normalizePhantomLedgerKeys,
|
|
13379
|
-
|
|
13173
|
+
import_zod19.z.object({
|
|
13380
13174
|
id: idString,
|
|
13381
13175
|
organizationId: idString,
|
|
13382
13176
|
phantomRunId: idString,
|
|
13383
13177
|
phantomCandidateId: idString,
|
|
13384
|
-
status:
|
|
13385
|
-
validationType:
|
|
13386
|
-
dryRun:
|
|
13178
|
+
status: import_zod19.z.string(),
|
|
13179
|
+
validationType: import_zod19.z.string(),
|
|
13180
|
+
dryRun: import_zod19.z.boolean(),
|
|
13387
13181
|
payload: jsonObject.catch({}),
|
|
13388
13182
|
resultPayload: jsonObject.catch({}),
|
|
13389
|
-
schemaVersion:
|
|
13183
|
+
schemaVersion: import_zod19.z.string(),
|
|
13390
13184
|
testRunId: nullableString,
|
|
13391
|
-
idempotencyKey:
|
|
13392
|
-
createdAt:
|
|
13393
|
-
updatedAt:
|
|
13185
|
+
idempotencyKey: import_zod19.z.string(),
|
|
13186
|
+
createdAt: import_zod19.z.string(),
|
|
13187
|
+
updatedAt: import_zod19.z.string()
|
|
13394
13188
|
})
|
|
13395
13189
|
);
|
|
13396
|
-
var phantomApplyOperationSchema =
|
|
13190
|
+
var phantomApplyOperationSchema = import_zod19.z.preprocess(
|
|
13397
13191
|
normalizePhantomLedgerKeys,
|
|
13398
|
-
|
|
13192
|
+
import_zod19.z.object({
|
|
13399
13193
|
id: idString,
|
|
13400
13194
|
organizationId: idString,
|
|
13401
13195
|
phantomRunId: idString,
|
|
13402
13196
|
phantomCandidateId: idString,
|
|
13403
|
-
status:
|
|
13404
|
-
operationType:
|
|
13405
|
-
dryRun:
|
|
13197
|
+
status: import_zod19.z.string(),
|
|
13198
|
+
operationType: import_zod19.z.string(),
|
|
13199
|
+
dryRun: import_zod19.z.boolean(),
|
|
13406
13200
|
targetType: nullableString,
|
|
13407
13201
|
targetId: nullableString,
|
|
13408
13202
|
payload: jsonObject.catch({}),
|
|
13409
13203
|
resultPayload: jsonObject.catch({}),
|
|
13410
|
-
schemaVersion:
|
|
13204
|
+
schemaVersion: import_zod19.z.string(),
|
|
13411
13205
|
testRunId: nullableString,
|
|
13412
|
-
idempotencyKey:
|
|
13413
|
-
createdAt:
|
|
13414
|
-
updatedAt:
|
|
13206
|
+
idempotencyKey: import_zod19.z.string(),
|
|
13207
|
+
createdAt: import_zod19.z.string(),
|
|
13208
|
+
updatedAt: import_zod19.z.string()
|
|
13415
13209
|
})
|
|
13416
13210
|
);
|
|
13417
|
-
var phantomRunsSchema =
|
|
13418
|
-
var phantomReportsSchema =
|
|
13419
|
-
var phantomObservationsSchema =
|
|
13420
|
-
var phantomCandidatesSchema =
|
|
13421
|
-
var phantomCandidateEvidencesSchema =
|
|
13422
|
-
var phantomValidationsSchema =
|
|
13423
|
-
var phantomApplyOperationsSchema =
|
|
13211
|
+
var phantomRunsSchema = import_zod19.z.array(phantomRunListItemSchema);
|
|
13212
|
+
var phantomReportsSchema = import_zod19.z.array(phantomReportSchema);
|
|
13213
|
+
var phantomObservationsSchema = import_zod19.z.array(phantomObservationSchema);
|
|
13214
|
+
var phantomCandidatesSchema = import_zod19.z.array(phantomCandidateSchema);
|
|
13215
|
+
var phantomCandidateEvidencesSchema = import_zod19.z.array(phantomCandidateEvidenceSchema);
|
|
13216
|
+
var phantomValidationsSchema = import_zod19.z.array(phantomValidationSchema);
|
|
13217
|
+
var phantomApplyOperationsSchema = import_zod19.z.array(phantomApplyOperationSchema);
|
|
13424
13218
|
function isRecord6(value) {
|
|
13425
13219
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
13426
13220
|
}
|
|
@@ -14877,79 +14671,77 @@ function registerDatasheetsCommands(program) {
|
|
|
14877
14671
|
}
|
|
14878
14672
|
|
|
14879
14673
|
// src/commands/atlasAuthoring.ts
|
|
14880
|
-
var
|
|
14881
|
-
var idSchema14 =
|
|
14882
|
-
var idempotencyKeySchema =
|
|
14883
|
-
var skillScopeSchema =
|
|
14884
|
-
var isoDateSchema =
|
|
14885
|
-
var nonEmptyStringSchema =
|
|
14674
|
+
var import_zod20 = require("zod");
|
|
14675
|
+
var idSchema14 = import_zod20.z.string().trim().min(1);
|
|
14676
|
+
var idempotencyKeySchema = import_zod20.z.string().min(1).refine((value) => value.trim() === value, "Idempotency key must not have leading or trailing whitespace.");
|
|
14677
|
+
var skillScopeSchema = import_zod20.z.enum(["ADMIN_GLOBAL", "MEMBER_PERSONAL"]);
|
|
14678
|
+
var isoDateSchema = import_zod20.z.iso.date();
|
|
14679
|
+
var nonEmptyStringSchema = import_zod20.z.string().trim().min(1);
|
|
14886
14680
|
var AUTOMATION_RUN_HTTP_TIMEOUT_MS = 6e4;
|
|
14887
|
-
var agentToolAccessSchema =
|
|
14888
|
-
|
|
14681
|
+
var agentToolAccessSchema = import_zod20.z.array(
|
|
14682
|
+
import_zod20.z.object({
|
|
14889
14683
|
tool_key: nonEmptyStringSchema,
|
|
14890
14684
|
scope_value: nonEmptyStringSchema
|
|
14891
14685
|
}).strict()
|
|
14892
14686
|
).min(1);
|
|
14893
14687
|
var agentToolAccessUpdateSchema = agentToolAccessSchema.min(0);
|
|
14894
|
-
var agentPluginConnectionsSchema =
|
|
14895
|
-
|
|
14688
|
+
var agentPluginConnectionsSchema = import_zod20.z.array(
|
|
14689
|
+
import_zod20.z.object({
|
|
14896
14690
|
external_tool_connection_id: nonEmptyStringSchema,
|
|
14897
14691
|
tool_key: nonEmptyStringSchema,
|
|
14898
14692
|
scope_value: nonEmptyStringSchema.optional(),
|
|
14899
|
-
allowed_tools:
|
|
14900
|
-
allowed_scopes:
|
|
14901
|
-
requires_confirmation:
|
|
14902
|
-
enabled:
|
|
14693
|
+
allowed_tools: import_zod20.z.array(nonEmptyStringSchema).optional(),
|
|
14694
|
+
allowed_scopes: import_zod20.z.array(nonEmptyStringSchema).optional(),
|
|
14695
|
+
requires_confirmation: import_zod20.z.boolean().optional(),
|
|
14696
|
+
enabled: import_zod20.z.boolean().optional()
|
|
14903
14697
|
}).strict()
|
|
14904
14698
|
).min(1);
|
|
14905
|
-
var agentPluginConnectionUpdateSchema =
|
|
14906
|
-
|
|
14907
|
-
|
|
14699
|
+
var agentPluginConnectionUpdateSchema = import_zod20.z.array(
|
|
14700
|
+
import_zod20.z.union([
|
|
14701
|
+
import_zod20.z.object({
|
|
14908
14702
|
id: nonEmptyStringSchema,
|
|
14909
|
-
_destroy:
|
|
14703
|
+
_destroy: import_zod20.z.literal(true)
|
|
14910
14704
|
}).strict(),
|
|
14911
|
-
|
|
14705
|
+
import_zod20.z.object({
|
|
14912
14706
|
id: nonEmptyStringSchema.optional(),
|
|
14913
14707
|
external_tool_connection_id: nonEmptyStringSchema.optional(),
|
|
14914
14708
|
tool_key: nonEmptyStringSchema.optional(),
|
|
14915
14709
|
scope_value: nonEmptyStringSchema.optional(),
|
|
14916
|
-
allowed_tools:
|
|
14917
|
-
allowed_scopes:
|
|
14918
|
-
requires_confirmation:
|
|
14919
|
-
enabled:
|
|
14710
|
+
allowed_tools: import_zod20.z.array(nonEmptyStringSchema).optional(),
|
|
14711
|
+
allowed_scopes: import_zod20.z.array(nonEmptyStringSchema).optional(),
|
|
14712
|
+
requires_confirmation: import_zod20.z.boolean().optional(),
|
|
14713
|
+
enabled: import_zod20.z.boolean().optional()
|
|
14920
14714
|
}).strict().superRefine((value, context) => {
|
|
14921
14715
|
if (value.id || value.external_tool_connection_id && value.tool_key) return;
|
|
14922
14716
|
context.addIssue({
|
|
14923
|
-
code:
|
|
14717
|
+
code: import_zod20.z.ZodIssueCode.custom,
|
|
14924
14718
|
message: "Plugin updates require an id, or both external_tool_connection_id and tool_key for a new grant."
|
|
14925
14719
|
});
|
|
14926
14720
|
})
|
|
14927
14721
|
])
|
|
14928
14722
|
);
|
|
14929
|
-
var agentTriggerSchema =
|
|
14930
|
-
trigger_type:
|
|
14723
|
+
var agentTriggerSchema = import_zod20.z.object({
|
|
14724
|
+
trigger_type: import_zod20.z.literal("cron"),
|
|
14931
14725
|
cron_expression: nonEmptyStringSchema,
|
|
14932
14726
|
timezone: nonEmptyStringSchema,
|
|
14933
|
-
starts_at:
|
|
14934
|
-
ends_at:
|
|
14935
|
-
max_runs:
|
|
14936
|
-
enabled:
|
|
14727
|
+
starts_at: import_zod20.z.iso.datetime({ offset: true }).nullable().optional(),
|
|
14728
|
+
ends_at: import_zod20.z.iso.datetime({ offset: true }).nullable().optional(),
|
|
14729
|
+
max_runs: import_zod20.z.number().int().positive().nullable().optional(),
|
|
14730
|
+
enabled: import_zod20.z.boolean().optional()
|
|
14937
14731
|
}).strict();
|
|
14938
|
-
var agentTriggerUpdateSchema =
|
|
14732
|
+
var agentTriggerUpdateSchema = import_zod20.z.union([
|
|
14939
14733
|
agentTriggerSchema.extend({ id: nonEmptyStringSchema.optional() }).strict(),
|
|
14940
|
-
|
|
14734
|
+
import_zod20.z.object({
|
|
14941
14735
|
id: nonEmptyStringSchema,
|
|
14942
|
-
_destroy:
|
|
14736
|
+
_destroy: import_zod20.z.literal(true)
|
|
14943
14737
|
}).strict()
|
|
14944
14738
|
]);
|
|
14945
|
-
var automationConfigSchema =
|
|
14739
|
+
var automationConfigSchema = import_zod20.z.record(import_zod20.z.string(), import_zod20.z.unknown());
|
|
14946
14740
|
var AGENT_SELECTION = `{
|
|
14947
14741
|
id
|
|
14948
14742
|
type
|
|
14949
14743
|
name
|
|
14950
14744
|
slug
|
|
14951
|
-
description
|
|
14952
|
-
notes
|
|
14953
14745
|
status
|
|
14954
14746
|
visibility
|
|
14955
14747
|
model
|
|
@@ -15226,7 +15018,16 @@ function normalizeAutomationRunPayload(payload) {
|
|
|
15226
15018
|
};
|
|
15227
15019
|
}
|
|
15228
15020
|
function parseAutomationConfig(value) {
|
|
15229
|
-
|
|
15021
|
+
const config = automationConfigSchema.parse(parseJson(String(value), "--ai-task-config"));
|
|
15022
|
+
if (Object.hasOwn(config, "agent_id") || Object.hasOwn(config, "agentId")) {
|
|
15023
|
+
throw new CliError({
|
|
15024
|
+
message: "Automation executor agent_id must be supplied through --agent-id, not --ai-task-config.",
|
|
15025
|
+
kind: "invalid_args",
|
|
15026
|
+
status: 400,
|
|
15027
|
+
exitCode: EXIT_CODES.invalidArgs
|
|
15028
|
+
});
|
|
15029
|
+
}
|
|
15030
|
+
return config;
|
|
15230
15031
|
}
|
|
15231
15032
|
function parseExpectedUpdateVersion(value) {
|
|
15232
15033
|
return nonEmptyStringSchema.parse(String(value));
|
|
@@ -15435,7 +15236,7 @@ function registerAtlasAuthoringCommands(program) {
|
|
|
15435
15236
|
"--service <service>",
|
|
15436
15237
|
"Supported service: gmail, calendar, slack, or stripe"
|
|
15437
15238
|
).action(async (opts, cmd) => {
|
|
15438
|
-
const service =
|
|
15239
|
+
const service = import_zod20.z.enum(["gmail", "calendar", "slack", "stripe"]).parse(opts.service);
|
|
15439
15240
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
15440
15241
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
15441
15242
|
await runGraphqlQueryCommand({
|
|
@@ -15449,7 +15250,7 @@ function registerAtlasAuthoringCommands(program) {
|
|
|
15449
15250
|
});
|
|
15450
15251
|
});
|
|
15451
15252
|
const automations = program.command("automations").description("Bounded Automation authoring operations");
|
|
15452
|
-
automations.command("create").description("Create a Backlog Automation through the API-owned createAutomation contract").requiredOption("--summary <summary>").requiredOption("--ai-task-config <json>", "Valid JSON for the API-owned ai_task_config field").requiredOption("--idempotency-key <key>", "Required create idempotency key").option("--description <description>").option("--notes <notes>").option("--member-id <memberId>").
|
|
15253
|
+
automations.command("create").description("Create a Backlog Automation through the API-owned createAutomation contract").requiredOption("--summary <summary>").requiredOption("--ai-task-config <json>", "Valid JSON for the API-owned ai_task_config field").requiredOption("--idempotency-key <key>", "Required create idempotency key").option("--description <description>").option("--notes <notes>").option("--member-id <memberId>").requiredOption("--agent-id <agentId>", "Required executor Agent id").option("--priority <priority>").option("--due-date <date>", "ISO-8601 date (YYYY-MM-DD)").action(async (opts, cmd) => {
|
|
15453
15254
|
const idempotencyKey = idempotencyKeySchema.parse(opts.idempotencyKey);
|
|
15454
15255
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
15455
15256
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
@@ -15467,7 +15268,7 @@ function registerAtlasAuthoringCommands(program) {
|
|
|
15467
15268
|
organization_id: organizationId,
|
|
15468
15269
|
input: {
|
|
15469
15270
|
summary: idSchema14.parse(opts.summary),
|
|
15470
|
-
ai_task_config:
|
|
15271
|
+
ai_task_config: parseAutomationConfig(opts.aiTaskConfig),
|
|
15471
15272
|
...opts.description !== void 0 ? { description: String(opts.description) } : {},
|
|
15472
15273
|
...opts.notes !== void 0 ? { notes: String(opts.notes) } : {},
|
|
15473
15274
|
...opts.memberId !== void 0 ? { member_id: idSchema14.parse(opts.memberId) } : {},
|
|
@@ -15538,20 +15339,17 @@ function registerAtlasAuthoringCommands(program) {
|
|
|
15538
15339
|
"Exact opaque updateVersion value from automations show; rejects stale writes"
|
|
15539
15340
|
).option("--summary <summary>").option("--description <description>").option("--notes <notes>").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(
|
|
15540
15341
|
"--agent-id <agentId>",
|
|
15541
|
-
"
|
|
15342
|
+
"Rejected: executor ownership is immutable after Automation creation"
|
|
15542
15343
|
).action(async (opts, cmd) => {
|
|
15543
|
-
if (opts.agentId !== void 0
|
|
15344
|
+
if (opts.agentId !== void 0) {
|
|
15544
15345
|
throw new CliError({
|
|
15545
|
-
message: "automations update
|
|
15346
|
+
message: "automations update cannot change executor ownership; create a new Automation instead.",
|
|
15546
15347
|
kind: "invalid_args",
|
|
15547
15348
|
status: 400,
|
|
15548
15349
|
exitCode: EXIT_CODES.invalidArgs
|
|
15549
15350
|
});
|
|
15550
15351
|
}
|
|
15551
|
-
const aiTaskConfig = opts.aiTaskConfig === void 0 ? void 0 :
|
|
15552
|
-
...parseAutomationConfig(opts.aiTaskConfig),
|
|
15553
|
-
...opts.agentId !== void 0 ? { agent_id: idSchema14.parse(opts.agentId) } : {}
|
|
15554
|
-
};
|
|
15352
|
+
const aiTaskConfig = opts.aiTaskConfig === void 0 ? void 0 : parseAutomationConfig(opts.aiTaskConfig);
|
|
15555
15353
|
const patch = {
|
|
15556
15354
|
...opts.summary !== void 0 ? { summary: String(opts.summary) } : {},
|
|
15557
15355
|
...opts.description !== void 0 ? { description: String(opts.description) } : {},
|
|
@@ -15674,7 +15472,7 @@ var import_node_path4 = require("path");
|
|
|
15674
15472
|
var import_node_crypto3 = require("crypto");
|
|
15675
15473
|
|
|
15676
15474
|
// src/version.ts
|
|
15677
|
-
var CLI_VERSION = "0.1.
|
|
15475
|
+
var CLI_VERSION = "0.1.77";
|
|
15678
15476
|
|
|
15679
15477
|
// src/operationMetadata.ts
|
|
15680
15478
|
var DISCOVERY_OPERATION_IDS = [
|
|
@@ -16078,7 +15876,6 @@ var WRITE_OPERATION_IDS = [
|
|
|
16078
15876
|
"osmd.ingest.text",
|
|
16079
15877
|
"osmd.ingest.transcript",
|
|
16080
15878
|
"osmd.ingest.url",
|
|
16081
|
-
"osmd.phantom.run",
|
|
16082
15879
|
"osmd.wiki.append-log",
|
|
16083
15880
|
"osmd.wiki.create",
|
|
16084
15881
|
"osmd.wiki.index-upsert",
|
|
@@ -16397,22 +16194,21 @@ var NAMESPACE_DOCS = {
|
|
|
16397
16194
|
osmd: {
|
|
16398
16195
|
name: "osmd",
|
|
16399
16196
|
tier: "primary",
|
|
16400
|
-
description: "Canonical OSMD, .agent overlay, Agent Wiki, ingest,
|
|
16197
|
+
description: "Canonical OSMD, .agent overlay, Agent Wiki, ingest, and lint operations.",
|
|
16401
16198
|
examples: [
|
|
16402
16199
|
"wave osmd tree --depth 2",
|
|
16403
16200
|
"wave osmd lint --json",
|
|
16404
16201
|
'wave osmd ingest text "Notes" --slug notes --parent-ref "projects/Wave Tools" --summary "Source notes" --dry-run',
|
|
16405
|
-
'wave osmd agent update "projects/Wave Tools" notes.md --content "# Notes"'
|
|
16406
|
-
"wave osmd phantom run --dry-run"
|
|
16202
|
+
'wave osmd agent update "projects/Wave Tools" notes.md --content "# Notes"'
|
|
16407
16203
|
],
|
|
16408
16204
|
schema: {
|
|
16409
16205
|
output: "json-envelope-default",
|
|
16410
16206
|
safety: [
|
|
16411
16207
|
"Canonical OSMD writes are blocked before mutation.",
|
|
16412
16208
|
"Agent Wiki log is append-only.",
|
|
16413
|
-
"Ingest
|
|
16209
|
+
"Ingest supports dry-run paths."
|
|
16414
16210
|
],
|
|
16415
|
-
commands: ["tree", "status", "read", "children", "search", "lint", "memory-quality", "ingest", "
|
|
16211
|
+
commands: ["tree", "status", "read", "children", "search", "lint", "memory-quality", "ingest", "agent", "wiki"]
|
|
16416
16212
|
}
|
|
16417
16213
|
},
|
|
16418
16214
|
phantom: {
|
|
@@ -17218,7 +17014,7 @@ function registerDiscoveryCommands(program) {
|
|
|
17218
17014
|
const phantom = program.commands.find((command) => command.name() === "phantom");
|
|
17219
17015
|
phantom?.addHelpText(
|
|
17220
17016
|
"after",
|
|
17221
|
-
"\nExamples:\n wave phantom inventory --json\n wave phantom observations --run-id 123 --json\n wave phantom candidates --candidate-type organization_meta_profile_update_candidate --json\n wave phantom apply-operations --status succeeded --operation-type organization_meta_profile_patch --json\n wave phantom report latest --json\n
|
|
17017
|
+
"\nExamples:\n wave phantom inventory --json\n wave phantom observations --run-id 123 --json\n wave phantom candidates --candidate-type organization_meta_profile_update_candidate --json\n wave phantom apply-operations --status succeeded --operation-type organization_meta_profile_patch --json\n wave phantom report latest --json\n"
|
|
17222
17018
|
);
|
|
17223
17019
|
}
|
|
17224
17020
|
function attachNamespaceDiscovery(program) {
|
|
@@ -17284,12 +17080,11 @@ function attachDiscoveryHelp(program) {
|
|
|
17284
17080
|
" wave capabilities list",
|
|
17285
17081
|
" wave capabilities tools",
|
|
17286
17082
|
" wave osmd lint --json",
|
|
17287
|
-
" wave osmd phantom run --dry-run",
|
|
17288
17083
|
" wave doctor"
|
|
17289
17084
|
].join("\n")
|
|
17290
17085
|
);
|
|
17291
17086
|
const helpByName = /* @__PURE__ */ new Map([
|
|
17292
|
-
["osmd", '\nExamples:\n wave osmd tree --depth 2\n wave osmd lint --json\n wave osmd agent update "projects/Wave Tools" notes.md --content "# Notes"\n
|
|
17087
|
+
["osmd", '\nExamples:\n wave osmd tree --depth 2\n wave osmd lint --json\n wave osmd agent update "projects/Wave Tools" notes.md --content "# Notes"\n'],
|
|
17293
17088
|
["broadcast", "\nExamples:\n wave broadcast list\n wave broadcast workspace\n wave broadcast community\n wave broadcast open\n"],
|
|
17294
17089
|
["support", "\nExamples:\n wave support counts --status open\n wave support tickets --status open --page 1 --per 20\n wave support knowledge-articles --collection-id 123 --visibility public\n wave support settings\n wave support open\n"],
|
|
17295
17090
|
["markdown-tree", "\nExamples:\n wave markdown-tree root --tree-view\n wave markdown-tree resolve --tool-key projects --node-key tasks --parent-id 123\n"],
|
|
@@ -17388,19 +17183,30 @@ function buildCli(options) {
|
|
|
17388
17183
|
|
|
17389
17184
|
// src/machine.ts
|
|
17390
17185
|
var import_node_crypto4 = require("crypto");
|
|
17186
|
+
var import_node_fs5 = require("fs");
|
|
17391
17187
|
var MACHINE_FLAGS = /* @__PURE__ */ new Set([
|
|
17392
17188
|
"--machine",
|
|
17393
17189
|
"--operation",
|
|
17394
17190
|
"--phase",
|
|
17395
|
-
"--input-json"
|
|
17191
|
+
"--input-json",
|
|
17192
|
+
"--machine-auth-fd",
|
|
17193
|
+
"--machine-approval-fd"
|
|
17396
17194
|
]);
|
|
17195
|
+
var MACHINE_AUTH_FD = 3;
|
|
17196
|
+
var MACHINE_APPROVAL_FD = 4;
|
|
17197
|
+
var MAX_MACHINE_SECRET_BYTES = 64 * 1024;
|
|
17198
|
+
var MAX_MACHINE_INPUT_BYTES = 128 * 1024;
|
|
17397
17199
|
function machineEnvelope(params) {
|
|
17398
17200
|
return {
|
|
17399
17201
|
ok: params.ok,
|
|
17400
17202
|
command: params.command,
|
|
17401
17203
|
status: params.status,
|
|
17402
17204
|
data: params.data ?? null,
|
|
17403
|
-
error: params.error
|
|
17205
|
+
error: params.error ? {
|
|
17206
|
+
code: params.error.code,
|
|
17207
|
+
message: params.error.message,
|
|
17208
|
+
details: params.error.details ?? {}
|
|
17209
|
+
} : null,
|
|
17404
17210
|
meta: { requestId: "machine" }
|
|
17405
17211
|
};
|
|
17406
17212
|
}
|
|
@@ -17422,7 +17228,7 @@ function commandId(command) {
|
|
|
17422
17228
|
function parseMachineArgs(argv) {
|
|
17423
17229
|
const values = {};
|
|
17424
17230
|
for (let index = 0; index < argv.length; index += 1) {
|
|
17425
|
-
const flag = argv[index];
|
|
17231
|
+
const flag = argv[index] ?? "";
|
|
17426
17232
|
if (!MACHINE_FLAGS.has(flag)) {
|
|
17427
17233
|
return { error: `Unsupported machine flag: ${flag}` };
|
|
17428
17234
|
}
|
|
@@ -17437,19 +17243,45 @@ function parseMachineArgs(argv) {
|
|
|
17437
17243
|
if (values["--machine"] !== "execute") {
|
|
17438
17244
|
return { error: '--machine must be "execute".' };
|
|
17439
17245
|
}
|
|
17246
|
+
const authFd = parseReservedMachineFd(values["--machine-auth-fd"], MACHINE_AUTH_FD);
|
|
17247
|
+
if (authFd instanceof Error) return { error: authFd.message };
|
|
17248
|
+
const approvalFd = parseReservedMachineFd(
|
|
17249
|
+
values["--machine-approval-fd"],
|
|
17250
|
+
MACHINE_APPROVAL_FD
|
|
17251
|
+
);
|
|
17252
|
+
if (approvalFd instanceof Error) return { error: approvalFd.message };
|
|
17440
17253
|
return {
|
|
17441
|
-
operation: values["--operation"],
|
|
17442
|
-
phase: values["--phase"],
|
|
17443
|
-
inputJson: values["--input-json"]
|
|
17254
|
+
...values["--operation"] ? { operation: values["--operation"] } : {},
|
|
17255
|
+
...values["--phase"] ? { phase: values["--phase"] } : {},
|
|
17256
|
+
...values["--input-json"] ? { inputJson: values["--input-json"] } : {},
|
|
17257
|
+
...authFd !== void 0 ? { authFd } : {},
|
|
17258
|
+
...approvalFd !== void 0 ? { approvalFd } : {}
|
|
17444
17259
|
};
|
|
17445
17260
|
}
|
|
17261
|
+
function parseReservedMachineFd(value, expected) {
|
|
17262
|
+
if (value === void 0) return void 0;
|
|
17263
|
+
if (!/^\d+$/.test(value) || Number(value) !== expected) {
|
|
17264
|
+
return new Error(`The machine secret descriptor must be fd ${expected}.`);
|
|
17265
|
+
}
|
|
17266
|
+
return expected;
|
|
17267
|
+
}
|
|
17446
17268
|
async function readMachineInput(location) {
|
|
17447
17269
|
if (location !== "-") {
|
|
17448
17270
|
throw new Error('Machine input must be supplied with "--input-json -".');
|
|
17449
17271
|
}
|
|
17450
17272
|
let raw = "";
|
|
17273
|
+
let bytes = 0;
|
|
17451
17274
|
process.stdin.setEncoding("utf8");
|
|
17452
|
-
for await (const chunk of process.stdin)
|
|
17275
|
+
for await (const chunk of process.stdin) {
|
|
17276
|
+
const text = String(chunk);
|
|
17277
|
+
bytes += Buffer.byteLength(text, "utf8");
|
|
17278
|
+
if (bytes > MAX_MACHINE_INPUT_BYTES) {
|
|
17279
|
+
throw new Error(
|
|
17280
|
+
`Machine input exceeds the maximum size of ${MAX_MACHINE_INPUT_BYTES} bytes.`
|
|
17281
|
+
);
|
|
17282
|
+
}
|
|
17283
|
+
raw += text;
|
|
17284
|
+
}
|
|
17453
17285
|
if (!raw.trim()) throw new Error("Machine input JSON is required.");
|
|
17454
17286
|
const parsed = JSON.parse(raw);
|
|
17455
17287
|
if (!isPlainObject(parsed)) throw new Error("Machine input must be a JSON object.");
|
|
@@ -17470,11 +17302,20 @@ function normalizeInput(input) {
|
|
|
17470
17302
|
Object.keys(input).sort().map((key) => [key, input[key]])
|
|
17471
17303
|
);
|
|
17472
17304
|
}
|
|
17473
|
-
function
|
|
17474
|
-
|
|
17475
|
-
if (!raw) return null;
|
|
17305
|
+
function parseTrustedJsonFromFd(fd, predicate) {
|
|
17306
|
+
if (fd === void 0) return null;
|
|
17476
17307
|
try {
|
|
17477
|
-
const
|
|
17308
|
+
const chunks = [];
|
|
17309
|
+
const buffer = Buffer.allocUnsafe(8 * 1024);
|
|
17310
|
+
let bytes = 0;
|
|
17311
|
+
while (true) {
|
|
17312
|
+
const read = (0, import_node_fs5.readSync)(fd, buffer, 0, buffer.length, null);
|
|
17313
|
+
if (read === 0) break;
|
|
17314
|
+
bytes += read;
|
|
17315
|
+
if (bytes > MAX_MACHINE_SECRET_BYTES) return null;
|
|
17316
|
+
chunks.push(Buffer.from(buffer.subarray(0, read)));
|
|
17317
|
+
}
|
|
17318
|
+
const parsed = JSON.parse(Buffer.concat(chunks).toString("utf8"));
|
|
17478
17319
|
return predicate(parsed) ? parsed : null;
|
|
17479
17320
|
} catch {
|
|
17480
17321
|
return null;
|
|
@@ -17549,13 +17390,9 @@ function withTrustedMachineAuth(auth, callback) {
|
|
|
17549
17390
|
for (const key of Object.keys(process.env)) {
|
|
17550
17391
|
if (key.startsWith("WAVE_")) delete process.env[key];
|
|
17551
17392
|
}
|
|
17552
|
-
if (auth) {
|
|
17553
|
-
process.env.WAVE_API_TOKEN = auth.token;
|
|
17554
|
-
process.env.WAVE_API_BASE_URL = auth.baseUrl;
|
|
17555
|
-
}
|
|
17556
17393
|
process.env.WAVE_CLI_AUTH_STORAGE = "disabled";
|
|
17557
17394
|
process.env.WAVE_CLI_HOME = "/dev/null";
|
|
17558
|
-
return callback
|
|
17395
|
+
return withMachineRuntimeAuth(auth, callback).finally(() => {
|
|
17559
17396
|
for (const key of Object.keys(process.env)) {
|
|
17560
17397
|
if (key.startsWith("WAVE_")) delete process.env[key];
|
|
17561
17398
|
}
|
|
@@ -17707,7 +17544,7 @@ async function maybeRunMachineExecute(argv, program) {
|
|
|
17707
17544
|
})
|
|
17708
17545
|
});
|
|
17709
17546
|
}
|
|
17710
|
-
const auth =
|
|
17547
|
+
const auth = parseTrustedJsonFromFd(parsed.authFd, isTrustedAuth);
|
|
17711
17548
|
if (needsTrustedAuth(resolved.operation) && !auth) {
|
|
17712
17549
|
return printEnvelopeAndExit({
|
|
17713
17550
|
envelope: machineEnvelope({
|
|
@@ -17723,7 +17560,7 @@ async function maybeRunMachineExecute(argv, program) {
|
|
|
17723
17560
|
});
|
|
17724
17561
|
}
|
|
17725
17562
|
if (resolved.operation.classification === "write") {
|
|
17726
|
-
const approval =
|
|
17563
|
+
const approval = parseTrustedJsonFromFd(parsed.approvalFd, isTrustedApproval);
|
|
17727
17564
|
if (!approval || approval.operation !== resolved.operation.id || approval.inputDigest !== digest || approval.cliVersion !== manifest.cli.version || approval.registryDigest !== manifest.registryDigest || approval.organizationId !== auth?.organizationId || approval.actorId !== auth?.actorId) {
|
|
17728
17565
|
return printEnvelopeAndExit({
|
|
17729
17566
|
envelope: machineEnvelope({
|
|
@@ -17803,13 +17640,13 @@ main().catch((error) => {
|
|
|
17803
17640
|
});
|
|
17804
17641
|
return;
|
|
17805
17642
|
}
|
|
17806
|
-
if (error instanceof
|
|
17643
|
+
if (error instanceof import_zod21.ZodError || error instanceof import_commander2.InvalidArgumentError) {
|
|
17807
17644
|
printCliFailure({
|
|
17808
17645
|
status: 400,
|
|
17809
17646
|
code: "invalid_args",
|
|
17810
17647
|
message: "Invalid command arguments.",
|
|
17811
17648
|
details: {
|
|
17812
|
-
issues: error instanceof
|
|
17649
|
+
issues: error instanceof import_zod21.ZodError ? error.issues : [{ message: error.message, code: "invalid_argument" }]
|
|
17813
17650
|
},
|
|
17814
17651
|
exitCode: EXIT_CODES.invalidArgs
|
|
17815
17652
|
});
|