@sentropic/focus 0.3.0 → 0.5.0-rc.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.
Files changed (100) hide show
  1. package/README.md +9 -0
  2. package/dist/cli/index.d.ts +1 -1
  3. package/dist/cli/index.d.ts.map +1 -1
  4. package/dist/cli/index.js +12 -3
  5. package/dist/cli/index.js.map +1 -1
  6. package/dist/editing/anchors.d.ts +14 -0
  7. package/dist/editing/anchors.d.ts.map +1 -0
  8. package/dist/editing/anchors.js +113 -0
  9. package/dist/editing/anchors.js.map +1 -0
  10. package/dist/editing/codec.d.ts +24 -0
  11. package/dist/editing/codec.d.ts.map +1 -0
  12. package/dist/editing/codec.js +143 -0
  13. package/dist/editing/codec.js.map +1 -0
  14. package/dist/editing/contract.d.ts +129 -0
  15. package/dist/editing/contract.d.ts.map +1 -0
  16. package/dist/editing/contract.js +76 -0
  17. package/dist/editing/contract.js.map +1 -0
  18. package/dist/editing/diff.d.ts +12 -0
  19. package/dist/editing/diff.d.ts.map +1 -0
  20. package/dist/editing/diff.js +125 -0
  21. package/dist/editing/diff.js.map +1 -0
  22. package/dist/editing/digest.d.ts +6 -0
  23. package/dist/editing/digest.d.ts.map +1 -0
  24. package/dist/editing/digest.js +56 -0
  25. package/dist/editing/digest.js.map +1 -0
  26. package/dist/editing/index.d.ts +7 -0
  27. package/dist/editing/index.d.ts.map +1 -0
  28. package/dist/editing/index.js +7 -0
  29. package/dist/editing/index.js.map +1 -0
  30. package/dist/editing/reconcile.d.ts +66 -0
  31. package/dist/editing/reconcile.d.ts.map +1 -0
  32. package/dist/editing/reconcile.js +167 -0
  33. package/dist/editing/reconcile.js.map +1 -0
  34. package/dist/editing/structure.d.ts +24 -0
  35. package/dist/editing/structure.d.ts.map +1 -0
  36. package/dist/editing/structure.js +71 -0
  37. package/dist/editing/structure.js.map +1 -0
  38. package/dist/index.d.ts +4 -1
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +2 -0
  41. package/dist/index.js.map +1 -1
  42. package/dist/model.d.ts +144 -2
  43. package/dist/model.d.ts.map +1 -1
  44. package/dist/model.js +1 -1
  45. package/dist/model.js.map +1 -1
  46. package/dist/registry/definitions.d.ts +159 -0
  47. package/dist/registry/definitions.d.ts.map +1 -0
  48. package/dist/registry/definitions.js +509 -0
  49. package/dist/registry/definitions.js.map +1 -0
  50. package/dist/render/evidence.d.ts +10 -0
  51. package/dist/render/evidence.d.ts.map +1 -0
  52. package/dist/render/evidence.js +37 -0
  53. package/dist/render/evidence.js.map +1 -0
  54. package/dist/render/html.d.ts.map +1 -1
  55. package/dist/render/html.js +14 -1
  56. package/dist/render/html.js.map +1 -1
  57. package/dist/render/md.d.ts.map +1 -1
  58. package/dist/render/md.js +15 -1
  59. package/dist/render/md.js.map +1 -1
  60. package/dist/render/presentation.d.ts +4 -0
  61. package/dist/render/presentation.d.ts.map +1 -0
  62. package/dist/render/presentation.js +25 -0
  63. package/dist/render/presentation.js.map +1 -0
  64. package/dist/render/terminal.d.ts.map +1 -1
  65. package/dist/render/terminal.js +15 -1
  66. package/dist/render/terminal.js.map +1 -1
  67. package/dist/track/index.d.ts.map +1 -1
  68. package/dist/track/index.js +24 -10
  69. package/dist/track/index.js.map +1 -1
  70. package/dist/validation/evidence-bytes.d.ts +5 -0
  71. package/dist/validation/evidence-bytes.d.ts.map +1 -0
  72. package/dist/validation/evidence-bytes.js +57 -0
  73. package/dist/validation/evidence-bytes.js.map +1 -0
  74. package/dist/validation/evidence-shape.d.ts +12 -0
  75. package/dist/validation/evidence-shape.d.ts.map +1 -0
  76. package/dist/validation/evidence-shape.js +54 -0
  77. package/dist/validation/evidence-shape.js.map +1 -0
  78. package/dist/validation/evidence-sources.d.ts +7 -0
  79. package/dist/validation/evidence-sources.d.ts.map +1 -0
  80. package/dist/validation/evidence-sources.js +56 -0
  81. package/dist/validation/evidence-sources.js.map +1 -0
  82. package/dist/validation/evidence.d.ts +5 -0
  83. package/dist/validation/evidence.d.ts.map +1 -0
  84. package/dist/validation/evidence.js +131 -0
  85. package/dist/validation/evidence.js.map +1 -0
  86. package/dist/validation/index.d.ts +59 -0
  87. package/dist/validation/index.d.ts.map +1 -0
  88. package/dist/validation/index.js +500 -0
  89. package/dist/validation/index.js.map +1 -0
  90. package/dist/validation/readability.d.ts +28 -0
  91. package/dist/validation/readability.d.ts.map +1 -0
  92. package/dist/validation/readability.js +265 -0
  93. package/dist/validation/readability.js.map +1 -0
  94. package/package.json +36 -8
  95. package/registry/entries.v1.json +140 -0
  96. package/schemas/decision-dossier-document.v1.schema.json +193 -0
  97. package/schemas/decision-dossier-document.v2.schema.json +925 -0
  98. package/schemas/focus-edit-return.v1.schema.json +950 -0
  99. package/schemas/focus-editing-manifest.v1.schema.json +167 -0
  100. package/skills/focus/SKILL.md +181 -0
