@arshdelight/practi 0.18.0 → 0.20.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 +79 -136
- package/dist/client.js +6 -6
- package/dist/client.js.map +1 -1
- package/dist/cmd/blob.js +21 -24
- package/dist/cmd/blob.js.map +1 -1
- package/dist/cmd/branch.js +5 -7
- package/dist/cmd/branch.js.map +1 -1
- package/dist/cmd/clone.js +29 -23
- package/dist/cmd/clone.js.map +1 -1
- package/dist/cmd/commit.js +97 -0
- package/dist/cmd/commit.js.map +1 -0
- package/dist/cmd/config.js +1 -17
- package/dist/cmd/config.js.map +1 -1
- package/dist/cmd/edit.js +18 -4
- package/dist/cmd/edit.js.map +1 -1
- package/dist/cmd/embed.js +30 -25
- package/dist/cmd/embed.js.map +1 -1
- package/dist/cmd/export.js +43 -0
- package/dist/cmd/export.js.map +1 -0
- package/dist/cmd/fix.js +9 -153
- package/dist/cmd/fix.js.map +1 -1
- package/dist/cmd/gc.js +6 -5
- package/dist/cmd/gc.js.map +1 -1
- package/dist/cmd/history.js +73 -70
- package/dist/cmd/history.js.map +1 -1
- package/dist/cmd/init.js +10 -5
- package/dist/cmd/init.js.map +1 -1
- package/dist/cmd/lint.js +23 -20
- package/dist/cmd/lint.js.map +1 -1
- package/dist/cmd/log.js +2 -4
- package/dist/cmd/log.js.map +1 -1
- package/dist/cmd/merge.js +13 -10
- package/dist/cmd/merge.js.map +1 -1
- package/dist/cmd/new.js +56 -54
- package/dist/cmd/new.js.map +1 -1
- package/dist/cmd/note.js +27 -42
- package/dist/cmd/note.js.map +1 -1
- package/dist/cmd/pull.js +17 -13
- package/dist/cmd/pull.js.map +1 -1
- package/dist/cmd/push.js +27 -12
- package/dist/cmd/push.js.map +1 -1
- package/dist/cmd/search.js +30 -44
- package/dist/cmd/search.js.map +1 -1
- package/dist/cmd/show.js +5 -4
- package/dist/cmd/show.js.map +1 -1
- package/dist/cmd/similar.js +7 -20
- package/dist/cmd/similar.js.map +1 -1
- package/dist/cmd/skill.js +16 -16
- package/dist/cmd/skill.js.map +1 -1
- package/dist/cmd/switch.js +11 -6
- package/dist/cmd/switch.js.map +1 -1
- package/dist/index.js +245 -447
- package/dist/index.js.map +1 -1
- package/dist/practice.js +120 -97
- package/dist/practice.js.map +1 -1
- package/dist/quality.js +2 -2
- package/dist/quality.js.map +1 -1
- package/dist/state.js +13 -73
- package/dist/state.js.map +1 -1
- package/dist/sync.js +6 -48
- package/dist/sync.js.map +1 -1
- package/dist/web.js +259 -481
- package/dist/web.js.map +1 -1
- package/dist/workspace.js +10 -52
- package/dist/workspace.js.map +1 -1
- package/package.json +1 -1
- package/skills/use-practi/SKILL.md +123 -125
- package/web-default/chain.html +39 -0
- package/web-default/chain.js +56 -0
- package/web-default/detail.js +11 -8
- package/web-default/home.html +36 -0
- package/web-default/home.js +49 -0
- package/web-default/lang.js +17 -23
- package/web-default/style.css +1 -1
- package/web-default/app.js +0 -132
- package/web-default/index.html +0 -28
package/README.md
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
# practi
|
|
2
2
|
|
|
3
|
-
The `practi` command (formerly `pop` / `@arshdelight/pop-cli`):
|
|
3
|
+
The `practi` command (formerly `pop` / `@arshdelight/pop-cli`): **practice folders with full local history** for POP (Protocol of Practice) documents, built on [@arshdelight/pop-sdk](https://www.npmjs.com/package/@arshdelight/pop-sdk). A practice is a self-contained folder you own — the pop is a plain JSON file you edit with any editor, and the history lives beside it like `.git`. Nothing leaves the machine except the syncs you ask for (`practi push` / `pull` / `clone` against [practihub](https://practihub.com)).
|
|
4
|
+
|
|
5
|
+
## A practice folder
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
green-tea/
|
|
9
|
+
green-tea.json the pop — a plain document, edit it with anything
|
|
10
|
+
.practi/ the history (like .git):
|
|
11
|
+
chain.json commits {seq, root, parent, message} + branch pointers
|
|
12
|
+
nodes/ every revision, content-addressed (hash = identity)
|
|
13
|
+
blobs/ attachment bytes
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The working file and the head usually match; when they don't, you have **uncommitted changes** — `practi commit` snapshots them as a new revision, `practi export <head>` discards them. History rewriting is local and git-style; `push` reconciles with the hub (divergence errors; `--force` overwrites and the hub drops unreachable objects).
|
|
4
17
|
|
|
5
18
|
## Install
|
|
6
19
|
|
|
@@ -11,151 +24,81 @@ npm install -g @arshdelight/practi
|
|
|
11
24
|
## Commands
|
|
12
25
|
|
|
13
26
|
```
|
|
14
|
-
|
|
15
|
-
practi
|
|
16
|
-
|
|
17
|
-
practi
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
practi
|
|
22
|
-
practi
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
practi
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
practi
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
practi
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
practi
|
|
57
|
-
practi
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
practi
|
|
65
|
-
practi
|
|
66
|
-
|
|
67
|
-
practi
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
practi
|
|
73
|
-
|
|
74
|
-
practi note list [hash] [--json] list notes — all (grouped by document) or a subtree
|
|
75
|
-
practi note edit|delete <note-id> edit (-m "<text>") or remove a note (id prefix OK)
|
|
76
|
-
practi note promote <note-id> [--out <file>]
|
|
77
|
-
turn a note back into a **draft** document of its owning direct
|
|
78
|
-
root, with the note spliced in at the node it was pinned to — it
|
|
79
|
-
drafts and stops, never edits for you (an edit is a new hash:
|
|
80
|
-
that call is yours)
|
|
27
|
+
birth · edit · sync (run inside a practice folder unless noted)
|
|
28
|
+
practi new <name> [--base <file.json>] [-m <msg>] birth a practice folder in cwd;
|
|
29
|
+
--base seeds the first revision from a pop document
|
|
30
|
+
practi commit [-m <msg>] [--amend] snapshot the working file as a new revision
|
|
31
|
+
(local only; nothing to commit when it matches the
|
|
32
|
+
head; --amend replaces the head instead)
|
|
33
|
+
practi export <hash> [-o <file>] write any revision back out as a document
|
|
34
|
+
practi push [--force] sync to the hub (first push creates the instance there)
|
|
35
|
+
practi pull fetch missing revisions, fast-forward, update the
|
|
36
|
+
working file (refuses when it has uncommitted changes)
|
|
37
|
+
practi clone <owner>/<name>[@branch] [--dir <path>]
|
|
38
|
+
clone a hub practice into a local folder (full chain)
|
|
39
|
+
|
|
40
|
+
history
|
|
41
|
+
practi log [--branch <b>] [--limit N] [--json] commits, tip first
|
|
42
|
+
practi branch [name] [-d <name>] [--from <hash>] list (* = current) / create / delete
|
|
43
|
+
practi switch <branch> switch branches; the working file follows the head
|
|
44
|
+
(refuses when dirty — commit first)
|
|
45
|
+
practi merge <branch> fast-forward, else a pointer move (same-tree commits
|
|
46
|
+
are identical — POP §9.1: one row per root)
|
|
47
|
+
practi history reword <seq> -m <msg> | squash <seq> | drop <seq> | reset <seq>
|
|
48
|
+
rewrite the local chain; the working file is left as
|
|
49
|
+
is (git reset semantics) — keep it with a commit or
|
|
50
|
+
discard it with export
|
|
51
|
+
|
|
52
|
+
inside a practice folder
|
|
53
|
+
practi show <hash> [--json] [--doc] inspect one revision node (hash prefix OK)
|
|
54
|
+
practi search [query...] [--json] search this practice's revisions (BM25, title-first,
|
|
55
|
+
multi-word AND across fields, field: scoping, hash
|
|
56
|
+
prefixes, labeled partial-match tier; --notes includes
|
|
57
|
+
local notes; --semantic fuses vector recall when the
|
|
58
|
+
optional model is installed)
|
|
59
|
+
practi similar <hash> content neighbours within this practice (literal bigram
|
|
60
|
+
similarity — a paraphrase will not surface)
|
|
61
|
+
practi lint quality hints on the current branch head (read-only, always
|
|
62
|
+
exits 0 — a to-do list, not a gate)
|
|
63
|
+
practi note add|list|edit|delete learning notes pinned to node hashes (.practi/notes.json,
|
|
64
|
+
never uploaded; the notes sidebar in `practi web` writes
|
|
65
|
+
the same file)
|
|
66
|
+
practi blob add <file-or-url> [--name <name>] store attachment bytes (.practi/blobs/)
|
|
67
|
+
practi embed status|pull|build|prune optional offline vector model (.practi/models/),
|
|
68
|
+
scoped to this practice; without it search is lexical
|
|
69
|
+
practi gc [--apply] free orphan blobs (dry-run by default)
|
|
70
|
+
practi web [--port 4317] browse practices locally: inside a practice folder it serves
|
|
71
|
+
the commit chain, branches, and the per-revision reader
|
|
72
|
+
(wizard / standard view / tree); anywhere else it serves
|
|
73
|
+
the practices home (default ~/.practi/practices) as a
|
|
74
|
+
directory page — click through to the reader
|
|
75
|
+
|
|
76
|
+
anywhere
|
|
77
|
+
practi init [path] create the config home (credentials + remote; default ~/.practi)
|
|
78
|
+
practi remote set <url> | remove point at a hub
|
|
79
|
+
practi login [--no-open] [--reauth] OAuth sign-in (PKCE, browser consent); logout revokes
|
|
80
|
+
practi me show the signed-in account and scopes
|
|
81
|
+
practi config show config home and remote
|
|
82
|
+
practi fix <file.json> [--dry-run] migrate a POP 1.x document file to 2.0
|
|
83
|
+
practi skill install | update | uninstall | import <dir> | export <ref>
|
|
84
|
+
practi spec print the bundled pop-spec.md (no network)
|
|
85
|
+
practi update self-update via npm
|
|
86
|
+
practi version | --version show CLI + pop-spec versions
|
|
81
87
|
```
|
|
82
88
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
### Edit
|
|
86
|
-
|
|
87
|
-
Editing is replacing: content addressing means an edit produces a **new root hash**. `practi edit <hash> <file.json>` (or `--json` / stdin) validates and stores the new tree and swaps the old root out of the direct registration. The document carries no history (POP 2.0): the swap is recorded in the local commit log `commits.json` (`from` = old root hash; `--message` sets the commit note that `practi push` sends to the hub). Nodes no longer reachable from any direct root are garbage-collected: content still referenced by another direct POP survives, exclusive descendants go (`--keep` preserves them).
|
|
88
|
-
|
|
89
|
-
### Search
|
|
90
|
-
|
|
91
|
-
- `practi search <query...>` searches **every stored node** — direct, indirect, nodes referenced only through `inputs.from`, and orphans alike. The index text covers name / description / content / declared inputs+outputs / loop prose / op, ranked by field-weighted BM25 with title-first ordering; hits report which field matched. Pure-hex queries (≥4 chars) also match hash prefixes. Derived at search time only: never written back into a node, never part of a hash.
|
|
92
|
-
- **Words are ANDed** — every word must match somewhere, and words may match in *different* fields. Quote a phrase to search it whole. `field:value` scopes one word: `name: desc: content: flow: loop: op: hash:`.
|
|
93
|
-
- **Partial match is labeled** — when strict matching finds nothing, results relax to a strict majority of terms and say so. Treat a relaxed row as a lead, not an answer.
|
|
94
|
-
- Empty query = browse: lists direct roots with their node counts.
|
|
95
|
-
- `--json` emits `{query, mode, results, total}`; `--limit N` caps the output (default 20, max 50). `--notes` additionally indexes your local notes (off by default, so existing hit sets are unchanged); `--semantic` fuses vector recall with the lexical ranking via RRF — it needs `embed pull` + `embed build`, and otherwise reports what is missing and is ignored.
|
|
96
|
-
|
|
97
|
-
### Recording quality (`W_*` hints)
|
|
89
|
+
Retired with the pops registry (2026-10-20): `edit` `ls` `list` `remove` `claim` `unclaim` `publish` `fetch` `repair` `migrate` — each prints where it went. The config home (`~/.practi`) only holds `practi.json` (remote) and `practi.auth.json` (credentials); practices are plain folders wherever you keep your documents.
|
|
98
90
|
|
|
99
|
-
|
|
91
|
+
### Editing
|
|
100
92
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
### Web
|
|
104
|
-
|
|
105
|
-
`practi web` serves a local UI on `127.0.0.1` (default port 4317). Data and presentation are separated:
|
|
106
|
-
|
|
107
|
-
- **Data window** — plain JSON endpoints backed by the workspace: `GET /api/directs` (directory list: hash, name, description, node/step/output counts), `GET /pop/<hash>.json` (§7 standard view), `GET /doc/<hash>.json` (document tree + `nodeIndex`, a hash→tree-path registry for resolving `inputs.from` references), `GET /blobs/<hash>` (attachment bytes), `GET /api/notes?ref=<hash>` (learning notes within that node's subtree).
|
|
108
|
-
- **Notes write endpoint** — `POST /api/notes` is how the built-in notes sidebar writes (also available to custom frontends): `{"op":"add","hash":"<node hash>","content":"…"}` / `{"op":"edit","id":"<note id>","content":"…"}` / `{"op":"delete","id":"<note id>"}` with `content-type: application/json` and a same-origin `Origin` header (the same CSRF gate as `/api/run`).
|
|
109
|
-
- **Action endpoint** — `POST /api/run` lets a custom frontend trigger CLI commands directly. Request: `{ "cmd": "<name>", "args": { ... } }` with `content-type: application/json` and a same-origin `Origin` header (browser fetch from the page itself satisfies both). Response: `{ "code": <CLI exit code>, "out": "<stdout>", "err": "<stderr>" }`. Runnable commands (the whitelist mirrors the CLI, deliberately narrow):
|
|
110
|
-
|
|
111
|
-
| cmd | args | effect |
|
|
112
|
-
|---|---|---|
|
|
113
|
-
| `new` | `{ json: "<POP document text>" }` | create a POP, register it as direct |
|
|
114
|
-
|
|
115
|
-
Commands run one at a time (queued). `new` accepts JSON text only — no file paths. The built-in frontend does not use this endpoint; it exists for DIY frontends dropped into `<data-dir>/web/`.
|
|
116
|
-
- **Frontend files** — the UI is plain HTML/CSS/JS served from the CLI's bundled `web-default/`. To customize, drop files into `<data-dir>/web/` — files there **override the built-in ones file-by-file** (missing files fall back to the default). Delete a file to return to the built-in version.
|
|
117
|
-
- **Live reload** — the server watches the data dir and the frontend directories; every page (built-in or custom) auto-reloads in the browser when a frontend file changes or when another terminal runs `practi new`. Editing the frontend is a save-and-see loop, no rebuild, no restart.
|
|
93
|
+
Editing is replacing: content addressing means a commit produces a **new root hash**. You never call an editor through practi — the working file *is* the document, and `practi commit -m "..."` records it. `--amend` replaces the head instead of appending (message-only amend rewords). `practi history` rewrites the local chain freely (reword / squash / drop / reset); pushed chains diverge and need `practi push --force`, which rebuilds the hub side and drops unreachable revisions.
|
|
118
94
|
|
|
119
95
|
### Notes
|
|
120
96
|
|
|
121
|
-
|
|
122
|
-
- Two write doors, one file: the CLI (`practi note add <node-hash> -m "step 3 needs admin rights on Windows"` — the gate agents go through) and `practi web`'s **notes sidebar** on the detail page (toggle in the header; lists the current node's notes with inline add/edit/delete; empty file just means an empty panel). The wizard view also renders a node's notes inline on its card, and amber dots in the outline mark nodes that carry notes.
|
|
97
|
+
`practi note` keeps local learning notes in the practice's `.practi/notes.json`, each pinned to a node hash — the pin is about *that version* and can never drift. Two write doors, one file: the CLI and the notes sidebar in `practi web`.
|
|
123
98
|
|
|
124
99
|
### Hub (practihub, optional)
|
|
125
100
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
```
|
|
129
|
-
practi remote set <url> | remove point at a hub (default: https://practihub.com)
|
|
130
|
-
practi login [--no-open] [--reauth] OAuth sign-in / re-credentials; logout revokes + drops
|
|
131
|
-
practi me show the signed-in account
|
|
132
|
-
practi clone <owner>/<name>[@branch] fetch a practice instance, bind the workspace to it and
|
|
133
|
-
check out its head (git clone: the instance IS the repository)
|
|
134
|
-
practi instance create <name> [--public] [--desc <text>] create + bind (branch main)
|
|
135
|
-
practi instance bind <owner>/<name> | show bind an existing instance / summary
|
|
136
|
-
practi push [hash] [--branch <b>] one call: store the document AND bind it as the branch head —
|
|
137
|
-
the commit is appended with parent = current head (linear lineage
|
|
138
|
-
by construction); --message / the local commit log supplies the
|
|
139
|
-
commit note. Requires a bound instance
|
|
140
|
-
practi log [--branch <b>] [--limit N] [--json] commit history of the current branch (tip first;
|
|
141
|
-
unpushed local entries listed on top)
|
|
142
|
-
practi branch [name] [--from <hash>] | -d <name> list (* = default) / create / delete a branch
|
|
143
|
-
practi switch <branch> switch the bound branch (local pointer; pull brings content)
|
|
144
|
-
practi merge <branch> merge into the current branch: fast-forward (pointer move)
|
|
145
|
-
when the tip's parent chain reaches the head, otherwise a squash
|
|
146
|
-
merge commit is appended (tree = the branch tip, parent = the
|
|
147
|
-
head, note = "merge branch 'X'") — the merge always completes;
|
|
148
|
-
`practi pull` syncs it back
|
|
149
|
-
practi pull sync the bound instance's remote revisions into the workspace
|
|
150
|
-
(git pull inside the repository): missing chain revisions are
|
|
151
|
-
fetched hash-verified, the head fast-forwards when your local
|
|
152
|
-
direct is an ancestor, checks out otherwise
|
|
153
|
-
practi fetch <hash> pull a single POP from the hub into your local registry (direct;
|
|
154
|
-
full sha256 hash). Public content fetchable by anyone, private
|
|
155
|
-
only by instance owners — no instance involved
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
Content addressing is untouched: the hub re-derives the root hash server-side with the same SDK, and visibility follows the instance — a PUBLIC instance's chain is readable by anyone (that's what `clone`/`fetch` read), PRIVATE only by its owner. Making an instance public is a hub-web workflow. POP lives on the hub only as practice instances — `push`/`pull` require a bound instance (start with `clone` or `instance create`/`bind`); the document store is object storage addressed by hash, not an inbox.
|
|
101
|
+
A practice folder maps one-to-one onto a hub **instance** — a single-owner, GitHub-like home for one POP's revision chain with branches. `practi push` births the hub copy on first push; `practi clone <owner>/<name>` brings a full chain down as a folder. Content addressing is untouched: the hub re-derives hashes server-side with the same SDK, and visibility follows the instance (PUBLIC chains readable by anyone, PRIVATE only by the owner). Everything hub-side needs `practi login` + `practi remote set`.
|
|
159
102
|
|
|
160
103
|
## License
|
|
161
104
|
|
package/dist/client.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { loadCredentials, saveCredentials, isAccessTokenFresh, } from './credentials.js';
|
|
2
2
|
import { refreshAccessToken } from './oauth.js';
|
|
3
3
|
import { fetchUrl } from './net.js';
|
|
4
|
-
import { createFromDoc, parseDocument } from '@arshdelight/pop-sdk';
|
|
5
|
-
import { openWorkspace } from './workspace.js';
|
|
4
|
+
import { createFromDoc, loadWorkspace, parseDocument } from '@arshdelight/pop-sdk';
|
|
6
5
|
/** refresh 被服务端拒绝(token 端点有应答但 HTTP 报错)——凭据已死,需重新 login */
|
|
7
6
|
export class RefreshRejectedError extends Error {
|
|
8
7
|
}
|
|
@@ -111,11 +110,12 @@ export function normalizeHashRef(ref) {
|
|
|
111
110
|
}
|
|
112
111
|
/** GET /api/v1/instances/{owner}/{name}/revisions/{hash} + 入库前验算(内容寻址的客户端责任,
|
|
113
112
|
* hub 读路径不代验):纯导入(不落库)算出的根哈希必须等于请求地址——不符即拒绝,防止
|
|
114
|
-
* 「另一身份的文档被悄悄注册进本地库」。pull/
|
|
113
|
+
* 「另一身份的文档被悄悄注册进本地库」。pull/clone 共用。
|
|
114
|
+
* 凭据读 home(配置家),字节落 storeDir(实例的 .practi 池)——文件夹模型下两者分离。
|
|
115
115
|
* 访问带仓库上下文(GitHub blobs 同构,2026-10-19 拍板;全局 /api/v1/pop/:ref 已退役):
|
|
116
116
|
* 公开实例任何人可拉,私有实例仅 owner/admin。 */
|
|
117
|
-
export async function fetchRemoteDoc(
|
|
118
|
-
const res = await authedFetch(
|
|
117
|
+
export async function fetchRemoteDoc(home, storeDir, remote, owner, name, ref) {
|
|
118
|
+
const res = await authedFetch(home, remote, `/api/v1/instances/${encodeURIComponent(owner)}/${encodeURIComponent(name)}/revisions/${encodeURIComponent(ref)}`);
|
|
119
119
|
const body = (await res.json().catch(() => ({})));
|
|
120
120
|
if (!res.ok) {
|
|
121
121
|
const detail = typeof body.message === 'string' ? body.message : typeof body.error === 'string' ? body.error : `HTTP ${res.status}`;
|
|
@@ -128,7 +128,7 @@ export async function fetchRemoteDoc(dataDir, remote, owner, name, ref) {
|
|
|
128
128
|
if (parsed.rootHash !== ref) {
|
|
129
129
|
throw new Error(`${ref} — hash mismatch: content hashes to ${parsed.rootHash}`);
|
|
130
130
|
}
|
|
131
|
-
const ws =
|
|
131
|
+
const ws = loadWorkspace(storeDir);
|
|
132
132
|
createFromDoc(ws, body.document);
|
|
133
133
|
return { rootHash: parsed.rootHash, status: body.status ?? 'PRIVATE' };
|
|
134
134
|
}
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,eAAe,EACf,kBAAkB,GAEnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAuB,MAAM,UAAU,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,eAAe,EACf,kBAAkB,GAEnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAuB,MAAM,UAAU,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAEnF,2DAA2D;AAC3D,MAAM,OAAO,oBAAqB,SAAQ,KAAK;CAAG;AAClD,+CAA+C;AAC/C,MAAM,OAAO,mBAAoB,SAAQ,KAAK;CAAG;AAcjD,SAAS,OAAO,CAAC,CAAiB;IAChC,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACtC,OAAO;QACL,EAAE,EAAE,CAAC,CAAC,EAAE;QACR,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,IAAI,EAAE,KAAK,IAAI,EAAE;YACf,IAAI,CAAC;gBACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAA4B,CAAC;YACrD,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,EAAE,CAAC;YACZ,CAAC;QACH,CAAC;QACD,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,IAAI;KACvB,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AAEH,MAAM,UAAU,kBAAkB,CAA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,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,MAAM,EAAE,CAAC;QACpI,MAAM,IAAI,KAAK,CAAC,GAAG,GAAG,MAAM,MAAM,EAAE,CAAC,CAAC;IACxC,CAAC;IACD,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,EAAE,CAAC;QAC1D,MAAM,IAAI,KAAK,CAAC,GAAG,GAAG,8BAA8B,CAAC,CAAC;IACxD,CAAC;IACD,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC5C,IAAI,MAAM,CAAC,QAAQ,KAAK,GAAG,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,GAAG,GAAG,uCAAuC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;IAClF,CAAC;IACD,MAAM,EAAE,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;IACnC,aAAa,CAAC,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,SAAS,EAAE,CAAC;AACzE,CAAC"}
|
package/dist/cmd/blob.js
CHANGED
|
@@ -2,20 +2,19 @@ import fs from 'node:fs';
|
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { createHash } from 'node:crypto';
|
|
4
4
|
import { storeBlob } from '@arshdelight/pop-sdk';
|
|
5
|
-
import {
|
|
6
|
-
import { isInitialized } from '../workspace.js';
|
|
5
|
+
import { resolveRepo } from '../practice.js';
|
|
7
6
|
import { fetchUrl } from '../net.js';
|
|
8
7
|
/**
|
|
9
8
|
* Stage an attachment and emit the ready-to-paste attachment entry.
|
|
10
|
-
* - Local file: hashed + stored into the
|
|
11
|
-
*
|
|
12
|
-
* - http(s) URL: fetched once (25MB cap), bytes ALSO stored into the
|
|
9
|
+
* - Local file: hashed + stored into the instance's blob channel (.practi/blobs),
|
|
10
|
+
* entry emitted without url.
|
|
11
|
+
* - http(s) URL: fetched once (25MB cap), bytes ALSO stored into the instance's
|
|
13
12
|
* blob channel, entry emitted without url (2026-09-03 本地口径:指针纯 hash,
|
|
14
|
-
* bytes 一律走 blobs/<2hex>/<64hex> 内容寻址布局——url 只是导入途径,不进指针;
|
|
13
|
+
* bytes 一律走 .practi/blobs/<2hex>/<64hex> 内容寻址布局——url 只是导入途径,不进指针;
|
|
15
14
|
* spec §5 允许 url 字段,practi 不产生也不消费).
|
|
16
15
|
*
|
|
17
16
|
* Attachments are immutable content: the emitted entry goes into the author's
|
|
18
|
-
* document JSON
|
|
17
|
+
* document JSON, never mutated onto an existing node.
|
|
19
18
|
*/
|
|
20
19
|
/** decodeURIComponent 的 URIError 兜底:a%zz 这类坏转义用原名 */
|
|
21
20
|
function safeDecode(s) {
|
|
@@ -32,21 +31,21 @@ export async function runBlobAdd(opts) {
|
|
|
32
31
|
console.error('usage: practi blob add <file-or-url> [--name <name>]');
|
|
33
32
|
return 1;
|
|
34
33
|
}
|
|
35
|
-
const
|
|
34
|
+
const repo = resolveRepo({ dir: opts.dir, verb: 'blob add' });
|
|
35
|
+
if (repo === null)
|
|
36
|
+
return 1;
|
|
36
37
|
if (/^https?:\/\//i.test(target))
|
|
37
|
-
return blobFromUrl(target, opts.name,
|
|
38
|
-
return blobFromFile(target, opts.name,
|
|
38
|
+
return blobFromUrl(target, opts.name, repo.poolDir);
|
|
39
|
+
return blobFromFile(target, opts.name, repo.poolDir);
|
|
39
40
|
}
|
|
40
|
-
function blobFromFile(target, name,
|
|
41
|
+
function blobFromFile(target, name, poolDir) {
|
|
41
42
|
const bytes = fs.readFileSync(target);
|
|
42
43
|
const base = path.basename(target);
|
|
43
44
|
const hash = sha256(bytes);
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
console.log(`stored: ${stored} (in ${dataDir})`);
|
|
49
|
-
}
|
|
45
|
+
const stored = storeBlob(poolDir, bytes);
|
|
46
|
+
if (stored !== hash)
|
|
47
|
+
throw new Error('internal error: stored blob hash mismatch');
|
|
48
|
+
console.log(`stored: ${stored} (in ${poolDir})`);
|
|
50
49
|
printEntry({
|
|
51
50
|
name: name ?? base,
|
|
52
51
|
hash,
|
|
@@ -56,7 +55,7 @@ function blobFromFile(target, name, dataDir) {
|
|
|
56
55
|
return 0;
|
|
57
56
|
}
|
|
58
57
|
const MAX_URL_BYTES = 25 * 1024 * 1024;
|
|
59
|
-
async function blobFromUrl(url, name,
|
|
58
|
+
async function blobFromUrl(url, name, poolDir) {
|
|
60
59
|
// 走 net.ts 而不是全局 fetch:有系统代理的机器上 fetch 会直接 "fetch failed"
|
|
61
60
|
// (Node 的 undici 不读 Windows 注册表代理)——实测复现过的真实故障
|
|
62
61
|
const res = await fetchUrl(url, { maxBytes: MAX_URL_BYTES });
|
|
@@ -73,12 +72,10 @@ async function blobFromUrl(url, name, dataDir) {
|
|
|
73
72
|
}
|
|
74
73
|
const mimeExt = mimeFromName(base);
|
|
75
74
|
const hash = sha256(bytes);
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
console.log(`stored: ${stored} (in ${dataDir})`);
|
|
81
|
-
}
|
|
75
|
+
const stored = storeBlob(poolDir, bytes);
|
|
76
|
+
if (stored !== hash)
|
|
77
|
+
throw new Error('internal error: stored blob hash mismatch');
|
|
78
|
+
console.log(`stored: ${stored} (in ${poolDir})`);
|
|
82
79
|
printEntry({
|
|
83
80
|
name: name ?? (base && base !== '/' ? safeDecode(base) : 'attachment'),
|
|
84
81
|
hash,
|
package/dist/cmd/blob.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blob.js","sourceRoot":"","sources":["../../src/cmd/blob.ts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UAAU,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;AACtE,CAAC;AAED,MAAM,IAAI,GAA2B;IACnC,GAAG,EAAE,WAAW,EAAE,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,WAAW;IACzE,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,cAAc;IACjF,GAAG,EAAE,WAAW,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,iBAAiB;IAC9E,GAAG,EAAE,YAAY,EAAE,GAAG,EAAE,WAAW,EAAE,GAAG,EAAE,iBAAiB;IAC3D,EAAE,EAAE,eAAe,EAAE,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,kBAAkB;IAChE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,iBAAiB,EAAE,EAAE,EAAE,kBAAkB;IAC/D,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,kBAAkB;CAC9D,CAAC;AAEF,SAAS,YAAY,CAAC,IAAY;IAChC,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IACtD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,0BAA0B,CAAC;AACjD,CAAC"}
|
package/dist/cmd/branch.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { resolvePractice, saveChain } from '../practice.js';
|
|
1
|
+
import { resolveRepo, saveChain } from '../practice.js';
|
|
3
2
|
import { shortHash } from '../render.js';
|
|
4
3
|
/**
|
|
5
4
|
* practi branch [name] [-d <name>] [--from <hash>]:实例支指针管理(本地链操作)。
|
|
6
|
-
* branch 列全部分支(* = 当前支——git
|
|
5
|
+
* branch 列全部分支(* = 当前支——git 同款)
|
|
7
6
|
* branch <name> 从当前支头建新支
|
|
8
7
|
* branch -d <name> 删支指针(默认支 main 不可删)
|
|
9
8
|
*/
|
|
10
9
|
export function runBranch(opts) {
|
|
11
|
-
const
|
|
12
|
-
const repo = resolvePractice({ dataDir, explicitDir: opts.dir, explicitName: opts.practice, verb: 'branch' });
|
|
10
|
+
const repo = resolveRepo({ dir: opts.dir, verb: 'branch' });
|
|
13
11
|
if (repo === null)
|
|
14
12
|
return 1;
|
|
15
13
|
const chain = repo.chain;
|
|
@@ -51,10 +49,10 @@ export function runBranch(opts) {
|
|
|
51
49
|
chain.branches[name] = head;
|
|
52
50
|
saveChain(repo);
|
|
53
51
|
console.log(`created branch: ${name} (from ${head ? head.slice(7, 19) : 'empty root'})`);
|
|
54
|
-
console.log(`next: \`practi switch ${name}\` then
|
|
52
|
+
console.log(`next: \`practi switch ${name}\` then commit into it`);
|
|
55
53
|
return 0;
|
|
56
54
|
}
|
|
57
|
-
// 列表:* = 当前支(git
|
|
55
|
+
// 列表:* = 当前支(git 同款)
|
|
58
56
|
for (const [b, r] of Object.entries(chain.branches)) {
|
|
59
57
|
const mark = b === chain.current ? '*' : ' ';
|
|
60
58
|
console.log(`${mark} ${b}${r ? ` ${r.slice(7, 19)}` : ' (empty)'}`);
|
package/dist/cmd/branch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"branch.js","sourceRoot":"","sources":["../../src/cmd/branch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"branch.js","sourceRoot":"","sources":["../../src/cmd/branch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAa,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AASzC;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,IAAgB;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;QAC7C,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;IACxE,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC"}
|
package/dist/cmd/clone.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { defaultDataDir, loadState } from '../state.js';
|
|
4
|
-
import {
|
|
4
|
+
import { exportSubtree, initWorkspace, loadWorkspace } from '@arshdelight/pop-sdk';
|
|
5
5
|
import { fetchInstanceChain, syncInstanceObjects } from '../sync.js';
|
|
6
|
-
import {
|
|
6
|
+
import { chainHead, saveChain, workingFileFor } from '../practice.js';
|
|
7
7
|
import { shortHash } from '../render.js';
|
|
8
8
|
/** `practi clone <owner>/<name>[@branch]` 的 ref 形态(分支段可选,缺省=实例默认支) */
|
|
9
9
|
export function parseCloneRef(ref) {
|
|
@@ -14,10 +14,9 @@ export function parseCloneRef(ref) {
|
|
|
14
14
|
return { owner, name, branch };
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
|
-
* practi clone <owner>/<name>[@branch] [--dir <path>]
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* - 此后的 push/pull/log/publish 都以 cwd / --dir / --practice 定位到它
|
|
17
|
+
* practi clone <owner>/<name>[@branch] [--dir <path>]:把一个实践实例克隆成本地
|
|
18
|
+
* 实例文件夹——<name>.json 工作文件 + .practi/(全链历史,自包含)。此后的
|
|
19
|
+
* commit/push/pull/log 都以 cwd 定位到它。
|
|
21
20
|
*/
|
|
22
21
|
export async function runClone(opts) {
|
|
23
22
|
const dataDir = opts.dataDir ?? defaultDataDir();
|
|
@@ -33,21 +32,22 @@ export async function runClone(opts) {
|
|
|
33
32
|
return 1;
|
|
34
33
|
}
|
|
35
34
|
const { owner, name, branch } = parsed;
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const chainPath = opts.dir ? path.join(repoDir, 'chain.json') : chainPathFor(dataDir, name);
|
|
40
|
-
if (fs.existsSync(chainPath)) {
|
|
41
|
-
console.error(`clone failed: ${opts.dir ? opts.dir : name} already exists locally (chain.json present)`);
|
|
35
|
+
const dir = path.resolve(opts.dir ?? path.join(process.cwd(), name));
|
|
36
|
+
if (fs.existsSync(dir) && fs.readdirSync(dir).length > 0) {
|
|
37
|
+
console.error(`clone failed: ${dir} already exists and is not empty`);
|
|
42
38
|
return 1;
|
|
43
39
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
const poolDir = path.join(dir, '.practi');
|
|
41
|
+
fs.mkdirSync(poolDir, { recursive: true });
|
|
42
|
+
try {
|
|
43
|
+
initWorkspace(poolDir);
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
// practice.yaml 已在(半途重试)——沿用
|
|
47
47
|
}
|
|
48
|
-
const
|
|
49
|
-
const ws =
|
|
50
|
-
const sync = await syncInstanceObjects(poolDir, state.remote.url, owner, name, view, (h) => ws.nodes.has(h));
|
|
48
|
+
const view = await fetchInstanceChain(dataDir, state.remote.url, owner, name, branch);
|
|
49
|
+
const ws = loadWorkspace(poolDir);
|
|
50
|
+
const sync = await syncInstanceObjects(dataDir, poolDir, state.remote.url, owner, name, view, (h) => ws.nodes.has(h));
|
|
51
51
|
if (sync.failed.length > 0) {
|
|
52
52
|
console.error(`clone incomplete: ${sync.failed.length} revision(s) failed to fetch`);
|
|
53
53
|
return 1;
|
|
@@ -69,15 +69,21 @@ export async function runClone(opts) {
|
|
|
69
69
|
pushedAt: now,
|
|
70
70
|
})),
|
|
71
71
|
};
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
const repo = { dir, chain, chainPath: path.join(poolDir, 'chain.json'), filePath: workingFileFor(dir, name), poolDir };
|
|
73
|
+
saveChain(repo);
|
|
74
|
+
const head = chainHead(chain);
|
|
75
|
+
if (head !== null) {
|
|
76
|
+
const node = loadWorkspace(poolDir).nodes.get(head);
|
|
77
|
+
if (node) {
|
|
78
|
+
fs.writeFileSync(repo.filePath, JSON.stringify(exportSubtree(node, ws.nodes), null, 2) + '\n', 'utf8');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
console.log(`cloned: ${owner}/${name} → ${dir} (${view.visibility}, branch ${view.branch}, ${view.revisions.length} revision(s))`);
|
|
76
82
|
if (sync.missing > 0) {
|
|
77
83
|
console.log(`note: ${sync.missing} revision(s) missing on the hub (history traces of hard-deleted documents)`);
|
|
78
84
|
}
|
|
79
85
|
console.log(`head: ${view.head ? shortHash(view.head) : '(empty)'}`);
|
|
80
|
-
console.log(
|
|
86
|
+
console.log(`next: cd ${name} — edit ${name}.json, \`practi commit -m "..."\`, then \`practi push\``);
|
|
81
87
|
return 0;
|
|
82
88
|
}
|
|
83
89
|
//# sourceMappingURL=clone.js.map
|
package/dist/cmd/clone.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clone.js","sourceRoot":"","sources":["../../src/cmd/clone.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"clone.js","sourceRoot":"","sources":["../../src/cmd/clone.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACnF,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