@memoarchitect/architect 0.6.5 → 0.7.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.
Files changed (79) hide show
  1. package/README.md +45 -4
  2. package/dist/assets/AiWorkspace-Bu9TlIWg.js +7 -0
  3. package/dist/assets/AnalysisWorkspace-CodmoI-v.js +39 -0
  4. package/dist/assets/{ComplianceWizard-DWolzleI.js → ComplianceWizard-CTihkUi-.js} +1 -1
  5. package/dist/assets/DSMView-BiC845df.js +1 -0
  6. package/dist/assets/Dashboard-CgnNLhKq.js +1 -0
  7. package/dist/assets/{DhfDashboard-D9JxRAbD.js → DhfDashboard-w-dJoJHU.js} +1 -1
  8. package/dist/assets/{DhfWorkbench-BQv2WQ9o.js → DhfWorkbench-o6B_MT-0.js} +15 -15
  9. package/dist/assets/DiagramCanvas-CqGqDbgT.js +3 -0
  10. package/dist/assets/DiagramEditor-UJDHcAUF.js +4 -0
  11. package/dist/assets/DiagramToolbarControls-B2gZFJlg.js +1 -0
  12. package/dist/assets/ElementDetailView-10U0rr33.js +2 -0
  13. package/dist/assets/ExplorerTreeRow-DqhF_qoO.js +3 -0
  14. package/dist/assets/{ImportView-33dFwj6A.js → ImportView-D8svP04Q.js} +1 -1
  15. package/dist/assets/{LayerGrid-B3MBWswK.js → LayerGrid-DEe0Ryz-.js} +1 -1
  16. package/dist/assets/{LayerTable-DyIzIt5M.js → LayerTable-CN_b2rDr.js} +2 -2
  17. package/dist/assets/{MaxGraphCanvas-BS5wYazZ.js → MaxGraphCanvas-bo8oPBct.js} +6 -6
  18. package/dist/assets/{ModelDiff-BoFREnpg.js → ModelDiff-xe95oVua.js} +1 -1
  19. package/dist/assets/{OntologyDecompositionDiagram-IG1gj1c3.js → OntologyDecompositionDiagram-BL9R8bdB.js} +1 -1
  20. package/dist/assets/{OntologyViewer-CQTEg-GI.js → OntologyViewer-CtqNkkCn.js} +2 -2
  21. package/dist/assets/{RelationshipOverlay-B9bqt4zl.js → RelationshipOverlay-DL0N8Vmk.js} +1 -1
  22. package/dist/assets/{RelationshipsSection-DttMvF2i.js → RelationshipsSection-BoJ0aUXe.js} +1 -1
  23. package/dist/assets/{ReviewDashboard-BJ_smBGS.js → ReviewDashboard-DeTge2oC.js} +1 -1
  24. package/dist/assets/ScenarioEditor-FAEYTHgP.js +3 -0
  25. package/dist/assets/{StatisticsDashboard-CBYJGUPH.js → StatisticsDashboard-BAZRqIPN.js} +1 -1
  26. package/dist/assets/{SysmlCodeEditor-Die2RUsz.js → SysmlCodeEditor-BBfup_Ni.js} +1 -1
  27. package/dist/assets/TabularView-I4LjHhoH.js +1 -0
  28. package/dist/assets/TraceabilityMatrix-DbrvjqLN.js +3 -0
  29. package/dist/assets/UiScreensWorkspace-DDD_PyJs.js +1 -0
  30. package/dist/assets/{WorkflowWizard-CbkDyd1W.js → WorkflowWizard-VwpEHt3R.js} +1 -1
  31. package/dist/assets/element-options-B7AgTB8R.js +3 -0
  32. package/dist/assets/html2canvas.esm-QH1iLAAe.js +22 -0
  33. package/dist/assets/index-BWMNo4wW.css +1 -0
  34. package/dist/assets/index-Bij8Q4Kg.js +45 -0
  35. package/dist/assets/index.es-ClbJxlAQ.js +18 -0
  36. package/dist/assets/jspdf.es.min-DZ68BGxk.js +170 -0
  37. package/dist/assets/notation-scene-DT8LpWVK.js +1 -0
  38. package/dist/assets/purify.es-DP5U8-sc.js +3 -0
  39. package/dist/assets/{reactflow-CsCqNKB-.js → reactflow-s7jmJtXx.js} +5 -5
  40. package/dist/index.html +3 -3
  41. package/lib/__tests__/compiler-bundling.test.d.ts +2 -0
  42. package/lib/__tests__/compiler-bundling.test.d.ts.map +1 -0
  43. package/lib/__tests__/compiler-bundling.test.js +32 -0
  44. package/lib/__tests__/compiler-bundling.test.js.map +1 -0
  45. package/lib/__tests__/standard-sysml-diagrams-smoke.test.d.ts +2 -0
  46. package/lib/__tests__/standard-sysml-diagrams-smoke.test.d.ts.map +1 -0
  47. package/lib/__tests__/standard-sysml-diagrams-smoke.test.js +22 -0
  48. package/lib/__tests__/standard-sysml-diagrams-smoke.test.js.map +1 -0
  49. package/lib/__tests__/supervised-child-args.test.d.ts +2 -0
  50. package/lib/__tests__/supervised-child-args.test.d.ts.map +1 -0
  51. package/lib/__tests__/supervised-child-args.test.js +35 -0
  52. package/lib/__tests__/supervised-child-args.test.js.map +1 -0
  53. package/lib/bin/memo-architect.js +30 -4
  54. package/lib/bin/memo-architect.js.map +1 -1
  55. package/lib/commands/dev.d.ts +18 -2
  56. package/lib/commands/dev.d.ts.map +1 -1
  57. package/lib/commands/dev.js +56 -8
  58. package/lib/commands/dev.js.map +1 -1
  59. package/lib/commands/example.d.ts +1 -0
  60. package/lib/commands/example.d.ts.map +1 -1
  61. package/lib/commands/example.js +2 -0
  62. package/lib/commands/example.js.map +1 -1
  63. package/lib/feature-grants.d.ts.map +1 -1
  64. package/lib/feature-grants.js +2 -2
  65. package/lib/feature-grants.js.map +1 -1
  66. package/package.json +12 -6
  67. package/dist/assets/AiWorkspace-DHZ6a9HJ.js +0 -3
  68. package/dist/assets/DSMView-TdC3EADB.js +0 -1
  69. package/dist/assets/Dashboard-DBfAOCJv.js +0 -1
  70. package/dist/assets/DhfSettingsPanel-Firov0IF.js +0 -1
  71. package/dist/assets/DiagramCanvas-BfwO8YE5.js +0 -1
  72. package/dist/assets/DiagramEditor-Cp9ORYoN.js +0 -4
  73. package/dist/assets/ElementDetailView-DOrG8v7V.js +0 -2
  74. package/dist/assets/ScenarioEditor-D06nbX4h.js +0 -3
  75. package/dist/assets/TabularView-BLzDtgmK.js +0 -1
  76. package/dist/assets/TraceabilityMatrix-DbL_FkAC.js +0 -1
  77. package/dist/assets/index-B8HDzVLs.css +0 -1
  78. package/dist/assets/index-D0vtjNjX.js +0 -3280
  79. package/dist/assets/layout-selection-DIQaaOIC.js +0 -1
package/dist/index.html CHANGED
@@ -8,10 +8,10 @@
8
8
  <link rel="preconnect" href="https://fonts.googleapis.com">
9
9
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
10
10
  <link href="https://fonts.googleapis.com/css2?family=Nunito:wght@700;800;900&display=swap" rel="stylesheet">
11
- <script type="module" crossorigin src="/assets/index-D0vtjNjX.js"></script>
11
+ <script type="module" crossorigin src="/assets/index-Bij8Q4Kg.js"></script>
12
12
  <link rel="modulepreload" crossorigin href="/assets/zustand-CrhqMOHB.js">
13
- <link rel="modulepreload" crossorigin href="/assets/reactflow-CsCqNKB-.js">
14
- <link rel="stylesheet" crossorigin href="/assets/index-B8HDzVLs.css">
13
+ <link rel="modulepreload" crossorigin href="/assets/reactflow-s7jmJtXx.js">
14
+ <link rel="stylesheet" crossorigin href="/assets/index-BWMNo4wW.css">
15
15
  </head>
