@chalksurf/cli 0.3.6 → 0.4.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 +24 -18
- package/dist/bin/chalksurf.js +10410 -9280
- package/docs/agents.md +63 -50
- package/docs/content-operations.md +36 -0
- package/docs/examples/authoritative-sheet-import-manifest.json +48 -0
- package/docs/examples/exercise-import-manifest.json +16 -9
- package/docs/examples/exercise-sheet-solution-import-manifest.json +13 -8
- package/docs/examples/exercise-sheet-translation-import-manifest.json +20 -0
- package/docs/examples/exercise-solution-import-manifest.json +13 -8
- package/docs/examples/sheet-import-manifest.json +12 -5
- package/docs/exit-codes.md +14 -4
- package/docs/manifest.md +12 -165
- package/docs/manual.md +44 -28
- package/docs/mcp.md +62 -57
- package/docs/migration-0.4.md +79 -0
- package/package.json +6 -3
- package/schemas/content-manifest.schema.json +2308 -0
- package/schemas/content-plan.schema.json +5003 -0
- package/schemas/exercise-import-manifest.schema.json +131 -101
- package/schemas/exercise-sheet-solution-import-manifest.schema.json +118 -90
- package/schemas/exercise-sheet-translation-import-manifest.schema.json +156 -0
- package/schemas/exercise-solution-import-manifest.schema.json +118 -90
- package/schemas/sheet-import-manifest.schema.json +547 -181
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Migrating to CLI 0.4.0
|
|
2
|
+
|
|
3
|
+
Version 0.4.0 groups content operations by resource, component and action. Removed names are rejected; they are not aliases. The release also changes content input and output formats. Source order and domain authorization remain enforced; update scripts and saved artifacts before using the new version.
|
|
4
|
+
|
|
5
|
+
| Previous command | Replacement |
|
|
6
|
+
| --- | --- |
|
|
7
|
+
| `exercise import-solution` | `exercise solution import` |
|
|
8
|
+
| `sheet import-solutions` | `sheet solution import` |
|
|
9
|
+
| `exercise translate` | `exercise translation generate` |
|
|
10
|
+
| `sheet generate-translation` | `sheet translation generate` |
|
|
11
|
+
| `sheet import-translation` | `sheet translation import` |
|
|
12
|
+
| `exercise versions` | `exercise version list` |
|
|
13
|
+
| `exercise version` | `exercise version get` |
|
|
14
|
+
| `exercise sources` | `exercise source list` |
|
|
15
|
+
| `exercise source` | `exercise source get` |
|
|
16
|
+
| `exercise labels` | `exercise label list` |
|
|
17
|
+
| `exercise validate-latex` | `exercise latex validate` |
|
|
18
|
+
| `exercise set-visibility` | `exercise visibility set` |
|
|
19
|
+
| `sheet versions` | `sheet version list` |
|
|
20
|
+
| `sheet version` | `sheet version get` |
|
|
21
|
+
| `sheet set-visibility` | `sheet visibility set` |
|
|
22
|
+
| `sheet append` | `sheet exercise append` |
|
|
23
|
+
|
|
24
|
+
The JSON envelope's `command` field uses the replacement path. Update scripts that inspect that field as well as the command invocation. Use `--help` on the complete path to inspect its arguments, for example `chalksurf exercise solution import --help`.
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## Inputs and repeated operations
|
|
28
|
+
|
|
29
|
+
Use `--input FILE|-` for a single structured request or patch and `--manifest FILE|-` for repeated requests. The affected content/update commands no longer accept `--input-json` or `--patch-json`. There is no bulk mode: repeat explicit IDs where supported, use `--sheet-id` for exercise generation, or provide one versioned manifest. Do not combine target/operation flags with a manifest.
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"schemaVersion": "v1",
|
|
34
|
+
"operation": "sheet.import",
|
|
35
|
+
"items": [{
|
|
36
|
+
"itemId": "round-1",
|
|
37
|
+
"title": "Round 1",
|
|
38
|
+
"targetLanguages": ["english"],
|
|
39
|
+
"sources": [{"kind": "local", "path": "paper.pdf", "sourceId": "official-paper"}]
|
|
40
|
+
}]
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Old top-level `sheets`, `sources`, `organizationId` and `wait` manifest fields are rejected. Choose organization through the CLI/profile and wait through `--wait`. Use `targetLanguages` in applicable manifest items and repeatable `--target-language` in direct commands; `translateTo` and `--translate-to` are removed. Authoritative sheet translation import takes exactly one target language. Role-bearing legacy source objects are no longer accepted.
|
|
45
|
+
|
|
46
|
+
File paths now resolve relative to the input file, not the invocation directory. Stdin paths resolve relative to the invocation directory. JSON input/plan files are bounded to 16 MiB. Known expansion is limited to 100 mutation targets and 20 logical sheet-import groups; no truncation or automatic splitting occurs. Local import dry runs hash readable bytes; remote URLs remain unfetched and extraction counts stay unknown.
|
|
47
|
+
|
|
48
|
+
## Plans replace bulk-update
|
|
49
|
+
|
|
50
|
+
`sheet bulk-update`, `sheet bulk-update apply` and `sheet bulk-update verify` are removed:
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
chalksurf --profile prod-codex sheet update --manifest patches.json --dry-run --plan-out plan.json --json
|
|
54
|
+
chalksurf --profile prod-codex plan show plan.json --json
|
|
55
|
+
chalksurf --profile prod-codex plan apply plan.json --result-file applied.json --json
|
|
56
|
+
chalksurf --profile prod-codex plan verify plan.json --json
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
An update manifest uses `schemaVersion`, `operation: "sheet.update"` (or `exercise.update`) and `items` containing `itemId`, `id`, `expectedUpdatedAt` and `patch`, plus applicable preconditions. Only updates and solution/description generation have executable plans. Translations and imports have read-only previews. `--plan-out` requires `--dry-run`; `plan apply` accepts no target, request-ID or policy overrides. Old dry-run result envelopes are not executable plans: regenerate from the original input.
|
|
60
|
+
|
|
61
|
+
Sheet batch application remains atomic. Exercise entries are best effort after full initial revalidation. Reviewed blocked entries remain visible and cause nonzero status. A single safe operation generally needs no saved plan; repeated updates and generation that replaces existing content require review. Use `--replace-existing` for solutions and explicit shared-use acknowledgement when applicable.
|
|
62
|
+
|
|
63
|
+
## Results, jobs and recovery
|
|
64
|
+
|
|
65
|
+
Content results now contain operation/phase/request identity, `items[]` and `summary` (`total`, `successful`, `unsuccessful`, `unfinished`). Receipts and jobs belong to each item; waited snapshots and linked work appear under `observation`. Queued work is unfinished, not completed. Unrelated commands retain their previous result shapes.
|
|
66
|
+
|
|
67
|
+
The outer JSON envelope remains v1. `--result-file` contains that complete envelope; stdout may contain a compact artifact path. Keep the full fallback if publication fails after execution: its original exit code remains authoritative.
|
|
68
|
+
|
|
69
|
+
Before a write, the CLI privately persists attempt evidence under `operations/` beside its configuration, or at `--request-file`. Preserve the request ID and original input; signed source URL parameters are redacted from evidence. `--request-id` is only for intentional exact resends. The server returns prior accepted work and rejects changed input. The CLI never automatically retries a write.
|
|
70
|
+
|
|
71
|
+
Use `job list --request-id ID` to inspect both live jobs and durable acceptance, including deleted-job tombstones. For saved plans, `plan verify FILE` reads current update state or recorded generation acceptance. Read failure cannot establish that a write failed. Current `desired` values do not prove authorship.
|
|
72
|
+
|
|
73
|
+
Use generic `job cancel ID [ID..]` and `job dismiss ID [ID..]`; there is no `sheet translation cancel`. Cancellation stops active work when supported; dismissal only changes notifications. Published language removal is `sheet translation remove ID --target-language LANGUAGE --confirm-resource-id ID` and preserves the last ready language and exercise translations.
|
|
74
|
+
|
|
75
|
+
Exit 6 means timeout, 7 unsuccessful-only outcomes (including cancelled/not-solved), 8 mixed outcomes, 9 uncertain acceptance and 130 local interruption. Observation failures use 5 and retain known state. Ordinary successful acceptance exits 0 without claiming completion. `job cancel --wait` treats requested cancellation as success. See [all exit codes](./exit-codes.md).
|
|
76
|
+
|
|
77
|
+
## Server prerequisite
|
|
78
|
+
|
|
79
|
+
The 0.4.0 content surface requires CLI protocol v1 and authorized guarded writes. If capability checks fail, the CLI stops without falling back to older mutation endpoints. Compatible API and job processors must be deployed before guarded-write activation and CLI publication. This release does not change MCP commands or inputs.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chalksurf/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -30,17 +30,20 @@
|
|
|
30
30
|
"type-check": "tsgo --noEmit --project ./tsconfig.json --checkers 2",
|
|
31
31
|
"test": "vitest --config ./vitest.config.ts --run --maxWorkers=1",
|
|
32
32
|
"test:watch": "vitest --config ./vitest.config.ts --watch --maxWorkers=1",
|
|
33
|
-
"smoke-pack": "node --import tsx ./scripts/smoke-pack.ts"
|
|
33
|
+
"smoke-pack": "node --import tsx ./scripts/smoke-pack.ts",
|
|
34
|
+
"schemas:generate": "node --import tsx ./scripts/generate-content-schemas.ts",
|
|
35
|
+
"schemas:check": "node --import tsx ./scripts/generate-content-schemas.ts --check"
|
|
34
36
|
},
|
|
35
37
|
"dependencies": {
|
|
36
38
|
"p-limit": "^6.2.0",
|
|
39
|
+
"pretty-bytes": "^7.1.3",
|
|
37
40
|
"yargs": "^17.7.2",
|
|
38
41
|
"zod": "^4.1.12"
|
|
39
42
|
},
|
|
40
43
|
"devDependencies": {
|
|
41
44
|
"@types/node": "^24.10.1",
|
|
42
45
|
"@types/yargs": "^17.0.35",
|
|
43
|
-
"@typescript/native-preview": "^7.0.0-dev.
|
|
46
|
+
"@typescript/native-preview": "^7.0.0-dev.20260707.2",
|
|
44
47
|
"esbuild": "^0.27.0",
|
|
45
48
|
"tsx": "^4.20.6",
|
|
46
49
|
"typescript": "^6.0.3",
|