@@ -0,0 +1,265 @@
1
+ import { isEvidenceDossier } from '../model.js';
2
+ export const READABILITY_BUDGETS = { low: 2, medium: 8, high: 30 };
3
+ export const READABILITY_LIMITS = {
4
+ minOwnerRequestQuoteLength: 8,
5
+ minStakesLength: 20,
6
+ minQuestionContextLength: 20,
7
+ minOptionsPerQuestion: 2,
8
+ maxOptionsPerQuestion: 4,
9
+ maxQuestionReadingMinutes: 2,
10
+ maxDossierBudgetMinutes: 30,
11
+ wordsPerMinute: 180,
12
+ maxHeadingLength: 100,
13
+ maxDecisionLineLength: 300,
14
+ maxOptionLabelLength: 100,
15
+ maxConsequenceLength: 160,
16
+ maxOptionBodyLength: 300,
17
+ };
18
+ // Acronyms and opaque codes, including L06b, MH-L3, R5 and CI-4821.
19
+ const CODE_PATTERN = /\b(?:[A-Z][A-Z0-9]*(?:-[A-Z0-9]+)+|[A-Z][A-Z0-9]*\d[A-Z0-9]*[a-z]?|[A-Z]{2,})\b/g;
20
+ // Ordinary outcome words and diagram direction syntax, not internal references.
21
+ const PLAIN_TOKENS = new Set(["GO", "NO-GO", "NO", "PENDING", "DEFERRED", "LR", "RL", "TB", "BT", "TD", "UTF-8"]);
22
+ const CHOICE_PATTERN = /\beither\b[\s\S]{0,160}?\bor\b|\bsoit\b[\s\S]{0,160}?\bsoit\b|\b(?:instead of|rather than|plut[oô]t que|versus|vs\.?|choos(?:e|ing) between|choisir entre)\b/i;
23
+ const SUBOPTION_PATTERN = /(?:^|[\n\r\u2028\u2029])\s*(?:[-*+•‣>]|\d+[.)]|[a-z][.)])\s+\S|\([a-z]\)[\s\S]*\([a-z]\)|\b(?:sub[- ]?options?|sous[- ]?options?)\b/i;
24
+ const LINE_BREAK = /[\n\r\u2028\u2029]/;
25
+ const blank = (text) => !text?.trim();
26
+ const asRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
27
+ const minutesFor = (texts) => (texts.join(" ").match(/\S+/gu)?.length ?? 0) / READABILITY_LIMITS.wordsPerMinute;
28
+ /** Check a structurally valid document; use ForPresentation for untrusted input. */
29
+ export const validateDecisionDossierReadability = (doc) => {
30
+ const issues = [];
31
+ const refuse = (path, code, message) => { issues.push({ path, code, message }); };
32
+ const r = doc.readability;
33
+ const quote = r?.ownerRequestQuote?.trim() ?? "";
34
+ if (r?.noOwnerRequest === true) {
35
+ refuse("$.readability.noOwnerRequest", quote ? "conflicting_owner_request" : "presentation_blocked", quote ? "A quoted owner request conflicts with noOwnerRequest: keep the literal request and remove the flag."
36
+ : "No owner request: presentation is blocked until the owner's literal request is quoted.");
37
+ }
38
+ else if (!quote) {
39
+ refuse("$.readability.ownerRequestQuote", "missing_owner_request", "Quote the literal owner request this dossier serves, or set noOwnerRequest to block presentation explicitly.");
40
+ }
41
+ else if (quote.length < READABILITY_LIMITS.minOwnerRequestQuoteLength) {
42
+ refuse("$.readability.ownerRequestQuote", "owner_request_too_short", "Quote the full literal owner request so the owner recognizes their own intention.");
43
+ }
44
+ if (blank(r?.stakes)) {
45
+ refuse("$.readability.stakes", "missing_stakes", "State why the decision matters to the owner, using plain words about cost, time or consequences.");
46
+ }
47
+ else if (r.stakes.trim().length < READABILITY_LIMITS.minStakesLength) {
48
+ refuse("$.readability.stakes", "stakes_too_short", "Explain the actual consequence for the owner in at least 20 characters; an internal label is insufficient.");
49
+ }
50
+ const level = r?.stakesLevel;
51
+ if (!level || !Object.hasOwn(READABILITY_BUDGETS, level)) {
52
+ refuse("$.readability.stakesLevel", "missing_stakes_level", "Declare stakesLevel: low for a small reversible inconvenience, medium for cost/disruption, high for lasting or major impact.");
53
+ }
54
+ const budget = r?.readingBudgetMinutes;
55
+ const budgetValid = budget !== undefined && Number.isFinite(budget) && budget >= 1 && budget <= READABILITY_LIMITS.maxDossierBudgetMinutes;
56
+ if (budget === undefined) {
57
+ refuse("$.readability.readingBudgetMinutes", "missing_reading_budget", "Declare a total reading budget in minutes proportionate to the stakes: low up to 2, medium up to 8, high up to 30.");
58
+ }
59
+ else if (!budgetValid) {
60
+ refuse("$.readability.readingBudgetMinutes", "reading_budget_out_of_range", "The total reading budget must be a finite number between 1 and 30 minutes.");
61
+ }
62
+ else if (level && Object.hasOwn(READABILITY_BUDGETS, level) && budget > READABILITY_BUDGETS[level]) {
63
+ refuse("$.readability.readingBudgetMinutes", "reading_budget_disproportionate", `The ${level} stakes budget is at most ${READABILITY_BUDGETS[level]} minutes; shorten this dossier or justify a different stakes level.`);
64
+ }
65
+ const glossary = new Map();
66
+ r?.glossary?.forEach((entry, i) => {
67
+ if (blank(entry.term) || blank(entry.definition)) {
68
+ refuse(`$.readability.glossary[${i}]`, "empty_glossary_entry", "Give every glossary term a definition in plain words visible to the reader.");
69
+ }
70
+ else {
71
+ const term = entry.term.trim();
72
+ if (glossary.has(term) || entry.definition.trim() === term) {
73
+ refuse(`$.readability.glossary[${i}]`, "invalid_glossary_entry", "Use one definition per term and expand its meaning; repeating the code does not explain it.");
74
+ }
75
+ if ((entry.definition.match(CODE_PATTERN) ?? []).some((code) => !PLAIN_TOKENS.has(code))) {
76
+ refuse(`$.readability.glossary[${i}].definition`, "invalid_glossary_entry", "Explain each term independently in plain words, without itself or another code, even one defined elsewhere.");
77
+ }
78
+ glossary.set(term, entry.definition);
79
+ }
80
+ });
81
+ const checkCodes = (text, path) => {
82
+ for (const code of new Set(text?.match(CODE_PATTERN) ?? [])) {
83
+ if (!PLAIN_TOKENS.has(code) && !glossary.has(code)) {
84
+ refuse(path, "undefined_code", `Unexpanded code or acronym "${code}": define it in the visible glossary in plain words, or rewrite it.`);
85
+ }
86
+ }
87
+ };
88
+ // Shared reading time includes everything displayed outside question/option blocks.
89
+ const shared = [];
90
+ const visible = (text, path) => {
91
+ checkCodes(text, path);
92
+ if (text)
93
+ shared.push(text);
94
+ };
95
+ if (isEvidenceDossier(doc)) {
96
+ doc.sources.forEach((s, i) => { checkCodes(s.title, `$.sources[${i}].title`); checkCodes(s.alt, `$.sources[${i}].alt`); });
97
+ doc.citations.forEach((c, i) => {
98
+ checkCodes(c.label, `$.citations[${i}].label`);
99
+ if (c.locator.kind === 'image')
100
+ checkCodes(c.locator.caption, `$.citations[${i}].locator.caption`);
101
+ });
102
+ doc.evidenceGroups.forEach((g, i) => visible(g.summary, `$.evidenceGroups[${i}].summary`));
103
+ doc.annexes.forEach((a, i) => {
104
+ visible(a.title, `$.annexes[${i}].title`);
105
+ visible(a.summary, `$.annexes[${i}].summary`);
106
+ a.blocks.forEach((b, j) => {
107
+ const path = `$.annexes[${i}].blocks[${j}]`;
108
+ if (b.kind === 'text')
109
+ checkCodes(b.text, `${path}.text`);
110
+ if (b.kind === 'table')
111
+ [...b.columns, ...b.rows.flat()].forEach(t => checkCodes(t, path));
112
+ });
113
+ });
114
+ }
115
+ for (const field of ["title", "subject"]) {
116
+ visible(doc[field], `$.${field}`);
117
+ if (blank(doc[field]))
118
+ refuse(`$.${field}`, "empty_heading", "Name the subject and decision in a short, non-empty line the owner understands.");
119
+ checkLine(doc[field], `$.${field}`, READABILITY_LIMITS.maxHeadingLength);
120
+ }
121
+ visible(quote, "$.readability.ownerRequestQuote");
122
+ visible(r?.stakes, "$.readability.stakes");
123
+ r?.glossary?.forEach((entry, i) => {
124
+ shared.push(entry.term);
125
+ visible(entry.definition, `$.readability.glossary[${i}].definition`);
126
+ });
127
+ const checkSteps = (steps, path) => {
128
+ steps.forEach((step, i) => {
129
+ visible(step.author, `${path}[${i}].author`);
130
+ visible(step.summary, `${path}[${i}].summary`);
131
+ });
132
+ };
133
+ checkSteps(doc.amendmentTrace, "$.amendmentTrace");
134
+ doc.interactions.forEach((action, i) => visible(action.label, `$.interactions[${i}].label`));
135
+ const questions = doc.sections.filter((s) => s.kind === "question");
136
+ const questionIds = new Set(questions.map((q) => q.id));
137
+ if (!questions.length)
138
+ refuse("$.sections", "missing_question", "A decision dossier needs an explicit question with context, options and a recommendation.");
139
+ const checkQuestionRef = (questionId, path, required) => {
140
+ if (blank(questionId)) {
141
+ if (required)
142
+ refuse(path, "hidden_decision", "This content implies a choice without an explicit question: set questionId to the question the owner must answer.");
143
+ }
144
+ else if (!questionIds.has(questionId)) {
145
+ refuse(path, "unknown_question_ref", `Question "${questionId}" does not exist in this dossier; link to an explicit question.`);
146
+ }
147
+ };
148
+ const optionSets = doc.sections.filter((s) => s.kind === "optionSet");
149
+ let totalQuestionMinutes = 0;
150
+ doc.sections.forEach((section, i) => {
151
+ const path = `$.sections[${i}]`;
152
+ switch (section.kind) {
153
+ case "prose":
154
+ visible(section.markdown, `${path}.markdown`);
155
+ checkQuestionRef(section.questionId, `${path}.questionId`, CHOICE_PATTERN.test(section.markdown));
156
+ break;
157
+ case "outcome":
158
+ visible(section.statement, `${path}.statement`);
159
+ checkQuestionRef(section.questionId, `${path}.questionId`, section.modality !== "comment" || CHOICE_PATTERN.test(section.statement));
160
+ break;
161
+ case "diagram":
162
+ visible(section.alt, `${path}.alt`);
163
+ // Keep the fallback's code guard, but count only the representation displayed.
164
+ if (section.scene === undefined)
165
+ visible(section.source, `${path}.source`);
166
+ else
167
+ checkCodes(section.source, `${path}.source`);
168
+ // The interim renderer reads these generic@1 texts instead of the source fallback.
169
+ for (const [family, field] of [["entities", "name"], ["relations", "label"]]) {
170
+ for (const [id, member] of Object.entries(asRecord(section.scene?.[family]))) {
171
+ const attribute = asRecord(asRecord(asRecord(member).attributes)[field]);
172
+ if (attribute.kind === "text" && typeof attribute.value === "string") {
173
+ visible(attribute.value, `${path}.scene.${family}.${id}.attributes.${field}.value`);
174
+ }
175
+ }
176
+ }
177
+ break;
178
+ case "amendmentTrace":
179
+ checkSteps(section.steps, `${path}.steps`);
180
+ break;
181
+ case "optionSet":
182
+ checkQuestionRef(section.questionId, `${path}.questionId`, true);
183
+ checkCodes(section.title, `${path}.title`);
184
+ checkLine(section.title, `${path}.title`, READABILITY_LIMITS.maxHeadingLength);
185
+ section.options.forEach((option, j) => checkOption(option, `${path}.options[${j}]`));
186
+ break;
187
+ case "question": {
188
+ if (blank(section.question))
189
+ refuse(`${path}.question`, "empty_question", "State the explicit decision the owner needs to make in this question.");
190
+ if (blank(section.context)) {
191
+ refuse(`${path}.context`, "missing_question_context", "Add representative context in plain words so the question can be understood on its own.");
192
+ }
193
+ else if (section.context.trim().length < READABILITY_LIMITS.minQuestionContextLength) {
194
+ refuse(`${path}.context`, "question_context_too_short", "Give representative context of at least 20 characters, including what changes for the owner.");
195
+ }
196
+ if (blank(section.recommendedAnswer))
197
+ refuse(`${path}.recommendedAnswer`, "missing_recommendation", "Recommend an option with a short reason that relates to the owner's request and stakes.");
198
+ checkLine(section.question, `${path}.question`, READABILITY_LIMITS.maxDecisionLineLength);
199
+ checkLine(section.recommendedAnswer, `${path}.recommendedAnswer`, READABILITY_LIMITS.maxDecisionLineLength);
200
+ const linked = optionSets.filter((set) => set.questionId === section.id);
201
+ const options = linked.flatMap((set) => set.options);
202
+ if (options.length < 2 || options.length > 4)
203
+ refuse(path, "option_count", `Each question needs 2–4 short options; this question has ${options.length}.`);
204
+ if (!options.some((option) => option.id === section.recommendedOptionId)) {
205
+ refuse(`${path}.recommendedOptionId`, "unknown_recommended_option", "Identify the recommended option by its id among this question's options, with the reason in recommendedAnswer.");
206
+ }
207
+ const texts = [section.question, section.context, section.recommendedAnswer, section.answer,
208
+ options.find((option) => option.id === section.recommendedOptionId)?.label,
209
+ ...linked.map((set) => set.title), ...options.flatMap((o) => [o.label, o.consequence, o.body, o.annotationComment])];
210
+ checkCodes(section.question, `${path}.question`);
211
+ checkCodes(section.context, `${path}.context`);
212
+ checkCodes(section.recommendedAnswer, `${path}.recommendedAnswer`);
213
+ checkCodes(section.answer, `${path}.answer`);
214
+ const minutes = section.readingTimeMinutes;
215
+ const minimum = minutesFor(texts);
216
+ if (minutes === undefined) {
217
+ refuse(`${path}.readingTimeMinutes`, "missing_reading_time", "Estimate the time to read this question, context and options in readingTimeMinutes (up to 2 minutes).");
218
+ }
219
+ else if (!Number.isFinite(minutes) || minutes <= 0 || minutes > 2) {
220
+ refuse(`${path}.readingTimeMinutes`, "reading_time_exceeded", "Each question must take a positive finite time of at most 2 minutes; shorten or split it.");
221
+ }
222
+ else {
223
+ if (minutes < minimum)
224
+ refuse(`${path}.readingTimeMinutes`, "reading_time_underestimated", `This question needs at least ${minimum.toFixed(2)} minutes at 180 words/minute; shorten it or correct its estimate (maximum 2 minutes).`);
225
+ totalQuestionMinutes += Math.max(minutes, minimum);
226
+ }
227
+ break;
228
+ }
229
+ }
230
+ });
231
+ if (budgetValid && totalQuestionMinutes + minutesFor(shared) > budget) {
232
+ refuse("$.readability.readingBudgetMinutes", "reading_budget_exceeded", "The questions plus shared context and glossary exceed the declared reading budget; shorten the dossier to match its stakes.");
233
+ }
234
+ return issues;
235
+ function checkLine(text, path, max) {
236
+ if (!text)
237
+ return;
238
+ if (text.trim().length > max || LINE_BREAK.test(text))
239
+ refuse(path, "decision_line_too_long", `Use one short line of at most ${max} characters; put explanation in the question context.`);
240
+ if (SUBOPTION_PATTERN.test(text))
241
+ refuse(path, "nested_suboptions", "Expose sub-choices as separate options or questions, without nested lists or inline branches.");
242
+ }
243
+ function checkOption(option, path) {
244
+ const fields = [
245
+ { field: "label", text: option.label, max: READABILITY_LIMITS.maxOptionLabelLength, code: "option_too_long" },
246
+ { field: "consequence", text: option.consequence, max: READABILITY_LIMITS.maxConsequenceLength, code: "consequence_too_long" },
247
+ { field: "body", text: option.body, max: READABILITY_LIMITS.maxOptionBodyLength, code: "option_too_long" },
248
+ { field: "annotationComment", text: option.annotationComment, max: READABILITY_LIMITS.maxOptionBodyLength, code: "option_too_long" },
249
+ ];
250
+ if (blank(option.label))
251
+ refuse(`${path}.label`, "empty_option_label", "Name this option in a few plain words so the owner can compare it at a glance.");
252
+ if (blank(option.consequence))
253
+ refuse(`${path}.consequence`, "missing_consequence", "Add a one-line consequence: what choosing this option changes for the owner.");
254
+ for (const { field, text, max, code } of fields) {
255
+ if (!text)
256
+ continue;
257
+ checkCodes(text, `${path}.${field}`);
258
+ if (text.trim().length > max || LINE_BREAK.test(text))
259
+ refuse(`${path}.${field}`, code, `Keep this option ${field} to one short line of at most ${max} characters; move necessary context to the question.`);
260
+ if (SUBOPTION_PATTERN.test(text) || CHOICE_PATTERN.test(text))
261
+ refuse(`${path}.${field}`, "nested_suboptions", "This option hides sub-options: expose the choices as separate options or as a separate question.");
262
+ }
263
+ }
264
+ };
265
+ //# sourceMappingURL=readability.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readability.js","sourceRoot":"","sources":["../../src/validation/readability.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGhD,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAW,CAAC;AAC5E,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,0BAA0B,EAAE,CAAC;IAC7B,eAAe,EAAE,EAAE;IACnB,wBAAwB,EAAE,EAAE;IAC5B,qBAAqB,EAAE,CAAC;IACxB,qBAAqB,EAAE,CAAC;IACxB,yBAAyB,EAAE,CAAC;IAC5B,uBAAuB,EAAE,EAAE;IAC3B,cAAc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gBAAE,MAAM,CAAC,GAAG,IAAI,IAAI,KAAK,EAAE,EAAE,mBAAmB,EAAE,kGAAkG,CAAC,CAAC;QACrN,CAAC;IACH,CAAC;AACH,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,17 +1,25 @@
1
1
  {
2
2
  "name": "@sentropic/focus",
3
- "version": "0.3.0",
3
+ "version": "0.5.0-rc.1",
4
4
  "description": "Focused-session document runtime (FocusSnapshot): the concrete decision-dossier document model + deterministic terminal/MD/HTML renderers + a /track read binding over @sentropic/track/read + a /cli read-only driver (stp focus). Read-only snapshot render-core; markdown injected by the host, HTML sanitized by the host. (Focus-M1 L3)",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "git+https://github.com/rhanka/sentropic.git",
9
+ "url": "git+https://github.com/rhanka/h2a.git",
10
10
  "directory": "packages/focus"
11
11
  },
