@plurnk/plurnk-schemes 0.3.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 CHANGED
@@ -13,16 +13,16 @@ 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` / `VisibilityCaps` / `TagCaps` / `NotifyCaps` / `SubscriptionCaps` / `CrossSchemeCaps`, plus `EntryData` / `ChannelState` / `SubscriptionHandle` / `ProposalAware`.
16
+ - Capability ctx: `SchemeCtx` + `EntryCaps` / `ChannelCaps` / `TagCaps` / `NotifyCaps` / `SubscriptionCaps` / `CrossSchemeCaps`, plus `EntryData` / `ChannelState` / `SubscriptionHandle` / `ProposalAware`.
17
17
 
18
- ### Helpers
18
+ ### Helpers (`export default class`, static methods)
19
19
 
20
- - `resolveForLoop(handlers, flags)` — active-scheme resolution under loop flags.
21
- - `isBinaryMimetype` / `isLineNavigableMimetype` / `isJsonMimetype` / `normalizeAutoTextMimetype` / `TEXT_PRIMITIVE_MIMETYPE` — mimetype classification.
22
- - `sliceLines` / `sliceLinesRaw` / `sliceJsonItems` / `applyLineMarkerEdit` / `applyJsonItemEdit` — `<L>` slicing + structural EDIT.
23
- - `resolveEntryMimetype(pathname, default, mimetypes)` — path-extension mimetype resolver.
24
- - `matchAgainstContent(body, content, mimetype, mimetypes, baseLine?)` — body-matcher dispatch adapter over `Mimetypes.query` (glob/regex/jsonpath/xpath).
25
- - Result builders/guards: `schemeError` / `logCoordinate` / `isEntryResult` / `isProposalResult` / `isPassthroughResult` / `isErrorStatus`.
20
+ - `SchemeResolver.forLoop(handlers, flags)` — active-scheme resolution under loop flags.
21
+ - `MimetypeClassifier.isBinary` / `.isLineNavigable` / `.isJson` / `.normalizeAutoText` (+ `TEXT_PRIMITIVE_MIMETYPE` named export) — mimetype classification.
22
+ - `Slicer.lines` / `.linesRaw` / `.jsonItems` / `.lineMarkerEdit` / `.jsonItemEdit` — `<L>` slicing + structural EDIT.
23
+ - `PathMimetype.resolve(pathname, default, mimetypes)` — path-extension mimetype resolver.
24
+ - `Matcher.matchAgainstContent(body, content, mimetype, mimetypes, baseLine?)` — body-matcher dispatch over `Mimetypes.query` (glob/regex/jsonpath/xpath).
25
+ - `Results.error` / `.logCoordinate` / `.isEntry` / `.isProposal` / `.isPassthrough` / `.isErrorStatus` — result builders + guards.
26
26
 
27
27
  The **capability ctx** (`SchemeCtx`) is the DB-free authoring surface for siblings — interfaces only; plurnk-service injects the db-backed impl (see SPEC §3.bis). The db-backed implementations themselves (CRUD primitives, entry-op handlers, channel writes, subscription registry) stay in plurnk-service.
28
28
 
package/SPEC.md CHANGED
@@ -79,35 +79,44 @@ 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` / `VisibilityCaps` / `TagCaps` / `NotifyCaps` / `SubscriptionCaps` / `CrossSchemeCaps`, plus `EntryData`, `ChannelState`, `SubscriptionHandle`, `ProposalAware`.
82
+ - Capability ctx (PR-2, see §3.bis): `SchemeCtx` + `EntryCaps` / `ChannelCaps` / `TagCaps` / `NotifyCaps` / `SubscriptionCaps` / `CrossSchemeCaps`, plus `EntryData`, `ChannelState`, `SubscriptionHandle`, `ProposalAware`.
83
83
 
84
- ### Active-scheme resolution
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
 