16
16
  <body>
17
17
  <div id="root"></div>
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=compiler-bundling.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compiler-bundling.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/compiler-bundling.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,32 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { dirname, resolve } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ import { describe, expect, it } from 'vitest';
5
+ // ─── Architect delegates compiler selection to tools ─────────────────────────
6
+ //
7
+ // "The user is responsible for PATH" governs third-party validators. It has
8
+ // never governed MEMO's own compiler: a default install has to compile and draw
9
+ // with nothing installed and nothing configured. Architect therefore *bundles*
10
+ // its bundled `memo-sysmlc` default, SysIDE, or another configured provider.
11
+ //
12
+ // Resolving and spawning it stays in MEMO Tools (§1.2.2 rule 4). Architect's
13
+ // whole part in this is the tools dependency; that is what this test pins.
14
+ const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '../..');
15
+ const manifest = JSON.parse(readFileSync(resolve(ROOT, 'package.json'), 'utf8'));
16
+ describe('Architect delegates compiler selection to tools', () => {
17
+ it('declares tools, not a fixed compiler, as its runtime dependency', () => {
18
+ expect(Object.keys(manifest.dependencies)).toContain('@memoarchitect/tools');
19
+ expect(Object.keys(manifest.dependencies)).not.toContain('@memoarchitect/sysmlc');
20
+ });
21
+ it('does not declare a second compiler package', () => {
22
+ expect(manifest.dependencies['@memoarchitect/sysmlc']).toBeUndefined();
23
+ });
24
+ it('does not reach for the compiler itself', () => {
25
+ // Architect calls MEMO Tools; MEMO Tools spawns the compiler. An
26
+ // Architect that knew how to start `memo-sysmlc` would be a second
27
+ // implementation of an operation that already has one.
28
+ const dev = readFileSync(resolve(ROOT, 'src/commands/dev.ts'), 'utf8');
29
+ expect(dev).not.toMatch(/memo-sysmlc/);
30
+ });
31
+ });
32
+ //# sourceMappingURL=compiler-bundling.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compiler-bundling.test.js","sourceRoot":"","sources":["../../src/__tests__/compiler-bundling.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,gFAAgF;AAChF,EAAE;AACF,4EAA4E;AAC5E,gFAAgF;AAChF,+EAA+E;AAC/E,6EAA6E;AAC7E,EAAE;AACF,6EAA6E;AAC7E,2EAA2E;AAE3E,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;AACvE,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AAEjF,QAAQ,CAAC,iDAAiD,EAAE,GAAG,EAAE;IAC7D,EAAE,CAAC,iEAAiE,EAAE,GAAG,EAAE;QACvE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,sBAAsB,CAAC,CAAC;QAC7E,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,uBAAuB,CAAC,CAAC;IACtF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;QAClD,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,uBAAuB,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;IAC3E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAC9C,iEAAiE;QACjE,mEAAmE;QACnE,uDAAuD;QACvD,MAAM,GAAG,GAAG,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,qBAAqB,CAAC,EAAE,MAAM,CAAC,CAAC;QACvE,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=standard-sysml-diagrams-smoke.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standard-sysml-diagrams-smoke.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/standard-sysml-diagrams-smoke.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,22 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { createRequire } from 'node:module';
3
+ import { dirname, join } from 'node:path';
4
+ import { describe, expect, it } from 'vitest';
5
+ import { listArchitectExamples } from '../commands/example.js';
6
+ const require = createRequire(import.meta.url);
7
+ describe('memo-architect --example standard-sysml-diagrams', () => {
8
+ it('ships the runnable action-flow model with its source identities', () => {
9
+ expect(listArchitectExamples()).toContain('standard-sysml-diagrams');
10
+ const ontologyRoot = dirname(require.resolve('@memoarchitect/ontology/package.json'));
11
+ const source = readFileSync(join(ontologyRoot, 'examples/sysml-diagram-samples/model/sysml_v2_activity_example.sysml'), 'utf8');
12
+ expect(source).toContain('FulfillOrder');
13
+ expect(source).toContain('receiveOrder');
14
+ expect(source).toContain('routeOrder');
15
+ expect(source).toContain('readyToNotify');
16
+ expect(source).toContain('CustomerProcess');
17
+ expect(source).toContain('validUserDecision');
18
+ expect(source).toContain('shoppingDecision');
19
+ expect(source).toContain('creditDecision');
20
+ });
21
+ });
22
+ //# sourceMappingURL=standard-sysml-diagrams-smoke.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standard-sysml-diagrams-smoke.test.js","sourceRoot":"","sources":["../../src/__tests__/standard-sysml-diagrams-smoke.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C,QAAQ,CAAC,kDAAkD,EAAE,GAAG,EAAE;IAC9D,EAAE,CAAC,iEAAiE,EAAE,GAAG,EAAE;QACvE,MAAM,CAAC,qBAAqB,EAAE,CAAC,CAAC,SAAS,CAAC,yBAAyB,CAAC,CAAC;QACrE,MAAM,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,sCAAsC,CAAC,CAAC,CAAC;QACtF,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,sEAAsE,CAAC,EAAE,MAAM,CAAC,CAAC;QAChI,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;QACzC,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;QACzC,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;QACvC,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;QAC1C,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;QAC5C,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;QAC9C,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC;QAC7C,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=supervised-child-args.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supervised-child-args.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/supervised-child-args.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,35 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { supervisedChildArgs } from '../commands/dev.js';
3
+ // ─── Supervised child argv ──────────────────────────────────────────────────
4
+ //
5
+ // The supervisor rebuilds argv rather than forwarding it, so every flag the
6
+ // session was started with has to be restated. A dropped flag is invisible:
7
+ // the server starts, serves, and simply behaves as though the user never
8
+ // passed it — which is how `--experimental dev` came to serve a client with
9
+ // no Traceability, Ontology, Import or AI surfaces.
10
+ const ENTRY = '/usr/local/bin/memo-architect.js';
11
+ describe('supervisedChildArgs', () => {
12
+ it('carries the experimental grant to the child that serves the client', () => {
13
+ const args = supervisedChildArgs(ENTRY, { featureGrants: { experimental: true } }, true);
14
+ expect(args).toContain('--experimental');
15
+ });
16
+ it('does not invent a grant the session was started without', () => {
17
+ expect(supervisedChildArgs(ENTRY, { featureGrants: { experimental: false } }, true))
18
+ .not.toContain('--experimental');
19
+ expect(supervisedChildArgs(ENTRY, {}, true)).not.toContain('--experimental');
20
+ });
21
+ it('keeps the toolchain selection across a relaunch', () => {
22
+ const args = supervisedChildArgs(ENTRY, { toolchainArgv: ['--toolchain.validator=syside'] }, false);
23
+ expect(args).toContain('--toolchain.validator=syside');
24
+ });
25
+ it('opens a browser once, and never again on a relaunch', () => {
26
+ expect(supervisedChildArgs(ENTRY, { open: true }, true)).not.toContain('--no-open');
27
+ expect(supervisedChildArgs(ENTRY, { open: true }, false)).toContain('--no-open');
28
+ expect(supervisedChildArgs(ENTRY, { open: false }, true)).toContain('--no-open');
29
+ });
30
+ it('passes the resolved port, defaulting to 3000', () => {
31
+ expect(supervisedChildArgs(ENTRY, { port: 4100 }, true)).toEqual([ENTRY, 'dev', '--port', '4100']);
32
+ expect(supervisedChildArgs(ENTRY, {}, true)).toContain('3000');
33
+ });
34
+ });
35
+ //# sourceMappingURL=supervised-child-args.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supervised-child-args.test.js","sourceRoot":"","sources":["../../src/__tests__/supervised-child-args.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,+EAA+E;AAC/E,EAAE;AACF,4EAA4E;AAC5E,4EAA4E;AAC5E,yEAAyE;AACzE,4EAA4E;AAC5E,oDAAoD;AAEpD,MAAM,KAAK,GAAG,kCAAkC,CAAC;AAEjD,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,oEAAoE,EAAE,GAAG,EAAE;QAC1E,MAAM,IAAI,GAAG,mBAAmB,CAAC,KAA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AAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACrF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;QACpD,MAAM,CAAC,mBAAmB,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAC5D,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CACnC,CAAC;QACF,MAAM,CAAC,mBAAmB,CAAC,KAAK,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -4,15 +4,36 @@ import { architectBuildCommand } from '../commands/build.js';
4
4
  import { architectDevCommand } from '../commands/dev.js';