12
+ "homepage": "https://github.com/rhanka/h2a/tree/main/packages/focus#readme",
12
13
  "main": "./dist/index.js",
13
14
  "types": "./dist/index.d.ts",
14
15
  "exports": {
16
+ "./package.json": "./package.json",
17
+ "./editing": {
18
+ "types": "./dist/editing/index.d.ts",
19
+ "import": "./dist/editing/index.js"
20
+ },
21
+ "./schemas/focus-edit-return.v1": "./schemas/focus-edit-return.v1.schema.json",
22
+ "./schemas/focus-editing-manifest.v1": "./schemas/focus-editing-manifest.v1.schema.json",
15
23
  ".": {
16
24
  "types": "./dist/index.d.ts",
17
25
  "import": "./dist/index.js"
@@ -23,10 +31,24 @@
23
31
  "./cli": {
24
32
  "types": "./dist/cli/index.d.ts",
25
33
  "import": "./dist/cli/index.js"
26
- }
34
+ },
35
+ "./validate": {
36
+ "types": "./dist/validation/index.d.ts",
37
+ "import": "./dist/validation/index.js"
38
+ },
39
+ "./registry/manifest": "./registry/entries.v1.json",
40
+ "./registry/definitions": {
41
+ "types": "./dist/registry/definitions.d.ts",
42
+ "import": "./dist/registry/definitions.js"
43
+ },
44
+ "./schemas/decision-dossier-document.v1": "./schemas/decision-dossier-document.v1.schema.json",
45
+ "./schemas/decision-dossier-document.v2": "./schemas/decision-dossier-document.v2.schema.json"
27
46
  },
