openplanr 2.2639.0 → 2.2639.2
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 +10 -0
- package/dist/cli/commands/init-deterministic.d.ts.map +1 -1
- package/dist/cli/commands/init-deterministic.js +3 -0
- package/dist/cli/commands/init-deterministic.js.map +1 -1
- package/dist/cli/commands/upgrade.d.ts.map +1 -1
- package/dist/cli/commands/upgrade.js +7 -8
- package/dist/cli/commands/upgrade.js.map +1 -1
- package/dist/dashboard/.vite/manifest.json +1 -1
- package/dist/dashboard/assets/{index-AeydhSKa.js → index-lJDcN9xd.js} +2 -2
- package/dist/dashboard/assets/{index-AeydhSKa.js.map → index-lJDcN9xd.js.map} +1 -1
- package/dist/dashboard/dashboard-manifest.json +13 -13
- package/dist/dashboard/index.html +1 -1
- package/dist/services/claude-plugin-service.d.ts +10 -19
- package/dist/services/claude-plugin-service.d.ts.map +1 -1
- package/dist/services/claude-plugin-service.js +26 -200
- package/dist/services/claude-plugin-service.js.map +1 -1
- package/dist/services/runtime-manager-service.d.ts +1 -0
- package/dist/services/runtime-manager-service.d.ts.map +1 -1
- package/dist/services/runtime-manager-service.js +27 -2
- package/dist/services/runtime-manager-service.js.map +1 -1
- package/dist/services/upgrade-offer-service.d.ts.map +1 -1
- package/dist/services/upgrade-offer-service.js +3 -3
- package/dist/services/upgrade-offer-service.js.map +1 -1
- package/dist/services/upgrade-service.d.ts +25 -14
- package/dist/services/upgrade-service.d.ts.map +1 -1
- package/dist/services/upgrade-service.js +57 -30
- package/dist/services/upgrade-service.js.map +1 -1
- package/docs/CLI.md +10 -6
- package/docs/CROSS_RUNTIME_SETUP.md +17 -3
- package/lib/host-packages/adapter-registry.json +5 -5
- package/lib/host-packages/capability-map.json +1 -1
- package/lib/host-packages/claude/.claude-plugin/marketplace.json +2 -2
- package/lib/host-packages/claude/openplanr/.claude-plugin/plugin.json +1 -1
- package/lib/host-packages/claude/openplanr/.openplanr-content.json +16 -16
- package/lib/host-packages/claude/openplanr/skills/ceo-review/scripts/validate-note.mjs +1 -1
- package/lib/host-packages/claude/openplanr/skills/chair-review/scripts/validate-note.mjs +1 -1
- package/lib/host-packages/claude/openplanr/skills/challenger-review/scripts/validate-note.mjs +1 -1
- package/lib/host-packages/claude/openplanr/skills/cmo-review/scripts/validate-note.mjs +1 -1
- package/lib/host-packages/claude/openplanr/skills/coo-review/scripts/validate-note.mjs +1 -1
- package/lib/host-packages/claude/openplanr/skills/cpo-review/scripts/validate-note.mjs +1 -1
- package/lib/host-packages/claude/openplanr/skills/cto-review/scripts/validate-note.mjs +1 -1
- package/lib/host-packages/claude/openplanr/skills/design/scripts/runtime/packages/protocol/package.json +1 -1
- package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/runtime/packages/protocol/package.json +1 -1
- package/lib/host-packages/claude/openplanr/skills/design-review/scripts/runtime/packages/protocol/package.json +1 -1
- package/lib/host-packages/claude/openplanr/skills/doctor/SKILL.md +11 -7
- package/lib/host-packages/claude/openplanr/skills/doctor/references/upgrade.md +60 -28
- package/lib/host-packages/claude/openplanr/skills/operate/scripts/validate-note.mjs +1 -1
- package/lib/host-packages/claude/openplanr/skills/plan/scripts/runtime/packages/protocol/package.json +1 -1
- package/lib/host-packages/cursor/openplanr/.openplanr-content.json +16 -16
- package/lib/host-packages/cursor/openplanr/manifest.json +1 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-ceo-review/scripts/validate-note.mjs +1 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-chair-review/scripts/validate-note.mjs +1 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-challenger-review/scripts/validate-note.mjs +1 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-cmo-review/scripts/validate-note.mjs +1 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-coo-review/scripts/validate-note.mjs +1 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-cpo-review/scripts/validate-note.mjs +1 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-cto-review/scripts/validate-note.mjs +1 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/runtime/packages/protocol/package.json +1 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/runtime/packages/protocol/package.json +1 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/runtime/packages/protocol/package.json +1 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-doctor/references/upgrade.md +60 -28
- package/lib/host-packages/cursor/openplanr/rules/planr-doctor.mdc +11 -7
- package/lib/host-packages/cursor/openplanr/rules/planr-operate/scripts/validate-note.mjs +1 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/runtime/packages/protocol/package.json +1 -1
- package/lib/host-packages/openai/.claude-plugin/marketplace.json +2 -2
- package/lib/host-packages/openai/openplanr/.codex-plugin/plugin.json +1 -1
- package/lib/host-packages/openai/openplanr/.openplanr-content.json +16 -16
- package/lib/host-packages/openai/openplanr/skills/ceo-review/scripts/validate-note.mjs +1 -1
- package/lib/host-packages/openai/openplanr/skills/chair-review/scripts/validate-note.mjs +1 -1
- package/lib/host-packages/openai/openplanr/skills/challenger-review/scripts/validate-note.mjs +1 -1
- package/lib/host-packages/openai/openplanr/skills/cmo-review/scripts/validate-note.mjs +1 -1
- package/lib/host-packages/openai/openplanr/skills/coo-review/scripts/validate-note.mjs +1 -1
- package/lib/host-packages/openai/openplanr/skills/cpo-review/scripts/validate-note.mjs +1 -1
- package/lib/host-packages/openai/openplanr/skills/cto-review/scripts/validate-note.mjs +1 -1
- package/lib/host-packages/openai/openplanr/skills/design/scripts/runtime/packages/protocol/package.json +1 -1
- package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/runtime/packages/protocol/package.json +1 -1
- package/lib/host-packages/openai/openplanr/skills/design-review/scripts/runtime/packages/protocol/package.json +1 -1
- package/lib/host-packages/openai/openplanr/skills/doctor/SKILL.md +11 -7
- package/lib/host-packages/openai/openplanr/skills/doctor/references/upgrade.md +60 -28
- package/lib/host-packages/openai/openplanr/skills/operate/scripts/validate-note.mjs +1 -1
- package/lib/host-packages/openai/openplanr/skills/plan/scripts/runtime/packages/protocol/package.json +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.2639.2
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
- 3bcf955: `planr init` now creates `.planr/specs/` when the new configuration turns on spec-driven mode, which the default configuration does. A first run no longer leaves the project in spec-driven mode without its specs folder.
|
|
7
|
+
- 3bcf955: The Operate review-note validator (`scripts/validate-note.mjs` in `planr-operate` and the seven review skills) now exits 0 when a note passes and 1 only when it reports diagnostics. It previously exited 1 on every note, including clean ones.
|
|
8
|
+
- 3bcf955: Correct the setup documentation: `planr setup` installs `planr@openplanr-local` from the marketplace bundled with the installed package and never reads `openplanr/marketplace`. `CROSS_RUNTIME_SETUP.md` now lists the four installation channels and their status, and advises using one Claude Code channel per machine.
|
|
9
|
+
- 3bcf955: `planr upgrade status` and `planr upgrade apply` now judge and prescribe the plugin `planr setup` installs, `planr@openplanr-local` from the bundled `openplanr-local` marketplace, instead of the retired `openplanr@openplanr` and `planr-pipeline@openplanr` plugins. After a CLI upgrade the prescribed commands refresh `openplanr-local`, update `planr@openplanr-local`, and remove leftover legacy plugins; when the marketplace was never registered the advice is `planr setup --runtime claude --scope user`. `planr setup` and `planr doctor` also warn when a marketplace-installed `planr@openplanr` sits beside `planr@openplanr-local` and give the exact `claude plugin uninstall` command to keep one, without removing anything themselves.
|
|
10
|
+
|
|
11
|
+
## 2.2639.1
|
|
12
|
+
|
|
3
13
|
## 2.2639.0
|
|
4
14
|
|
|
5
15
|
Releases are now numbered by release week. The middle number is the year and ISO week the release was prepared in (2026, week 39), and further releases in the same week raise the last number. The version still increases with every release, so existing `^2` ranges accept it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-deterministic.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init-deterministic.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"init-deterministic.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init-deterministic.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;AASjD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,QAqCnD"}
|
|
@@ -2,6 +2,7 @@ import path from 'node:path';
|
|
|
2
2
|
import { Option } from 'commander';
|
|
3
3
|
import { createChecklist } from '../../services/checklist-service.js';
|
|
4
4
|
import { createDefaultConfig, saveConfig } from '../../services/config-service.js';
|
|
5
|
+
import { getSpecsRootDir } from '../../services/spec-service.js';
|
|
5
6
|
import { renderTemplate } from '../../services/template-service.js';
|
|
6
7
|
import { ARTIFACT_DIRS, CONFIG_FILENAME } from '../../utils/constants.js';
|
|
7
8
|
import { ensureDir, fileExists, writeFile } from '../../utils/fs.js';
|
|
@@ -27,6 +28,8 @@ export function registerInitCommand(program) {
|
|
|
27
28
|
for (const directory of Object.values(ARTIFACT_DIRS))
|
|
28
29
|
await ensureDir(path.join(agileDir, directory));
|
|
29
30
|
await ensureDir(path.join(agileDir, 'diagrams'));
|
|
31
|
+
if (config.idPrefix.spec)
|
|
32
|
+
await ensureDir(getSpecsRootDir(projectDir, config));
|
|
30
33
|
await saveConfig(projectDir, config);
|
|
31
34
|
await createChecklist(projectDir, config);
|
|
32
35
|
const estimationPath = path.join(agileDir, 'ESTIMATION.md');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-deterministic.js","sourceRoot":"","sources":["../../../src/cli/commands/init-deterministic.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAgB,MAAM,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,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E,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC;YAClD,MAAM,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;QAClD,MAAM,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC;QACjD,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI;YAAE,MAAM,SAAS,CAAC,eAAe,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;QAC/E,MAAM,UAAU,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QACrC,MAAM,eAAe,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QAC1C,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC;QAC5D,IAAI,CAAC,CAAC,MAAM,UAAU,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC;YACxC,MAAM,SAAS,CAAC,cAAc,EAAE,MAAM,cAAc,CAAC,0BAA0B,EAAE,EAAE,CAAC,CAAC,CAAC;QACxF,CAAC;QACD,MAAM,CAAC,OAAO,CAAC,eAAe,WAAW,OAAO,MAAM,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC,CAAC;QAC9E,MAAM,CAAC,IAAI,CAAC,qEAAqE,CAAC,CAAC;IACrF,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/upgrade.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/upgrade.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAazC;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,QAgK3E"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isNonInteractive } from '../../services/interactive-state.js';
|
|
2
2
|
import { runPendingMigrations } from '../../services/migration-registry.js';
|
|
3
3
|
import { promptConfirm } from '../../services/prompt-service.js';
|
|
4
|
-
import { executeCliHalfUpgrade, planCliUpgrade, pluginHalfPrescription, reconcileInstalledTuple, } from '../../services/upgrade-service.js';
|
|
4
|
+
import { executeCliHalfUpgrade, PLUGIN_HALF_INSTRUCTION, planCliUpgrade, pluginHalfPrescription, reconcileInstalledTuple, } from '../../services/upgrade-service.js';
|
|
5
5
|
import { display, logger } from '../../utils/logger.js';
|
|
6
6
|
/**
|
|
7
7
|
* `planr upgrade` — reconcile the installed tuple against the published
|
|
@@ -29,8 +29,7 @@ export function registerUpgradeCommand(program, _cliVersion) {
|
|
|
29
29
|
display.keyValue('Manifest source', result.ecosystemSource);
|
|
30
30
|
display.keyValue('Installed CLI', result.installed.cli);
|
|
31
31
|
display.keyValue('Bundled pipeline', result.bundledPipeline ?? 'not resolved');
|
|
32
|
-
display.keyValue('Installed host plugin', result.installed.skills ?? 'not installed');
|
|
33
|
-
display.keyValue('Installed pipeline plugin', result.installed.pipeline ?? 'not installed');
|
|
32
|
+
display.keyValue('Installed host plugin (planr@openplanr-local)', result.installed.skills ?? 'not installed');
|
|
34
33
|
if (result.legacyPlugins && result.legacyPlugins.length > 0) {
|
|
35
34
|
display.keyValue('Legacy plugins', result.legacyPlugins.join(', '));
|
|
36
35
|
}
|
|
@@ -84,8 +83,8 @@ export function registerUpgradeCommand(program, _cliVersion) {
|
|
|
84
83
|
logger.info(plan.reason);
|
|
85
84
|
if (pluginHalfCommands.length > 0) {
|
|
86
85
|
display.blank();
|
|
87
|
-
display.heading('Plugin half — the
|
|
88
|
-
logger.info(
|
|
86
|
+
display.heading('Plugin half — the upgrade never changes Claude plugins itself');
|
|
87
|
+
logger.info(PLUGIN_HALF_INSTRUCTION);
|
|
89
88
|
pluginHalfCommands.forEach((command, index) => {
|
|
90
89
|
display.numbered(index + 1, command);
|
|
91
90
|
});
|
|
@@ -144,15 +143,15 @@ export function registerUpgradeCommand(program, _cliVersion) {
|
|
|
144
143
|
logger.dim('No changelog entries were found for this range.');
|
|
145
144
|
}
|
|
146
145
|
display.blank();
|
|
147
|
-
display.heading('Plugin half — the
|
|
146
|
+
display.heading('Plugin half — the upgrade never changes Claude plugins itself');
|
|
148
147
|
if (result.pluginHalfCommands.length > 0) {
|
|
149
|
-
logger.info(
|
|
148
|
+
logger.info(PLUGIN_HALF_INSTRUCTION);
|
|
150
149
|
result.pluginHalfCommands.forEach((command, index) => {
|
|
151
150
|
display.numbered(index + 1, command);
|
|
152
151
|
});
|
|
153
152
|
}
|
|
154
153
|
else {
|
|
155
|
-
logger.dim('
|
|
154
|
+
logger.dim('No Claude plugin commands were prescribed; run `planr doctor` to confirm the host plugin state.');
|
|
156
155
|
}
|
|
157
156
|
}
|
|
158
157
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade.js","sourceRoot":"","sources":["../../../src/cli/commands/upgrade.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAExD;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAgB,EAAE,WAAmB;IAC1E,MAAM,OAAO,GAAG,OAAO;SACpB,OAAO,CAAC,SAAS,CAAC;SAClB,WAAW,CAAC,8EAA8E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,CAAC;gBACJ,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,IAAI,+BAA+B,CAAC,CAAC;gBACzE,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;oBACtB,MAAM,CAAC,IAAI,CAAC,iCAAiC,MAAM,CAAC,UAAU,GAAG,CAAC,CAAC;gBACrE,CAAC;YACH,CAAC;QACH,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,EAAE;YAAE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"src": "../../../node_modules/@fontsource-variable/geist/files/geist-vietnamese-wght-normal.woff2"
|
|
45
45
|
},
|
|
46
46
|
"index.html": {
|
|
47
|
-
"file": "assets/index-
|
|
47
|
+
"file": "assets/index-lJDcN9xd.js",
|
|
48
48
|
"name": "index",
|
|
49
49
|
"src": "index.html",
|
|
50
50
|
"isEntry": true,
|
|
@@ -553,5 +553,5 @@ Error generating stack: `+d.message+`
|
|
|
553
553
|
`),C=(b=I.find(S=>S.startsWith("event:")))==null?void 0:b.slice(6).trim(),O=I.filter(S=>S.startsWith("data:")).map(S=>S.slice(5).trimStart()).join(`
|
|
554
554
|
`);O&&e.reconciler.ingestSseFrame(O,C),x=m.indexOf(`
|
|
555
555
|
|
|
556
|
-
`)}if(w.done){if(m.trim())return he("$","Planning live response ended mid-frame");break}}}finally{A.releaseLock()}})().catch(h=>{if(!t.signal.aborted)throw h instanceof ee?h:new ee("$","Planning live response failed safely")}).finally(()=>{var h;return(h=e.signal)==null?void 0:h.removeEventListener("abort",a)});return Object.freeze({completion:l,close:()=>{var h;t.abort(),e.reconciler.dispose(),(h=e.signal)==null||h.removeEventListener("abort",a)}})}const y4=Object.freeze({connectSse:m4,createSseReconciler:f4,encodeCheckpoint:A4,fetchGraph:h4,parseGraphEnvelope:Cu}),E4=Object.freeze(Object.defineProperty({__proto__:null,planningRuntime:y4},Symbol.toStringTag,{value:"Module"})),B4=Object.freeze({create:Ve}),v4=Object.freeze({ValidationError:ee,isValidatedState:Pe,parseSafeError:$w,parseState:so,statePolicy:oo}),b4=Object.freeze({parse:Ha}),w4=Object.freeze({connectSse:tI,createSseReconciler:eI}),x4=Object.freeze({identity:B4,projection:v4,routing:b4,transport:w4}),j4=Object.freeze(Object.defineProperty({__proto__:null,dashboardRuntime:x4},Symbol.toStringTag,{value:"Module"})),{operateRuntime:Xe}=qP,{planningRuntime:Hc}=E4,{dashboardRuntime:Ne}=j4,ZI=new Set(["ready","read-only","stale","partial","blocked","offline"]),Pr=Ne.projection.parseState({kind:"booting",binding:null,data:null,reasonCodes:[],error:null,mutationEnabled:!1,policy:Ne.projection.statePolicy("booting")}),XI=Ne.routing.parse("#/overview");function WI(e){return`DASHBOARD_${e.toUpperCase().replace("-","_")}`}function pr(e){return Ne.projection.parseState({kind:"loading",binding:e,data:null,reasonCodes:[],error:null,mutationEnabled:!1,policy:Ne.projection.statePolicy("loading")},{currentBinding:e})}function e0(e,t=null){return Ne.projection.parseState({kind:"unavailable",binding:e,data:null,reasonCodes:["DASHBOARD_UNAVAILABLE"],error:t,mutationEnabled:!1,policy:Ne.projection.statePolicy("unavailable")},{currentBinding:e})}function yr(e,t=!1){const s=(e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}).code==="DASHBOARD_RESPONSE_INVALID"||e instanceof Ne.projection.ValidationError;return Ne.projection.parseSafeError({code:t||!s?"DASHBOARD_READ_FAILED":"DASHBOARD_RESPONSE_INVALID",retryable:!1,context:{operation:"dashboard.projection.read"}})}function Ya(e,t){const a=t??yr(void 0);if(a.code!=="DASHBOARD_RESPONSE_INVALID")return e0(e,a);const s=Ne.projection.parseSafeError({code:"DASHBOARD_RESPONSE_INVALID",retryable:!1,context:{}});return Ne.projection.parseState({kind:"corrupt",binding:null,data:null,reasonCodes:["DASHBOARD_CORRUPT"],error:s,mutationEnabled:!1,policy:Ne.projection.statePolicy("corrupt")})}function Q4(e,t,a,s,c=!1,l=null){if(!ZI.has(e))throw new Error("Unsupported owner presentation state.");return Ne.projection.parseState({kind:e,binding:t,data:a,reasonCodes:e==="ready"?[]:[WI(e)],error:l,mutationEnabled:e==="ready"&&c,policy:Ne.projection.statePolicy(e)},{currentBinding:t,validateData:s})}function I4(e,t){return!Ne.projection.isValidatedState(e)||e.binding===null||e.data===null?e:Ne.projection.parseState({kind:"stale",binding:e.binding,data:e.data,reasonCodes:["DASHBOARD_STALE"],error:t,mutationEnabled:!1,policy:Ne.projection.statePolicy("stale")},{currentBinding:e.binding,validateData:a=>a!==null})}function C4(e,t){return Ne.projection.parseState({kind:e,binding:t,data:null,reasonCodes:[WI(e)],error:null,mutationEnabled:!1,policy:Ne.projection.statePolicy(e)},{currentBinding:t})}function Fr(e,t){const a=B.useRef(t);a.current=t;const s=B.useRef(e);s.current=e;const c=B.useRef(null),l=B.useRef(null),[u,f]=B.useState(0),[h,A]=B.useState(()=>Object.freeze({key:null,revision:0,phase:"idle",data:null,error:null})),y=B.useCallback(()=>f(j=>j+1),[]),m=B.useCallback(()=>{var O;if(c.current!==null)return c.current;const j=s.current;if(j===null)return Promise.reject(new Error("Owner read is unavailable."));const I=new AbortController;(O=l.current)==null||O.abort(),l.current=I,A(S=>Object.freeze({key:j,revision:S.revision,phase:"loading",data:S.key===j?S.data:null,error:null}));const C=a.current(I.signal).then(S=>{if(I.signal.aborted||s.current!==j)throw new DOMException("Cancelled","AbortError");return A(_=>Object.freeze({key:j,revision:_.revision,phase:"ready",data:S,error:null})),S}).catch(S=>{throw!I.signal.aborted&&s.current===j&&A(_=>Object.freeze({key:j,revision:_.revision,phase:"failed",data:_.key===j?_.data:null,error:yr(S,_.key===j&&_.data!==null)})),S}).finally(()=>{c.current===C&&(c.current=null),l.current===I&&(l.current=null)});return c.current=C,C},[]);B.useEffect(()=>{var I;if((I=l.current)==null||I.abort(),l.current=null,c.current=null,e===null){A(Object.freeze({key:null,revision:u,phase:"idle",data:null,error:null}));return}const j=new AbortController;return A(C=>Object.freeze({key:e,revision:u,phase:"loading",data:C.key===e?C.data:null,error:null})),a.current(j.signal).then(C=>{j.signal.aborted||A(Object.freeze({key:e,revision:u,phase:"ready",data:C,error:null}))}).catch(C=>{j.signal.aborted||A(O=>Object.freeze({key:e,revision:u,phase:"failed",data:O.key===e?O.data:null,error:yr(C,O.key===e&&O.data!==null)}))}),()=>j.abort()},[e,u]);const E=h.key===e&&h.revision===u,b=E?h.phase:e===null?"idle":"loading",w=E?h.data:null,x=E?h.error:null;return B.useMemo(()=>Object.freeze({phase:b,data:w,error:x,refetch:y,reconcile:m}),[w,x,b,m,y])}function S4(e){return e===null?null:JSON.stringify(e)}function O4(e){return e.product==="planning"?e:XI}function _4(e){return e.kind==="operate.evidence"||e.kind==="operate.evidence-item"?"evidence":e.kind==="operate.outcomes"?"outcomes":e.kind==="operate.outcome"?"outcome":e.kind==="operate.history"?"history":null}function eu(e){return e.kind==="operate.actions"||e.kind==="operate.action"||e.kind==="operate.action-planning"||e.kind==="operate.inbox"||e.kind==="operate.inbox-item"||e.kind==="operate.recovery"}function N4(e){return e.kind==="operate.action-planning"?{kind:"operate.action",product:"operate",subjectId:e.subjectId}:e}function Vr(e){return Object.freeze({eventHead:e.payload.eventHead,viewHash:e.payload.viewHash})}function Io(e){const t=e.payload.status;if(!ZI.has(t))throw new Ne.projection.ValidationError("$.payload.status","contains an unsupported display status");return t}function R4(e){return e.payload.status==="terminal"?"read-only":Io(e)}function yw(e,t){if(e.data===null)return e.phase==="loading"||e.phase==="idle"?pr(t):Ya(t,e.error);const a=Ne.identity.create({...t,eventHead:e.data.payload.sourceEventHead,viewHash:e.data.payload.sourceViewHash});return Ei(e,a,e.data,Xe.review.createValidator(a),R4(e.data),e.data.payload.mutationEnabled)}function Ei(e,t,a,s,c,l=!1){const u=e.phase==="failed"?"stale":e.phase==="loading"||e.phase==="idle"?"refreshing":c;try{return Q4(u,t,a,s,l,u==="stale"?e.error??yr(void 0,!0):null)}catch(f){return Ya(t,yr(f))}}function Ew(e,t){if(e.data===null)return e.phase==="loading"||e.phase==="idle"?pr(t):Ya(t,e.error);const a=Ne.identity.create({...t,eventHead:e.data.cursor.eventHead,viewHash:e.data.cursor.viewHash});return Ei(e,a,e.data,s=>{try{return Hc.parseGraphEnvelope(s,t),!0}catch{return!1}},"ready")}function Bw(e,t,a,s){var u;if(e.data===null)return e.phase==="loading"||e.phase==="idle"?pr(t):Ya(t,e.error);const c=Ne.identity.create({...t,...Vr(e.data)}),l=a==="today"?Xe.today.createValidator(c):Xe.cycles.createListValidator(c);return e.phase!=="ready"?Ei(e,c,e.data,l,Io(e.data),e.data.payload.mutationEnabled):a==="today"&&e.data.payload.surface==="today"&&e.data.payload.status==="ready"&&e.data.payload.data.activeCycle===null?l(e.data)?s?s.phase==="loading"||s.phase==="idle"?Ei(Object.freeze({...e,phase:"loading",error:null}),c,e.data,l,"ready"):s.phase==="failed"?Ei(Object.freeze({...e,phase:"failed",error:s.error}),c,e.data,l,"ready"):((u=s.data)==null?void 0:u.payload.surface)!=="cycles"?Ya(c,yr(new Ne.projection.ValidationError("$.payload.surface","does not contain the required cycles display"))):C4(s.data.payload.data.cycles.length===0?"first-use":"empty",c):pr(c):Ya(c,yr(new Ne.projection.ValidationError("$.data","failed its owner-boundary contract"))):Ei(e,c,e.data,l,Io(e.data),e.data.payload.mutationEnabled)}function D4(e){if(e.subjectId===null)throw new Error("Action display identity requires a subject.");return Ne.identity.create({...e,route:`#/operate/actions/${encodeURIComponent(e.subjectId)}`})}function vw(e,t,a){if(e.data===null)return e.phase==="loading"||e.phase==="idle"?pr(t):Ya(t,e.error);const s=Ne.identity.create({...t,...Vr(e.data)});let c;if(a.kind==="operate.actions")c=Xe.actions.createListValidator(s);else if(a.kind==="operate.action"||a.kind==="operate.action-planning"){const l=a.kind==="operate.action-planning"?D4(s):s;c=Xe.actions.createDetailValidator(l)}else if(a.kind==="operate.inbox"||a.kind==="operate.inbox-item")c=Xe.actions.createInboxValidator(s);else if(a.kind==="operate.recovery")c=Xe.actions.createRecoveryValidator(s);else return e0(s);return Ei(e,s,e.data,c,Io(e.data),a.kind==="operate.action-planning"?!1:e.data.payload.mutationEnabled)}function T4(e,t){var ye,Ee;const a=(e==null?void 0:e.origin)??null,s=JSON.stringify(t),[c,l]=B.useState(null),u=(e==null?void 0:e.queryRoots.planning)??null,f=(e==null?void 0:e.queryRoots.operate)??null,h=B.useMemo(()=>O4(t),[t]),A=B.useMemo(()=>u?Xe.transport.identityFromRoot(u,XI):null,[u]),y=B.useMemo(()=>u?Xe.transport.identityFromRoot(u,h):null,[u,h]),m=Fr(A?JSON.stringify(A):null,R=>{if(!a||!A)throw new Error("Planning query root is unavailable.");return Hc.fetchGraph({origin:a,identity:A,signal:R})}),E=S4(f),b=Fr(E,R=>{if(!a||!f)throw new Error("Operate query root is unavailable.");return Xe.transport.fetchRootDisplay({origin:a,root:f,surface:"today",signal:R})}),w=Fr(E,R=>{if(!a||!f)throw new Error("Operate query root is unavailable.");return Xe.transport.fetchRootDisplay({origin:a,root:f,surface:"cycles",signal:R})}),x=((ye=b.data)==null?void 0:ye.payload.surface)==="today"?b.data:null,j=(x==null?void 0:x.payload.surface)==="today"?((Ee=x.payload.data.activeCycle)==null?void 0:Ee.cycleId)??null:null,I=t.kind==="operate.cycle"?t.subjectId:t.kind==="operate.review"?t.cycleId:j,C=x?Vr(x):null,O=B.useMemo(()=>f&&t.product==="operate"&&I&&C?Xe.transport.identityFromRoot(f,t,{cycleId:I,eventHead:C.eventHead,viewHash:C.viewHash}):null,[C,f,t,I]),S=a&&f&&O?JSON.stringify({root:f,binding:O}):null,_=B.useMemo(()=>f&&t.kind==="operate.review"?Xe.transport.identityFromRoot(f,t,{cycleId:t.cycleId}):null,[f,t]),k=a&&_?JSON.stringify({root:f,route:_.route}):null,N=Fr(k,R=>{if(!a||!f||t.kind!=="operate.review")throw new Error("Operate Review query custody is incomplete.");return Xe.review.fetch({origin:a,root:f,cycleId:t.cycleId,reviewId:t.subjectId,signal:R})}),z=B.useMemo(()=>N4(t),[t]),M=B.useMemo(()=>f&&eu(t)&&I&&C?Xe.transport.identityFromRoot(f,z,{cycleId:I,eventHead:C.eventHead,viewHash:C.viewHash}):null,[z,C,f,t,I]),L=a&&f&&M?JSON.stringify({root:f,binding:M}):null,Z=_4(t),F=Fr(Z?S:null,R=>{if(!a||!f||!I||!Z)throw new Error("Operate audit query custody is incomplete.");return Xe.transport.fetchAuditDisplay({origin:a,root:f,route:t,surface:Z,cycleId:I,signal:R})}),oe=Fr(t.kind==="operate.cycle"?S:null,R=>{if(!a||!f||t.kind!=="operate.cycle")throw new Error("Operate Cycle query custody is incomplete.");return Xe.transport.fetchCycleDisplay({origin:a,root:f,cycleId:t.subjectId,signal:R})}),re=Fr(eu(t)?L:null,R=>{if(!a||!M)throw new Error("Operate route display custody is incomplete.");if(t.kind==="operate.actions")return Xe.actions.fetchList({origin:a,identity:M,signal:R});if(t.kind==="operate.action"||t.kind==="operate.action-planning")return Xe.actions.fetchDetail({origin:a,identity:M,signal:R});if(t.kind==="operate.inbox"||t.kind==="operate.inbox-item")return Xe.actions.fetchInbox({origin:a,identity:M,signal:R});if(t.kind==="operate.recovery")return Xe.actions.fetchRecovery({origin:a,identity:M,signal:R});throw new Error("Operate route does not own a bound display read.")}),pe=B.useMemo(()=>y?Ew(m,y):Pr,[y,m]),Y=B.useMemo(()=>{if(!f)return null;const R=Ne.routing.parse("#/operate/today");return Xe.transport.identityFromRoot(f,R,{cycleId:j})},[j,f]),V=B.useMemo(()=>Y?Bw(b,Y,"today",w):Pr,[w,Y,b]),te=B.useMemo(()=>{if(!V.binding||!I)return null;const R=Xe.today.resolveModel({current:V},V.binding);return(R==null?void 0:R.kind)==="surface"?Xe.review.uniqueNavigationForCycle(R,I):null},[I,V]),le=B.useMemo(()=>f?Xe.transport.identityFromRoot(f,Ne.routing.parse("#/operate/cycles")):null,[f]),fe=B.useMemo(()=>le?Bw(w,le,"cycles"):Pr,[le,w]),T=B.useMemo(()=>{var ne;if(!f||((ne=w.data)==null?void 0:ne.payload.surface)!=="cycles")return Object.freeze([]);const R=Vr(w.data),J=Ne.routing.parse("#/operate/cycles");return Object.freeze(w.data.payload.data.cycles.map(Ae=>Xe.transport.identityFromRoot(f,J,{cycleId:Ae.cycleId,eventHead:R.eventHead,viewHash:R.viewHash})))},[w,f]),X=B.useMemo(()=>{if(t.product==="planning")return Object.freeze({binding:pe.binding,projection:pe});if(t.product!=="operate"||!f)return Object.freeze({binding:null,projection:Pr});if(t.kind==="operate.today")return Object.freeze({binding:V.binding,projection:V});if(t.kind==="operate.cycles")return Object.freeze({binding:fe.binding,projection:fe});if(t.kind==="operate.review"){if(!_)return Object.freeze({binding:null,projection:Pr});const J=yw(N,_);return Object.freeze({binding:J.binding,projection:J})}if(!C||!I)return Object.freeze({binding:null,projection:Pr});const R=O;if(!R)return Object.freeze({binding:null,projection:Pr});if(t.kind==="operate.cycle"){if(oe.data===null){const ne=oe.phase==="loading"||oe.phase==="idle"?pr(R):Ya(R,oe.error);return Object.freeze({binding:ne.binding,projection:ne})}const J=Ne.identity.create({...R,...Vr(oe.data)});return Object.freeze({binding:J,projection:Ei(oe,J,oe.data,Xe.cycles.createDetailValidator(J),Io(oe.data),oe.data.payload.mutationEnabled)})}if(Z){if(F.data===null){const Ae=F.phase==="loading"||F.phase==="idle"?pr(R):Ya(R,F.error);return Object.freeze({binding:Ae.binding,projection:Ae})}const J=Ne.identity.create({...R,...Vr(F.data)}),ne=Z==="evidence"?Xe.audit.createEvidenceValidator(J):Z==="outcomes"||Z==="outcome"?Xe.audit.createOutcomeValidator(J):Xe.audit.createHistoryValidator(J);return Object.freeze({binding:J,projection:Ei(F,J,F.data,ne,Io(F.data),!1)})}return eu(t)?Object.freeze({binding:R,projection:vw(re,R,t)}):Object.freeze({binding:R,projection:pr(R)})},[F,Z,re,O,oe,C,fe,f,pe,N,_,t,I,V]);B.useEffect(()=>{l(R=>R!==null&&R.routeKey!==s?null:R)},[s]);const se=B.useMemo(()=>c!==null&&c.routeKey===s&&(!Ne.projection.isValidatedState(X.projection)||X.projection.data===null)?Object.freeze({binding:c.binding,projection:c.projection}):X,[c,X,s]);B.useEffect(()=>{if(!a||!m.data||m.phase!=="ready"||!A)return;const R=Ne.identity.create({...A,eventHead:m.data.cursor.eventHead,viewHash:m.data.cursor.viewHash});let J=!0;const ne=Hc.createSseReconciler({identity:R,initial:m.data,isCurrent:()=>J,onSnapshot:()=>{},onPatch:()=>m.refetch(),onRefetch:()=>m.refetch(),onStale:()=>m.refetch()}),Ae=Hc.connectSse({origin:a,identity:R,reconciler:ne,lastEventId:Hc.encodeCheckpoint(m.data.cursor)});return Ae.completion.catch(()=>{}),()=>{J=!1,Ae.close()}},[a,A,m]),B.useEffect(()=>{if(!a||!f||!x||!Y)return;const R=Vr(x),J=Ne.identity.create({...Y,...R});let ne=!0;const Ae=Ne.transport.createSseReconciler({identity:J,isCurrent:()=>ne,onSnapshot:(xe,Ze)=>{var Ie,ce;(Ze.eventHead.sequence!==((Ie=R.eventHead)==null?void 0:Ie.sequence)||Ze.eventHead.hash!==((ce=R.eventHead)==null?void 0:ce.hash)||Ze.viewHash!==R.viewHash)&&(b.refetch(),w.refetch())},onPatch:()=>{b.refetch(),w.refetch()},onRefetch:()=>{b.refetch(),w.refetch()},onStale:()=>{b.refetch(),w.refetch()}}),we=Ne.transport.connectSse({origin:a,identity:J,reconciler:Ae});return we.completion.catch(()=>{}),()=>{ne=!1,we.close()}},[w,a,f,x,Y,b]);const de=B.useCallback(async()=>{const R=se;R.binding!==null&&Ne.projection.isValidatedState(R.projection)&&R.projection.data!==null&&l(Object.freeze({routeKey:s,binding:R.binding,projection:R.projection}));try{let J;if(t.kind==="operate.review"&&_){const ne=await N.reconcile();J=yw(Object.freeze({phase:"ready",data:ne,error:null,refetch:N.refetch,reconcile:N.reconcile}),_)}else if(eu(t)&&O){const ne=await re.reconcile();J=vw(Object.freeze({phase:"ready",data:ne,error:null,refetch:re.refetch,reconcile:re.reconcile}),O,t)}else if(t.product==="planning"&&y){const ne=await m.reconcile();J=Ew(Object.freeze({phase:"ready",data:ne,error:null,refetch:m.refetch,reconcile:m.reconcile}),y)}else throw new Ne.projection.ValidationError("$.route","does not own an exact reconciliation read");if(!Ne.projection.isValidatedState(J)||J.data===null)throw new Ne.projection.ValidationError("$.projection","did not return a verified projection");return l(null),J}catch(J){const ne=R.binding!==null&&Ne.projection.isValidatedState(R.projection)&&R.projection.data!==null,Ae=yr(J,ne),we=ne?I4(R.projection,Ae):R.binding===null?R.projection:Ya(R.binding,Ae);return ne&&R.binding!==null&&l(Object.freeze({routeKey:s,binding:R.binding,projection:we})),we}},[re,O,se,y,m,N,_,t,s]);return Object.freeze({binding:se.binding,projection:se.projection,planningProjection:pe,operateCyclesProjection:fe,operateSearchBindings:T,operateReviewNavigation:te,refetchCurrent:de})}function bw(e){return e!==void 0?e:typeof window>"u"?"":window.location.hash}function k4(e,t){return e!==void 0||typeof window>"u"?()=>{}:(window.addEventListener("hashchange",t),()=>window.removeEventListener("hashchange",t))}function M4({buildId:e,initialHash:t,identity:a,connection:s,bootstrap:c,bootPhase:l,bootDetail:u}){const f=B.useSyncExternalStore(S=>k4(t,S),()=>bw(t),()=>bw(t)),h=c===void 0&&s===void 0,[A,y]=B.useState(c??null),[m,E]=B.useState(l??(h?"checking":"compatible")),[b,w]=B.useState(u??null);B.useEffect(()=>{if(!h)return;const S=new AbortController;return E("checking"),w("Waiting for OpenPlanr to return a validated bootstrap envelope."),BP(e,{signal:S.signal}).then(_=>{y(_.bootstrap),E(_.phase==="compatible"?"compatible":_.phase),w(_.detail)}).catch(()=>{}),()=>S.abort()},[e,h]);const x=B.useMemo(()=>s??x1(A,e,b),[A,b,e,s]),j=B.useMemo(()=>a??j1(A),[A,a]),I=B.useMemo(()=>Ha(f),[f]),C=I.kind==="system.diagnostics"||m==="incompatible"||x.state==="incompatible",O=T4(m==="compatible"&&x.state!=="incompatible"&&I.product!==null?A:null,I);return r.jsxs(y1,{buildId:e,initialHash:C?Pa(kw):t,identity:j,connection:x,bootstrap:A,bootPhase:m,bootDetail:b,binding:O.binding,projection:O.projection,planningProjection:O.planningProjection,operateCyclesProjection:O.operateCyclesProjection,operateSearchBindings:O.operateSearchBindings,operateReviewNavigation:O.operateReviewNavigation,refetchCurrent:O.refetchCurrent,children:[r.jsx(B1,{}),r.jsx(pP,{})]})}const t0=document.querySelector("#root");if(!t0)throw new Error("OpenPlanr dashboard root element is missing.");DS.createRoot(t0).render(r.jsx(B.StrictMode,{children:r.jsx(M4,{buildId:"dashboard-0.1.5-11df7521ace6e45b"})}));
|
|
557
|
-
//# sourceMappingURL=index-
|
|
556
|
+
`)}if(w.done){if(m.trim())return he("$","Planning live response ended mid-frame");break}}}finally{A.releaseLock()}})().catch(h=>{if(!t.signal.aborted)throw h instanceof ee?h:new ee("$","Planning live response failed safely")}).finally(()=>{var h;return(h=e.signal)==null?void 0:h.removeEventListener("abort",a)});return Object.freeze({completion:l,close:()=>{var h;t.abort(),e.reconciler.dispose(),(h=e.signal)==null||h.removeEventListener("abort",a)}})}const y4=Object.freeze({connectSse:m4,createSseReconciler:f4,encodeCheckpoint:A4,fetchGraph:h4,parseGraphEnvelope:Cu}),E4=Object.freeze(Object.defineProperty({__proto__:null,planningRuntime:y4},Symbol.toStringTag,{value:"Module"})),B4=Object.freeze({create:Ve}),v4=Object.freeze({ValidationError:ee,isValidatedState:Pe,parseSafeError:$w,parseState:so,statePolicy:oo}),b4=Object.freeze({parse:Ha}),w4=Object.freeze({connectSse:tI,createSseReconciler:eI}),x4=Object.freeze({identity:B4,projection:v4,routing:b4,transport:w4}),j4=Object.freeze(Object.defineProperty({__proto__:null,dashboardRuntime:x4},Symbol.toStringTag,{value:"Module"})),{operateRuntime:Xe}=qP,{planningRuntime:Hc}=E4,{dashboardRuntime:Ne}=j4,ZI=new Set(["ready","read-only","stale","partial","blocked","offline"]),Pr=Ne.projection.parseState({kind:"booting",binding:null,data:null,reasonCodes:[],error:null,mutationEnabled:!1,policy:Ne.projection.statePolicy("booting")}),XI=Ne.routing.parse("#/overview");function WI(e){return`DASHBOARD_${e.toUpperCase().replace("-","_")}`}function pr(e){return Ne.projection.parseState({kind:"loading",binding:e,data:null,reasonCodes:[],error:null,mutationEnabled:!1,policy:Ne.projection.statePolicy("loading")},{currentBinding:e})}function e0(e,t=null){return Ne.projection.parseState({kind:"unavailable",binding:e,data:null,reasonCodes:["DASHBOARD_UNAVAILABLE"],error:t,mutationEnabled:!1,policy:Ne.projection.statePolicy("unavailable")},{currentBinding:e})}function yr(e,t=!1){const s=(e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}).code==="DASHBOARD_RESPONSE_INVALID"||e instanceof Ne.projection.ValidationError;return Ne.projection.parseSafeError({code:t||!s?"DASHBOARD_READ_FAILED":"DASHBOARD_RESPONSE_INVALID",retryable:!1,context:{operation:"dashboard.projection.read"}})}function Ya(e,t){const a=t??yr(void 0);if(a.code!=="DASHBOARD_RESPONSE_INVALID")return e0(e,a);const s=Ne.projection.parseSafeError({code:"DASHBOARD_RESPONSE_INVALID",retryable:!1,context:{}});return Ne.projection.parseState({kind:"corrupt",binding:null,data:null,reasonCodes:["DASHBOARD_CORRUPT"],error:s,mutationEnabled:!1,policy:Ne.projection.statePolicy("corrupt")})}function Q4(e,t,a,s,c=!1,l=null){if(!ZI.has(e))throw new Error("Unsupported owner presentation state.");return Ne.projection.parseState({kind:e,binding:t,data:a,reasonCodes:e==="ready"?[]:[WI(e)],error:l,mutationEnabled:e==="ready"&&c,policy:Ne.projection.statePolicy(e)},{currentBinding:t,validateData:s})}function I4(e,t){return!Ne.projection.isValidatedState(e)||e.binding===null||e.data===null?e:Ne.projection.parseState({kind:"stale",binding:e.binding,data:e.data,reasonCodes:["DASHBOARD_STALE"],error:t,mutationEnabled:!1,policy:Ne.projection.statePolicy("stale")},{currentBinding:e.binding,validateData:a=>a!==null})}function C4(e,t){return Ne.projection.parseState({kind:e,binding:t,data:null,reasonCodes:[WI(e)],error:null,mutationEnabled:!1,policy:Ne.projection.statePolicy(e)},{currentBinding:t})}function Fr(e,t){const a=B.useRef(t);a.current=t;const s=B.useRef(e);s.current=e;const c=B.useRef(null),l=B.useRef(null),[u,f]=B.useState(0),[h,A]=B.useState(()=>Object.freeze({key:null,revision:0,phase:"idle",data:null,error:null})),y=B.useCallback(()=>f(j=>j+1),[]),m=B.useCallback(()=>{var O;if(c.current!==null)return c.current;const j=s.current;if(j===null)return Promise.reject(new Error("Owner read is unavailable."));const I=new AbortController;(O=l.current)==null||O.abort(),l.current=I,A(S=>Object.freeze({key:j,revision:S.revision,phase:"loading",data:S.key===j?S.data:null,error:null}));const C=a.current(I.signal).then(S=>{if(I.signal.aborted||s.current!==j)throw new DOMException("Cancelled","AbortError");return A(_=>Object.freeze({key:j,revision:_.revision,phase:"ready",data:S,error:null})),S}).catch(S=>{throw!I.signal.aborted&&s.current===j&&A(_=>Object.freeze({key:j,revision:_.revision,phase:"failed",data:_.key===j?_.data:null,error:yr(S,_.key===j&&_.data!==null)})),S}).finally(()=>{c.current===C&&(c.current=null),l.current===I&&(l.current=null)});return c.current=C,C},[]);B.useEffect(()=>{var I;if((I=l.current)==null||I.abort(),l.current=null,c.current=null,e===null){A(Object.freeze({key:null,revision:u,phase:"idle",data:null,error:null}));return}const j=new AbortController;return A(C=>Object.freeze({key:e,revision:u,phase:"loading",data:C.key===e?C.data:null,error:null})),a.current(j.signal).then(C=>{j.signal.aborted||A(Object.freeze({key:e,revision:u,phase:"ready",data:C,error:null}))}).catch(C=>{j.signal.aborted||A(O=>Object.freeze({key:e,revision:u,phase:"failed",data:O.key===e?O.data:null,error:yr(C,O.key===e&&O.data!==null)}))}),()=>j.abort()},[e,u]);const E=h.key===e&&h.revision===u,b=E?h.phase:e===null?"idle":"loading",w=E?h.data:null,x=E?h.error:null;return B.useMemo(()=>Object.freeze({phase:b,data:w,error:x,refetch:y,reconcile:m}),[w,x,b,m,y])}function S4(e){return e===null?null:JSON.stringify(e)}function O4(e){return e.product==="planning"?e:XI}function _4(e){return e.kind==="operate.evidence"||e.kind==="operate.evidence-item"?"evidence":e.kind==="operate.outcomes"?"outcomes":e.kind==="operate.outcome"?"outcome":e.kind==="operate.history"?"history":null}function eu(e){return e.kind==="operate.actions"||e.kind==="operate.action"||e.kind==="operate.action-planning"||e.kind==="operate.inbox"||e.kind==="operate.inbox-item"||e.kind==="operate.recovery"}function N4(e){return e.kind==="operate.action-planning"?{kind:"operate.action",product:"operate",subjectId:e.subjectId}:e}function Vr(e){return Object.freeze({eventHead:e.payload.eventHead,viewHash:e.payload.viewHash})}function Io(e){const t=e.payload.status;if(!ZI.has(t))throw new Ne.projection.ValidationError("$.payload.status","contains an unsupported display status");return t}function R4(e){return e.payload.status==="terminal"?"read-only":Io(e)}function yw(e,t){if(e.data===null)return e.phase==="loading"||e.phase==="idle"?pr(t):Ya(t,e.error);const a=Ne.identity.create({...t,eventHead:e.data.payload.sourceEventHead,viewHash:e.data.payload.sourceViewHash});return Ei(e,a,e.data,Xe.review.createValidator(a),R4(e.data),e.data.payload.mutationEnabled)}function Ei(e,t,a,s,c,l=!1){const u=e.phase==="failed"?"stale":e.phase==="loading"||e.phase==="idle"?"refreshing":c;try{return Q4(u,t,a,s,l,u==="stale"?e.error??yr(void 0,!0):null)}catch(f){return Ya(t,yr(f))}}function Ew(e,t){if(e.data===null)return e.phase==="loading"||e.phase==="idle"?pr(t):Ya(t,e.error);const a=Ne.identity.create({...t,eventHead:e.data.cursor.eventHead,viewHash:e.data.cursor.viewHash});return Ei(e,a,e.data,s=>{try{return Hc.parseGraphEnvelope(s,t),!0}catch{return!1}},"ready")}function Bw(e,t,a,s){var u;if(e.data===null)return e.phase==="loading"||e.phase==="idle"?pr(t):Ya(t,e.error);const c=Ne.identity.create({...t,...Vr(e.data)}),l=a==="today"?Xe.today.createValidator(c):Xe.cycles.createListValidator(c);return e.phase!=="ready"?Ei(e,c,e.data,l,Io(e.data),e.data.payload.mutationEnabled):a==="today"&&e.data.payload.surface==="today"&&e.data.payload.status==="ready"&&e.data.payload.data.activeCycle===null?l(e.data)?s?s.phase==="loading"||s.phase==="idle"?Ei(Object.freeze({...e,phase:"loading",error:null}),c,e.data,l,"ready"):s.phase==="failed"?Ei(Object.freeze({...e,phase:"failed",error:s.error}),c,e.data,l,"ready"):((u=s.data)==null?void 0:u.payload.surface)!=="cycles"?Ya(c,yr(new Ne.projection.ValidationError("$.payload.surface","does not contain the required cycles display"))):C4(s.data.payload.data.cycles.length===0?"first-use":"empty",c):pr(c):Ya(c,yr(new Ne.projection.ValidationError("$.data","failed its owner-boundary contract"))):Ei(e,c,e.data,l,Io(e.data),e.data.payload.mutationEnabled)}function D4(e){if(e.subjectId===null)throw new Error("Action display identity requires a subject.");return Ne.identity.create({...e,route:`#/operate/actions/${encodeURIComponent(e.subjectId)}`})}function vw(e,t,a){if(e.data===null)return e.phase==="loading"||e.phase==="idle"?pr(t):Ya(t,e.error);const s=Ne.identity.create({...t,...Vr(e.data)});let c;if(a.kind==="operate.actions")c=Xe.actions.createListValidator(s);else if(a.kind==="operate.action"||a.kind==="operate.action-planning"){const l=a.kind==="operate.action-planning"?D4(s):s;c=Xe.actions.createDetailValidator(l)}else if(a.kind==="operate.inbox"||a.kind==="operate.inbox-item")c=Xe.actions.createInboxValidator(s);else if(a.kind==="operate.recovery")c=Xe.actions.createRecoveryValidator(s);else return e0(s);return Ei(e,s,e.data,c,Io(e.data),a.kind==="operate.action-planning"?!1:e.data.payload.mutationEnabled)}function T4(e,t){var ye,Ee;const a=(e==null?void 0:e.origin)??null,s=JSON.stringify(t),[c,l]=B.useState(null),u=(e==null?void 0:e.queryRoots.planning)??null,f=(e==null?void 0:e.queryRoots.operate)??null,h=B.useMemo(()=>O4(t),[t]),A=B.useMemo(()=>u?Xe.transport.identityFromRoot(u,XI):null,[u]),y=B.useMemo(()=>u?Xe.transport.identityFromRoot(u,h):null,[u,h]),m=Fr(A?JSON.stringify(A):null,R=>{if(!a||!A)throw new Error("Planning query root is unavailable.");return Hc.fetchGraph({origin:a,identity:A,signal:R})}),E=S4(f),b=Fr(E,R=>{if(!a||!f)throw new Error("Operate query root is unavailable.");return Xe.transport.fetchRootDisplay({origin:a,root:f,surface:"today",signal:R})}),w=Fr(E,R=>{if(!a||!f)throw new Error("Operate query root is unavailable.");return Xe.transport.fetchRootDisplay({origin:a,root:f,surface:"cycles",signal:R})}),x=((ye=b.data)==null?void 0:ye.payload.surface)==="today"?b.data:null,j=(x==null?void 0:x.payload.surface)==="today"?((Ee=x.payload.data.activeCycle)==null?void 0:Ee.cycleId)??null:null,I=t.kind==="operate.cycle"?t.subjectId:t.kind==="operate.review"?t.cycleId:j,C=x?Vr(x):null,O=B.useMemo(()=>f&&t.product==="operate"&&I&&C?Xe.transport.identityFromRoot(f,t,{cycleId:I,eventHead:C.eventHead,viewHash:C.viewHash}):null,[C,f,t,I]),S=a&&f&&O?JSON.stringify({root:f,binding:O}):null,_=B.useMemo(()=>f&&t.kind==="operate.review"?Xe.transport.identityFromRoot(f,t,{cycleId:t.cycleId}):null,[f,t]),k=a&&_?JSON.stringify({root:f,route:_.route}):null,N=Fr(k,R=>{if(!a||!f||t.kind!=="operate.review")throw new Error("Operate Review query custody is incomplete.");return Xe.review.fetch({origin:a,root:f,cycleId:t.cycleId,reviewId:t.subjectId,signal:R})}),z=B.useMemo(()=>N4(t),[t]),M=B.useMemo(()=>f&&eu(t)&&I&&C?Xe.transport.identityFromRoot(f,z,{cycleId:I,eventHead:C.eventHead,viewHash:C.viewHash}):null,[z,C,f,t,I]),L=a&&f&&M?JSON.stringify({root:f,binding:M}):null,Z=_4(t),F=Fr(Z?S:null,R=>{if(!a||!f||!I||!Z)throw new Error("Operate audit query custody is incomplete.");return Xe.transport.fetchAuditDisplay({origin:a,root:f,route:t,surface:Z,cycleId:I,signal:R})}),oe=Fr(t.kind==="operate.cycle"?S:null,R=>{if(!a||!f||t.kind!=="operate.cycle")throw new Error("Operate Cycle query custody is incomplete.");return Xe.transport.fetchCycleDisplay({origin:a,root:f,cycleId:t.subjectId,signal:R})}),re=Fr(eu(t)?L:null,R=>{if(!a||!M)throw new Error("Operate route display custody is incomplete.");if(t.kind==="operate.actions")return Xe.actions.fetchList({origin:a,identity:M,signal:R});if(t.kind==="operate.action"||t.kind==="operate.action-planning")return Xe.actions.fetchDetail({origin:a,identity:M,signal:R});if(t.kind==="operate.inbox"||t.kind==="operate.inbox-item")return Xe.actions.fetchInbox({origin:a,identity:M,signal:R});if(t.kind==="operate.recovery")return Xe.actions.fetchRecovery({origin:a,identity:M,signal:R});throw new Error("Operate route does not own a bound display read.")}),pe=B.useMemo(()=>y?Ew(m,y):Pr,[y,m]),Y=B.useMemo(()=>{if(!f)return null;const R=Ne.routing.parse("#/operate/today");return Xe.transport.identityFromRoot(f,R,{cycleId:j})},[j,f]),V=B.useMemo(()=>Y?Bw(b,Y,"today",w):Pr,[w,Y,b]),te=B.useMemo(()=>{if(!V.binding||!I)return null;const R=Xe.today.resolveModel({current:V},V.binding);return(R==null?void 0:R.kind)==="surface"?Xe.review.uniqueNavigationForCycle(R,I):null},[I,V]),le=B.useMemo(()=>f?Xe.transport.identityFromRoot(f,Ne.routing.parse("#/operate/cycles")):null,[f]),fe=B.useMemo(()=>le?Bw(w,le,"cycles"):Pr,[le,w]),T=B.useMemo(()=>{var ne;if(!f||((ne=w.data)==null?void 0:ne.payload.surface)!=="cycles")return Object.freeze([]);const R=Vr(w.data),J=Ne.routing.parse("#/operate/cycles");return Object.freeze(w.data.payload.data.cycles.map(Ae=>Xe.transport.identityFromRoot(f,J,{cycleId:Ae.cycleId,eventHead:R.eventHead,viewHash:R.viewHash})))},[w,f]),X=B.useMemo(()=>{if(t.product==="planning")return Object.freeze({binding:pe.binding,projection:pe});if(t.product!=="operate"||!f)return Object.freeze({binding:null,projection:Pr});if(t.kind==="operate.today")return Object.freeze({binding:V.binding,projection:V});if(t.kind==="operate.cycles")return Object.freeze({binding:fe.binding,projection:fe});if(t.kind==="operate.review"){if(!_)return Object.freeze({binding:null,projection:Pr});const J=yw(N,_);return Object.freeze({binding:J.binding,projection:J})}if(!C||!I)return Object.freeze({binding:null,projection:Pr});const R=O;if(!R)return Object.freeze({binding:null,projection:Pr});if(t.kind==="operate.cycle"){if(oe.data===null){const ne=oe.phase==="loading"||oe.phase==="idle"?pr(R):Ya(R,oe.error);return Object.freeze({binding:ne.binding,projection:ne})}const J=Ne.identity.create({...R,...Vr(oe.data)});return Object.freeze({binding:J,projection:Ei(oe,J,oe.data,Xe.cycles.createDetailValidator(J),Io(oe.data),oe.data.payload.mutationEnabled)})}if(Z){if(F.data===null){const Ae=F.phase==="loading"||F.phase==="idle"?pr(R):Ya(R,F.error);return Object.freeze({binding:Ae.binding,projection:Ae})}const J=Ne.identity.create({...R,...Vr(F.data)}),ne=Z==="evidence"?Xe.audit.createEvidenceValidator(J):Z==="outcomes"||Z==="outcome"?Xe.audit.createOutcomeValidator(J):Xe.audit.createHistoryValidator(J);return Object.freeze({binding:J,projection:Ei(F,J,F.data,ne,Io(F.data),!1)})}return eu(t)?Object.freeze({binding:R,projection:vw(re,R,t)}):Object.freeze({binding:R,projection:pr(R)})},[F,Z,re,O,oe,C,fe,f,pe,N,_,t,I,V]);B.useEffect(()=>{l(R=>R!==null&&R.routeKey!==s?null:R)},[s]);const se=B.useMemo(()=>c!==null&&c.routeKey===s&&(!Ne.projection.isValidatedState(X.projection)||X.projection.data===null)?Object.freeze({binding:c.binding,projection:c.projection}):X,[c,X,s]);B.useEffect(()=>{if(!a||!m.data||m.phase!=="ready"||!A)return;const R=Ne.identity.create({...A,eventHead:m.data.cursor.eventHead,viewHash:m.data.cursor.viewHash});let J=!0;const ne=Hc.createSseReconciler({identity:R,initial:m.data,isCurrent:()=>J,onSnapshot:()=>{},onPatch:()=>m.refetch(),onRefetch:()=>m.refetch(),onStale:()=>m.refetch()}),Ae=Hc.connectSse({origin:a,identity:R,reconciler:ne,lastEventId:Hc.encodeCheckpoint(m.data.cursor)});return Ae.completion.catch(()=>{}),()=>{J=!1,Ae.close()}},[a,A,m]),B.useEffect(()=>{if(!a||!f||!x||!Y)return;const R=Vr(x),J=Ne.identity.create({...Y,...R});let ne=!0;const Ae=Ne.transport.createSseReconciler({identity:J,isCurrent:()=>ne,onSnapshot:(xe,Ze)=>{var Ie,ce;(Ze.eventHead.sequence!==((Ie=R.eventHead)==null?void 0:Ie.sequence)||Ze.eventHead.hash!==((ce=R.eventHead)==null?void 0:ce.hash)||Ze.viewHash!==R.viewHash)&&(b.refetch(),w.refetch())},onPatch:()=>{b.refetch(),w.refetch()},onRefetch:()=>{b.refetch(),w.refetch()},onStale:()=>{b.refetch(),w.refetch()}}),we=Ne.transport.connectSse({origin:a,identity:J,reconciler:Ae});return we.completion.catch(()=>{}),()=>{ne=!1,we.close()}},[w,a,f,x,Y,b]);const de=B.useCallback(async()=>{const R=se;R.binding!==null&&Ne.projection.isValidatedState(R.projection)&&R.projection.data!==null&&l(Object.freeze({routeKey:s,binding:R.binding,projection:R.projection}));try{let J;if(t.kind==="operate.review"&&_){const ne=await N.reconcile();J=yw(Object.freeze({phase:"ready",data:ne,error:null,refetch:N.refetch,reconcile:N.reconcile}),_)}else if(eu(t)&&O){const ne=await re.reconcile();J=vw(Object.freeze({phase:"ready",data:ne,error:null,refetch:re.refetch,reconcile:re.reconcile}),O,t)}else if(t.product==="planning"&&y){const ne=await m.reconcile();J=Ew(Object.freeze({phase:"ready",data:ne,error:null,refetch:m.refetch,reconcile:m.reconcile}),y)}else throw new Ne.projection.ValidationError("$.route","does not own an exact reconciliation read");if(!Ne.projection.isValidatedState(J)||J.data===null)throw new Ne.projection.ValidationError("$.projection","did not return a verified projection");return l(null),J}catch(J){const ne=R.binding!==null&&Ne.projection.isValidatedState(R.projection)&&R.projection.data!==null,Ae=yr(J,ne),we=ne?I4(R.projection,Ae):R.binding===null?R.projection:Ya(R.binding,Ae);return ne&&R.binding!==null&&l(Object.freeze({routeKey:s,binding:R.binding,projection:we})),we}},[re,O,se,y,m,N,_,t,s]);return Object.freeze({binding:se.binding,projection:se.projection,planningProjection:pe,operateCyclesProjection:fe,operateSearchBindings:T,operateReviewNavigation:te,refetchCurrent:de})}function bw(e){return e!==void 0?e:typeof window>"u"?"":window.location.hash}function k4(e,t){return e!==void 0||typeof window>"u"?()=>{}:(window.addEventListener("hashchange",t),()=>window.removeEventListener("hashchange",t))}function M4({buildId:e,initialHash:t,identity:a,connection:s,bootstrap:c,bootPhase:l,bootDetail:u}){const f=B.useSyncExternalStore(S=>k4(t,S),()=>bw(t),()=>bw(t)),h=c===void 0&&s===void 0,[A,y]=B.useState(c??null),[m,E]=B.useState(l??(h?"checking":"compatible")),[b,w]=B.useState(u??null);B.useEffect(()=>{if(!h)return;const S=new AbortController;return E("checking"),w("Waiting for OpenPlanr to return a validated bootstrap envelope."),BP(e,{signal:S.signal}).then(_=>{y(_.bootstrap),E(_.phase==="compatible"?"compatible":_.phase),w(_.detail)}).catch(()=>{}),()=>S.abort()},[e,h]);const x=B.useMemo(()=>s??x1(A,e,b),[A,b,e,s]),j=B.useMemo(()=>a??j1(A),[A,a]),I=B.useMemo(()=>Ha(f),[f]),C=I.kind==="system.diagnostics"||m==="incompatible"||x.state==="incompatible",O=T4(m==="compatible"&&x.state!=="incompatible"&&I.product!==null?A:null,I);return r.jsxs(y1,{buildId:e,initialHash:C?Pa(kw):t,identity:j,connection:x,bootstrap:A,bootPhase:m,bootDetail:b,binding:O.binding,projection:O.projection,planningProjection:O.planningProjection,operateCyclesProjection:O.operateCyclesProjection,operateSearchBindings:O.operateSearchBindings,operateReviewNavigation:O.operateReviewNavigation,refetchCurrent:O.refetchCurrent,children:[r.jsx(B1,{}),r.jsx(pP,{})]})}const t0=document.querySelector("#root");if(!t0)throw new Error("OpenPlanr dashboard root element is missing.");DS.createRoot(t0).render(r.jsx(B.StrictMode,{children:r.jsx(M4,{buildId:"dashboard-0.1.6-1a617808bea552ff"})}));
|
|
557
|
+
//# sourceMappingURL=index-lJDcN9xd.js.map
|