recess-cli 1.9.2 → 2.0.0
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 +82 -55
- package/dist/api.js +42 -10
- package/dist/args.js +12 -1
- package/dist/auth.js +11 -10
- package/dist/cli.js +1190 -245
- package/dist/command-schema.js +257 -0
- package/dist/config.js +116 -19
- package/dist/delivery.js +26 -0
- package/dist/feedback.js +64 -0
- package/dist/http.js +25 -0
- package/dist/index.js +15 -3
- package/dist/jobs.js +80 -0
- package/dist/skill-update.js +2 -1
- package/dist/ui/index.js +2 -1
- package/package.json +1 -1
- package/skill/recess-cli/SKILL.md +18 -8
- package/skill/recess-cli/agents/version.json +2 -2
package/dist/skill-update.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import fs from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
+
import { cliRequestHeaders } from "./http.js";
|
|
3
4
|
import { skillDestinations } from "./setup.js";
|
|
4
5
|
/**
|
|
5
6
|
* Compare dotted numeric versions. Deliberately hand-rolled rather than adding a
|
|
@@ -88,7 +89,7 @@ export async function updateSkillFromServer(input) {
|
|
|
88
89
|
let bundle;
|
|
89
90
|
try {
|
|
90
91
|
const response = await fetch(new URL("/auth/admin-cli/skill/", input.apiOrigin), {
|
|
91
|
-
headers: input.sessionCookie ? { cookie: input.sessionCookie } :
|
|
92
|
+
headers: cliRequestHeaders(input.sessionCookie ? { cookie: input.sessionCookie } : undefined, input.reason),
|
|
92
93
|
signal: AbortSignal.timeout(10_000),
|
|
93
94
|
});
|
|
94
95
|
if (!response.ok) {
|
package/dist/ui/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import { render } from "ink";
|
|
|
3
3
|
import { RecessAdminApi } from "../api.js";
|
|
4
4
|
import { resolveConfig } from "../config.js";
|
|
5
5
|
import { CliError } from "../errors.js";
|
|
6
|
+
import { RECESS_CLIENT_CLI_UI } from "../http.js";
|
|
6
7
|
import { App } from "./app.js";
|
|
7
8
|
/**
|
|
8
9
|
* The interactive console. Kept off the JSON path on purpose: agents parse
|
|
@@ -14,7 +15,7 @@ export async function runUi() {
|
|
|
14
15
|
if (!config.sessionCookie) {
|
|
15
16
|
throw new CliError("auth_required", "No Recess CLI session found. Run `recess auth login`.");
|
|
16
17
|
}
|
|
17
|
-
const api = new RecessAdminApi(config);
|
|
18
|
+
const api = new RecessAdminApi(config, undefined, RECESS_CLIENT_CLI_UI);
|
|
18
19
|
const instance = render(_jsx(App, { api: api }));
|
|
19
20
|
await instance.waitUntilExit();
|
|
20
21
|
}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@ Use the installed `recess` command for Recess work. This small skill is shared b
|
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
13
|
command -v recess
|
|
14
|
-
recess --json doctor
|
|
14
|
+
recess --json doctor --reason "Verify CLI connectivity, identity, and scope"
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
`doctor` reports the active API origin, authenticated user, and CLI scope. Do not assume a role from the request. Use the scope returned by the server.
|
|
@@ -20,17 +20,19 @@ Then load the guidance for the purpose of the work:
|
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
22
|
# Parent or guardian work: kids, schedules, goals, todos, progress, memory, Rocky
|
|
23
|
-
recess --json skills guardian get recess-family --all-references
|
|
23
|
+
recess --json skills guardian get recess-family --all-references --reason "Load family workflow guidance"
|
|
24
24
|
|
|
25
25
|
# Research, author, validate, or apply a goal or reusable goal template
|
|
26
|
-
recess --json skills guardian get recess-goal-authoring --all-references
|
|
26
|
+
recess --json skills guardian get recess-goal-authoring --all-references --reason "Load goal authoring guidance"
|
|
27
27
|
|
|
28
28
|
# Staff-only school operations
|
|
29
|
-
recess --json skills admin get recess-admin --all-references
|
|
29
|
+
recess --json skills admin get recess-admin --all-references --reason "Load staff operations guidance"
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
Use `skills guardian list` or `skills admin list` when the needed skill is not obvious. Never substitute one audience for the other. A guardian session cannot fetch the admin catalog; an admin may fetch either catalog.
|
|
33
33
|
|
|
34
|
+
For machine-readable discovery, use `recess --json agent-context`; for a smaller syntax surface, use `recess --json help <noun> [verb]`. Unknown commands, flags, duplicate non-repeatable flags, missing flag values, and extra positional arguments fail explicitly.
|
|
35
|
+
|
|
34
36
|
## Authentication
|
|
35
37
|
|
|
36
38
|
- Workstation: `recess --json auth login` opens Recess SSO.
|
|
@@ -49,23 +51,31 @@ Always pass `--json`. Stdout contains one object:
|
|
|
49
51
|
- Failure: `{"ok":false,"error":{"code":"...","message":"...","details":{...}}}`, exit 1.
|
|
50
52
|
- Write awaiting approval: `confirmation_required`, exit 2, with `details.preview` and `details.requiredFlag`.
|
|
51
53
|
|
|
54
|
+
Every command-driven Recess API call except `auth` requires `--reason "..."`: a specific,
|
|
55
|
+
human-readable purpose from 1 to 1024 characters. The server records it in the CLI request audit
|
|
56
|
+
ledger. Reuse the invocation's same reason across its preflight and execution requests. The
|
|
57
|
+
human-only `recess ui` console is exempt.
|
|
58
|
+
|
|
52
59
|
Every write is two-step:
|
|
53
60
|
|
|
54
61
|
1. Run without `--confirm`.
|
|
55
62
|
2. Show the human the complete preview, including `preview.details`.
|
|
56
63
|
3. Ask for explicit approval of that exact action.
|
|
57
|
-
4. Rerun the unchanged command with `--confirm
|
|
64
|
+
4. Rerun the unchanged command with `--confirm --operation-key <operationKey>`. If the preview includes an `approvalToken`, pass it unchanged too.
|
|
58
65
|
|
|
59
|
-
Any changed target, payload, local file, server revision, amount, recipient, or consequence requires a new preview and new approval. Never infer approval from the original request.
|
|
66
|
+
Any changed target, payload, local file, server revision, amount, recipient, or consequence requires a new preview and new approval. Never infer approval from the original request. If a confirmed invocation is interrupted, retry the unchanged command with the same operation key; never mint a new one for an uncertain write. Inspect recovery state with `recess --json jobs get <operation-key>`.
|
|
60
67
|
|
|
61
68
|
## Shared constraints
|
|
62
69
|
|
|
63
|
-
- Use high-level CLI commands. The raw escape hatch is GET-only:
|
|
70
|
+
- Use high-level CLI commands. The raw escape hatch is GET-only:
|
|
71
|
+
`recess --json request get /path --reason "Inspect the exact API resource needed for this task"`.
|
|
64
72
|
- Resolve names to exact IDs before writes. Stop on ambiguous matches.
|
|
65
73
|
- Money uses integer cents.
|
|
66
74
|
- Keep dates in the exact format required by command help.
|
|
67
75
|
- Treat a 401 or `auth_required` as an authentication problem. A transport-level `fetch failed` is a network/sandbox problem, not proof that the session expired.
|
|
68
|
-
-
|
|
76
|
+
- Use `profile list|save|use` or global `--profile` for named environments. `--deliver file:<path>` atomically stores one JSON envelope locally; authenticated webhook delivery is intentionally unavailable.
|
|
77
|
+
- `feedback submit` records CLI friction under an operation key and optionally forwards it when an upstream endpoint is configured.
|
|
78
|
+
- Run scoped help for syntax; load the audience skill for workflow meaning.
|
|
69
79
|
|
|
70
80
|
## Updating this shared skill
|
|
71
81
|
|