5
5
  import { architectExampleCommand, listArchitectExamples, listArchitectTemplates, } from '../commands/example.js';
6
6
  import { EXPERIMENTAL_FLAG_DESCRIPTION, resolveFeatureGrants } from '../feature-grants.js';
7
+ import { applyToolchainCliOptions, defaultRegistry, toolchainOptionName } from '@memoarchitect/tools';
7
8
  const program = new Command();
9
+ /**
10
+ * Toolchain flags, generated by MEMO Tools from its provider registry.
11
+ *
12
+ * Architect declares none of them itself and reads none of their values: it
13
+ * forwards them to the operation that owns the toolchain. That is the whole of
14
+ * §1.2.2 here — anything you can do in the UI you can script, without Architect
15
+ * learning a provider's name or a tool's output format.
16
+ */
17
+ const TOOLCHAIN_OPTION_NAMES = defaultRegistry.schema().map(toolchainOptionName);
18
+ function toolchainOptionsFrom(options) {
19
+ return Object.fromEntries(TOOLCHAIN_OPTION_NAMES
20
+ .filter(name => options[name] !== undefined)
21
+ .map(name => [name, options[name]]));
22
+ }
23
+ /** Re-emit the toolchain flags so the supervised child runs the same toolchain. */
24
+ function toolchainArgv(options) {
25
+ return Object.entries(toolchainOptionsFrom(options))
26
+ .flatMap(([name, value]) => [`--${name}`, String(value)]);
27
+ }
8
28
  program
9
29
  .name('memo-architect')
10
30
  .description('MEMO Architect — interactive and distributable model workbench')
11
- .version('0.6.3')
31
+ .version('0.6.6')
12
32
  .option('--example <name>', 'Open a bundled example project (e.g. gpca, standard-sysml-diagrams). A local checkout is opened in place; an installed package is opened read-only in a disposable copy')
13
33
  .option('--read-only', 'Always open the example in a disposable copy, even from a local checkout')
14
34
  .option('-p, --port <port>', 'Server port', '3000')
15
35
  .option('--no-open', 'Do not open a browser')
36
+ .option('--keep-alive', 'Keep running after the last browser disconnects')
16
37
  .option('--experimental', EXPERIMENTAL_FLAG_DESCRIPTION)
17
38
  .action(async (options) => {
18
39
  if (options.example) {
@@ -22,6 +43,7 @@ program
22
43
  open: options.open,
23
44
  readOnly: options.readOnly,
24
45
  featureGrants: resolveFeatureGrants(options),
46
+ keepAlive: options.keepAlive,
25
47
  });
26
48
  return;
27
49
  }
@@ -44,20 +66,24 @@ function resolveOption(command, name, local) {
44
66
  return parent.opts()[name];
45
67
  return local;
46
68
  }
