@dotobokuri/fleet-console 1.22.1 → 1.23.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 +4 -2
- package/dist/cli.mjs +128 -62
- package/dist/client/assets/{_baseUniq-cap0P4FK.js → _baseUniq-BjOe5yYF.js} +1 -1
- package/dist/client/assets/{arc-yBqa09aK.js → arc-bFUuO3jf.js} +1 -1
- package/dist/client/assets/{architectureDiagram-Q4EWVU46-Bug4qdr-.js → architectureDiagram-Q4EWVU46-Ba7nimQq.js} +1 -1
- package/dist/client/assets/{blockDiagram-DXYQGD6D-BkiIL2xt.js → blockDiagram-DXYQGD6D-CQGf47hl.js} +1 -1
- package/dist/client/assets/{c4Diagram-AHTNJAMY-DYY200Al.js → c4Diagram-AHTNJAMY-DZF_cAK4.js} +1 -1
- package/dist/client/assets/channel-D2BahVp1.js +1 -0
- package/dist/client/assets/{chunk-4BX2VUAB-DQKmhVxn.js → chunk-4BX2VUAB-DjUUHSQ5.js} +1 -1
- package/dist/client/assets/{chunk-4TB4RGXK-DHpmA3Zl.js → chunk-4TB4RGXK-Dvqti8bd.js} +1 -1
- package/dist/client/assets/{chunk-55IACEB6-DeRDuQXE.js → chunk-55IACEB6-2BxiBvkp.js} +1 -1
- package/dist/client/assets/{chunk-EDXVE4YY-CNpnhSJm.js → chunk-EDXVE4YY-CqCjol5O.js} +1 -1
- package/dist/client/assets/{chunk-FMBD7UC4-BXGVABL-.js → chunk-FMBD7UC4-eoCfIbly.js} +1 -1
- package/dist/client/assets/{chunk-OYMX7WX6-WbJs4VwZ.js → chunk-OYMX7WX6-CoC86V_1.js} +1 -1
- package/dist/client/assets/{chunk-QZHKN3VN-u3BLl6Sl.js → chunk-QZHKN3VN-CJQA5mlQ.js} +1 -1
- package/dist/client/assets/{chunk-YZCP3GAM-BFESuhuJ.js → chunk-YZCP3GAM-C5C4kbLu.js} +1 -1
- package/dist/client/assets/classDiagram-6PBFFD2Q-DsDAVLhS.js +1 -0
- package/dist/client/assets/classDiagram-v2-HSJHXN6E-DsDAVLhS.js +1 -0
- package/dist/client/assets/clone-CdZy2Xzf.js +1 -0
- package/dist/client/assets/{cose-bilkent-S5V4N54A-rouOsZjT.js → cose-bilkent-S5V4N54A-CahuunpL.js} +1 -1
- package/dist/client/assets/{dagre-KV5264BT-QCUeCVpM.js → dagre-KV5264BT-Cbv5kSi5.js} +1 -1
- package/dist/client/assets/{diagram-5BDNPKRD-DqerlFb_.js → diagram-5BDNPKRD-CNm40ZGB.js} +1 -1
- package/dist/client/assets/{diagram-G4DWMVQ6-BS3a1YGN.js → diagram-G4DWMVQ6-DrlGNT3i.js} +1 -1
- package/dist/client/assets/{diagram-MMDJMWI5-BeauTcSV.js → diagram-MMDJMWI5-r8Y2oqmw.js} +1 -1
- package/dist/client/assets/{diagram-TYMM5635-Ci2wLUUE.js → diagram-TYMM5635-CMzEhXup.js} +1 -1
- package/dist/client/assets/{erDiagram-SMLLAGMA-9MnmiKch.js → erDiagram-SMLLAGMA-UFjUUMPz.js} +1 -1
- package/dist/client/assets/{flowDiagram-DWJPFMVM-CiV9p5EU.js → flowDiagram-DWJPFMVM-Dd1STmYc.js} +1 -1
- package/dist/client/assets/{ganttDiagram-T4ZO3ILL-D6oNoENl.js → ganttDiagram-T4ZO3ILL-CHHU0hVd.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-UUTBAWPF-DESO385F.js → gitGraphDiagram-UUTBAWPF-vj2HukAF.js} +1 -1
- package/dist/client/assets/{graph-BZdl-RHy.js → graph-DhjfEbEb.js} +1 -1
- package/dist/client/assets/index-Dq9EKm2G.css +1 -0
- package/dist/client/assets/{index-BKpCMFrm.js → index-DtzbOdd7.js} +75 -75
- package/dist/client/assets/{infoDiagram-42DDH7IO-lc8vZnyi.js → infoDiagram-42DDH7IO-CC7AEgDm.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-UXIWVN3A-BfzvQXhn.js → ishikawaDiagram-UXIWVN3A-DlRw2B9G.js} +1 -1
- package/dist/client/assets/{journeyDiagram-VCZTEJTY-BS_Dr0EV.js → journeyDiagram-VCZTEJTY-BbRXANKQ.js} +1 -1
- package/dist/client/assets/{kanban-definition-6JOO6SKY-Cw7oTQJN.js → kanban-definition-6JOO6SKY-DtvdCxGN.js} +1 -1
- package/dist/client/assets/{layout-ChwcDQm8.js → layout-Dg5cvw5v.js} +1 -1
- package/dist/client/assets/{linear-C7GLbmND.js → linear-BvVlQLqF.js} +1 -1
- package/dist/client/assets/{mermaid.core-D9phfpQo.js → mermaid.core-DzrV8sC-.js} +4 -4
- package/dist/client/assets/{min-p7Whc_Wi.js → min-DNGQ1Ciz.js} +1 -1
- package/dist/client/assets/{mindmap-definition-QFDTVHPH-fl_SJKrw.js → mindmap-definition-QFDTVHPH-DxJCNZbg.js} +1 -1
- package/dist/client/assets/{pieDiagram-DEJITSTG-Btw7ckA5.js → pieDiagram-DEJITSTG-B75XHG-s.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-34T5L4WZ-DB4iJlTI.js → quadrantDiagram-34T5L4WZ-CL4yoF0m.js} +1 -1
- package/dist/client/assets/{requirementDiagram-MS252O5E-hXwV5Nhy.js → requirementDiagram-MS252O5E-kGV4vcr1.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-XADWPNL6-DC-fizCk.js → sankeyDiagram-XADWPNL6-DoA4u7wI.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-FGHM5R23-RrfrroR5.js → sequenceDiagram-FGHM5R23-ZpNDf1bS.js} +1 -1
- package/dist/client/assets/{stateDiagram-FHFEXIEX-q8FUPV_e.js → stateDiagram-FHFEXIEX-BzgKcVAG.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-yRK5hzZ4.js +1 -0
- package/dist/client/assets/{timeline-definition-GMOUNBTQ-tegMd8Od.js → timeline-definition-GMOUNBTQ-B_DkUDsD.js} +1 -1
- package/dist/client/assets/{vennDiagram-DHZGUBPP-CXx5oN2X.js → vennDiagram-DHZGUBPP-MCUnnsKb.js} +1 -1
- package/dist/client/assets/{wardley-RL74JXVD-CxSJ3P_7.js → wardley-RL74JXVD-D_JAMSxj.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-NUSXRM2D-DN1P180Z.js → wardleyDiagram-NUSXRM2D-BHCwZGLq.js} +1 -1
- package/dist/client/assets/{xychartDiagram-5P7HB3ND-Dcn9ukv5.js → xychartDiagram-5P7HB3ND-FbGwbD3V.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/fleet-plugins/skills/routes.mjs +0 -3
- package/dist/fleet-plugins/terminal/routes.mjs +388 -365
- package/package.json +1 -1
- package/dist/client/assets/channel-B3EqY8ya.js +0 -1
- package/dist/client/assets/classDiagram-6PBFFD2Q-BekEZLVJ.js +0 -1
- package/dist/client/assets/classDiagram-v2-HSJHXN6E-BekEZLVJ.js +0 -1
- package/dist/client/assets/clone-CsVi9-Ni.js +0 -1
- package/dist/client/assets/index-cg8Uxys9.css +0 -1
- package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-BErzXGq7.js +0 -1
package/AGENTS.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
- Console durable state is persisted in the console data directory's `state.json` (`createDurableJsonStore`, `sensitivity: "sensitive"`). The data directory follows the release channel: published stable builds use `~/.fleet/console/state.json`, while unpublished local runs (`pnpm fleet-console`/`tsx`) use the project workspace `.fleet/console/state.json` co-located with the lock, so a dev console never shares Theaters/Operations with a globally installed one. Setting `FLEET_CONSOLE_DIR` relocates the durable state (and captures) into that directory too — co-located with the lock, matching the runtime-file escape hatch — so a read-only checkout can point its writable runtime slot away from the project tree. The console server is the sole writer; the file stores `{ version: 2, theaters, operations }`. On startup the server restores Theaters and Operations into a dormant state (no PTY), and Operation state survives console restarts.
|
|
12
12
|
- A capture inbound channel writes `{fleetSessionId}.json` under the same console data directory's `captures/` (`~/.fleet/console/captures/` for stable, the project `.fleet/console/captures/` for local runs). Provider CLI SessionStart hooks record provider session ids via `fleet-console hook capture-session <provider>`; the server reads the capture file, merges the provider session id into durable state, and cleans up the capture file. This is separate from the console lock file in `os.tmpdir()` (stable) / the project `.fleet/console` lock (local).
|
|
13
13
|
- The React SPA served from the console backend at `/console/`: layout, components, styles, and visual identity. The bottom StatusBar provides version/What's New, self-update, and repository affordances, while the Operations SideBar owns **Theater** selection — a project root directory that groups console-owned terminal sessions and Codex wiki context. The Operations surface renders a single spatial Map canvas of terminal sessions filtered to the active Theater; operators create sessions directly on the canvas (Shift-drag or right-click), choosing an Agent CLI before a new terminal session starts. Each session panel lists its active carrier jobs in a floating job dock, and selecting a job opens a centered streaming overlay scoped to that session's jobs. The canvas also hosts free shell panels (right-click) that resolve their cwd from the active Theater. A console-wide Operation quick-search (Cmd/Ctrl+K) searches terminal sessions across all Theaters, switches to the selected Operation's Theater, selects that Operation, and navigates to `/operations`; on `/codex` paths the same shortcut yields to Codex's own search.
|
|
14
|
-
- The built-in Terminal plugin (`runtime/fleet-plugins/terminal`, package `@fleet-plugins/terminal`): one plugin id, `terminal`, owns the Shell and Agent operation kinds plus plugin-scoped WebSocket, ticket registry, PTY session lifecycle, and launch runtime. It absorbs the server-shared and client-shared helpers, keeps operation type ids `shell` and `agent` (carrier streaming renders inside the Agent panel as a resident collapsible stream dock pinned to the panel bottom — live output always visible without a click, per-browser collapsed state persisted — plus a
|
|
14
|
+
- The built-in Terminal plugin (`runtime/fleet-plugins/terminal`, package `@fleet-plugins/terminal`): one plugin id, `terminal`, owns the Shell and Agent operation kinds plus plugin-scoped WebSocket, ticket registry, PTY session lifecycle, and launch runtime. It absorbs the server-shared and client-shared helpers, keeps operation type ids `shell` and `agent` (carrier streaming renders inside the Agent panel as a resident collapsible stream dock pinned to the panel bottom — live output always visible without a click, per-browser collapsed state persisted — plus a Details modal for full track history accessed via the dock header, not a separate child operation; thinking text never appears on the dock strip or rows — live tracks with no output show neutral-ink `thinking…` state, and the full thought body is available only through the Details modal's default-collapsed disclosure (`thinking · N chars`); the Details modal shares pin-to-bottom follow — released on upward scroll, restored via the aurora Follow button — and keeps rendering finalized jobs until the modal closes; the dock lingers ~4s after the last active job ends — neutral dot on normal termination, coral dot on error — then collapses), serves plugin HTTP routes under `/plugins/terminal/{shell,agent}/*`, and uses the plugin-scoped `ws` route for PTY transport. The Shell launch label is `Shell`.
|
|
15
15
|
- The Codex/Fleet Wiki web surface under `/console/codex`: the console-owned Codex server gateway, workspace registry, wiki API routes, and migrated vanilla TypeScript Maritime Codex client. The console-level **TheaterRegistry** is the source of truth for project roots and does not require a Fleet Wiki knowledge root; the Codex `WorkspaceRegistry` is the subset of Theaters whose directories contain a Fleet Wiki knowledge root. Codex is mounted as a Right Rail built-in panel without an iframe or proxy daemon.
|
|
16
16
|
- The observer-side client contract: REST snapshot fetches and the SSE consumption loop with reconnect/resync.
|
|
17
17
|
- The streaming view model: the event reducer that folds `CarrierJobStreamEvent` timelines into per-job, per-track views with incremental text accumulation.
|
|
@@ -171,9 +171,11 @@ Operation chrome (maximize, minimize, focus, and the Operations Left SideBar) is
|
|
|
171
171
|
## Streaming Invariants
|
|
172
172
|
|
|
173
173
|
- `track:text` / `track:thought` events are **deltas**; the reducer appends them per track. Never treat them as snapshots.
|
|
174
|
+
- `latestLine` (the collapsed strip tail source) updates from output (`track:text`) only; `track:thought` must never update it.
|
|
174
175
|
- Event ids (the console-assigned `observedId`) are globally monotonic across all registered CLI sessions; the reducer must ignore non-advancing ids so snapshot resync and live frames can overlap safely.
|
|
175
176
|
- Snapshot rebuild (`/observer/jobs`) and live SSE application must go through the same reducer (`applyEvent`) — no second interpretation of event payloads.
|
|
176
|
-
- The output view
|
|
177
|
+
- The output view and Details modal keep pin-to-bottom follow behavior: pinned within slack distance, released on upward scroll, restored via the follow button. Removing this is a UX regression.
|
|
178
|
+
- Error track state renders as coral in the dock; `conn` status tracks count as live.
|
|
177
179
|
- `sentTextLength` tracks emitted length from `textLength` metadata so retention clamping on the console-backend side stays visible to the operator.
|
|
178
180
|
|
|
179
181
|
## Right Rail (Activity Rail)
|
package/dist/cli.mjs
CHANGED
|
@@ -20652,11 +20652,24 @@ function getYoloModeId(cli) {
|
|
|
20652
20652
|
return "yolo";
|
|
20653
20653
|
}
|
|
20654
20654
|
}
|
|
20655
|
-
function
|
|
20656
|
-
|
|
20657
|
-
|
|
20655
|
+
function buildCodexConfigEnv(systemPrompt, configOverrides, baseConfigJson) {
|
|
20656
|
+
const map2 = parseBaseConfigMap(baseConfigJson);
|
|
20657
|
+
for (const override of configOverrides ?? []) {
|
|
20658
|
+
const eqIndex = override.indexOf("=");
|
|
20659
|
+
if (eqIndex < 0) {
|
|
20660
|
+
continue;
|
|
20661
|
+
}
|
|
20662
|
+
const key = override.slice(0, eqIndex);
|
|
20663
|
+
const rawValue = override.slice(eqIndex + 1);
|
|
20664
|
+
assignNestedKey(map2, key, parseOverrideValue(rawValue));
|
|
20665
|
+
}
|
|
20666
|
+
if (systemPrompt) {
|
|
20667
|
+
map2.developer_instructions = systemPrompt;
|
|
20658
20668
|
}
|
|
20659
|
-
|
|
20669
|
+
if (Object.keys(map2).length === 0) {
|
|
20670
|
+
return void 0;
|
|
20671
|
+
}
|
|
20672
|
+
return JSON.stringify(map2);
|
|
20660
20673
|
}
|
|
20661
20674
|
function buildConfigOverrideArgs(overrides) {
|
|
20662
20675
|
return overrides.flatMap((override) => ["-c", override]);
|
|
@@ -20684,27 +20697,44 @@ function mcpServerConfigsToAcp(servers) {
|
|
|
20684
20697
|
headers: server.headers ?? []
|
|
20685
20698
|
}));
|
|
20686
20699
|
}
|
|
20687
|
-
function
|
|
20688
|
-
|
|
20689
|
-
|
|
20690
|
-
|
|
20691
|
-
|
|
20692
|
-
|
|
20693
|
-
|
|
20694
|
-
|
|
20695
|
-
return "\\n";
|
|
20696
|
-
case "\f":
|
|
20697
|
-
return "\\f";
|
|
20698
|
-
case "\r":
|
|
20699
|
-
return "\\r";
|
|
20700
|
-
case '"':
|
|
20701
|
-
return '\\"';
|
|
20702
|
-
case "\\":
|
|
20703
|
-
return "\\\\";
|
|
20704
|
-
default:
|
|
20705
|
-
return `\\u${char.charCodeAt(0).toString(16).padStart(4, "0")}`;
|
|
20700
|
+
function parseBaseConfigMap(baseConfigJson) {
|
|
20701
|
+
if (!baseConfigJson) {
|
|
20702
|
+
return {};
|
|
20703
|
+
}
|
|
20704
|
+
try {
|
|
20705
|
+
const parsed = JSON.parse(baseConfigJson);
|
|
20706
|
+
if (typeof parsed === "object" && parsed !== null && !Array.isArray(parsed)) {
|
|
20707
|
+
return parsed;
|
|
20706
20708
|
}
|
|
20707
|
-
}
|
|
20709
|
+
} catch {
|
|
20710
|
+
}
|
|
20711
|
+
return {};
|
|
20712
|
+
}
|
|
20713
|
+
function parseOverrideValue(raw) {
|
|
20714
|
+
try {
|
|
20715
|
+
return JSON.parse(raw);
|
|
20716
|
+
} catch {
|
|
20717
|
+
if (raw.length >= 2 && raw.startsWith('"') && raw.endsWith('"')) {
|
|
20718
|
+
return raw.slice(1, -1);
|
|
20719
|
+
}
|
|
20720
|
+
return raw;
|
|
20721
|
+
}
|
|
20722
|
+
}
|
|
20723
|
+
function assignNestedKey(target, dottedKey, value) {
|
|
20724
|
+
const segments = dottedKey.split(".");
|
|
20725
|
+
let cursor = target;
|
|
20726
|
+
for (let i = 0; i < segments.length - 1; i += 1) {
|
|
20727
|
+
const segment = segments[i];
|
|
20728
|
+
const existing = cursor[segment];
|
|
20729
|
+
if (typeof existing === "object" && existing !== null && !Array.isArray(existing)) {
|
|
20730
|
+
cursor = existing;
|
|
20731
|
+
} else {
|
|
20732
|
+
const nested = {};
|
|
20733
|
+
cursor[segment] = nested;
|
|
20734
|
+
cursor = nested;
|
|
20735
|
+
}
|
|
20736
|
+
}
|
|
20737
|
+
cursor[segments[segments.length - 1]] = value;
|
|
20708
20738
|
}
|
|
20709
20739
|
|
|
20710
20740
|
// ../../packages/core-unified-agent/src/detector/CliDetector.ts
|
|
@@ -22099,13 +22129,11 @@ function findRolloutPath(root, threadId) {
|
|
|
22099
22129
|
// ../../packages/core-unified-agent/src/client/UnifiedCodexAgentClient.ts
|
|
22100
22130
|
var CODEX_TURN_LEVEL_CONFIG_KEYS = /* @__PURE__ */ new Set(["effort", "model"]);
|
|
22101
22131
|
var CODEX_THREAD_POLICY_CONFIG_KEYS = /* @__PURE__ */ new Set(["approvalPolicy", "sandbox"]);
|
|
22102
|
-
var CODEX_ACP_PROMPT_FALLBACK = process.platform === "win32";
|
|
22103
22132
|
var UnifiedCodexAgentClient = class extends EventEmitter {
|
|
22104
22133
|
connection = null;
|
|
22105
22134
|
sessionId = null;
|
|
22106
22135
|
sessionCwd = null;
|
|
22107
22136
|
currentSystemPrompt = null;
|
|
22108
|
-
firstPromptPending = null;
|
|
22109
22137
|
pendingOverrides = null;
|
|
22110
22138
|
detector = new CliDetector();
|
|
22111
22139
|
on(event, listener) {
|
|
@@ -22197,22 +22225,17 @@ var UnifiedCodexAgentClient = class extends EventEmitter {
|
|
|
22197
22225
|
async connectAcp(options) {
|
|
22198
22226
|
const cleanEnv = cleanEnvironment(process.env, options.env);
|
|
22199
22227
|
const spawnConfig = createSpawnConfig("codex", options);
|
|
22200
|
-
const
|
|
22201
|
-
|
|
22202
|
-
|
|
22203
|
-
|
|
22204
|
-
|
|
22205
|
-
void 0,
|
|
22206
|
-
void 0,
|
|
22207
|
-
developerInstructions
|
|
22208
|
-
)
|
|
22209
|
-
];
|
|
22228
|
+
const codexConfigEnv = buildCodexConfigEnv(
|
|
22229
|
+
options.systemPrompt,
|
|
22230
|
+
options.configOverrides,
|
|
22231
|
+
cleanEnv.CODEX_CONFIG
|
|
22232
|
+
);
|
|
22210
22233
|
const connection = new AcpConnection({
|
|
22211
22234
|
command: spawnConfig.command,
|
|
22212
|
-
args,
|
|
22235
|
+
args: spawnConfig.args,
|
|
22213
22236
|
cliType: "codex",
|
|
22214
22237
|
cwd: options.cwd,
|
|
22215
|
-
env: { ...cleanEnv },
|
|
22238
|
+
env: { ...cleanEnv, ...codexConfigEnv ? { CODEX_CONFIG: codexConfigEnv } : {} },
|
|
22216
22239
|
requestTimeout: options.timeout ?? 6e5,
|
|
22217
22240
|
initTimeout: options.timeout ?? 6e4,
|
|
22218
22241
|
promptIdleTimeout: options.promptIdleTimeout ?? 6e5,
|
|
@@ -22309,17 +22332,7 @@ var UnifiedCodexAgentClient = class extends EventEmitter {
|
|
|
22309
22332
|
if (!this.sessionId) {
|
|
22310
22333
|
throw new Error("\uC5F0\uACB0\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
|
|
22311
22334
|
}
|
|
22312
|
-
|
|
22313
|
-
if (!systemPrompt) {
|
|
22314
|
-
return this.connection.sendPrompt(this.sessionId, content);
|
|
22315
|
-
}
|
|
22316
|
-
const userBlocks = typeof content === "string" ? [{ type: "text", text: content }] : content;
|
|
22317
|
-
const response = await this.connection.sendPrompt(this.sessionId, [
|
|
22318
|
-
{ type: "text", text: systemPrompt },
|
|
22319
|
-
...userBlocks
|
|
22320
|
-
]);
|
|
22321
|
-
this.firstPromptPending = null;
|
|
22322
|
-
return response;
|
|
22335
|
+
return this.connection.sendPrompt(this.sessionId, content);
|
|
22323
22336
|
}
|
|
22324
22337
|
this.applyPendingOverrides();
|
|
22325
22338
|
const input = typeof content === "string" ? [{ type: "text", text: content, text_elements: [] }] : content.map((block) => "text" in block ? { type: "text", text: block.text, text_elements: [] } : { type: "text", text: JSON.stringify(block), text_elements: [] });
|
|
@@ -22401,8 +22414,6 @@ var UnifiedCodexAgentClient = class extends EventEmitter {
|
|
|
22401
22414
|
mcpServers: this.resolveAcpMcpServers(mcpServers)
|
|
22402
22415
|
});
|
|
22403
22416
|
this.sessionId = sessionId;
|
|
22404
|
-
this.currentSystemPrompt = null;
|
|
22405
|
-
this.firstPromptPending = null;
|
|
22406
22417
|
return;
|
|
22407
22418
|
}
|
|
22408
22419
|
if (mcpServers?.length) {
|
|
@@ -22439,7 +22450,6 @@ var UnifiedCodexAgentClient = class extends EventEmitter {
|
|
|
22439
22450
|
const session = await this.connection.reconnectSession(targetCwd);
|
|
22440
22451
|
this.sessionId = session.sessionId;
|
|
22441
22452
|
this.sessionCwd = targetCwd;
|
|
22442
|
-
this.firstPromptPending = this.currentSystemPrompt;
|
|
22443
22453
|
return {
|
|
22444
22454
|
cli: "codex",
|
|
22445
22455
|
protocol: "acp",
|
|
@@ -22467,7 +22477,6 @@ var UnifiedCodexAgentClient = class extends EventEmitter {
|
|
|
22467
22477
|
this.sessionId = session.sessionId;
|
|
22468
22478
|
this.sessionCwd = options.cwd;
|
|
22469
22479
|
this.currentSystemPrompt = options.systemPrompt ?? null;
|
|
22470
|
-
this.firstPromptPending = CODEX_ACP_PROMPT_FALLBACK && !options.sessionId ? options.systemPrompt ?? null : null;
|
|
22471
22480
|
this.pendingOverrides = {
|
|
22472
22481
|
turnConfig: {},
|
|
22473
22482
|
threadConfig: {}
|
|
@@ -22485,7 +22494,6 @@ var UnifiedCodexAgentClient = class extends EventEmitter {
|
|
|
22485
22494
|
this.sessionId = null;
|
|
22486
22495
|
this.sessionCwd = null;
|
|
22487
22496
|
this.currentSystemPrompt = null;
|
|
22488
|
-
this.firstPromptPending = null;
|
|
22489
22497
|
this.pendingOverrides = null;
|
|
22490
22498
|
}
|
|
22491
22499
|
validateModelEffort(modelId, effort) {
|
|
@@ -22696,9 +22704,8 @@ var UnifiedCodexAgentClient = class extends EventEmitter {
|
|
|
22696
22704
|
return "read-only";
|
|
22697
22705
|
}
|
|
22698
22706
|
}
|
|
22699
|
-
buildStartupConfigArgs(overrides, servers, modeMapping
|
|
22707
|
+
buildStartupConfigArgs(overrides, servers, modeMapping) {
|
|
22700
22708
|
const configArgs = [
|
|
22701
|
-
...buildCodexDeveloperInstructionConfig(developerInstructions),
|
|
22702
22709
|
...modeMapping ? [
|
|
22703
22710
|
`approval_policy="${modeMapping.approvalPolicy}"`,
|
|
22704
22711
|
`sandbox_mode="${modeMapping.sandbox}"`
|
|
@@ -37430,6 +37437,8 @@ function resolveDefaultServerModulePath() {
|
|
|
37430
37437
|
// core/host/update-check.ts
|
|
37431
37438
|
var FLEET_CONSOLE_PACKAGE_NAME = "@dotobokuri/fleet-console";
|
|
37432
37439
|
var UPDATE_CHECK_TTL_MS = 60 * 60 * 1e3;
|
|
37440
|
+
var UPDATE_CHECK_ERROR_TTL_MS = 5 * 60 * 1e3;
|
|
37441
|
+
var UPDATE_CHECK_INTERVAL_MS = 30 * 60 * 1e3;
|
|
37433
37442
|
var NO_UPDATE_STATUS = { updateAvailable: false };
|
|
37434
37443
|
function createConsoleUpdateCheckService(deps = {}) {
|
|
37435
37444
|
const readRelease = deps.readRelease ?? readFleetConsoleRelease;
|
|
@@ -37437,11 +37446,17 @@ function createConsoleUpdateCheckService(deps = {}) {
|
|
|
37437
37446
|
const isGreater = deps.isGreater ?? isVersionGreater;
|
|
37438
37447
|
const now = deps.now ?? Date.now;
|
|
37439
37448
|
const ttlMs = deps.ttlMs ?? UPDATE_CHECK_TTL_MS;
|
|
37449
|
+
const errorTtlMs = deps.errorTtlMs ?? UPDATE_CHECK_ERROR_TTL_MS;
|
|
37450
|
+
const intervalMs = deps.intervalMs ?? UPDATE_CHECK_INTERVAL_MS;
|
|
37451
|
+
const startInterval = deps.setInterval ?? ((callback, delayMs) => setInterval(callback, delayMs));
|
|
37452
|
+
const stopInterval = deps.clearInterval ?? ((interval2) => clearInterval(interval2));
|
|
37440
37453
|
let cached2 = null;
|
|
37441
37454
|
let inFlight = null;
|
|
37455
|
+
let interval = null;
|
|
37456
|
+
const changeListeners = /* @__PURE__ */ new Set();
|
|
37442
37457
|
const getStatus = () => {
|
|
37443
37458
|
const current = cached2;
|
|
37444
|
-
if (current && now() - current.checkedAt < ttlMs) {
|
|
37459
|
+
if (current && now() - current.checkedAt < current.ttlMs) {
|
|
37445
37460
|
return current.status;
|
|
37446
37461
|
}
|
|
37447
37462
|
void refresh();
|
|
@@ -37449,17 +37464,19 @@ function createConsoleUpdateCheckService(deps = {}) {
|
|
|
37449
37464
|
};
|
|
37450
37465
|
const refresh = async (options = {}) => {
|
|
37451
37466
|
const current = cached2;
|
|
37452
|
-
if (options.force !== true && current && now() - current.checkedAt < ttlMs) {
|
|
37467
|
+
if (options.force !== true && current && now() - current.checkedAt < current.ttlMs) {
|
|
37453
37468
|
return current.status;
|
|
37454
37469
|
}
|
|
37455
37470
|
if (inFlight) {
|
|
37456
37471
|
return inFlight;
|
|
37457
37472
|
}
|
|
37458
37473
|
inFlight = resolveUpdateStatus().then((status) => {
|
|
37459
|
-
|
|
37474
|
+
const previousStatus = cached2?.status ?? NO_UPDATE_STATUS;
|
|
37475
|
+
cached2 = { status, checkedAt: now(), ttlMs };
|
|
37476
|
+
notifyIfChanged(previousStatus, status);
|
|
37460
37477
|
return status;
|
|
37461
37478
|
}).catch(() => {
|
|
37462
|
-
cached2 = { status: NO_UPDATE_STATUS, checkedAt: now() };
|
|
37479
|
+
cached2 = { status: NO_UPDATE_STATUS, checkedAt: now(), ttlMs: errorTtlMs };
|
|
37463
37480
|
return NO_UPDATE_STATUS;
|
|
37464
37481
|
}).finally(() => {
|
|
37465
37482
|
inFlight = null;
|
|
@@ -37472,12 +37489,42 @@ function createConsoleUpdateCheckService(deps = {}) {
|
|
|
37472
37489
|
return NO_UPDATE_STATUS;
|
|
37473
37490
|
}
|
|
37474
37491
|
const latestVersion = await fetchLatest(FLEET_CONSOLE_PACKAGE_NAME);
|
|
37475
|
-
if (
|
|
37492
|
+
if (latestVersion === void 0) {
|
|
37493
|
+
throw new Error("registry lookup failed");
|
|
37494
|
+
}
|
|
37495
|
+
if (!isGreater(latestVersion, release.version)) {
|
|
37476
37496
|
return NO_UPDATE_STATUS;
|
|
37477
37497
|
}
|
|
37478
37498
|
return { updateAvailable: true, latestVersion };
|
|
37479
37499
|
};
|
|
37480
|
-
|
|
37500
|
+
const start = () => {
|
|
37501
|
+
if (interval) return;
|
|
37502
|
+
interval = startInterval(() => {
|
|
37503
|
+
void refresh({ force: true });
|
|
37504
|
+
}, intervalMs);
|
|
37505
|
+
interval.unref?.();
|
|
37506
|
+
};
|
|
37507
|
+
const stop = () => {
|
|
37508
|
+
if (!interval) return;
|
|
37509
|
+
stopInterval(interval);
|
|
37510
|
+
interval = null;
|
|
37511
|
+
};
|
|
37512
|
+
const onChange = (listener) => {
|
|
37513
|
+
changeListeners.add(listener);
|
|
37514
|
+
return () => changeListeners.delete(listener);
|
|
37515
|
+
};
|
|
37516
|
+
function notifyIfChanged(previous, next) {
|
|
37517
|
+
const updateBecameAvailable = !previous.updateAvailable && next.updateAvailable;
|
|
37518
|
+
const latestVersionChanged = previous.latestVersion !== next.latestVersion;
|
|
37519
|
+
if (!updateBecameAvailable && !latestVersionChanged) return;
|
|
37520
|
+
for (const listener of changeListeners) {
|
|
37521
|
+
try {
|
|
37522
|
+
listener(next);
|
|
37523
|
+
} catch {
|
|
37524
|
+
}
|
|
37525
|
+
}
|
|
37526
|
+
}
|
|
37527
|
+
return { getStatus, refresh, start, stop, onChange };
|
|
37481
37528
|
}
|
|
37482
37529
|
|
|
37483
37530
|
// core/host/server.ts
|
|
@@ -37617,6 +37664,9 @@ function createConsoleServer(deps = {}) {
|
|
|
37617
37664
|
const pluginCleanupCallbacks = /* @__PURE__ */ new Set();
|
|
37618
37665
|
const pluginEventListeners = /* @__PURE__ */ new Map();
|
|
37619
37666
|
const operationSseSubscribers = /* @__PURE__ */ new Set();
|
|
37667
|
+
let unsubscribeUpdateCheckChanges = updateCheck.onChange?.(() => {
|
|
37668
|
+
broadcastUpdateAvailable();
|
|
37669
|
+
}) ?? null;
|
|
37620
37670
|
const pluginHostCapabilities = {
|
|
37621
37671
|
operations: {
|
|
37622
37672
|
list: () => operations.list(),
|
|
@@ -38180,6 +38230,9 @@ function createConsoleServer(deps = {}) {
|
|
|
38180
38230
|
await disposeConsoleResources(currentLock);
|
|
38181
38231
|
}
|
|
38182
38232
|
async function disposeConsoleResources(currentLock) {
|
|
38233
|
+
updateCheck.stop?.();
|
|
38234
|
+
unsubscribeUpdateCheckChanges?.();
|
|
38235
|
+
unsubscribeUpdateCheckChanges = null;
|
|
38183
38236
|
if (consoleResourcesDisposed) {
|
|
38184
38237
|
currentLock?.release();
|
|
38185
38238
|
return;
|
|
@@ -38235,6 +38288,13 @@ function createConsoleServer(deps = {}) {
|
|
|
38235
38288
|
res.write(data);
|
|
38236
38289
|
}
|
|
38237
38290
|
}
|
|
38291
|
+
function broadcastUpdateAvailable() {
|
|
38292
|
+
if (operationSseSubscribers.size === 0) return;
|
|
38293
|
+
const data = encodeSseData("update:available", {});
|
|
38294
|
+
for (const res of operationSseSubscribers) {
|
|
38295
|
+
res.write(data);
|
|
38296
|
+
}
|
|
38297
|
+
}
|
|
38238
38298
|
function persistDurableState() {
|
|
38239
38299
|
try {
|
|
38240
38300
|
durableStateStore.save({
|
|
@@ -38287,6 +38347,12 @@ function createConsoleServer(deps = {}) {
|
|
|
38287
38347
|
throw error51;
|
|
38288
38348
|
}
|
|
38289
38349
|
if (!activeEndpoint) throw new Error("Console endpoint unavailable");
|
|
38350
|
+
if (unsubscribeUpdateCheckChanges === null) {
|
|
38351
|
+
unsubscribeUpdateCheckChanges = updateCheck.onChange?.(() => {
|
|
38352
|
+
broadcastUpdateAvailable();
|
|
38353
|
+
}) ?? null;
|
|
38354
|
+
}
|
|
38355
|
+
updateCheck.start?.();
|
|
38290
38356
|
void updateCheck.refresh();
|
|
38291
38357
|
return activeEndpoint;
|
|
38292
38358
|
},
|
|
@@ -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-DzrV8sC-.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-DzrV8sC-.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};
|