@plurnk/plurnk-schemes 1.3.12 → 1.5.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 +43 -17
- package/SPEC.md +368 -86
- package/dist/Manifest.d.ts +6 -0
- package/dist/Manifest.d.ts.map +1 -0
- package/dist/Manifest.js +115 -0
- package/dist/Manifest.js.map +1 -0
- package/dist/Matcher.d.ts +5 -6
- package/dist/Matcher.d.ts.map +1 -1
- package/dist/Matcher.js +51 -59
- package/dist/Matcher.js.map +1 -1
- package/dist/MimetypeClassifier.d.ts +1 -1
- package/dist/MimetypeClassifier.d.ts.map +1 -1
- package/dist/MimetypeClassifier.js +11 -15
- package/dist/MimetypeClassifier.js.map +1 -1
- package/dist/NetworkAddress.d.ts +13 -0
- package/dist/NetworkAddress.d.ts.map +1 -0
- package/dist/NetworkAddress.js +43 -0
- package/dist/NetworkAddress.js.map +1 -0
- package/dist/OutputScheme.d.ts.map +1 -1
- package/dist/OutputScheme.js +5 -6
- package/dist/OutputScheme.js.map +1 -1
- package/dist/PacketSections.d.ts +6 -0
- package/dist/PacketSections.d.ts.map +1 -0
- package/dist/PacketSections.js +42 -0
- package/dist/PacketSections.js.map +1 -0
- package/dist/PathMimetype.js +9 -9
- package/dist/PathMimetype.js.map +1 -1
- package/dist/Results.d.ts +42 -8
- package/dist/Results.d.ts.map +1 -1
- package/dist/Results.js +132 -44
- package/dist/Results.js.map +1 -1
- package/dist/SchemeDiscovery.d.ts +2 -0
- package/dist/SchemeDiscovery.d.ts.map +1 -1
- package/dist/SchemeDiscovery.js +40 -42
- package/dist/SchemeDiscovery.js.map +1 -1
- package/dist/SchemeResolver.d.ts.map +1 -1
- package/dist/SchemeResolver.js +4 -5
- package/dist/SchemeResolver.js.map +1 -1
- package/dist/Slicer.d.ts +27 -14
- package/dist/Slicer.d.ts.map +1 -1
- package/dist/Slicer.js +382 -374
- package/dist/Slicer.js.map +1 -1
- package/dist/Summarize.js +3 -3
- package/dist/Summarize.js.map +1 -1
- package/dist/ctx.d.ts +70 -67
- package/dist/ctx.d.ts.map +1 -1
- package/dist/edit-receipt.d.ts +39 -0
- package/dist/edit-receipt.d.ts.map +1 -0
- package/dist/edit-receipt.js +2 -0
- package/dist/edit-receipt.js.map +1 -0
- package/dist/handler.d.ts +13 -10
- package/dist/handler.d.ts.map +1 -1
- package/dist/handler.js +7 -5
- package/dist/handler.js.map +1 -1
- package/dist/index.d.ts +14 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/packet.d.ts +2 -3
- package/dist/packet.d.ts.map +1 -1
- package/dist/packet.js +2 -20
- package/dist/packet.js.map +1 -1
- package/dist/types.d.ts +3 -11
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -7
- package/dist/types.js.map +1 -1
- package/package.json +10 -8
- package/dist/DefaultRead.d.ts +0 -11
- package/dist/DefaultRead.d.ts.map +0 -1
- package/dist/DefaultRead.js +0 -27
- package/dist/DefaultRead.js.map +0 -1
package/dist/packet.js
CHANGED
|
@@ -1,22 +1,4 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
// A scheme MAY reshape the packet's section list — add / remove / reorder —
|
|
4
|
-
// before the engine measures it. The engine builds its default section list,
|
|
5
|
-
// then pipes it through every registered scheme that implements
|
|
6
|
-
// `transformSections`, in registration order. It's the trusted, in-process seam
|
|
7
|
-
// for plugin packet control (the client wire never touches the packet), and the
|
|
8
|
-
// fork-avoidance valve: a plugin that can reshape the packet to its needs has no
|
|
9
|
-
// reason to fork the engine.
|
|
10
|
-
//
|
|
11
|
-
// OPTIONAL and STANDALONE — compose it with SchemeHandler:
|
|
12
|
-
// export default class X implements SchemeHandler, PacketSectionTransformer {…}
|
|
13
|
-
// The engine calls it duck-typed (`typeof handler.transformSections === "function"`),
|
|
14
|
-
// so declaring it here just gives an external author a typed surface + discovery.
|
|
15
|
-
//
|
|
16
|
-
// `PacketSection` is the engine's packet-row shape — service-owned at runtime
|
|
17
|
-
// (grammar 0.67 dropped `Packet.json`), but the CONTRACT declares the shape so a
|
|
18
|
-
// sibling can implement the hook without importing plurnk-service; service
|
|
19
|
-
// conforms its packet builder to it. Same direction as `SchemeManifest` /
|
|
20
|
-
// `SchemeCtx`: contract declares, service implements.
|
|
1
|
+
// {§scheme-packet-transform} — public authoring surface for trusted packet
|
|
2
|
+
// transforms. Measurement remains core-owned.
|
|
21
3
|
export {};
|
|
22
4
|
//# sourceMappingURL=packet.js.map
|
package/dist/packet.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packet.js","sourceRoot":"","sources":["../src/packet.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"packet.js","sourceRoot":"","sources":["../src/packet.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,8CAA8C"}
|
package/dist/types.d.ts
CHANGED
|
@@ -3,14 +3,12 @@ export interface SchemeFlagAffinity {
|
|
|
3
3
|
readonly excludedInAsk?: boolean;
|
|
4
4
|
readonly requiresWeb?: boolean;
|
|
5
5
|
readonly requiresInteraction?: boolean;
|
|
6
|
-
readonly proposes?: boolean;
|
|
7
6
|
}
|
|
8
7
|
export interface SchemeManifest {
|
|
9
8
|
readonly name: string;
|
|
10
9
|
readonly channels: Record<string, string>;
|
|
11
10
|
readonly defaultChannel: string;
|
|
12
11
|
readonly category: "data" | "logging" | "control";
|
|
13
|
-
readonly scope: "workspace" | "worker";
|
|
14
12
|
readonly writableBy: ReadonlyArray<WriterTier>;
|
|
15
13
|
readonly volatile: boolean;
|
|
16
14
|
readonly modelVisible: boolean;
|
|
@@ -20,14 +18,8 @@ export interface SchemeManifest {
|
|
|
20
18
|
readonly example?: string;
|
|
21
19
|
readonly documentation?: string;
|
|
22
20
|
readonly glyph?: string;
|
|
23
|
-
readonly storedScheme?: string
|
|
21
|
+
readonly storedScheme?: string;
|
|
24
22
|
}
|
|
25
|
-
export
|
|
26
|
-
|
|
27
|
-
readonly auto: boolean;
|
|
28
|
-
readonly noWeb: boolean;
|
|
29
|
-
readonly noInteraction: boolean;
|
|
30
|
-
readonly noProposals: boolean;
|
|
31
|
-
}
|
|
32
|
-
export declare const DEFAULT_LOOP_FLAGS: LoopFlags;
|
|
23
|
+
export type { LoopFlags } from "@plurnk/plurnk-contracts";
|
|
24
|
+
export { DEFAULT_LOOP_FLAGS } from "@plurnk/plurnk-contracts";
|
|
33
25
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAElE,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAElE,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC1C;AAED,MAAM,WAAW,cAAc;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAG1C,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAGhC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;IAClD,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IAC/C,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAI/B,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAIhC,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IACnC,QAAQ,CAAC,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAKpC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAGhC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAGxB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAClC;AAID,YAAY,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/types.js
CHANGED
|
@@ -7,11 +7,5 @@
|
|
|
7
7
|
// in the consumer. Sister schemes consume the parts of ctx the engine
|
|
8
8
|
// supplies them per dispatch; this repo ships only the manifest + flag
|
|
9
9
|
// types every sibling needs to declare itself.
|
|
10
|
-
export
|
|
11
|
-
mode: "act",
|
|
12
|
-
auto: false,
|
|
13
|
-
noWeb: false,
|
|
14
|
-
noInteraction: false,
|
|
15
|
-
noProposals: false,
|
|
16
|
-
});
|
|
10
|
+
export { DEFAULT_LOOP_FLAGS } from "@plurnk/plurnk-contracts";
|
|
17
11
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,qCAAqC;AACrC,EAAE;AACF,6EAA6E;AAC7E,6EAA6E;AAC7E,yEAAyE;AACzE,sEAAsE;AACtE,uEAAuE;AACvE,+CAA+C;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,qCAAqC;AACrC,EAAE;AACF,6EAA6E;AAC7E,6EAA6E;AAC7E,yEAAyE;AACzE,sEAAsE;AACtE,uEAAuE;AACvE,+CAA+C;AAgD/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plurnk/plurnk-schemes",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Framework + contract for the @plurnk/plurnk-schemes-* URI handler packages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"plurnk",
|
|
7
7
|
"scheme",
|
|
8
8
|
"uri"
|
|
9
9
|
],
|
|
10
|
-
"homepage": "https://github.com/plurnk/plurnk-schemes#readme",
|
|
10
|
+
"homepage": "https://github.com/plurnk/plurnk-service/tree/main/plurnk-schemes#readme",
|
|
11
11
|
"bugs": {
|
|
12
|
-
"url": "https://
|
|
12
|
+
"url": "https://repo.possumtech.com/plurnk/plurnk-service/issues"
|
|
13
13
|
},
|
|
14
14
|
"repository": {
|
|
15
15
|
"type": "git",
|
|
16
|
-
"url": "git+https://github.com/plurnk/plurnk-
|
|
16
|
+
"url": "git+https://github.com/plurnk/plurnk-service.git",
|
|
17
|
+
"directory": "plurnk-schemes"
|
|
17
18
|
},
|
|
18
19
|
"engines": {
|
|
19
20
|
"node": ">=26"
|
|
@@ -41,16 +42,17 @@
|
|
|
41
42
|
"test:lint": "tsc --noEmit",
|
|
42
43
|
"test:unit": "node --conditions=plurnk-dev --test src/**/*.test.ts",
|
|
43
44
|
"test": "npm run test:lint && npm run test:unit",
|
|
45
|
+
"build:clean": "rm -rf dist",
|
|
44
46
|
"build:dist": "tsc -p tsconfig.build.json",
|
|
45
|
-
"build": "npm run build:dist",
|
|
47
|
+
"build": "npm run build:clean && npm run build:dist",
|
|
46
48
|
"prepublishOnly": "npm audit --audit-level=moderate && npm test",
|
|
47
49
|
"prepack": "npm run build"
|
|
48
50
|
},
|
|
49
51
|
"peerDependencies": {
|
|
50
|
-
"@plurnk/plurnk-
|
|
51
|
-
"@plurnk/plurnk-mimetypes": "^1.3.12"
|
|
52
|
+
"@plurnk/plurnk-mimetypes": "^1.5.0"
|
|
52
53
|
},
|
|
53
54
|
"dependencies": {
|
|
54
|
-
"@plurnk/plurnk-
|
|
55
|
+
"@plurnk/plurnk-contracts": "1.5.0",
|
|
56
|
+
"@plurnk/plurnk-meta": "1.5.0"
|
|
55
57
|
}
|
|
56
58
|
}
|
package/dist/DefaultRead.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { ReadStatement } from "@plurnk/plurnk-grammar";
|
|
2
|
-
import type { Mimetypes } from "@plurnk/plurnk-mimetypes";
|
|
3
|
-
export interface ReadResolution {
|
|
4
|
-
readonly status: number;
|
|
5
|
-
readonly body?: string;
|
|
6
|
-
readonly error?: string;
|
|
7
|
-
}
|
|
8
|
-
export default class DefaultRead {
|
|
9
|
-
static read(content: string, mimetype: string, statement: ReadStatement, mimetypes: Mimetypes): Promise<ReadResolution>;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=DefaultRead.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultRead.d.ts","sourceRoot":"","sources":["../src/DefaultRead.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAI1D,MAAM,WAAW,cAAc;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,CAAC,OAAO,OAAO,WAAW;IAK5B,OAAa,IAAI,CACb,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,aAAa,EACxB,SAAS,EAAE,SAAS,GACrB,OAAO,CAAC,cAAc,CAAC,CAUzB;CACJ"}
|
package/dist/DefaultRead.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// The free default READ an executor-scheme inherits (executor-is-a-scheme RFC —
|
|
2
|
-
// schemes#20 / service#240): generic `<L>` slicing and matcher-dialect resolve
|
|
3
|
-
// over a produced output blob, reusing Slicer + Matcher so the slicing logic is
|
|
4
|
-
// single-sourced (not forked into BaseExecutor). A pure resolver — given the
|
|
5
|
-
// stored output + the READ statement, it returns WHICH slice to serve; the
|
|
6
|
-
// executor-scheme delivers it. READ-purity holds: this reads already-produced
|
|
7
|
-
// output, it never triggers EXEC.
|
|
8
|
-
import Slicer from "./Slicer.js";
|
|
9
|
-
import Matcher from "./Matcher.js";
|
|
10
|
-
export default class DefaultRead {
|
|
11
|
-
// Resolve a READ against an output blob:
|
|
12
|
-
// matcher body present → Matcher dispatch (glob/regex/jsonpath/xpath via Mimetypes.query)
|
|
13
|
-
// else <L> line marker → Slicer slice
|
|
14
|
-
// else → the whole blob
|
|
15
|
-
static async read(content, mimetype, statement, mimetypes) {
|
|
16
|
-
if (statement.body !== null) {
|
|
17
|
-
const m = await Matcher.matchAgainstContent(statement.body, content, mimetype, mimetypes);
|
|
18
|
-
return { status: m.status, body: m.body, error: m.error };
|
|
19
|
-
}
|
|
20
|
-
if (statement.lineMarker !== null) {
|
|
21
|
-
const s = Slicer.lines(content, statement.lineMarker);
|
|
22
|
-
return { status: s.status, body: s.text, error: s.error };
|
|
23
|
-
}
|
|
24
|
-
return { status: 200, body: content };
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=DefaultRead.js.map
|
package/dist/DefaultRead.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultRead.js","sourceRoot":"","sources":["../src/DefaultRead.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,+EAA+E;AAC/E,gFAAgF;AAChF,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA8E;AAC9E,kCAAkC;AAIlC,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,OAAO,MAAM,cAAc,CAAC;AAQnC,MAAM,CAAC,OAAO,OAAO,WAAW;IAC5B,yCAAyC;IACzC,6FAA6F;IAC7F,yCAAyC;IACzC,2CAA2C;IAC3C,MAAM,CAAC,KAAK,CAAC,IAAI,CACb,OAAe,EACf,QAAgB,EAChB,SAAwB,EACxB,SAAoB;QAEpB,IAAI,SAAS,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;YAC1B,MAAM,CAAC,GAAG,MAAM,OAAO,CAAC,mBAAmB,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;YAC1F,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;QAC9D,CAAC;QACD,IAAI,SAAS,CAAC,UAAU,KAAK,IAAI,EAAE,CAAC;YAChC,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;YACtD,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;QAC9D,CAAC;QACD,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IAC1C,CAAC;CACJ"}
|