@agent-native/core-corpus 0.216.0 → 0.217.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/corpus/README.md +1 -1
- package/corpus/templates/analytics/.agents/skills/session-replay/SKILL.md +61 -1
- package/corpus/templates/analytics/AGENTS.md +1 -1
- package/corpus/templates/analytics/CHANGELOG.md +1 -0
- package/corpus/templates/analytics/actions/get-session-replay-summary.ts +9 -65
- package/corpus/templates/analytics/actions/list-event-catalog.ts +1 -1
- package/corpus/templates/analytics/actions/list-session-outputs.ts +40 -0
- package/corpus/templates/analytics/actions/list-session-recordings.ts +17 -4
- package/corpus/templates/analytics/actions/view-screen.ts +29 -3
- package/corpus/templates/analytics/app/i18n/en-US.ts +27 -0
- package/corpus/templates/analytics/app/pages/sessions/EventCatalogPage.tsx +18 -1
- package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +3 -1
- package/corpus/templates/analytics/app/pages/sessions/SessionOutputs.tsx +197 -0
- package/corpus/templates/analytics/app/pages/sessions/SessionsTriagePage.tsx +114 -4
- package/corpus/templates/analytics/changelog/2026-10-15-sessions-can-find-people-who-made-a-slides-deck-but-didn-t-p.md +6 -0
- package/corpus/templates/analytics/changelog/2026-10-16-the-activation-funnel-counts-visitors-who-decline-analytics-.md +6 -0
- package/corpus/templates/analytics/server/db/schema.ts +67 -0
- package/corpus/templates/analytics/server/lib/canonical-first-party-dashboard-repair.ts +9 -0
- package/corpus/templates/analytics/server/lib/first-party-analytics.ts +28 -22
- package/corpus/templates/analytics/server/lib/first-party-metric-catalog.ts +36 -1
- package/corpus/templates/analytics/server/lib/output-outcomes.ts +712 -0
- package/corpus/templates/analytics/server/lib/replay-origins.ts +33 -0
- package/corpus/templates/analytics/server/lib/session-event-index.ts +20 -0
- package/corpus/templates/analytics/server/lib/session-performance.ts +6 -40
- package/corpus/templates/analytics/server/lib/session-recording-associations.ts +30 -1
- package/corpus/templates/analytics/server/lib/session-replay-triage.ts +99 -0
- package/corpus/templates/analytics/server/lib/session-replay.ts +45 -31
- package/corpus/templates/analytics/server/lib/sessions-triage-lab.ts +8 -2
- package/corpus/templates/analytics/server/plugins/db.ts +46 -0
- package/corpus/templates/analytics/shared/output-use.ts +205 -0
- package/corpus/templates/analytics/shared/session-events.ts +6 -0
- package/corpus/templates/calendar/CHANGELOG.md +6 -0
- package/corpus/templates/calendar/actions/create-event.ts +2 -4
- package/corpus/templates/calendar/actions/update-event.ts +35 -6
- package/corpus/templates/calendar/changelog/2026-10-21-solo-events-avoid-notification-approval.md +6 -0
- package/corpus/templates/community/qr/package.json +1 -1
- package/corpus/templates/content/.agents/skills/document-editing/references/databases.md +6 -3
- package/corpus/templates/content/CHANGELOG.md +8 -0
- package/corpus/templates/content/actions/_browser-document-save-attempt.ts +23 -1
- package/corpus/templates/content/actions/_builder-cms-blob-custody.ts +467 -0
- package/corpus/templates/content/actions/_builder-cms-execution-lease.ts +17 -0
- package/corpus/templates/content/actions/_builder-cms-intent-lookup.ts +5 -0
- package/corpus/templates/content/actions/_builder-cms-read-client.ts +881 -21
- package/corpus/templates/content/actions/_builder-cms-write-adapter.ts +28 -2
- package/corpus/templates/content/actions/_builder-cms-write-client.ts +109 -11
- package/corpus/templates/content/actions/_builder-docs-client.ts +1 -0
- package/corpus/templates/content/actions/_builder-private-blob.test-fixture.ts +90 -0
- package/corpus/templates/content/actions/_builder-source-execution-guard.ts +48 -0
- package/corpus/templates/content/actions/_content-save-outcomes.ts +5 -0
- package/corpus/templates/content/actions/_database-source-utils.ts +290 -8
- package/corpus/templates/content/actions/_database-utils.ts +93 -7
- package/corpus/templates/content/actions/_database-view-setup.ts +21 -2
- package/corpus/templates/content/actions/_delete-content-space.ts +8 -1
- package/corpus/templates/content/actions/_github-source-freshness.ts +30 -4
- package/corpus/templates/content/actions/add-content-database-source-field-property.ts +23 -6
- package/corpus/templates/content/actions/cancel-prepared-builder-source-update.ts +110 -26
- package/corpus/templates/content/actions/change-content-database-source-role.ts +51 -7
- package/corpus/templates/content/actions/delete-document.ts +41 -3
- package/corpus/templates/content/actions/disconnect-content-database-source.ts +68 -2
- package/corpus/templates/content/actions/disconnect-local-folder-source.ts +33 -2
- package/corpus/templates/content/actions/execute-builder-source-execution.ts +900 -140
- package/corpus/templates/content/actions/get-document.ts +2 -0
- package/corpus/templates/content/actions/permanently-delete-document.ts +6 -0
- package/corpus/templates/content/actions/prepare-builder-source-execution.ts +155 -13
- package/corpus/templates/content/actions/prepare-builder-source-review.ts +299 -73
- package/corpus/templates/content/actions/set-live-body-switch.ts +45 -0
- package/corpus/templates/content/actions/update-document.ts +139 -20
- package/corpus/templates/content/actions/validate-builder-source-execution.ts +135 -26
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +23 -0
- package/corpus/templates/content/app/components/editor/database/GitHubSourceStatusLine.tsx +27 -2
- package/corpus/templates/content/app/components/editor/database/ListItemLayout.tsx +32 -8
- package/corpus/templates/content/app/components/editor/database/ListItemRow.tsx +27 -2
- package/corpus/templates/content/app/components/editor/database-sources/BuilderSourceReviewDialog.tsx +1 -0
- package/corpus/templates/content/app/hooks/use-content-database.ts +40 -2
- package/corpus/templates/content/app/hooks/use-documents.ts +14 -0
- package/corpus/templates/content/app/i18n-data.ts +1 -0
- package/corpus/templates/content/changelog/2026-10-17-builder-content-avoids-retrying-a-write-when-builder-accepte.md +6 -0
- package/corpus/templates/content/changelog/2026-10-18-link-a-new-collection-to-a-github-folder-from-its-sources.md +1 -1
- package/corpus/templates/content/changelog/2026-10-20-builder-content-sync-keeps-read-and-write-status-accurate-wh.md +6 -0
- package/corpus/templates/content/changelog/2026-10-21-list-rows-can-show-each-pages-first-lines.md +6 -0
- package/corpus/templates/content/changelog/2026-10-22-a-collection-linked-to-a-big-github-folder-fills-faster-and-p.md +6 -0
- package/corpus/templates/content/docs/product/capabilities/content.source.adapters.md +29 -0
- package/corpus/templates/content/parity/matrix.md +42 -42
- package/corpus/templates/content/parity/matrix.ts +3 -1
- package/corpus/templates/content/server/db/schema.ts +20 -0
- package/corpus/templates/content/server/lib/content-trash-purge.ts +15 -1
- package/corpus/templates/content/server/lib/live-body-writer.ts +138 -26
- package/corpus/templates/content/server/live-copy/binding.ts +31 -0
- package/corpus/templates/content/server/live-copy/bounded-task.d.ts +6 -0
- package/corpus/templates/content/server/live-copy/exec-db.ts +1 -0
- package/corpus/templates/content/server/live-copy/holds.ts +59 -0
- package/corpus/templates/content/server/live-copy/persist.ts +656 -0
- package/corpus/templates/content/server/live-copy/switch.ts +136 -0
- package/corpus/templates/content/server/live-copy/task-names.ts +4 -0
- package/corpus/templates/content/server/live-copy/tasks.ts +183 -0
- package/corpus/templates/content/server/live-copy/write-cause.ts +85 -0
- package/corpus/templates/content/server/live-copy/write.ts +85 -0
- package/corpus/templates/content/server/plugins/builder-private-payload-cleanup.ts +22 -0
- package/corpus/templates/content/server/plugins/collab.ts +3 -0
- package/corpus/templates/content/server/plugins/db.ts +28 -0
- package/corpus/templates/content/shared/api.ts +30 -1
- package/corpus/templates/content/shared/database-item-layout.ts +54 -22
- package/corpus/templates/content/shared/document-intent-merge.ts +16 -9
- package/corpus/templates/content/shared/og-description.ts +258 -36
- package/corpus/templates/design/.agents/skills/design-templates/SKILL.md +5 -1
- package/corpus/templates/design/.generated/bridge/shader-runtime.generated.ts +25 -4
- package/corpus/templates/design/CHANGELOG.md +2 -0
- package/corpus/templates/design/actions/get-getting-started.ts +53 -0
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +10 -0
- package/corpus/templates/design/app/components/design/bridge/native-shader-runtime.bridge.ts +132 -79
- package/corpus/templates/design/app/components/design/bridge/native-source-provider.ts +268 -130
- package/corpus/templates/design/app/components/design/bridge/native-worker-scene-host.ts +122 -42
- package/corpus/templates/design/app/components/design/bridge/shader-runtime.bridge.ts +41 -4
- package/corpus/templates/design/app/components/design/design-canvas/text-content-change-result.ts +46 -12
- package/corpus/templates/design/app/components/home/DesignHomeLibrary.tsx +15 -8
- package/corpus/templates/design/app/components/layout/GettingStarted.tsx +50 -0
- package/corpus/templates/design/app/components/layout/Sidebar.tsx +3 -0
- package/corpus/templates/design/app/components/templates/DesignTemplateGrid.tsx +163 -0
- package/corpus/templates/design/app/components/templates/DesignTemplateLibrary.tsx +65 -78
- package/corpus/templates/design/app/components/templates/TemplatePreview.tsx +6 -2
- package/corpus/templates/design/app/global.css +6 -0
- package/corpus/templates/design/app/i18n/en-US.ts +17 -0
- package/corpus/templates/design/app/lib/canvas-load-outcome.ts +147 -0
- package/corpus/templates/design/app/lib/canvas-outcome-tracking.ts +531 -0
- package/corpus/templates/design/app/lib/canvas-style-kind.ts +50 -0
- package/corpus/templates/design/app/pages/Index.tsx +10 -3
- package/corpus/templates/design/app/pages/design-editor/commands/commit-visual-styles.ts +86 -29
- package/corpus/templates/design/app/pages/design-editor/commands/save-file-content.ts +38 -3
- package/corpus/templates/design/app/pages/design-editor/domains/use-editor-core.ts +9 -0
- package/corpus/templates/design/app/pages/design-editor/domains/use-editor-files-and-saving.ts +2 -0
- package/corpus/templates/design/changelog/2026-10-21-a-getting-started-checklist-at-the-bottom-of-the-sidebar-tra.md +6 -0
- package/corpus/templates/design/changelog/2026-10-21-templates-now-open-a-read-only-preview-from-the-card-and-the.md +6 -0
- package/corpus/templates/design/changelog/2026-10-22-collapsed-shader-layers-no-longer-interrupt-other-shaders-on.md +6 -0
- package/corpus/templates/design/changelog/2026-10-22-shader-fills-keep-rendering-when-other-screen-content-cannot.md +6 -0
- package/corpus/templates/design/scripts/design-export-validation/export-baseline.json +24 -0
- package/corpus/templates/design/server/lib/getting-started.ts +267 -0
- package/corpus/templates/design/server/plugins/getting-started.ts +5 -0
- package/corpus/templates/design/shared/design-template-presets/analytics-dashboard.ts +127 -0
- package/corpus/templates/design/shared/design-template-presets/design-studio.ts +98 -0
- package/corpus/templates/design/shared/design-template-presets/messaging-app.ts +101 -0
- package/corpus/templates/design/shared/design-template-presets/project-tasks.ts +120 -0
- package/corpus/templates/design/shared/design-template-presets.ts +8 -0
- package/corpus/templates/forms/server/plugins/agent-chat.ts +1 -1
- package/corpus/templates/slides/CHANGELOG.md +6 -0
- package/corpus/templates/slides/actions/delete-deck.ts +7 -0
- package/corpus/templates/slides/changelog/2026-10-21-connected-deck-deletion-requires-approval.md +6 -0
- package/corpus/templates/slides/scripts/edit-fidelity/client-action.ts +61 -0
- package/corpus/templates/slides/scripts/edit-fidelity/run.ts +10 -0
- package/package.json +1 -1
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import type { DesignTemplatePreset } from "../design-template-presets.js";
|
|
2
|
+
import { presetDocument } from "./doc.js";
|
|
3
|
+
|
|
4
|
+
const C = {
|
|
5
|
+
// guard:allow-raw-color — authored template palette, not app chrome.
|
|
6
|
+
canvas: "#FBF1E3",
|
|
7
|
+
// guard:allow-raw-color — authored template palette, not app chrome.
|
|
8
|
+
ink: "#3A2412",
|
|
9
|
+
// guard:allow-raw-color — authored template palette, not app chrome.
|
|
10
|
+
muted: "#8C6B4F",
|
|
11
|
+
// guard:allow-raw-color — authored template palette, not app chrome.
|
|
12
|
+
paper: "#FFFAF2",
|
|
13
|
+
// guard:allow-raw-color — authored template palette, not app chrome.
|
|
14
|
+
todo: "#F3C99A",
|
|
15
|
+
// guard:allow-raw-color — authored template palette, not app chrome.
|
|
16
|
+
doing: "#E89A5E",
|
|
17
|
+
// guard:allow-raw-color — authored template palette, not app chrome.
|
|
18
|
+
done: "#C96F3B",
|
|
19
|
+
// guard:allow-raw-color — authored template palette, not app chrome.
|
|
20
|
+
lane: "#F6E3CB",
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
type Task = [string, string];
|
|
24
|
+
const columns: [string, string, Task[]][] = [
|
|
25
|
+
[
|
|
26
|
+
"To do",
|
|
27
|
+
"todo",
|
|
28
|
+
[
|
|
29
|
+
["Draft onboarding emails", "Mara"],
|
|
30
|
+
["Audit pricing page copy", "Jules"],
|
|
31
|
+
["Plan Q3 roadmap review", "Sam"],
|
|
32
|
+
],
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
"In progress",
|
|
36
|
+
"doing",
|
|
37
|
+
[
|
|
38
|
+
["Redesign settings screen", "Ines"],
|
|
39
|
+
["Ship search filters", "Theo"],
|
|
40
|
+
["Prepare launch checklist", "Mara"],
|
|
41
|
+
],
|
|
42
|
+
],
|
|
43
|
+
[
|
|
44
|
+
"Done",
|
|
45
|
+
"done",
|
|
46
|
+
[
|
|
47
|
+
["Fix sign-in redirect", "Sam"],
|
|
48
|
+
["Publish changelog v2.4", "Jules"],
|
|
49
|
+
["Migrate analytics events", "Theo"],
|
|
50
|
+
],
|
|
51
|
+
],
|
|
52
|
+
];
|
|
53
|
+
|
|
54
|
+
const lanes = columns
|
|
55
|
+
.map(
|
|
56
|
+
([name, tone, tasks]) => `
|
|
57
|
+
<section class="lane" data-agent-native-node-id="lane-${tone}" data-agent-native-layer-name="${name}">
|
|
58
|
+
<h2><span>${name}</span><b>${tasks.length}</b></h2>
|
|
59
|
+
${tasks
|
|
60
|
+
.map(
|
|
61
|
+
([title, owner]) =>
|
|
62
|
+
`<article class="task ${tone}"><p>${title}</p><small>${owner}</small></article>`,
|
|
63
|
+
)
|
|
64
|
+
.join("")}
|
|
65
|
+
</section>`,
|
|
66
|
+
)
|
|
67
|
+
.join("");
|
|
68
|
+
|
|
69
|
+
export const projectTasks: DesignTemplatePreset = {
|
|
70
|
+
id: "preset-project-tasks",
|
|
71
|
+
title: "Project tasks",
|
|
72
|
+
description: "Plan, assign, and ship work faster.",
|
|
73
|
+
category: "other",
|
|
74
|
+
width: 1440,
|
|
75
|
+
height: 900,
|
|
76
|
+
filename: "project-tasks.html",
|
|
77
|
+
content: presetDocument({
|
|
78
|
+
title: "Tally — Project tasks",
|
|
79
|
+
width: 1440,
|
|
80
|
+
height: 900,
|
|
81
|
+
fonts: "family=Manrope:wght@400;600;700;800",
|
|
82
|
+
palette: {
|
|
83
|
+
canvas: C.canvas,
|
|
84
|
+
ink: C.ink,
|
|
85
|
+
muted: C.muted,
|
|
86
|
+
paper: C.paper,
|
|
87
|
+
todo: C.todo,
|
|
88
|
+
doing: C.doing,
|
|
89
|
+
done: C.done,
|
|
90
|
+
lane: C.lane,
|
|
91
|
+
},
|
|
92
|
+
css: `
|
|
93
|
+
.artboard { color:var(--ink); font-family:'Manrope', sans-serif; }
|
|
94
|
+
.top { position:absolute; left:56px; right:56px; top:36px; z-index:1; display:flex; justify-content:flex-end; align-items:center; gap:12px; height:44px; }
|
|
95
|
+
.top span { padding:10px 18px; border-radius:999px; background:var(--lane); color:var(--muted); font-size:14px; font-weight:600; }
|
|
96
|
+
.top span.primary { background:var(--ink); color:var(--paper); }
|
|
97
|
+
.board { position:absolute; left:56px; right:56px; top:112px; bottom:56px; z-index:1; display:grid; grid-template-columns:repeat(3,1fr); gap:24px; }
|
|
98
|
+
.lane { padding:20px; border-radius:20px; background:var(--lane); }
|
|
99
|
+
.lane h2 { display:flex; justify-content:space-between; align-items:center; margin-bottom:18px; color:var(--muted); font-size:13px; font-weight:800; letter-spacing:.12em; text-transform:uppercase; }
|
|
100
|
+
.lane h2 b { padding:2px 10px; border-radius:999px; background:var(--paper); font-size:12px; }
|
|
101
|
+
.task { display:flex; flex-direction:column; justify-content:space-between; height:150px; margin-bottom:16px; padding:20px 22px; border-radius:16px; box-shadow:0 8px 24px color-mix(in srgb, var(--ink) 14%, transparent); }
|
|
102
|
+
.task p { font-size:20px; font-weight:700; line-height:1.25; letter-spacing:-.01em; }
|
|
103
|
+
.task small { font-size:14px; font-weight:400; opacity:.75; }
|
|
104
|
+
.task.todo { background:var(--todo); }
|
|
105
|
+
.task.doing { background:var(--doing); }
|
|
106
|
+
.task.done { background:var(--done); color:var(--paper); }
|
|
107
|
+
`,
|
|
108
|
+
body: `
|
|
109
|
+
<div style="position:absolute;inset:0;background:${C.canvas}" data-agent-native-node-id="template-background" data-agent-native-layer-name="Background" data-agent-native-locked="true"></div>
|
|
110
|
+
<div style="position:absolute;left:56px;top:40px;z-index:2;display:flex;align-items:center;gap:10px;color:${C.ink};font:800 24px/1 'Manrope',sans-serif;letter-spacing:-.03em" data-agent-native-node-id="template-logo" data-agent-native-layer-name="Logo" data-agent-native-locked="true">
|
|
111
|
+
<svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><rect width="30" height="30" rx="9" fill="${C.done}"/><path d="M8 15.5l4.5 4.5L22 10" fill="none" stroke="${C.paper}" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
|
112
|
+
<span>Tally</span>
|
|
113
|
+
</div>
|
|
114
|
+
<header class="top" data-agent-native-node-id="toolbar" data-agent-native-layer-name="Toolbar">
|
|
115
|
+
<span>This sprint</span><span>Filter</span><span class="primary">New task</span>
|
|
116
|
+
</header>
|
|
117
|
+
<div class="board" data-agent-native-node-id="board" data-agent-native-layer-name="Board">${lanes}
|
|
118
|
+
</div>`,
|
|
119
|
+
}),
|
|
120
|
+
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { analyticsDashboard } from "./design-template-presets/analytics-dashboard.js";
|
|
2
|
+
import { designStudio } from "./design-template-presets/design-studio.js";
|
|
1
3
|
import { displayLuxury } from "./design-template-presets/display-ad.js";
|
|
2
4
|
import { eventPoster } from "./design-template-presets/event-poster.js";
|
|
3
5
|
import { keynoteTitle } from "./design-template-presets/keynote-title.js";
|
|
@@ -6,7 +8,9 @@ import { landingDtc } from "./design-template-presets/landing-dtc.js";
|
|
|
6
8
|
import { leaderboard } from "./design-template-presets/leaderboard.js";
|
|
7
9
|
import { LEGACY_DESIGN_TEMPLATE_PRESETS } from "./design-template-presets/legacy.js";
|
|
8
10
|
import { menuCard } from "./design-template-presets/menu-card.js";
|
|
11
|
+
import { messagingApp } from "./design-template-presets/messaging-app.js";
|
|
9
12
|
import { onePagerEditorial } from "./design-template-presets/one-pager.js";
|
|
13
|
+
import { projectTasks } from "./design-template-presets/project-tasks.js";
|
|
10
14
|
import { socialBrutalist } from "./design-template-presets/social-brutalist.js";
|
|
11
15
|
import { socialStory } from "./design-template-presets/social-story.js";
|
|
12
16
|
import { videoThumbnail } from "./design-template-presets/video-thumbnail.js";
|
|
@@ -31,6 +35,10 @@ export interface DesignTemplatePreset {
|
|
|
31
35
|
}
|
|
32
36
|
|
|
33
37
|
export const DESIGN_TEMPLATE_PRESETS: DesignTemplatePreset[] = [
|
|
38
|
+
analyticsDashboard,
|
|
39
|
+
messagingApp,
|
|
40
|
+
projectTasks,
|
|
41
|
+
designStudio,
|
|
34
42
|
socialStory,
|
|
35
43
|
keynoteTitle,
|
|
36
44
|
landingDevtool,
|
|
@@ -58,7 +58,7 @@ export default createAgentChatPlugin({
|
|
|
58
58
|
initialToolNames: INITIAL_TOOL_NAMES,
|
|
59
59
|
mcp: {
|
|
60
60
|
instructions:
|
|
61
|
-
|
|
61
|
+
"Build a complete new form with create-form. For edits, publishing, existing forms, response analysis, or exports, use ask_app because these operations have no advertised direct tool. Include the form ID when known and describe the requested outcome. If ask_app returns a taskId, follow its ask_app_status polling instruction until the task completes. Copy a returned publicUrl verbatim instead of constructing a public link. Never invent SQL or response data.",
|
|
62
62
|
},
|
|
63
63
|
actions: loadActionsFromStaticRegistry(actionsRegistry),
|
|
64
64
|
nativeActionsInDev: true,
|
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable user-facing changes to Agent-Native Slides are documented here. Open it any
|
|
4
4
|
time from the command menu (Cmd+K → "What's new").
|
|
5
5
|
|
|
6
|
+
## 2026-10-21
|
|
7
|
+
|
|
8
|
+
### Fixed
|
|
9
|
+
|
|
10
|
+
- Deleting a deck through an agent requires approval for each deletion.
|
|
11
|
+
|
|
6
12
|
## 2026-10-20
|
|
7
13
|
|
|
8
14
|
### Improved
|
|
@@ -13,6 +13,13 @@ export default defineAction({
|
|
|
13
13
|
id: z.string().min(1).describe("Deck ID"),
|
|
14
14
|
}),
|
|
15
15
|
http: { method: "DELETE" },
|
|
16
|
+
needsApproval: true,
|
|
17
|
+
allowPersistentApproval: false,
|
|
18
|
+
mcpAnnotations: {
|
|
19
|
+
readOnlyHint: false,
|
|
20
|
+
destructiveHint: true,
|
|
21
|
+
openWorldHint: false,
|
|
22
|
+
},
|
|
16
23
|
run: async ({ id }) => {
|
|
17
24
|
try {
|
|
18
25
|
const access = await assertAccess("deck", id, "admin");
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ActionHttpError,
|
|
3
|
+
ActionRequestTimeoutError,
|
|
4
|
+
ActionTransportError,
|
|
5
|
+
isPlaywrightTargetTransportFailure,
|
|
6
|
+
} from "./run-outcomes.ts";
|
|
7
|
+
|
|
8
|
+
interface BrowserActionArgs {
|
|
9
|
+
body: Record<string, unknown>;
|
|
10
|
+
compatibilityVersion: string;
|
|
11
|
+
source: string;
|
|
12
|
+
timeoutMs: number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface ActionPage {
|
|
16
|
+
evaluate<A, R>(run: (args: A) => Promise<R>, args: A): Promise<R>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export async function deleteScratchDeck<T>(
|
|
20
|
+
page: ActionPage,
|
|
21
|
+
args: BrowserActionArgs,
|
|
22
|
+
): Promise<T> {
|
|
23
|
+
const result = await page
|
|
24
|
+
.evaluate(async ({ body, compatibilityVersion, source, timeoutMs }) => {
|
|
25
|
+
try {
|
|
26
|
+
const { callAction } = await import(source);
|
|
27
|
+
const value: T = await callAction("delete-deck", body, {
|
|
28
|
+
method: "DELETE",
|
|
29
|
+
uiOnly: true,
|
|
30
|
+
timeoutMs,
|
|
31
|
+
// Cleanup can run before Vite's client bootstrap sets define globals.
|
|
32
|
+
headers: {
|
|
33
|
+
"X-Agent-Native-Client-Compatibility": compatibilityVersion,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
return { kind: "success" as const, value };
|
|
37
|
+
} catch (error) {
|
|
38
|
+
const fault = error as { status?: unknown; timedOut?: unknown } | null;
|
|
39
|
+
// Playwright does not preserve custom Error properties across evaluate.
|
|
40
|
+
return {
|
|
41
|
+
kind: "failure" as const,
|
|
42
|
+
message: String(error),
|
|
43
|
+
status: typeof fault?.status === "number" ? fault.status : null,
|
|
44
|
+
timedOut: fault?.timedOut === true,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}, args)
|
|
48
|
+
.catch((error: unknown) => {
|
|
49
|
+
if (isPlaywrightTargetTransportFailure(error)) {
|
|
50
|
+
throw new ActionTransportError(
|
|
51
|
+
`delete-deck action evaluation failed: ${String(error)}`,
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
throw error;
|
|
55
|
+
});
|
|
56
|
+
if (result.kind === "success") return result.value;
|
|
57
|
+
if (result.timedOut) throw new ActionRequestTimeoutError(result.message);
|
|
58
|
+
if (result.status !== null)
|
|
59
|
+
throw new ActionHttpError("delete-deck", result.status);
|
|
60
|
+
throw new ActionTransportError(result.message);
|
|
61
|
+
}
|
|
@@ -16,6 +16,7 @@ import { fileURLToPath } from "node:url";
|
|
|
16
16
|
import { parse, type DefaultTreeAdapterTypes as P5 } from "parse5";
|
|
17
17
|
|
|
18
18
|
import { IN_PLACE_TEXT_UNDO_LIMIT } from "../../app/components/editor/in-place-text-session.ts";
|
|
19
|
+
import { CLIENT_COMPATIBILITY_VERSION } from "../../shared/client-compatibility.ts";
|
|
19
20
|
import {
|
|
20
21
|
pick,
|
|
21
22
|
resolvePnpmEntry,
|
|
@@ -53,6 +54,7 @@ import {
|
|
|
53
54
|
shouldRetainCleanupRecoveryClaimEvidence,
|
|
54
55
|
type AuthoringFuzzPersistence,
|
|
55
56
|
} from "./authoring-fuzz.ts";
|
|
57
|
+
import { deleteScratchDeck } from "./client-action.ts";
|
|
56
58
|
import { devServerListeningUrl } from "./dev-server-url.ts";
|
|
57
59
|
import {
|
|
58
60
|
CHROME_SELECTOR,
|
|
@@ -742,6 +744,14 @@ async function action<T = any>(
|
|
|
742
744
|
method: "DELETE" | "GET" | "POST" = "POST",
|
|
743
745
|
timeoutMs = 30_000,
|
|
744
746
|
): Promise<T> {
|
|
747
|
+
if (name === "delete-deck") {
|
|
748
|
+
return deleteScratchDeck<T>(page, {
|
|
749
|
+
body,
|
|
750
|
+
compatibilityVersion: CLIENT_COMPATIBILITY_VERSION,
|
|
751
|
+
source: `/@fs/${WORKTREE_ROOT.replace(/\\/g, "/")}/packages/core/src/client/use-action.ts`,
|
|
752
|
+
timeoutMs,
|
|
753
|
+
});
|
|
754
|
+
}
|
|
745
755
|
const evaluation = page.evaluate(
|
|
746
756
|
async ({ name, body, method, timeoutMs }: any) => {
|
|
747
757
|
const url =
|
package/package.json
CHANGED