foundry-design-web-adapter 0.2.0-beta.4 → 0.2.0-beta.5
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/dist/adapter.js +167 -10
- package/dist/diagnostics.d.ts +27 -0
- package/dist/diagnostics.d.ts.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/adapter.js
CHANGED
|
@@ -896,6 +896,25 @@ var FOUNDRY_UI_FOUNDATION_CSS = `
|
|
|
896
896
|
}
|
|
897
897
|
`;
|
|
898
898
|
|
|
899
|
+
// src/diagnostics.ts
|
|
900
|
+
function createSafeDiagnostics(input) {
|
|
901
|
+
return {
|
|
902
|
+
product: "Foundry Design Control",
|
|
903
|
+
protocolVersion: input.protocolVersion ?? "1.1.0",
|
|
904
|
+
interfaceTheme: input.interfaceTheme,
|
|
905
|
+
connection: {
|
|
906
|
+
runtime: input.runtimeConnected ? "connected" : "disconnected",
|
|
907
|
+
agent: input.agentConnected ? "connected" : "disconnected",
|
|
908
|
+
...input.agentConnected && input.agentName ? { agentName: input.agentName } : {}
|
|
909
|
+
},
|
|
910
|
+
workspace: {
|
|
911
|
+
selectedElementCount: Math.max(0, input.selectedCount),
|
|
912
|
+
recordedChangeCount: Math.max(0, input.recordedChangeCount),
|
|
913
|
+
latestApplyState: input.latestApplyState ?? "none"
|
|
914
|
+
}
|
|
915
|
+
};
|
|
916
|
+
}
|
|
917
|
+
|
|
899
918
|
// src/workspace.ts
|
|
900
919
|
function resolveInterfaceTheme(preference, systemPrefersDark) {
|
|
901
920
|
return preference === "system" ? systemPrefersDark ? "dark" : "light" : preference;
|
|
@@ -1197,6 +1216,8 @@ var PANEL_CSS = `
|
|
|
1197
1216
|
.review-head strong { font-size:12px; }.review-summary { padding:12px 16px 12px;border-bottom:1px solid var(--fdc-line);background:#fcfcfc; }.review-summary strong { display:block;font-size:12px;font-weight:550;letter-spacing:-.01em; }.review-summary span { display:block;margin-top:4px;color:var(--fdc-muted);font-size:12px;line-height:1.45; }.review-summary.attention strong { color:#8b4d3d; }.review-toolbar button { height:28px;padding:0 8px;font-size:12px; }
|
|
1198
1217
|
.onboarding-card { bottom:84px;width:340px;padding:16px;border-radius:12px;box-shadow:0 16px 40px rgb(0 0 0 / 15%); }.onboarding-card-head { gap:8px; }.onboarding-card-head span { width:28px;height:28px;display:grid;place-items:center;color:#a75031;background:#fbf1ed;border-radius:8px; }.onboarding-card-head svg { width:16px;height:16px;color:inherit; }.onboarding-card-head strong { font-size:12px;letter-spacing:-.015em; }.onboarding-card>p { margin:8px 0 16px;font-size:12px;line-height:1.55; }.onboarding-steps { display:grid;grid-template-columns:1fr;gap:1px;border:1px solid var(--fdc-line);border-radius:8px;overflow:hidden;background:var(--fdc-line); }.onboarding-step { display:grid;grid-template-columns:24px 1fr;gap:8px;padding:8px 12px;background:white;text-align:left; }.onboarding-step b { color:#8a8a8a;font-size:8px;font-weight:500;letter-spacing:.04em; }.onboarding-step strong { display:block;font-size:12px;font-weight:550; }.onboarding-step small { display:block;margin-top:4px;color:var(--fdc-muted);font-size:8px;line-height:1.35; }.onboarding-actions { gap:8px;margin-top:12px; }.onboarding-actions button { height:32px;padding:0 12px;border-radius:8px;font-size:12px; }
|
|
1199
1218
|
.onboarding-card,.onboarding-step { color:var(--fdc-ink);background:var(--fdc-surface); }.onboarding-card-head span { color:#e7a68c;background:#36231d; }.onboarding-actions button { color:var(--fdc-ink);background:var(--fdc-elevated);border-color:var(--fdc-line); }.onboarding-actions .onboarding-start { color:#141416;background:#f0f1f3;border-color:#f0f1f3; }
|
|
1219
|
+
.status-popover { width:256px; }.status-popover-actions { display:grid;grid-template-columns:1fr 1fr;gap:4px;margin-top:8px; }.status-popover .status-popover-actions button { height:32px;margin:0; }.status-popover .status-popover-actions [data-status-retry] { grid-column:1/-1; }
|
|
1220
|
+
.onboarding-card { width:360px; }.onboarding-card-head>strong { flex:1; }.onboarding-card-head .onboarding-close { width:28px;height:28px;display:grid;place-items:center;padding:0;border:0;border-radius:4px;background:transparent;color:var(--fdc-muted);cursor:pointer; }.onboarding-card-head .onboarding-close:hover { color:var(--fdc-ink);background:var(--fdc-subtle); }.onboarding-card-head .onboarding-close svg { width:12px;height:12px; }.onboarding-steps { gap:4px;border:0;overflow:visible;background:transparent; }.onboarding-step { min-height:40px;grid-template-columns:24px minmax(0,1fr);align-items:center;gap:8px;padding:8px;border:1px solid var(--fdc-line);border-radius:8px; }.onboarding-step b { width:20px;height:20px;display:grid;place-items:center;border:1px solid var(--fdc-line);border-radius:50%;color:var(--fdc-muted);font:500 8px/1 var(--fdc-font);letter-spacing:0; }.onboarding-step b svg { width:12px;height:12px; }.onboarding-step.complete>b { color:#141416;background:#8ae0c2;border-color:#8ae0c2; }.onboarding-step.current { border-color:var(--fdc-signal);box-shadow:0 0 0 4px rgb(59 130 246 / 10%); }
|
|
1200
1221
|
.review-summary { color:var(--fdc-ink);background:var(--fdc-paper); }.empty-state-icon { color:#9ec5ff;background:var(--fdc-signal-soft); }
|
|
1201
1222
|
.component-card,.health-card { color:var(--fdc-ink);background:var(--fdc-surface);border-color:var(--fdc-line); }.component-card.selected { color:var(--fdc-ink);background:var(--fdc-component-soft);border-color:#5c4b9e;box-shadow:0 0 0 4px rgb(155 135 245 / 10%); }.component-variants span,.component-actions button,.component-variants button { color:#c1b5f5;background:var(--fdc-component-soft);border-color:#4a406f; }.health-score::before { background:var(--fdc-surface); }.health-filters button { color:var(--fdc-muted); }.health-filters button:hover,.health-filters button.active { color:var(--fdc-ink);background:var(--fdc-elevated);border-color:var(--fdc-line); }.health-card p,.health-evidence { color:var(--fdc-muted); }.mapping-chooser { color:#f0c9a8;background:#35291d;border-color:#665039; }.mapping-chooser>strong,.mapping-option,.mapping-option small { color:#e7c29f; }.review-card.locating { background:var(--fdc-signal-soft); }.baseline-badge { color:#83d8bb;background:#18352c; }
|
|
1202
1223
|
/* Workspace ownership */
|
|
@@ -1891,7 +1912,7 @@ function installFoundryInspector(options = {}) {
|
|
|
1891
1912
|
statusPill.setAttribute("aria-label", "Foundry session status");
|
|
1892
1913
|
statusPill.insertAdjacentHTML(
|
|
1893
1914
|
"afterend",
|
|
1894
|
-
'<div class="status-popover" hidden><strong data-status-title>Session connected</strong><span data-status-detail>Changes are stored locally.</span><code data-status-project></code><code data-status-revision></code><button data-status-retry>Check connection</button></div>'
|
|
1915
|
+
'<div class="status-popover" hidden><strong data-status-title>Session connected</strong><span data-status-detail>Changes are stored locally.</span><code data-status-project></code><code data-status-revision></code><div class="status-popover-actions"><button data-status-checklist>Getting started</button><button data-status-diagnostics>Copy diagnostics</button><button data-status-retry>Check connection</button></div></div>'
|
|
1895
1916
|
);
|
|
1896
1917
|
shadow.querySelector(".panel").insertAdjacentHTML(
|
|
1897
1918
|
"beforeend",
|
|
@@ -1901,7 +1922,7 @@ function installFoundryInspector(options = {}) {
|
|
|
1901
1922
|
onboarding.className = "onboarding-card";
|
|
1902
1923
|
onboarding.hidden = true;
|
|
1903
1924
|
onboarding.setAttribute("aria-label", "Getting started with Foundry");
|
|
1904
|
-
onboarding.innerHTML = '<div class="onboarding-card-head"><span><i data-foundry-icon="sparkles"></i></span><strong>
|
|
1925
|
+
onboarding.innerHTML = '<div class="onboarding-card-head"><span><i data-foundry-icon="sparkles"></i></span><strong>Getting started</strong><button class="onboarding-close" aria-label="Close getting started"><i data-foundry-icon="x"></i></button></div><p>Complete one real design loop. Progress stays in this browser and contains no project content.</p><div class="onboarding-steps"></div><div class="onboarding-actions"><button class="onboarding-shortcuts">View shortcuts</button><button class="onboarding-start">Continue</button></div>';
|
|
1905
1926
|
shadow.append(onboarding);
|
|
1906
1927
|
const compareBar = document.createElement("div");
|
|
1907
1928
|
compareBar.className = "compare-bar";
|
|
@@ -2152,10 +2173,84 @@ function installFoundryInspector(options = {}) {
|
|
|
2152
2173
|
const capturedBaselineRuns = /* @__PURE__ */ new Set();
|
|
2153
2174
|
let projectRoot = location.origin;
|
|
2154
2175
|
let projectRevision = "";
|
|
2176
|
+
let runtimeConnected = false;
|
|
2177
|
+
let recordedChangeCount = 0;
|
|
2178
|
+
let latestApplyState = "none";
|
|
2179
|
+
const onboardingCompleted = /* @__PURE__ */ new Set();
|
|
2155
2180
|
let designMemory = emptyDesignMemory();
|
|
2156
2181
|
let matrixMode = false;
|
|
2157
2182
|
let lastUtilityTrigger = null;
|
|
2158
2183
|
const utilityRects = /* @__PURE__ */ new Map();
|
|
2184
|
+
const onboardingSteps = [
|
|
2185
|
+
{
|
|
2186
|
+
id: "setup",
|
|
2187
|
+
title: "Setup complete",
|
|
2188
|
+
detail: "The project adapter and local session are ready."
|
|
2189
|
+
},
|
|
2190
|
+
{
|
|
2191
|
+
id: "agent",
|
|
2192
|
+
title: "Agent restarted and connected",
|
|
2193
|
+
detail: "Keep the coding agent listening while you design."
|
|
2194
|
+
},
|
|
2195
|
+
{
|
|
2196
|
+
id: "selection",
|
|
2197
|
+
title: "First element selected",
|
|
2198
|
+
detail: "Click the canvas or choose an item in Layers."
|
|
2199
|
+
},
|
|
2200
|
+
{
|
|
2201
|
+
id: "change",
|
|
2202
|
+
title: "First change recorded",
|
|
2203
|
+
detail: "Adjust a measured value in the Inspector."
|
|
2204
|
+
},
|
|
2205
|
+
{
|
|
2206
|
+
id: "apply",
|
|
2207
|
+
title: "First batch applied and verified",
|
|
2208
|
+
detail: "Review once, update source, then measure the rebuild."
|
|
2209
|
+
}
|
|
2210
|
+
];
|
|
2211
|
+
function onboardingStorageKey(suffix) {
|
|
2212
|
+
return `__foundry_getting_started:${suffix}:${projectRoot}`;
|
|
2213
|
+
}
|
|
2214
|
+
function loadOnboardingProgress() {
|
|
2215
|
+
onboardingCompleted.clear();
|
|
2216
|
+
try {
|
|
2217
|
+
const stored = JSON.parse(localStorage.getItem(onboardingStorageKey("completed")) ?? "[]");
|
|
2218
|
+
for (const id of stored) {
|
|
2219
|
+
if (onboardingSteps.some((step) => step.id === id)) onboardingCompleted.add(id);
|
|
2220
|
+
}
|
|
2221
|
+
} catch {
|
|
2222
|
+
localStorage.removeItem(onboardingStorageKey("completed"));
|
|
2223
|
+
}
|
|
2224
|
+
}
|
|
2225
|
+
function completeOnboardingStep(id) {
|
|
2226
|
+
if (onboardingCompleted.has(id)) return;
|
|
2227
|
+
onboardingCompleted.add(id);
|
|
2228
|
+
try {
|
|
2229
|
+
localStorage.setItem(
|
|
2230
|
+
onboardingStorageKey("completed"),
|
|
2231
|
+
JSON.stringify([...onboardingCompleted])
|
|
2232
|
+
);
|
|
2233
|
+
} catch {
|
|
2234
|
+
}
|
|
2235
|
+
renderOnboardingChecklist();
|
|
2236
|
+
}
|
|
2237
|
+
function renderOnboardingChecklist(forceOpen = false) {
|
|
2238
|
+
const nextStep = onboardingSteps.find((step) => !onboardingCompleted.has(step.id));
|
|
2239
|
+
const complete = !nextStep;
|
|
2240
|
+
const stepsRoot = onboarding.querySelector(".onboarding-steps");
|
|
2241
|
+
stepsRoot.innerHTML = onboardingSteps.map((step, index) => {
|
|
2242
|
+
const done = onboardingCompleted.has(step.id);
|
|
2243
|
+
const current = step.id === nextStep?.id;
|
|
2244
|
+
return `<div class="onboarding-step ${done ? "complete" : ""} ${current ? "current" : ""}"><b>${done ? '<i data-foundry-icon="check"></i>' : String(index + 1).padStart(2, "0")}</b><span><strong>${step.title}</strong><small>${step.detail}</small></span></div>`;
|
|
2245
|
+
}).join("");
|
|
2246
|
+
renderIcons(stepsRoot);
|
|
2247
|
+
const continueButton = onboarding.querySelector(".onboarding-start");
|
|
2248
|
+
const action = nextStep?.id ?? "done";
|
|
2249
|
+
continueButton.dataset.action = action;
|
|
2250
|
+
continueButton.textContent = action === "agent" ? "Copy restart prompt" : action === "selection" ? "Select an element" : action === "change" ? "Adjust a value" : action === "apply" ? "Review changes" : "Done";
|
|
2251
|
+
const dismissed = localStorage.getItem(onboardingStorageKey("dismissed")) === "1";
|
|
2252
|
+
onboarding.hidden = complete || !forceOpen && dismissed;
|
|
2253
|
+
}
|
|
2159
2254
|
function utilityStorageKey(utility) {
|
|
2160
2255
|
return `__foundry_utility_rect:${utility}:${projectRoot}`;
|
|
2161
2256
|
}
|
|
@@ -2389,16 +2484,23 @@ function installFoundryInspector(options = {}) {
|
|
|
2389
2484
|
async function hydrateSession() {
|
|
2390
2485
|
if (!sessionId || !token) return;
|
|
2391
2486
|
try {
|
|
2392
|
-
const response = await
|
|
2393
|
-
|
|
2394
|
-
|
|
2487
|
+
const [response, presence] = await Promise.all([
|
|
2488
|
+
fetch(`${runtimeUrl}/v1/sessions/${sessionId}`, {
|
|
2489
|
+
headers: { "x-foundry-token": token }
|
|
2490
|
+
}),
|
|
2491
|
+
sessionRequest("/agent-presence").catch(() => ({ connected: false, presence: null }))
|
|
2492
|
+
]);
|
|
2395
2493
|
if (!response.ok) throw new Error("The local session could not be read.");
|
|
2396
|
-
const
|
|
2494
|
+
const payload = await response.json();
|
|
2495
|
+
const { changeSet, designGraph: graph } = payload;
|
|
2496
|
+
runtimeConnected = true;
|
|
2497
|
+
activeAgentPresence = presence;
|
|
2397
2498
|
statusPopover.querySelector("[data-status-project]").textContent = changeSet.context.projectRoot;
|
|
2398
2499
|
statusPopover.querySelector("[data-status-revision]").textContent = `Revision ${changeSet.context.revision ?? "working tree"}`;
|
|
2399
2500
|
const nextProjectRoot = changeSet.context.projectRoot || location.origin;
|
|
2400
2501
|
if (projectRoot !== nextProjectRoot || !hydratedOnce) {
|
|
2401
2502
|
projectRoot = nextProjectRoot;
|
|
2503
|
+
loadOnboardingProgress();
|
|
2402
2504
|
designMemory = readDesignMemory(localStorage, projectRoot);
|
|
2403
2505
|
utilityRects.clear();
|
|
2404
2506
|
positionWorkspaceSurfaces();
|
|
@@ -2411,15 +2513,23 @@ function installFoundryInspector(options = {}) {
|
|
|
2411
2513
|
const activeChanges = changeSet.changes.filter(
|
|
2412
2514
|
(change) => change.status !== "rejected" && String(change.before) !== String(change.after)
|
|
2413
2515
|
);
|
|
2516
|
+
recordedChangeCount = activeChanges.length;
|
|
2517
|
+
latestApplyState = payload.applyRuns?.at(-1)?.state ?? "none";
|
|
2414
2518
|
updateChangeCount(activeChanges.length, activeChanges.at(-1));
|
|
2519
|
+
completeOnboardingStep("setup");
|
|
2520
|
+
if (activeAgentPresence.connected) completeOnboardingStep("agent");
|
|
2521
|
+
if (selectedElements.length) completeOnboardingStep("selection");
|
|
2522
|
+
if (activeChanges.length) completeOnboardingStep("change");
|
|
2523
|
+
if (latestApplyState === "passed") completeOnboardingStep("apply");
|
|
2524
|
+
renderOnboardingChecklist();
|
|
2415
2525
|
setSessionStatus("live");
|
|
2416
2526
|
if (!libraryPanel.hidden) renderDesignMemory();
|
|
2417
2527
|
if (changeSet.changes.length === 0 && !hydratedOnce) {
|
|
2418
2528
|
showToast("Click any element. Shift-click builds a selection.");
|
|
2419
|
-
if (!localStorage.getItem("__foundry_onboarded")) onboarding.hidden = false;
|
|
2420
2529
|
}
|
|
2421
2530
|
hydratedOnce = true;
|
|
2422
2531
|
} catch (error) {
|
|
2532
|
+
runtimeConnected = false;
|
|
2423
2533
|
setSessionStatus(
|
|
2424
2534
|
"error",
|
|
2425
2535
|
error instanceof Error ? error.message : "The local session could not be read."
|
|
@@ -3639,6 +3749,8 @@ function installFoundryInspector(options = {}) {
|
|
|
3639
3749
|
const passed = run.state === "passed";
|
|
3640
3750
|
const active = ["queued", "claimed", "applying", "rebuilding", "verifying"].includes(run.state);
|
|
3641
3751
|
const latestMessage = run.state === "queued" ? "The reviewed changes are queued. Keep your coding agent active, or ask it to apply your reviewed Foundry changes." : run.messages.at(-1)?.message ?? run.error ?? "Apply run created.";
|
|
3752
|
+
latestApplyState = run.state;
|
|
3753
|
+
if (run.state === "passed") completeOnboardingStep("apply");
|
|
3642
3754
|
captureVerifiedRun(run);
|
|
3643
3755
|
reviewCount.textContent = `Attempt ${run.attempts}`;
|
|
3644
3756
|
reviewBody.innerHTML = `<div class="run-summary"><div class="run-state"><i class="${passed ? "passed" : attention ? "attention" : active ? "active" : ""}"></i><strong>${escapeHtml(runStateLabels[run.state] ?? run.state)}</strong></div><p>${escapeHtml(latestMessage)}</p></div><div class="run-steps">${run.messages.map(
|
|
@@ -3709,6 +3821,7 @@ function installFoundryInspector(options = {}) {
|
|
|
3709
3821
|
sessionRequest("/agent-presence")
|
|
3710
3822
|
]);
|
|
3711
3823
|
activeAgentPresence = presence;
|
|
3824
|
+
if (presence.connected) completeOnboardingStep("agent");
|
|
3712
3825
|
const latestRun = payload.applyRuns?.at(-1);
|
|
3713
3826
|
const runNeedsRefresh = latestRun && [
|
|
3714
3827
|
"queued",
|
|
@@ -3748,6 +3861,7 @@ function installFoundryInspector(options = {}) {
|
|
|
3748
3861
|
sessionRequest("/agent-presence")
|
|
3749
3862
|
]);
|
|
3750
3863
|
activeAgentPresence = presence;
|
|
3864
|
+
if (presence.connected) completeOnboardingStep("agent");
|
|
3751
3865
|
renderReviewPayload(payload);
|
|
3752
3866
|
requestAnimationFrame(() => {
|
|
3753
3867
|
reviewBody.scrollTop = reviewScrollTop;
|
|
@@ -4049,6 +4163,8 @@ function installFoundryInspector(options = {}) {
|
|
|
4049
4163
|
const activeChanges = responsePayload.changeSet.changes.filter(
|
|
4050
4164
|
(change) => change.status !== "rejected" && String(change.before) !== String(change.after)
|
|
4051
4165
|
);
|
|
4166
|
+
recordedChangeCount = activeChanges.length;
|
|
4167
|
+
completeOnboardingStep("change");
|
|
4052
4168
|
lastRecordedSummary = `${target.label} \xB7 ${control.label} ${before}${control.unit ?? ""} \u2192 ${after}${control.unit ?? ""}`;
|
|
4053
4169
|
updateChangeCount(activeChanges.length, activeChanges.at(-1));
|
|
4054
4170
|
showToast(ambiguous ? "Choose the source intent in review" : "Change recorded");
|
|
@@ -5485,6 +5601,7 @@ function installFoundryInspector(options = {}) {
|
|
|
5485
5601
|
selectedElements = [element];
|
|
5486
5602
|
selected = element;
|
|
5487
5603
|
}
|
|
5604
|
+
completeOnboardingStep("selection");
|
|
5488
5605
|
if (!sectionPreferenceTouched) {
|
|
5489
5606
|
const categoryKeys = [
|
|
5490
5607
|
"position",
|
|
@@ -6085,6 +6202,25 @@ function installFoundryInspector(options = {}) {
|
|
|
6085
6202
|
}
|
|
6086
6203
|
});
|
|
6087
6204
|
statusPopover.querySelector("[data-status-retry]").addEventListener("click", () => void hydrateSession());
|
|
6205
|
+
statusPopover.querySelector("[data-status-checklist]").addEventListener("click", () => {
|
|
6206
|
+
localStorage.removeItem(onboardingStorageKey("dismissed"));
|
|
6207
|
+
renderOnboardingChecklist(true);
|
|
6208
|
+
statusPopover.hidden = true;
|
|
6209
|
+
sessionStatus.setAttribute("aria-expanded", "false");
|
|
6210
|
+
});
|
|
6211
|
+
statusPopover.querySelector("[data-status-diagnostics]").addEventListener("click", () => {
|
|
6212
|
+
const diagnostics = createSafeDiagnostics({
|
|
6213
|
+
interfaceTheme: resolvedInterfaceTheme(),
|
|
6214
|
+
runtimeConnected,
|
|
6215
|
+
agentConnected: activeAgentPresence.connected,
|
|
6216
|
+
agentName: activeAgentPresence.presence?.agent?.name,
|
|
6217
|
+
selectedCount: selectedElements.length,
|
|
6218
|
+
recordedChangeCount,
|
|
6219
|
+
latestApplyState
|
|
6220
|
+
});
|
|
6221
|
+
void navigator.clipboard.writeText(JSON.stringify(diagnostics, null, 2));
|
|
6222
|
+
showToast("Privacy-safe diagnostics copied");
|
|
6223
|
+
});
|
|
6088
6224
|
interfaceThemeTrigger.addEventListener("click", () => {
|
|
6089
6225
|
if (interfaceThemeMenu.hidden) openInterfaceThemeMenu();
|
|
6090
6226
|
else closeInterfaceThemeMenu();
|
|
@@ -6097,15 +6233,36 @@ function installFoundryInspector(options = {}) {
|
|
|
6097
6233
|
);
|
|
6098
6234
|
changeDock.querySelector(".dock-undo")?.addEventListener("click", () => void replayHistory(-1));
|
|
6099
6235
|
changeDock.querySelector(".dock-review")?.addEventListener("click", () => void openReview());
|
|
6236
|
+
onboarding.querySelector(".onboarding-close")?.addEventListener("click", () => {
|
|
6237
|
+
localStorage.setItem(onboardingStorageKey("dismissed"), "1");
|
|
6238
|
+
onboarding.hidden = true;
|
|
6239
|
+
});
|
|
6100
6240
|
onboarding.querySelector(".onboarding-start")?.addEventListener("click", () => {
|
|
6101
|
-
|
|
6241
|
+
const action = onboarding.querySelector(".onboarding-start")?.dataset.action;
|
|
6242
|
+
if (action === "agent") {
|
|
6243
|
+
void navigator.clipboard.writeText(
|
|
6244
|
+
"Start Foundry for this project and keep listening for Apply with agent requests."
|
|
6245
|
+
);
|
|
6246
|
+
showToast("Restart prompt copied");
|
|
6247
|
+
return;
|
|
6248
|
+
}
|
|
6249
|
+
if (action === "apply" && recordedChangeCount > 0) {
|
|
6250
|
+
onboarding.hidden = true;
|
|
6251
|
+
void openReview();
|
|
6252
|
+
return;
|
|
6253
|
+
}
|
|
6254
|
+
if (action === "done") {
|
|
6255
|
+
onboarding.hidden = true;
|
|
6256
|
+
return;
|
|
6257
|
+
}
|
|
6102
6258
|
onboarding.hidden = true;
|
|
6103
6259
|
inspecting = true;
|
|
6104
6260
|
updateInspectionMode();
|
|
6105
|
-
showToast(
|
|
6261
|
+
showToast(
|
|
6262
|
+
action === "change" ? "Adjust any Inspector value to record a change" : "Select mode stays on \xB7 click any element to begin"
|
|
6263
|
+
);
|
|
6106
6264
|
});
|
|
6107
6265
|
onboarding.querySelector(".onboarding-shortcuts")?.addEventListener("click", () => {
|
|
6108
|
-
localStorage.setItem("__foundry_onboarded", "1");
|
|
6109
6266
|
onboarding.hidden = true;
|
|
6110
6267
|
openCommands();
|
|
6111
6268
|
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface SafeDiagnosticsInput {
|
|
2
|
+
interfaceTheme: 'light' | 'dark';
|
|
3
|
+
runtimeConnected: boolean;
|
|
4
|
+
agentConnected: boolean;
|
|
5
|
+
agentName?: string;
|
|
6
|
+
selectedCount: number;
|
|
7
|
+
recordedChangeCount: number;
|
|
8
|
+
latestApplyState?: string;
|
|
9
|
+
protocolVersion?: string;
|
|
10
|
+
}
|
|
11
|
+
/** Build useful support state without exposing project content or session credentials. */
|
|
12
|
+
export declare function createSafeDiagnostics(input: SafeDiagnosticsInput): {
|
|
13
|
+
product: string;
|
|
14
|
+
protocolVersion: string;
|
|
15
|
+
interfaceTheme: "light" | "dark";
|
|
16
|
+
connection: {
|
|
17
|
+
agentName?: string | undefined;
|
|
18
|
+
runtime: string;
|
|
19
|
+
agent: string;
|
|
20
|
+
};
|
|
21
|
+
workspace: {
|
|
22
|
+
selectedElementCount: number;
|
|
23
|
+
recordedChangeCount: number;
|
|
24
|
+
latestApplyState: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=diagnostics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../src/diagnostics.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,cAAc,EAAE,OAAO,GAAG,MAAM,CAAC;IACjC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,OAAO,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,0FAA0F;AAC1F,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,oBAAoB;;;;;;;;;;;;;;EAgBhE"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA8DA,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,0BAA0B;IACzC,OAAO,IAAI,IAAI,CAAC;IAChB,cAAc,IAAI,IAAI,CAAC;IACvB,MAAM,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IACnC,OAAO,IAAI,IAAI,CAAC;CACjB;AAu/BD,wBAAgB,uBAAuB,CACrC,OAAO,GAAE,uBAA4B,GACpC,0BAA0B,CAg9K5B"}
|