@plurnk/plurnk-schemes 0.6.0 → 0.8.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/SPEC.md CHANGED
@@ -46,39 +46,34 @@ class Known {
46
46
 
47
47
  ## §2 Interface
48
48
 
49
- Sister scheme handlers implement op methods consumed by plurnk-service via dispatch. The expected method shape (per consumer-side §3 of plurnk-service's SPEC):
49
+ Sister scheme handlers implement op methods consumed by plurnk-service via dispatch: the engine calls `handler[statement.op.toLowerCase()](statement, ctx)` and returns **501** for any op whose method is absent. The op-dispatch surface is the exported **`SchemeHandler`** interface — every method optional, each `(statement, ctx) => Promise<SchemeResult>`, the per-op statement type from grammar:
50
50
 
51
51
  ```ts
52
- interface PlurnkScheme {
53
- // CRUD primitives — REQUIRED for entry-bearing schemes.
54
- readEntry(pathname, ctx): Promise<ReadEntryResult>;
55
- writeEntry(pathname, entry, ctx): Promise<WriteEntryResult>;
56
- deleteEntry(pathname, ctx): Promise<DeleteEntryResult>;
57
-
58
- // Op handlers OPTIONAL. Absent op = 501.
59
- edit?(statement, ctx): Promise<EditResult>;
60
- read?(statement, ctx): Promise<ReadResult>;
61
- show?(statement, ctx): Promise<ShowHideResult>;
62
- hide?(statement, ctx): Promise<ShowHideResult>;
63
- find?(statement, ctx): Promise<FindResult>;
64
- send?(statement, ctx): Promise<SendResult>;
65
- exec?(statement, ctx): Promise<ExecResult>;
66
-
67
- // Proposal lifecycle — OPTIONAL.
68
- onProposalAccepted?(pathname, proposal, ctx): Promise<OpResult>;
69
- onProposalRejected?(pathname, proposal, ctx): Promise<void>;
52
+ import type { SchemeHandler } from "@plurnk/plurnk-schemes";
53
+
54
+ export interface SchemeHandler {
55
+ read?(statement: ReadStatement, ctx: SchemeCtx): Promise<SchemeResult>;
56
+ find?(statement: FindStatement, ctx: SchemeCtx): Promise<SchemeResult>;
57
+ show?(statement: ShowStatement, ctx: SchemeCtx): Promise<SchemeResult>;
58
+ hide?(statement: HideStatement, ctx: SchemeCtx): Promise<SchemeResult>;
59
+ edit?(statement: EditStatement, ctx: SchemeCtx): Promise<SchemeResult>;
60
+ copy?(statement: CopyStatement, ctx: SchemeCtx): Promise<SchemeResult>;
61
+ move?(statement: MoveStatement, ctx: SchemeCtx): Promise<SchemeResult>;
62
+ send?(statement: SendStatement, ctx: SchemeCtx): Promise<SchemeResult>;
63
+ exec?(statement: ExecStatement, ctx: SchemeCtx): Promise<SchemeResult>;
70
64
  }
71
65
  ```
72
66
 
73
- Default export: a class implementing the shape with `static manifest: SchemeManifest`.
67
+ A sibling does `export default class X implements SchemeHandler` (with `static manifest: SchemeManifest`) and gets compile-time signature checking. The op set tracks the pinned grammar (0.21.0) and moves with the framework's grammar bump. **The statement + path types (`ReadStatement`, `SendStatement`, `UrlPath`, …) are re-exported from this barrel**, so a sibling depends on and exact-pins ONLY `@plurnk/plurnk-schemes` — grammar rides underneath as the framework's transitive pin (§3).
74
68
 
75
- Result-type definitions (`EditResult`, `ReadResult`, etc.) live in plurnk-service v0 alongside the helpers that produce them. Forward-spec: these migrate to this repo when the namespaced ctx API lands.
69
+ Two surfaces are NOT yet in `SchemeHandler`, pending their result types migrating here from plurnk-service v0: the **CRUD primitives** (`readEntry`/`writeEntry`/`deleteEntry`, required for entry-bearing schemes) and the **proposal lifecycle** (the optional `ProposalAware.applyResolution` hook, already exported via §3.bis). Until then a scheme declares those methods directly.
76
70
 
77
71
  ## §3 Helpers exported by this repo
78
72
 
79
73
  ### Types
80
74
 
81
75
  - Manifest/flags: `SchemeManifest`, `SchemeFlagAffinity`, `WriterTier`, `LoopFlags`, `DEFAULT_LOOP_FLAGS`.
76
+ - Behavior contract: `SchemeHandler` (§2). Scheme-facing grammar types re-exported here so siblings pin only this package: `PlurnkStatement` + the per-op statement types (`ReadStatement`, `FindStatement`, `ShowStatement`, `HideStatement`, `EditStatement`, `CopyStatement`, `MoveStatement`, `SendStatement`, `ExecStatement`) and path types (`ParsedPath`, `LocalPath`, `UrlPath`).
82
77
  - Result families: `SchemeResult` (`EntryResult` | `ProposalResult` | `PassthroughResult`), `SchemeResultBase`, `TelemetryEvent`. Keyed on scheme-shape, not op. `error` is a grammar `TelemetryEvent`, present iff `status >= 400`. Guards `isEntryResult` / `isProposalResult` / `isPassthroughResult` / `isErrorStatus`; builders `schemeError(scheme, kind, message?, position?)`, `logCoordinate(coordinate, op?)`.
83
78
  - Capability ctx (PR-2, see §3.bis): `SchemeCtx` + `EntryCaps` / `ChannelCaps` / `TagCaps` / `NotifyCaps` / `SubscriptionCaps` / `CrossSchemeCaps`, plus `EntryData`, `ChannelState`, `SubscriptionHandle`, `ProposalAware`.
84
79
 
@@ -134,7 +129,7 @@ The contract that lets a third-party `@plurnk/plurnk-schemes-*` sibling be autho
134
129
  - `channels` — content writes + state (`append`/`replace`/`setState`).
135
130
  - `tags` — entry tags (`add`/`remove`/`list`).
136
131
  - `notify` — between-turn client signal (`streamEvent`, metadata-only); not model-facing. (No `wakeRun`: the run-wake carries subscription-close context that only exists at stream completion, so it lives on `subscriptions.close`. Only streaming schemes wake a run, always via close.)
137
- - `subscriptions` — streaming lifecycle: `open(pathname, handle)` returns a run+teardown-composed `AbortSignal` and takes a force-cancel `SubscriptionHandle`; `notifyChunk(channel, chunk)` is **fused** (append + stream/event in one call); `close(reason, outcome?)` composites channel state + registry close + run wake. Designed against Exec (two-channel, cancel-tested).
132
+ - `subscriptions` — streaming lifecycle: `open(pathname, handle)` returns a run+teardown-composed `AbortSignal` and takes a force-cancel `SubscriptionHandle`; `notifyChunk(channel, chunk, mimetype?)` is **fused** (append + stream/event in one call), with an optional per-call `mimetype` that retypes the channel to the content's actual type (passed statelessly per chunk; the impl writes only on change; the manifest channel mimetype is the pre-fetch seed default — plurnk-service#226); `close(reason, outcome?)` composites channel state + registry close + run wake. Designed against Exec (two-channel, cancel-tested).
138
133
 
139
134
  There is **no `visibility` capability**: entry-level SHOW/HIDE was removed in plurnk-service's index/visibility teardown — SHOW/HIDE now collapse/expand `log://` rows, a log-side concern with no entry-visibility for a scheme to set (plurnk-service#180).
140
135
 
@@ -171,3 +166,13 @@ These migrate when the v1 namespaced ctx API lands (entries / channels / visibil
171
166
  | Spawning subprocesses (unless the scheme is specifically a subprocess scheme) |
172
167
  | Opening network connections (unless specifically a network scheme) |
173
168
  | Caching across op invocations (state in instance fields beyond config) |
169
+
170
+ ## §6 Discovery & registration (third-party)
171
+
172
+ A scheme handler is discovered and registered with **zero first-party involvement** — install it, it lights up. The contract:
173
+
174
+ - **Declare** `plurnk.kind: "scheme"` and `plurnk.name: "<scheme>"` in `package.json`, and `export default` the handler class.
175
+ - **Service scans scope-agnostically.** `SchemeRegistry.discoverExternal` walks *all* of `node_modules` — scoped (`@acme/foo`) and unscoped — registering every package with `plurnk.kind === "scheme"` by its declared `plurnk.name`. A third party publishes under their own scope and is found by the same scan; there is no first-party allow-list (plurnk-service#227). A name collision with an in-tree scheme fail-hards.
176
+ - **The framework stays contract-only.** `@plurnk/plurnk-schemes` never depends on a scheme package — that would nest daughters under it and the top-level scan would miss them. Daughters peer-pin the framework (exact); it arrives transitively and is itself ignored by the scan (no `plurnk.kind`).
177
+ - **`@plurnk/plurnk-schemes-all`** is the first-party convenience bundle: it deps the first-party siblings flat so one install surfaces them all. It is never a gate — operators install individual packages or third-party ones identically.
178
+ - **Trust.** An operator can require host-level trust before a discovered plugin registers (`PLURNK_PLUGINS_TRUSTED_ONLY`, plurnk-service#229) — the scope-agnostic scan widens reach, the trust gate bounds it.
package/dist/ctx.d.ts CHANGED
@@ -51,7 +51,7 @@ export interface NotifyCaps {
51
51
  }
52
52
  export interface SubscriptionCaps {
53
53
  open(pathname: string, handle: SubscriptionHandle): Promise<AbortSignal>;
54
- notifyChunk(channel: string, chunk: string): Promise<void>;
54
+ notifyChunk(channel: string, chunk: string, mimetype?: string): Promise<void>;
55
55
  close(reason: "done" | "error", outcome?: string): Promise<void>;
56
56
  }
57
57
  export interface SubscriptionHandle {
package/dist/ctx.d.ts.map CHAN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Q,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAG5B,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,SAAS,CAAC;IAEzC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,aAAa,EAAE,gBAAgB,CAAC;IACzC,QAAQ,CAAC,WAAW,EAAE,eAAe,CAAC;CACzC;AAUD,MAAM,WAAW,aAAa;IAC1B,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CACtG"}
@@ -0,0 +1,15 @@
1
+ import type { FindStatement, ReadStatement, ShowStatement, HideStatement, EditStatement, CopyStatement, MoveStatement, SendStatement, ExecStatement } from "@plurnk/plurnk-grammar";
2
+ import type { SchemeCtx } from "./ctx.ts";
3
+ import type { SchemeResult } from "./results.ts";
4
+ export interface SchemeHandler {
5
+ read?(statement: ReadStatement, ctx: SchemeCtx): Promise<SchemeResult>;
6
+ find?(statement: FindStatement, ctx: SchemeCtx): Promise<SchemeResult>;
7
+ show?(statement: ShowStatement, ctx: SchemeCtx): Promise<SchemeResult>;
8
+ hide?(statement: HideStatement, ctx: SchemeCtx): Promise<SchemeResult>;
9
+ edit?(statement: EditStatement, ctx: SchemeCtx): Promise<SchemeResult>;
10
+ copy?(statement: CopyStatement, ctx: SchemeCtx): Promise<SchemeResult>;
11
+ move?(statement: MoveStatement, ctx: SchemeCtx): Promise<SchemeResult>;
12
+ send?(statement: SendStatement, ctx: SchemeCtx): Promise<SchemeResult>;
13
+ exec?(statement: ExecStatement, ctx: SchemeCtx): Promise<SchemeResult>;
14
+ }
15
+ //# sourceMappingURL=handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../src/handler.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EACR,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,MAAM,WAAW,aAAa;IAC1B,IAAI,CAAC,CAAC,SAAS,EAAE,aAAa,EAAE,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACvE,IAAI,CAAC,CAAC,SAAS,EAAE,aAAa,EAAE,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACvE,IAAI,CAAC,CAAC,SAAS,EAAE,aAAa,EAAE,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACvE,IAAI,CAAC,CAAC,SAAS,EAAE,aAAa,EAAE,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACvE,IAAI,CAAC,CAAC,SAAS,EAAE,aAAa,EAAE,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACvE,IAAI,CAAC,CAAC,SAAS,EAAE,aAAa,EAAE,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACvE,IAAI,CAAC,CAAC,SAAS,EAAE,aAAa,EAAE,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACvE,IAAI,CAAC,CAAC,SAAS,EAAE,aAAa,EAAE,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACvE,IAAI,CAAC,CAAC,SAAS,EAAE,aAAa,EAAE,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CAC1E"}
@@ -0,0 +1,16 @@
1
+ // The scheme BEHAVIOR contract — the typed counterpart to SchemeManifest
2
+ // (which types a scheme's declaration). A handler implements a method per op it
3
+ // supports, named for the lowercased op (READ → read, SEND → send, FIND → find,
4
+ // …); plurnk-service dispatches `handler[statement.op.toLowerCase()](statement,
5
+ // ctx)` and returns 501 for any op a scheme doesn't implement. Every method is
6
+ // therefore OPTIONAL — a scheme implements only its surface (http: read + send;
7
+ // an entry scheme: read/find/edit/copy/move/…). All share one shape:
8
+ // `(statement, ctx) => Promise<SchemeResult>`.
9
+ //
10
+ // `implements SchemeHandler` gives a sibling compile-time checking of its op
11
+ // signatures instead of the duck-typed `object` the engine falls back to. The
12
+ // per-op statement types are re-exported from the barrel, so a sibling depends
13
+ // on (and exact-pins) ONLY @plurnk/plurnk-schemes — grammar rides underneath as
14
+ // the framework's transitive pin, not a second pin every scheme tracks by hand.
15
+ export {};
16
+ //# sourceMappingURL=handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handler.js","sourceRoot":"","sources":["../src/handler.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,gFAAgF;AAChF,gFAAgF;AAChF,gFAAgF;AAChF,+EAA+E;AAC/E,gFAAgF;AAChF,qEAAqE;AACrE,+CAA+C;AAC/C,EAAE;AACF,6EAA6E;AAC7E,8EAA8E;AAC9E,+EAA+E;AAC/E,gFAAgF;AAChF,gFAAgF"}
package/dist/index.d.ts CHANGED
@@ -10,4 +10,6 @@ export type { MatchResult } from "./matcher.ts";
10
10
  export { default as Results } from "./results.ts";
11
11
  export type { EntryResult, PassthroughResult, ProposalResult, SchemeResult, SchemeResultBase, TelemetryEvent, } from "./results.ts";
12
12
  export type { ChannelCaps, ChannelState, CrossSchemeCaps, EntryCaps, EntryData, NotifyCaps, ProposalAware, SchemeCtx, SubscriptionCaps, SubscriptionHandle, TagCaps, } from "./ctx.ts";
13
+ export type { SchemeHandler } from "./handler.ts";
14
+ export type { PlurnkStatement, FindStatement, ReadStatement, ShowStatement, HideStatement, EditStatement, CopyStatement, MoveStatement, SendStatement, ExecStatement, ParsedPath, LocalPath, UrlPath, } from "@plurnk/plurnk-grammar";
13
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,YAAY,EACR,SAAS,EACT,kBAAkB,EAClB,cAAc,EACd,UAAU,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAGhD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC9F,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACrD,YAAY,EAAE,UAAU,IAAI,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACnG,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC;AAClD,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC;AAClD,YAAY,EACR,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,cAAc,GACjB,MAAM,cAAc,CAAC;AAItB,YAAY,EACR,WAAW,EACX,YAAY,EACZ,eAAe,EACf,SAAS,EACT,SAAS,EACT,UAAU,EACV,a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a,EACb,aAAa,EACb,UAAU,EACV,SAAS,EACT,OAAO,GACV,MAAM,wBAAwB,CAAC"}
package/package.json CHANGED
@@ -1,57 +1,57 @@
1
1
  {
2
- "name": "@plurnk/plurnk-schemes",
3
- "version": "0.6.0",
4
- "description": "Framework + contract for the @plurnk/plurnk-schemes-* URI handler family.",
5
- "keywords": [
6
- "plurnk",
7
- "scheme",
8
- "uri"
9
- ],
10
- "homepage": "https://github.com/plurnk/plurnk-schemes#readme",
11
- "bugs": {
12
- "url": "https://github.com/plurnk/plurnk-schemes/issues"
13
- },
14
- "repository": {
15
- "type": "git",
16
- "url": "git+https://github.com/plurnk/plurnk-schemes.git"
17
- },
18
- "engines": {
19
- "node": ">=25"
20
- },
21
- "license": "MIT",
22
- "author": "@wikitopian",
23
- "type": "module",
24
- "publishConfig": {
25
- "access": "public"
26
- },
27
- "exports": {
28
- ".": {
29
- "types": "./dist/index.d.ts",
30
- "default": "./dist/index.js"
2
+ "name": "@plurnk/plurnk-schemes",
3
+ "version": "0.8.0",
4
+ "description": "Framework + contract for the @plurnk/plurnk-schemes-* URI handler family.",
5
+ "keywords": [
6
+ "plurnk",
7
+ "scheme",
8
+ "uri"
9
+ ],
10
+ "homepage": "https://github.com/plurnk/plurnk-schemes#readme",
11
+ "bugs": {
12
+ "url": "https://github.com/plurnk/plurnk-schemes/issues"
31
13
  },
32
- "./package.json": "./package.json"
33
- },
34
- "files": [
35
- "dist/**/*",
36
- "README.md",
37
- "SPEC.md"
38
- ],
39
- "scripts": {
40
- "test:lint": "tsc --noEmit",
41
- "test:unit": "node --test src/**/*.test.ts",
42
- "test": "npm run test:lint && npm run test:unit",
43
- "build:dist": "tsc -p tsconfig.build.json",
44
- "build": "npm run build:dist",
45
- "prepare": "npm run build"
46
- },
47
- "peerDependencies": {
48
- "@plurnk/plurnk-grammar": "0.21.0",
49
- "@plurnk/plurnk-mimetypes": "0.14.0"
50
- },
51
- "devDependencies": {
52
- "@plurnk/plurnk-grammar": "0.21.0",
53
- "@plurnk/plurnk-mimetypes": "0.14.0",
54
- "@types/node": "^25.8.0",
55
- "typescript": "^6.0.3"
56
- }
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/plurnk/plurnk-schemes.git"
17
+ },
18
+ "engines": {
19
+ "node": ">=25"
20
+ },
21
+ "license": "MIT",
22
+ "author": "@wikitopian",
23
+ "type": "module",
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "exports": {
28
+ ".": {
29
+ "types": "./dist/index.d.ts",
30
+ "default": "./dist/index.js"
31
+ },
32
+ "./package.json": "./package.json"
33
+ },
34
+ "files": [
35
+ "dist/**/*",
36
+ "README.md",
37
+ "SPEC.md"
38
+ ],
39
+ "scripts": {
40
+ "test:lint": "tsc --noEmit",
41
+ "test:unit": "node --test src/**/*.test.ts",
42
+ "test": "npm run test:lint && npm run test:unit",
43
+ "build:dist": "tsc -p tsconfig.build.json",
44
+ "build": "npm run build:dist",
45
+ "prepare": "npm run build"
46
+ },
47
+ "peerDependencies": {
48
+ "@plurnk/plurnk-grammar": "0.21.0",
49
+ "@plurnk/plurnk-mimetypes": "0.14.0"
50
+ },
51
+ "devDependencies": {
52
+ "@plurnk/plurnk-grammar": "0.21.0",
53
+ "@plurnk/plurnk-mimetypes": "0.14.0",
54
+ "@types/node": "^25.8.0",
55
+ "typescript": "^6.0.3"
56
+ }
57
57
  }