@dotobokuri/fleet-console 1.59.0 → 1.61.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/AGENTS.md +1 -1
- package/dist/cli.d.ts +13 -2
- package/dist/cli.mjs +126 -30
- package/dist/client/assets/{_baseUniq-CKkDoWU8.js → _baseUniq-9W447fNf.js} +1 -1
- package/dist/client/assets/{arc-CcRdX8oF.js → arc-hoitnVWi.js} +1 -1
- package/dist/client/assets/{architectureDiagram-Q4EWVU46-gaFzE1W7.js → architectureDiagram-Q4EWVU46-DYd58Vfc.js} +1 -1
- package/dist/client/assets/{blockDiagram-DXYQGD6D-Bzybih30.js → blockDiagram-DXYQGD6D-kuFqPdP_.js} +1 -1
- package/dist/client/assets/{c4Diagram-AHTNJAMY-Dz8bwV9j.js → c4Diagram-AHTNJAMY-C7n41zCn.js} +1 -1
- package/dist/client/assets/channel-D2TsEFjE.js +1 -0
- package/dist/client/assets/{chunk-4BX2VUAB-DmgZtGyV.js → chunk-4BX2VUAB-DrHeb54-.js} +1 -1
- package/dist/client/assets/{chunk-4TB4RGXK-DX1WxV3U.js → chunk-4TB4RGXK-DFjT6kwT.js} +1 -1
- package/dist/client/assets/{chunk-55IACEB6-Bk4b3T9u.js → chunk-55IACEB6-DxEzuA7W.js} +1 -1
- package/dist/client/assets/{chunk-EDXVE4YY-BzGadfvT.js → chunk-EDXVE4YY-aAlF0YEo.js} +1 -1
- package/dist/client/assets/{chunk-FMBD7UC4-44f7YyvW.js → chunk-FMBD7UC4-DwqRMFL1.js} +1 -1
- package/dist/client/assets/{chunk-OYMX7WX6-CyUAky9W.js → chunk-OYMX7WX6-DCkUlaRi.js} +1 -1
- package/dist/client/assets/{chunk-QZHKN3VN-C11OUntR.js → chunk-QZHKN3VN-B1Dx8Zhl.js} +1 -1
- package/dist/client/assets/{chunk-YZCP3GAM-DVTmWawU.js → chunk-YZCP3GAM-J2bgJmn-.js} +1 -1
- package/dist/client/assets/classDiagram-6PBFFD2Q-DhjJiPic.js +1 -0
- package/dist/client/assets/classDiagram-v2-HSJHXN6E-DhjJiPic.js +1 -0
- package/dist/client/assets/clone-DwVC2-Mi.js +1 -0
- package/dist/client/assets/{cose-bilkent-S5V4N54A-CEatGsZv.js → cose-bilkent-S5V4N54A-BxzLzyJp.js} +1 -1
- package/dist/client/assets/{dagre-KV5264BT-DlrgN02H.js → dagre-KV5264BT-D1ixDJxZ.js} +1 -1
- package/dist/client/assets/{diagram-5BDNPKRD-BZ3hRO5t.js → diagram-5BDNPKRD-DZPIz1Pa.js} +1 -1
- package/dist/client/assets/{diagram-G4DWMVQ6-B-izS46x.js → diagram-G4DWMVQ6-Pbcr-a5H.js} +1 -1
- package/dist/client/assets/{diagram-MMDJMWI5-Cw-wnJGs.js → diagram-MMDJMWI5-CBssBmPY.js} +1 -1
- package/dist/client/assets/{diagram-TYMM5635-BoWnyd4_.js → diagram-TYMM5635-cVQUs6jp.js} +1 -1
- package/dist/client/assets/{erDiagram-SMLLAGMA-BUmyXZbP.js → erDiagram-SMLLAGMA-ChMSAXos.js} +1 -1
- package/dist/client/assets/{flowDiagram-DWJPFMVM-COS3kjS0.js → flowDiagram-DWJPFMVM-FEIrU5mu.js} +1 -1
- package/dist/client/assets/{ganttDiagram-T4ZO3ILL-BTr1fdio.js → ganttDiagram-T4ZO3ILL-D6ELHTJY.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-UUTBAWPF-BkGkaosN.js → gitGraphDiagram-UUTBAWPF-DTJ6HgV4.js} +1 -1
- package/dist/client/assets/{graph-DmbgK-mH.js → graph-uscjDdHm.js} +1 -1
- package/dist/client/assets/index-DMjY1OQ0.js +465 -0
- package/dist/client/assets/index-Ec4RaE0g.css +1 -0
- package/dist/client/assets/{infoDiagram-42DDH7IO-B8zI6k1l.js → infoDiagram-42DDH7IO-C2AlA___.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-UXIWVN3A-cIcEzrcK.js → ishikawaDiagram-UXIWVN3A-BZGfIhBp.js} +1 -1
- package/dist/client/assets/{journeyDiagram-VCZTEJTY-DhuabHCk.js → journeyDiagram-VCZTEJTY-DnGNMdvj.js} +1 -1
- package/dist/client/assets/{kanban-definition-6JOO6SKY-uHTkqxhX.js → kanban-definition-6JOO6SKY-BkuplZGR.js} +1 -1
- package/dist/client/assets/{layout-Cfgk_duA.js → layout-BBayH8iU.js} +1 -1
- package/dist/client/assets/{linear-BKvV0sr5.js → linear-BQvaHed0.js} +1 -1
- package/dist/client/assets/{mermaid.core-DozmrCuG.js → mermaid.core-CO0f3d6Y.js} +4 -4
- package/dist/client/assets/{min-ke46otlW.js → min-B610GdeY.js} +1 -1
- package/dist/client/assets/{mindmap-definition-QFDTVHPH-d7xzxhzf.js → mindmap-definition-QFDTVHPH-gwkhgCyj.js} +1 -1
- package/dist/client/assets/{pieDiagram-DEJITSTG-C4S9Jy5A.js → pieDiagram-DEJITSTG-DYU2zgk8.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-34T5L4WZ-CoQnj3kv.js → quadrantDiagram-34T5L4WZ-B5Vkk65i.js} +1 -1
- package/dist/client/assets/{requirementDiagram-MS252O5E-CdopMDtg.js → requirementDiagram-MS252O5E-D4EcF7kq.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-XADWPNL6-DdR4zdh4.js → sankeyDiagram-XADWPNL6-DFk-RMV4.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-FGHM5R23-NeYZWVQm.js → sequenceDiagram-FGHM5R23-B-beo9e0.js} +1 -1
- package/dist/client/assets/{stateDiagram-FHFEXIEX-D0CQGKV_.js → stateDiagram-FHFEXIEX-VDT0TOd7.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-wHPBl_p1.js +1 -0
- package/dist/client/assets/{timeline-definition-GMOUNBTQ-Bz2b3nfQ.js → timeline-definition-GMOUNBTQ-By4DMNqG.js} +1 -1
- package/dist/client/assets/{vennDiagram-DHZGUBPP-CVO2Ja80.js → vennDiagram-DHZGUBPP-DzlBrijd.js} +1 -1
- package/dist/client/assets/{wardley-RL74JXVD-Ba_GKs5u.js → wardley-RL74JXVD-BHSHTMU6.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-NUSXRM2D-yP3xvrPy.js → wardleyDiagram-NUSXRM2D-COB-cWHQ.js} +1 -1
- package/dist/client/assets/{xychartDiagram-5P7HB3ND-BLSs6w4C.js → xychartDiagram-5P7HB3ND-C-GVSBHd.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/fleet-plugins/file-explorer/routes.mjs +132 -13
- package/dist/fleet-plugins/ledger/routes.mjs +223 -16
- package/dist/fleet-plugins/quota/routes.mjs +33 -2
- package/dist/fleet-plugins/scuttlebutt/routes.mjs +5 -5
- package/dist/fleet-plugins/terminal/routes.mjs +653 -79
- package/dist/fleet.mjs +383 -66
- package/package.json +1 -1
- package/dist/client/assets/channel-CAhLkt5l.js +0 -1
- package/dist/client/assets/classDiagram-6PBFFD2Q-BSvLoE2t.js +0 -1
- package/dist/client/assets/classDiagram-v2-HSJHXN6E-BSvLoE2t.js +0 -1
- package/dist/client/assets/clone-o26VS_sk.js +0 -1
- package/dist/client/assets/index-C-3spb_b.js +0 -465
- package/dist/client/assets/index-FU1PGEfG.css +0 -1
- package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-hM1GV37r.js +0 -1
package/AGENTS.md
CHANGED
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
|
|
43
43
|
## Design invariants
|
|
44
44
|
|
|
45
|
-
- Every color speaks on exactly one channel: signal tokens (`aurora`/`warn`/`coral`/`positive`) carry state only, `brass` carries location/focus/hover only, and user or agent identity uses the `--id-*` tones painted exclusively
|
|
45
|
+
- Every color speaks on exactly one channel: signal tokens (`aurora`/`warn`/`coral`/`positive`) carry state only, `brass` carries location/focus/hover only, and user or agent identity uses the `--id-*` tones painted exclusively as marks (caption nameplate, rail-chip spine, minimap dot) — borders stay state-owned and identity never repaints signal surfaces or the unfocused caption fill.
|
|
46
46
|
- Core and built-in plugin CSS consume colors only as theme tokens via `var()`/`color-mix`; chromatic raw literals live solely in `theme.css` token definitions so all three themes retune together. Near-achromatic shadow, scrim, and sheen literals that carry depth rather than hue are the sanctioned exception.
|
|
47
47
|
- `tests/instrument-design-contract.test.ts` pins the design grammar: a legitimate grammar change updates the contract together with the change, and intentional exceptions are recorded as doctrine comments beside the exempted CSS rule.
|
|
48
48
|
|
package/dist/cli.d.ts
CHANGED
|
@@ -30,13 +30,21 @@ interface ConsoleHealth {
|
|
|
30
30
|
readonly workspaceCount: number;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
/**
|
|
34
|
+
* 브라우저 실행기가 실제로 떴는지에 대한 답. 실패를 삼키면 CLI가 "열었다"고 말한 뒤
|
|
35
|
+
* 아무것도 뜨지 않는 화면만 남으므로, 이 결과는 호출자가 사용자에게 전할 사실이다.
|
|
36
|
+
*/
|
|
37
|
+
interface BrowserOpenResult {
|
|
38
|
+
readonly opened: boolean;
|
|
39
|
+
readonly reason?: string;
|
|
40
|
+
}
|
|
33
41
|
interface OpenBrowserDeps {
|
|
34
42
|
readonly platform?: NodeJS.Platform;
|
|
35
43
|
readonly spawnBrowser?: (command: string, args: readonly string[], options: {
|
|
36
44
|
readonly detached: true;
|
|
37
45
|
readonly stdio: "ignore";
|
|
38
46
|
readonly windowsHide: true;
|
|
39
|
-
}) => void
|
|
47
|
+
}) => void | Promise<BrowserOpenResult>;
|
|
40
48
|
}
|
|
41
49
|
|
|
42
50
|
interface ConsoleProbeResult {
|
|
@@ -68,10 +76,13 @@ interface ConsoleDaemonLifecycleDeps {
|
|
|
68
76
|
}
|
|
69
77
|
interface OpenFleetConsoleDeps {
|
|
70
78
|
readonly lifecycle?: Pick<ReturnType<typeof createConsoleDaemonLifecycle>, "ensureDaemon" | "probe">;
|
|
71
|
-
readonly openBrowser?: (url: string, deps?: OpenBrowserDeps) => void
|
|
79
|
+
readonly openBrowser?: (url: string, deps?: OpenBrowserDeps) => void | Promise<BrowserOpenResult>;
|
|
72
80
|
}
|
|
73
81
|
interface OpenFleetConsoleResult {
|
|
74
82
|
readonly url: string;
|
|
83
|
+
/** 브라우저 실행기가 실제로 떴는지. 거짓이면 호출자가 주소를 사용자에게 직접 건네야 한다. */
|
|
84
|
+
readonly browserOpened: boolean;
|
|
85
|
+
readonly browserError?: string;
|
|
75
86
|
}
|
|
76
87
|
interface ConsoleStatusDeps {
|
|
77
88
|
readonly lifecycle?: Pick<ReturnType<typeof createConsoleDaemonLifecycle>, "probe">;
|
package/dist/cli.mjs
CHANGED
|
@@ -125,23 +125,88 @@ function withNodeSystemCa(env) {
|
|
|
125
125
|
if (!hasExplicitValue) next[NODE_USE_SYSTEM_CA_ENV] = "1";
|
|
126
126
|
return next;
|
|
127
127
|
}
|
|
128
|
+
var SPAWN_GRACE_MS = 250;
|
|
128
129
|
function openBrowser(url2, deps = {}) {
|
|
129
130
|
const platform = deps.platform ?? os4__default.platform();
|
|
130
|
-
const spawnBrowser = deps.spawnBrowser ??
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
const spawnBrowser = deps.spawnBrowser ?? defaultSpawnBrowser;
|
|
132
|
+
const options = { detached: true, stdio: "ignore", windowsHide: true };
|
|
133
|
+
if (platform === "darwin") return normalize(spawnBrowser("open", [url2], options));
|
|
134
|
+
if (platform === "win32") return normalize(spawnBrowser("cmd", ["/c", "start", "", url2], options));
|
|
135
|
+
return normalize(spawnBrowser("xdg-open", [url2], options));
|
|
136
|
+
}
|
|
137
|
+
async function normalize(result) {
|
|
138
|
+
const resolved = await result;
|
|
139
|
+
return resolved ?? { opened: true };
|
|
140
|
+
}
|
|
141
|
+
function defaultSpawnBrowser(command2, args, options) {
|
|
142
|
+
return new Promise((resolve3) => {
|
|
143
|
+
let child;
|
|
144
|
+
try {
|
|
145
|
+
child = spawn(command2, [...args], options);
|
|
146
|
+
} catch (error51) {
|
|
147
|
+
resolve3({ opened: false, reason: describe(error51, command2) });
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
const timer = setTimeout(() => {
|
|
151
|
+
child.unref();
|
|
152
|
+
resolve3({ opened: true });
|
|
153
|
+
}, SPAWN_GRACE_MS);
|
|
154
|
+
child.once("error", (error51) => {
|
|
155
|
+
clearTimeout(timer);
|
|
156
|
+
child.unref();
|
|
157
|
+
resolve3({ opened: false, reason: describe(error51, command2) });
|
|
158
|
+
});
|
|
159
|
+
child.once("exit", (code) => {
|
|
160
|
+
clearTimeout(timer);
|
|
161
|
+
child.unref();
|
|
162
|
+
if (code === null || code === 0) resolve3({ opened: true });
|
|
163
|
+
else resolve3({ opened: false, reason: `${command2} exited with status ${code}` });
|
|
133
164
|
});
|
|
134
|
-
child.unref();
|
|
135
165
|
});
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
if (
|
|
141
|
-
|
|
142
|
-
|
|
166
|
+
}
|
|
167
|
+
function describe(error51, command2) {
|
|
168
|
+
const code = error51?.code;
|
|
169
|
+
if (code === "ENOENT") return `${command2} is not on PATH`;
|
|
170
|
+
if (code === "EACCES") return `${command2} is not executable`;
|
|
171
|
+
return error51 instanceof Error ? error51.message : String(error51);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// core/host/failure-notice.ts
|
|
175
|
+
function formatFailureNotice(notice) {
|
|
176
|
+
const lines = [notice.what, ` Why ${notice.why}`];
|
|
177
|
+
notice.next.forEach((step, index) => {
|
|
178
|
+
lines.push(` ${index === 0 ? "Next " : " "} ${step}`);
|
|
179
|
+
});
|
|
180
|
+
return lines.join("\n");
|
|
181
|
+
}
|
|
182
|
+
function describeConsoleLaunch(successLine, outcome) {
|
|
183
|
+
if (outcome.browserOpened) return successLine;
|
|
184
|
+
return formatFailureNotice({
|
|
185
|
+
what: "Fleet Console is running, but no browser opened on this machine.",
|
|
186
|
+
why: outcome.browserError ?? "the browser launcher did not start",
|
|
187
|
+
next: [`Open this address yourself: ${outcome.url}`]
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
function describeDaemonStartFailure(input) {
|
|
191
|
+
if (input.spawnError) {
|
|
192
|
+
return formatFailureNotice({
|
|
193
|
+
what: "Fleet Console server did not start.",
|
|
194
|
+
why: `the server process could not be spawned \u2014 ${input.spawnError}`,
|
|
195
|
+
next: [
|
|
196
|
+
"Check that this Node install can run the Console: node --version",
|
|
197
|
+
"Reinstall if the package is incomplete: npm install -g @dotobokuri/fleet-console"
|
|
198
|
+
]
|
|
199
|
+
});
|
|
143
200
|
}
|
|
144
|
-
|
|
201
|
+
return formatFailureNotice({
|
|
202
|
+
what: "Fleet Console server did not start.",
|
|
203
|
+
why: input.probeError ? `it was started but never answered a health check \u2014 ${input.probeError}` : "it was started but never answered a health check within 3 seconds",
|
|
204
|
+
next: [
|
|
205
|
+
`Check that this directory is writable: ${input.dataDir}`,
|
|
206
|
+
"Show the current state: fleet console status",
|
|
207
|
+
"Then try again: fleet console restart"
|
|
208
|
+
]
|
|
209
|
+
});
|
|
145
210
|
}
|
|
146
211
|
|
|
147
212
|
// core/host/health.ts
|
|
@@ -16147,7 +16212,7 @@ __export(external_exports, {
|
|
|
16147
16212
|
date: () => date3,
|
|
16148
16213
|
decode: () => decode2,
|
|
16149
16214
|
decodeAsync: () => decodeAsync2,
|
|
16150
|
-
describe: () =>
|
|
16215
|
+
describe: () => describe3,
|
|
16151
16216
|
discriminatedUnion: () => discriminatedUnion,
|
|
16152
16217
|
e164: () => e1642,
|
|
16153
16218
|
email: () => email2,
|
|
@@ -16525,7 +16590,7 @@ __export(core_exports2, {
|
|
|
16525
16590
|
createToJSONSchemaMethod: () => createToJSONSchemaMethod,
|
|
16526
16591
|
decode: () => decode,
|
|
16527
16592
|
decodeAsync: () => decodeAsync,
|
|
16528
|
-
describe: () =>
|
|
16593
|
+
describe: () => describe2,
|
|
16529
16594
|
encode: () => encode,
|
|
16530
16595
|
encodeAsync: () => encodeAsync,
|
|
16531
16596
|
extractDefs: () => extractDefs,
|
|
@@ -27341,7 +27406,7 @@ function _check(fn, params) {
|
|
|
27341
27406
|
return ch;
|
|
27342
27407
|
}
|
|
27343
27408
|
// @__NO_SIDE_EFFECTS__
|
|
27344
|
-
function
|
|
27409
|
+
function describe2(description) {
|
|
27345
27410
|
const ch = new $ZodCheck({ check: "describe" });
|
|
27346
27411
|
ch._zod.onattach = [
|
|
27347
27412
|
(inst) => {
|
|
@@ -28497,7 +28562,7 @@ __export(schemas_exports2, {
|
|
|
28497
28562
|
cuid2: () => cuid22,
|
|
28498
28563
|
custom: () => custom,
|
|
28499
28564
|
date: () => date3,
|
|
28500
|
-
describe: () =>
|
|
28565
|
+
describe: () => describe3,
|
|
28501
28566
|
discriminatedUnion: () => discriminatedUnion,
|
|
28502
28567
|
e164: () => e1642,
|
|
28503
28568
|
email: () => email2,
|
|
@@ -29948,7 +30013,7 @@ function refine(fn, _params = {}) {
|
|
|
29948
30013
|
function superRefine(fn, params) {
|
|
29949
30014
|
return _superRefine(fn, params);
|
|
29950
30015
|
}
|
|
29951
|
-
var
|
|
30016
|
+
var describe3 = describe2;
|
|
29952
30017
|
var meta2 = meta;
|
|
29953
30018
|
function _instanceof(cls, params = {}) {
|
|
29954
30019
|
const inst = new ZodCustom({
|
|
@@ -38158,11 +38223,12 @@ var SDK_API_VERSION = 1;
|
|
|
38158
38223
|
var SHIM_NAMED_EXPORTS = {
|
|
38159
38224
|
"react": ["Activity", "Children", "Component", "Fragment", "Profiler", "PureComponent", "StrictMode", "Suspense", "__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE", "__COMPILER_RUNTIME", "act", "cache", "cacheSignal", "captureOwnerStack", "cloneElement", "createContext", "createElement", "createRef", "forwardRef", "isValidElement", "lazy", "memo", "startTransition", "unstable_useCacheRefresh", "use", "useActionState", "useCallback", "useContext", "useDebugValue", "useDeferredValue", "useEffect", "useEffectEvent", "useId", "useImperativeHandle", "useInsertionEffect", "useLayoutEffect", "useMemo", "useOptimistic", "useReducer", "useRef", "useState", "useSyncExternalStore", "useTransition", "version"],
|
|
38160
38225
|
"react/jsx-runtime": ["Fragment", "jsx", "jsxs"],
|
|
38161
|
-
"@fleet-console/sdk/plugin/browser": ["React", "createClientCapabilities", "defineOperationKind", "definePlugin", "
|
|
38226
|
+
"@fleet-console/sdk/plugin/browser": ["React", "createClientCapabilities", "defineOperationKind", "definePlugin", "useOperationRuntime", "useOperationRuntimeHydration", "useOperations", "usePluginApi", "usePluginSettings", "usePluginStorage", "useStoreSnapshot"],
|
|
38162
38227
|
"@fleet-console/sdk/settings/browser": ["ExperimentalBadge", "SettingsCard", "SettingsField", "SettingsRow", "SettingsSelect", "SettingsToggle", "defineSettingsSection"],
|
|
38163
38228
|
"@fleet-console/sdk/operations/browser": ["ApiError", "OperationBody", "assertOperationNode", "fetchOperationCatalog", "hasForbiddenBrowserPayloadKey"],
|
|
38164
38229
|
"@fleet-console/sdk/notifications/browser": ["defineNotificationKind"],
|
|
38165
|
-
"@fleet-console/sdk/react/browser": ["PluginErrorBoundary", "React", "Select", "useSelect"]
|
|
38230
|
+
"@fleet-console/sdk/react/browser": ["PluginErrorBoundary", "React", "Select", "useSelect"],
|
|
38231
|
+
"@fleet-console/sdk/components/failure-notice": ["FailureNotice"]
|
|
38166
38232
|
};
|
|
38167
38233
|
|
|
38168
38234
|
// core/host/plugin-host/plugin-host.ts
|
|
@@ -38295,7 +38361,8 @@ var SHIM_DEFINITIONS = [
|
|
|
38295
38361
|
{ name: "sdk-settings-browser", specifier: "@fleet-console/sdk/settings/browser", globalKey: "@fleet-console/sdk/settings/browser", namedExports: SHIM_NAMED_EXPORTS["@fleet-console/sdk/settings/browser"] ?? [] },
|
|
38296
38362
|
{ name: "sdk-operations-browser", specifier: "@fleet-console/sdk/operations/browser", globalKey: "@fleet-console/sdk/operations/browser", namedExports: SHIM_NAMED_EXPORTS["@fleet-console/sdk/operations/browser"] ?? [] },
|
|
38297
38363
|
{ name: "sdk-notifications-browser", specifier: "@fleet-console/sdk/notifications/browser", globalKey: "@fleet-console/sdk/notifications/browser", namedExports: SHIM_NAMED_EXPORTS["@fleet-console/sdk/notifications/browser"] ?? [] },
|
|
38298
|
-
{ name: "sdk-react-browser", specifier: "@fleet-console/sdk/react/browser", globalKey: "@fleet-console/sdk/react/browser", namedExports: SHIM_NAMED_EXPORTS["@fleet-console/sdk/react/browser"] ?? [] }
|
|
38364
|
+
{ name: "sdk-react-browser", specifier: "@fleet-console/sdk/react/browser", globalKey: "@fleet-console/sdk/react/browser", namedExports: SHIM_NAMED_EXPORTS["@fleet-console/sdk/react/browser"] ?? [] },
|
|
38365
|
+
{ name: "sdk-components-failure-notice", specifier: "@fleet-console/sdk/components/failure-notice", globalKey: "@fleet-console/sdk/components/failure-notice", namedExports: SHIM_NAMED_EXPORTS["@fleet-console/sdk/components/failure-notice"] ?? [] }
|
|
38299
38366
|
];
|
|
38300
38367
|
var SHIM_URL_BY_SPECIFIER = new Map(SHIM_DEFINITIONS.map((definition) => [definition.specifier, `/plugin-runtime/shim/${definition.name}.mjs`]));
|
|
38301
38368
|
var SHIM_BY_NAME = new Map(SHIM_DEFINITIONS.map((definition) => [definition.name, definition]));
|
|
@@ -38306,9 +38373,11 @@ var NODE_BUILTINS = /* @__PURE__ */ new Set([
|
|
|
38306
38373
|
function createPluginClientAssets(deps) {
|
|
38307
38374
|
const clientSources = /* @__PURE__ */ new Map();
|
|
38308
38375
|
const preparedPlugins = /* @__PURE__ */ new Set();
|
|
38376
|
+
const skippedPlugins = /* @__PURE__ */ new Map();
|
|
38309
38377
|
async function prepare() {
|
|
38310
38378
|
clientSources.clear();
|
|
38311
38379
|
preparedPlugins.clear();
|
|
38380
|
+
skippedPlugins.clear();
|
|
38312
38381
|
for (const plugin of deps.plugins) {
|
|
38313
38382
|
if (!plugin.external || !plugin.clientEntry) continue;
|
|
38314
38383
|
try {
|
|
@@ -38317,17 +38386,24 @@ function createPluginClientAssets(deps) {
|
|
|
38317
38386
|
preparedPlugins.add(plugin.manifest.id);
|
|
38318
38387
|
} catch (error51) {
|
|
38319
38388
|
console.warn(`[fleet-console] Plugin ${plugin.manifest.id} client skipped: ${error51 instanceof Error ? error51.message : String(error51)}`);
|
|
38389
|
+
skippedPlugins.set(plugin.manifest.id, {
|
|
38390
|
+
id: plugin.manifest.id,
|
|
38391
|
+
...plugin.manifest.name ? { name: plugin.manifest.name } : {},
|
|
38392
|
+
reason: error51?.message === "unsupported_client_entry" ? "unsupported_client_entry" : "client_build_failed"
|
|
38393
|
+
});
|
|
38320
38394
|
}
|
|
38321
38395
|
}
|
|
38322
38396
|
}
|
|
38323
38397
|
function manifest() {
|
|
38398
|
+
const skipped = [...skippedPlugins.values()];
|
|
38324
38399
|
return {
|
|
38325
38400
|
plugins: deps.plugins.filter((plugin) => plugin.external && !!plugin.clientEntry && preparedPlugins.has(plugin.manifest.id)).map((plugin) => ({
|
|
38326
38401
|
id: plugin.manifest.id,
|
|
38327
38402
|
...plugin.manifest.name ? { name: plugin.manifest.name } : {},
|
|
38328
38403
|
clientUrl: `/plugin-runtime/client/${plugin.manifest.id}.mjs`,
|
|
38329
38404
|
apiVersion: plugin.manifest.apiVersion ?? SDK_API_VERSION
|
|
38330
|
-
}))
|
|
38405
|
+
})),
|
|
38406
|
+
...skipped.length > 0 ? { skipped } : {}
|
|
38331
38407
|
};
|
|
38332
38408
|
}
|
|
38333
38409
|
function getClient(id) {
|
|
@@ -41866,15 +41942,25 @@ function isValidConsoleStaticPort2(value) {
|
|
|
41866
41942
|
function sanitizeLaunchKind(value) {
|
|
41867
41943
|
if (!isPlainObject2(value) || typeof value.id !== "string" || typeof value.type !== "string" || typeof value.title !== "string") return null;
|
|
41868
41944
|
const variants = readLaunchVariantGroups(value.variants);
|
|
41945
|
+
const launchViews = readLaunchViews(value.launchViews);
|
|
41869
41946
|
return {
|
|
41870
41947
|
id: value.id,
|
|
41871
41948
|
type: value.type,
|
|
41872
41949
|
title: value.title,
|
|
41873
41950
|
...typeof value.disabled === "boolean" ? { disabled: value.disabled } : {},
|
|
41874
41951
|
...typeof value.disabledReason === "string" ? { disabledReason: value.disabledReason } : {},
|
|
41875
|
-
...variants.length > 0 ? { variants } : {}
|
|
41952
|
+
...variants.length > 0 ? { variants } : {},
|
|
41953
|
+
...launchViews.length > 0 ? { launchViews } : {}
|
|
41876
41954
|
};
|
|
41877
41955
|
}
|
|
41956
|
+
function readLaunchViews(value) {
|
|
41957
|
+
if (!Array.isArray(value)) return [];
|
|
41958
|
+
const seen = /* @__PURE__ */ new Set();
|
|
41959
|
+
for (const entry of value) {
|
|
41960
|
+
if (entry === "terminal" || entry === "chat") seen.add(entry);
|
|
41961
|
+
}
|
|
41962
|
+
return seen.has("chat") ? [...seen] : [];
|
|
41963
|
+
}
|
|
41878
41964
|
function requestHasBody(req) {
|
|
41879
41965
|
const contentLength = req.headers["content-length"];
|
|
41880
41966
|
if (typeof contentLength === "string" && contentLength !== "0") return true;
|
|
@@ -42071,9 +42157,11 @@ function createConsoleDaemonLifecycle(deps = {}) {
|
|
|
42071
42157
|
const childEnv = env.FLEET_CONSOLE_NO_SYSTEM_CA === "1" ? env : withNodeSystemCa(env);
|
|
42072
42158
|
const execPath = deps.execPath ?? process4.execPath;
|
|
42073
42159
|
const serverModulePath = deps.serverModulePath ?? resolveDefaultServerModulePath2();
|
|
42160
|
+
let lastSpawnError = null;
|
|
42074
42161
|
const spawnDetached = deps.spawnDetached ?? ((bin, args, options) => {
|
|
42075
42162
|
const child = spawn(bin, [...args], options);
|
|
42076
|
-
child.once("error", () => {
|
|
42163
|
+
child.once("error", (error51) => {
|
|
42164
|
+
lastSpawnError = error51 instanceof Error ? error51.message : String(error51);
|
|
42077
42165
|
});
|
|
42078
42166
|
child.unref();
|
|
42079
42167
|
});
|
|
@@ -42126,13 +42214,20 @@ function createConsoleDaemonLifecycle(deps = {}) {
|
|
|
42126
42214
|
if (typeof probeResult.health?.workspaceCount === "number" && probeResult.health.workspaceCount > 0) return current.endpoint;
|
|
42127
42215
|
}
|
|
42128
42216
|
if (current) await stop();
|
|
42217
|
+
lastSpawnError = null;
|
|
42129
42218
|
spawnDetached(execPath, [serverModulePath, "serve"], withHidden({ detached: true, env: childEnv, stdio: "ignore" }));
|
|
42219
|
+
let lastProbeError = null;
|
|
42130
42220
|
for (let i = 0; i < 30; i += 1) {
|
|
42131
42221
|
await sleep(100);
|
|
42132
42222
|
const next = await probe();
|
|
42133
42223
|
if (next.healthy && next.lock) return next.lock.endpoint;
|
|
42224
|
+
if (next.error) lastProbeError = next.error;
|
|
42134
42225
|
}
|
|
42135
|
-
throw new Error(
|
|
42226
|
+
throw new Error(describeDaemonStartFailure({
|
|
42227
|
+
spawnError: lastSpawnError,
|
|
42228
|
+
probeError: lastProbeError,
|
|
42229
|
+
dataDir: paths.dir
|
|
42230
|
+
}));
|
|
42136
42231
|
}
|
|
42137
42232
|
return { ensureDaemon, probe, runServer, stop };
|
|
42138
42233
|
function readTrustedLock(options = {}) {
|
|
@@ -42161,8 +42256,9 @@ async function openFleetConsole(deps = {}) {
|
|
|
42161
42256
|
throw new Error("Fleet Console server is not healthy after ensure");
|
|
42162
42257
|
}
|
|
42163
42258
|
const url2 = `${status.lock.endpoint}console/`;
|
|
42164
|
-
(deps.openBrowser ?? openBrowser)(url2);
|
|
42165
|
-
|
|
42259
|
+
const browser = await (deps.openBrowser ?? openBrowser)(url2);
|
|
42260
|
+
const result = browser ?? { opened: true };
|
|
42261
|
+
return result.opened ? { url: url2, browserOpened: true } : { url: url2, browserOpened: false, browserError: result.reason };
|
|
42166
42262
|
}
|
|
42167
42263
|
async function runConsoleStatus(deps = {}) {
|
|
42168
42264
|
const lifecycle = deps.lifecycle ?? createConsoleDaemonLifecycle();
|
|
@@ -42253,14 +42349,14 @@ async function main() {
|
|
|
42253
42349
|
return;
|
|
42254
42350
|
}
|
|
42255
42351
|
if (mode === "restart") {
|
|
42256
|
-
await runConsoleRestart();
|
|
42257
|
-
process4.stdout.write(
|
|
42352
|
+
const restarted = await runConsoleRestart();
|
|
42353
|
+
process4.stdout.write(`${describeConsoleLaunch("Fleet Console restarted.", restarted)}
|
|
42258
42354
|
${await runConsoleStatus()}
|
|
42259
42355
|
`);
|
|
42260
42356
|
return;
|
|
42261
42357
|
}
|
|
42262
|
-
await openFleetConsole();
|
|
42263
|
-
process4.stdout.write(
|
|
42358
|
+
const opened = await openFleetConsole();
|
|
42359
|
+
process4.stdout.write(`${describeConsoleLaunch("Fleet Console opened.", opened)}
|
|
42264
42360
|
${await runConsoleStatus()}
|
|
42265
42361
|
`);
|
|
42266
42362
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aW as L,bs as ln,aG as A,aU as P,aF as W,bt as gn,bu as dn,bv as hn,bw as z,bx as pn,bn as An,by as m,aX as N,b0 as U,b3 as T,bz as _n,a_ as on,bA as wn,bq as On,aH as V,bo as vn,bB as I}from"./mermaid.core-
|
|
1
|
+
import{aW as L,bs as ln,aG as A,aU as P,aF as W,bt as gn,bu as dn,bv as hn,bw as z,bx as pn,bn as An,by as m,aX as N,b0 as U,b3 as T,bz as _n,a_ as on,bA as wn,bq as On,aH as V,bo as vn,bB as I}from"./mermaid.core-CO0f3d6Y.js";var Pn="[object Symbol]";function x(n){return typeof n=="symbol"||L(n)&&ln(n)==Pn}function yn(n,r){for(var e=-1,i=n==null?0:n.length,f=Array(i);++e<i;)f[e]=r(n[e],e,n);return f}var B=P?P.prototype:void 0,H=B?B.toString:void 0;function k(n){if(typeof n=="string")return n;if(A(n))return yn(n,k)+"";if(x(n))return H?H.call(n):"";var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}function bn(){}function En(n,r){for(var e=-1,i=n==null?0:n.length;++e<i&&r(n[e],e,n)!==!1;);return n}function cn(n,r,e,i){for(var f=n.length,t=e+-1;++t<f;)if(r(n[t],t,n))return t;return-1}function Tn(n){return n!==n}function Rn(n,r,e){for(var i=e-1,f=n.length;++i<f;)if(n[i]===r)return i;return-1}function In(n,r,e){return r===r?Rn(n,r,e):cn(n,Tn,e)}function Sn(n,r){var e=n==null?0:n.length;return!!e&&In(n,r,0)>-1}function M(n){return W(n)?gn(n):dn(n)}var Ln=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,xn=/^\w*$/;function $(n,r){if(A(n))return!1;var e=typeof n;return e=="number"||e=="symbol"||e=="boolean"||n==null||x(n)?!0:xn.test(n)||!Ln.test(n)||r!=null&&n in Object(r)}var Mn=500;function $n(n){var r=hn(n,function(i){return e.size===Mn&&e.clear(),i}),e=r.cache;return r}var Cn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Fn=/\\(\\)?/g,Gn=$n(function(n){var r=[];return n.charCodeAt(0)===46&&r.push(""),n.replace(Cn,function(e,i,f,t){r.push(f?t.replace(Fn,"$1"):i||e)}),r});function Dn(n){return n==null?"":k(n)}function j(n,r){return A(n)?n:$(n,r)?[n]:Gn(Dn(n))}function R(n){if(typeof n=="string"||x(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}function nn(n,r){r=j(r,n);for(var e=0,i=r.length;n!=null&&e<i;)n=n[R(r[e++])];return e&&e==i?n:void 0}function mn(n,r,e){var i=n==null?void 0:nn(n,r);return i===void 0?e:i}function rn(n,r){for(var e=-1,i=r.length,f=n.length;++e<i;)n[f+e]=r[e];return n}var K=P?P.isConcatSpreadable:void 0;function Nn(n){return A(n)||z(n)||!!(K&&n&&n[K])}function Kr(n,r,e,i,f){var t=-1,s=n.length;for(e||(e=Nn),f||(f=[]);++t<s;){var u=n[t];e(u)?rn(f,u):i||(f[f.length]=u)}return f}function Un(n,r,e,i){var f=-1,t=n==null?0:n.length;for(i&&t&&(e=n[++f]);++f<t;)e=r(e,n[f],f,n);return e}function en(n,r){for(var e=-1,i=n==null?0:n.length,f=0,t=[];++e<i;){var s=n[e];r(s,e,n)&&(t[f++]=s)}return t}function Bn(){return[]}var Hn=Object.prototype,Kn=Hn.propertyIsEnumerable,q=Object.getOwnPropertySymbols,qn=q?function(n){return n==null?[]:(n=Object(n),en(q(n),function(r){return Kn.call(n,r)}))}:Bn;function Zn(n,r,e){var i=r(n);return A(n)?i:rn(i,e(n))}function Z(n){return Zn(n,M,qn)}var Xn="__lodash_hash_undefined__";function Yn(n){return this.__data__.set(n,Xn),this}function Jn(n){return this.__data__.has(n)}function y(n){var r=-1,e=n==null?0:n.length;for(this.__data__=new pn;++r<e;)this.add(n[r])}y.prototype.add=y.prototype.push=Yn;y.prototype.has=Jn;function Qn(n,r){for(var e=-1,i=n==null?0:n.length;++e<i;)if(r(n[e],e,n))return!0;return!1}function tn(n,r){return n.has(r)}var Wn=1,zn=2;function fn(n,r,e,i,f,t){var s=e&Wn,u=n.length,a=r.length;if(u!=a&&!(s&&a>u))return!1;var h=t.get(n),g=t.get(r);if(h&&g)return h==r&&g==n;var l=-1,d=!0,o=e&zn?new y:void 0;for(t.set(n,r),t.set(r,n);++l<u;){var p=n[l],_=r[l];if(i)var w=s?i(_,p,l,r,n,t):i(p,_,l,n,r,t);if(w!==void 0){if(w)continue;d=!1;break}if(o){if(!Qn(r,function(O,v){if(!tn(o,v)&&(p===O||f(p,O,e,i,t)))return o.push(v)})){d=!1;break}}else if(!(p===_||f(p,_,e,i,t))){d=!1;break}}return t.delete(n),t.delete(r),d}function Vn(n){var r=-1,e=Array(n.size);return n.forEach(function(i,f){e[++r]=[f,i]}),e}function C(n){var r=-1,e=Array(n.size);return n.forEach(function(i){e[++r]=i}),e}var kn=1,jn=2,nr="[object Boolean]",rr="[object Date]",er="[object Error]",ir="[object Map]",tr="[object Number]",fr="[object RegExp]",sr="[object Set]",ur="[object String]",ar="[object Symbol]",lr="[object ArrayBuffer]",gr="[object DataView]",X=P?P.prototype:void 0,S=X?X.valueOf:void 0;function dr(n,r,e,i,f,t,s){switch(e){case gr:if(n.byteLength!=r.byteLength||n.byteOffset!=r.byteOffset)return!1;n=n.buffer,r=r.buffer;case lr:return!(n.byteLength!=r.byteLength||!t(new m(n),new m(r)));case nr:case rr:case tr:return An(+n,+r);case er:return n.name==r.name&&n.message==r.message;case fr:case ur:return n==r+"";case ir:var u=Vn;case sr:var a=i&kn;if(u||(u=C),n.size!=r.size&&!a)return!1;var h=s.get(n);if(h)return h==r;i|=jn,s.set(n,r);var g=fn(u(n),u(r),i,f,t,s);return s.delete(n),g;case ar:if(S)return S.call(n)==S.call(r)}return!1}var hr=1,pr=Object.prototype,Ar=pr.hasOwnProperty;function _r(n,r,e,i,f,t){var s=e&hr,u=Z(n),a=u.length,h=Z(r),g=h.length;if(a!=g&&!s)return!1;for(var l=a;l--;){var d=u[l];if(!(s?d in r:Ar.call(r,d)))return!1}var o=t.get(n),p=t.get(r);if(o&&p)return o==r&&p==n;var _=!0;t.set(n,r),t.set(r,n);for(var w=s;++l<a;){d=u[l];var O=n[d],v=r[d];if(i)var D=s?i(v,O,d,r,n,t):i(O,v,d,n,r,t);if(!(D===void 0?O===v||f(O,v,e,i,t):D)){_=!1;break}w||(w=d=="constructor")}if(_&&!w){var b=n.constructor,E=r.constructor;b!=E&&"constructor"in n&&"constructor"in r&&!(typeof b=="function"&&b instanceof b&&typeof E=="function"&&E instanceof E)&&(_=!1)}return t.delete(n),t.delete(r),_}var or=1,Y="[object Arguments]",J="[object Array]",c="[object Object]",wr=Object.prototype,Q=wr.hasOwnProperty;function Or(n,r,e,i,f,t){var s=A(n),u=A(r),a=s?J:N(n),h=u?J:N(r);a=a==Y?c:a,h=h==Y?c:h;var g=a==c,l=h==c,d=a==h;if(d&&U(n)){if(!U(r))return!1;s=!0,g=!1}if(d&&!g)return t||(t=new T),s||_n(n)?fn(n,r,e,i,f,t):dr(n,r,a,e,i,f,t);if(!(e&or)){var o=g&&Q.call(n,"__wrapped__"),p=l&&Q.call(r,"__wrapped__");if(o||p){var _=o?n.value():n,w=p?r.value():r;return t||(t=new T),f(_,w,e,i,t)}}return d?(t||(t=new T),_r(n,r,e,i,f,t)):!1}function F(n,r,e,i,f){return n===r?!0:n==null||r==null||!L(n)&&!L(r)?n!==n&&r!==r:Or(n,r,e,i,F,f)}var vr=1,Pr=2;function yr(n,r,e,i){var f=e.length,t=f;if(n==null)return!t;for(n=Object(n);f--;){var s=e[f];if(s[2]?s[1]!==n[s[0]]:!(s[0]in n))return!1}for(;++f<t;){s=e[f];var u=s[0],a=n[u],h=s[1];if(s[2]){if(a===void 0&&!(u in n))return!1}else{var g=new T,l;if(!(l===void 0?F(h,a,vr|Pr,i,g):l))return!1}}return!0}function sn(n){return n===n&&!on(n)}function br(n){for(var r=M(n),e=r.length;e--;){var i=r[e],f=n[i];r[e]=[i,f,sn(f)]}return r}function un(n,r){return function(e){return e==null?!1:e[n]===r&&(r!==void 0||n in Object(e))}}function Er(n){var r=br(n);return r.length==1&&r[0][2]?un(r[0][0],r[0][1]):function(e){return e===n||yr(e,n,r)}}function cr(n,r){return n!=null&&r in Object(n)}function Tr(n,r,e){r=j(r,n);for(var i=-1,f=r.length,t=!1;++i<f;){var s=R(r[i]);if(!(t=n!=null&&e(n,s)))break;n=n[s]}return t||++i!=f?t:(f=n==null?0:n.length,!!f&&wn(f)&&On(s,f)&&(A(n)||z(n)))}function Rr(n,r){return n!=null&&Tr(n,r,cr)}var Ir=1,Sr=2;function Lr(n,r){return $(n)&&sn(r)?un(R(n),r):function(e){var i=mn(e,n);return i===void 0&&i===r?Rr(e,n):F(r,i,Ir|Sr)}}function xr(n){return function(r){return r?.[n]}}function Mr(n){return function(r){return nn(r,n)}}function $r(n){return $(n)?xr(R(n)):Mr(n)}function an(n){return typeof n=="function"?n:n==null?V:typeof n=="object"?A(n)?Lr(n[0],n[1]):Er(n):$r(n)}function Cr(n,r){return n&&vn(n,r,M)}function Fr(n,r){return function(e,i){if(e==null)return e;if(!W(e))return n(e,i);for(var f=e.length,t=-1,s=Object(e);++t<f&&i(s[t],t,s)!==!1;);return e}}var G=Fr(Cr);function Gr(n){return typeof n=="function"?n:V}function qr(n,r){var e=A(n)?En:G;return e(n,Gr(r))}function Dr(n,r){var e=[];return G(n,function(i,f,t){r(i,f,t)&&e.push(i)}),e}function Zr(n,r){var e=A(n)?en:Dr;return e(n,an(r))}function mr(n,r,e,i,f){return f(n,function(t,s,u){e=i?(i=!1,t):r(e,t,s,u)}),e}function Xr(n,r,e){var i=A(n)?Un:mr,f=arguments.length<3;return i(n,an(r),e,f,G)}var Nr=1/0,Ur=I&&1/C(new I([,-0]))[1]==Nr?function(n){return new I(n)}:bn,Br=200;function Yr(n,r,e){var i=-1,f=Sn,t=n.length,s=!0,u=[],a=u;if(t>=Br){var h=r?null:Ur(n);if(h)return C(h);s=!1,f=tn,a=new y}else a=r?[]:u;n:for(;++i<t;){var g=n[i],l=r?r(g):g;if(g=g!==0?g:0,s&&l===l){for(var d=a.length;d--;)if(a[d]===l)continue n;r&&a.push(l),u.push(g)}else f(a,l,e)||(a!==u&&a.push(l),u.push(g))}return u}export{G as a,Kr as b,an as c,yn as d,rn as e,Zn as f,qn as g,En as h,x as i,Z as j,M as k,Yr as l,Zr as m,qr as n,cn as o,Gr as p,Cr as q,Xr as r,Bn as s,Tr as t,j as u,R as v,nn as w,Rr as x,Dn as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as ln,a0 as an,a1 as G,a2 as q,a3 as z,a4 as un,a5 as y,a6 as tn,a7 as K,a8 as _,a9 as rn,aa as o,ab as on,ac as sn,ad as fn}from"./mermaid.core-
|
|
1
|
+
import{$ as ln,a0 as an,a1 as G,a2 as q,a3 as z,a4 as un,a5 as y,a6 as tn,a7 as K,a8 as _,a9 as rn,aa as o,ab as on,ac as sn,ad as fn}from"./mermaid.core-CO0f3d6Y.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,B,a){var O=I-l,i=D-h,n=B-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function V(l,h,I,D,v,A,B){var a=l-I,O=h-D,i=(B?A:-A)/K(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,C=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*K(on(0,T*T*R-P*P)),$=(P*g-m*S)/R,j=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=$-C,e=j-t,r=w-C,F=p-t;return x*x+e*e>r*r+F*F&&($=w,j=p),{cx:$,cy:j,x01:-n,y01:-d,x11:$*(v/T-1),y11:j*(v/T-1)}}function hn(){var l=cn,h=yn,I=z(0),D=null,v=gn,A=dn,B=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,C=rn(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(C>tn-y)a.moveTo(s*G(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*G(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=C,S=C,$=B.apply(this,arguments)/2,j=$>y&&(D?+D.apply(this,arguments):K(u*u+s*s)),w=_(rn(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if(j>y){var F=sn(j/u*q($)),L=sn(j/s*q($));(P-=F*2)>y?(F*=t?1:-1,R+=F,T-=F):(P=0,R=T=(f+c)/2),(S-=L*2)>y?(L*=t?1:-1,m+=L,g-=L):(S=0,m=g=(f+c)/2)}var H=s*G(m),J=s*q(m),M=u*G(T),N=u*q(T);if(w>y){var Q=s*G(g),U=s*q(g),W=u*G(R),X=u*q(R),E;if(C<an)if(E=pn(H,J,W,X,Q,U,M,N)){var Y=H-E[0],Z=J-E[1],b=Q-E[0],k=U-E[1],nn=1/q(fn((Y*b+Z*k)/(K(Y*Y+Z*Z)*K(b*b+k*k)))/2),en=K(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=V(W,X,H,J,s,x,t),r=V(Q,U,M,N,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(H,J),a.arc(0,0,s,m,g,!t)):a.moveTo(H,J),!(u>y)||!(P>y)?a.lineTo(M,N):p>y?(e=V(M,N,Q,U,u,-p,t),r=V(H,J,W,X,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[G(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:z(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:z(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:z(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:z(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:z(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:z(+n),i):A},i.padAngle=function(n){return arguments.length?(B=typeof n=="function"?n:z(+n),i):B},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
|