@ted-galago/wave-cli 0.1.10 → 0.1.13
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 +22 -0
- package/dist/index.cjs +73 -20
- package/dist/index.js +73 -20
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -190,6 +190,28 @@ If a required parent field is missing, CLI returns JSON error with exit code `2`
|
|
|
190
190
|
- `content.member_id` is required.
|
|
191
191
|
- `content.type` is not required for create.
|
|
192
192
|
|
|
193
|
+
`knowledge.list` filter notes:
|
|
194
|
+
|
|
195
|
+
- `--assigned true` uses backend "assigned for current authenticated member" logic.
|
|
196
|
+
- `--assigned true` defaults to incomplete items only.
|
|
197
|
+
- CLI `knowledge list` does not currently expose an `include_completed` toggle.
|
|
198
|
+
- `--member-id` filters `contents.member_id` (owner/author), not assignment target.
|
|
199
|
+
- `--focus-member-id` filters `contents.focus_member_id` (focus scope), not assignment target.
|
|
200
|
+
- For manager/admin users, `--assigned true` may include creator-visible items with assignments, not only direct assignee matches.
|
|
201
|
+
|
|
202
|
+
Examples:
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
# Assigned to current authenticated member (incomplete only by default)
|
|
206
|
+
wave knowledge list --assigned true --page 1 --per 50
|
|
207
|
+
|
|
208
|
+
# Owner filter (not assignment target filter)
|
|
209
|
+
wave knowledge list --member-id 67 --page 1 --per 50
|
|
210
|
+
|
|
211
|
+
# Focus scope filter (not assignment target filter)
|
|
212
|
+
wave knowledge list --focus-member-id 67 --page 1 --per 50
|
|
213
|
+
```
|
|
214
|
+
|
|
193
215
|
`news.create` contract notes:
|
|
194
216
|
|
|
195
217
|
- Requires `headline.member_id`, `headline.status`, and `headline.headline_type`.
|
package/dist/index.cjs
CHANGED
|
@@ -91,10 +91,7 @@ function toOptionalNonEmpty(raw) {
|
|
|
91
91
|
const trimmed = raw.trim();
|
|
92
92
|
return trimmed.length > 0 ? trimmed : void 0;
|
|
93
93
|
}
|
|
94
|
-
function parseDebug(
|
|
95
|
-
if (typeof rawDebugOption === "boolean") {
|
|
96
|
-
return rawDebugOption;
|
|
97
|
-
}
|
|
94
|
+
function parseDebug(rawDebugEnv) {
|
|
98
95
|
if (!rawDebugEnv) {
|
|
99
96
|
return false;
|
|
100
97
|
}
|
|
@@ -124,7 +121,7 @@ function getConfig(options) {
|
|
|
124
121
|
baseUrl,
|
|
125
122
|
token,
|
|
126
123
|
timeoutMs: parseTimeoutMs(options.timeoutMs ?? process.env.WAVE_TIMEOUT_MS),
|
|
127
|
-
debug: parseDebug(
|
|
124
|
+
debug: parseDebug(process.env.WAVE_DEBUG),
|
|
128
125
|
agentName: toOptionalNonEmpty(options.agentName ?? process.env.WAVE_AGENT_NAME),
|
|
129
126
|
agentRunId: toOptionalNonEmpty(options.agentRunId ?? process.env.WAVE_AGENT_RUN_ID),
|
|
130
127
|
requestId: toOptionalNonEmpty(options.requestId ?? process.env.WAVE_REQUEST_ID),
|
|
@@ -726,6 +723,12 @@ async function graphqlRequest(input) {
|
|
|
726
723
|
var import_node_fs = require("fs");
|
|
727
724
|
var RETRYABLE_WRITE_CODES = /* @__PURE__ */ new Set(["EAGAIN", "EINTR"]);
|
|
728
725
|
var RETRY_BACKOFF_MS = 1;
|
|
726
|
+
var EnvelopeEmittedSignal = class extends Error {
|
|
727
|
+
constructor() {
|
|
728
|
+
super("wave_cli_envelope_emitted");
|
|
729
|
+
this.name = "EnvelopeEmittedSignal";
|
|
730
|
+
}
|
|
731
|
+
};
|
|
729
732
|
function sleepBriefly(ms) {
|
|
730
733
|
const lock = new Int32Array(new SharedArrayBuffer(4));
|
|
731
734
|
Atomics.wait(lock, 0, 0, ms);
|
|
@@ -758,7 +761,11 @@ function printEnvelope(envelope) {
|
|
|
758
761
|
}
|
|
759
762
|
function printEnvelopeAndExit(params) {
|
|
760
763
|
printEnvelope(params.envelope);
|
|
761
|
-
process.
|
|
764
|
+
process.exitCode = params.exitCode ?? EXIT_CODES.success;
|
|
765
|
+
throw new EnvelopeEmittedSignal();
|
|
766
|
+
}
|
|
767
|
+
function isEnvelopeEmittedSignal(error) {
|
|
768
|
+
return error instanceof EnvelopeEmittedSignal;
|
|
762
769
|
}
|
|
763
770
|
|
|
764
771
|
// src/commandRunner.ts
|
|
@@ -1400,8 +1407,11 @@ async function runGraphqlQueryCommand(input) {
|
|
|
1400
1407
|
}
|
|
1401
1408
|
printEnvelopeAndExit(result);
|
|
1402
1409
|
} catch (error) {
|
|
1410
|
+
if (isEnvelopeEmittedSignal(error)) {
|
|
1411
|
+
throw error;
|
|
1412
|
+
}
|
|
1403
1413
|
if (error instanceof CliError) {
|
|
1404
|
-
printEnvelopeAndExit({
|
|
1414
|
+
return printEnvelopeAndExit({
|
|
1405
1415
|
envelope: buildCliErrorEnvelope({
|
|
1406
1416
|
command: input.command,
|
|
1407
1417
|
status: error.status,
|
|
@@ -1413,7 +1423,7 @@ async function runGraphqlQueryCommand(input) {
|
|
|
1413
1423
|
});
|
|
1414
1424
|
}
|
|
1415
1425
|
const message = error instanceof Error ? error.message : "Unexpected error.";
|
|
1416
|
-
printEnvelopeAndExit({
|
|
1426
|
+
return printEnvelopeAndExit({
|
|
1417
1427
|
envelope: buildCliErrorEnvelope({
|
|
1418
1428
|
command: input.command,
|
|
1419
1429
|
status: 500,
|
|
@@ -1439,8 +1449,11 @@ async function runGraphqlMutationCommand(input) {
|
|
|
1439
1449
|
});
|
|
1440
1450
|
printEnvelopeAndExit(result);
|
|
1441
1451
|
} catch (error) {
|
|
1452
|
+
if (isEnvelopeEmittedSignal(error)) {
|
|
1453
|
+
throw error;
|
|
1454
|
+
}
|
|
1442
1455
|
if (error instanceof CliError) {
|
|
1443
|
-
printEnvelopeAndExit({
|
|
1456
|
+
return printEnvelopeAndExit({
|
|
1444
1457
|
envelope: buildCliErrorEnvelope({
|
|
1445
1458
|
command: input.command,
|
|
1446
1459
|
status: error.status,
|
|
@@ -1452,7 +1465,7 @@ async function runGraphqlMutationCommand(input) {
|
|
|
1452
1465
|
});
|
|
1453
1466
|
}
|
|
1454
1467
|
const message = error instanceof Error ? error.message : "Unexpected error.";
|
|
1455
|
-
printEnvelopeAndExit({
|
|
1468
|
+
return printEnvelopeAndExit({
|
|
1456
1469
|
envelope: buildCliErrorEnvelope({
|
|
1457
1470
|
command: input.command,
|
|
1458
1471
|
status: 500,
|
|
@@ -1562,11 +1575,7 @@ function resolveFromSources(options, stdin, env) {
|
|
|
1562
1575
|
normalize(env.WAVE_ORG_ID)
|
|
1563
1576
|
);
|
|
1564
1577
|
const timeoutMs = firstDefined(options.timeoutMs, stdin.timeoutMs, env.WAVE_TIMEOUT_MS);
|
|
1565
|
-
const debug =
|
|
1566
|
-
options.debug === true ? true : void 0,
|
|
1567
|
-
stdin.debug,
|
|
1568
|
-
parseBool(env.WAVE_DEBUG)
|
|
1569
|
-
);
|
|
1578
|
+
const debug = parseBool(env.WAVE_DEBUG);
|
|
1570
1579
|
const agentName = firstDefined(
|
|
1571
1580
|
normalize(options.agentName),
|
|
1572
1581
|
normalize(stdin.agentName),
|
|
@@ -2442,11 +2451,12 @@ function registerEntityCrudCommands(program, config) {
|
|
|
2442
2451
|
const updateHelp5 = buildDataJsonHelp(config.rootKey, "update") ?? "JSON object, optionally wrapped with root key";
|
|
2443
2452
|
const list = entityCommand.command("list").option("--page <page>").option("--per <per>");
|
|
2444
2453
|
const listParams = config.listParams ?? [];
|
|
2454
|
+
const listParamHelp = config.listParamHelp ?? {};
|
|
2445
2455
|
const showParams = config.showParams ?? [];
|
|
2446
2456
|
const allowQueryJson = config.allowQueryJson !== false;
|
|
2447
2457
|
listParams.forEach((param) => {
|
|
2448
2458
|
const cliParam = param.replace(/_/g, "-");
|
|
2449
|
-
list.option(`--${cliParam} <${cliParam}
|
|
2459
|
+
list.option(`--${cliParam} <${cliParam}>`, listParamHelp[param]);
|
|
2450
2460
|
});
|
|
2451
2461
|
if (allowQueryJson) {
|
|
2452
2462
|
list.option("--query-json <queryJson>", "Additional query params as JSON object");
|
|
@@ -3033,11 +3043,40 @@ var import_zod7 = require("zod");
|
|
|
3033
3043
|
var idSchema6 = import_zod7.z.string().min(1);
|
|
3034
3044
|
var createHelp3 = buildDataJsonHelp("member", "create") ?? 'JSON object for member or {"member": {...}}';
|
|
3035
3045
|
var updateHelp3 = buildDataJsonHelp("member", "update") ?? 'JSON object for member or {"member": {...}}';
|
|
3046
|
+
function parseStrictBooleanOption(value, optionName) {
|
|
3047
|
+
if (typeof value === "boolean") {
|
|
3048
|
+
return value;
|
|
3049
|
+
}
|
|
3050
|
+
if (typeof value === "string") {
|
|
3051
|
+
const lowered = value.trim().toLowerCase();
|
|
3052
|
+
if (lowered === "true") {
|
|
3053
|
+
return true;
|
|
3054
|
+
}
|
|
3055
|
+
if (lowered === "false") {
|
|
3056
|
+
return false;
|
|
3057
|
+
}
|
|
3058
|
+
}
|
|
3059
|
+
throw new CliError({
|
|
3060
|
+
message: `Invalid ${optionName} value. Use true or false.`,
|
|
3061
|
+
kind: "invalid_args",
|
|
3062
|
+
status: 400,
|
|
3063
|
+
exitCode: EXIT_CODES.invalidArgs,
|
|
3064
|
+
details: {
|
|
3065
|
+
option: optionName,
|
|
3066
|
+
value,
|
|
3067
|
+
allowed: ["true", "false"]
|
|
3068
|
+
}
|
|
3069
|
+
});
|
|
3070
|
+
}
|
|
3036
3071
|
function registerMemberCommands(program) {
|
|
3037
3072
|
const members = program.command("members").description("Member operations");
|
|
3038
|
-
members.command("list").option("--page <page>").option("--per <per>").
|
|
3073
|
+
members.command("list").option("--page <page>").option("--per <per>").option(
|
|
3074
|
+
"--include-coaches <includeCoaches>",
|
|
3075
|
+
"Include linked coach members. Defaults to false; omitted/false returns organization members only."
|
|
3076
|
+
).action(async (opts, cmd) => {
|
|
3039
3077
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
3040
3078
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
3079
|
+
const includeCoaches = opts.includeCoaches === void 0 ? void 0 : parseStrictBooleanOption(opts.includeCoaches, "--include-coaches");
|
|
3041
3080
|
await runGraphqlQueryCommand({
|
|
3042
3081
|
command: "members.list",
|
|
3043
3082
|
runtimeOptions: context.runtimeOptions,
|
|
@@ -3045,7 +3084,8 @@ function registerMemberCommands(program) {
|
|
|
3045
3084
|
variables: normalizeGraphqlVariables2({
|
|
3046
3085
|
organization_id: organizationId,
|
|
3047
3086
|
page: opts.page,
|
|
3048
|
-
per: opts.per
|
|
3087
|
+
per: opts.per,
|
|
3088
|
+
include_coaches: includeCoaches
|
|
3049
3089
|
}),
|
|
3050
3090
|
isList: true
|
|
3051
3091
|
});
|
|
@@ -3914,6 +3954,11 @@ function registerSystemToolCommands(program) {
|
|
|
3914
3954
|
"term",
|
|
3915
3955
|
"type"
|
|
3916
3956
|
],
|
|
3957
|
+
listParamHelp: {
|
|
3958
|
+
assigned: "Show assigned knowledge for the authenticated current member context (not a direct assignee-id filter).",
|
|
3959
|
+
member_id: "Filter by content owner/author (contents.member_id), not assignment target member.",
|
|
3960
|
+
focus_member_id: "Filter by focus scope (contents.focus_member_id), not assignment target member."
|
|
3961
|
+
},
|
|
3917
3962
|
showParams: ["include_all_rollups"],
|
|
3918
3963
|
allowQueryJson: false
|
|
3919
3964
|
});
|
|
@@ -6039,7 +6084,7 @@ function buildCli(options) {
|
|
|
6039
6084
|
).option(
|
|
6040
6085
|
"--organization-id <organizationId>",
|
|
6041
6086
|
"Organization ID (prefer WAVE_ORGANIZATION_ID env var)"
|
|
6042
|
-
).option("--timeout-ms <timeoutMs>", "HTTP timeout in milliseconds").option("--
|
|
6087
|
+
).option("--timeout-ms <timeoutMs>", "HTTP timeout in milliseconds").option("--agent-name <agentName>", "Agent name for tracing").option("--agent-run-id <agentRunId>", "Agent run identifier for tracing").option("--request-id <requestId>", "Request identifier").option(
|
|
6043
6088
|
"--openapi-path <openapiPath>",
|
|
6044
6089
|
"Optional local OpenAPI file path for contract-aware tooling"
|
|
6045
6090
|
).option(
|
|
@@ -6093,6 +6138,9 @@ async function main() {
|
|
|
6093
6138
|
await program.parseAsync(process.argv);
|
|
6094
6139
|
}
|
|
6095
6140
|
main().catch((error) => {
|
|
6141
|
+
if (isEnvelopeEmittedSignal(error)) {
|
|
6142
|
+
return;
|
|
6143
|
+
}
|
|
6096
6144
|
if (error instanceof CliError) {
|
|
6097
6145
|
printCliFailure({
|
|
6098
6146
|
status: error.status,
|
|
@@ -6101,10 +6149,12 @@ main().catch((error) => {
|
|
|
6101
6149
|
details: error.details,
|
|
6102
6150
|
exitCode: error.exitCode
|
|
6103
6151
|
});
|
|
6152
|
+
return;
|
|
6104
6153
|
}
|
|
6105
6154
|
if (error instanceof import_commander2.CommanderError) {
|
|
6106
6155
|
if (error.code === "commander.helpDisplayed" || error.code === "commander.version") {
|
|
6107
|
-
process.
|
|
6156
|
+
process.exitCode = EXIT_CODES.success;
|
|
6157
|
+
return;
|
|
6108
6158
|
}
|
|
6109
6159
|
printCliFailure({
|
|
6110
6160
|
status: 400,
|
|
@@ -6112,6 +6162,7 @@ main().catch((error) => {
|
|
|
6112
6162
|
message: error.message,
|
|
6113
6163
|
exitCode: EXIT_CODES.invalidArgs
|
|
6114
6164
|
});
|
|
6165
|
+
return;
|
|
6115
6166
|
}
|
|
6116
6167
|
if (error instanceof import_zod16.ZodError || error instanceof import_commander2.InvalidArgumentError) {
|
|
6117
6168
|
printCliFailure({
|
|
@@ -6123,6 +6174,7 @@ main().catch((error) => {
|
|
|
6123
6174
|
},
|
|
6124
6175
|
exitCode: EXIT_CODES.invalidArgs
|
|
6125
6176
|
});
|
|
6177
|
+
return;
|
|
6126
6178
|
}
|
|
6127
6179
|
const message = error instanceof Error ? error.message : "Unexpected error.";
|
|
6128
6180
|
printCliFailure({
|
|
@@ -6131,4 +6183,5 @@ main().catch((error) => {
|
|
|
6131
6183
|
message,
|
|
6132
6184
|
exitCode: EXIT_CODES.generic
|
|
6133
6185
|
});
|
|
6186
|
+
return;
|
|
6134
6187
|
});
|
package/dist/index.js
CHANGED
|
@@ -90,10 +90,7 @@ function toOptionalNonEmpty(raw) {
|
|
|
90
90
|
const trimmed = raw.trim();
|
|
91
91
|
return trimmed.length > 0 ? trimmed : void 0;
|
|
92
92
|
}
|
|
93
|
-
function parseDebug(
|
|
94
|
-
if (typeof rawDebugOption === "boolean") {
|
|
95
|
-
return rawDebugOption;
|
|
96
|
-
}
|
|
93
|
+
function parseDebug(rawDebugEnv) {
|
|
97
94
|
if (!rawDebugEnv) {
|
|
98
95
|
return false;
|
|
99
96
|
}
|
|
@@ -123,7 +120,7 @@ function getConfig(options) {
|
|
|
123
120
|
baseUrl,
|
|
124
121
|
token,
|
|
125
122
|
timeoutMs: parseTimeoutMs(options.timeoutMs ?? process.env.WAVE_TIMEOUT_MS),
|
|
126
|
-
debug: parseDebug(
|
|
123
|
+
debug: parseDebug(process.env.WAVE_DEBUG),
|
|
127
124
|
agentName: toOptionalNonEmpty(options.agentName ?? process.env.WAVE_AGENT_NAME),
|
|
128
125
|
agentRunId: toOptionalNonEmpty(options.agentRunId ?? process.env.WAVE_AGENT_RUN_ID),
|
|
129
126
|
requestId: toOptionalNonEmpty(options.requestId ?? process.env.WAVE_REQUEST_ID),
|
|
@@ -725,6 +722,12 @@ async function graphqlRequest(input) {
|
|
|
725
722
|
import { writeSync } from "fs";
|
|
726
723
|
var RETRYABLE_WRITE_CODES = /* @__PURE__ */ new Set(["EAGAIN", "EINTR"]);
|
|
727
724
|
var RETRY_BACKOFF_MS = 1;
|
|
725
|
+
var EnvelopeEmittedSignal = class extends Error {
|
|
726
|
+
constructor() {
|
|
727
|
+
super("wave_cli_envelope_emitted");
|
|
728
|
+
this.name = "EnvelopeEmittedSignal";
|
|
729
|
+
}
|
|
730
|
+
};
|
|
728
731
|
function sleepBriefly(ms) {
|
|
729
732
|
const lock = new Int32Array(new SharedArrayBuffer(4));
|
|
730
733
|
Atomics.wait(lock, 0, 0, ms);
|
|
@@ -757,7 +760,11 @@ function printEnvelope(envelope) {
|
|
|
757
760
|
}
|
|
758
761
|
function printEnvelopeAndExit(params) {
|
|
759
762
|
printEnvelope(params.envelope);
|
|
760
|
-
process.
|
|
763
|
+
process.exitCode = params.exitCode ?? EXIT_CODES.success;
|
|
764
|
+
throw new EnvelopeEmittedSignal();
|
|
765
|
+
}
|
|
766
|
+
function isEnvelopeEmittedSignal(error) {
|
|
767
|
+
return error instanceof EnvelopeEmittedSignal;
|
|
761
768
|
}
|
|
762
769
|
|
|
763
770
|
// src/commandRunner.ts
|
|
@@ -1399,8 +1406,11 @@ async function runGraphqlQueryCommand(input) {
|
|
|
1399
1406
|
}
|
|
1400
1407
|
printEnvelopeAndExit(result);
|
|
1401
1408
|
} catch (error) {
|
|
1409
|
+
if (isEnvelopeEmittedSignal(error)) {
|
|
1410
|
+
throw error;
|
|
1411
|
+
}
|
|
1402
1412
|
if (error instanceof CliError) {
|
|
1403
|
-
printEnvelopeAndExit({
|
|
1413
|
+
return printEnvelopeAndExit({
|
|
1404
1414
|
envelope: buildCliErrorEnvelope({
|
|
1405
1415
|
command: input.command,
|
|
1406
1416
|
status: error.status,
|
|
@@ -1412,7 +1422,7 @@ async function runGraphqlQueryCommand(input) {
|
|
|
1412
1422
|
});
|
|
1413
1423
|
}
|
|
1414
1424
|
const message = error instanceof Error ? error.message : "Unexpected error.";
|
|
1415
|
-
printEnvelopeAndExit({
|
|
1425
|
+
return printEnvelopeAndExit({
|
|
1416
1426
|
envelope: buildCliErrorEnvelope({
|
|
1417
1427
|
command: input.command,
|
|
1418
1428
|
status: 500,
|
|
@@ -1438,8 +1448,11 @@ async function runGraphqlMutationCommand(input) {
|
|
|
1438
1448
|
});
|
|
1439
1449
|
printEnvelopeAndExit(result);
|
|
1440
1450
|
} catch (error) {
|
|
1451
|
+
if (isEnvelopeEmittedSignal(error)) {
|
|
1452
|
+
throw error;
|
|
1453
|
+
}
|
|
1441
1454
|
if (error instanceof CliError) {
|
|
1442
|
-
printEnvelopeAndExit({
|
|
1455
|
+
return printEnvelopeAndExit({
|
|
1443
1456
|
envelope: buildCliErrorEnvelope({
|
|
1444
1457
|
command: input.command,
|
|
1445
1458
|
status: error.status,
|
|
@@ -1451,7 +1464,7 @@ async function runGraphqlMutationCommand(input) {
|
|
|
1451
1464
|
});
|
|
1452
1465
|
}
|
|
1453
1466
|
const message = error instanceof Error ? error.message : "Unexpected error.";
|
|
1454
|
-
printEnvelopeAndExit({
|
|
1467
|
+
return printEnvelopeAndExit({
|
|
1455
1468
|
envelope: buildCliErrorEnvelope({
|
|
1456
1469
|
command: input.command,
|
|
1457
1470
|
status: 500,
|
|
@@ -1561,11 +1574,7 @@ function resolveFromSources(options, stdin, env) {
|
|
|
1561
1574
|
normalize(env.WAVE_ORG_ID)
|
|
1562
1575
|
);
|
|
1563
1576
|
const timeoutMs = firstDefined(options.timeoutMs, stdin.timeoutMs, env.WAVE_TIMEOUT_MS);
|
|
1564
|
-
const debug =
|
|
1565
|
-
options.debug === true ? true : void 0,
|
|
1566
|
-
stdin.debug,
|
|
1567
|
-
parseBool(env.WAVE_DEBUG)
|
|
1568
|
-
);
|
|
1577
|
+
const debug = parseBool(env.WAVE_DEBUG);
|
|
1569
1578
|
const agentName = firstDefined(
|
|
1570
1579
|
normalize(options.agentName),
|
|
1571
1580
|
normalize(stdin.agentName),
|
|
@@ -2441,11 +2450,12 @@ function registerEntityCrudCommands(program, config) {
|
|
|
2441
2450
|
const updateHelp5 = buildDataJsonHelp(config.rootKey, "update") ?? "JSON object, optionally wrapped with root key";
|
|
2442
2451
|
const list = entityCommand.command("list").option("--page <page>").option("--per <per>");
|
|
2443
2452
|
const listParams = config.listParams ?? [];
|
|
2453
|
+
const listParamHelp = config.listParamHelp ?? {};
|
|
2444
2454
|
const showParams = config.showParams ?? [];
|
|
2445
2455
|
const allowQueryJson = config.allowQueryJson !== false;
|
|
2446
2456
|
listParams.forEach((param) => {
|
|
2447
2457
|
const cliParam = param.replace(/_/g, "-");
|
|
2448
|
-
list.option(`--${cliParam} <${cliParam}
|
|
2458
|
+
list.option(`--${cliParam} <${cliParam}>`, listParamHelp[param]);
|
|
2449
2459
|
});
|
|
2450
2460
|
if (allowQueryJson) {
|
|
2451
2461
|
list.option("--query-json <queryJson>", "Additional query params as JSON object");
|
|
@@ -3032,11 +3042,40 @@ import { z as z7 } from "zod";
|
|
|
3032
3042
|
var idSchema6 = z7.string().min(1);
|
|
3033
3043
|
var createHelp3 = buildDataJsonHelp("member", "create") ?? 'JSON object for member or {"member": {...}}';
|
|
3034
3044
|
var updateHelp3 = buildDataJsonHelp("member", "update") ?? 'JSON object for member or {"member": {...}}';
|
|
3045
|
+
function parseStrictBooleanOption(value, optionName) {
|
|
3046
|
+
if (typeof value === "boolean") {
|
|
3047
|
+
return value;
|
|
3048
|
+
}
|
|
3049
|
+
if (typeof value === "string") {
|
|
3050
|
+
const lowered = value.trim().toLowerCase();
|
|
3051
|
+
if (lowered === "true") {
|
|
3052
|
+
return true;
|
|
3053
|
+
}
|
|
3054
|
+
if (lowered === "false") {
|
|
3055
|
+
return false;
|
|
3056
|
+
}
|
|
3057
|
+
}
|
|
3058
|
+
throw new CliError({
|
|
3059
|
+
message: `Invalid ${optionName} value. Use true or false.`,
|
|
3060
|
+
kind: "invalid_args",
|
|
3061
|
+
status: 400,
|
|
3062
|
+
exitCode: EXIT_CODES.invalidArgs,
|
|
3063
|
+
details: {
|
|
3064
|
+
option: optionName,
|
|
3065
|
+
value,
|
|
3066
|
+
allowed: ["true", "false"]
|
|
3067
|
+
}
|
|
3068
|
+
});
|
|
3069
|
+
}
|
|
3035
3070
|
function registerMemberCommands(program) {
|
|
3036
3071
|
const members = program.command("members").description("Member operations");
|
|
3037
|
-
members.command("list").option("--page <page>").option("--per <per>").
|
|
3072
|
+
members.command("list").option("--page <page>").option("--per <per>").option(
|
|
3073
|
+
"--include-coaches <includeCoaches>",
|
|
3074
|
+
"Include linked coach members. Defaults to false; omitted/false returns organization members only."
|
|
3075
|
+
).action(async (opts, cmd) => {
|
|
3038
3076
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
3039
3077
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
3078
|
+
const includeCoaches = opts.includeCoaches === void 0 ? void 0 : parseStrictBooleanOption(opts.includeCoaches, "--include-coaches");
|
|
3040
3079
|
await runGraphqlQueryCommand({
|
|
3041
3080
|
command: "members.list",
|
|
3042
3081
|
runtimeOptions: context.runtimeOptions,
|
|
@@ -3044,7 +3083,8 @@ function registerMemberCommands(program) {
|
|
|
3044
3083
|
variables: normalizeGraphqlVariables2({
|
|
3045
3084
|
organization_id: organizationId,
|
|
3046
3085
|
page: opts.page,
|
|
3047
|
-
per: opts.per
|
|
3086
|
+
per: opts.per,
|
|
3087
|
+
include_coaches: includeCoaches
|
|
3048
3088
|
}),
|
|
3049
3089
|
isList: true
|
|
3050
3090
|
});
|
|
@@ -3913,6 +3953,11 @@ function registerSystemToolCommands(program) {
|
|
|
3913
3953
|
"term",
|
|
3914
3954
|
"type"
|
|
3915
3955
|
],
|
|
3956
|
+
listParamHelp: {
|
|
3957
|
+
assigned: "Show assigned knowledge for the authenticated current member context (not a direct assignee-id filter).",
|
|
3958
|
+
member_id: "Filter by content owner/author (contents.member_id), not assignment target member.",
|
|
3959
|
+
focus_member_id: "Filter by focus scope (contents.focus_member_id), not assignment target member."
|
|
3960
|
+
},
|
|
3916
3961
|
showParams: ["include_all_rollups"],
|
|
3917
3962
|
allowQueryJson: false
|
|
3918
3963
|
});
|
|
@@ -6038,7 +6083,7 @@ function buildCli(options) {
|
|
|
6038
6083
|
).option(
|
|
6039
6084
|
"--organization-id <organizationId>",
|
|
6040
6085
|
"Organization ID (prefer WAVE_ORGANIZATION_ID env var)"
|
|
6041
|
-
).option("--timeout-ms <timeoutMs>", "HTTP timeout in milliseconds").option("--
|
|
6086
|
+
).option("--timeout-ms <timeoutMs>", "HTTP timeout in milliseconds").option("--agent-name <agentName>", "Agent name for tracing").option("--agent-run-id <agentRunId>", "Agent run identifier for tracing").option("--request-id <requestId>", "Request identifier").option(
|
|
6042
6087
|
"--openapi-path <openapiPath>",
|
|
6043
6088
|
"Optional local OpenAPI file path for contract-aware tooling"
|
|
6044
6089
|
).option(
|
|
@@ -6092,6 +6137,9 @@ async function main() {
|
|
|
6092
6137
|
await program.parseAsync(process.argv);
|
|
6093
6138
|
}
|
|
6094
6139
|
main().catch((error) => {
|
|
6140
|
+
if (isEnvelopeEmittedSignal(error)) {
|
|
6141
|
+
return;
|
|
6142
|
+
}
|
|
6095
6143
|
if (error instanceof CliError) {
|
|
6096
6144
|
printCliFailure({
|
|
6097
6145
|
status: error.status,
|
|
@@ -6100,10 +6148,12 @@ main().catch((error) => {
|
|
|
6100
6148
|
details: error.details,
|
|
6101
6149
|
exitCode: error.exitCode
|
|
6102
6150
|
});
|
|
6151
|
+
return;
|
|
6103
6152
|
}
|
|
6104
6153
|
if (error instanceof CommanderError) {
|
|
6105
6154
|
if (error.code === "commander.helpDisplayed" || error.code === "commander.version") {
|
|
6106
|
-
process.
|
|
6155
|
+
process.exitCode = EXIT_CODES.success;
|
|
6156
|
+
return;
|
|
6107
6157
|
}
|
|
6108
6158
|
printCliFailure({
|
|
6109
6159
|
status: 400,
|
|
@@ -6111,6 +6161,7 @@ main().catch((error) => {
|
|
|
6111
6161
|
message: error.message,
|
|
6112
6162
|
exitCode: EXIT_CODES.invalidArgs
|
|
6113
6163
|
});
|
|
6164
|
+
return;
|
|
6114
6165
|
}
|
|
6115
6166
|
if (error instanceof ZodError || error instanceof InvalidArgumentError) {
|
|
6116
6167
|
printCliFailure({
|
|
@@ -6122,6 +6173,7 @@ main().catch((error) => {
|
|
|
6122
6173
|
},
|
|
6123
6174
|
exitCode: EXIT_CODES.invalidArgs
|
|
6124
6175
|
});
|
|
6176
|
+
return;
|
|
6125
6177
|
}
|
|
6126
6178
|
const message = error instanceof Error ? error.message : "Unexpected error.";
|
|
6127
6179
|
printCliFailure({
|
|
@@ -6130,4 +6182,5 @@ main().catch((error) => {
|
|
|
6130
6182
|
message,
|
|
6131
6183
|
exitCode: EXIT_CODES.generic
|
|
6132
6184
|
});
|
|
6185
|
+
return;
|
|
6133
6186
|
});
|