@plurnk/plurnk-schemes 0.4.0 → 0.4.1
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 +1 -1
- package/SPEC.md +4 -3
- package/dist/ctx.d.ts +0 -9
- package/dist/ctx.d.ts.map +1 -1
- package/dist/ctx.js +7 -5
- package/dist/ctx.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ Framework + contract for `@plurnk/plurnk-schemes-*` URI handler packages. Consum
|
|
|
13
13
|
|
|
14
14
|
- Manifest/flags: `SchemeManifest`, `SchemeFlagAffinity`, `WriterTier`, `LoopFlags`, `DEFAULT_LOOP_FLAGS`.
|
|
15
15
|
- Result families: `SchemeResult` / `EntryResult` / `ProposalResult` / `PassthroughResult` / `SchemeResultBase` / `TelemetryEvent`.
|
|
16
|
-
- Capability ctx: `SchemeCtx` + `EntryCaps` / `ChannelCaps` / `
|
|
16
|
+
- Capability ctx: `SchemeCtx` + `EntryCaps` / `ChannelCaps` / `TagCaps` / `NotifyCaps` / `SubscriptionCaps` / `CrossSchemeCaps`, plus `EntryData` / `ChannelState` / `SubscriptionHandle` / `ProposalAware`.
|
|
17
17
|
|
|
18
18
|
### Helpers (`export default class`, static methods)
|
|
19
19
|
|
package/SPEC.md
CHANGED
|
@@ -79,7 +79,7 @@ Result-type definitions (`EditResult`, `ReadResult`, etc.) live in plurnk-servic
|
|
|
79
79
|
|
|
80
80
|
- Manifest/flags: `SchemeManifest`, `SchemeFlagAffinity`, `WriterTier`, `LoopFlags`, `DEFAULT_LOOP_FLAGS`.
|
|
81
81
|
- 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?)`.
|
|
82
|
-
- Capability ctx (PR-2, see §3.bis): `SchemeCtx` + `EntryCaps` / `ChannelCaps` / `
|
|
82
|
+
- Capability ctx (PR-2, see §3.bis): `SchemeCtx` + `EntryCaps` / `ChannelCaps` / `TagCaps` / `NotifyCaps` / `SubscriptionCaps` / `CrossSchemeCaps`, plus `EntryData`, `ChannelState`, `SubscriptionHandle`, `ProposalAware`.
|
|
83
83
|
|
|
84
84
|
Behavior ships as `export default class` (one class per file, static methods) — the ecosystem class paradigm. Type-only modules, the barrel, and the frozen `DEFAULT_LOOP_FLAGS` constant are the only non-class files.
|
|
85
85
|
|
|
@@ -127,15 +127,16 @@ Behavior ships as `export default class` (one class per file, static methods)
|
|
|
127
127
|
|
|
128
128
|
The contract that lets a third-party `@plurnk/plurnk-schemes-*` sibling be authored without importing `@plurnk/plurnk-service` or touching a raw DB handle (forbidden by §5). **Interfaces only**: this repo exports the shapes; plurnk-service injects a db-backed implementation behind them (the `scheme-types.ts` seam, widened). In-tree schemes keep using `db` directly during transition and cut over scheme-by-scheme. Design converged on [plurnk-service#180](https://github.com/plurnk/plurnk-service/issues/180).
|
|
129
129
|
|
|
130
|
-
`SchemeCtx` carries per-dispatch identity (`sessionId`/`runId`/`loopId`/`turnId`/`writer`/`signal`) plus **
|
|
130
|
+
`SchemeCtx` carries per-dispatch identity (`sessionId`/`runId`/`loopId`/`turnId`/`writer`/`signal`) plus **five live capability namespaces** replacing raw `db`:
|
|
131
131
|
|
|
132
132
|
- `entries` — CRUD over the scheme's own namespace (`read`/`write`/`delete`).
|
|
133
133
|
- `channels` — content writes + state (`append`/`replace`/`setState`).
|
|
134
|
-
- `visibility` — the per-(run, entry, channel) index bit (`show`/`hide`, channel optional).
|
|
135
134
|
- `tags` — entry tags (`add`/`remove`/`list`).
|
|
136
135
|
- `notify` — between-turn client/engine signals (`streamEvent`, `wakeRun`); not model-facing.
|
|
137
136
|
- `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).
|
|
138
137
|
|
|
138
|
+
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).
|
|
139
|
+
|
|
139
140
|
`crossScheme` is a **deferred** placeholder — no FROM/TO methods committed until the first real cross-scheme COPY/MOVE forces the shape.
|
|
140
141
|
|
|
141
142
|
**Proposals are not a capability.** A side-effecting scheme proposes by *returning* a `ProposalResult` (status 202); the engine owns the resolution lifecycle (await/accept/reject, YOLO/noProposals auto-resolve, timeout) and it is invisible to the sibling. The only sibling-side surface is the optional `ProposalAware.applyResolution(pathname, proposal, ctx)` hook the engine calls on accept.
|
package/dist/ctx.d.ts
CHANGED
|
@@ -34,14 +34,6 @@ export interface ChannelCaps {
|
|
|
34
34
|
status: number;
|
|
35
35
|
}>;
|
|
36
36
|
}
|
|
37
|
-
export interface VisibilityCaps {
|
|
38
|
-
show(pathname: string, channel?: string): Promise<{
|
|
39
|
-
status: number;
|
|
40
|
-
}>;
|
|
41
|
-
hide(pathname: string, channel?: string): Promise<{
|
|
42
|
-
status: number;
|
|
43
|
-
}>;
|
|
44
|
-
}
|
|
45
37
|
export interface TagCaps {
|
|
46
38
|
add(pathname: string, tags: ReadonlyArray<string>): Promise<{
|
|
47
39
|
status: number;
|
|
@@ -78,7 +70,6 @@ export interface SchemeCtx {
|
|
|
78
70
|
readonly signal: AbortSignal | undefined;
|
|
79
71
|
readonly entries: EntryCaps;
|
|
80
72
|
readonly channels: ChannelCaps;
|
|
81
|
-
readonly visibility: VisibilityCaps;
|
|
82
73
|
readonly tags: TagCaps;
|
|
83
74
|
readonly notify: NotifyCaps;
|
|
84
75
|
readonly subscriptions: SubscriptionCaps;
|
package/dist/ctx.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ctx.d.ts","sourceRoot":"","sources":["../src/ctx.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ctx.d.ts","sourceRoot":"","sources":["../src/ctx.ts"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAIjE,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAItE,MAAM,WAAW,SAAS;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,YAAY,CAAA;KAAE,CAAC,CAAC;IAC/F,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CACxC;AAMD,MAAM,WAAW,SAAS;IACtB,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;IAC7E,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;IACjH,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACzD;AAQD,MAAM,WAAW,WAAW;IACxB,MAAM,C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`ChannelWrite` helpers, cut over scheme-by-scheme.
|
|
16
16
|
//
|
|
17
|
-
//
|
|
18
|
-
// entries / channels /
|
|
19
|
-
// `
|
|
20
|
-
// subscriptions
|
|
21
|
-
//
|
|
17
|
+
// FIVE live namespaces decompose what `ctx.db` is used for today:
|
|
18
|
+
// entries / channels / tags / notify — map 1:1 onto the `_entry-*.ts` +
|
|
19
|
+
// `ChannelWrite` helpers; wrap cleanly.
|
|
20
|
+
// subscriptions — the streaming lifecycle
|
|
21
|
+
// (open/notifyChunk/close); design against Exec, the proven
|
|
22
22
|
// two-channel cancel-tested case.
|
|
23
|
+
// (No `visibility`: entry-level SHOW/HIDE was removed in plurnk-service's
|
|
24
|
+
// index/visibility teardown — SHOW/HIDE now act on `log://` rows. #180.)
|
|
23
25
|
//
|
|
24
26
|
// NOT a namespace:
|
|
25
27
|
// proposals — collapses to "return a ProposalResult (202) + implement
|
package/dist/ctx.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ctx.js","sourceRoot":"","sources":["../src/ctx.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,0EAA0E;AAC1E,uBAAuB;AACvB,EAAE;AACF,4EAA4E;AAC5E,wEAAwE;AACxE,2EAA2E;AAC3E,yEAAyE;AACzE,yCAAyC;AACzC,EAAE;AACF,uEAAuE;AACvE,6EAA6E;AAC7E,yEAAyE;AACzE,kEAAkE;AAClE,qEAAqE;AACrE,EAAE;AACF,
|
|
1
|
+
{"version":3,"file":"ctx.js","sourceRoot":"","sources":["../src/ctx.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,0EAA0E;AAC1E,uBAAuB;AACvB,EAAE;AACF,4EAA4E;AAC5E,wEAAwE;AACxE,2EAA2E;AAC3E,yEAAyE;AACzE,yCAAyC;AACzC,EAAE;AACF,uEAAuE;AACvE,6EAA6E;AAC7E,yEAAyE;AACzE,kEAAkE;AAClE,qEAAqE;AACrE,EAAE;AACF,kEAAkE;AAClE,2EAA2E;AAC3E,4CAA4C;AAC5C,kEAAkE;AAClE,gEAAgE;AAChE,sCAAsC;AACtC,0EAA0E;AAC1E,0EAA0E;AAC1E,EAAE;AACF,mBAAmB;AACnB,0EAA0E;AAC1E,6EAA6E;AAC7E,6EAA6E;AAC7E,2EAA2E;AAC3E,4CAA4C;AAC5C,2EAA2E;AAC3E,wEAAwE;AACxE,iEAAiE"}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,5 +9,5 @@ export { default as Matcher } from "./matcher.ts";
|
|
|
9
9
|
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
|
-
export type { ChannelCaps, ChannelState, CrossSchemeCaps, EntryCaps, EntryData, NotifyCaps, ProposalAware, SchemeCtx, SubscriptionCaps, SubscriptionHandle, TagCaps,
|
|
12
|
+
export type { ChannelCaps, ChannelState, CrossSchemeCaps, EntryCaps, EntryData, NotifyCaps, ProposalAware, SchemeCtx, SubscriptionCaps, SubscriptionHandle, TagCaps, } from "./ctx.ts";
|
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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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