@opetope/devtools 0.1.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/CHANGELOG.md +5 -0
- package/LICENSE +21 -0
- package/README.md +105 -0
- package/README.ru.md +105 -0
- package/dist/activity-export.d.ts +4 -0
- package/dist/activity.d.ts +63 -0
- package/dist/conformance-activity.d.ts +8 -0
- package/dist/conformance.d.ts +37 -0
- package/dist/control-subject.d.ts +15 -0
- package/dist/control-ui-DMmVy9Ob.js +16 -0
- package/dist/control-ui-DMmVy9Ob.js.map +1 -0
- package/dist/control.d.ts +45 -0
- package/dist/corpus.d.ts +33 -0
- package/dist/decode-activity.d.ts +4 -0
- package/dist/decode-shapes.d.ts +32 -0
- package/dist/decode-values.d.ts +36 -0
- package/dist/decode.d.ts +41 -0
- package/dist/digest.d.ts +17 -0
- package/dist/export-run-DIQZax_d.js +2 -0
- package/dist/export-run-DIQZax_d.js.map +1 -0
- package/dist/export-snapshot-Buw-c6ZG.js +2 -0
- package/dist/export-snapshot-Buw-c6ZG.js.map +1 -0
- package/dist/export-snapshot.d.ts +34 -0
- package/dist/extension-points.d.ts +45 -0
- package/dist/fixture-plan.d.ts +62 -0
- package/dist/fixture-runtime.d.ts +37 -0
- package/dist/fixture.d.ts +23 -0
- package/dist/fold-snapshot-DjiURn8v.js +2 -0
- package/dist/fold-snapshot-DjiURn8v.js.map +1 -0
- package/dist/fold-snapshot.d.ts +15 -0
- package/dist/graph-index.d.ts +104 -0
- package/dist/graph-store.d.ts +77 -0
- package/dist/graph.d.ts +211 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/inspector.d.ts +70 -0
- package/dist/install.d.ts +44 -0
- package/dist/install.js +2 -0
- package/dist/install.js.map +1 -0
- package/dist/integration.d.ts +42 -0
- package/dist/integration.js +2 -0
- package/dist/integration.js.map +1 -0
- package/dist/legend-DT7j0_pD.js +2 -0
- package/dist/legend-DT7j0_pD.js.map +1 -0
- package/dist/node-facts.d.ts +20 -0
- package/dist/node-state.d.ts +152 -0
- package/dist/optional.d.ts +9 -0
- package/dist/panel-5jvisQBr.js +367 -0
- package/dist/panel-5jvisQBr.js.map +1 -0
- package/dist/producer-ids.d.ts +15 -0
- package/dist/protocol-joKTjlMj.js +2 -0
- package/dist/protocol-joKTjlMj.js.map +1 -0
- package/dist/protocol.d.ts +238 -0
- package/dist/react/activity-rows.d.ts +12 -0
- package/dist/react/activity-view.d.ts +9 -0
- package/dist/react/control-locale.d.ts +25 -0
- package/dist/react/control-styles.d.ts +7 -0
- package/dist/react/control-ui.d.ts +37 -0
- package/dist/react/edge-filter.d.ts +36 -0
- package/dist/react/edge-filters.d.ts +17 -0
- package/dist/react/export-delivery.d.ts +33 -0
- package/dist/react/export-run.d.ts +20 -0
- package/dist/react/format.d.ts +17 -0
- package/dist/react/glyph.d.ts +20 -0
- package/dist/react/graph-layout.d.ts +67 -0
- package/dist/react/graph-view.d.ts +30 -0
- package/dist/react/graph-viewport.d.ts +48 -0
- package/dist/react/icons.d.ts +12 -0
- package/dist/react/inspector-view.d.ts +29 -0
- package/dist/react/label.d.ts +28 -0
- package/dist/react/lazy-module.d.ts +38 -0
- package/dist/react/legend-locale.d.ts +23 -0
- package/dist/react/legend.d.ts +10 -0
- package/dist/react/locale-context.d.ts +17 -0
- package/dist/react/locale.d.ts +115 -0
- package/dist/react/main-column.d.ts +22 -0
- package/dist/react/panel-header.d.ts +20 -0
- package/dist/react/panel-mode.d.ts +3 -0
- package/dist/react/panel-status.d.ts +19 -0
- package/dist/react/panel.d.ts +41 -0
- package/dist/react/search-results.d.ts +18 -0
- package/dist/react/selection.d.ts +15 -0
- package/dist/react/styles.d.ts +13 -0
- package/dist/react/theme.d.ts +39 -0
- package/dist/react/timeline-locale.d.ts +20 -0
- package/dist/react/timeline-view.d.ts +14 -0
- package/dist/react/tree.d.ts +26 -0
- package/dist/react/use-store.d.ts +11 -0
- package/dist/react.d.ts +16 -0
- package/dist/react.js +2 -0
- package/dist/react.js.map +1 -0
- package/dist/search-CC7avy6I.js +2 -0
- package/dist/search-CC7avy6I.js.map +1 -0
- package/dist/search.d.ts +20 -0
- package/dist/session-qjKT0E69.js +2 -0
- package/dist/session-qjKT0E69.js.map +1 -0
- package/dist/session.d.ts +59 -0
- package/dist/testing.d.ts +10 -0
- package/dist/testing.js +4 -0
- package/dist/testing.js.map +1 -0
- package/dist/timeline-view-ByPB1a7-.js +2 -0
- package/dist/timeline-view-ByPB1a7-.js.map +1 -0
- package/dist/timeline.d.ts +57 -0
- package/dist/visual-axes.d.ts +35 -0
- package/package.json +107 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trusted attach, per `docs/devtools.md` §3.1: one call in the application composition root, and nothing else in the
|
|
3
|
+
* application knows this package exists.
|
|
4
|
+
*
|
|
5
|
+
* The application hands over the `ApplicationExecution` that `openApplication` returned and nothing else. Opening the
|
|
6
|
+
* observation port — and, under `mode: 'control'`, the write port — happens here, because `@opetope/runtime/internal`
|
|
7
|
+
* is a seam between library packages rather than a surface an application is meant to reach (D248). The earlier form
|
|
8
|
+
* that took ready sessions is replaced in every consumer by the same commit rather than kept beside this one (D35):
|
|
9
|
+
* a host that could still pass its own sessions would be a second way to own them.
|
|
10
|
+
*
|
|
11
|
+
* Feature `ui/models/data/repositories` must not import this module — it is the only surface that will ever hold a
|
|
12
|
+
* control authority, and source lint keeps it out of feature code. The npm export map is not the security boundary.
|
|
13
|
+
*/
|
|
14
|
+
import type { ApplicationExecution } from '@opetope/runtime/internal';
|
|
15
|
+
import type { DevtoolsHandle } from './install.js';
|
|
16
|
+
import type { DevtoolsMode } from './react/panel.js';
|
|
17
|
+
import type { DevtoolsTheme } from './react/theme.js';
|
|
18
|
+
import type { DevtoolsSessionOptions } from './session.js';
|
|
19
|
+
type InstallDevtoolsOptions = Readonly<{
|
|
20
|
+
/** Where the drawer mounts. Defaults to a `div` appended to `document.body`, owned by this call. */
|
|
21
|
+
container?: HTMLElement;
|
|
22
|
+
/** The running application, exactly as `openApplication` returned it: both ports are keyed by its identity (§3.2). */
|
|
23
|
+
execution: ApplicationExecution;
|
|
24
|
+
/**
|
|
25
|
+
* `control` opens the write port beside the observation one; `inspect`, the default, leaves the panel read-only and
|
|
26
|
+
* never asks the runtime for an authority it would not use.
|
|
27
|
+
*/
|
|
28
|
+
mode?: DevtoolsMode;
|
|
29
|
+
sessionOptions?: DevtoolsSessionOptions;
|
|
30
|
+
theme?: DevtoolsTheme;
|
|
31
|
+
}>;
|
|
32
|
+
/**
|
|
33
|
+
* Opens the ports, installs the panel and returns the detach. Both sessions belong to the returned handle: `close()`
|
|
34
|
+
* closes the observation session and, with it, every override the write session put in place.
|
|
35
|
+
*
|
|
36
|
+
* An execution already holds at most one live control session (D191), so a second install on the same one throws out
|
|
37
|
+
* of here — a failed install, not a panel that quietly came up read-only. Whatever this call has taken by then is
|
|
38
|
+
* given back before the throw leaves it (§7).
|
|
39
|
+
*/
|
|
40
|
+
declare function installDevtools(options: InstallDevtoolsOptions): DevtoolsHandle;
|
|
41
|
+
export { installDevtools };
|
|
42
|
+
export type { DevtoolsHandle, InstallDevtoolsOptions };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createInspectionSession as t,createControlSession as r}from"@opetope/runtime/internal";import{installPanel as s}from"./install.js";function c(e){const o=t(e.execution);try{const n=e.mode==="control"?r(e.execution):void 0;return s({container:e.container,control:n,mode:e.mode,session:o,sessionOptions:e.sessionOptions,theme:e.theme})}catch(n){throw o.close(),n}}export{c as installDevtools};
|
|
2
|
+
//# sourceMappingURL=integration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration.js","sources":["../src/integration.ts"],"sourcesContent":["/**\n * Trusted attach, per `docs/devtools.md` §3.1: one call in the application composition root, and nothing else in the\n * application knows this package exists.\n *\n * The application hands over the `ApplicationExecution` that `openApplication` returned and nothing else. Opening the\n * observation port — and, under `mode: 'control'`, the write port — happens here, because `@opetope/runtime/internal`\n * is a seam between library packages rather than a surface an application is meant to reach (D248). The earlier form\n * that took ready sessions is replaced in every consumer by the same commit rather than kept beside this one (D35):\n * a host that could still pass its own sessions would be a second way to own them.\n *\n * Feature `ui/models/data/repositories` must not import this module — it is the only surface that will ever hold a\n * control authority, and source lint keeps it out of feature code. The npm export map is not the security boundary.\n */\n\nimport { createControlSession, createInspectionSession } from '@opetope/runtime/internal';\nimport type { ApplicationExecution } from '@opetope/runtime/internal';\n\nimport { installPanel } from './install';\nimport type { DevtoolsHandle } from './install';\nimport type { DevtoolsMode } from './react/panel';\nimport type { DevtoolsTheme } from './react/theme';\nimport type { DevtoolsSessionOptions } from './session';\n\ntype InstallDevtoolsOptions = Readonly<{\n /** Where the drawer mounts. Defaults to a `div` appended to `document.body`, owned by this call. */\n container?: HTMLElement;\n /** The running application, exactly as `openApplication` returned it: both ports are keyed by its identity (§3.2). */\n execution: ApplicationExecution;\n /**\n * `control` opens the write port beside the observation one; `inspect`, the default, leaves the panel read-only and\n * never asks the runtime for an authority it would not use.\n */\n mode?: DevtoolsMode;\n sessionOptions?: DevtoolsSessionOptions;\n theme?: DevtoolsTheme;\n}>;\n\n/**\n * Opens the ports, installs the panel and returns the detach. Both sessions belong to the returned handle: `close()`\n * closes the observation session and, with it, every override the write session put in place.\n *\n * An execution already holds at most one live control session (D191), so a second install on the same one throws out\n * of here — a failed install, not a panel that quietly came up read-only. Whatever this call has taken by then is\n * given back before the throw leaves it (§7).\n */\nfunction installDevtools(options: InstallDevtoolsOptions): DevtoolsHandle {\n const session = createInspectionSession(options.execution);\n\n try {\n const control = options.mode === 'control' ? createControlSession(options.execution) : undefined;\n\n return installPanel({\n container: options.container,\n control,\n mode: options.mode,\n session,\n sessionOptions: options.sessionOptions,\n theme: options.theme,\n });\n } catch (error) {\n // Closing twice is harmless — the connection closes the producer as well — and closing not at all leaks the slot.\n session.close();\n\n throw error;\n }\n}\n\nexport { installDevtools };\nexport type { DevtoolsHandle, InstallDevtoolsOptions };\n"],"names":["installDevtools","options","session","createInspectionSession","control","createControlSession","installPanel","error"],"mappings":"0IA6CA,SAASA,EAAgBC,EAA+B,CACtD,MAAMC,EAAUC,EAAwBF,EAAQ,SAAS,EAEzD,GAAI,CACF,MAAMG,EAAUH,EAAQ,OAAS,UAAYI,EAAqBJ,EAAQ,SAAS,EAAI,OAEvF,OAAOK,EAAa,CAClB,UAAWL,EAAQ,UACnB,QAAAG,EACA,KAAMH,EAAQ,KACd,QAAAC,EACA,eAAgBD,EAAQ,eACxB,MAAOA,EAAQ,KAChB,CAAA,CACH,OAASM,EAAO,CAEd,MAAAL,EAAQ,MAAK,EAEPK,CACR,CACF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsxs as a,jsx as n}from"react/jsx-runtime";import{m as t,n as o,o as g,S as i,a as r,j as m}from"./panel-5jvisQBr.js";const p={legendBadgeDesired:"what the activation machine wants: active or inactive",legendBadgeHealth:"whether that position is a problem",legendBadgeLifecycle:"where the node sits in its own automaton",legendBadges:"badges",legendEdgeContribution:"contribution",legendEdgeDependency:"dependency",legendEdgeOwnership:"ownership",legendEdges:"edges",legendEdgeWeak:"weak dependency",legendLifecycle:"lifecycle",legendWeakCovers:"reads found or missing, never waits"},h={legendBadgeDesired:"\u0447\u0435\u0433\u043E \u0445\u043E\u0447\u0435\u0442 \u043C\u0430\u0448\u0438\u043D\u0430 \u0430\u043A\u0442\u0438\u0432\u0430\u0446\u0438\u0438: active \u0438\u043B\u0438 inactive",legendBadgeHealth:"\u044F\u0432\u043B\u044F\u0435\u0442\u0441\u044F \u043B\u0438 \u044D\u0442\u043E \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u043E\u0439",legendBadgeLifecycle:"\u0433\u0434\u0435 \u0443\u0437\u0435\u043B \u043D\u0430\u0445\u043E\u0434\u0438\u0442\u0441\u044F \u0432 \u0441\u043E\u0431\u0441\u0442\u0432\u0435\u043D\u043D\u043E\u043C \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0435",legendBadges:"\u0431\u0435\u0439\u0434\u0436\u0438",legendEdgeContribution:"\u0432\u043A\u043B\u0430\u0434",legendEdgeDependency:"\u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E\u0441\u0442\u044C",legendEdgeOwnership:"\u0432\u043B\u0430\u0434\u0435\u043D\u0438\u0435",legendEdges:"\u0440\u0451\u0431\u0440\u0430",legendEdgeWeak:"\u0441\u043B\u0430\u0431\u0430\u044F \u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E\u0441\u0442\u044C",legendLifecycle:"\u0436\u0438\u0437\u043D\u0435\u043D\u043D\u044B\u0439 \u0446\u0438\u043A\u043B",legendWeakCovers:"\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u043A\u0430\u043A found \u0438\u043B\u0438 missing, \u043D\u0438\u043A\u043E\u0433\u0434\u0430 \u043D\u0435 \u0436\u0434\u0451\u0442"};function c(e){return e==="ru"?h:p}function u(e){return[{className:"odt-edge-sample",covers:"hard-import, requires-port",name:e.legendEdgeDependency},{className:"odt-edge-sample",covers:`optional-import, optional-port, absent-import, absent-port \xB7 ${e.legendWeakCovers}`,name:e.legendEdgeWeak},{className:"odt-edge-sample odt-edge-sample-accent",covers:"owns, provides-port, condition-control",name:e.legendEdgeOwnership},{className:"odt-edge-sample odt-edge-sample-dashed",covers:"contributes-to",name:e.legendEdgeContribution}]}function N(e,d){return[{detail:e.legendBadgeDesired,name:d[0]},{detail:e.legendBadgeLifecycle,name:d[1]},{detail:e.legendBadgeHealth,name:d[2]}]}function f(){const e=t(),d=c(o());return a("div",{className:"odt-legend-group",children:[n("h3",{className:"odt-sec",children:d.legendLifecycle}),g.map(s=>a("span",{className:"odt-legend-row",children:[n(i,{state:s}),n(r,{state:s}),n("span",{className:"odt-legend-detail",children:m(s,e)})]},s))]})}function v(){const e=c(o());return a("div",{className:"odt-legend-group",children:[n("h3",{className:"odt-sec",children:e.legendEdges}),u(e).map(d=>a("span",{className:"odt-legend-row",children:[n("span",{className:d.className}),n("span",{className:"odt-legend-name",children:d.name}),n("span",{className:"odt-legend-detail odt-mono",children:d.covers})]},d.name))]})}function E(){const e=t(),d=c(o()),s=[e.axisDesired,e.axisLifecycle,e.axisHealth];return a("div",{className:"odt-legend-group",children:[n("h3",{className:"odt-sec",children:d.legendBadges}),N(d,s).map(l=>a("span",{className:"odt-legend-row",children:[n("span",{className:"odt-tag odt-tag-accent",children:l.name}),n("span",{className:"odt-legend-detail",children:l.detail})]},l.name))]})}function w(){const e=t();return a("section",{"aria-label":e.legend,className:"odt-legend-panel",children:[n(f,{}),n(v,{}),n(E,{})]})}export{w as Legend};
|
|
2
|
+
//# sourceMappingURL=legend-DT7j0_pD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legend-DT7j0_pD.js","sources":["../src/react/legend-locale.ts","../src/react/legend.tsx"],"sourcesContent":["/**\n * The legend's own dictionary, kept out of the panel's (§4.6).\n *\n * The legend is collapsed until a developer asks what a shape means, so its words travel with its code rather than\n * with every panel that never opens it. The discipline is the panel's: English is the source, the Russian record is\n * typed against it, and the protocol vocabulary the legend explains is not translated in either.\n */\n\nimport type { DevtoolsLocale } from './locale';\n\nconst en = {\n legendBadgeDesired: 'what the activation machine wants: active or inactive',\n legendBadgeHealth: 'whether that position is a problem',\n legendBadgeLifecycle: 'where the node sits in its own automaton',\n legendBadges: 'badges',\n legendEdgeContribution: 'contribution',\n legendEdgeDependency: 'dependency',\n legendEdgeOwnership: 'ownership',\n legendEdges: 'edges',\n legendEdgeWeak: 'weak dependency',\n legendLifecycle: 'lifecycle',\n legendWeakCovers: 'reads found or missing, never waits',\n};\n\nconst ru: typeof en = {\n legendBadgeDesired: 'чего хочет машина активации: active или inactive',\n legendBadgeHealth: 'является ли это положение проблемой',\n legendBadgeLifecycle: 'где узел находится в собственном автомате',\n legendBadges: 'бейджи',\n legendEdgeContribution: 'вклад',\n legendEdgeDependency: 'зависимость',\n legendEdgeOwnership: 'владение',\n legendEdges: 'рёбра',\n legendEdgeWeak: 'слабая зависимость',\n legendLifecycle: 'жизненный цикл',\n legendWeakCovers: 'читается как found или missing, никогда не ждёт',\n};\n\nfunction legendStringsFor(locale: DevtoolsLocale): typeof en {\n return locale === 'ru' ? ru : en;\n}\n\nexport { legendStringsFor };\n","/**\n * One legend for the whole panel, per the owner's request: the state glyphs, the three kinds of edge and the badges,\n * in one collapsible place instead of two partial legends pinned to a tree and a canvas.\n *\n * It is collapsed by default. A legend that is always open spends the space a graph needs; a legend that cannot be\n * found is worse than none — so the header carries a button, and the button says whether it is open.\n */\n\nimport type { ReactElement } from 'react';\n\nimport { displayStates, stateDescription, StateGlyph, StateTag } from './glyph';\nimport { legendStringsFor } from './legend-locale';\nimport { useLocale, useStrings } from './locale-context';\n\ntype LegendStrings = ReturnType<typeof legendStringsFor>;\n\ntype EdgeSample = Readonly<{\n className: string;\n covers: string;\n name: string;\n}>;\n\n/**\n * Three visual kinds, not eleven: the panel draws a dependency, an ownership and a contribution, and the legend says\n * which protocol edges fall into each. The names stay untranslated — they are protocol words, not prose.\n */\nfunction edgeSamples(strings: LegendStrings): readonly EdgeSample[] {\n return [\n { className: 'odt-edge-sample', covers: 'hard-import, requires-port', name: strings.legendEdgeDependency },\n {\n className: 'odt-edge-sample',\n covers: `optional-import, optional-port, absent-import, absent-port · ${strings.legendWeakCovers}`,\n name: strings.legendEdgeWeak,\n },\n {\n className: 'odt-edge-sample odt-edge-sample-accent',\n covers: 'owns, provides-port, condition-control',\n name: strings.legendEdgeOwnership,\n },\n {\n className: 'odt-edge-sample odt-edge-sample-dashed',\n covers: 'contributes-to',\n name: strings.legendEdgeContribution,\n },\n ];\n}\n\ntype BadgeSample = Readonly<{\n detail: string;\n name: string;\n}>;\n\nfunction badgeSamples(strings: LegendStrings, axes: readonly [string, string, string]): readonly BadgeSample[] {\n return [\n { detail: strings.legendBadgeDesired, name: axes[0] },\n { detail: strings.legendBadgeLifecycle, name: axes[1] },\n { detail: strings.legendBadgeHealth, name: axes[2] },\n ];\n}\n\nfunction LegendStates(): ReactElement {\n const strings = useStrings();\n const legend = legendStringsFor(useLocale());\n\n return (\n <div className=\"odt-legend-group\">\n <h3 className=\"odt-sec\">{legend.legendLifecycle}</h3>\n {displayStates.map(state => (\n <span key={state} className=\"odt-legend-row\">\n <StateGlyph state={state} />\n <StateTag state={state} />\n <span className=\"odt-legend-detail\">{stateDescription(state, strings)}</span>\n </span>\n ))}\n </div>\n );\n}\n\nfunction LegendEdges(): ReactElement {\n const strings = legendStringsFor(useLocale());\n\n return (\n <div className=\"odt-legend-group\">\n <h3 className=\"odt-sec\">{strings.legendEdges}</h3>\n {edgeSamples(strings).map(sample => (\n <span key={sample.name} className=\"odt-legend-row\">\n <span className={sample.className} />\n <span className=\"odt-legend-name\">{sample.name}</span>\n <span className=\"odt-legend-detail odt-mono\">{sample.covers}</span>\n </span>\n ))}\n </div>\n );\n}\n\nfunction LegendBadges(): ReactElement {\n const panel = useStrings();\n const strings = legendStringsFor(useLocale());\n const axes: readonly [string, string, string] = [panel.axisDesired, panel.axisLifecycle, panel.axisHealth];\n\n return (\n <div className=\"odt-legend-group\">\n <h3 className=\"odt-sec\">{strings.legendBadges}</h3>\n {badgeSamples(strings, axes).map(sample => (\n <span key={sample.name} className=\"odt-legend-row\">\n <span className=\"odt-tag odt-tag-accent\">{sample.name}</span>\n <span className=\"odt-legend-detail\">{sample.detail}</span>\n </span>\n ))}\n </div>\n );\n}\n\nfunction Legend(): ReactElement {\n const strings = useStrings();\n\n return (\n <section aria-label={strings.legend} className=\"odt-legend-panel\">\n <LegendStates />\n <LegendEdges />\n <LegendBadges />\n </section>\n );\n}\n\nexport { Legend };\n"],"names":["en","ru","legendStringsFor","locale","edgeSamples","strings","badgeSamples","axes","LegendStates","useStrings","legend","useLocale","_jsxs","_jsx","displayStates","state","StateGlyph","StateTag","stateDescription","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MAAMlB,EAAUI,EAAU,EAE1B,OACEG,0BAAqBP,EAAQ,OAAQ,UAAU,mBAAkB,SAAA,CAC/DQ,EAACL,EAAY,CAAA,CAAA,EACbK,EAACM,EAAW,CAAA,CAAA,EACZN,EAACQ,EAAY,EAAA,CAAG,EAAA,CAGtB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Small readers over the kind-specific state unions. They exist so the panel and the search index ask "does this node
|
|
3
|
+
* carry a failure" once, in one place, instead of every view re-implementing a `state.kind` switch and drifting.
|
|
4
|
+
*/
|
|
5
|
+
import type { DiagnosticRuntimeNode } from './graph.js';
|
|
6
|
+
import type { DiagnosticFailure } from './protocol.js';
|
|
7
|
+
/** §2.6: a failure is the runtime's own subject and code plus a phase. There is no message, stack or cause to read. */
|
|
8
|
+
declare function failureOf(node: DiagnosticRuntimeNode): DiagnosticFailure | undefined;
|
|
9
|
+
declare function generationOf(node: DiagnosticRuntimeNode): number | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* How far a group has walked its canonical order, in either direction. A count, never a duration.
|
|
12
|
+
*
|
|
13
|
+
* The counts are written in the protocol's own words — the state kind and the numbers it carries — and not as a
|
|
14
|
+
* sentence. A projection that composes prose would be prose no dictionary could reach: this string is built below
|
|
15
|
+
* the view, so an English sentence here would print English in a Russian panel (U21).
|
|
16
|
+
*/
|
|
17
|
+
declare function progressOf(node: DiagnosticRuntimeNode): string | undefined;
|
|
18
|
+
/** Whether this node currently satisfies whoever depends on it. */
|
|
19
|
+
declare function isReadyDisplay(node: DiagnosticRuntimeNode): boolean;
|
|
20
|
+
export { failureOf, generationOf, isReadyDisplay, progressOf };
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kind-specific state automata. Each one is transcribed from a machine that exists in the runtime today, not from a
|
|
3
|
+
* taxonomy the panel would like to have:
|
|
4
|
+
*
|
|
5
|
+
* - the condition group from `runtime/src/condition-group-execution.ts` (D110);
|
|
6
|
+
* - the feature instance from `runtime/src/module-generation.ts` and the `FeatureError` codes of `spec.md` §4;
|
|
7
|
+
* - the attachment from `AttachmentLifecycleSnapshot` in `core/src/attachment-lifecycle-contract.ts`;
|
|
8
|
+
* - the contribution from the hub of D79, where a published contribution with `when` false is withheld from
|
|
9
|
+
* `entries` while staying published;
|
|
10
|
+
* - the port from the application compiler, which selects one provider at compile time (two is a compile error), so
|
|
11
|
+
* the only runtime question left is whether that provider currently has a live instance;
|
|
12
|
+
* - the host contract from `bind(contract, value)` at `openApplication` (D68).
|
|
13
|
+
*
|
|
14
|
+
* There is deliberately no universal `node.status`: collapsing six different automata into one enum is how a debugger
|
|
15
|
+
* starts lying. The three visual axes are derived from these unions in `visual-axes.ts`, never the other way round.
|
|
16
|
+
*/
|
|
17
|
+
import type { DiagnosticCauseRef, DiagnosticClosedReason, DiagnosticFailure, DiagnosticNodeId, DiagnosticSequence, DiagnosticWaitReason, LifecycleAxis } from './protocol.js';
|
|
18
|
+
/**
|
|
19
|
+
* A condition's truth. `source-closed` reads as `false` for the activation machine, and the law that produces it is
|
|
20
|
+
* D93: a condition computed from a retired feature reads `false`. It stays a separate state because "nobody has said
|
|
21
|
+
* yes" and "the feature that would say yes is gone" send a developer to different places.
|
|
22
|
+
*/
|
|
23
|
+
type ConditionState = Readonly<{
|
|
24
|
+
kind: 'false';
|
|
25
|
+
}> | Readonly<{
|
|
26
|
+
kind: 'source-closed';
|
|
27
|
+
}> | Readonly<{
|
|
28
|
+
kind: 'true';
|
|
29
|
+
}>;
|
|
30
|
+
/**
|
|
31
|
+
* The condition group: features whose `when` names the same set of conditions, which is the owner of activation the
|
|
32
|
+
* compiler infers (D93, D102). `opened` and `total` are positions in the canonical order, not a clock.
|
|
33
|
+
*/
|
|
34
|
+
type ConditionGroupState = Readonly<{
|
|
35
|
+
failure: DiagnosticFailure;
|
|
36
|
+
kind: 'failed';
|
|
37
|
+
}> | Readonly<{
|
|
38
|
+
kind: 'active';
|
|
39
|
+
}> | Readonly<{
|
|
40
|
+
kind: 'closed';
|
|
41
|
+
}> | Readonly<{
|
|
42
|
+
kind: 'inactive';
|
|
43
|
+
reason: DiagnosticClosedReason;
|
|
44
|
+
}> | Readonly<{
|
|
45
|
+
kind: 'opening';
|
|
46
|
+
opened: number;
|
|
47
|
+
total: number;
|
|
48
|
+
}> | Readonly<{
|
|
49
|
+
kind: 'retiring';
|
|
50
|
+
remaining: number;
|
|
51
|
+
}>;
|
|
52
|
+
/**
|
|
53
|
+
* One life of one feature: `FeatureInstance` in the author vocabulary (D81, D110). The workspace states carry the
|
|
54
|
+
* `FeatureError` code that produced them, so `not-ready`, `retired`, `quarantined` and `cleanup-failed` here are the
|
|
55
|
+
* same four words the runtime throws.
|
|
56
|
+
*/
|
|
57
|
+
type FeatureInstanceState = Readonly<{
|
|
58
|
+
blockedBy: readonly DiagnosticNodeId[];
|
|
59
|
+
kind: 'waiting';
|
|
60
|
+
reason: DiagnosticWaitReason;
|
|
61
|
+
}> | Readonly<{
|
|
62
|
+
failure: DiagnosticFailure;
|
|
63
|
+
kind: 'cleanup-failed';
|
|
64
|
+
}> | Readonly<{
|
|
65
|
+
failure: DiagnosticFailure;
|
|
66
|
+
kind: 'not-ready';
|
|
67
|
+
}> | Readonly<{
|
|
68
|
+
failure: DiagnosticFailure;
|
|
69
|
+
kind: 'quarantined';
|
|
70
|
+
}> | Readonly<{
|
|
71
|
+
kind: 'draining';
|
|
72
|
+
}> | Readonly<{
|
|
73
|
+
kind: 'fencing';
|
|
74
|
+
}> | Readonly<{
|
|
75
|
+
kind: 'opening';
|
|
76
|
+
}> | Readonly<{
|
|
77
|
+
kind: 'ready';
|
|
78
|
+
}> | Readonly<{
|
|
79
|
+
kind: 'retired';
|
|
80
|
+
reason: DiagnosticClosedReason;
|
|
81
|
+
}>;
|
|
82
|
+
/** Exactly `AttachmentLifecycleSnapshot`: the five states an attachment can report, with its closing phase. */
|
|
83
|
+
type AttachmentState = Readonly<{
|
|
84
|
+
failure: DiagnosticFailure;
|
|
85
|
+
kind: 'failed-close';
|
|
86
|
+
}> | Readonly<{
|
|
87
|
+
kind: 'closed';
|
|
88
|
+
}> | Readonly<{
|
|
89
|
+
kind: 'closing';
|
|
90
|
+
phase: 'close' | 'retry' | 'rollback';
|
|
91
|
+
}> | Readonly<{
|
|
92
|
+
kind: 'opening';
|
|
93
|
+
}> | Readonly<{
|
|
94
|
+
kind: 'ready';
|
|
95
|
+
}>;
|
|
96
|
+
/**
|
|
97
|
+
* A contribution. `withheld` is the state D79 created: the contribution is published and its id is validated, but
|
|
98
|
+
* its `when` reads `false`, so `Slot`, `fold`, `select` and emptiness checks do not see it. Published-and-invisible
|
|
99
|
+
* is not the same fact as withdrawn, and merging them would hide the most common "why is my slot empty".
|
|
100
|
+
*/
|
|
101
|
+
type ContributionState = Readonly<{
|
|
102
|
+
failure: DiagnosticFailure;
|
|
103
|
+
kind: 'rejected';
|
|
104
|
+
}> | Readonly<{
|
|
105
|
+
kind: 'pending';
|
|
106
|
+
}> | Readonly<{
|
|
107
|
+
kind: 'published';
|
|
108
|
+
}> | Readonly<{
|
|
109
|
+
kind: 'withdrawn';
|
|
110
|
+
}> | Readonly<{
|
|
111
|
+
kind: 'withheld';
|
|
112
|
+
}>;
|
|
113
|
+
/**
|
|
114
|
+
* A port. The provider is chosen once, when `defineApplication` compiles the topology, so there is no admission,
|
|
115
|
+
* no candidate set and no ambiguity to report at runtime — two providers are a compile error and `required` without
|
|
116
|
+
* a provider never compiles. What is left is whether the selected provider has a live instance right now, which is
|
|
117
|
+
* what decides between a call that runs and a weak call that settles `CallError('unavailable')` (D105).
|
|
118
|
+
*/
|
|
119
|
+
type PortState = Readonly<{
|
|
120
|
+
instance: DiagnosticNodeId;
|
|
121
|
+
kind: 'available';
|
|
122
|
+
}> | Readonly<{
|
|
123
|
+
kind: 'absent';
|
|
124
|
+
}> | Readonly<{
|
|
125
|
+
kind: 'unavailable';
|
|
126
|
+
provider: DiagnosticNodeId;
|
|
127
|
+
}>;
|
|
128
|
+
/**
|
|
129
|
+
* A host contract. `bound` is a value the host passed to `bind(contract, value)`, `unbound` is a weak host import the
|
|
130
|
+
* host chose not to bind, and `deferred` is `onDemand(hostContract)`, whose connection waits for the attachment that
|
|
131
|
+
* opens it rather than for activation.
|
|
132
|
+
*/
|
|
133
|
+
type HostContractState = Readonly<{
|
|
134
|
+
kind: 'bound';
|
|
135
|
+
}> | Readonly<{
|
|
136
|
+
kind: 'deferred';
|
|
137
|
+
}> | Readonly<{
|
|
138
|
+
kind: 'unbound';
|
|
139
|
+
}>;
|
|
140
|
+
type DiagnosticNodeState = AttachmentState | ConditionGroupState | ConditionState | ContributionState | FeatureInstanceState | HostContractState | PortState;
|
|
141
|
+
/**
|
|
142
|
+
* One step of the chain the inspector shows under "last causal chain". Typed on purpose: the panel formats
|
|
143
|
+
* `<condition> → true` or `<node> · ready` from refs, it does not receive or parse a prose sentence. The step has no
|
|
144
|
+
* clock of its own — `cause.at` is the only one, and it is optional.
|
|
145
|
+
*/
|
|
146
|
+
type DiagnosticCausalStep = Readonly<{
|
|
147
|
+
cause: DiagnosticCauseRef;
|
|
148
|
+
lifecycle?: LifecycleAxis;
|
|
149
|
+
node?: DiagnosticNodeId;
|
|
150
|
+
sequence: DiagnosticSequence;
|
|
151
|
+
}>;
|
|
152
|
+
export type { AttachmentState, ConditionGroupState, ConditionState, ContributionState, DiagnosticCausalStep, DiagnosticNodeState, FeatureInstanceState, HostContractState, PortState, };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `exactOptionalPropertyTypes` forbids writing `undefined` into an optional property, which otherwise turns every
|
|
3
|
+
* optional field into its own conditional spread. This drops absent keys instead, so a projection can be assembled
|
|
4
|
+
* from possibly-absent values in one place.
|
|
5
|
+
*/
|
|
6
|
+
declare function defined<Fields extends object>(fields: {
|
|
7
|
+
[Key in keyof Fields]?: Fields[Key] | undefined;
|
|
8
|
+
}): Fields;
|
|
9
|
+
export { defined };
|