@standards/cli 1.0.0-alpha.431 → 1.0.0-alpha.434
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.mjs +8 -9
- package/guide/agents.md +1 -1
- package/package.json +4 -4
package/dist/bin.mjs
CHANGED
|
@@ -486,6 +486,7 @@ function questionsOf(decision) {
|
|
|
486
486
|
return [{
|
|
487
487
|
id: entry.id,
|
|
488
488
|
question: typeof entry.question === "string" ? entry.question : "",
|
|
489
|
+
...typeof entry.context === "string" && entry.context.trim() !== "" ? { context: entry.context.trim() } : {},
|
|
489
490
|
multiSelect: entry.multiSelect === true,
|
|
490
491
|
options: Array.isArray(entry.options) ? entry.options.filter(isOption) : []
|
|
491
492
|
}];
|
|
@@ -525,14 +526,13 @@ function decisionUrl(cmd, decision) {
|
|
|
525
526
|
const sessionId = sessionIdOf(decision);
|
|
526
527
|
return sessionId ? conversationUrl(cmd, sessionId) : appUrl(cmd);
|
|
527
528
|
}
|
|
528
|
-
/** A decision as one block of text: title,
|
|
529
|
+
/** A decision as one block of text: title, each question with its context and numbered options, setup commands. */
|
|
529
530
|
function renderDecision(decision) {
|
|
530
531
|
const lines = [`${decision.title} (${decision.type}, ${decision.id})`];
|
|
531
|
-
if (decision.why) lines.push(` why: ${decision.why}`);
|
|
532
|
-
if (decision.change) lines.push(` change: ${decision.change}`);
|
|
533
532
|
for (const [index, question] of questionsOf(decision).entries()) {
|
|
534
533
|
const multi = question.multiSelect ? " (several: 1,3)" : "";
|
|
535
534
|
lines.push(` Q${index + 1}. ${question.question}${multi}`);
|
|
535
|
+
if (question.context) lines.push(` ${question.context}`);
|
|
536
536
|
for (const option of numberedOptions(question)) lines.push(` ${option}`);
|
|
537
537
|
}
|
|
538
538
|
for (const variable of setupVariablesOf(decision)) lines.push(` ${variable.label}: ${secretCommand(variable)}`);
|
|
@@ -550,6 +550,7 @@ function summarizeDecision$1(decision) {
|
|
|
550
550
|
questions: questionsOf(decision).map((question) => ({
|
|
551
551
|
id: question.id,
|
|
552
552
|
question: question.question,
|
|
553
|
+
...question.context && { context: question.context },
|
|
553
554
|
...question.multiSelect && { multiSelect: true },
|
|
554
555
|
options: numberedOptions(question)
|
|
555
556
|
}))
|
|
@@ -558,8 +559,6 @@ function summarizeDecision$1(decision) {
|
|
|
558
559
|
function describeDecision(cmd, decision) {
|
|
559
560
|
return {
|
|
560
561
|
...summarizeDecision$1(decision),
|
|
561
|
-
why: decision.why ?? null,
|
|
562
|
-
change: decision.change ?? null,
|
|
563
562
|
links: decision.links.map(formatDecisionLink),
|
|
564
563
|
setup: setupVariablesOf(decision).map((variable) => ({
|
|
565
564
|
key: variable.key,
|
|
@@ -663,7 +662,7 @@ function registerDecisionsCommand(program) {
|
|
|
663
662
|
decisions.command("list").description("List open decisions, options numbered from 1").option("--all", "every decision not archived, answered ones included").action(async (opts, cmd) => {
|
|
664
663
|
formatOutput((await readDecisions(getAppClientFromCommand(cmd), opts.all ? void 0 : "open")).map(summarizeDecision$1), getFormat(cmd));
|
|
665
664
|
});
|
|
666
|
-
decisions.command("show").description("Show a decision:
|
|
665
|
+
decisions.command("show").description("Show a decision: its questions with their context, numbered options, links, setup commands").argument("<id>", "decision id").action(async (id, _opts, cmd) => {
|
|
667
666
|
formatOutput(describeDecision(cmd, await findDecision(getAppClientFromCommand(cmd), id)), getFormat(cmd));
|
|
668
667
|
});
|
|
669
668
|
decisions.command("answer").description("Answer a decision: yes/no, an option number or label per question, changes, continue/skip, configure").argument("<id>", "decision id").argument("[answer...]", "the answer, one per question for a question").option("--reason <reason>", "why, with an approval").option("--feedback <feedback>", "what to change, with a review's changes").option("--skip", "skip every question").action(async (id, args, flags, cmd) => {
|
|
@@ -1904,7 +1903,7 @@ async function deleteSecret(client, owner, key) {
|
|
|
1904
1903
|
function stripped(result) {
|
|
1905
1904
|
return Array.isArray(result) ? result.map(withoutValue) : withoutValue(result);
|
|
1906
1905
|
}
|
|
1907
|
-
/** A workspace secret
|
|
1906
|
+
/** A workspace secret no environment lists yet; an update keeps the environments that list it. */
|
|
1908
1907
|
function reachesNoEnvironment(result) {
|
|
1909
1908
|
if (Array.isArray(result)) return false;
|
|
1910
1909
|
const { environments } = result;
|
|
@@ -1917,7 +1916,7 @@ function registerSecretsCommand(program) {
|
|
|
1917
1916
|
const client = getAppClientFromCommand(cmd);
|
|
1918
1917
|
formatOutput((await listOwnerSecrets(client, await resolveOwner(client, opts))).map(withoutValue), getFormat(cmd));
|
|
1919
1918
|
});
|
|
1920
|
-
secrets.command("set").description("Set a secret from piped stdin: printf %s \"$VALUE\" | standards secrets set KEY").argument("<KEY>", "secret key").allowExcessArguments(false).option("--private", "your own secret").option("--env <env>", "an environment's secret (name or id)").option("--repository <owner/name>", "scope an environment's secret to one repository").option("--environments <env,…|all>", "the environments a new workspace secret
|
|
1919
|
+
secrets.command("set").description("Set a secret from piped stdin: printf %s \"$VALUE\" | standards secrets set KEY").argument("<KEY>", "secret key").allowExcessArguments(false).option("--private", "your own secret").option("--env <env>", "an environment's secret (name or id)").option("--repository <owner/name>", "scope an environment's secret to one repository").option("--environments <env,…|all>", "the environments that list a new workspace secret (all: every current one)").option("--plain", "store it as non-sensitive").action(async (key, opts, cmd) => {
|
|
1921
1920
|
checkOwnerFlags(opts);
|
|
1922
1921
|
if (opts.environments !== void 0 && (opts.private || opts.env)) throw new ValidationError("--environments only applies to a workspace secret", []);
|
|
1923
1922
|
const value = await readPipedValue(`secrets set ${key}`);
|
|
@@ -1929,7 +1928,7 @@ function registerSecretsCommand(program) {
|
|
|
1929
1928
|
isSensitive: !opts.plain
|
|
1930
1929
|
}, opts.environments);
|
|
1931
1930
|
formatOutput(stripped(result), getFormat(cmd));
|
|
1932
|
-
if (owner.kind === "workspace" && reachesNoEnvironment(result)) process.stderr.write("
|
|
1931
|
+
if (owner.kind === "workspace" && reachesNoEnvironment(result)) process.stderr.write("Used by no environment yet: re-run with --environments <env,…|all> (all = every current environment)\n");
|
|
1933
1932
|
});
|
|
1934
1933
|
secrets.command("delete").description("Delete a secret").argument("<KEY>", "secret key").option("--private", "your own secret").option("--env <env>", "an environment's secret (name or id)").option("--repository <owner/name>", "the repository's value of an environment's secret").option("--yes", "delete without confirmation").action(async (key, opts, cmd) => {
|
|
1935
1934
|
checkOwnerFlags(opts);
|
package/guide/agents.md
CHANGED
|
@@ -84,7 +84,7 @@ standards sessions archive <id>
|
|
|
84
84
|
|
|
85
85
|
```bash
|
|
86
86
|
standards decisions list [--all] # open by default; options numbered from 1
|
|
87
|
-
standards decisions show <id> # title,
|
|
87
|
+
standards decisions show <id> # title, each question with its context, links
|
|
88
88
|
standards decisions answer <id> …
|
|
89
89
|
```
|
|
90
90
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@standards/cli",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.434",
|
|
4
4
|
"description": "CLI tool to interact with Standards API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"node": ">=22"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@standards/client": "1.0.0-alpha.
|
|
28
|
-
"@standards/constants": "1.0.0-alpha.
|
|
29
|
-
"@standards/schema": "1.0.0-alpha.
|
|
27
|
+
"@standards/client": "1.0.0-alpha.434",
|
|
28
|
+
"@standards/constants": "1.0.0-alpha.434",
|
|
29
|
+
"@standards/schema": "1.0.0-alpha.434",
|
|
30
30
|
"cli-table3": "^0.6.5",
|
|
31
31
|
"commander": "^13.1.0",
|
|
32
32
|
"jiti": "2.7.0",
|