@plurnk/plurnk-plurnkdown 1.4.0 → 1.6.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 +21 -17
- package/dist/Plurnkdown.d.ts.map +1 -1
- package/dist/Plurnkdown.js +20 -9
- package/dist/Plurnkdown.js.map +1 -1
- package/package.json +2 -2
package/SPEC.md
CHANGED
|
@@ -27,12 +27,12 @@ Markdown strings; a trusted plugin may transform the section list before renderi
|
|
|
27
27
|
flowchart LR
|
|
28
28
|
subgraph system[system slot]
|
|
29
29
|
direction LR
|
|
30
|
-
definition["definition<br/>bare content"] -->
|
|
30
|
+
definition["definition<br/>bare content"] --> policy["Policy"]
|
|
31
|
+
policy --> project["Project Policy"]
|
|
32
|
+
project --> tools["Registered Tools"]
|
|
31
33
|
tools --> optional["Enabled Optional Operations"]
|
|
32
|
-
optional --> schemes["
|
|
34
|
+
optional --> schemes["Resources"]
|
|
33
35
|
schemes --> notes["Operator Notes"]
|
|
34
|
-
notes --> policy["Policy"]
|
|
35
|
-
policy --> project["Project Policy"]
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
subgraph user[user slot]
|
|
@@ -51,12 +51,12 @@ flowchart LR
|
|
|
51
51
|
| Default section | Slot | Wire form | Semantic owner |
|
|
52
52
|
| --------------------- | ------ | --------------------------------------------- | ------------------------------- |
|
|
53
53
|
| `definition` | system | Bare `plurnk.md`; no wrapper heading | {§definition-table-projection} |
|
|
54
|
-
| `
|
|
54
|
+
| `system-policy` | system | Authored Markdown | {§policy-sections} |
|
|
55
|
+
| `project-policy` | system | Authored Markdown | {§policy-sections} |
|
|
56
|
+
| `tools` | system | Generated Markdown capability table | {§tools-capability-sheet} |
|
|
55
57
|
| `optional-operations` | system | `plurnk` fence | {§tools-capability-sheet} |
|
|
56
58
|
| `schemes` | system | `plurnk` fence | {§schemes-directory} |
|
|
57
59
|
| `inject` | system | Authored Markdown | {§packet-inject} |
|
|
58
|
-
| `system-policy` | system | Authored Markdown | {§policy-sections} |
|
|
59
|
-
| `project-policy` | system | Authored Markdown | {§policy-sections} |
|
|
60
60
|
| `log` | user | Dynamic `jsonplurnk` fence | {§jsonplurnk} |
|
|
61
61
|
| `child-streams` | user | `* <status> <path>` pointers | {§child-orientation} |
|
|
62
62
|
| `child-workers` | user | `* <status> <path>` pointers | {§child-orientation} |
|
|
@@ -77,15 +77,15 @@ Plurnkdown preserves the semantic evidence supplied by section owners.
|
|
|
77
77
|
|
|
78
78
|
| Invariant | Required projection |
|
|
79
79
|
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
80
|
-
| Addressability | Paths, URI fragments, log coordinates, scopes, and
|
|
80
|
+
| Addressability | Paths, URI fragments, log coordinates, scopes, and coordinate-prefixed body lines remain usable without translation. |
|
|
81
81
|
| Weighability | The Budget line and log-row `tokens` / `itemsTokenTotal` values remain attached to the artifacts they measure. |
|
|
82
|
-
| Honesty | Statuses, Problems, body visibility,
|
|
82
|
+
| Honesty | Statuses, Problems, body visibility, chunk extents, and bodyless rows render as produced; presentation never upgrades or suppresses truth. |
|
|
83
83
|
| Structure | Typed operation examples and Log data remain typed fences rather than prose paraphrases. |
|
|
84
84
|
|
|
85
85
|
## §packet-operation-fences PLURNK operation fences
|
|
86
86
|
|
|
87
|
-
Model-facing operation examples use fenced blocks with the `plurnk` info string. A
|
|
88
|
-
|
|
87
|
+
Model-facing operation examples use fenced blocks with the `plurnk` info string. A structural
|
|
88
|
+
PLURNK operation heading outside such a fence is an `op-fence` error. Each `plurnk` fence is parsed statement-by-statement by
|
|
89
89
|
`@plurnk/plurnk-contracts`; bounded diagnostics and {§unparsed-tail-boundary} surface as
|
|
90
90
|
`op-syntax` diagnostics under {§parse-diagnostics}.
|
|
91
91
|
|
|
@@ -94,11 +94,15 @@ languages are opaque to the PLURNK syntax check.
|
|
|
94
94
|
|
|
95
95
|
## §packet-jsonplurnk-exception Log fence
|
|
96
96
|
|
|
97
|
-
The Log is a
|
|
98
|
-
deliberately not labeled `json`: an open nonempty `body`
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
97
|
+
The Log is a fixed three-backtick `jsonplurnk` array owned by {§jsonplurnk}. It is valid GFM but
|
|
98
|
+
deliberately not labeled `json`: an open nonempty `body` uses one raw multiline quoted string rather than a JSON-escaped string.
|
|
99
|
+
Every physical body line begins with either a numeric `N:` or anchored
|
|
100
|
+
`@hash N:` coordinate prefix; the latter admits one or more separating ASCII
|
|
101
|
+
spaces. The closing quote appears at column zero before
|
|
102
|
+
either the object close or a following `chunk` member.
|
|
103
|
+
Coordinate prefixes keep source backticks out of the CommonMark closing-fence position, so content
|
|
104
|
+
cannot close the fixed fence. `@plurnk/plurnk-contracts` owns the deterministic transform that
|
|
105
|
+
recovers strict JSON.
|
|
102
106
|
|
|
103
107
|
## §packet-atomic-prose Atomic prose
|
|
104
108
|
|
|
@@ -116,7 +120,7 @@ document-size limit.
|
|
|
116
120
|
|
|
117
121
|
| Rule | Severity | Trigger |
|
|
118
122
|
| ----------- | ---------------- | -------------------------------------------------------------------------- |
|
|
119
|
-
| `op-fence` | error | A
|
|
123
|
+
| `op-fence` | error | A PLURNK operation heading occurs outside a `plurnk` fence. |
|
|
120
124
|
| `op-syntax` | error or warning | A `plurnk` fence contains a parser diagnostic, advisory, or unparsed tail. |
|
|
121
125
|
| `run-on` | warning | Paragraph prose crosses an atomic-prose threshold. |
|
|
122
126
|
|
package/dist/Plurnkdown.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plurnkdown.d.ts","sourceRoot":"","sources":["../src/Plurnkdown.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"Plurnkdown.d.ts","sourceRoot":"","sources":["../src/Plurnkdown.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAS7C,MAAM,CAAC,OAAO,OAAO,UAAU;;IAC3B,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,EAAE,CAajC;CAwFJ"}
|
package/dist/Plurnkdown.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Lexer } from "marked";
|
|
2
|
-
import { PlurnkParser } from "@plurnk/plurnk-contracts";
|
|
2
|
+
import { PLURNK_OPS, PlurnkParser } from "@plurnk/plurnk-contracts";
|
|
3
3
|
const RUNON_LIMIT = 180; // a long run-on regardless of structure
|
|
4
4
|
const WELD_LIMIT = 120; // a semicolon welding clauses in a non-trivial sentence
|
|
5
|
+
const PROTOCOL_OPS = new Set(PLURNK_OPS);
|
|
6
|
+
const CLIENT_OPS = new Set(["LOOK", "BUFF"]);
|
|
5
7
|
// Structural blocks are not prose. Bare paragraph operations require fences;
|
|
6
8
|
// contracts owns fenced statement parsing. {§packet-operation-fences} {§packet-atomic-prose}
|
|
7
9
|
export default class Plurnkdown {
|
|
@@ -9,22 +11,31 @@ export default class Plurnkdown {
|
|
|
9
11
|
const diagnostics = [];
|
|
10
12
|
let line = 1;
|
|
11
13
|
for (const token of Lexer.lex(source)) {
|
|
12
|
-
if (token.type === "
|
|
13
|
-
this.#checkBareOps(token, line, diagnostics);
|
|
14
|
-
this.#checkRunOns(token, line, diagnostics);
|
|
15
|
-
}
|
|
16
|
-
else if (token.type === "code" && token.lang === "plurnk") {
|
|
14
|
+
if (token.type === "code" && token.lang === "plurnk") {
|
|
17
15
|
this.#checkFencedOps(token.text, line, diagnostics);
|
|
18
16
|
}
|
|
17
|
+
else {
|
|
18
|
+
this.#checkBareOps(token, line, diagnostics);
|
|
19
|
+
if (token.type === "paragraph")
|
|
20
|
+
this.#checkRunOns(token, line, diagnostics);
|
|
21
|
+
}
|
|
19
22
|
line += this.#newlines(token.raw);
|
|
20
23
|
}
|
|
21
24
|
return diagnostics;
|
|
22
25
|
}
|
|
23
|
-
// A Plurnk
|
|
24
|
-
//
|
|
26
|
+
// A structural Plurnk heading outside a fence is a bare op. Markdown tokenizes
|
|
27
|
+
// it as a heading, not prose, so inspect every non-fence block. {§op-shapes}
|
|
25
28
|
#checkBareOps(token, line, diagnostics) {
|
|
26
29
|
token.raw.split("\n").forEach((text, index) => {
|
|
27
|
-
|
|
30
|
+
const match = /^(#{1,2}) ([A-Z]+)[A-Za-z0-9_]*(?=$|[ \t])/.exec(text);
|
|
31
|
+
if (match === null)
|
|
32
|
+
return;
|
|
33
|
+
const [, marks, op] = match;
|
|
34
|
+
const isProtocolHeading = op === "PLAN"
|
|
35
|
+
? marks === "#"
|
|
36
|
+
: marks === "##" && PROTOCOL_OPS.has(op);
|
|
37
|
+
const isClientHeading = marks === "##" && CLIENT_OPS.has(op);
|
|
38
|
+
if (!isProtocolHeading && !isClientHeading)
|
|
28
39
|
return;
|
|
29
40
|
diagnostics.push({
|
|
30
41
|
rule: "op-fence",
|
package/dist/Plurnkdown.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plurnkdown.js","sourceRoot":"","sources":["../src/Plurnkdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAA2B,MAAM,QAAQ,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"Plurnkdown.js","sourceRoot":"","sources":["../src/Plurnkdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAA2B,MAAM,QAAQ,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGpE,MAAM,WAAW,GAAG,GAAG,CAAC,CAAC,wCAAwC;AACjE,MAAM,UAAU,GAAG,GAAG,CAAC,CAAE,wDAAwD;AACjF,MAAM,YAAY,GAAG,IAAI,GAAG,CAAS,UAAU,CAAC,CAAC;AACjD,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,C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AAM,EAAE,CAAC;YACzB,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI;gBAAE,SAAS;YAClC,MAAM,QAAQ,GAAI,KAA8B,CAAC,MAAM,CAAC;YACxD,IAAI,QAAQ,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAAC,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;gBAAC,SAAS;YAAC,CAAC;YACtF,MAAM,IAAI,GAAG,KAAwC,CAAC;YACtD,GAAG,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC;QACvC,CAAC;QACD,OAAO,GAAG,CAAC;IACf,CAAC;IAED,SAAS,CAAC,GAAW;QACjB,OAAO,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IACtC,CAAC;CACJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plurnk/plurnk-plurnkdown",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Plurnkdown — the plurnk packet house style (GFM + Mermaid + fenced Plurnk ops) and its linter.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"plurnk",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"node": ">=26"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@plurnk/plurnk-contracts": "1.
|
|
17
|
+
"@plurnk/plurnk-contracts": "1.6.0",
|
|
18
18
|
"marked": "^18.0.5"
|
|
19
19
|
},
|
|
20
20
|
"license": "MIT",
|