28
47
  "files": [
29
48
  "dist",
49
+ "registry/entries.v1.json",
50
+ "schemas/",
51
+ "skills/",
30
52
  "README.md",
31
53
  "LICENSE"
32
54
  ],
@@ -36,14 +58,20 @@
36
58
  "sideEffects": false,
37
59
  "scripts": {
38
60
  "build": "tsc -p tsconfig.json",
39
- "typecheck": "tsc --noEmit -p tsconfig.json"
61
+ "typecheck": "tsc --noEmit -p tsconfig.json",
62
+ "test": "vitest run",
63
+ "prepack": "npm run build",
64
+ "registry:sync": "node scripts/sync-registry-entry.mjs"
40
65
  },
41
66
  "dependencies": {
42
- "@sentropic/track": "^0.17.0"
67
+ "@lezer/markdown": "1.8.0",
68
+ "@noble/hashes": "2.0.1",
69
+ "@sentropic/track": "0.98.8-rc.1",
70
+ "yaml": "2.9.0"
43
71
  },
44
72
  "devDependencies": {
45
- "@types/node": "^20.12.0",
46
- "typescript": "5.4.5",
47
- "vitest": "4.0.18"
73
+ "@types/node": "^22.19.19",
74
+ "typescript": "^5.9.3",
75
+ "vitest": "^4.1.11"
48
76
  }
