@letterstory/cli 0.177.95 → 0.177.96
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/lib/cli.mjs +4 -1
- package/lib/commands/goals.mjs +35 -0
- package/lib/commands/insights.mjs +1 -0
- package/lib/commands.mjs +2 -0
- package/lib/documents.mjs +1 -0
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -69,6 +69,7 @@ import {
|
|
|
69
69
|
cmdIdeas,
|
|
70
70
|
cmdPlan,
|
|
71
71
|
cmdMemory,
|
|
72
|
+
cmdGoals,
|
|
72
73
|
cmdSite,
|
|
73
74
|
cmdEvals,
|
|
74
75
|
cmdOfferings,
|
|
@@ -90,7 +91,7 @@ import {
|
|
|
90
91
|
import { fetchParkedSections, withoutParked } from "./parked.mjs";
|
|
91
92
|
|
|
92
93
|
// Matches cli/package.json; publish-cli.yml rewrites both to the published version.
|
|
93
|
-
export const VERSION = "0.177.
|
|
94
|
+
export const VERSION = "0.177.96";
|
|
94
95
|
|
|
95
96
|
/** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
|
|
96
97
|
export const EXIT_PAYMENT_REQUIRED = 3;
|
|
@@ -1880,6 +1881,7 @@ Insights:
|
|
|
1880
1881
|
plan strategies [--site host] [--archived] The goals typed on Ideas, each a strategy
|
|
1881
1882
|
plan strategy add "<words…>" [--site host] Keep a goal in your words as a strategy
|
|
1882
1883
|
plan strategy archive <strategy-id> [--restore] Put one away (its card leaves the Plan), or bring it back
|
|
1884
|
+
goals list|suggest|save|commit [goal] --host <host> Set up goals, save to Memory and commit intent JSON
|
|
1883
1885
|
memory ingest [--text|--text-file <path|->] [--link <url>]… [--include-website] [--mcp-url <url>] Push context to Memory: a reviewable proposal
|
|
1884
1886
|
memory apply <ingestion-id> --changes <id>,<id> Save the proposed changes you accept
|
|
1885
1887
|
memory add --section <id> --body <text> [--title] [--origin] File one entry in a custom memory section
|
|
@@ -2341,6 +2343,7 @@ const CLIENT_COMMANDS = {
|
|
|
2341
2343
|
ideas: cmdIdeas,
|
|
2342
2344
|
plan: cmdPlan,
|
|
2343
2345
|
memory: cmdMemory,
|
|
2346
|
+
goals: cmdGoals,
|
|
2344
2347
|
site: cmdSite,
|
|
2345
2348
|
evals: cmdEvals,
|
|
2346
2349
|
visits: cmdVisits,
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CliError } from "../client.mjs";
|
|
2
|
+
import { argsFromFlags, printResult, readTextInput, refuseUnknownFlags } from "./shared.mjs";
|
|
3
|
+
export const ARGS = {
|
|
4
|
+
get_goal_setups: { host: { flag: "host", required: true } },
|
|
5
|
+
suggest_goal_phrases: { host: { flag: "host", required: true }, goal: { positional: 0, required: true } },
|
|
6
|
+
save_goal_setup: {
|
|
7
|
+
host: { flag: "host", required: true },
|
|
8
|
+
goal: { positional: 0, required: true },
|
|
9
|
+
answers: {
|
|
10
|
+
value: (flags) => {
|
|
11
|
+
const raw = readTextInput(flags, "answers", "answers-file");
|
|
12
|
+
if (!raw) throw new CliError("Supply --answers or --answers-file");
|
|
13
|
+
try {
|
|
14
|
+
return JSON.parse(raw);
|
|
15
|
+
} catch {
|
|
16
|
+
throw new CliError("Answers must be JSON");
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
commit_goal_setup: { host: { flag: "host", required: true }, goal: { positional: 0, required: true } },
|
|
22
|
+
};
|
|
23
|
+
export async function cmdGoals(ctx) {
|
|
24
|
+
const tool = {
|
|
25
|
+
list: "get_goal_setups",
|
|
26
|
+
suggest: "suggest_goal_phrases",
|
|
27
|
+
save: "save_goal_setup",
|
|
28
|
+
commit: "commit_goal_setup",
|
|
29
|
+
}[ctx.positionals[0]];
|
|
30
|
+
if (!tool) throw new CliError("Usage: goals list|suggest|save|commit [goal] --host <host> [--answers-file <path>]");
|
|
31
|
+
refuseUnknownFlags(ctx, ARGS[tool], tool === "save_goal_setup" ? ["answers", "answers-file"] : []);
|
|
32
|
+
const args = argsFromFlags(ARGS[tool], ctx.flags, ctx.positionals.slice(1));
|
|
33
|
+
printResult(ctx.io, ctx.flags, await ctx.client.callTool(tool, args), (r) => JSON.stringify(r, null, 2));
|
|
34
|
+
return 0;
|
|
35
|
+
}
|
|
@@ -84,6 +84,7 @@ export const ARGS = {
|
|
|
84
84
|
question_key: { positional: 0, label: "question-key", required: true },
|
|
85
85
|
period: { flag: "period", enum: PERIODS },
|
|
86
86
|
filter: { flag: "filter", enum: ["all", "named_you", "rival_not_you", "no_one"] },
|
|
87
|
+
engine: { flag: "engine" },
|
|
87
88
|
limit: { flag: "limit", type: "num" },
|
|
88
89
|
},
|
|
89
90
|
};
|
package/lib/commands.mjs
CHANGED
package/lib/documents.mjs
CHANGED
|
@@ -81,6 +81,7 @@ export const DOCUMENT_FLAG_PAIRS = [
|
|
|
81
81
|
* lists, so a new `--x-file` flag cannot be added without answering "prose or JSON?".
|
|
82
82
|
*/
|
|
83
83
|
export const JSON_ARG_FLAG_PAIRS = [
|
|
84
|
+
["answers", "answers-file"],
|
|
84
85
|
// A build's explicit tool requirements and scopes (repo.mjs).
|
|
85
86
|
["tool-access", "tool-access-file"],
|
|
86
87
|
// A topic plan, or a whole saved proposal (onboard.mjs readTopicPlan).
|