86
- - `resolveForLoop(handlers: Map<string, object>, flags: LoopFlags): Set<string>` applies `manifest.flags` affinity to each handler and returns names of schemes active under the loop's flags.
86
+ ### Active-scheme resolution — `SchemeResolver`
87
87
 
88
- ### Mimetype classification
88
+ - `SchemeResolver.forLoop(handlers: ReadonlyMap<string, object>, flags: LoopFlags): Set<string>` — applies `manifest.flags` affinity to each handler and returns names of schemes active under the loop's flags.
89
89
 
90
- - `isBinaryMimetype(mimetype)`enforces 415 boundary on binary entries (text/* is text; application/{json,yaml,toml,xml,javascript,typescript,sql} is text; `+json`/`+xml`/`+yaml` suffix variants are text; everything else with a slash is binary).
91
- - `isJsonMimetype(mimetype)` — `application/json` plus `+json` variants. Used by `<L>` dispatch.
92
- - `isLineNavigableMimetype(mimetype)` — render-layer decides whether to prefix lines with `N:\t`.
93
- - `normalizeAutoTextMimetype(mimetype)` — `text/plain` / null / undefined → `TEXT_PRIMITIVE_MIMETYPE` (`text/markdown`).
94
- - `TEXT_PRIMITIVE_MIMETYPE` — `"text/markdown"`.
90
+ ### Mimetype classification — `MimetypeClassifier`
95
91
 
96
- ### `<L>` slicing
92
+ - `MimetypeClassifier.isBinary(mimetype)` — enforces 415 boundary on binary entries (text/* is text; application/{json,yaml,toml,xml,javascript,typescript,sql} is text; `+json`/`+xml`/`+yaml` suffix variants are text; everything else with a slash is binary).
93
+ - `MimetypeClassifier.isJson(mimetype)` — `application/json` plus `+json` variants. Used by `<L>` dispatch.
94
+ - `MimetypeClassifier.isLineNavigable(mimetype)` — render-layer decides whether to prefix lines with `N:\t`.
95
+ - `MimetypeClassifier.normalizeAutoText(mimetype)` — `text/plain` / null / undefined → `TEXT_PRIMITIVE_MIMETYPE` (`text/markdown`).
96
+ - `TEXT_PRIMITIVE_MIMETYPE` — `"text/markdown"` (named export from the same module).
97
97
 
98
- - `sliceLines(content, marker)`line-navigable slice. Returns `{ status, text?, startLine?, error? }`.
99
- - `sliceLinesRaw(content, marker)` — same shape; no `N:\t` prefix.
100
- - `sliceJsonItems(content, marker)` — JSON-source item slice. Returns `{ status, body?, error? }`.
101
- - `applyLineMarkerEdit(content, marker, body)` — line-navigable EDIT.
102
- - `applyJsonItemEdit(content, marker, body)` — structural JSON EDIT.
98
+ ### `<L>` slicing — `Slicer`
103
99
 
104
- ### Path-extension mimetype
100
+ - `Slicer.lines(content, marker)` — line-navigable slice. Returns `{ status, text?, startLine?, error? }`.
101
+ - `Slicer.linesRaw(content, marker)` — same shape; no `N:\t` prefix.
102
+ - `Slicer.jsonItems(content, marker)` — JSON-source item slice. Returns `{ status, body?, error? }`.
103
+ - `Slicer.lineMarkerEdit(content, marker, body)` — line-navigable EDIT.
104
+ - `Slicer.jsonItemEdit(content, marker, body)` — structural JSON EDIT.
105
105
 
106
- - `resolveEntryMimetype(pathname, defaultMimetype, mimetypes)` pathname extension → `Mimetypes.detect({ ext })`; falls back to `defaultMimetype` when no extension. text/plain auto-normalizes to text/markdown.
106
+ ### Path-extension mimetype — `PathMimetype`
107
107
 
108
- ### Matcher dispatch
108
+ - `PathMimetype.resolve(pathname, defaultMimetype, mimetypes)` — pathname extension → `Mimetypes.detect({ ext })`; falls back to `defaultMimetype` when no extension. text/plain auto-normalizes to text/markdown.
109
109
 
110
- - `matchAgainstContent(body, content, mimetype, mimetypes, baseLine?)` body-matcher adapter over `Mimetypes.query`. Maps framework errors:
110
+ ### Result families — `Results`
111
+
112
+ - `Results.isEntry` / `Results.isProposal` / `Results.isPassthrough` — `shape` discriminator guards over `SchemeResult`.
113
+ - `Results.isErrorStatus(status)` — `status >= 400`.
114
+ - `Results.error(scheme, kind, message?, position?)` — build a scheme-sourced `TelemetryEvent` (`source: "scheme:<name>"`).
115
+ - `Results.logCoordinate(coordinate, op?)` — build a `LogCoordinate` position.
116
+
117
+ ### Matcher dispatch — `Matcher`
118
+
119
+ - `Matcher.matchAgainstContent(body, content, mimetype, mimetypes, baseLine?)` — body-matcher adapter over `Mimetypes.query` (glob/regex/jsonpath/xpath, all served by the framework). Maps framework errors:
111
120
  - `UnsupportedDialectError` → status 415
112
121
  - `InvalidExpressionError` → status 400
113
122
  - `QueryParseFailureError` → status 203 (soft fallback: raw content as text/markdown with `reason`)
@@ -118,15 +127,16 @@ Result-type definitions (`EditResult`, `ReadResult`, etc.) live in plurnk-servic
118
127
 
119
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).
120
129
 
121
- `SchemeCtx` carries per-dispatch identity (`sessionId`/`runId`/`loopId`/`turnId`/`writer`/`signal`) plus **six live capability namespaces** replacing raw `db`:
130
+ `SchemeCtx` carries per-dispatch identity (`sessionId`/`runId`/`loopId`/`turnId`/`writer`/`signal`) plus **five live capability namespaces** replacing raw `db`:
122
131
 
123
132
  - `entries` — CRUD over the scheme's own namespace (`read`/`write`/`delete`).
124
133
  - `channels` — content writes + state (`append`/`replace`/`setState`).
125
- - `visibility` — the per-(run, entry, channel) index bit (`show`/`hide`, channel optional).
126
134
  - `tags` — entry tags (`add`/`remove`/`list`).
127
135
  - `notify` — between-turn client/engine signals (`streamEvent`, `wakeRun`); not model-facing.
128
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).
129
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
+
130
140
  `crossScheme` is a **deferred** placeholder — no FROM/TO methods committed until the first real cross-scheme COPY/MOVE forces the shape.
131
141
 
132
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":"AAiCA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAIjE,MAAM,MAAM,YAAY,G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e;IAC5B,QAAQ,CAAC,SAAS,EAAE,8FAA8F,CAAC;CACtH;AAMD,MAAM,WAAW,SAAS;IACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,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"}
package/dist/ctx.js CHANGED
@@ -14,12 +14,14 @@
14
14
  // during transition; the cap impl is a thin adapter over the same
15
15
  // `_entry-*.ts` / `ChannelWrite` helpers, cut over scheme-by-scheme.
16
16
  //
17
- // SIX live namespaces decompose what `ctx.db` is used for today:
18
- // entries / channels / visibility / tags / notify — map 1:1 onto the
19
- // `_entry-*.ts` + `ChannelWrite` helpers; wrap cleanly.
20
- // subscriptions — the streaming
21
- // lifecycle (open/notifyChunk/close); design against Exec, the proven
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,iEAAiE;AACjE,wEAAwE;AACxE,4DAA4D;AAC5D,sEAAsE;AACtE,0EAA0E;AAC1E,sCAAsC;AACtC,EAAE;AACF,mBAAmB;AACnB,0EAA0E;AAC1E,6EAA6E;AAC7E,6EAA6E;AAC7E,2EAA2E;AAC3E,4CAA4C;AAC5C,2EAA2E;AAC3E,wEAAwE;AACxE,iEAAiE"}
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
@@ -1,13 +1,13 @@
1
1
  export type { LoopFlags, SchemeFlagAffinity, SchemeManifest, WriterTier, } from "./types.ts";
2
2
  export { DEFAULT_LOOP_FLAGS } from "./types.ts";
3
- export { resolveForLoop } from "./resolveForLoop.ts";
4
- export { isBinaryMimetype, isJsonMimetype, isLineNavigableMimetype, normalizeAutoTextMimetype, TEXT_PRIMITIVE_MIMETYPE, } from "./mimetype-binary.ts";
5
- export { applyJsonItemEdit, applyLineMarkerEdit, sliceJsonItems, sliceLines, sliceLinesRaw, } from "./line-marker.ts";
3
+ export { default as SchemeResolver } from "./resolveForLoop.ts";
4
+ export { default as MimetypeClassifier, TEXT_PRIMITIVE_MIMETYPE } from "./mimetype-binary.ts";
5
+ export { default as Slicer } from "./line-marker.ts";
6
6
  export type { EditResult as LineEditResult, JsonSliceResult, SliceResult } from "./line-marker.ts";
7
- export { resolveEntryMimetype } from "./path-mimetype.ts";
8
- export { matchAgainstContent } from "./matcher.ts";
7
+ export { default as PathMimetype } from "./path-mimetype.ts";
8
+ export { default as Matcher } from "./matcher.ts";
9
9
  export type { MatchResult } from "./matcher.ts";
10
- export { isEntryResult, isErrorStatus, isPassthroughResult, isProposalResult, logCoordinate, schemeError, } from "./results.ts";
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, VisibilityCaps, } from "./ctx.ts";
12
+ export type { ChannelCaps, ChannelState, CrossSchemeCaps, EntryCaps, EntryData, NotifyCaps, ProposalAware, SchemeCtx, SubscriptionCaps, SubscriptionHandle, TagCaps, } from "./ctx.ts";
13
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACR,SAAS,EACT,kBAAkB,EAClB,cAAc,EACd,UAAU,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EACH,gBAAgB,EAChB,cAAc,EACd,uBAAuB,EACvB,yBAAyB,EACzB,uBAAuB,GAC1B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACH,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,UAAU,EACV,aAAa,GAChB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,UAAU,IAAI,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEnG,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EACH,aAAa,EACb,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,EACb,WAAW,GACd,MAAM,cAAc,CAAC;AACtB,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,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,kBAAkB,EAClB,OAAO,EACP,cAAc,GACjB,MAAM,UAAU,CAAC"}
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,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,kBAAkB,EAClB,OAAO,GACV,MAAM,UAAU,CAAC"}
package/dist/index.js CHANGED
@@ -1,8 +1,15 @@
1
+ // Public API barrel for @plurnk/plurnk-schemes.
2
+ //
3
+ // Behavior ships as `export default class` (one class per file, static
4
+ // methods) per the ecosystem class paradigm. Type-only modules (types.ts,
5
+ // ctx.ts), the frozen constant (DEFAULT_LOOP_FLAGS), and this barrel are
6
+ // the only non-class files.
1
7
  export { DEFAULT_LOOP_FLAGS } from "./types.js";
2
- export { resolveForLoop } from "./resolveForLoop.js";
3
- export { isBinaryMimetype, isJsonMimetype, isLineNavigableMimetype, normalizeAutoTextMimetype, TEXT_PRIMITIVE_MIMETYPE, } from "./mimetype-binary.js";
4
- export { applyJsonItemEdit, applyLineMarkerEdit, sliceJsonItems, sliceLines, sliceLinesRaw, } from "./line-marker.js";
5
- export { resolveEntryMimetype } from "./path-mimetype.js";
6
- export { matchAgainstContent } from "./matcher.js";
7
- export { isEntryResult, isErrorStatus, isPassthroughResult, isProposalResult, logCoordinate, schemeError, } from "./results.js";
8
+ // ── Behavior classes ─────────────────────────────────────────────────────
9
+ export { default as SchemeResolver } from "./resolveForLoop.js";
10
+ export { default as MimetypeClassifier, TEXT_PRIMITIVE_MIMETYPE } from "./mimetype-binary.js";
11
+ export { default as Slicer } from "./line-marker.js";
12
+ export { default as PathMimetype } from "./path-mimetype.js";
13
+ export { default as Matcher } from "./matcher.js";
14
+ export { default as Results } from "./results.js";
8
15
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EACH,gBAAgB,EAChB,cAAc,EACd,uBAAuB,EACvB,yBAAyB,EACzB,uBAAuB,GAC1B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACH,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,UAAU,EACV,aAAa,GAChB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGnD,OAAO,EACH,aAAa,EACb,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,EACb,WAAW,GACd,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,EAAE;AACF,uEAAuE;AACvE,0EAA0E;AAC1E,yEAAyE;AACzE,4BAA4B;AAS5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,4EAA4E;AAC5E,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;AAErD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC"}
@@ -5,19 +5,22 @@ export interface SliceResult {
5
5
  startLine?: number;
6
6
  error?: string;
7
7
  }
8
- export declare const sliceLines: (content: string, marker: LineMarker) => SliceResult;
9
8
  export interface JsonSliceResult {
10
9
  status: number;
11
10
  body?: string;
12
11
  error?: string;
13
12
  }
14
- export declare const sliceJsonItems: (content: string, marker: LineMarker) => JsonSliceResult;
15
- export declare const applyJsonItemEdit: (content: string, marker: LineMarker, body: string) => EditResult;
16
- export declare const sliceLinesRaw: (content: string, marker: LineMarker) => SliceResult;
17
13
  export interface EditResult {
18
14
  status: number;
19
15
  result?: string;
20
16
  error?: string;
21
17
  }
22
- export declare const applyLineMarkerEdit: (content: string, marker: LineMarker, body: string) => EditResult;
18
+ export default class Slicer {
19
+ #private;
20
+ static lines(content: string, marker: LineMarker): SliceResult;
21
+ static jsonItems(content: string, marker: LineMarker): JsonSliceResult;
22
+ static jsonItemEdit(content: string, marker: LineMarker, body: string): EditResult;
23
+ static linesRaw(content: string, marker: LineMarker): SliceResult;
24
+ static lineMarkerEdit(content: string, marker: LineMarker, body: string): EditResult;
25
+ }
23
26
  //# sourceMappingURL=line-marker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"line-marker.d.ts","sourceRoot":"","sources":["../src/line-marker.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAkCzD,MAAM,WAAW,WAAW;IAAG,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE;AAWlG,eAAO,MAAM,UAAU,GAAI,SAAS,MAAM,EAAE,QAAQ,UAAU,KAAG,WAOhE,CAAC;AAyBF,MAAM,WAAW,eAAe;IAAG,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE;AAElF,eAAO,MAAM,cAAc,GAAI,SAAS,MAAM,EAAE,QAAQ,UAAU,KAAG,eAoBpE,CAAC;AA6GF,eAAO,MAAM,iBAAiB,GAAI,SAAS,MAAM,EAAE,QAAQ,UAAU,EAAE,MAAM,MAAM,KAAG,UAerF,CAAC;AAOF,eAAO,MAAM,aAAa,GAAI,SAAS,MAAM,EAAE,QAAQ,UAAU,KAAG,WAQnE,CAAC;AAEF,MAAM,WAAW,UAAU;IAAG,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE;AAS/E,eAAO,MAAM,mBAAmB,GAAI,SAAS,MAAM,EAAE,QAAQ,UAAU,EAAE,MAAM,MAAM,KAAG,UAiBvF,CAAC"}
1
+ {"version":3,"file":"line-marker.d.ts","sourceRoot":"","sources":["../src/line-marker.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAQzD,MAAM,WAAW,WAAW;IAAG,MAAM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