49
77
  }
@@ -0,0 +1,140 @@
1
+ {
2
+ "format": "sentropic.registry-package/v1",
3
+ "entries": [
4
+ {
5
+ "format": "sentropic.registry-entry/v1",
6
+ "contractVersion": "1.1.4",
7
+ "kind": "skill",
8
+ "id": "sentropic.focus",
9
+ "name": "focus",
10
+ "description": "Prepare and review readable decision dossiers that trace the owner's request, expose real stakes and offer short explicit choices. Read-only snapshots; no decisions, signatures, amendments or Track writes.",
11
+ "entryVersion": "2.0.0",
12
+ "publisher": {
13
+ "packageName": "@sentropic/focus",
14
+ "packageVersion": "0.5.0"
15
+ },
16
+ "compatibility": {
17
+ "entryContract": "1.1.4",
18
+ "packages": [
19
+ {
20
+ "name": "@sentropic/track",
21
+ "range": "^0.98.6"
22
+ }
23
+ ],
24
+ "schemaProfiles": [
25
+ "sentropic.parameters/2020-12-bounded-v1"
26
+ ],
27
+ "requiredHostFeatures": [],
28
+ "optionalHostFeatures": [
29
+ "terminal",
30
+ "markdown",
31
+ "html-sanitization",
32
+ "mcp-app-ui"
33
+ ]
34
+ },
35
+ "parameters": {
36
+ "schemaVersion": "1.0.0",
37
+ "schema": {
38
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
39
+ "$id": "urn:sentropic:registry:parameters:sentropic.focus:1.0.0",
40
+ "type": "object",
41
+ "additionalProperties": false,
42
+ "required": [
43
+ "mode",
44
+ "preferredPresentation",
45
+ "locale"
46
+ ],
47
+ "properties": {
48
+ "mode": {
49
+ "const": "snapshot"
50
+ },
51
+ "preferredPresentation": {
52
+ "enum": [
53
+ "terminal",
54
+ "markdown",
55
+ "html",
56
+ "mcp-app"
57
+ ]
58
+ },
59
+ "locale": {
60
+ "enum": [
61
+ "en",
62
+ "fr"
63
+ ]
64
+ }
65
+ }
66
+ },
67
+ "defaults": {
68
+ "mode": "snapshot",
69
+ "preferredPresentation": "markdown",
70
+ "locale": "en"
71
+ }
72
+ },
73
+ "bindings": [],
74
+ "assets": [
75
+ {
76
+ "role": "skill-instructions",
77
+ "path": "skills/focus/SKILL.md",
78
+ "mediaType": "text/markdown",
79
+ "sha256": "4845682823695a3d6646cbf447f260c00bad3cea5a1c852088f256ecdc3e603d"
80
+ },
81
+ {
82
+ "role": "document-schema",
83
+ "path": "schemas/decision-dossier-document.v1.schema.json",
84
+ "mediaType": "application/schema+json",
85
+ "sha256": "725bc07e7c6b6ad51a1f720cc9fb02649d8f31bc54e71c61c350fd20058c8852"
86
+ },
87
+ {
88
+ "role": "document-schema",
89
+ "path": "schemas/decision-dossier-document.v2.schema.json",
90
+ "mediaType": "application/schema+json",
91
+ "sha256": "1a8059e5264785cd15c74b7fcfc04cbe42c575203b4232af43819e094846f5a9"
92
+ }
93
+ ],
94
+ "skill": {
95
+ "profile": "instructions",
96
+ "metadata": {
97
+ "category": "decision",
98
+ "contextFilters": [
99
+ "decision-dossier"
100
+ ],
101
+ "permissions": [
102
+ "track.dossier.read"
103
+ ],
104
+ "toolNames": []
105
+ },
106
+ "instructionsAsset": "skills/focus/SKILL.md",
107
+ "capabilities": [
108
+ {
109
+ "id": "sentropic.focus.decision-dossier",
110
+ "description": "Prepare, explain and review a read-only decision-dossier snapshot under the host's own permissions; never signs, amends or writes.",
111
+ "effect": "read-only",
112
+ "permissions": [
113
+ "track.dossier.read"
114
+ ],
115
+ "inputSchemaRef": "urn:sentropic:focus:DecisionDossierDocument:2.0.0",
116
+ "outputSchemaRef": "urn:sentropic:focus:DecisionDossierDocument:2.0.0"
117
+ }
118
+ ],
119
+ "tools": [],
120
+ "documentSchemas": [
121
+ {
122
+ "name": "DecisionDossierDocument",
123
+ "schemaId": "urn:sentropic:focus:DecisionDossierDocument:1.0.0",
124
+ "version": "1.0.0",
125
+ "assetPath": "schemas/decision-dossier-document.v1.schema.json",
126
+ "sha256": "725bc07e7c6b6ad51a1f720cc9fb02649d8f31bc54e71c61c350fd20058c8852"
127
+ },
128
+ {
129
+ "name": "DecisionDossierDocument",
130
+ "schemaId": "urn:sentropic:focus:DecisionDossierDocument:2.0.0",
131
+ "version": "2.0.0",
132
+ "assetPath": "schemas/decision-dossier-document.v2.schema.json",
133
+ "sha256": "1a8059e5264785cd15c74b7fcfc04cbe42c575203b4232af43819e094846f5a9"
134
+ }
135
+ ],
136
+ "dependencies": []
137
+ }
138
+ }
139
+ ]
140
+ }