47
- program
69
+ applyToolchainCliOptions(program
48
70
  .command('dev')
49
71
  .description('Start Architect with live model reload')
50
72
  .option('-p, --port <port>', 'Server port', '3000')
51
73
  .option('--no-open', 'Do not open a browser')
52
- .option('--experimental', EXPERIMENTAL_FLAG_DESCRIPTION)
53
- .action(async function (options) {
74
+ .option('--keep-alive', 'Keep running after the last browser disconnects')
75
+ .option('--experimental', EXPERIMENTAL_FLAG_DESCRIPTION), defaultRegistry).action(async function (options) {
54
76
  const port = resolveOption(this, 'port', options.port);
55
77
  const open = resolveOption(this, 'open', options.open);
56
78
  const experimental = resolveOption(this, 'experimental', options.experimental);
79
+ const keepAlive = resolveOption(this, 'keepAlive', options.keepAlive);
57
80
  await architectDevCommand({
58
81
  port: Number.parseInt(String(port), 10),
59
82
  open,
60
83
  featureGrants: resolveFeatureGrants({ experimental }),
84
+ keepAlive: keepAlive === true,
85
+ toolchainOptions: toolchainOptionsFrom(options),
86
+ toolchainArgv: toolchainArgv(options),
61
87
  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AG,CAAC,gDAAgD,CAAC,CAAC;AAClE,CAAC,CAAC,CAAC;AAEP,OAAO;KACF,OAAO,CAAC,WAAW,CAAC;KACpB,WAAW,CAAC,qDAAqD,CAAC;KAClE,MAAM,CAAC,GAAG,EAAE;IACT,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;IAC5C,KAAK,MAAM,EAAE,IAAI,sBAAsB,EAAE;QAAE,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAClE,OAAO,CAAC,GAAG,CAAC,wDAAwD,CAAC,CAAC;AAC1E,CAAC,CAAC,CAAC;AAEP,OAAO;KACF,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,4DAA4D,CAAC;KACzE,MAAM,CAAC,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,CAAC;KACxD,MAAM,CAAC,cAAc,EAAE,qDAAqD,CAAC;KAC7E,MAAM,CAAC,gBAAgB,EAAE,6BAA6B,CAAC;KACvD,MAAM,CAAC,KAAK,WAA0B,OAAyE;IAC5G,wEAAwE;IACxE,sEAAsE;IACtE,+CAA+C;IAC/C,MAAM,YAAY,GAAG,aAAa,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/E,MAAM,qBAAqB,CAAC;QACxB,GAAG,OAAO;QACV,aAAa,EAAE,oBAAoB,CAAC,EAAE,YAAY,EAAE,CAAC;KACxD,CAAC,CAAC;AACP,CAAC,CAAC,CAAC;AAEP,OAAO,CAAC,KAAK,EAAE,CAAC"}
@@ -1,7 +1,23 @@
1
1
  import { type FeatureGrants } from '../feature-grants.js';
2
- export declare function architectDevCommand(options: {
2
+ export interface ArchitectDevOptions {
3
3
  port?: number;
4
4
  open?: boolean;
5
5
  featureGrants?: FeatureGrants;
6
- }): Promise<void>;
6
+ keepAlive?: boolean;
7
+ /** Parsed `--toolchain.*` options, passed straight through to MEMO Tools. */
8
+ toolchainOptions?: Record<string, unknown>;
9
+ /** The same flags as argv, so the supervised child runs the same toolchain. */
10
+ toolchainArgv?: string[];
11
+ }
12
+ /**
13
+ * The argv the supervised child is launched with.
14
+ *
15
+ * The child, not this process, serves the client shell and holds the model
16
+ * runtime — so anything the session was started with has to be restated here
17
+ * or it is silently lost. That has bitten grants (the browser lost every
18
+ * experimental surface) and would bite the toolchain the same way, which is
19
+ * why this is one reviewable function rather than a line in a loop.
20
+ */
21
+ export declare function supervisedChildArgs(entry: string, options: ArchitectDevOptions, firstStart: boolean): string[];
22
+ export declare function architectDevCommand(options: ArchitectDevOptions): Promise<void>;
7
23
  //# sourceMappingURL=dev.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AAIA,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAY/E,wBAAsB,mBAAmB,CAAC,OAAO,EAAE;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,aAAa,CAAC,EAAE,aAAa,CAAC;CAChE,GAAG,OAAO,CAAC,IAAI,CAAC,CAoBhB"}
1
+ {"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AAMA,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAY/E,MAAM,WAAW,mBAAmB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,aAAa,CAAC,EAAE,aAAa,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAClF,6EAA6E;IAC7E,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,+EAA+E;IAC/E,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAC/B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,mBAAmB,EAC5B,UAAU,EAAE,OAAO,GACpB,MAAM,EAAE,CAOV;AAED,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CA8CrF"}
@@ -1,6 +1,8 @@
1
1
  import { existsSync } from 'node:fs';
2
2
  import { dirname, resolve } from 'node:path';
3
3
  import { fileURLToPath } from 'node:url';
4
+ import { spawn } from 'node:child_process';
5
+ import { once } from 'node:events';
4
6
  import { startProjectServer } from '@memoarchitect/tools';
5
7
  import { injectFeatureGrants } from '../feature-grants.js';
6
8
  function architectPackageRoot() {
@@ -11,20 +13,66 @@ function clientRoot() {
11
13
  const sourceRoot = resolve(root, 'packages', 'web');
12
14
  return existsSync(resolve(sourceRoot, 'index.html')) ? sourceRoot : root;
13
15
  }
16
+ /**
17
+ * The argv the supervised child is launched with.
18
+ *
19
+ * The child, not this process, serves the client shell and holds the model
20
+ * runtime — so anything the session was started with has to be restated here
21
+ * or it is silently lost. That has bitten grants (the browser lost every
22
+ * experimental surface) and would bite the toolchain the same way, which is
23
+ * why this is one reviewable function rather than a line in a loop.
24
+ */
25
+ export function supervisedChildArgs(entry, options, firstStart) {
26
+ const args = [entry, 'dev', '--port', String(options.port ?? 3000)];
27
+ if (!firstStart || options.open === false)
28
+ args.push('--no-open');
29
+ if (options.keepAlive)
30
+ args.push('--keep-alive');
31
+ if (options.featureGrants?.experimental === true)
32
+ args.push('--experimental');
33
+ args.push(...(options.toolchainArgv ?? []));
34
+ return args;
35
+ }
14
36
  export async function architectDevCommand(options) {
15
- // Ctrl+C has to stop the server. This command drives startProjectServer
16
- // directly rather than going through the Tools dev command, so it does not
17
- // inherit that command's signal handling and has to register its own —
18
- // without this the process ignores SIGINT and only a kill will end it.
19
- for (const signal of ['SIGINT', 'SIGTERM']) {
20
- process.once(signal, () => {
21
- process.exit(0);
22
- });
37
+ if (process.env.MEMO_ARCHITECT_RUNTIME_CHILD !== '1') {
38
+ const port = options.port ?? 3000;
39
+ let stopping = false;
40
+ let firstStart = true;
41
+ let restartStartedAt;
42
+ let child;
43
+ const stop = () => { stopping = true; child?.kill('SIGTERM'); };
44
+ process.once('SIGINT', stop);
45
+ process.once('SIGTERM', stop);
46
+ while (!stopping) {
47
+ const args = supervisedChildArgs(process.argv[1], { ...options, port }, firstStart);
48
+ child = spawn(process.execPath, args, {
49
+ cwd: process.cwd(), stdio: 'inherit',
50
+ env: {
51
+ ...process.env,
52
+ MEMO_ARCHITECT_RUNTIME_CHILD: '1',
53
+ ...(restartStartedAt ? { MEMO_RUNTIME_RESTART_STARTED_AT: String(restartStartedAt) } : {}),
54
+ },
55
+ });
56
+ firstStart = false;
57
+ const [code] = await once(child, 'exit');
58
+ child = undefined;
59
+ if (stopping || code !== 75) {
60
+ if (code && code !== 0)
61
+ process.exitCode = code;
62
+ break;
63
+ }
64
+ restartStartedAt = Date.now();
65
+ process.stderr.write(' Reusable semantics changed; relaunching model runtime...\n');
66
+ }
67
+ return;
23
68
  }
24
69
  await startProjectServer({
25
70
  port: options.port,
26
71
  open: options.open,
27
72
  clientRoot: clientRoot(),
73
+ exitWhenIdle: !options.keepAlive,
74
+ supervisedRuntime: true,
75
+ toolchainOptions: options.toolchainOptions,
28
76
  // Tools serves the shell; Architect decides what goes into it.
29
77
  transformClientHtml: options.featureGrants
30
78
  ? html => injectFeatureGrants(html, options.featureGrants)
@@ -1 +1 @@
1
- {"version":3,"file":"dev.js","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAsB,MAAM,sBA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CAAC;YACnB,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE,MAAM,CAAoB,CAAC;YAC5D,KAAK,GAAG,SAAS,CAAC;YAClB,IAAI,QAAQ,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;gBAC1B,IAAI,IAAI,IAAI,IAAI,KAAK,CAAC;oBAAE,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;gBAChD,MAAM;YACV,CAAC;YACD,gBAAgB,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YAC9B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,8DAA8D,CAAC,CAAC;QACzF,CAAC;QACD,OAAO;IACX,CAAC;IAED,MAAM,kBAAkB,CAAC;QACrB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,UAAU,EAAE,UAAU,EAAE;QACxB,YAAY,EAAE,CAAC,OAAO,CAAC,SAAS;QAChC,iBAAiB,EAAE,IAAI;QACvB,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;QAC1C,+DAA+D;QAC/D,mBAAmB,EAAE,OAAO,CAAC,aAAa;YACtC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,mBAAmB,CAAC,IAAI,EAAE,OAAO,CAAC,aAAc,CAAC;YAC3D,CAAC,CAAC,SAAS;KAClB,CAAC,CAAC;AACP,CAAC"}
@@ -18,5 +18,6 @@ export declare function architectExampleCommand(options: {
18
18
  /** Force the disposable copy even for a local checkout. */
19
19
  readOnly?: boolean;
20
20
  featureGrants?: FeatureGrants;
21
+ keepAlive?: boolean;
21
22
  }): Promise<void>;
22
23
  //# sourceMappingURL=example.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"example.d.ts","sourceRoot":"","sources":["../../src/commands/example.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAgE1D,kDAAkD;AAClD,wBAAgB,qBAAqB,IAAI,MAAM,EAAE,CAEhD;AAED,uEAAuE;AACvE,wBAAgB,sBAAsB,IAAI,MAAM,EAAE,CAEjD;AA2BD;;;;;;;GAOG;AACH,wBAAsB,uBAAuB,CAAC,OAAO,EAAE;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,aAAa,CAAC;CACjC,GAAG,OAAO,CAAC,IAAI,CAAC,CA6ChB"}
1
+ {"version":3,"file":"example.d.ts","sourceRoot":"","sources":["../../src/commands/example.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAgE1D,kDAAkD;AAClD,wBAAgB,qBAAqB,IAAI,MAAM,EAAE,CAEhD;AAED,uEAAuE;AACvE,wBAAgB,sBAAsB,IAAI,MAAM,EAAE,CAEjD;AA2BD;;;;;;;GAOG;AACH,wBAAsB,uBAAuB,CAAC,OAAO,EAAE;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB,GAAG,OAAO,CAAC,IAAI,CAAC,CA+ChB"}
@@ -128,6 +128,7 @@ export async function architectExampleCommand(options) {
128
128
  process.chdir(target);
129
129
  await architectDevCommand({
130
130
  port: options.port, open: options.open, featureGrants: options.featureGrants,
131
+ keepAlive: options.keepAlive,
131
132
  });
132
133
  return;
133
134
  }
@@ -149,6 +150,7 @@ export async function architectExampleCommand(options) {
149
150
  process.chdir(tempRoot);
150
151
  await architectDevCommand({
151
152
  port: options.port, open: options.open, featureGrants: options.featureGrants,
153
+ keepAlive: options.keepAlive,
152
154
  });
153
155
  }
154
156
  //# sourceMappingURL=example.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"example.js","sourceRoot":"","sources":["../../src/commands/example.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EACtD,YAAY,EAAE,YAAY,EAAE,MAAM,GACrC,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAG/C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C,wFAAwF;AACxF,SAAS,mBAAmB;IACxB,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,sCAAsC,CAAC,CAAC,CAAC;AAC5E,CAAC;AAED,qFAAqF;AACrF,SAAS,gBAAgB,CAAC,YAAoB,EAAE,SAAiB;IAC7D,MAAM,gBAAgB,GAAG,QAAQ,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;IAC3D,OAAO,gBAAgB,KAAK,EAAE;QAC1B,gBAAgB,KAAK,IAAI;QACzB,CAAC,gBAAgB,CAAC,UAAU,CAAC,KAAK,GAAG,EAAE,CAAC;QACxC,CAAC,gBAAgB,CAAC,UAAU,CAAC,GAAG,CAAC;QACjC,CAAC,gBAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AAC3C,CAAC;AAED;;;;GAIG;AACH,SAAS,iBAAiB,CAAC,YAAoB,EAAE,IAAY;IACzD,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,EAAE,UAAU,CAAC,CA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;AACP,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"feature-grants.d.ts","sourceRoot":"","sources":["../src/feature-grants.ts"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE;IAAE,YAAY,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,aAAa,CAEvF;AAED,kFAAkF;AAClF,eAAO,MAAM,6BAA6B,QAEsD,CAAC;AAEjG;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,MAAM,CAI/E"}
1
+ {"version":3,"file":"feature-grants.d.ts","sourceRoot":"","sources":["../src/feature-grants.ts"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE;IAAE,YAAY,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,aAAa,CAEvF;AAED,kFAAkF;AAClF,eAAO,MAAM,6BAA6B,QAEyD,CAAC;AAEpG;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,MAAM,CAI/E"}
@@ -9,8 +9,8 @@ export function resolveFeatureGrants(options) {
9
9
  return { experimental: options.experimental === true };
10
10
  }
11
11
  /** Shared `--experimental` help text, so every subcommand says the same thing. */
12
- export const EXPERIMENTAL_FLAG_DESCRIPTION = 'Enable experimental surfaces (currently the AI Tools: Model Assistant and SysML Generator). '
13
- + 'Off by default: generated content is unreviewed and carries no design-control provenance';
12
+ export const EXPERIMENTAL_FLAG_DESCRIPTION = 'Enable all experimental workbench surfaces (AI Tools, Ontology, Import, and Model Tools). '
13
+ + 'Off by default: advanced and generated content workflows carry no design-control provenance';
14
14
  /**
15
15
  * Splice grants into the client HTML shell.
16
16
  *
@@ -1 +1 @@
1
- {"version":3,"file":"feature-grants.js","sourceRoot":"","sources":["../src/feature-grants.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,EAAE;AACF,+EAA+E;AAC/E,yCAAyC;AACzC,gFAAgF;AAChF,gCAAgC;AAChC,gFAAgF;AAchF,MAAM,UAAU,oBAAoB,CAAC,OAAmC;IACpE,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,YAAY,KAAK,IAAI,EAAE,CAAC;AAC3D,CAAC;AAED,kFAAkF;AAClF,MAAM,CAAC,MAAM,6BAA6B,GACtC,8FAA8F;MAC5F,0FAA0F,CAAC;AAEjG;;;;;;;;;;GAUG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAY,EAAE,MAAqB;IACnE,IAAI,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC;QAAE,OAAO,IAAI,CAAC;IACjD,MAAM,GAAG,GAAG,iCAAiC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC;IAChF,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC;AAC9F,CAAC"}
1
+ {"version":3,"file":"feature-grants.js","sourceRoot":"","sources":["../src/feature-grants.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,EAAE;AACF,+EAA+E;AAC/E,yCAAyC;AACzC,gFAAgF;AAChF,gCAAgC;AAChC,gFAAgF;AAchF,MAAM,UAAU,oBAAoB,CAAC,OAAmC;IACpE,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,YAAY,KAAK,IAAI,EAAE,CAAC;AAC3D,CAAC;AAED,kFAAkF;AAClF,MAAM,CAAC,MAAM,6BAA6B,GACtC,4FAA4F;MAC1F,6FAA6F,CAAC;AAEpG;;;;;;;;;;GAUG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAY,EAAE,MAAqB;IACnE,IAAI,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC;QAAE,OAAO,IAAI,CAAC;IACjD,MAAM,GAAG,GAAG,iCAAiC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC;IAChF,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC;AAC9F,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@memoarchitect/architect",
3
- "version": "0.6.5",
4
- "description": "MEMO Architect \u2014 interactive workbench and distributable viewer for medical device systems engineering",
3
+ "version": "0.7.2",
4
+ "description": "MEMO Architect interactive workbench and distributable viewer for medical device systems engineering",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "memo-architect": "lib/bin/memo-architect.js"
@@ -17,7 +17,8 @@
17
17
  "LICENSE"
18
18
  ],
19
19
  "scripts": {
20
- "build": "pnpm run check:cache && pnpm run build:client && pnpm run check:bundle && pnpm run build:cli",
20
+ "build": "pnpm run generate:notation && pnpm run check:cache && pnpm run build:client && pnpm run check:bundle && pnpm run build:cli",
21
+ "generate:notation": "node scripts/generate-notation-registry.mjs",
21
22
  "prepack": "pnpm run clean && pnpm run build",
22
23
  "build:client": "vite build --config packages/web/vite.config.ts",
23
24
  "build:cli": "tsc -p tsconfig.architect.json",
@@ -40,9 +41,14 @@
40
41
  "test:cli": "vitest run --config vitest.cli.config.ts"
41
42
  },
42
43
  "dependencies": {
43
- "@memoarchitect/tools": "0.6.5",
44
- "@memoarchitect/ontology": "0.6.3",
45
- "commander": "^12.1.0"
44
+ "@memoarchitect/ontology": "0.7.0",
45
+ "@memoarchitect/tools": "0.7.2",
46
+ "class-variance-authority": "^0.7.1",
47
+ "clsx": "^2.1.1",
48
+ "commander": "^12.1.0",
49
+ "html-to-image": "^1.11.13",
50
+ "jspdf": "^4.2.1",
51
+ "tailwind-merge": "^3.6.0"
46
52
  },
47
53
  "devDependencies": {
48
54
  "@dagrejs/dagre": "^2.0.0",
@@ -1,3 +0,0 @@
1
- import{j as e}from"./reactflow-CsCqNKB-.js";import{u as v,k as M,m as _,n as N,o as G}from"./index-D0vtjNjX.js";import{a as l}from"./zustand-CrhqMOHB.js";const U={env:"an environment variable","env-file":"the project .env file","project-settings":"project settings","user-credentials":"your saved credentials",default:"the default"},Y={anthropic:"claude-opus-5",openai:"gpt-4o"};function V({onClose:t}){const i=v(a=>a.llmSettings),f=v(a=>a.registerLlmRequest),[n,p]=l.useState((i==null?void 0:i.provider)??"anthropic"),[x,d]=l.useState((i==null?void 0:i.model)??""),[c,g]=l.useState(""),[m,E]=l.useState(!1),[b,j]=l.useState(null),k=l.useCallback(async()=>{E(!0),j(null);const a=`llmset-${Date.now()}-${Math.random().toString(36).slice(2)}`;try{await new Promise((u,S)=>{f(a,u,S),M(a,{provider:n,model:x.trim()||void 0,...c?{apiKey:c}:{}}),setTimeout(()=>S(new Error("The save timed out.")),2e4)}),g(""),j("Saved.")}catch(u){j((u==null?void 0:u.message)??"The settings could not be saved.")}finally{E(!1)}},[n,x,c,f]),C=l.useCallback(async()=>{E(!0),j(null);const a=`llmclear-${Date.now()}-${Math.random().toString(36).slice(2)}`;try{await new Promise((u,S)=>{f(a,u,S),M(a,{provider:n,apiKey:""}),setTimeout(()=>S(new Error("The request timed out.")),2e4)}),j("Key removed.")}catch(u){j((u==null?void 0:u.message)??"The key could not be removed.")}finally{E(!1)}},[n,f]),w={fontSize:"11px",fontWeight:600,color:"#374151",display:"block",marginBottom:"4px"},s={width:"100%",padding:"6px 10px",border:"1px solid #E5E5E0",borderRadius:"6px",fontSize:"12px",outline:"none",background:"#fff",color:"#1B3A4B",fontFamily:"inherit"};return e.jsxs("div",{style:{padding:"14px 20px",background:"#fff",borderBottom:"1px solid #E5E5E0",display:"flex",flexDirection:"column",gap:"12px",flexShrink:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[e.jsx("div",{style:{flex:1,fontSize:"12px",fontWeight:700,color:"#1B3A4B"},children:"LLM settings"}),e.jsx("button",{onClick:t,style:{background:"none",border:"none",color:"#9CA3AF",fontSize:"14px",cursor:"pointer"},children:"✕"})]}),e.jsxs("div",{style:{display:"flex",gap:"10px"},children:[e.jsxs("div",{style:{flex:"0 0 130px"},children:[e.jsx("label",{style:w,children:"Provider"}),e.jsxs("select",{value:n,onChange:a=>p(a.target.value),style:{...s,cursor:"pointer"},children:[e.jsx("option",{value:"anthropic",children:"Anthropic"}),e.jsx("option",{value:"openai",children:"OpenAI-compatible"})]})]}),e.jsxs("div",{style:{flex:1},children:[e.jsx("label",{style:w,children:"Model"}),e.jsx("input",{value:x,onChange:a=>d(a.target.value),placeholder:Y[n]??"",style:s})]})]}),e.jsxs("div",{children:[e.jsx("label",{style:w,children:"API key"}),i&&!i.keyEditable&&i.configured?e.jsxs("div",{style:{fontSize:"11px",color:"#6B7280",lineHeight:1.6},children:["A key is already supplied by ",U[i.keyOrigin??"default"],", which takes precedence over anything saved here. Remove it there to set a key from this screen."]}):e.jsxs(e.Fragment,{children:[e.jsx("input",{type:"password",value:c,onChange:a=>g(a.target.value),placeholder:i!=null&&i.configured?"Saved — type a new key to replace it":"sk-…",autoComplete:"off",style:s}),e.jsxs("div",{style:{fontSize:"10px",color:"#9CA3AF",marginTop:"4px",lineHeight:1.5},children:["Stored in ",e.jsx("code",{children:"~/.memo/credentials.json"})," with owner-only permissions — outside this project, so it is never committed. You can also set"," ",e.jsx("code",{children:"ANTHROPIC_API_KEY"})," in the environment or a project ",e.jsx("code",{children:".env"}),"."]})]})]}),e.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[e.jsx("button",{onClick:k,disabled:m,style:{padding:"6px 14px",borderRadius:"6px",border:"none",background:"#1B3A4B",color:"#fff",fontSize:"11px",fontWeight:600,cursor:m?"default":"pointer",opacity:m?.5:1},children:m?"Saving…":"Save"}),(i==null?void 0:i.configured)&&i.keyEditable&&e.jsx("button",{onClick:C,disabled:m,style:{padding:"6px 12px",borderRadius:"6px",border:"1px solid #E5E5E0",background:"transparent",color:"#dc2626",fontSize:"11px",cursor:"pointer"},children:"Remove saved key"}),b&&e.jsx("span",{style:{fontSize:"11px",color:"#6B7280"},children:b})]})]})}const Q=["What hazards have no risk controls?","Show trace from requirements to verification.","Which layers have the most gaps?","How many unmitigated hazards are there?","List all SOUP components."],X=12e4;function J(){const t=v(o=>o.llmAvailable),i=v(o=>o.llmProvider),f=v(o=>o.llmModel),n=v(o=>o.model),p=v(o=>o.registerLlmRequest),[x,d]=l.useState([]),[c,g]=l.useState([]),[m,E]=l.useState(""),[b,j]=l.useState(!1),[k,C]=l.useState(!1),[w,s]=l.useState(!1),[a,u]=l.useState(!1),[S,D]=l.useState(new Set),[T,B]=l.useState(null),L=l.useRef(null),$=l.useRef(null);l.useEffect(()=>{var o;(o=L.current)==null||o.scrollIntoView({behavior:"smooth"})},[x,b]);const R=l.useCallback((o,h)=>new Promise((y,r)=>{p(o,y,r),h(),setTimeout(()=>r(new Error("The request timed out after 2 minutes.")),X)}),[p]),I=l.useCallback(async o=>{if(!o.trim()||b)return;const h=o.trim();E(""),d(r=>[...r,{role:"user",content:h}]),j(!0),B(null);const y=`chat-${Date.now()}-${Math.random().toString(36).slice(2)}`;try{const r=await R(y,()=>_(y,h,c,k));g(r.messages),d(A=>[...A,{role:"assistant",content:r.truncated?`${r.answer}
2
-
3
- _(Stopped at the tool-call limit for one turn — ask again to continue.)_`:r.answer,changes:r.proposedChanges.length?r.proposedChanges:void 0}]),r.proposedChanges.length&&D(A=>{const F=new Set(A);for(const z of r.proposedChanges)F.add(z.id);return F})}catch(r){d(A=>[...A,{role:"assistant",content:(r==null?void 0:r.message)??"Unknown error",error:!0}])}finally{j(!1)}},[b,c,k,R]),W=o=>{o.key==="Enter"&&!o.shiftKey&&(o.preventDefault(),I(m))},P=o=>{D(h=>{const y=new Set(h);return y.has(o)?y.delete(o):y.add(o),y})},q=l.useCallback(async o=>{const h=o.filter(r=>S.has(r.id));if(h.length===0||a)return;u(!0),B(null);const y=`apply-${Date.now()}-${Math.random().toString(36).slice(2)}`;try{const r=await R(y,()=>N(y,h)),A=new Set(r.applied);d(F=>F.map(z=>z.changes?{...z,changes:z.changes.filter(H=>!A.has(H.id))}:z)),B(r.failed.length?`Applied ${r.applied.length}. Failed: ${r.failed.map(F=>F.error).join("; ")}`:`Applied ${r.applied.length} change${r.applied.length===1?"":"s"} to the model source.`)}catch(r){B((r==null?void 0:r.message)??"The changes could not be applied.")}finally{u(!1)}},[S,a,R]),O=o=>{const h=new Set(o.map(y=>y.id));d(y=>y.map(r=>r.changes?{...r,changes:r.changes.filter(A=>!h.has(A.id))}:r))},K=()=>{d([]),g([]),D(new Set),B(null)};return n?e.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",background:"#F7F7F5",overflow:"hidden"},children:[e.jsxs("div",{style:{padding:"14px 20px 10px",borderBottom:"1px solid #E5E5E0",background:"#fff",flexShrink:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[e.jsx("span",{style:{fontSize:"16px"},children:"✦"}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{style:{fontSize:"14px",fontWeight:700,color:"#1B3A4B"},children:"Model Assistant"}),e.jsx("div",{style:{fontSize:"11px",color:t?"#059669":"#dc2626",marginTop:"1px"},children:t?`${i??"LLM"} · ${f??"unknown model"}`:"No API key configured"})]}),e.jsx("button",{onClick:()=>s(o=>!o),title:"LLM settings",style:{background:w?"#F3F4F6":"none",border:"1px solid #E5E5E0",borderRadius:"6px",padding:"4px 8px",fontSize:"12px",color:"#374151",cursor:"pointer"},children:"⚙ Settings"})]}),e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"8px",fontSize:"11px",color:"#6B7280",cursor:"pointer"},children:[e.jsx("input",{type:"checkbox",checked:k,onChange:o=>C(o.target.checked),style:{cursor:"pointer"}}),"Suggest edits — the assistant may propose model changes for your approval"]})]}),w&&e.jsx(V,{onClose:()=>s(!1)}),e.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"16px 20px",display:"flex",flexDirection:"column",gap:"12px"},children:[x.length===0&&e.jsxs("div",{style:{paddingTop:"8px"},children:[e.jsx("div",{style:{fontSize:"12px",color:"#9CA3AF",marginBottom:"12px"},children:"Ask about your model in plain English. The assistant can look up any element, follow traceability chains, and read validation gaps."}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:Q.map(o=>e.jsx("button",{onClick:()=>I(o),disabled:!t||b,style:{textAlign:"left",padding:"8px 12px",borderRadius:"8px",background:"#fff",border:"1px solid #E5E5E0",fontSize:"12px",color:"#374151",cursor:"pointer",transition:"border-color 0.1s",opacity:t?1:.5},onMouseEnter:h=>{t&&(h.currentTarget.style.borderColor="#2DD4A8")},onMouseLeave:h=>{h.currentTarget.style.borderColor="#E5E5E0"},children:o},o))})]}),x.map((o,h)=>e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[e.jsxs("div",{style:{display:"flex",flexDirection:o.role==="user"?"row-reverse":"row",gap:"8px",alignItems:"flex-start"},children:[e.jsx("div",{style:{width:"24px",height:"24px",borderRadius:"50%",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:o.role==="user"?"#1B3A4B":"#2DD4A815",fontSize:"10px",fontWeight:700,color:o.role==="user"?"#fff":"#2DD4A8",marginTop:"2px"},children:o.role==="user"?"U":"✦"}),e.jsx("div",{style:{maxWidth:"85%",padding:"10px 12px",borderRadius:"10px",background:o.role==="user"?"#1B3A4B":o.error?"#fef2f2":"#fff",color:o.role==="user"?"#fff":o.error?"#dc2626":"#1B3A4B",fontSize:"13px",lineHeight:"1.6",border:o.role==="assistant"?`1px solid ${o.error?"#fecaca":"#E5E5E0"}`:"none",whiteSpace:"pre-wrap"},children:o.content})]}),o.changes&&o.changes.length>0&&e.jsx(Z,{changes:o.changes,approved:S,onToggle:P,onApply:()=>q(o.changes),onDiscard:()=>O(o.changes),applying:a})]},h)),T&&e.jsx("div",{style:{fontSize:"11px",color:"#374151",background:"#fff",border:"1px solid #E5E5E0",borderRadius:"8px",padding:"8px 12px"},children:T}),b&&e.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"flex-start"},children:[e.jsx("div",{style:{width:"24px",height:"24px",borderRadius:"50%",background:"#2DD4A815",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"10px",color:"#2DD4A8",fontWeight:700},children:"✦"}),e.jsx("div",{style:{padding:"10px 14px",borderRadius:"10px",background:"#fff",border:"1px solid #E5E5E0",display:"flex",gap:"4px",alignItems:"center"},children:e.jsx(oe,{})})]}),e.jsx("div",{ref:L})]}),e.jsxs("div",{style:{padding:"12px 16px",borderTop:"1px solid #E5E5E0",background:"#fff",flexShrink:0},children:[e.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"flex-end"},children:[e.jsx("textarea",{ref:$,value:m,onChange:o=>E(o.target.value),onKeyDown:W,disabled:!t||b,placeholder:t?"Ask a question… (Enter to send, Shift+Enter for newline)":"Add an API key in Settings to start",rows:2,style:{flex:1,padding:"8px 12px",border:"1px solid #E5E5E0",borderRadius:"8px",fontSize:"13px",resize:"none",fontFamily:"inherit",outline:"none",background:"#F7F7F5",color:"#1B3A4B",lineHeight:"1.5",opacity:t?1:.5},onFocus:o=>{o.target.style.borderColor="#2DD4A8"},onBlur:o=>{o.target.style.borderColor="#E5E5E0"}}),e.jsx("button",{onClick:()=>I(m),disabled:!t||b||!m.trim(),style:{padding:"8px 14px",borderRadius:"8px",border:"none",background:"#1B3A4B",color:"#fff",fontSize:"12px",fontWeight:600,cursor:"pointer",flexShrink:0,opacity:!t||!m.trim()?.4:1,transition:"opacity 0.15s"},children:"Send"})]}),x.length>0&&e.jsx("button",{onClick:K,style:{marginTop:"6px",background:"none",border:"none",color:"#9CA3AF",fontSize:"11px",cursor:"pointer",padding:0},children:"Clear conversation"})]})]}):e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",color:"#9CA3AF"},children:"Waiting for model data…"})}function Z({changes:t,approved:i,onToggle:f,onApply:n,onDiscard:p,applying:x}){const d=t.filter(c=>i.has(c.id)).length;return e.jsxs("div",{style:{marginLeft:"32px",border:"1px solid #FCD34D",borderRadius:"10px",background:"#FFFBEB",overflow:"hidden"},children:[e.jsxs("div",{style:{padding:"8px 12px",borderBottom:"1px solid #FDE68A",fontSize:"11px",fontWeight:700,color:"#92400E"},children:[t.length," proposed change",t.length===1?"":"s"," — nothing is written until you apply"]}),e.jsx("div",{style:{display:"flex",flexDirection:"column"},children:t.map(c=>e.jsxs("label",{style:{display:"flex",gap:"8px",alignItems:"flex-start",padding:"8px 12px",borderBottom:"1px solid #FDE68A",cursor:"pointer",fontSize:"12px"},children:[e.jsx("input",{type:"checkbox",checked:i.has(c.id),onChange:()=>f(c.id),style:{marginTop:"2px",cursor:"pointer"}}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{style:{fontWeight:600,color:"#1B3A4B"},children:ee(c)}),e.jsx("div",{style:{color:"#92400E",marginTop:"2px"},children:c.summary}),e.jsx(te,{change:c})]})]},c.id))}),e.jsxs("div",{style:{padding:"8px 12px",display:"flex",gap:"8px",alignItems:"center"},children:[e.jsx("button",{onClick:n,disabled:d===0||x,style:{padding:"6px 12px",borderRadius:"6px",border:"none",background:"#92400E",color:"#fff",fontSize:"11px",fontWeight:600,cursor:d===0||x?"default":"pointer",opacity:d===0||x?.4:1},children:x?"Applying…":`Apply ${d} selected`}),e.jsx("button",{onClick:p,disabled:x,style:{padding:"6px 12px",borderRadius:"6px",border:"1px solid #FDE68A",background:"transparent",color:"#92400E",fontSize:"11px",cursor:"pointer"},children:"Discard all"})]})]})}function ee(t){switch(t.kind){case"create-element":return`Create ${t.elementKind} · ${t.elementId}`;case"update-element":return`Update · ${t.elementId}`;case"create-relationship":return`Relate · ${t.sourceId} → ${t.targetId}`;case"delete-relationship":return`Remove relationship · ${t.relationshipId}`}}function te({change:t}){const i={fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:"11px",color:"#374151",marginTop:"4px"};if(t.kind==="create-element"){const f=Object.entries(t.attributes??{});return e.jsxs("div",{style:i,children:[e.jsxs("div",{children:["name = ",t.name]}),t.layer&&e.jsxs("div",{children:["layer = ",t.layer]}),f.map(([n,p])=>e.jsxs("div",{children:[n," = ",p]},n))]})}if(t.kind==="update-element"){const f=new Set([...Object.keys(t.changes.attributes??{}),...t.changes.name!==void 0?["name"]:[],...t.changes.doc!==void 0?["doc"]:[]]);return e.jsx("div",{style:i,children:[...f].map(n=>{var d,c;const p=n==="name"?t.before.name:n==="doc"?t.before.doc:(d=t.before.attributes)==null?void 0:d[n],x=n==="name"?t.changes.name:n==="doc"?t.changes.doc:(c=t.changes.attributes)==null?void 0:c[n];return e.jsxs("div",{children:[n,": ",e.jsx("span",{style:{color:"#dc2626",textDecoration:"line-through"},children:p||"∅"})," → ",e.jsx("span",{style:{color:"#059669"},children:x})]},n)})})}return t.kind==="create-relationship"?e.jsxs("div",{style:i,children:[t.sourceId," —",t.relationshipType,"→ ",t.targetId]}):e.jsxs("div",{style:i,children:[t.sourceId," —",t.relationshipType,"→ ",t.targetId]})}function oe(){return e.jsxs("span",{style:{display:"inline-flex",gap:"3px",alignItems:"center"},children:[[0,1,2].map(t=>e.jsx("span",{style:{width:"5px",height:"5px",borderRadius:"50%",background:"#9CA3AF",animation:"llm-pulse 1.2s ease-in-out infinite",animationDelay:`${t*.2}s`}},t)),e.jsx("style",{children:"@keyframes llm-pulse{0%,80%,100%{opacity:0.3}40%{opacity:1}}"})]})}const ne=["Add a PressureSensor component with a USB interface and a power port.","Create a hazard: AlarmFailure that causes patient harm in ICU setting.","Define a software item InfusionController with a requirement for dose limit checking.","Add a RiskControlMeasure that mitigates OverInfusion by adding a flow rate sensor."];function re(){const t=v(s=>s.llmAvailable),i=v(s=>s.llmProvider),f=v(s=>s.llmModel),n=v(s=>s.registerLlmRequest),[p,x]=l.useState(""),[d,c]=l.useState(!1),[g,m]=l.useState(null),[E,b]=l.useState(null),[j,k]=l.useState(!1),C=l.useCallback(async s=>{if(!s.trim()||d)return;c(!0),m(null),b(null),k(!1);const a=`gen-${Date.now()}-${Math.random().toString(36).slice(2)}`;try{const u=await new Promise((S,D)=>{n(a,S,D),G(a,s.trim()),setTimeout(()=>D(new Error("Request timed out after 60 seconds.")),6e4)});m(u)}catch(u){b((u==null?void 0:u.message)??"Unknown error")}finally{c(!1)}},[d,n]),w=()=>{g!=null&&g.sysml&&navigator.clipboard.writeText(g.sysml).then(()=>{k(!0),setTimeout(()=>k(!1),2e3)})};return e.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",background:"#F7F7F5",overflow:"hidden"},children:[e.jsx("div",{style:{padding:"14px 20px 10px",borderBottom:"1px solid #E5E5E0",background:"#fff",flexShrink:0},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[e.jsx("span",{style:{fontSize:"16px"},children:"⟨/⟩"}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:"14px",fontWeight:700,color:"#1B3A4B"},children:"SysML Generator"}),e.jsx("div",{style:{fontSize:"11px",color:t?"#059669":"#dc2626",marginTop:"1px"},children:t?`${i??"LLM"} · ${f??"unknown model"} · natural language → SysML v2`:"No LLM provider — set ANTHROPIC_API_KEY or OPENAI_API_KEY"})]})]})}),e.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"20px"},children:[e.jsxs("div",{style:{marginBottom:"16px"},children:[e.jsx("label",{style:{fontSize:"12px",fontWeight:600,color:"#374151",display:"block",marginBottom:"6px"},children:"Describe what to generate"}),e.jsx("textarea",{value:p,onChange:s=>x(s.target.value),disabled:!t||d,rows:4,placeholder:"Describe the element(s) to generate in plain English…",style:{width:"100%",padding:"10px 12px",border:"1px solid #E5E5E0",borderRadius:"8px",fontSize:"13px",resize:"vertical",fontFamily:"inherit",outline:"none",background:"#fff",color:"#1B3A4B",lineHeight:"1.5",boxSizing:"border-box",opacity:t?1:.5},onFocus:s=>{s.target.style.borderColor="#2DD4A8"},onBlur:s=>{s.target.style.borderColor="#E5E5E0"},onKeyDown:s=>{s.key==="Enter"&&(s.metaKey||s.ctrlKey)&&(s.preventDefault(),C(p))}}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:"8px"},children:[e.jsx("span",{style:{fontSize:"11px",color:"#9CA3AF"},children:"Cmd+Enter to generate"}),e.jsx("button",{onClick:()=>C(p),disabled:!t||d||!p.trim(),style:{padding:"6px 16px",borderRadius:"8px",border:"none",background:"#1B3A4B",color:"#fff",fontSize:"12px",fontWeight:600,cursor:"pointer",opacity:!t||!p.trim()?.4:1},children:d?"Generating…":"Generate SysML"})]})]}),!g&&!d&&e.jsxs("div",{style:{marginBottom:"16px"},children:[e.jsx("div",{style:{fontSize:"11px",fontWeight:600,color:"#9CA3AF",textTransform:"uppercase",letterSpacing:"0.06em",marginBottom:"8px"},children:"Examples"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"5px"},children:ne.map(s=>e.jsx("button",{onClick:()=>{x(s)},disabled:!t,style:{textAlign:"left",padding:"7px 11px",borderRadius:"6px",background:"#fff",border:"1px solid #E5E5E0",fontSize:"12px",color:"#374151",cursor:"pointer",opacity:t?1:.5},onMouseEnter:a=>{t&&(a.currentTarget.style.borderColor="#2DD4A8")},onMouseLeave:a=>{a.currentTarget.style.borderColor="#E5E5E0"},children:s},s))})]}),d&&e.jsxs("div",{style:{background:"#fff",border:"1px solid #E5E5E0",borderRadius:"10px",padding:"20px",textAlign:"center",color:"#9CA3AF",fontSize:"13px"},children:[e.jsx("div",{style:{marginBottom:"8px",fontSize:"20px"},children:"⟨/⟩"}),"Generating SysML v2…"]}),E&&e.jsxs("div",{style:{background:"#fef2f2",border:"1px solid #fecaca",borderRadius:"8px",padding:"12px",color:"#dc2626",fontSize:"13px"},children:[e.jsx("strong",{children:"Error:"})," ",E]}),g&&!d&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[e.jsxs("div",{style:{background:"#F0FDF9",border:"1px solid #A7F3D0",borderRadius:"8px",padding:"12px"},children:[e.jsx("div",{style:{fontSize:"11px",fontWeight:600,color:"#065F46",marginBottom:"4px",textTransform:"uppercase",letterSpacing:"0.06em"},children:"Explanation"}),e.jsx("p",{style:{fontSize:"13px",color:"#1B3A4B",margin:0,lineHeight:"1.6"},children:g.explanation}),g.suggestedFile&&e.jsxs("div",{style:{marginTop:"8px",fontSize:"11px",color:"#6B7280"},children:["Suggested file: ",e.jsx("code",{style:{background:"#D1FAE5",padding:"1px 5px",borderRadius:"3px"},children:g.suggestedFile})]})]}),e.jsxs("div",{style:{background:"#1e293b",borderRadius:"10px",overflow:"hidden"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 14px",borderBottom:"1px solid #334155"},children:[e.jsx("span",{style:{fontSize:"11px",color:"#94a3b8",fontWeight:600},children:"SysML v2"}),e.jsx("button",{onClick:w,style:{padding:"3px 10px",borderRadius:"4px",border:"none",background:j?"#059669":"#334155",color:"#fff",fontSize:"11px",cursor:"pointer",fontWeight:500},children:j?"Copied!":"Copy"})]}),e.jsx("pre",{style:{margin:0,padding:"14px 16px",fontSize:"12px",lineHeight:"1.6",color:"#e2e8f0",overflowX:"auto",fontFamily:"'SF Mono', 'Fira Code', 'Consolas', monospace"},children:e.jsx("code",{children:g.sysml})})]}),e.jsxs("div",{style:{fontSize:"11px",color:"#9CA3AF",padding:"4px 0"},children:["Review the generated SysML before saving. Copy it into your project's ",e.jsx("code",{children:".sysml"})," files. The dev server will pick up the changes automatically."]}),e.jsx("button",{onClick:()=>{m(null),x("")},style:{padding:"6px 14px",borderRadius:"6px",border:"1px solid #E5E5E0",background:"#fff",color:"#374151",fontSize:"12px",cursor:"pointer",alignSelf:"flex-start"},children:"Generate another"})]})]})]})}const se=[{view:"ask",label:"Model Assistant",description:"Ask questions and propose edits"},{view:"sysml-generator",label:"SysML Generator",description:"Natural language → SysML v2"}];function de(){const t=v(n=>n.activeView),i=v(n=>n.setActiveView),f=t.type==="sysml-generator"?"sysml-generator":"ask";return e.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",overflow:"hidden"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"10px 16px",borderBottom:"1px solid #E5E7EB",background:"#fff",flexShrink:0,flexWrap:"wrap"},children:[e.jsxs("span",{style:{fontSize:"10px",fontWeight:700,color:"#065F46",textTransform:"uppercase",letterSpacing:"0.06em",display:"flex",alignItems:"center",gap:"4px",marginRight:"4px"},children:[e.jsx("span",{children:"✦"})," AI Tools"]}),se.map(n=>{const p=f===n.view;return e.jsx("button",{onClick:()=>i({type:n.view}),title:n.description,"aria-current":p?"page":void 0,style:{padding:"5px 12px",borderRadius:"6px",fontSize:"13px",fontWeight:p?600:400,cursor:"pointer",background:p?"#F0FDF9":"transparent",border:`1px solid ${p?"#A7F3D0":"transparent"}`,color:p?"#065F46":"#6B7280"},children:n.label},n.view)}),e.jsx("span",{style:{flex:1}}),e.jsx("span",{title:"Enabled by --experimental. Generated content is unreviewed and carries no design-control provenance.",style:{fontSize:"10px",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.06em",color:"#92400E",background:"#FEF3C7",border:"1px solid #FDE68A",borderRadius:"4px",padding:"2px 6px"},children:"Experimental"})]}),e.jsx("div",{style:{flex:1,minHeight:0,overflow:"hidden"},children:f==="ask"?e.jsx(J,{}):e.jsx(re,{})})]})}export{de as AiWorkspace};