dsh-knowhub 0.9.1 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -1
- package/cordis.patch.yml +10 -0
- package/lib/host/pipeline/initialize.js +144 -27
- package/package.json +3 -2
- package/skills/archify/LICENSE +202 -0
- package/skills/archify/LICENSE-MIT +22 -0
- package/skills/archify/NOTICE +26 -0
- package/skills/archify/SKILL.md +137 -0
- package/skills/archify/THIRD_PARTY_NOTICES.md +78 -0
- package/skills/archify/assets/JetBrainsMono-OFL.txt +93 -0
- package/skills/archify/assets/template.html +14768 -0
- package/skills/archify/bin/archify.mjs +7289 -0
- package/skills/archify/bin/delivery-update.mjs +92 -0
- package/skills/archify/bin/finalize.mjs +1055 -0
- package/skills/archify/bin/open-artifact.mjs +146 -0
- package/skills/archify/bin/preview.mjs +970 -0
- package/skills/archify/bin/recover-output.mjs +41 -0
- package/skills/archify/bin/visual-check.mjs +2780 -0
- package/skills/archify/brand-marks/README.md +31 -0
- package/skills/archify/brand-marks/catalog.json +131 -0
- package/skills/archify/delta/architecture-delta.mjs +1318 -0
- package/skills/archify/examples/agent-run.lifecycle.json +55 -0
- package/skills/archify/examples/agent-tool-call.workflow.json +74 -0
- package/skills/archify/examples/archify-dev-activity.timeline.json +176 -0
- package/skills/archify/examples/archify-repository.tree.json +197 -0
- package/skills/archify/examples/async-job-roundtrip.sequence.json +56 -0
- package/skills/archify/examples/brand-aware-delivery.architecture.json +34 -0
- package/skills/archify/examples/cache-miss-request.sequence.json +77 -0
- package/skills/archify/examples/checkout-platform.base.architecture.json +32 -0
- package/skills/archify/examples/checkout-platform.head.architecture.json +32 -0
- package/skills/archify/examples/checkout-request.waterfall.json +20 -0
- package/skills/archify/examples/delivery.explainer.json +155 -0
- package/skills/archify/examples/deployment-release.lifecycle.json +72 -0
- package/skills/archify/examples/event-stream.dataflow.json +52 -0
- package/skills/archify/examples/example-rebuild.waterfall.json +212 -0
- package/skills/archify/examples/holiday-planning.workflow.json +143 -0
- package/skills/archify/examples/incident-response.workflow.json +59 -0
- package/skills/archify/examples/locales/de.json +463 -0
- package/skills/archify/examples/locales/fr.json +463 -0
- package/skills/archify/examples/locales/fr.partial.json +22 -0
- package/skills/archify/examples/locales/it.json +463 -0
- package/skills/archify/examples/locales/ja.json +463 -0
- package/skills/archify/examples/locales/pt.json +463 -0
- package/skills/archify/examples/locales/ru.json +463 -0
- package/skills/archify/examples/orders.erd.json +337 -0
- package/skills/archify/examples/payment-incident.timeline.json +24 -0
- package/skills/archify/examples/payment-platform.tree.json +22 -0
- package/skills/archify/examples/payment-processors.class.json +177 -0
- package/skills/archify/examples/payments.class.json +85 -0
- package/skills/archify/examples/product-analytics.dataflow.json +71 -0
- package/skills/archify/examples/production-deployment.architecture.json +51 -0
- package/skills/archify/examples/release-delivery.workflow.json +57 -0
- package/skills/archify/examples/subscription-billing.erd.json +548 -0
- package/skills/archify/examples/web-app.architecture.json +41 -0
- package/skills/archify/explainer/browser-check.mjs +208 -0
- package/skills/archify/explainer/charts.mjs +70 -0
- package/skills/archify/explainer/check.mjs +167 -0
- package/skills/archify/explainer/diagrams.mjs +517 -0
- package/skills/archify/explainer/diff.mjs +124 -0
- package/skills/archify/explainer/inline.mjs +155 -0
- package/skills/archify/explainer/layout.mjs +35 -0
- package/skills/archify/explainer/page-bundle.mjs +16 -0
- package/skills/archify/explainer/parse.mjs +300 -0
- package/skills/archify/explainer/patch.mjs +117 -0
- package/skills/archify/explainer/prepare.mjs +131 -0
- package/skills/archify/explainer/reader.css +472 -0
- package/skills/archify/explainer/reader.js +666 -0
- package/skills/archify/explainer/render.mjs +224 -0
- package/skills/archify/explainer/revision.mjs +20 -0
- package/skills/archify/explainer/sources.mjs +318 -0
- package/skills/archify/explainer/validate.mjs +138 -0
- package/skills/archify/explainer/vendor/pele/LICENSE +40 -0
- package/skills/archify/explainer/vendor/pele/README.md +5 -0
- package/skills/archify/explainer/vendor/pele/chunks/3DKXF73K.js +4 -0
- package/skills/archify/explainer/vendor/pele/chunks/42UTT654.js +3 -0
- package/skills/archify/explainer/vendor/pele/chunks/DKTLEL5E.js +1 -0
- package/skills/archify/explainer/vendor/pele/chunks/EEIX5ZYH.js +2 -0
- package/skills/archify/explainer/vendor/pele/chunks/EJ5KOXYD.js +25 -0
- package/skills/archify/explainer/vendor/pele/chunks/GUJTEFZK.js +1 -0
- package/skills/archify/explainer/vendor/pele/chunks/IZOKQ2GT.js +4 -0
- package/skills/archify/explainer/vendor/pele/chunks/L4LY553T.js +3 -0
- package/skills/archify/explainer/vendor/pele/chunks/MSKIJHB2.js +2 -0
- package/skills/archify/explainer/vendor/pele/chunks/RVARI57O.js +1 -0
- package/skills/archify/explainer/vendor/pele/chunks/UKSIWDDN.js +2 -0
- package/skills/archify/explainer/vendor/pele/chunks/UPTXNAXN.js +2 -0
- package/skills/archify/explainer/vendor/pele/chunks/XTDUIGUI.js +9 -0
- package/skills/archify/explainer/vendor/pele/chunks/YAYTP6L5.js +9 -0
- package/skills/archify/explainer/vendor/pele/core.js +1 -0
- package/skills/archify/explainer/vendor/pele/diagrams/pie.js +1 -0
- package/skills/archify/explainer/vendor/pele/diagrams/quadrantChart.js +1 -0
- package/skills/archify/explainer/vendor/pele/diagrams/radar.js +1 -0
- package/skills/archify/explainer/vendor/pele/diagrams/sankey.js +1 -0
- package/skills/archify/explainer/vendor/pele/diagrams/venn.js +1 -0
- package/skills/archify/explainer/vendor/pele/diagrams/xychart.js +1 -0
- package/skills/archify/explainer/writing.mjs +139 -0
- package/skills/archify/locales/README.md +40 -0
- package/skills/archify/locales/ar.json +488 -0
- package/skills/archify/locales/en.json +488 -0
- package/skills/archify/locales/es.json +488 -0
- package/skills/archify/locales/ko.json +488 -0
- package/skills/archify/locales/manifest.json +10 -0
- package/skills/archify/locales/zh-CN.json +488 -0
- package/skills/archify/locales/zh-TW.json +488 -0
- package/skills/archify/migrations/workflow-v2.mjs +280 -0
- package/skills/archify/package.json +17 -0
- package/skills/archify/recipes/scenarios.mjs +455 -0
- package/skills/archify/references/architecture-layout-repair.md +18 -0
- package/skills/archify/references/authoring-contract.md +645 -0
- package/skills/archify/references/authoring-defaults.md +57 -0
- package/skills/archify/references/brand-marks.md +119 -0
- package/skills/archify/references/delivery-contract.md +665 -0
- package/skills/archify/references/explainer-authoring.md +274 -0
- package/skills/archify/references/repository-authoring.md +126 -0
- package/skills/archify/references/update-awareness.md +13 -0
- package/skills/archify/references/viewer-runtime.md +52 -0
- package/skills/archify/renderers/architecture/grid.mjs +62 -0
- package/skills/archify/renderers/architecture/labels.mjs +2 -0
- package/skills/archify/renderers/architecture/render-architecture.mjs +1204 -0
- package/skills/archify/renderers/architecture/routing.mjs +1469 -0
- package/skills/archify/renderers/class/README.md +130 -0
- package/skills/archify/renderers/class/render-class.mjs +1095 -0
- package/skills/archify/renderers/dataflow/README.md +176 -0
- package/skills/archify/renderers/dataflow/dataflow-compiler.mjs +1605 -0
- package/skills/archify/renderers/dataflow/joint-label-routing.mjs +165 -0
- package/skills/archify/renderers/dataflow/label-capacity.mjs +81 -0
- package/skills/archify/renderers/dataflow/render-dataflow.mjs +23 -0
- package/skills/archify/renderers/erd/README.md +246 -0
- package/skills/archify/renderers/erd/grid.mjs +150 -0
- package/skills/archify/renderers/erd/render-erd.mjs +1588 -0
- package/skills/archify/renderers/explainer/render-explainer.mjs +42 -0
- package/skills/archify/renderers/lifecycle/README.md +104 -0
- package/skills/archify/renderers/lifecycle/render-lifecycle.mjs +1134 -0
- package/skills/archify/renderers/sequence/README.md +146 -0
- package/skills/archify/renderers/sequence/render-sequence.mjs +1105 -0
- package/skills/archify/renderers/shared/atomic-output.mjs +1982 -0
- package/skills/archify/renderers/shared/automatic-labels.mjs +290 -0
- package/skills/archify/renderers/shared/brand-marks.mjs +706 -0
- package/skills/archify/renderers/shared/cli.mjs +430 -0
- package/skills/archify/renderers/shared/desktop-readability.mjs +132 -0
- package/skills/archify/renderers/shared/diagnostics.mjs +0 -0
- package/skills/archify/renderers/shared/engineering-profiles.mjs +157 -0
- package/skills/archify/renderers/shared/generated-brand-marks.mjs +2003 -0
- package/skills/archify/renderers/shared/generated-validators.mjs +279 -0
- package/skills/archify/renderers/shared/geometry.mjs +2073 -0
- package/skills/archify/renderers/shared/i18n.mjs +328 -0
- package/skills/archify/renderers/shared/layout-report.mjs +57 -0
- package/skills/archify/renderers/shared/legend.mjs +227 -0
- package/skills/archify/renderers/shared/node-card-style.mjs +32 -0
- package/skills/archify/renderers/shared/output-path.mjs +440 -0
- package/skills/archify/renderers/shared/owned-temp-directory.mjs +82 -0
- package/skills/archify/renderers/shared/path-semantics.mjs +1017 -0
- package/skills/archify/renderers/shared/portable-path.mjs +408 -0
- package/skills/archify/renderers/shared/repository-evidence.mjs +394 -0
- package/skills/archify/renderers/shared/repository-location.mjs +71 -0
- package/skills/archify/renderers/shared/route-quality.mjs +670 -0
- package/skills/archify/renderers/shared/sidecar-path.mjs +38 -0
- package/skills/archify/renderers/shared/software-notices.mjs +6 -0
- package/skills/archify/renderers/shared/spatial-grid.mjs +66 -0
- package/skills/archify/renderers/shared/svg-path-analysis.mjs +135 -0
- package/skills/archify/renderers/shared/text-fit.mjs +105 -0
- package/skills/archify/renderers/shared/utils.mjs +260 -0
- package/skills/archify/renderers/shared/validator.mjs +83 -0
- package/skills/archify/renderers/timeline/README.md +76 -0
- package/skills/archify/renderers/timeline/render-timeline.mjs +576 -0
- package/skills/archify/renderers/tree/README.md +96 -0
- package/skills/archify/renderers/tree/render-tree.mjs +573 -0
- package/skills/archify/renderers/waterfall/README.md +73 -0
- package/skills/archify/renderers/waterfall/render-waterfall.mjs +413 -0
- package/skills/archify/renderers/workflow/README.md +337 -0
- package/skills/archify/renderers/workflow/render-workflow.mjs +47 -0
- package/skills/archify/renderers/workflow/workflow-compiler.mjs +5920 -0
- package/skills/archify/renderers/workflow/workflow-migration-geometry.mjs +161 -0
- package/skills/archify/renderers/workflow/workflow-placement-repair.mjs +94 -0
- package/skills/archify/schemas/README.md +258 -0
- package/skills/archify/schemas/architecture.schema.json +152 -0
- package/skills/archify/schemas/class.schema.json +345 -0
- package/skills/archify/schemas/common.schema.json +181 -0
- package/skills/archify/schemas/dataflow.schema.json +254 -0
- package/skills/archify/schemas/erd.schema.json +381 -0
- package/skills/archify/schemas/explainer.schema.json +927 -0
- package/skills/archify/schemas/lifecycle.schema.json +179 -0
- package/skills/archify/schemas/sequence.schema.json +234 -0
- package/skills/archify/schemas/timeline.schema.json +160 -0
- package/skills/archify/schemas/tree.schema.json +141 -0
- package/skills/archify/schemas/waterfall.schema.json +147 -0
- package/skills/archify/schemas/workflow.schema.json +439 -0
- package/skills/archify/scripts/check-render-output.mjs +1469 -0
- package/skills/archify/scripts/check-update.mjs +1717 -0
- package/skills/archify/scripts/delivery-update-child.mjs +26 -0
- package/skills/archify/scripts/render-examples.mjs +36 -0
- package/skills/archify/scripts/update-contract.mjs +187 -0
- package/skills/archify/skill-release.json +10 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
|
|
4
|
+
const OPENERS = {
|
|
5
|
+
darwin: {
|
|
6
|
+
command: 'open',
|
|
7
|
+
method: 'open',
|
|
8
|
+
timeoutMs: 5000,
|
|
9
|
+
args: (target) => [target],
|
|
10
|
+
},
|
|
11
|
+
linux: {
|
|
12
|
+
command: 'xdg-open',
|
|
13
|
+
method: 'xdg-open',
|
|
14
|
+
timeoutMs: 5000,
|
|
15
|
+
args: (target) => [target],
|
|
16
|
+
},
|
|
17
|
+
win32: {
|
|
18
|
+
command: 'powershell.exe',
|
|
19
|
+
method: 'powershell',
|
|
20
|
+
// PowerShell cold starts can approach five seconds on hosted Windows
|
|
21
|
+
// runners. Keep the launch bounded without treating normal startup as a
|
|
22
|
+
// timeout.
|
|
23
|
+
timeoutMs: 15000,
|
|
24
|
+
// Keep the command constant and pass the target through a child-only
|
|
25
|
+
// environment variable. Paths are never interpolated into executable source.
|
|
26
|
+
args: () => [
|
|
27
|
+
'-NoProfile',
|
|
28
|
+
'-NonInteractive',
|
|
29
|
+
'-Command',
|
|
30
|
+
'Start-Process -FilePath $env:ARCHIFY_OPEN_TARGET',
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
function failureDetails(result, opener, timeoutMs) {
|
|
36
|
+
const error = result?.error;
|
|
37
|
+
if (error?.code === 'ENOENT') {
|
|
38
|
+
return {
|
|
39
|
+
code: 'opener/unavailable',
|
|
40
|
+
reason: `Could not find ${opener.command}. Install or enable the platform opener, then open the target manually.`,
|
|
41
|
+
systemCode: 'ENOENT',
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
if (error?.code === 'ETIMEDOUT') {
|
|
45
|
+
return {
|
|
46
|
+
code: 'opener/timeout',
|
|
47
|
+
reason: `${opener.command} did not finish within ${timeoutMs}ms. Open the target manually or retry when the system is less busy.`,
|
|
48
|
+
systemCode: 'ETIMEDOUT',
|
|
49
|
+
timeoutMs,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
if (error) {
|
|
53
|
+
return {
|
|
54
|
+
code: 'opener/spawn-failed',
|
|
55
|
+
reason: error.message || `${opener.command} could not be started. Open the target manually.`,
|
|
56
|
+
...(error.code ? { systemCode: String(error.code) } : {}),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
if (result?.signal) {
|
|
60
|
+
return {
|
|
61
|
+
code: 'opener/signaled',
|
|
62
|
+
reason: `${opener.command} was terminated by ${result.signal}. Open the target manually.`,
|
|
63
|
+
signal: result.signal,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
if (result?.status !== 0) {
|
|
67
|
+
return {
|
|
68
|
+
code: 'opener/nonzero-exit',
|
|
69
|
+
reason: `${opener.command} exited with status ${result?.status ?? 'unknown'}. Open the target manually.`,
|
|
70
|
+
exitCode: result?.status ?? null,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function launchTimeout(value, fallback) {
|
|
77
|
+
return Number.isSafeInteger(value) && value > 0 ? value : fallback;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function launchTarget(target, options = {}) {
|
|
81
|
+
const platform = options.platform || process.platform;
|
|
82
|
+
const opener = OPENERS[platform];
|
|
83
|
+
if (!opener) {
|
|
84
|
+
return {
|
|
85
|
+
requested: true,
|
|
86
|
+
status: 'unsupported',
|
|
87
|
+
target,
|
|
88
|
+
method: null,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const spawn = options.spawn || spawnSync;
|
|
93
|
+
const timeoutMs = launchTimeout(options.timeoutMs, opener.timeoutMs);
|
|
94
|
+
let result;
|
|
95
|
+
try {
|
|
96
|
+
const spawnOptions = {
|
|
97
|
+
encoding: 'utf8',
|
|
98
|
+
shell: false,
|
|
99
|
+
stdio: 'ignore',
|
|
100
|
+
timeout: timeoutMs,
|
|
101
|
+
windowsHide: true,
|
|
102
|
+
};
|
|
103
|
+
if (platform === 'win32') {
|
|
104
|
+
spawnOptions.env = {
|
|
105
|
+
...process.env,
|
|
106
|
+
ARCHIFY_OPEN_TARGET: target,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
result = spawn(opener.command, opener.args(target), spawnOptions);
|
|
110
|
+
} catch (error) {
|
|
111
|
+
result = { error };
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const failure = failureDetails(result, opener, timeoutMs);
|
|
115
|
+
let status = 'opened';
|
|
116
|
+
if (failure?.code === 'opener/unavailable') status = 'unsupported';
|
|
117
|
+
else if (failure) status = 'failed';
|
|
118
|
+
|
|
119
|
+
return {
|
|
120
|
+
requested: true,
|
|
121
|
+
status,
|
|
122
|
+
target,
|
|
123
|
+
method: opener.method,
|
|
124
|
+
...(failure ? { failure } : {}),
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export function openArtifact(target, options = {}) {
|
|
129
|
+
return launchTarget(path.resolve(target), options);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export function openLoopbackUrl(target, options = {}) {
|
|
133
|
+
let url;
|
|
134
|
+
try {
|
|
135
|
+
url = new URL(target);
|
|
136
|
+
} catch {
|
|
137
|
+
throw new TypeError('Preview URL must be a valid loopback HTTP URL.');
|
|
138
|
+
}
|
|
139
|
+
if (url.protocol !== 'http:' || url.hostname !== '127.0.0.1' || !url.port) {
|
|
140
|
+
throw new TypeError('Preview URL must be a loopback URL using http://127.0.0.1:<port>.');
|
|
141
|
+
}
|
|
142
|
+
if (url.username || url.password || url.pathname !== '/' || url.search || url.hash) {
|
|
143
|
+
throw new TypeError('Preview URL must target the loopback preview root.');
|
|
144
|
+
}
|
|
145
|
+
return launchTarget(url.href, options);
|
|
146
|
+
}
|