archsight 0.2.0 → 0.2.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.
- checksums.yaml +4 -4
- data/chart/archsight/values.yaml +2 -0
- data/docs/kubernetes.md +53 -0
- data/lib/archsight/annotations/annotation.rb +13 -1
- data/lib/archsight/cli.rb +6 -0
- data/lib/archsight/import/license_analyzer.rb +14 -6
- data/lib/archsight/resources/base.rb +2 -2
- data/lib/archsight/resources/technology_artifact.rb +7 -3
- data/lib/archsight/version.rb +1 -1
- data/lib/archsight/web/application.rb +38 -0
- data/lib/archsight/web/public/vue/{ApiDocsPage-B1RqTNqh.js → ApiDocsPage-Cwn04X61.js} +1 -1
- data/lib/archsight/web/public/vue/{DocPage-DzwBgBd4.js → DocPage-Y83PCbYi.js} +1 -1
- data/lib/archsight/web/public/vue/{EditorPage-D_miHSv4.js → EditorPage-DqRMOBE6.js} +1 -1
- data/lib/archsight/web/public/vue/{ErrorPage-CQQtPey3.js → ErrorPage-D0lKMCXA.js} +1 -1
- data/lib/archsight/web/public/vue/{GraphView-T9jFH_qg.js → GraphView-Byq-Nfd9.js} +1 -1
- data/lib/archsight/web/public/vue/{InstanceRouter-1Sm-CRhf.js → InstanceRouter-B3Q2fH0X.js} +1 -1
- data/lib/archsight/web/public/vue/{KindList-JA_L_-Cz.js → KindList-DlDrvJDd.js} +1 -1
- data/lib/archsight/web/public/vue/{ResourceList-8iqavWdg.js → ResourceList-DwsfI85-.js} +1 -1
- data/lib/archsight/web/public/vue/{SearchResults-BdgFeHcm.js → SearchResults-DlWGROho.js} +1 -1
- data/lib/archsight/web/public/vue/{_basePickBy-CVgieyx-.js → _basePickBy-DXGWsL9H.js} +1 -1
- data/lib/archsight/web/public/vue/{_baseUniq-BNfrOSaP.js → _baseUniq-C8pAAASt.js} +1 -1
- data/lib/archsight/web/public/vue/{architectureDiagram-VXUJARFQ-CJXNpTr5.js → architectureDiagram-VXUJARFQ-Dg_wTk4u.js} +1 -1
- data/lib/archsight/web/public/vue/{blockDiagram-VD42YOAC-B5488Hes.js → blockDiagram-VD42YOAC-C8HXvtNT.js} +1 -1
- data/lib/archsight/web/public/vue/{c4Diagram-YG6GDRKO-eYY3hprM.js → c4Diagram-YG6GDRKO-QzXboDJ8.js} +1 -1
- data/lib/archsight/web/public/vue/{chunk-4BX2VUAB-ZoXeL4D1.js → chunk-4BX2VUAB-DSPzEX5F.js} +1 -1
- data/lib/archsight/web/public/vue/{chunk-55IACEB6-rNtQYnu_.js → chunk-55IACEB6-Dd5Z8Bov.js} +1 -1
- data/lib/archsight/web/public/vue/{chunk-B4BG7PRW-DolAeVV9.js → chunk-B4BG7PRW-B_hXD1nI.js} +1 -1
- data/lib/archsight/web/public/vue/{chunk-DI55MBZ5-DnN0f_hj.js → chunk-DI55MBZ5-C-2DUMJY.js} +1 -1
- data/lib/archsight/web/public/vue/{chunk-FMBD7UC4-BQWOCMuR.js → chunk-FMBD7UC4-BlBtfKnL.js} +1 -1
- data/lib/archsight/web/public/vue/{chunk-QN33PNHL-DId301Kb.js → chunk-QN33PNHL-Db3REDIz.js} +1 -1
- data/lib/archsight/web/public/vue/{chunk-QZHKN3VN-xbY0NLgv.js → chunk-QZHKN3VN-BqVqGMTy.js} +1 -1
- data/lib/archsight/web/public/vue/{chunk-TZMSLE5B-CgF9_37b.js → chunk-TZMSLE5B-DfX4VDWu.js} +1 -1
- data/lib/archsight/web/public/vue/classDiagram-2ON5EDUG-C9Kk58xl.js +1 -0
- data/lib/archsight/web/public/vue/classDiagram-v2-WZHVMYZB-C9Kk58xl.js +1 -0
- data/lib/archsight/web/public/vue/clone-B6uzD5eH.js +1 -0
- data/lib/archsight/web/public/vue/{cose-bilkent-S5V4N54A-CB9Zfu50.js → cose-bilkent-S5V4N54A-CfkQxn-a.js} +1 -1
- data/lib/archsight/web/public/vue/{dagre-6UL2VRFP-BqkmE-LI.js → dagre-6UL2VRFP-D13da1qu.js} +1 -1
- data/lib/archsight/web/public/vue/{diagram-PSM6KHXK-CKBfqtw3.js → diagram-PSM6KHXK-BwzbeHPK.js} +1 -1
- data/lib/archsight/web/public/vue/{diagram-QEK2KX5R-B78rOlvK.js → diagram-QEK2KX5R-COjSoDC8.js} +1 -1
- data/lib/archsight/web/public/vue/{diagram-S2PKOQOG-BlXC6Cia.js → diagram-S2PKOQOG-FH65FafS.js} +1 -1
- data/lib/archsight/web/public/vue/{erDiagram-Q2GNP2WA-BnliyziJ.js → erDiagram-Q2GNP2WA-D1mxJWSp.js} +1 -1
- data/lib/archsight/web/public/vue/{flowDiagram-NV44I4VS-wuqPowTd.js → flowDiagram-NV44I4VS-DpRd5cPP.js} +1 -1
- data/lib/archsight/web/public/vue/{ganttDiagram-JELNMOA3-GSffAIH3.js → ganttDiagram-JELNMOA3-D04Sdd3Q.js} +1 -1
- data/lib/archsight/web/public/vue/{gitGraphDiagram-V2S2FVAM-OA7VyugW.js → gitGraphDiagram-V2S2FVAM-DgNNP2nj.js} +1 -1
- data/lib/archsight/web/public/vue/{graph-BXHAtA0S.js → graph-Cnoy0p_X.js} +1 -1
- data/lib/archsight/web/public/vue/{index-DsEsN0_K.js → index-Zr9MoxJi.js} +2 -2
- data/lib/archsight/web/public/vue/{infoDiagram-HS3SLOUP-nlVe2qgv.js → infoDiagram-HS3SLOUP-D5asL_9P.js} +1 -1
- data/lib/archsight/web/public/vue/{journeyDiagram-XKPGCS4Q-CtTIcKwf.js → journeyDiagram-XKPGCS4Q-D-SRalYk.js} +1 -1
- data/lib/archsight/web/public/vue/{kanban-definition-3W4ZIXB7-837KX0sW.js → kanban-definition-3W4ZIXB7-CuOjHa3p.js} +1 -1
- data/lib/archsight/web/public/vue/{layout-DtE0QdL6.js → layout-CD8FBujT.js} +1 -1
- data/lib/archsight/web/public/vue/{mermaid-DpPHPFQh.js → mermaid-DUllW9QE.js} +60 -60
- data/lib/archsight/web/public/vue/{mindmap-definition-VGOIOE7T-9gLF2AoY.js → mindmap-definition-VGOIOE7T-BfbYXGBk.js} +1 -1
- data/lib/archsight/web/public/vue/{pieDiagram-ADFJNKIX-CyCNgw3u.js → pieDiagram-ADFJNKIX-mb757Gpq.js} +1 -1
- data/lib/archsight/web/public/vue/{quadrantDiagram-AYHSOK5B-CkPh8g02.js → quadrantDiagram-AYHSOK5B-DMtvHJQW.js} +1 -1
- data/lib/archsight/web/public/vue/{requirementDiagram-UZGBJVZJ-Dkt6OSlY.js → requirementDiagram-UZGBJVZJ-CHguirsB.js} +1 -1
- data/lib/archsight/web/public/vue/{sankeyDiagram-TZEHDZUN-BqprTk8x.js → sankeyDiagram-TZEHDZUN-nblWMNF6.js} +1 -1
- data/lib/archsight/web/public/vue/{sequenceDiagram-WL72ISMW-CTmTe1FQ.js → sequenceDiagram-WL72ISMW-B83ZoXls.js} +1 -1
- data/lib/archsight/web/public/vue/{stateDiagram-FKZM4ZOC-CphqmkEU.js → stateDiagram-FKZM4ZOC-Ct0OgmPh.js} +1 -1
- data/lib/archsight/web/public/vue/stateDiagram-v2-4FDKWEC3-CJZXQ6xd.js +1 -0
- data/lib/archsight/web/public/vue/{timeline-definition-IT6M3QCI-CSQUZkyE.js → timeline-definition-IT6M3QCI-D1Wd-DLb.js} +1 -1
- data/lib/archsight/web/public/vue/{treemap-GDKQZRPO-DTojm7Yr.js → treemap-GDKQZRPO-DFPZrNlp.js} +1 -1
- data/lib/archsight/web/public/vue/{useGraphviz-A5s4h76R.js → useGraphviz-BN4iwLLN.js} +1 -1
- data/lib/archsight/web/public/vue/{useHighlight-C6Kb5G3l.js → useHighlight-DmGaxZxx.js} +1 -1
- data/lib/archsight/web/public/vue/{useMermaid-DqxTrLRB.js → useMermaid-DSo5f1Jc.js} +1 -1
- data/lib/archsight/web/public/vue/{usePanZoom-BybZ_rfh.js → usePanZoom-BEXq_r0S.js} +1 -1
- data/lib/archsight/web/public/vue/{xychartDiagram-PRI3JC2R-B1ZJZtDC.js → xychartDiagram-PRI3JC2R-i_eB4HAQ.js} +1 -1
- data/lib/archsight/web/public/vue.html +2 -2
- metadata +71 -57
- data/lib/archsight/web/public/vue/classDiagram-2ON5EDUG-jGlvI-Za.js +0 -1
- data/lib/archsight/web/public/vue/classDiagram-v2-WZHVMYZB-jGlvI-Za.js +0 -1
- data/lib/archsight/web/public/vue/clone-6iRPe1-W.js +0 -1
- data/lib/archsight/web/public/vue/stateDiagram-v2-4FDKWEC3-CxaDW5sW.js +0 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 80cb12962c9a8df468f3d644135ad4a19f4253f931655b971f3c8f537a8f339c
|
|
4
|
+
data.tar.gz: e901fd680848d138dd069322adb0ffc60704cc081e19a2855ae080d1cfbbc9bf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2cb304a5d1699e21bfe51e50882ece47a8ec245b8c86e0088b19d167a4662a719152d4e547d61ce0ee1aa6aa9b4fe19e9cb89ee16a1e566f3b18057b2872ef75
|
|
7
|
+
data.tar.gz: d4fa392608acd1ed9c2d09efe0c1b5313b7fb10e48b17a8283b505c3f212241223e07f9effac546c4ac2bccd431bd561c9c202bf9ab5e43ecdac7785935d54b0
|
data/chart/archsight/values.yaml
CHANGED
|
@@ -159,4 +159,6 @@ extraVolumes: []
|
|
|
159
159
|
extraVolumeMounts: []
|
|
160
160
|
|
|
161
161
|
# Command arguments (passed to ENTRYPOINT ["archsight"])
|
|
162
|
+
# Add "--enable-restart" together with image.pullPolicy: Always to enable
|
|
163
|
+
# the POST /maintenance/restart endpoint for lightweight rolling deployments.
|
|
162
164
|
args: ["web", "--port", "4567", "-H", "0.0.0.0", "--production"]
|
data/docs/kubernetes.md
CHANGED
|
@@ -142,6 +142,59 @@ sidecars:
|
|
|
142
142
|
mountPath: /resources
|
|
143
143
|
```
|
|
144
144
|
|
|
145
|
+
## Rolling Restart via Maintenance Endpoint
|
|
146
|
+
|
|
147
|
+
For simple deployments where you want to trigger a pod restart (and image re-pull) without `kubectl`, you can enable the `POST /maintenance/restart` endpoint.
|
|
148
|
+
|
|
149
|
+
**How it works:**
|
|
150
|
+
1. A `POST` to `/maintenance/restart` signals the server to shut down gracefully.
|
|
151
|
+
2. Kubernetes detects the pod has exited and restarts it (`restartPolicy: Always`).
|
|
152
|
+
3. With `imagePullPolicy: Always`, the new image is pulled on every pod start.
|
|
153
|
+
|
|
154
|
+
**Enable in values.yaml:**
|
|
155
|
+
|
|
156
|
+
```yaml
|
|
157
|
+
image:
|
|
158
|
+
pullPolicy: Always # Pull a fresh image on every pod restart
|
|
159
|
+
|
|
160
|
+
args:
|
|
161
|
+
- web
|
|
162
|
+
- "--port"
|
|
163
|
+
- "4567"
|
|
164
|
+
- "-H"
|
|
165
|
+
- "0.0.0.0"
|
|
166
|
+
- "--production"
|
|
167
|
+
- "--enable-restart" # Opt-in: exposes POST /maintenance/restart
|
|
168
|
+
- "--restart-token"
|
|
169
|
+
- "your-secret-token" # Recommended: require a shared secret
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
**Trigger a restart:**
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
curl -X POST http://<archsight-service>/maintenance/restart \
|
|
176
|
+
-H "X-Restart-Token: your-secret-token"
|
|
177
|
+
# → {"ok":true,"message":"Server shutting down"}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
The pod exits, Kubernetes restarts it, and the new image is pulled automatically.
|
|
181
|
+
|
|
182
|
+
When the endpoint is disabled (the default), it returns `404 Restart endpoint is disabled`.
|
|
183
|
+
When a token is configured and the header is missing or wrong, it returns `401 Invalid or missing restart token`.
|
|
184
|
+
|
|
185
|
+
**Configuring the shutdown delay:**
|
|
186
|
+
|
|
187
|
+
The server waits 2 seconds (default) before sending SIGTERM to allow the response to be
|
|
188
|
+
flushed. Override with the `ARCHSIGHT_RESTART_SHUTDOWN_DELAY` environment variable (seconds, float):
|
|
189
|
+
|
|
190
|
+
```yaml
|
|
191
|
+
env:
|
|
192
|
+
- name: ARCHSIGHT_RESTART_SHUTDOWN_DELAY
|
|
193
|
+
value: "3.0"
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
> **Security note:** Restrict access to this endpoint at the network/ingress level. The `--restart-token` flag adds a shared-secret check in code, but network-level restrictions (e.g., internal-only ingress, NetworkPolicy) are the primary defence for publicly reachable deployments.
|
|
197
|
+
|
|
145
198
|
## Uninstalling the Chart
|
|
146
199
|
|
|
147
200
|
```bash
|
|
@@ -12,6 +12,7 @@ class Archsight::Annotations::Annotation
|
|
|
12
12
|
@explicit_title = options[:title]
|
|
13
13
|
@filter = options[:filter]
|
|
14
14
|
@enum = options[:enum]
|
|
15
|
+
@validator = options[:validator]
|
|
15
16
|
@sidebar = options.fetch(:sidebar, true)
|
|
16
17
|
@list = options.fetch(:list, false)
|
|
17
18
|
@editor = options.fetch(:editor, true)
|
|
@@ -54,7 +55,7 @@ class Archsight::Annotations::Annotation
|
|
|
54
55
|
end
|
|
55
56
|
|
|
56
57
|
def has_validation?
|
|
57
|
-
@enum || @type.is_a?(Class)
|
|
58
|
+
@enum || @validator || @type.is_a?(Class)
|
|
58
59
|
end
|
|
59
60
|
|
|
60
61
|
# === Value Methods (for instance values) ===
|
|
@@ -85,6 +86,7 @@ class Archsight::Annotations::Annotation
|
|
|
85
86
|
return errors if value.nil?
|
|
86
87
|
|
|
87
88
|
validate_enum(value, errors)
|
|
89
|
+
validate_custom(value, errors) if errors.empty?
|
|
88
90
|
validate_type(value, errors) if errors.empty?
|
|
89
91
|
validate_code(value, errors) if errors.empty?
|
|
90
92
|
|
|
@@ -147,6 +149,16 @@ class Archsight::Annotations::Annotation
|
|
|
147
149
|
end
|
|
148
150
|
end
|
|
149
151
|
|
|
152
|
+
def validate_custom(value, errors)
|
|
153
|
+
return unless @validator
|
|
154
|
+
|
|
155
|
+
values = list? ? value.to_s.split(",").map(&:strip) : [value.to_s]
|
|
156
|
+
values.each do |v|
|
|
157
|
+
message = @validator.call(v) # steep:ignore
|
|
158
|
+
errors << message if message
|
|
159
|
+
end
|
|
160
|
+
end
|
|
161
|
+
|
|
150
162
|
def validate_type(value, errors)
|
|
151
163
|
return unless @type.is_a?(Class)
|
|
152
164
|
|
data/lib/archsight/cli.rb
CHANGED
|
@@ -20,6 +20,10 @@ module Archsight
|
|
|
20
20
|
option :disable_reload, type: :boolean, default: false, desc: "Disable the reload button in the UI"
|
|
21
21
|
option :enable_logging, type: :boolean, default: nil, desc: "Enable request logging (default: false in dev, true in prod)"
|
|
22
22
|
option :inline_edit, type: :boolean, default: false, desc: "Enable inline editing (save directly to source files)"
|
|
23
|
+
option :enable_restart, type: :boolean, default: false,
|
|
24
|
+
desc: "Enable POST /maintenance/restart endpoint (use with imagePullPolicy: Always in Kubernetes)"
|
|
25
|
+
option :restart_token, type: :string, default: nil,
|
|
26
|
+
desc: "Shared secret required as X-Restart-Token header on POST /maintenance/restart"
|
|
23
27
|
def web
|
|
24
28
|
configure_resources
|
|
25
29
|
require "archsight/web/application"
|
|
@@ -28,6 +32,8 @@ module Archsight
|
|
|
28
32
|
Archsight::Web::Application.configure_environment!(env, logging: options[:enable_logging])
|
|
29
33
|
Archsight::Web::Application.set :reload_enabled, !options[:disable_reload]
|
|
30
34
|
Archsight::Web::Application.set :inline_edit_enabled, options[:inline_edit]
|
|
35
|
+
Archsight::Web::Application.set :restart_enabled, options[:enable_restart]
|
|
36
|
+
Archsight::Web::Application.set :restart_token, options[:restart_token]
|
|
31
37
|
Archsight::Web::Application.setup_mcp!
|
|
32
38
|
Archsight::Web::Application.run!(port: options[:port], bind: options[:host])
|
|
33
39
|
rescue Archsight::ResourceError => e
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require "open3"
|
|
4
4
|
require "json"
|
|
5
|
+
require "spdx-licenses"
|
|
5
6
|
require "archsight/import"
|
|
6
7
|
|
|
7
8
|
# License detection and dependency license scanning for repositories
|
|
@@ -32,6 +33,7 @@ class Archsight::Import::LicenseAnalyzer
|
|
|
32
33
|
{ id: "Unlicense", re: /\bThis is free and unencumbered software\b/mi },
|
|
33
34
|
{ id: "CC0-1.0", re: /Creative Commons.*CC0|CC0 1\.0 Universal/mi },
|
|
34
35
|
{ id: "BSL-1.0", re: /Boost Software License/mi },
|
|
36
|
+
{ id: "BUSL-1.1", re: /Business Source License.*1\.1/mi },
|
|
35
37
|
{ id: "EUPL-1.2", re: /European Union Public Licen[cs]e.*1\.2/mi }
|
|
36
38
|
].freeze
|
|
37
39
|
|
|
@@ -40,6 +42,7 @@ class Archsight::Import::LicenseAnalyzer
|
|
|
40
42
|
"permissive" => %w[Apache-2.0 MIT BSD-3-Clause BSD-2-Clause ISC Unlicense CC0-1.0 BSL-1.0 0BSD Ruby],
|
|
41
43
|
"copyleft" => %w[GPL-3.0 GPL-2.0 AGPL-3.0],
|
|
42
44
|
"weak-copyleft" => %w[LGPL-3.0 LGPL-2.1 MPL-2.0 EUPL-1.2 CDDL-1.0],
|
|
45
|
+
"source-available" => %w[BUSL-1.1],
|
|
43
46
|
"proprietary" => %w[proprietary]
|
|
44
47
|
}.freeze
|
|
45
48
|
|
|
@@ -56,10 +59,8 @@ class Archsight::Import::LicenseAnalyzer
|
|
|
56
59
|
\(c\)\s
|
|
57
60
|
/xi
|
|
58
61
|
|
|
59
|
-
#
|
|
60
|
-
|
|
61
|
-
CATEGORIES.values.flatten + %w[NOASSERTION unknown]
|
|
62
|
-
).freeze
|
|
62
|
+
# Custom non-SPDX values we accept
|
|
63
|
+
CUSTOM_LICENSE_VALUES = Set.new(%w[NOASSERTION proprietary unknown]).freeze
|
|
63
64
|
|
|
64
65
|
# License file names to search (in order of priority)
|
|
65
66
|
LICENSE_FILES = %w[
|
|
@@ -289,7 +290,7 @@ class Archsight::Import::LicenseAnalyzer
|
|
|
289
290
|
parts = cleaned.split(%r{\s*/\s*|\s+OR\s+}i)
|
|
290
291
|
parts.each do |part|
|
|
291
292
|
normalized = normalize_spdx_single(part.strip)
|
|
292
|
-
return normalized if
|
|
293
|
+
return normalized if known_spdx?(normalized)
|
|
293
294
|
end
|
|
294
295
|
end
|
|
295
296
|
|
|
@@ -322,6 +323,11 @@ class Archsight::Import::LicenseAnalyzer
|
|
|
322
323
|
end
|
|
323
324
|
end
|
|
324
325
|
|
|
326
|
+
# Check if a value is a known SPDX ID or one of our custom values
|
|
327
|
+
def known_spdx?(value)
|
|
328
|
+
CUSTOM_LICENSE_VALUES.include?(value) || SpdxLicenses.exist?(value)
|
|
329
|
+
end
|
|
330
|
+
|
|
325
331
|
# Categorize a license SPDX identifier
|
|
326
332
|
def categorize(spdx)
|
|
327
333
|
CATEGORY_LOOKUP[spdx] || "unknown"
|
|
@@ -633,13 +639,15 @@ class Archsight::Import::LicenseAnalyzer
|
|
|
633
639
|
|
|
634
640
|
strong_copyleft = CATEGORIES["copyleft"]
|
|
635
641
|
weak_copyleft = CATEGORIES["weak-copyleft"]
|
|
642
|
+
source_available = CATEGORIES["source-available"]
|
|
636
643
|
|
|
637
644
|
has_strong = license_names.any? { |l| strong_copyleft.include?(l) }
|
|
638
645
|
has_weak = license_names.any? { |l| weak_copyleft.include?(l) }
|
|
646
|
+
has_source_available = license_names.any? { |l| source_available.include?(l) }
|
|
639
647
|
unknown_count = license_names.count { |l| l == "unknown" }
|
|
640
648
|
many_unknown = unknown_count.positive? && (unknown_count.to_f / license_names.size) > 0.5
|
|
641
649
|
|
|
642
|
-
if has_strong || many_unknown
|
|
650
|
+
if has_strong || many_unknown || has_source_available
|
|
643
651
|
"copyleft"
|
|
644
652
|
elsif has_weak
|
|
645
653
|
"weak-copyleft"
|
|
@@ -25,10 +25,10 @@ module Archsight
|
|
|
25
25
|
|
|
26
26
|
# Define an annotation using the Annotation class
|
|
27
27
|
def self.annotation(key, description: nil, filter: nil, title: nil, format: nil, enum: nil, sidebar: true,
|
|
28
|
-
type: nil, list: false, editor: true)
|
|
28
|
+
type: nil, list: false, editor: true, validator: nil)
|
|
29
29
|
@annotations ||= [] #: Array[Archsight::Annotations::Annotation]
|
|
30
30
|
options = { description: description, filter: filter, title: title, format: format, enum: enum,
|
|
31
|
-
sidebar: sidebar, type: type, list: list, editor: editor }
|
|
31
|
+
sidebar: sidebar, type: type, list: list, editor: editor, validator: validator }
|
|
32
32
|
@annotations << Archsight::Annotations::Annotation.new(key, options)
|
|
33
33
|
end
|
|
34
34
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "uri"
|
|
4
|
+
require "spdx-licenses"
|
|
4
5
|
|
|
5
6
|
# TechnologyArtifact usually a source code repository or container
|
|
6
7
|
class Archsight::Resources::TechnologyArtifact < Archsight::Resources::Base
|
|
@@ -159,14 +160,17 @@ class Archsight::Resources::TechnologyArtifact < Archsight::Resources::Base
|
|
|
159
160
|
enum: %w[unprivileged privileged]
|
|
160
161
|
|
|
161
162
|
# License information
|
|
163
|
+
SPDX_CUSTOM_VALUES = Set.new(%w[NOASSERTION proprietary unknown]).freeze
|
|
164
|
+
SPDX_VALIDATOR = lambda { |v|
|
|
165
|
+
"invalid SPDX license identifier '#{v}'" unless SPDX_CUSTOM_VALUES.include?(v) || SpdxLicenses.exist?(v)
|
|
166
|
+
}
|
|
167
|
+
|
|
162
168
|
annotation "license/spdx",
|
|
163
169
|
description: "SPDX license identifier",
|
|
164
170
|
title: "License",
|
|
165
171
|
filter: :word,
|
|
166
172
|
sidebar: false,
|
|
167
|
-
|
|
168
|
-
LGPL-2.1 MPL-2.0 ISC AGPL-3.0 Unlicense CC0-1.0 BSL-1.0 EUPL-1.2
|
|
169
|
-
0BSD CDDL-1.0 Ruby NOASSERTION proprietary unknown]
|
|
173
|
+
validator: SPDX_VALIDATOR
|
|
170
174
|
annotation "license/file",
|
|
171
175
|
description: "License file path",
|
|
172
176
|
title: "License File",
|
data/lib/archsight/version.rb
CHANGED
|
@@ -53,11 +53,20 @@ class Archsight::Web::Application < Sinatra::Base
|
|
|
53
53
|
end
|
|
54
54
|
end
|
|
55
55
|
|
|
56
|
+
RESTART_SHUTDOWN_DELAY =
|
|
57
|
+
begin
|
|
58
|
+
Float(ENV.fetch("ARCHSIGHT_RESTART_SHUTDOWN_DELAY", "2.0"))
|
|
59
|
+
rescue ArgumentError, TypeError
|
|
60
|
+
2.0
|
|
61
|
+
end
|
|
62
|
+
|
|
56
63
|
configure do
|
|
57
64
|
set :public_folder, File.join(__dir__, "public")
|
|
58
65
|
set :server, :puma
|
|
59
66
|
set :reload_enabled, true
|
|
60
67
|
set :inline_edit_enabled, false
|
|
68
|
+
set :restart_enabled, false
|
|
69
|
+
set :restart_token, nil
|
|
61
70
|
end
|
|
62
71
|
|
|
63
72
|
# MCP Server setup
|
|
@@ -100,6 +109,16 @@ class Archsight::Web::Application < Sinatra::Base
|
|
|
100
109
|
settings.inline_edit_enabled
|
|
101
110
|
end
|
|
102
111
|
|
|
112
|
+
def restart_enabled?
|
|
113
|
+
settings.restart_enabled
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
def authorized_restart?
|
|
117
|
+
return true if settings.restart_token.nil?
|
|
118
|
+
|
|
119
|
+
request.env["HTTP_X_RESTART_TOKEN"] == settings.restart_token
|
|
120
|
+
end
|
|
121
|
+
|
|
103
122
|
def production?
|
|
104
123
|
settings.environment == :production
|
|
105
124
|
end
|
|
@@ -200,6 +219,25 @@ class Archsight::Web::Application < Sinatra::Base
|
|
|
200
219
|
end
|
|
201
220
|
end
|
|
202
221
|
|
|
222
|
+
after do
|
|
223
|
+
Archsight::Web::Application.perform_restart! if request.env["archsight.restart_requested"]
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
def self.perform_restart!
|
|
227
|
+
Thread.new do
|
|
228
|
+
sleep RESTART_SHUTDOWN_DELAY if RESTART_SHUTDOWN_DELAY.positive?
|
|
229
|
+
Process.kill("TERM", Process.pid)
|
|
230
|
+
end
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
post "/maintenance/restart" do
|
|
234
|
+
halt 404, "Restart endpoint is disabled" unless settings.restart_enabled
|
|
235
|
+
halt 401, "Invalid or missing restart token" unless authorized_restart?
|
|
236
|
+
request.env["archsight.restart_requested"] = true
|
|
237
|
+
content_type :json
|
|
238
|
+
JSON.generate({ ok: true, message: "Server shutting down" })
|
|
239
|
+
end
|
|
240
|
+
|
|
203
241
|
get "/doc/resources/:filename" do
|
|
204
242
|
serve_vue
|
|
205
243
|
end
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as u,l as _,c as s,a as c,v as m,t as f,b as v,r as i,z as k,o as d,B as w}from"./index-
|
|
1
|
+
import{_ as u,l as _,c as s,a as c,v as m,t as f,b as v,r as i,z as k,o as d,B as w}from"./index-Zr9MoxJi.js";import"./mermaid-DUllW9QE.js";const h={class:"api-docs-page"},y={key:0,class:"pico-color-red-500"},g={__name:"ApiDocsPage",setup(B){const l=k(),r=i(null),t=i(null);function p(o){return new Promise((e,n)=>{if(window.Redoc)return e();const a=document.createElement("script");a.src=o,a.onload=e,a.onerror=()=>n(new Error("Failed to load ReDoc")),document.head.appendChild(a)})}return _(async()=>{try{await p("https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js"),window.Redoc.init("/api/v1/openapi.yaml",{},r.value)}catch(o){t.value=o.message}}),(o,e)=>(d(),s("div",h,[c("a",{href:"#",class:"back-link",onClick:e[0]||(e[0]=m(n=>w(l).back(),["prevent"]))},"← Back"),t.value?(d(),s("div",y,f(t.value),1)):v("",!0),c("div",{ref_key:"container",ref:r},null,512)]))}},R=u(g,[["__scopeId","data-v-0e03906d"]]);export{R as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{w as m,c as i,a as f,r as a,o as s,j as p,k as d}from"./index-
|
|
1
|
+
import{w as m,c as i,a as f,r as a,o as s,j as p,k as d}from"./index-Zr9MoxJi.js";import{r as v}from"./useMermaid-DSo5f1Jc.js";import{h as _}from"./useHighlight-DmGaxZxx.js";import"./mermaid-DUllW9QE.js";import"./usePanZoom-BEXq_r0S.js";const k=["innerHTML"],g={key:1},D={__name:"DocPage",props:{filename:String},setup(c){const n=c,o=a(""),t=a(!0),e=a(null);async function u(){t.value=!0;const r=await p(n.filename);o.value=r||"<p>Documentation not found.</p>",t.value=!1,await d(),e.value&&(_(e.value),v(e.value))}return m(()=>n.filename,u,{immediate:!0}),(r,l)=>t.value?(s(),i("article",g,[...l[0]||(l[0]=[f("p",null,"Loading...",-1)])])):(s(),i("div",{key:0,ref_key:"articleEl",ref:e,innerHTML:o.value},null,8,k))}};export{D as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as nr,o as D,c as R,a as A,d as le,t as ne,b as Fe,I as Ge,J as Ri,F as yt,x as fn,K as Ft,n as Mt,y as Xe,w as Es,r as ie,l as ga,L as Tc,k as wc,p as Nc,M as Ac,N as Fc,e as Mn,f as go,B as Oc,v as $c,g as Ic,z as Mc,i as Pc,q as Lc,O as Dc,P as Rc}from"./index-DsEsN0_K.js";import{h as ho}from"./useHighlight-C6Kb5G3l.js";import{b9 as po}from"./mermaid-DpPHPFQh.js";const zc={class:"label-row"},Bc=["for","title"],Kc={key:0,class:"required"},Uc=["id","aria-invalid"],Wc=["value"],jc={key:1,class:"markdown-field"},Hc=["id","aria-invalid","placeholder"],Jc={key:0,class:"future-hint"},Vc={key:2,class:"code-field"},qc=["id","aria-invalid","placeholder"],Gc={class:"future-hint"},Yc=["id","step","aria-invalid"],Zc=["id","aria-invalid"],Xc=["id","aria-invalid"],Qc=["id","aria-invalid"],ed={key:7,class:"field-description"},td={key:8,class:"field-error"},nd={__name:"EditorField",props:{field:Object,modelValue:[String,Number,null],error:[Array,null]},emits:["update:modelValue","openMarkdown"],setup(n,{emit:e}){const t=n,r=e,i=Xe({get:()=>t.modelValue??"",set:l=>r("update:modelValue",l)}),s=Xe(()=>["textarea","markdown","code"].includes(t.field.input_type)),o=Xe(()=>t.error&&t.error.length>0);return(l,a)=>(D(),R("div",{class:Mt(["field-group",{"field-full-width":s.value}])},[A("div",zc,[A("label",{for:n.field.key,title:n.field.description},[le(ne(n.field.title)+" ",1),n.field.required?(D(),R("span",Kc,"*")):Fe("",!0)],8,Bc),n.field.input_type==="markdown"?(D(),R("button",{key:0,type:"button",class:"btn-edit-markdown",title:"Open rich text editor",onClick:a[0]||(a[0]=u=>l.$emit("openMarkdown",n.field.key))},[...a[8]||(a[8]=[A("i",{class:"iconoir-edit-pencil"},null,-1),le(" Edit ",-1)])])):Fe("",!0)]),n.field.input_type==="select"?Ge((D(),R("select",{key:0,id:n.field.key,"onUpdate:modelValue":a[1]||(a[1]=u=>i.value=u),"aria-invalid":o.value?"true":void 0},[a[9]||(a[9]=A("option",{value:""},"Select...",-1)),(D(!0),R(yt,null,fn(n.field.options,u=>(D(),R("option",{key:u,value:u},ne(u),9,Wc))),128))],8,Uc)),[[Ri,i.value]]):n.field.input_type==="textarea"||n.field.input_type==="markdown"?(D(),R("div",jc,[Ge(A("textarea",{id:n.field.key,"onUpdate:modelValue":a[2]||(a[2]=u=>i.value=u),"aria-invalid":o.value?"true":void 0,placeholder:n.field.input_type==="markdown"?"Enter markdown content...":"One entry per line..."},null,8,Hc),[[Ft,i.value]]),n.field.input_type==="markdown"?(D(),R("small",Jc,[...a[10]||(a[10]=[A("i",{class:"iconoir-info-circle"},null,-1),le(" Supports Markdown formatting ",-1)])])):Fe("",!0)])):n.field.input_type==="code"?(D(),R("div",Vc,[Ge(A("textarea",{id:n.field.key,"onUpdate:modelValue":a[3]||(a[3]=u=>i.value=u),"aria-invalid":o.value?"true":void 0,placeholder:`Enter ${n.field.code_language||""} code...`,spellcheck:"false"},null,8,qc),[[Ft,i.value]]),A("small",Gc,[a[11]||(a[11]=A("i",{class:"iconoir-code"},null,-1)),le(" "+ne((n.field.code_language||"").charAt(0).toUpperCase()+(n.field.code_language||"").slice(1))+" code ",1)])])):n.field.input_type==="number"?Ge((D(),R("input",{key:3,id:n.field.key,type:"number","onUpdate:modelValue":a[4]||(a[4]=u=>i.value=u),step:n.field.step,"aria-invalid":o.value?"true":void 0},null,8,Yc)),[[Ft,i.value]]):n.field.input_type==="url"?Ge((D(),R("input",{key:4,id:n.field.key,type:"url","onUpdate:modelValue":a[5]||(a[5]=u=>i.value=u),placeholder:"https://...","aria-invalid":o.value?"true":void 0},null,8,Zc)),[[Ft,i.value]]):n.field.input_type==="list"?Ge((D(),R("input",{key:5,id:n.field.key,type:"text","onUpdate:modelValue":a[6]||(a[6]=u=>i.value=u),placeholder:"Comma-separated values","aria-invalid":o.value?"true":void 0},null,8,Xc)),[[Ft,i.value]]):Ge((D(),R("input",{key:6,id:n.field.key,type:"text","onUpdate:modelValue":a[7]||(a[7]=u=>i.value=u),"aria-invalid":o.value?"true":void 0},null,8,Qc)),[[Ft,i.value]]),n.field.description&&!["textarea","markdown","code"].includes(n.field.input_type)?(D(),R("small",ed,ne(n.field.description),1)):Fe("",!0),o.value?(D(),R("div",td,ne(n.error.join(", ")),1)):Fe("",!0)],2))}},rd=nr(nd,[["__scopeId","data-v-6dfd17ff"]]),id={class:"relations-editor"},sd={key:0,class:"no-relations"},od={id:"relations-list"},ld={class:"relation-text"},ad=["onClick"],ud={class:"add-relation-row"},cd=["value"],dd=["value"],fd={__name:"EditorRelations",props:{relations:Array,relationOptions:Array,instancesByKind:Object},emits:["update:relations"],setup(n,{emit:e}){const t=n,r=e,i=ie(""),s=ie(""),o=Xe(()=>[...t.relations].sort((f,d)=>(f.verb+f.kind+f.name).localeCompare(d.verb+d.kind+d.name))),l=Xe(()=>i.value?t.relationOptions.find(d=>d.combo===i.value)?.target_kind:null),a=Xe(()=>l.value?t.instancesByKind[l.value]||[]:[]);Es(i,()=>{s.value=""});function u(){if(!i.value||!s.value)return;const f=t.relationOptions.find(g=>g.combo===i.value);if(!f||t.relations.some(g=>g.verb===f.verb&&g.kind===f.target_kind&&g.name===s.value))return;const h=[...t.relations,{verb:f.verb,kind:f.target_kind,name:s.value}];r("update:relations",h),i.value="",s.value=""}function c(f){const d=t.relations.filter((h,g)=>g!==f);r("update:relations",d)}return(f,d)=>(D(),R("div",id,[!n.relationOptions||n.relationOptions.length===0?(D(),R("p",sd," This resource type has no defined relations. ")):(D(),R(yt,{key:1},[A("div",od,[(D(!0),R(yt,null,fn(o.value,(h,g)=>(D(),R("div",{key:`${h.verb}:${h.kind}:${h.name}`,class:"relation-item"},[A("span",ld,[A("strong",null,ne(h.verb),1),le(" → "+ne(h.kind)+": ",1),A("em",null,ne(h.name),1)]),A("button",{class:"btn-remove",type:"button",title:"Remove",onClick:_=>c(g)},[...d[2]||(d[2]=[A("i",{class:"iconoir-xmark"},null,-1)])],8,ad)]))),128))]),A("div",ud,[Ge(A("select",{"onUpdate:modelValue":d[0]||(d[0]=h=>i.value=h)},[d[3]||(d[3]=A("option",{value:""},"Select relation...",-1)),(D(!0),R(yt,null,fn(n.relationOptions,h=>(D(),R("option",{key:h.combo,value:h.combo},ne(h.verb)+" → "+ne(h.target_kind),9,cd))),128))],512),[[Ri,i.value]]),Ge(A("select",{"onUpdate:modelValue":d[1]||(d[1]=h=>s.value=h)},[d[4]||(d[4]=A("option",{value:""},"Select instance...",-1)),(D(!0),R(yt,null,fn(a.value,h=>(D(),R("option",{key:h,value:h},ne(h),9,dd))),128))],512),[[Ri,s.value]]),A("button",{class:"secondary btn-add",type:"button",onClick:u},[...d[5]||(d[5]=[A("i",{class:"iconoir-plus"},null,-1),le(" Add ",-1)])])])],64))]))}},gd=nr(fd,[["__scopeId","data-v-e27dc1c0"]]),hd={class:"yaml-output-container"},pd={key:0,class:"conflict-error"},md={id:"yaml-content"},yd={class:"language-yaml"},_d={key:0,class:"yaml-file-info"},vd={key:1,class:"yaml-instructions"},xd={class:"yaml-actions"},bd=["disabled"],Sd={__name:"EditorYamlOutput",props:{yaml:String,kind:String,name:String,contentHash:String,pathRef:String,inlineEditEnabled:Boolean},emits:["editAgain"],setup(n,{emit:e}){const t=n,r=ie(null),i=ie("idle"),s=ie("idle"),o=ie(null);ga(()=>{r.value&&ho(r.value)}),Es(()=>t.yaml,async()=>{await wc(),r.value&&ho(r.value)});async function l(){try{await navigator.clipboard.writeText(t.yaml),i.value="copied",setTimeout(()=>{i.value="idle"},2e3)}catch{const u=document.createElement("textarea");u.value=t.yaml,u.style.position="fixed",u.style.opacity="0",document.body.appendChild(u),u.select(),document.execCommand("copy"),document.body.removeChild(u),i.value="copied",setTimeout(()=>{i.value="idle"},2e3)}}async function a(){s.value="saving",o.value=null;try{const u=await Tc(t.kind,t.name,t.yaml,t.contentHash);u.success?(s.value="saved",setTimeout(()=>{s.value="idle"},2e3)):u.conflict?(o.value=u.error,s.value="idle"):(alert("Save failed: "+u.error),s.value="idle")}catch(u){alert("Save failed: "+u.message),s.value="idle"}}return(u,c)=>(D(),R("div",hd,[o.value?(D(),R("div",pd,[c[1]||(c[1]=A("i",{class:"iconoir-warning-triangle"},null,-1)),A("span",null,ne(o.value),1)])):Fe("",!0),c[5]||(c[5]=A("p",{class:"yaml-success"},[A("i",{class:"iconoir-check-circle"}),le(" Generated YAML ")],-1)),A("div",{ref_key:"codeEl",ref:r},[A("pre",md,[A("code",yd,ne(n.yaml),1)])],512),A("footer",null,[n.pathRef?(D(),R("p",_d,[c[2]||(c[2]=A("i",{class:"iconoir-folder"},null,-1)),A("span",null,"Source: "+ne(n.pathRef),1)])):(D(),R("p",vd,[...c[3]||(c[3]=[A("i",{class:"iconoir-info-circle"},null,-1),A("span",null,[le(" Copy this YAML and save it to a "),A("code",null,".yaml"),le(" file in your resources directory, "),A("br"),le("then reload the application. ")],-1)])])),A("div",xd,[n.pathRef&&n.inlineEditEnabled?(D(),R("button",{key:0,type:"button",onClick:a,disabled:s.value==="saving",class:Mt({saved:s.value==="saved"})},[A("i",{class:Mt(s.value==="saving"?"iconoir-refresh":s.value==="saved"?"iconoir-check":"iconoir-check-circle")},null,2),le(" "+ne(s.value==="saving"?"Saving...":s.value==="saved"?"Saved!":"Save to File"),1)],10,bd)):Fe("",!0),A("button",{type:"button",onClick:l,class:Mt({copied:i.value==="copied"})},[A("i",{class:Mt(i.value==="copied"?"iconoir-check":"iconoir-copy")},null,2),le(" "+ne(i.value==="copied"?"Copied!":"Copy to Clipboard"),1)],2),A("button",{class:"secondary",type:"button",onClick:c[0]||(c[0]=f=>u.$emit("editAgain"))},[...c[4]||(c[4]=[A("i",{class:"iconoir-edit-pencil"},null,-1),le(" Edit Again ",-1)])])])])]))}},kd=nr(Sd,[["__scopeId","data-v-f7e6a550"]]);function F(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function ha(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);t.search=r.toString(),console.warn(`Minified Lexical warning #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const He=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Cd=He&&"documentMode"in document?document.documentMode:null,Ke=He&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),kt=He&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),$r=!(!He||!("InputEvent"in window)||Cd)&&"getTargetRanges"in new window.InputEvent("input"),Xr=He&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),rr=He&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Ed=He&&/Android/.test(navigator.userAgent),pa=He&&/^(?=.*Chrome).*/i.test(navigator.userAgent),zi=He&&Ed&&pa,Qr=He&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Ke&&!pa,Td=0,wd=1,Nd=2,ma=128,Ad=1,Fd=2,Od=3,$d=4,Id=5,Md=6,Jn=Xr||rr||Qr?" ":"",ei=`
|
|
1
|
+
import{_ as nr,o as D,c as R,a as A,d as le,t as ne,b as Fe,I as Ge,J as Ri,F as yt,x as fn,K as Ft,n as Mt,y as Xe,w as Es,r as ie,l as ga,L as Tc,k as wc,p as Nc,M as Ac,N as Fc,e as Mn,f as go,B as Oc,v as $c,g as Ic,z as Mc,i as Pc,q as Lc,O as Dc,P as Rc}from"./index-Zr9MoxJi.js";import{h as ho}from"./useHighlight-DmGaxZxx.js";import{b9 as po}from"./mermaid-DUllW9QE.js";const zc={class:"label-row"},Bc=["for","title"],Kc={key:0,class:"required"},Uc=["id","aria-invalid"],Wc=["value"],jc={key:1,class:"markdown-field"},Hc=["id","aria-invalid","placeholder"],Jc={key:0,class:"future-hint"},Vc={key:2,class:"code-field"},qc=["id","aria-invalid","placeholder"],Gc={class:"future-hint"},Yc=["id","step","aria-invalid"],Zc=["id","aria-invalid"],Xc=["id","aria-invalid"],Qc=["id","aria-invalid"],ed={key:7,class:"field-description"},td={key:8,class:"field-error"},nd={__name:"EditorField",props:{field:Object,modelValue:[String,Number,null],error:[Array,null]},emits:["update:modelValue","openMarkdown"],setup(n,{emit:e}){const t=n,r=e,i=Xe({get:()=>t.modelValue??"",set:l=>r("update:modelValue",l)}),s=Xe(()=>["textarea","markdown","code"].includes(t.field.input_type)),o=Xe(()=>t.error&&t.error.length>0);return(l,a)=>(D(),R("div",{class:Mt(["field-group",{"field-full-width":s.value}])},[A("div",zc,[A("label",{for:n.field.key,title:n.field.description},[le(ne(n.field.title)+" ",1),n.field.required?(D(),R("span",Kc,"*")):Fe("",!0)],8,Bc),n.field.input_type==="markdown"?(D(),R("button",{key:0,type:"button",class:"btn-edit-markdown",title:"Open rich text editor",onClick:a[0]||(a[0]=u=>l.$emit("openMarkdown",n.field.key))},[...a[8]||(a[8]=[A("i",{class:"iconoir-edit-pencil"},null,-1),le(" Edit ",-1)])])):Fe("",!0)]),n.field.input_type==="select"?Ge((D(),R("select",{key:0,id:n.field.key,"onUpdate:modelValue":a[1]||(a[1]=u=>i.value=u),"aria-invalid":o.value?"true":void 0},[a[9]||(a[9]=A("option",{value:""},"Select...",-1)),(D(!0),R(yt,null,fn(n.field.options,u=>(D(),R("option",{key:u,value:u},ne(u),9,Wc))),128))],8,Uc)),[[Ri,i.value]]):n.field.input_type==="textarea"||n.field.input_type==="markdown"?(D(),R("div",jc,[Ge(A("textarea",{id:n.field.key,"onUpdate:modelValue":a[2]||(a[2]=u=>i.value=u),"aria-invalid":o.value?"true":void 0,placeholder:n.field.input_type==="markdown"?"Enter markdown content...":"One entry per line..."},null,8,Hc),[[Ft,i.value]]),n.field.input_type==="markdown"?(D(),R("small",Jc,[...a[10]||(a[10]=[A("i",{class:"iconoir-info-circle"},null,-1),le(" Supports Markdown formatting ",-1)])])):Fe("",!0)])):n.field.input_type==="code"?(D(),R("div",Vc,[Ge(A("textarea",{id:n.field.key,"onUpdate:modelValue":a[3]||(a[3]=u=>i.value=u),"aria-invalid":o.value?"true":void 0,placeholder:`Enter ${n.field.code_language||""} code...`,spellcheck:"false"},null,8,qc),[[Ft,i.value]]),A("small",Gc,[a[11]||(a[11]=A("i",{class:"iconoir-code"},null,-1)),le(" "+ne((n.field.code_language||"").charAt(0).toUpperCase()+(n.field.code_language||"").slice(1))+" code ",1)])])):n.field.input_type==="number"?Ge((D(),R("input",{key:3,id:n.field.key,type:"number","onUpdate:modelValue":a[4]||(a[4]=u=>i.value=u),step:n.field.step,"aria-invalid":o.value?"true":void 0},null,8,Yc)),[[Ft,i.value]]):n.field.input_type==="url"?Ge((D(),R("input",{key:4,id:n.field.key,type:"url","onUpdate:modelValue":a[5]||(a[5]=u=>i.value=u),placeholder:"https://...","aria-invalid":o.value?"true":void 0},null,8,Zc)),[[Ft,i.value]]):n.field.input_type==="list"?Ge((D(),R("input",{key:5,id:n.field.key,type:"text","onUpdate:modelValue":a[6]||(a[6]=u=>i.value=u),placeholder:"Comma-separated values","aria-invalid":o.value?"true":void 0},null,8,Xc)),[[Ft,i.value]]):Ge((D(),R("input",{key:6,id:n.field.key,type:"text","onUpdate:modelValue":a[7]||(a[7]=u=>i.value=u),"aria-invalid":o.value?"true":void 0},null,8,Qc)),[[Ft,i.value]]),n.field.description&&!["textarea","markdown","code"].includes(n.field.input_type)?(D(),R("small",ed,ne(n.field.description),1)):Fe("",!0),o.value?(D(),R("div",td,ne(n.error.join(", ")),1)):Fe("",!0)],2))}},rd=nr(nd,[["__scopeId","data-v-6dfd17ff"]]),id={class:"relations-editor"},sd={key:0,class:"no-relations"},od={id:"relations-list"},ld={class:"relation-text"},ad=["onClick"],ud={class:"add-relation-row"},cd=["value"],dd=["value"],fd={__name:"EditorRelations",props:{relations:Array,relationOptions:Array,instancesByKind:Object},emits:["update:relations"],setup(n,{emit:e}){const t=n,r=e,i=ie(""),s=ie(""),o=Xe(()=>[...t.relations].sort((f,d)=>(f.verb+f.kind+f.name).localeCompare(d.verb+d.kind+d.name))),l=Xe(()=>i.value?t.relationOptions.find(d=>d.combo===i.value)?.target_kind:null),a=Xe(()=>l.value?t.instancesByKind[l.value]||[]:[]);Es(i,()=>{s.value=""});function u(){if(!i.value||!s.value)return;const f=t.relationOptions.find(g=>g.combo===i.value);if(!f||t.relations.some(g=>g.verb===f.verb&&g.kind===f.target_kind&&g.name===s.value))return;const h=[...t.relations,{verb:f.verb,kind:f.target_kind,name:s.value}];r("update:relations",h),i.value="",s.value=""}function c(f){const d=t.relations.filter((h,g)=>g!==f);r("update:relations",d)}return(f,d)=>(D(),R("div",id,[!n.relationOptions||n.relationOptions.length===0?(D(),R("p",sd," This resource type has no defined relations. ")):(D(),R(yt,{key:1},[A("div",od,[(D(!0),R(yt,null,fn(o.value,(h,g)=>(D(),R("div",{key:`${h.verb}:${h.kind}:${h.name}`,class:"relation-item"},[A("span",ld,[A("strong",null,ne(h.verb),1),le(" → "+ne(h.kind)+": ",1),A("em",null,ne(h.name),1)]),A("button",{class:"btn-remove",type:"button",title:"Remove",onClick:_=>c(g)},[...d[2]||(d[2]=[A("i",{class:"iconoir-xmark"},null,-1)])],8,ad)]))),128))]),A("div",ud,[Ge(A("select",{"onUpdate:modelValue":d[0]||(d[0]=h=>i.value=h)},[d[3]||(d[3]=A("option",{value:""},"Select relation...",-1)),(D(!0),R(yt,null,fn(n.relationOptions,h=>(D(),R("option",{key:h.combo,value:h.combo},ne(h.verb)+" → "+ne(h.target_kind),9,cd))),128))],512),[[Ri,i.value]]),Ge(A("select",{"onUpdate:modelValue":d[1]||(d[1]=h=>s.value=h)},[d[4]||(d[4]=A("option",{value:""},"Select instance...",-1)),(D(!0),R(yt,null,fn(a.value,h=>(D(),R("option",{key:h,value:h},ne(h),9,dd))),128))],512),[[Ri,s.value]]),A("button",{class:"secondary btn-add",type:"button",onClick:u},[...d[5]||(d[5]=[A("i",{class:"iconoir-plus"},null,-1),le(" Add ",-1)])])])],64))]))}},gd=nr(fd,[["__scopeId","data-v-e27dc1c0"]]),hd={class:"yaml-output-container"},pd={key:0,class:"conflict-error"},md={id:"yaml-content"},yd={class:"language-yaml"},_d={key:0,class:"yaml-file-info"},vd={key:1,class:"yaml-instructions"},xd={class:"yaml-actions"},bd=["disabled"],Sd={__name:"EditorYamlOutput",props:{yaml:String,kind:String,name:String,contentHash:String,pathRef:String,inlineEditEnabled:Boolean},emits:["editAgain"],setup(n,{emit:e}){const t=n,r=ie(null),i=ie("idle"),s=ie("idle"),o=ie(null);ga(()=>{r.value&&ho(r.value)}),Es(()=>t.yaml,async()=>{await wc(),r.value&&ho(r.value)});async function l(){try{await navigator.clipboard.writeText(t.yaml),i.value="copied",setTimeout(()=>{i.value="idle"},2e3)}catch{const u=document.createElement("textarea");u.value=t.yaml,u.style.position="fixed",u.style.opacity="0",document.body.appendChild(u),u.select(),document.execCommand("copy"),document.body.removeChild(u),i.value="copied",setTimeout(()=>{i.value="idle"},2e3)}}async function a(){s.value="saving",o.value=null;try{const u=await Tc(t.kind,t.name,t.yaml,t.contentHash);u.success?(s.value="saved",setTimeout(()=>{s.value="idle"},2e3)):u.conflict?(o.value=u.error,s.value="idle"):(alert("Save failed: "+u.error),s.value="idle")}catch(u){alert("Save failed: "+u.message),s.value="idle"}}return(u,c)=>(D(),R("div",hd,[o.value?(D(),R("div",pd,[c[1]||(c[1]=A("i",{class:"iconoir-warning-triangle"},null,-1)),A("span",null,ne(o.value),1)])):Fe("",!0),c[5]||(c[5]=A("p",{class:"yaml-success"},[A("i",{class:"iconoir-check-circle"}),le(" Generated YAML ")],-1)),A("div",{ref_key:"codeEl",ref:r},[A("pre",md,[A("code",yd,ne(n.yaml),1)])],512),A("footer",null,[n.pathRef?(D(),R("p",_d,[c[2]||(c[2]=A("i",{class:"iconoir-folder"},null,-1)),A("span",null,"Source: "+ne(n.pathRef),1)])):(D(),R("p",vd,[...c[3]||(c[3]=[A("i",{class:"iconoir-info-circle"},null,-1),A("span",null,[le(" Copy this YAML and save it to a "),A("code",null,".yaml"),le(" file in your resources directory, "),A("br"),le("then reload the application. ")],-1)])])),A("div",xd,[n.pathRef&&n.inlineEditEnabled?(D(),R("button",{key:0,type:"button",onClick:a,disabled:s.value==="saving",class:Mt({saved:s.value==="saved"})},[A("i",{class:Mt(s.value==="saving"?"iconoir-refresh":s.value==="saved"?"iconoir-check":"iconoir-check-circle")},null,2),le(" "+ne(s.value==="saving"?"Saving...":s.value==="saved"?"Saved!":"Save to File"),1)],10,bd)):Fe("",!0),A("button",{type:"button",onClick:l,class:Mt({copied:i.value==="copied"})},[A("i",{class:Mt(i.value==="copied"?"iconoir-check":"iconoir-copy")},null,2),le(" "+ne(i.value==="copied"?"Copied!":"Copy to Clipboard"),1)],2),A("button",{class:"secondary",type:"button",onClick:c[0]||(c[0]=f=>u.$emit("editAgain"))},[...c[4]||(c[4]=[A("i",{class:"iconoir-edit-pencil"},null,-1),le(" Edit Again ",-1)])])])])]))}},kd=nr(Sd,[["__scopeId","data-v-f7e6a550"]]);function F(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function ha(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);t.search=r.toString(),console.warn(`Minified Lexical warning #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const He=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Cd=He&&"documentMode"in document?document.documentMode:null,Ke=He&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),kt=He&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),$r=!(!He||!("InputEvent"in window)||Cd)&&"getTargetRanges"in new window.InputEvent("input"),Xr=He&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),rr=He&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Ed=He&&/Android/.test(navigator.userAgent),pa=He&&/^(?=.*Chrome).*/i.test(navigator.userAgent),zi=He&&Ed&&pa,Qr=He&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Ke&&!pa,Td=0,wd=1,Nd=2,ma=128,Ad=1,Fd=2,Od=3,$d=4,Id=5,Md=6,Jn=Xr||rr||Qr?" ":"",ei=`
|
|
2
2
|
|
|
3
3
|
`,Ts=kt?" ":Jn,ya="֑-߿יִ-﷽ﹰ-ﻼ",_a="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",Pd=new RegExp("^[^"+_a+"]*["+ya+"]"),Ld=new RegExp("^[^"+ya+"]*["+_a+"]"),Wt={bold:1,capitalize:1024,code:16,highlight:ma,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},Dd={directionless:1,unmergeable:2},Bi={center:2,end:6,justify:4,left:1,right:3,start:5},Rd={[Fd]:"center",[Md]:"end",[$d]:"justify",[Ad]:"left",[Od]:"right",[Id]:"start"},zd={normal:0,segmented:2,token:1},Bd={[Td]:"normal",[Nd]:"segmented",[wd]:"token"},mo="$config";function va(n,e,t,r,i,s){let o=n.getFirstChild();for(;o!==null;){const l=o.__key;o.__parent===e&&(T(o)&&va(o,l,t,r,i,s),t.has(l)||s.delete(l),i.push(l)),o=o.getNextSibling()}}let Ki=!1,ws=0;function Kd(n){ws=n.timeStamp}function yi(n,e,t){const r=n.nodeName==="BR",i=e.__lexicalLineBreak;return i&&(n===i||r&&n.previousSibling===i)||r&&li(n,t)!==void 0}function Ud(n,e,t){const r=Be(Le(t));let i=null,s=null;r!==null&&r.anchorNode===n&&(i=r.anchorOffset,s=r.focusOffset);const o=n.nodeValue;o!==null&&Vs(e,o,i,s,!1)}function Wd(n,e,t){if(N(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return pt(e)&&t.isAttached()}function jd(n,e,t,r){for(let i=n;i&&!Jf(i);i=lr(i)){const s=li(i,e);if(s!==void 0){const o=Q(s,t);if(o)return W(o)||!oe(i)?void 0:[i,o]}else if(i===r)return[r,Tu(t)]}}function xa(n,e,t){Ki=!0;const r=performance.now()-ws>100;try{tt(n,()=>{const i=$()||(function(d){return d.getEditorState().read(()=>{const h=$();return h!==null?h.clone():null})})(n),s=new Map,o=n.getRootElement(),l=n._editorState,a=n._blockCursorElement;let u=!1,c="";for(let d=0;d<e.length;d++){const h=e[d],g=h.type,_=h.target,p=jd(_,n,l,o);if(!p)continue;const[y,m]=p;if(g==="characterData")r&&O(m)&&pt(_)&&Wd(i,_,m)&&Ud(_,m,n);else if(g==="childList"){u=!0;const v=h.addedNodes;for(let x=0;x<v.length;x++){const C=v[x],E=Cu(C),k=C.parentNode;if(k!=null&&C!==a&&E===null&&!yi(C,k,n)){if(kt){const w=(oe(C)?C.innerText:null)||C.nodeValue;w&&(c+=w)}k.removeChild(C)}}const b=h.removedNodes,S=b.length;if(S>0){let x=0;for(let C=0;C<S;C++){const E=b[C];(yi(E,_,n)||a===E)&&(_.appendChild(E),x++)}S!==x&&s.set(y,m)}}}if(s.size>0)for(const[d,h]of s)h.reconcileObservedMutation(d,n);const f=t.takeRecords();if(f.length>0){for(let d=0;d<f.length;d++){const h=f[d],g=h.addedNodes,_=h.target;for(let p=0;p<g.length;p++){const y=g[p],m=y.parentNode;m==null||y.nodeName!=="BR"||yi(y,_,n)||m.removeChild(y)}}t.takeRecords()}i!==null&&(u&&xe(i),kt&&Fu(n)&&i.insertRawText(c))})}finally{Ki=!1}}function ba(n){const e=n._observer;e!==null&&xa(n,e.takeRecords(),e)}function Sa(n){(function(e){ws===0&&Le(e).addEventListener("textInput",Kd,!0)})(n),n._observer=new MutationObserver((e,t)=>{xa(n,e,t)})}let Hd=class{key;parse;unparse;isEqual;defaultValue;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||qd).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0)}};function Ns(n,e){return new Hd(n,e)}function As(n,e,t="latest"){const r=(t==="latest"?n.getLatest():n).__state;return r?r.getValue(e):e.defaultValue}function br(n,e,t){let r;if(ce(),typeof t=="function"){const s=n.getLatest(),o=As(s,e);if(r=t(o),e.isEqual(o,r))return s}else r=t;const i=n.getWritable();return Ca(i).updateFromKnown(e,r),i}function Jd(n){const e=new Map,t=new Set;for(let r=typeof n=="function"?n:n.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){const{ownNodeConfig:i}=ui(r);if(i&&i.stateConfigs)for(const s of i.stateConfigs){let o;"stateConfig"in s?(o=s.stateConfig,s.flat&&t.add(o.key)):o=s,e.set(o.key,o)}}return{flatKeys:t,sharedConfigMap:e}}let Vd=class ka{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,r=void 0,i=new Map,s=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=r,this.knownState=i;const{sharedConfigMap:o}=this.sharedNodeState,l=s!==void 0?s:(function(a,u,c){let f=c.size;if(u)for(const d in u){const h=a.get(d);h&&c.has(h)||f++}return f})(o,r,i);this.size=l}getValue(e){const t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let r=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){const i=this.unknownState[e.key];i!==void 0&&(r=e.parse(i)),this.updateFromKnown(e,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const e={...this.unknownState},t={};for(const[r,i]of this.knownState)r.isEqual(i,r.defaultValue)?delete e[r.key]:e[r.key]=r.unparse(i);for(const r of this.sharedNodeState.flatKeys)r in e&&(t[r]=e[r],delete e[r]);return yo(e)&&(t.$=e),t}getWritable(e){if(this.node===e)return this;const{sharedNodeState:t,unknownState:r}=this,i=new Map(this.knownState);return new ka(e,t,(function(s,o,l){let a;if(l)for(const[u,c]of Object.entries(l)){const f=s.get(u);f?o.has(f)||o.set(f,f.parse(c)):(a=a||{},a[u]=c)}return a})(t.sharedConfigMap,i,r),i,this.size)}updateFromKnown(e,t){const r=e.key;this.sharedNodeState.sharedConfigMap.set(r,e);const{knownState:i,unknownState:s}=this;i.has(e)||s&&r in s||(s&&(delete s[r],this.unknownState=yo(s)),this.size++),i.set(e,t)}updateFromUnknown(e,t){const r=this.sharedNodeState.sharedConfigMap.get(e);r?this.updateFromKnown(r,r.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){const{knownState:t}=this;for(const r of t.keys())t.set(r,r.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(const[r,i]of Object.entries(e))this.updateFromUnknown(r,i)}};function Ca(n){const e=n.getWritable(),t=e.__state?e.__state.getWritable(e):new Vd(e,Ea(e));return e.__state=t,t}function Ea(n){return n.__state?n.__state.sharedNodeState:vu(ai(),n.getType()).sharedNodeState}function yo(n){if(n)for(const e in n)return n}function qd(n){return n}function _o(n,e,t){for(const[r,i]of e.knownState){if(n.has(r.key))continue;n.add(r.key);const s=t?t.getValue(r):r.defaultValue;if(s!==i&&!r.isEqual(s,i))return!0}return!1}function vo(n,e,t){const{unknownState:r}=e,i=t?t.unknownState:void 0;if(r){for(const[s,o]of Object.entries(r))if(!n.has(s)&&(n.add(s),o!==(i?i[s]:void 0)))return!0}return!1}function xo(n,e){const t=n.__state;return t&&t.node===n?t.getWritable(e):t}function bo(n,e){const t=n.__mode,r=n.__format,i=n.__style,s=e.__mode,o=e.__format,l=e.__style,a=n.__state,u=e.__state;return(t===null||t===s)&&(r===null||r===o)&&(i===null||i===l)&&(n.__state===null||a===u||(function(c,f){if(c===f)return!0;if(c&&f&&c.size!==f.size)return!1;const d=new Set;return!(c&&_o(d,c,f)||f&&_o(d,f,c)||c&&vo(d,c,f)||f&&vo(d,f,c))})(a,u))}function So(n,e){const t=n.mergeWithSibling(e),r=q()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function ko(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&O(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(bo(e,r)){r=So(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&O(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(bo(r,t)){r=So(r,t);break}break}t.remove()}}else r.remove()}function Ir(n){return Co(n.anchor),Co(n.focus),n}function Co(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,i;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),i=!0):(r=e.getChildAtIndex(t),i=!1),O(r)){n.set(r.__key,i?r.getTextContentSize():0,"text",!0);break}if(!T(r))break;n.set(r.__key,i?r.getChildrenSize():0,"element",!0)}}let jt,pe,Vn,ti,Ui,Wi,Ht,Ue,ji,qn,ae="",qe=null,Ot=null,ln=!1,Mr=!1;function Pr(n,e){const t=Ht.get(n);if(e!==null){const r=qi(n);r.parentNode===e&&e.removeChild(r)}if(Ue.has(n)||pe._keyToDOMMap.delete(n),T(t)){const r=Dr(t,Ht);Hi(r,0,r.length-1,null)}t!==void 0&&qs(qn,Vn,ti,t,"destroyed")}function Hi(n,e,t,r){for(let i=e;i<=t;++i){const s=n[i];s!==void 0&&Pr(s,r)}}function At(n,e){n.setProperty("text-align",e)}const Gd="40px";function Ta(n,e){const t=jt.theme.indent;if(typeof t=="string"){const i=n.classList.contains(t);e>0&&!i?n.classList.add(t):e<1&&i&&n.classList.remove(t)}if(e===0)return void n.style.setProperty("padding-inline-start","");const r=getComputedStyle(pe._rootElement||n).getPropertyValue("--lexical-indent-base-value")||Gd;n.style.setProperty("padding-inline-start",`calc(${e} * ${r})`)}function wa(n,e){const t=n.style;e===0?At(t,""):e===1?At(t,"left"):e===2?At(t,"center"):e===3?At(t,"right"):e===4?At(t,"justify"):e===5?At(t,"start"):e===6&&At(t,"end")}function Ji(n,e){const t=(function(r){const i=r.__dir;if(i!==null)return i;if(ue(r))return null;const s=r.getParentOrThrow();return ue(s)&&s.__dir===null?"auto":null})(e);t!==null?n.dir=t:n.removeAttribute("dir")}function Lr(n,e){const t=Ue.get(n);t===void 0&&F(60);const r=t.createDOM(jt,pe);if((function(i,s,o){const l=o._keyToDOMMap;(function(a,u,c){const f=`__lexicalKey_${u._key}`;a[f]=c})(s,o,i),l.set(i,s)})(n,r,pe),O(t)?r.setAttribute("data-lexical-text","true"):W(t)&&r.setAttribute("data-lexical-decorator","true"),T(t)){const i=t.__indent,s=t.__size;if(Ji(r,t),i!==0&&Ta(r,i),s!==0){const l=s-1;Vi(Dr(t,Ue),t,0,l,t.getDOMSlot(r))}const o=t.__format;o!==0&&wa(r,o),t.isInline()||Na(null,t,r)}else{const i=t.getTextContent();if(W(t)){const s=t.decorate(pe,jt);s!==null&&Aa(n,s),r.contentEditable="false"}ae+=i}return e!==null&&e.insertChild(r),qs(qn,Vn,ti,t,"created"),r}function Vi(n,e,t,r,i){const s=ae;ae="";let o=t;for(;o<=r;++o){Lr(n[o],i);const l=Ue.get(n[o]);l!==null&&O(l)?qe===null&&(qe=l.getFormat(),Ot=l.getStyle()):T(l)&&o<r&&!l.isInline()&&(ae+=ei)}i.element.__lexicalTextContent=ae,ae=s+ae}function Eo(n,e){if(n){const t=n.__last;if(t){const r=e.get(t);if(r)return ee(r)?"line-break":W(r)&&r.isInline()?"decorator":null}return"empty"}return null}function Na(n,e,t){const r=Eo(n,Ht),i=Eo(e,Ue);r!==i&&e.getDOMSlot(t).setManagedLineBreak(i)}function Yd(n,e,t){var r;qe=null,Ot=null,(function(i,s,o){const l=ae,a=i.__size,u=s.__size;ae="";const c=o.element;if(a===1&&u===1){const f=i.__first,d=s.__first;if(f===d)Sr(f,c);else{const g=qi(f),_=Lr(d,null);try{c.replaceChild(_,g)}catch(p){if(typeof p=="object"&&p!=null){const y=`${p.toString()} Parent: ${c.tagName}, new child: {tag: ${_.tagName} key: ${d}}, old child: {tag: ${g.tagName}, key: ${f}}.`;throw new Error(y)}throw p}Pr(f,null)}const h=Ue.get(d);O(h)&&qe===null&&(qe=h.getFormat(),Ot=h.getStyle())}else{const f=Dr(i,Ht),d=Dr(s,Ue);if(f.length!==a&&F(227),d.length!==u&&F(228),a===0)u!==0&&Vi(d,0,0,u-1,o);else if(u===0){if(a!==0){const h=o.after==null&&o.before==null&&o.element.__lexicalLineBreak==null;Hi(f,0,a-1,h?null:c),h&&(c.textContent="")}}else(function(h,g,_,p,y,m){const v=p-1,b=y-1;let S,x,C=m.getFirstChild(),E=0,k=0;for(;E<=v&&k<=b;){const P=g[E],K=_[k];if(P===K)C=_i(Sr(K,m.element)),E++,k++;else{if(x===void 0&&(x=To(_,k)),S===void 0)S=To(g,E);else if(!S.has(P)){E++;continue}if(!x.has(P)){C=_i(qi(P)),Pr(P,m.element),E++,S.delete(P);continue}if(S.has(K)){const X=Sn(pe,K);X!==C&&m.withBefore(C).insertChild(X),C=_i(Sr(K,m.element)),E++,k++}else Lr(K,m.withBefore(C)),k++}const U=Ue.get(K);U!==null&&O(U)?qe===null&&(qe=U.getFormat(),Ot=U.getStyle()):T(U)&&k<=b&&!U.isInline()&&(ae+=ei)}const w=E>v,M=k>b;if(w&&!M){const P=_[b+1],K=P===void 0?null:pe.getElementByKey(P);Vi(_,0,k,b,m.withBefore(K))}else M&&!w&&Hi(g,E,v,m.element)})(0,f,d,a,u,o)}c.__lexicalTextContent=ae,ae=l+ae})(n,e,e.getDOMSlot(t)),r=e,qe==null||qe===r.__textFormat||Mr||r.setTextFormat(qe),(function(i){Ot==null||Ot===i.__textStyle||Mr||i.setTextStyle(Ot)})(e)}function Dr(n,e){const t=[];let r=n.__first;for(;r!==null;){const i=e.get(r);i===void 0&&F(101),t.push(r),r=i.__next}return t}function Sr(n,e){const t=Ht.get(n);let r=Ue.get(n);t!==void 0&&r!==void 0||F(61);const i=ln||Wi.has(n)||Ui.has(n),s=Sn(pe,n);if(t===r&&!i){let o;if(T(t)){const l=s.__lexicalTextContent;typeof l=="string"?o=l:(o=t.getTextContent(),s.__lexicalTextContent=o)}else o=t.getTextContent();return ae+=o,s}if(t!==r&&i&&qs(qn,Vn,ti,r,"updated"),r.updateDOM(t,s,jt)){const o=Lr(n,null);return e===null&&F(62),e.replaceChild(o,s),Pr(n,null),o}if(T(t)){T(r)||F(334,n);const o=r.__indent;(ln||o!==t.__indent)&&Ta(s,o);const l=r.__format;if((ln||l!==t.__format)&&wa(s,l),i)Yd(t,r,s),ue(r)||r.isInline()||Na(t,r,s);else{const a=s.__lexicalTextContent;let u;typeof a=="string"?u=a:(u=t.getTextContent(),s.__lexicalTextContent=u),ae+=u}if((ln||r.__dir!==t.__dir)&&(Ji(s,r),ue(r)&&!ln))for(const a of r.getChildren())T(a)&&Ji(Sn(pe,a.getKey()),a)}else{const o=r.getTextContent();if(W(r)){const l=r.decorate(pe,jt);l!==null&&Aa(n,l)}ae+=o}if(!Mr&&ue(r)&&r.__cachedText!==ae){const o=r.getWritable();o.__cachedText=ae,r=o}return s}function Aa(n,e){let t=pe._pendingDecorators;const r=pe._decorators;if(t===null){if(r[n]===e)return;t=Eu(pe)}t[n]=e}function _i(n){let e=n.nextSibling;return e!==null&&e===pe._blockCursorElement&&(e=e.nextSibling),e}function To(n,e){const t=new Set;for(let r=e;r<n.length;r++)t.add(n[r]);return t}function Zd(n,e,t,r,i,s){ae="",ln=r===2,pe=t,jt=t._config,Vn=t._nodes,ti=pe._listeners.mutation,Ui=i,Wi=s,Ht=n._nodeMap,Ue=e._nodeMap,Mr=e._readOnly,ji=new Map(t._keyToDOMMap);const o=new Map;return qn=o,Sr("root",null),pe=void 0,Vn=void 0,Ui=void 0,Wi=void 0,Ht=void 0,Ue=void 0,jt=void 0,ji=void 0,qn=void 0,o}function qi(n){const e=ji.get(n);return e===void 0&&F(75,n),e}function L(n){return{type:n}}const Fa=L("SELECTION_CHANGE_COMMAND"),Xd=L("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Oa=L("CLICK_COMMAND"),$a=L("BEFORE_INPUT_COMMAND"),Ia=L("INPUT_COMMAND"),Ma=L("COMPOSITION_START_COMMAND"),Pa=L("COMPOSITION_END_COMMAND"),Rt=L("DELETE_CHARACTER_COMMAND"),gn=L("INSERT_LINE_BREAK_COMMAND"),Gn=L("INSERT_PARAGRAPH_COMMAND"),hn=L("CONTROLLED_TEXT_INSERTION_COMMAND"),Fs=L("PASTE_COMMAND"),Gi=L("REMOVE_TEXT_COMMAND"),Yn=L("DELETE_WORD_COMMAND"),Zn=L("DELETE_LINE_COMMAND"),ct=L("FORMAT_TEXT_COMMAND"),Os=L("UNDO_COMMAND"),$s=L("REDO_COMMAND"),La=L("KEYDOWN_COMMAND"),Da=L("KEY_ARROW_RIGHT_COMMAND"),Yi=L("MOVE_TO_END"),Ra=L("KEY_ARROW_LEFT_COMMAND"),Rr=L("MOVE_TO_START"),_n=L("KEY_ARROW_UP_COMMAND"),zr=L("KEY_ARROW_DOWN_COMMAND"),Br=L("KEY_ENTER_COMMAND"),za=L("KEY_SPACE_COMMAND"),Ba=L("KEY_BACKSPACE_COMMAND"),Ka=L("KEY_ESCAPE_COMMAND"),Ua=L("KEY_DELETE_COMMAND"),Is=L("KEY_TAB_COMMAND"),Zi=L("INSERT_TAB_COMMAND"),zt=L("INDENT_CONTENT_COMMAND"),cn=L("OUTDENT_CONTENT_COMMAND"),Wa=L("DROP_COMMAND"),Qd=L("FORMAT_ELEMENT_COMMAND"),ja=L("DRAGSTART_COMMAND"),Ha=L("DRAGOVER_COMMAND"),ef=L("DRAGEND_COMMAND"),ni=L("COPY_COMMAND"),Ms=L("CUT_COMMAND"),Xi=L("SELECT_ALL_COMMAND"),tf=L("CLEAR_EDITOR_COMMAND"),nf=L("CLEAR_HISTORY_COMMAND"),cr=L("CAN_REDO_COMMAND"),dr=L("CAN_UNDO_COMMAND"),rf=L("FOCUS_COMMAND"),sf=L("BLUR_COMMAND"),of=L("KEY_MODIFIER_COMMAND"),st=Object.freeze({}),Qi=[["keydown",function(n,e){Xn=n.timeStamp,Ja=n.key,!e.isComposing()&&I(e,La,n)}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;On(t)&&r!=="touch"&&r!=="pen"&&n.button===0&&tt(e,()=>{xu(t)||(ns=!0)})}],["compositionstart",function(n,e){I(e,Ma,n)}],["compositionend",function(n,e){kt?Rn=!0:rr||!Xr&&!Qr?I(e,Pa,n):(kr=!0,Cr=n.data)}],["input",function(n,e){n.stopPropagation(),tt(e,()=>{e.dispatchCommand(Ia,n)},{event:n}),an=null}],["click",function(n,e){tt(e,()=>{const t=$(),r=Be(Le(e)),i=Nn();if(r){if(N(t)){const s=t.anchor,o=s.getNode();if(s.type==="element"&&s.offset===0&&t.isCollapsed()&&!ue(o)&&te().getChildrenSize()===1&&o.getTopLevelElementOrThrow().isEmpty()&&i!==null&&t.is(i))r.removeAllRanges(),t.dirty=!0;else if(n.detail===3&&!t.isCollapsed()&&o!==t.focus.getNode()){const l=ze(o,a=>T(a)&&!a.isInline());T(l)&&l.select(0)}}else if(n.pointerType==="touch"||n.pointerType==="pen"){const s=r.anchorNode;(oe(s)||pt(s))&&xe(Ds(i,r,e,n))}}I(e,Oa,n)})}],["cut",st],["copy",st],["dragstart",st],["dragover",st],["dragend",st],["paste",st],["focus",st],["blur",st],["drop",st]];$r&&Qi.push(["beforeinput",(n,e)=>(function(t,r){const i=t.inputType;i==="deleteCompositionText"||kt&&Fu(r)||i!=="insertCompositionText"&&I(r,$a,t)})(n,e)]);let Xn=0,Ja=null,Va=0,an=null;const es=new WeakMap,Kr=new WeakMap;let ts=!1,ns=!1,Kn=!1,Rn=!1,kr=!1,Cr="",It=null,qa=[0,"",0,"root",0];function Ga(n,e,t,r,i){const s=n.anchor,o=n.focus,l=s.getNode(),a=q(),u=Be(Le(a)),c=u!==null?u.anchorNode:null,f=s.key,d=a.getElementByKey(f),h=t.length;return f!==o.key||!O(l)||(!i&&(!$r||Va<r+50)||l.isDirty()&&h<2||wu(t))&&s.offset!==o.offset&&!l.isComposing()||at(l)||l.isDirty()&&h>1||(i||!$r)&&d!==null&&!l.isComposing()&&c!==xn(d)||u!==null&&e!==null&&(!e.collapsed||e.startContainer!==u.anchorNode||e.startOffset!==u.anchorOffset)||!l.isComposing()&&(l.getFormat()!==n.format||l.getStyle()!==n.style)||(function(g,_){if(_.isSegmented())return!0;if(!g.isCollapsed())return!1;const p=g.anchor.offset,y=_.getParentOrThrow(),m=Bt(_);return p===0?!_.canInsertTextBefore()||!y.canInsertTextBefore()&&!_.isComposing()||m||(function(v){const b=v.getPreviousSibling();return(O(b)||T(b)&&b.isInline())&&!b.canInsertTextAfter()})(_):p===_.getTextContentSize()&&(!_.canInsertTextAfter()||!y.canInsertTextAfter()&&!_.isComposing()||m)})(n,l)}function wo(n,e){return pt(n)&&n.nodeValue!==null&&e!==0&&e!==n.nodeValue.length}function No(n,e,t){const{anchorNode:r,anchorOffset:i,focusNode:s,focusOffset:o}=n;ts&&(ts=!1,wo(r,i)&&wo(s,o)&&!It)||tt(e,()=>{if(!t)return void xe(null);if(!or(e,r,s))return;let l=$();if(It&&N(l)&&l.isCollapsed()){const a=l.anchor,u=It.anchor;(a.key===u.key&&a.offset===u.offset+1||a.offset===1&&u.getNode().is(a.getNode().getPreviousSibling()))&&(l=It.clone(),xe(l))}if(It=null,N(l)){const a=l.anchor,u=a.getNode();if(l.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(l.dirty=!0);const c=Le(e).event,f=c?c.timeStamp:performance.now(),[d,h,g,_,p]=qa,y=te(),m=e.isComposing()===!1&&y.getTextContent()==="";if(f<p+200&&a.offset===g&&a.key===_)Er(l,d,h);else if(a.type==="text")O(u)||F(141),Ya(l,u);else if(a.type==="element"&&!m){T(u)||F(259);const v=a.getNode();v.isEmpty()?(function(b,S){const x=S.getTextFormat(),C=S.getTextStyle();Er(b,x,C)})(l,v):Er(l,0,"")}}else{const c=a.key,f=l.focus.key,d=l.getNodes(),h=d.length,g=l.isBackward(),_=g?o:i,p=g?i:o,y=g?f:c,m=g?c:f;let v=2047,b=!1;for(let S=0;S<h;S++){const x=d[S],C=x.getTextContentSize();if(O(x)&&C!==0&&!(S===0&&x.__key===y&&_===C||S===h-1&&x.__key===m&&p===0)&&(b=!0,v&=x.getFormat(),v===0))break}l.format=b?v:0}}I(e,Fa,void 0)})}function Er(n,e,t){n.format===e&&n.style===t||(n.format=e,n.style=t,n.dirty=!0)}function Ya(n,e){Er(n,e.getFormat(),e.getStyle())}function Za(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function lf(n){const e=n.inputType,t=Za(n),r=q(),i=$();if(e==="deleteContentBackward"){if(i===null){const f=Nn();if(!N(f))return!0;xe(f.clone())}if(N(i)){const f=i.anchor.key===i.focus.key;if(s=n.timeStamp,Ja==="MediaLast"&&s<Xn+30&&r.isComposing()&&f){if(he(null),Xn=0,setTimeout(()=>{tt(r,()=>{he(null)})},30),N(i)){const d=i.anchor.getNode();d.markDirty(),O(d)||F(142),Ya(i,d)}}else{he(null),n.preventDefault();const d=i.anchor.getNode(),h=d.getTextContent(),g=d.canInsertTextAfter(),_=i.anchor.offset===0&&i.focus.offset===h.length;let p=zi&&f&&!_&&g;if(p&&i.isCollapsed()&&(p=!W(as(i.anchor,!0))),!p){I(r,Rt,!0);const y=$();zi&&N(y)&&y.isCollapsed()&&(It=y,setTimeout(()=>It=null))}}return!0}}var s;if(!N(i))return!0;const o=n.data;an!==null&&Js(!1,r,an),i.dirty&&an===null||!i.isCollapsed()||ue(i.anchor.getNode())||t===null||i.applyDOMRange(t),an=null;const l=i.anchor,a=i.focus,u=l.getNode(),c=a.getNode();if(e==="insertText"||e==="insertTranspose"){if(o===`
|
|
4
4
|
`)n.preventDefault(),I(r,gn,!1);else if(o===ei)n.preventDefault(),I(r,Gn,void 0);else if(o==null&&n.dataTransfer){const f=n.dataTransfer.getData("text/plain");n.preventDefault(),i.insertRawText(f)}else o!=null&&Ga(i,t,o,n.timeStamp,!0)?(n.preventDefault(),I(r,hn,o)):an=o;return Va=n.timeStamp,!0}switch(n.preventDefault(),e){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":I(r,hn,n);break;case"insertFromComposition":he(null),I(r,hn,n);break;case"insertLineBreak":he(null),I(r,gn,!1);break;case"insertParagraph":he(null),Kn&&!rr?(Kn=!1,I(r,gn,!1)):I(r,Gn,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":I(r,Fs,n);break;case"deleteByComposition":(function(f,d){return f!==d||T(f)||T(d)||!Bt(f)||!Bt(d)})(u,c)&&I(r,Gi,n);break;case"deleteByDrag":case"deleteByCut":I(r,Gi,n);break;case"deleteContent":I(r,Rt,!1);break;case"deleteWordBackward":I(r,Yn,!0);break;case"deleteWordForward":I(r,Yn,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":I(r,Zn,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":I(r,Zn,!1);break;case"formatStrikeThrough":I(r,ct,"strikethrough");break;case"formatBold":I(r,ct,"bold");break;case"formatItalic":I(r,ct,"italic");break;case"formatUnderline":I(r,ct,"underline");break;case"historyUndo":I(r,Os,void 0);break;case"historyRedo":I(r,$s,void 0)}return!0}function af(n){if(oe(n.target)&&xu(n.target))return!0;const e=q(),t=$(),r=n.data,i=Za(n);if(r!=null&&N(t)&&Ga(t,i,r,n.timeStamp,!1)){Rn&&(Ur(e,r),Rn=!1);const s=t.anchor.getNode(),o=Be(Le(e));if(o===null)return!0;const l=t.isBackward(),a=l?t.anchor.offset:t.focus.offset,u=l?t.focus.offset:t.anchor.offset;$r&&!t.isCollapsed()&&O(s)&&o.anchorNode!==null&&s.getTextContent().slice(0,a)+r+s.getTextContent().slice(a+u)===Au(o.anchorNode)||I(e,hn,r);const c=r.length;kt&&c>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=c),zi&&e.isComposing()&&(Xn=0,he(null))}else Js(!1,e,r!==null?r:void 0),Rn&&(Ur(e,r||void 0),Rn=!1);return(function(){ce();const s=q();ba(s)})(),!0}function uf(n){const e=q(),t=$();if(N(t)&&!e.isComposing()){const r=t.anchor,i=t.anchor.getNode();he(r.key),Gs(tu),(n.timeStamp<Xn+30||r.type==="element"||!t.isCollapsed()||i.getFormat()!==t.format||O(i)&&i.getStyle()!==t.style)&&I(e,hn,Ts)}return!0}function cf(n){return Ur(q(),n.data),Gs(nu),!0}function Ur(n,e){const t=n._compositionKey;if(he(null),t!==null&&e!=null){if(e===""){const r=Q(t),i=xn(n.getElementByKey(t));if(i!==null&&i.nodeValue!==null&&O(r)){const s=Be(Le(n));let o=null,l=null;s!==null&&s.anchorNode===i&&(o=s.anchorOffset,l=s.focusOffset),Vs(r,i.nodeValue,o,l,!0)}return}if(e[e.length-1]===`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_,c as t,a as e,d as s,t as a,v as m,F as v,x as f,b as y,e as g,f as k,y as h,g as x,u as b,z as N,o as n,n as w,A as C}from"./index-
|
|
1
|
+
import{_,c as t,a as e,d as s,t as a,v as m,F as v,x as f,b as y,e as g,f as k,y as h,g as x,u as b,z as N,o as n,n as w,A as C}from"./index-Zr9MoxJi.js";import"./mermaid-DUllW9QE.js";const S={key:0},B={class:"error-header"},E={class:"error-message"},V={class:"error-location"},q={class:"error-line-badge"},R={key:0,class:"error-code-block"},z={class:"line-number"},F={key:1},J={__name:"ErrorPage",setup(L){const c=b(),u=N(),o=h(()=>{try{return c.query.data?JSON.parse(c.query.data):null}catch{return null}});async function d(){const i=await C();i.error?u.replace({name:"error",query:{data:JSON.stringify(i.error)}}):(u.push("/"),window.location.reload())}return(i,r)=>{const p=x("router-link");return o.value?(n(),t("div",S,[e("header",null,[e("article",B,[r[1]||(r[1]=e("h3",null,[e("i",{class:"iconoir-warning-triangle"}),s(" Error ")],-1)),e("p",E,a(o.value.error),1),e("p",V,[r[0]||(r[0]=e("i",{class:"iconoir-page"},null,-1)),s(" "+a(o.value.path)+" ",1),e("span",q,"Line "+a(o.value.line_no),1)])]),e("a",{href:"#",class:"reload-btn",onClick:m(d,["prevent"])},[...r[2]||(r[2]=[e("i",{class:"iconoir-refresh"},null,-1),s(" Reload ",-1)])])]),o.value.context?(n(),t("div",R,[e("pre",null,[e("code",null,[(n(!0),t(v,null,f(o.value.context,l=>(n(),t("span",{key:l.line_no,class:w(l.selected?"error-line":"code-line")},[e("span",z,a(String(l.line_no).padStart(4," ")),1),s(a(l.content)+`
|
|
2
2
|
`,1)],2))),128))])])])):y("",!0)])):(n(),t("div",F,[r[4]||(r[4]=e("p",null,"No error data available.",-1)),g(p,{to:"/"},{default:k(()=>[...r[3]||(r[3]=[s("Back to home",-1)])]),_:1})]))}}},A=_(J,[["__scopeId","data-v-109cf8ab"]]);export{A as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as p,l as d,m as v,k as m,p as _,c as o,a as n,r,o as s}from"./index-
|
|
1
|
+
import{_ as p,l as d,m as v,k as m,p as _,c as o,a as n,r,o as s}from"./index-Zr9MoxJi.js";import{r as f}from"./useGraphviz-BN4iwLLN.js";import{i as g}from"./usePanZoom-BEXq_r0S.js";import"./mermaid-DUllW9QE.js";const h={key:0},k={key:1,class:"graph-container graph-expand"},w=["innerHTML"],y={__name:"GraphView",setup(x){const l=r(""),i=r(!0),a=r(null);let u=null;d(async()=>{const e=await v();l.value=e?await f(e):"",i.value=!1,await m(),c()}),_(()=>{u?.destroy()});function c(){if(!a.value)return;const e=a.value.querySelector("svg");e&&(u=g(e,a.value))}return(e,t)=>(s(),o("article",null,[t[1]||(t[1]=n("header",null,[n("h2",null,"Architecture Overview")],-1)),i.value?(s(),o("div",h,[...t[0]||(t[0]=[n("p",null,"Loading graph...",-1)])])):(s(),o("div",k,[n("div",{id:"graphviz",ref_key:"graphEl",ref:a,class:"fullcanvas",innerHTML:l.value},null,8,w)]))]))}},L=p(y,[["__scopeId","data-v-7d4eb553"]]);export{L as default};
|