@agent-native/core 0.91.0 → 0.91.2
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/blueprints/action/crud.md +1 -1
- package/blueprints/channel/discord.md +1 -1
- package/blueprints/provider/stripe.md +1 -1
- package/blueprints/sandbox/docker.md +1 -1
- package/corpus/README.md +1 -1
- package/corpus/core/CHANGELOG.md +26 -0
- package/corpus/core/blueprints/action/crud.md +1 -1
- package/corpus/core/blueprints/channel/discord.md +1 -1
- package/corpus/core/blueprints/provider/stripe.md +1 -1
- package/corpus/core/blueprints/sandbox/docker.md +1 -1
- package/corpus/core/package.json +6 -5
- package/corpus/core/src/agent/run-manager.ts +23 -2
- package/corpus/core/src/agent/run-store.ts +2 -2
- package/corpus/core/src/cli/add.ts +1 -1
- package/corpus/core/src/cli/create.ts +8 -3
- package/corpus/core/src/cli/design-connect.ts +53 -9
- package/corpus/core/src/cli/index.ts +5 -4
- package/corpus/core/src/client/extensions/ExtensionSlot.tsx +7 -0
- package/corpus/core/src/client/session-replay.ts +97 -3
- package/corpus/core/src/jobs/scheduler.ts +30 -1
- package/corpus/core/src/localization/default-messages.ts +21 -0
- package/corpus/core/src/templates/default/app/i18n/ar-SA.ts +21 -0
- package/corpus/core/src/templates/default/app/i18n/de-DE.ts +21 -0
- package/corpus/core/src/templates/default/app/i18n/en-US.ts +21 -0
- package/corpus/core/src/templates/default/app/i18n/es-ES.ts +21 -0
- package/corpus/core/src/templates/default/app/i18n/fr-FR.ts +21 -0
- package/corpus/core/src/templates/default/app/i18n/hi-IN.ts +20 -0
- package/corpus/core/src/templates/default/app/i18n/ja-JP.ts +21 -0
- package/corpus/core/src/templates/default/app/i18n/ko-KR.ts +20 -0
- package/corpus/core/src/templates/default/app/i18n/pt-BR.ts +21 -0
- package/corpus/core/src/templates/default/app/i18n/zh-CN.ts +20 -0
- package/corpus/core/src/templates/default/app/i18n/zh-TW.ts +19 -0
- package/corpus/core/src/templates/default/package.json +2 -2
- package/corpus/core/src/templates/headless/package.json +3 -3
- package/corpus/core/src/templates/workspace-core/package.json +6 -6
- package/corpus/core/src/templates/workspace-root/package.json +2 -2
- package/corpus/core/src/triggers/dispatcher.ts +30 -2
- package/corpus/core/src/vite/client.ts +96 -1
- package/corpus/templates/analytics/.agents/skills/session-replay/SKILL.md +21 -2
- package/corpus/templates/analytics/app/global.css +26 -10
- package/corpus/templates/analytics/app/i18n/zh-TW.ts +2 -0
- package/corpus/templates/analytics/app/i18n-data.ts +25 -0
- package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +548 -237
- package/corpus/templates/analytics/app/pages/sessions/SessionDevToolsPanel.tsx +285 -294
- package/corpus/templates/analytics/changelog/2026-07-08-console-details-expand-inline-under-each-row-and-the-event-t.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-08-session-replay-clamps-ultra-wide-viewports-while-keeping-the.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-08-session-replay-keeps-a-usable-stage-when-dev-tools-is-open-a.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-08-session-replay-resumes-after-scrubbing-and-expands-console-r.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-08-session-replays-wait-for-full-load-keep-a-normal-viewport-an.md +6 -0
- package/corpus/templates/analytics/package.json +2 -2
- package/corpus/templates/assets/package.json +2 -2
- package/corpus/templates/brain/package.json +2 -2
- package/corpus/templates/calendar/AGENTS.md +10 -0
- package/corpus/templates/calendar/actions/create-event.ts +5 -1
- package/corpus/templates/calendar/actions/event-action-helpers.ts +41 -0
- package/corpus/templates/calendar/actions/get-attendee-timezones.ts +28 -0
- package/corpus/templates/calendar/actions/set-attendee-timezone.ts +68 -0
- package/corpus/templates/calendar/app/components/calendar/EventAttendeesSection.tsx +150 -11
- package/corpus/templates/calendar/app/components/calendar/EventDetailPanel.tsx +36 -1
- package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +32 -0
- package/corpus/templates/calendar/app/hooks/use-attendee-timezones.ts +24 -0
- package/corpus/templates/calendar/app/i18n/zh-TW.ts +2 -0
- package/corpus/templates/calendar/app/i18n-data.ts +20 -0
- package/corpus/templates/calendar/app/lib/attendee-local-time.ts +122 -0
- package/corpus/templates/calendar/changelog/2026-07-08-event-details-now-support-extension-widgets-and-you-can-see-.md +6 -0
- package/corpus/templates/calendar/changelog/2026-07-08-when-you-invite-guests-to-a-new-event-you-now-appear-in.md +6 -0
- package/corpus/templates/calendar/package.json +2 -2
- package/corpus/templates/calendar/server/handlers/events.ts +5 -1
- package/corpus/templates/calendar/shared/api.ts +6 -0
- package/corpus/templates/chat/package.json +2 -2
- package/corpus/templates/clips/.agents/skills/meetings/SKILL.md +6 -2
- package/corpus/templates/clips/actions/create-meeting.ts +8 -3
- package/corpus/templates/clips/actions/list-meetings.ts +31 -3
- package/corpus/templates/clips/changelog/2026-07-08-after-finishing-a-desktop-recording-reopening-clips-restor.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-08-clips-now-pops-up-to-take-notes-when-you-join-an-adhoc-zoom-.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-08-desktop-clip-recordings-are-louder-after-capture-mic-only.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-08-meeting-reminders-now-appear-1-minute-before-start-stay-unti.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-08-the-desktop-meetings-panel-has-room-for-its-drop-shadow-and-.md +6 -0
- package/corpus/templates/clips/chrome-extension/package.json +2 -2
- package/corpus/templates/clips/desktop/package.json +2 -2
- package/corpus/templates/clips/desktop/src/app.tsx +91 -34
- package/corpus/templates/clips/desktop/src/hooks/useMeetingTranscription.ts +15 -5
- package/corpus/templates/clips/desktop/src/lib/meeting-notification-timing.ts +83 -0
- package/corpus/templates/clips/desktop/src/lib/native-recording-warm.ts +21 -0
- package/corpus/templates/clips/desktop/src/lib/recorder.ts +98 -20
- package/corpus/templates/clips/desktop/src/overlays/meeting-notification.tsx +174 -50
- package/corpus/templates/clips/desktop/src/styles.css +128 -53
- package/corpus/templates/clips/desktop/src-tauri/src/adhoc_meetings_watcher.rs +364 -0
- package/corpus/templates/clips/desktop/src-tauri/src/clips/mod.rs +1 -1
- package/corpus/templates/clips/desktop/src-tauri/src/lib.rs +5 -0
- package/corpus/templates/clips/desktop/src-tauri/src/meetings_watcher.rs +91 -11
- package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +69 -19
- package/corpus/templates/clips/desktop/src-tauri/src/native_speech.rs +36 -1
- package/corpus/templates/clips/desktop/src-tauri/src/notifications.rs +62 -10
- package/corpus/templates/clips/desktop/src-tauri/src/silence_detector.rs +1 -24
- package/corpus/templates/clips/desktop/src-tauri/src/util.rs +36 -1
- package/corpus/templates/clips/package.json +2 -2
- package/corpus/templates/content/actions/_content-database-personal-view.ts +80 -0
- package/corpus/templates/content/actions/get-content-database-personal-view.ts +27 -0
- package/corpus/templates/content/actions/update-content-database-personal-view.ts +31 -0
- package/corpus/templates/content/actions/update-content-database-view.ts +3 -0
- package/corpus/templates/content/app/components/editor/DocumentProperties.tsx +1 -1
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +2584 -546
- package/corpus/templates/content/app/components/editor/database/filter-sort.ts +220 -18
- package/corpus/templates/content/app/hooks/use-content-database.ts +32 -0
- package/corpus/templates/content/app/i18n/zh-TW.ts +16 -0
- package/corpus/templates/content/app/i18n-data.ts +154 -0
- package/corpus/templates/content/changelog/2026-07-08-database-filters-now-support-notion-style-reset-save-for-eve.md +6 -0
- package/corpus/templates/content/changelog/2026-07-08-date-filters-can-now-target-a-between-range.md +6 -0
- package/corpus/templates/content/package.json +2 -2
- package/corpus/templates/content/parity/matrix.md +1 -1
- package/corpus/templates/content/parity/matrix.ts +2 -0
- package/corpus/templates/content/shared/api.ts +24 -0
- package/corpus/templates/design/AGENTS.md +9 -0
- package/corpus/templates/design/actions/request-localhost-write-consent.ts +141 -0
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +13 -19
- package/corpus/templates/design/package.json +2 -2
- package/corpus/templates/design/server/lib/verify-write-grant.ts +4 -2
- package/corpus/templates/dispatch/app/i18n/zh-TW.ts +34 -1
- package/corpus/templates/dispatch/app/i18n-data.ts +387 -10
- package/corpus/templates/dispatch/app/routes/automations.tsx +1 -0
- package/corpus/templates/dispatch/changelog/2026-07-08-added-an-automations-page-to-review-pause-and-create.md +6 -0
- package/corpus/templates/dispatch/changelog/2026-07-08-destinations-now-shows-outbound-delivery-queue-health.md +6 -0
- package/corpus/templates/dispatch/package.json +2 -2
- package/corpus/templates/forms/package.json +2 -2
- package/corpus/templates/macros/package.json +2 -2
- package/corpus/templates/mail/app/hooks/use-emails.ts +56 -44
- package/corpus/templates/mail/app/lib/gmail-mutation-queue.ts +325 -0
- package/corpus/templates/mail/changelog/2026-07-08-rapid-archive-and-mark-read-now-batch-gmail-updates-so-the-i.md +6 -0
- package/corpus/templates/mail/package.json +2 -2
- package/corpus/templates/plan/package.json +2 -2
- package/corpus/templates/slides/app/components/editor/ImageDropPromptPopover.tsx +46 -29
- package/corpus/templates/slides/app/context/DeckContext.tsx +45 -18
- package/corpus/templates/slides/app/i18n/ar-SA.ts +4 -0
- package/corpus/templates/slides/app/i18n/de-DE.ts +4 -0
- package/corpus/templates/slides/app/i18n/en-US.ts +4 -0
- package/corpus/templates/slides/app/i18n/es-ES.ts +4 -0
- package/corpus/templates/slides/app/i18n/fr-FR.ts +4 -0
- package/corpus/templates/slides/app/i18n/hi-IN.ts +4 -0
- package/corpus/templates/slides/app/i18n/ja-JP.ts +4 -0
- package/corpus/templates/slides/app/i18n/ko-KR.ts +4 -0
- package/corpus/templates/slides/app/i18n/pt-BR.ts +4 -0
- package/corpus/templates/slides/app/i18n/zh-CN.ts +4 -0
- package/corpus/templates/slides/app/i18n/zh-TW.ts +4 -0
- package/corpus/templates/slides/app/lib/image-drop-to-agent.ts +115 -0
- package/corpus/templates/slides/app/pages/DeckEditor.tsx +22 -13
- package/corpus/templates/slides/changelog/2026-07-08-dropping-an-image-onto-a-slide-and-sending-it-to-the-agent-w.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-08-undo-works-after-the-agent-edits-a-slide-so-you-can-reverse.md +6 -0
- package/corpus/templates/slides/package.json +2 -2
- package/dist/agent/run-manager.d.ts.map +1 -1
- package/dist/agent/run-manager.js +23 -2
- package/dist/agent/run-manager.js.map +1 -1
- package/dist/agent/run-store.js +2 -2
- package/dist/agent/run-store.js.map +1 -1
- package/dist/catalog.json +2 -2
- package/dist/cli/add.js +1 -1
- package/dist/cli/add.js.map +1 -1
- package/dist/cli/create.d.ts.map +1 -1
- package/dist/cli/create.js +8 -3
- package/dist/cli/create.js.map +1 -1
- package/dist/cli/design-connect.d.ts.map +1 -1
- package/dist/cli/design-connect.js +40 -10
- package/dist/cli/design-connect.js.map +1 -1
- package/dist/cli/index.js +5 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/client/extensions/ExtensionSlot.js +6 -0
- package/dist/client/extensions/ExtensionSlot.js.map +1 -1
- package/dist/client/session-replay.d.ts +8 -0
- package/dist/client/session-replay.d.ts.map +1 -1
- package/dist/client/session-replay.js +80 -3
- package/dist/client/session-replay.js.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/jobs/scheduler.js +26 -1
- package/dist/jobs/scheduler.js.map +1 -1
- package/dist/localization/default-messages.d.ts +19 -0
- package/dist/localization/default-messages.d.ts.map +1 -1
- package/dist/localization/default-messages.js +19 -0
- package/dist/localization/default-messages.js.map +1 -1
- package/dist/notifications/routes.d.ts +1 -1
- package/dist/observability/routes.d.ts +1 -1
- package/dist/provider-api/corpus-jobs.d.ts +2 -2
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/templates/default/app/i18n/ar-SA.ts +21 -0
- package/dist/templates/default/app/i18n/de-DE.ts +21 -0
- package/dist/templates/default/app/i18n/en-US.ts +21 -0
- package/dist/templates/default/app/i18n/es-ES.ts +21 -0
- package/dist/templates/default/app/i18n/fr-FR.ts +21 -0
- package/dist/templates/default/app/i18n/hi-IN.ts +20 -0
- package/dist/templates/default/app/i18n/ja-JP.ts +21 -0
- package/dist/templates/default/app/i18n/ko-KR.ts +20 -0
- package/dist/templates/default/app/i18n/pt-BR.ts +21 -0
- package/dist/templates/default/app/i18n/zh-CN.ts +20 -0
- package/dist/templates/default/app/i18n/zh-TW.ts +19 -0
- package/dist/templates/default/package.json +2 -2
- package/dist/templates/headless/package.json +3 -3
- package/dist/templates/workspace-core/package.json +6 -6
- package/dist/templates/workspace-root/package.json +2 -2
- package/dist/triggers/dispatcher.js +27 -2
- package/dist/triggers/dispatcher.js.map +1 -1
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +70 -1
- package/dist/vite/client.js.map +1 -1
- package/package.json +7 -6
- package/src/templates/default/app/i18n/ar-SA.ts +21 -0
- package/src/templates/default/app/i18n/de-DE.ts +21 -0
- package/src/templates/default/app/i18n/en-US.ts +21 -0
- package/src/templates/default/app/i18n/es-ES.ts +21 -0
- package/src/templates/default/app/i18n/fr-FR.ts +21 -0
- package/src/templates/default/app/i18n/hi-IN.ts +20 -0
- package/src/templates/default/app/i18n/ja-JP.ts +21 -0
- package/src/templates/default/app/i18n/ko-KR.ts +20 -0
- package/src/templates/default/app/i18n/pt-BR.ts +21 -0
- package/src/templates/default/app/i18n/zh-CN.ts +20 -0
- package/src/templates/default/app/i18n/zh-TW.ts +19 -0
- package/src/templates/default/package.json +2 -2
- package/src/templates/headless/package.json +3 -3
- package/src/templates/workspace-core/package.json +6 -6
- package/src/templates/workspace-root/package.json +2 -2
|
@@ -246,6 +246,15 @@ patterns live in `.agents/skills/`.
|
|
|
246
246
|
the latest localhost connection or a specific `connectionId`. Pass `routes`
|
|
247
247
|
with `path`/`url` when visualizing a flow; pass `paths` for a concise route
|
|
248
248
|
list. Then call `navigate --view editor --designId <id> --editorView overview`.
|
|
249
|
+
- `write-local-file`: writes/patches a local file through the bridge, but only
|
|
250
|
+
when a user-approved write-consent grant exists. Granting is human-only
|
|
251
|
+
(`grant-localhost-write-consent` is hidden from agents), so you cannot approve
|
|
252
|
+
it yourself.
|
|
253
|
+
- `request-localhost-write-consent`: call this when `write-local-file` fails
|
|
254
|
+
with "no write-consent grant". It opens the write-consent dialog in the
|
|
255
|
+
editor (or reports `alreadyGranted`). Tell the user to click "Allow writes",
|
|
256
|
+
then retry `write-local-file`. Do not keep retrying blindly — the write stays
|
|
257
|
+
blocked until the user approves.
|
|
249
258
|
|
|
250
259
|
## Review, Breakpoints, Screen States & Components
|
|
251
260
|
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { defineAction } from "@agent-native/core";
|
|
2
|
+
import {
|
|
3
|
+
readAppStateForCurrentTab,
|
|
4
|
+
writeAppState,
|
|
5
|
+
} from "@agent-native/core/application-state";
|
|
6
|
+
import { getRequestUserEmail } from "@agent-native/core/server/request-context";
|
|
7
|
+
import { assertAccess } from "@agent-native/core/sharing";
|
|
8
|
+
import { and, eq } from "drizzle-orm";
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
|
|
11
|
+
import { getDb, schema } from "../server/db/index.js";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Surface the LocalhostWriteConsentDialog so the user can approve local file
|
|
15
|
+
* writes. Granting is human-only (`grant-localhost-write-consent` is
|
|
16
|
+
* `agentTool: false`), so an agent writing from chat can only *request* the
|
|
17
|
+
* prompt: this writes an app-state key the editor observes and opens the dialog.
|
|
18
|
+
* If a valid grant already exists it reports that instead of prompting again.
|
|
19
|
+
*/
|
|
20
|
+
export default defineAction({
|
|
21
|
+
description:
|
|
22
|
+
"Prompt the user to allow local file writes for a design's localhost " +
|
|
23
|
+
"connection by opening the write-consent dialog in the editor. Write " +
|
|
24
|
+
"consent itself is human-only and cannot be granted by the agent. Call " +
|
|
25
|
+
"this when write-local-file fails because no write-consent grant exists, " +
|
|
26
|
+
"then retry write-local-file after the user approves. Requires editor " +
|
|
27
|
+
"access on the design.",
|
|
28
|
+
schema: z.object({
|
|
29
|
+
designId: z.string().describe("Design ID."),
|
|
30
|
+
connectionId: z
|
|
31
|
+
.string()
|
|
32
|
+
.describe("Localhost connection ID (from list-localhost-connections)."),
|
|
33
|
+
files: z
|
|
34
|
+
.array(z.string())
|
|
35
|
+
.optional()
|
|
36
|
+
.describe("File paths about to be written, shown in the dialog."),
|
|
37
|
+
}),
|
|
38
|
+
run: async ({ designId, connectionId, files }) => {
|
|
39
|
+
await assertAccess("design", designId, "editor");
|
|
40
|
+
|
|
41
|
+
const ownerEmail = getRequestUserEmail();
|
|
42
|
+
if (!ownerEmail) throw new Error("no authenticated user");
|
|
43
|
+
|
|
44
|
+
const db = getDb();
|
|
45
|
+
const [connection] = await db
|
|
46
|
+
.select({
|
|
47
|
+
rootPath: schema.designLocalhostConnections.rootPath,
|
|
48
|
+
bridgeToken: schema.designLocalhostConnections.bridgeToken,
|
|
49
|
+
})
|
|
50
|
+
.from(schema.designLocalhostConnections)
|
|
51
|
+
.where(
|
|
52
|
+
and(
|
|
53
|
+
eq(schema.designLocalhostConnections.id, connectionId),
|
|
54
|
+
eq(schema.designLocalhostConnections.ownerEmail, ownerEmail),
|
|
55
|
+
),
|
|
56
|
+
)
|
|
57
|
+
.limit(1);
|
|
58
|
+
|
|
59
|
+
if (!connection) {
|
|
60
|
+
throw new Error(
|
|
61
|
+
`Localhost connection "${connectionId}" not found for the current user.`,
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Fail fast on the same preconditions grant-localhost-write-consent
|
|
66
|
+
// enforces, so we never show a dialog that would hard-fail on approval —
|
|
67
|
+
// or one labeled with the connection id instead of a real folder.
|
|
68
|
+
if (!connection.rootPath || !connection.bridgeToken) {
|
|
69
|
+
throw new Error(
|
|
70
|
+
`Connection "${connectionId}" is not ready for writes (missing root ` +
|
|
71
|
+
"path or bridge token). Re-run `npx @agent-native/core@latest design " +
|
|
72
|
+
"connect` so the CLI records both, then retry.",
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Skip the prompt when a non-expired grant already covers this connection —
|
|
77
|
+
// the agent can just retry write-local-file.
|
|
78
|
+
const [grant] = await db
|
|
79
|
+
.select({
|
|
80
|
+
grantedUntil: schema.designLocalhostWriteGrants.grantedUntil,
|
|
81
|
+
})
|
|
82
|
+
.from(schema.designLocalhostWriteGrants)
|
|
83
|
+
.where(
|
|
84
|
+
and(
|
|
85
|
+
eq(schema.designLocalhostWriteGrants.designId, designId),
|
|
86
|
+
eq(schema.designLocalhostWriteGrants.connectionId, connectionId),
|
|
87
|
+
eq(schema.designLocalhostWriteGrants.ownerEmail, ownerEmail),
|
|
88
|
+
),
|
|
89
|
+
)
|
|
90
|
+
.limit(1);
|
|
91
|
+
if (grant && grant.grantedUntil > new Date().toISOString()) {
|
|
92
|
+
return {
|
|
93
|
+
designId,
|
|
94
|
+
connectionId,
|
|
95
|
+
alreadyGranted: true,
|
|
96
|
+
message:
|
|
97
|
+
"A valid write-consent grant already exists. Retry write-local-file.",
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
await writeAppState(`design-localhost-write-consent-request:${designId}`, {
|
|
102
|
+
designId,
|
|
103
|
+
connectionId,
|
|
104
|
+
rootPath: connection.rootPath,
|
|
105
|
+
files: files ?? [],
|
|
106
|
+
requestedAt: new Date().toISOString(),
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
// The dialog only renders from this design's editor, so only claim it
|
|
110
|
+
// surfaced when the user is actually there. Otherwise the request stays
|
|
111
|
+
// queued and fires when they open the design — report that honestly instead
|
|
112
|
+
// of implying a dialog is on screen.
|
|
113
|
+
const navigation = await readAppStateForCurrentTab("navigation").catch(
|
|
114
|
+
() => null,
|
|
115
|
+
);
|
|
116
|
+
const onThisEditor =
|
|
117
|
+
navigation?.["view"] === "editor" &&
|
|
118
|
+
navigation?.["designId"] === designId;
|
|
119
|
+
|
|
120
|
+
if (onThisEditor) {
|
|
121
|
+
return {
|
|
122
|
+
designId,
|
|
123
|
+
connectionId,
|
|
124
|
+
surfaced: true,
|
|
125
|
+
message:
|
|
126
|
+
"Opened the write-consent dialog. Ask the user to click 'Allow " +
|
|
127
|
+
"writes', then retry write-local-file.",
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return {
|
|
132
|
+
designId,
|
|
133
|
+
connectionId,
|
|
134
|
+
surfaced: false,
|
|
135
|
+
message:
|
|
136
|
+
"Queued a write-consent request, but the user is not on this design's " +
|
|
137
|
+
"editor so no dialog is showing yet. Ask them to open the design; the " +
|
|
138
|
+
"prompt appears then, and you can retry write-local-file after they approve.",
|
|
139
|
+
};
|
|
140
|
+
},
|
|
141
|
+
});
|
|
@@ -1315,25 +1315,21 @@ export function DesignCanvas({
|
|
|
1315
1315
|
(fetchedExternalSnapshot?.url === rawExternalPreviewUrl
|
|
1316
1316
|
? fetchedExternalSnapshot.html
|
|
1317
1317
|
: undefined);
|
|
1318
|
+
// Bake a neutral scale of 1 here (not the zoom-folded scale): this script is
|
|
1319
|
+
// registered with the localhost bridge via a large POST, so folding live zoom
|
|
1320
|
+
// in would re-fire the registration effect on every zoom tick. Live scale is
|
|
1321
|
+
// pushed separately over the `set-editor-chrome-scale` postMessage below.
|
|
1318
1322
|
const editorChromeBridgeForCurrentState = useMemo(
|
|
1319
1323
|
() =>
|
|
1320
1324
|
buildEditorChromeBridgeScript({
|
|
1321
1325
|
readOnly,
|
|
1322
1326
|
editMode,
|
|
1323
|
-
editorChromeScaleX:
|
|
1324
|
-
editorChromeScaleY:
|
|
1327
|
+
editorChromeScaleX: 1,
|
|
1328
|
+
editorChromeScaleY: 1,
|
|
1325
1329
|
screenId: screenId ?? contentKey ?? "",
|
|
1326
1330
|
boardSurface,
|
|
1327
1331
|
}),
|
|
1328
|
-
[
|
|
1329
|
-
boardSurface,
|
|
1330
|
-
contentKey,
|
|
1331
|
-
editMode,
|
|
1332
|
-
effectiveEditorChromeScaleX,
|
|
1333
|
-
effectiveEditorChromeScaleY,
|
|
1334
|
-
readOnly,
|
|
1335
|
-
screenId,
|
|
1336
|
-
],
|
|
1332
|
+
[boardSurface, contentKey, editMode, readOnly, screenId],
|
|
1337
1333
|
);
|
|
1338
1334
|
const embeddedWheelBridgeForCurrentState = useMemo(
|
|
1339
1335
|
() =>
|
|
@@ -1400,6 +1396,9 @@ export function DesignCanvas({
|
|
|
1400
1396
|
onExternalContentSnapshotRef.current = onExternalContentSnapshot;
|
|
1401
1397
|
}, [onExternalContentSnapshot]);
|
|
1402
1398
|
|
|
1399
|
+
// Register the editor bridge script with the localhost live-edit bridge so
|
|
1400
|
+
// it gets injected into the proxied preview. Re-runs only when the script
|
|
1401
|
+
// content (liveEditBridgeKey) or the bridge target changes.
|
|
1403
1402
|
useEffect(() => {
|
|
1404
1403
|
if (!usesLiveEditEditorBridge || !bridgeUrl) {
|
|
1405
1404
|
setRegisteredLiveEditBridgeKey(null);
|
|
@@ -1410,8 +1409,8 @@ export function DesignCanvas({
|
|
|
1410
1409
|
current === liveEditBridgeKey ? current : null,
|
|
1411
1410
|
);
|
|
1412
1411
|
void (async () => {
|
|
1412
|
+
const endpoint = new URL("/live-edit-bridge", bridgeUrl).toString();
|
|
1413
1413
|
try {
|
|
1414
|
-
const endpoint = new URL("/live-edit-bridge", bridgeUrl).toString();
|
|
1415
1414
|
const response = await fetch(endpoint, {
|
|
1416
1415
|
method: "POST",
|
|
1417
1416
|
headers: {
|
|
@@ -1423,15 +1422,10 @@ export function DesignCanvas({
|
|
|
1423
1422
|
if (!response.ok) {
|
|
1424
1423
|
throw new Error(`Bridge registration failed (${response.status})`);
|
|
1425
1424
|
}
|
|
1426
|
-
if (!cancelled)
|
|
1427
|
-
setRegisteredLiveEditBridgeKey(liveEditBridgeKey);
|
|
1428
|
-
}
|
|
1425
|
+
if (!cancelled) setRegisteredLiveEditBridgeKey(liveEditBridgeKey);
|
|
1429
1426
|
} catch (error) {
|
|
1430
1427
|
if (!cancelled) {
|
|
1431
|
-
console.warn(
|
|
1432
|
-
"[DesignCanvas] live edit bridge registration failed",
|
|
1433
|
-
error,
|
|
1434
|
-
);
|
|
1428
|
+
console.warn("live-edit bridge registration failed", error);
|
|
1435
1429
|
setRegisteredLiveEditBridgeKey(null);
|
|
1436
1430
|
}
|
|
1437
1431
|
}
|
|
@@ -77,7 +77,6 @@
|
|
|
77
77
|
"@types/node": "^24.2.1",
|
|
78
78
|
"@types/react": "catalog:",
|
|
79
79
|
"@types/react-dom": "catalog:",
|
|
80
|
-
"@typescript/native-preview": "catalog:",
|
|
81
80
|
"@xterm/addon-fit": "^0.11.0",
|
|
82
81
|
"@xterm/addon-web-links": "^0.12.0",
|
|
83
82
|
"@xterm/xterm": "^6.0.0",
|
|
@@ -100,7 +99,8 @@
|
|
|
100
99
|
"tailwind-merge": "^3.5.0",
|
|
101
100
|
"tailwindcss": "catalog:",
|
|
102
101
|
"tsx": "^4.20.3",
|
|
103
|
-
"typescript": "
|
|
102
|
+
"typescript": "catalog:",
|
|
103
|
+
"typescript-7": "catalog:",
|
|
104
104
|
"vaul": "^1.1.2",
|
|
105
105
|
"vite": "catalog:",
|
|
106
106
|
"vitest": "catalog:"
|
|
@@ -59,7 +59,8 @@ export async function verifyWriteGrant(
|
|
|
59
59
|
if (!grant) {
|
|
60
60
|
throw new Error(
|
|
61
61
|
"No localhost write-consent grant found for this design + connection. " +
|
|
62
|
-
"
|
|
62
|
+
"Call request-localhost-write-consent to prompt the user, then retry " +
|
|
63
|
+
"this write after they click 'Allow writes'.",
|
|
63
64
|
);
|
|
64
65
|
}
|
|
65
66
|
|
|
@@ -67,7 +68,8 @@ export async function verifyWriteGrant(
|
|
|
67
68
|
if (grant.grantedUntil < now) {
|
|
68
69
|
throw new Error(
|
|
69
70
|
`Localhost write-consent grant expired at ${grant.grantedUntil}. ` +
|
|
70
|
-
"
|
|
71
|
+
"Call request-localhost-write-consent to prompt the user for a new " +
|
|
72
|
+
"grant, then retry this write.",
|
|
71
73
|
);
|
|
72
74
|
}
|
|
73
75
|
|
|
@@ -22,9 +22,15 @@ const messages = {
|
|
|
22
22
|
workspaceDescription: "管理 Dispatch 的團隊存取權限和共用工作區資源。",
|
|
23
23
|
openTeamSettings: "開啟團隊設定",
|
|
24
24
|
openResourceSettings: "開啟資源設定",
|
|
25
|
+
automationsTitle: "自動化",
|
|
26
|
+
automationsDescription: "檢視、暫停並建立排程或事件觸發的工作。",
|
|
27
|
+
openAutomations: "開啟自動化",
|
|
28
|
+
deliveryTitle: "投遞",
|
|
29
|
+
deliveryDescription: "管理訊息目的地並查看出站投遞佇列。",
|
|
30
|
+
openDelivery: "開啟投遞",
|
|
25
31
|
agentTitle: "代理設定",
|
|
26
32
|
agentDescription:
|
|
27
|
-
"開啟代理側邊欄設定,管理模型、API
|
|
33
|
+
"開啟代理側邊欄設定,管理模型、API 金鑰、語音和其他代理控制項。排程與事件觸發的工作請使用自動化頁面。",
|
|
28
34
|
openAgentSettings: "開啟代理設定",
|
|
29
35
|
},
|
|
30
36
|
integrations: {
|
|
@@ -191,6 +197,33 @@ const messages = {
|
|
|
191
197
|
onboardingDescription:
|
|
192
198
|
"Dispatch 管理共用提供者帳戶。每個應用管理自己如何使用該帳戶。",
|
|
193
199
|
},
|
|
200
|
+
dispatch: {
|
|
201
|
+
nav: {
|
|
202
|
+
automations: "自動化",
|
|
203
|
+
approvals: "核准",
|
|
204
|
+
delivery: "投遞",
|
|
205
|
+
agents: "代理",
|
|
206
|
+
vault: "保管庫",
|
|
207
|
+
audit: "稽核",
|
|
208
|
+
},
|
|
209
|
+
pages: {
|
|
210
|
+
also: "還有",
|
|
211
|
+
workspaceShortcutsAria: "工作區快捷入口",
|
|
212
|
+
deliveryQueue: "投遞佇列",
|
|
213
|
+
failedLastHour: "過去一小時失敗 {{count}} 次",
|
|
214
|
+
processingCount: "{{count}} 個處理中",
|
|
215
|
+
queued: "排隊中",
|
|
216
|
+
active: "進行中",
|
|
217
|
+
done1h: "完成 1 小時",
|
|
218
|
+
failed1h: "失敗 1 小時",
|
|
219
|
+
oldestQueued: "最早排隊:{{age}}",
|
|
220
|
+
queueAgeNone: "無",
|
|
221
|
+
queueFailureHint: "請檢查憑證、目的地和最近的佇列錯誤。",
|
|
222
|
+
unknownPlatform: "未知",
|
|
223
|
+
attemptsCount: "{{count}} 次嘗試",
|
|
224
|
+
noErrorMessage: "(無錯誤訊息)",
|
|
225
|
+
},
|
|
226
|
+
},
|
|
194
227
|
};
|
|
195
228
|
|
|
196
229
|
export default messages;
|