@agent-native/core 0.164.4 → 0.164.12
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/calendar/.agents/skills/event-management/SKILL.md +84 -0
- package/corpus/templates/calendar/AGENTS.md +5 -0
- package/corpus/templates/calendar/actions/delete-event.ts +1 -1
- package/corpus/templates/calendar/actions/delete-events.ts +508 -0
- package/corpus/templates/calendar/actions/event-action-helpers.ts +1 -1
- package/corpus/templates/calendar/actions/list-events.ts +53 -0
- package/corpus/templates/calendar/app/components/calendar/CreateEventDialog.tsx +36 -47
- package/corpus/templates/calendar/app/components/calendar/DayView.tsx +3 -0
- package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +18 -1
- package/corpus/templates/calendar/app/components/calendar/InlineEventPickers.tsx +256 -38
- package/corpus/templates/calendar/app/hooks/use-google-auth.ts +43 -3
- package/corpus/templates/calendar/app/i18n-data.ts +120 -0
- package/corpus/templates/calendar/app/lib/event-form-utils.ts +113 -0
- package/corpus/templates/calendar/changelog/2026-08-18-the-agent-can-now-remove-many-meetings-at-once-such-as-every.md +6 -0
- package/corpus/templates/calendar/server/handlers/google-auth.ts +119 -3
- package/corpus/templates/calendar/server/lib/event-weekday.ts +112 -0
- package/corpus/templates/calendar/server/routes/[base]/_agent-native/google/add-account/auth-url.post.ts +1 -0
- package/corpus/templates/calendar/server/routes/[base]/_agent-native/google/auth-url.post.ts +1 -0
- package/corpus/templates/calendar/server/routes/_agent-native/google/add-account/auth-url.post.ts +1 -0
- package/corpus/templates/calendar/server/routes/_agent-native/google/auth-url.post.ts +1 -0
- package/corpus/templates/clips/app/components/player/video-player.tsx +12 -0
- package/corpus/templates/clips/app/routes/_app.dictate.tsx +18 -4
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +114 -20
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +83 -78
- package/corpus/templates/clips/changelog/2026-08-19-clips-nightly-builds-are-available-for-trying-the-latest-upd.md +6 -0
- package/corpus/templates/clips/changelog/2026-08-19-social-preview-video-frames.md +1 -0
- package/corpus/templates/clips/desktop/README.md +19 -4
- package/corpus/templates/clips/desktop/src/app.tsx +78 -16
- package/corpus/templates/clips/desktop/src-tauri/Cargo.toml +3 -2
- package/corpus/templates/clips/desktop/src-tauri/tauri.conf.json +1 -0
- package/corpus/templates/clips/server/routes/[base]/_agent-native/google/auth-url.post.ts +1 -0
- package/corpus/templates/clips/server/routes/_agent-native/google/auth-url.get.ts +41 -3
- package/corpus/templates/clips/server/routes/_agent-native/google/auth-url.post.ts +1 -0
- package/corpus/templates/clips/server/routes/_agent-native/google/callback.get.ts +22 -1
- package/corpus/templates/clips/server/routes/api/clips-updater.json.get.ts +41 -22
- package/corpus/templates/factory/AGENTS.md +3 -2
- package/corpus/templates/factory/actions/get-factory-graph-version.ts +69 -0
- package/corpus/templates/factory/actions/list-factory-automations.ts +4 -0
- package/corpus/templates/factory/actions/list-factory-graph-versions.ts +82 -0
- package/corpus/templates/factory/actions/restore-factory-graph-version.ts +163 -0
- package/corpus/templates/factory/actions/save-factory-graph.ts +93 -60
- package/corpus/templates/factory/actions/start-builder-for-item.ts +19 -17
- package/corpus/templates/factory/app/components/factory/FactoryAuditView.tsx +100 -36
- package/corpus/templates/factory/app/components/factory/FactoryHistoryView.tsx +709 -0
- package/corpus/templates/factory/app/components/factory/FactoryInspector.tsx +62 -2
- package/corpus/templates/factory/app/components/ui/alert-dialog.tsx +1 -0
- package/corpus/templates/factory/app/i18n/en-US.ts +47 -0
- package/corpus/templates/factory/app/routes/factory.tsx +324 -61
- package/corpus/templates/factory/server/connectors/slack.ts +44 -2
- package/corpus/templates/factory/server/plugins/agent-chat.ts +12 -8
- package/corpus/templates/factory/server/plugins/factory-scheduler-job.ts +13 -0
- package/corpus/templates/factory/server/triage/slack-client.ts +5 -0
- package/corpus/templates/factory/server/triage/slack-poller.ts +72 -4
- package/corpus/templates/mail/actions/view-screen.ts +1 -1
- package/corpus/templates/mail/app/components/GoogleConnectBanner.tsx +100 -18
- package/corpus/templates/mail/server/handlers/google-auth.ts +125 -24
- package/corpus/templates/mail/server/lib/gmail-query.ts +5 -2
- package/corpus/templates/mail/server/routes/[base]/_agent-native/google/add-account/auth-url.post.ts +1 -0
- package/corpus/templates/mail/server/routes/[base]/_agent-native/google/auth-url.post.ts +1 -0
- package/corpus/templates/mail/server/routes/_agent-native/google/add-account/auth-url.post.ts +1 -0
- package/corpus/templates/mail/server/routes/_agent-native/google/auth-url.post.ts +1 -0
- package/corpus/templates/plan/app/pages/PlansPage.tsx +0 -12
- package/corpus/templates/plan/changelog/2026-08-19-plan-prompts-now-guide-you-to-connect-ai-before-sending-and-.md +6 -0
- package/corpus/templates/slides/actions/approve-deck-access-request.ts +234 -0
- package/corpus/templates/slides/actions/get-deck-access-status.ts +35 -2
- package/corpus/templates/slides/actions/request-deck-access.ts +263 -64
- package/corpus/templates/slides/app/components/editor/MissingDeckAccessPane.tsx +196 -0
- package/corpus/templates/slides/app/components/editor/RequestDeckAccessDialog.tsx +101 -0
- package/corpus/templates/slides/app/hooks/use-deck-access.ts +7 -4
- package/corpus/templates/slides/app/i18n/en-US.ts +29 -6
- package/corpus/templates/slides/app/pages/DeckEditor.tsx +147 -169
- package/corpus/templates/slides/app/routes/access-request.approve.tsx +250 -0
- package/corpus/templates/slides/server/db/schema.ts +8 -0
- package/corpus/templates/slides/server/lib/access-request-email.ts +36 -0
- package/corpus/templates/slides/server/lib/emails.ts +26 -0
- package/corpus/templates/slides/server/plugins/agent-chat.ts +7 -0
- package/corpus/templates/slides/server/plugins/db.ts +50 -0
- package/corpus/templates/slides/shared/deck-access.ts +31 -0
- package/dist/a2a/task-store.d.ts +1 -0
- package/dist/a2a/task-store.js +1 -1
- package/dist/agent/observational-memory/store.d.ts +1 -0
- package/dist/agent/observational-memory/store.js +1 -1
- package/dist/agent/run-store.d.ts +1 -0
- package/dist/agent/run-store.js +1 -1
- package/dist/agent/tool-approval-store.d.ts +1 -0
- package/dist/agent/tool-approval-store.js +1 -1
- package/dist/application-state/store.d.ts +1 -0
- package/dist/application-state/store.js +1 -1
- package/dist/browser-sessions/store.d.ts +1 -0
- package/dist/browser-sessions/store.js +1 -1
- package/dist/checkpoints/store.d.ts +1 -0
- package/dist/checkpoints/store.js +1 -1
- package/dist/cli/code-agent-schedules.d.ts +11 -0
- package/dist/cli/code-agent-schedules.js +44 -5
- package/dist/client/AgentPanel.d.ts +5 -1
- package/dist/client/AgentPanel.js +2 -2
- package/dist/client/AssistantChat.d.ts +5 -1
- package/dist/client/AssistantChat.js +40 -6
- package/dist/client/EnvironmentBadge.d.ts +7 -13
- package/dist/client/EnvironmentBadge.js +43 -92
- package/dist/client/agent-chat/index.d.ts +1 -0
- package/dist/client/agent-chat/index.js +1 -0
- package/dist/client/agent-chat-adapter.js +76 -50
- package/dist/client/app-providers.js +4 -4
- package/dist/client/chat/message-components.d.ts +4 -0
- package/dist/client/chat/message-components.js +28 -1
- package/dist/client/chat/run-recovery.js +26 -0
- package/dist/client/chat-first/apps-rail.d.ts +1 -0
- package/dist/client/chat-first/apps-rail.js +28 -2
- package/dist/client/sse-event-processor.js +13 -8
- package/dist/client/use-active-agent-chat-run.d.ts +2 -0
- package/dist/client/use-active-agent-chat-run.js +22 -0
- package/dist/coding-tools/sandbox/executions-store.d.ts +1 -0
- package/dist/coding-tools/sandbox/executions-store.js +1 -1
- package/dist/collab/awareness-store.d.ts +1 -0
- package/dist/collab/awareness-store.js +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/collab/storage.d.ts +1 -0
- package/dist/collab/storage.js +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/db/client.js +3 -3
- package/dist/db/ddl-guard.js +8 -0
- package/dist/db/migration-runtime.d.ts +23 -0
- package/dist/db/migration-runtime.js +41 -0
- package/dist/db/migrations.d.ts +1 -2
- package/dist/db/migrations.js +2 -24
- package/dist/email-catalog/log.d.ts +1 -0
- package/dist/email-catalog/log.js +1 -1
- package/dist/guards/index.d.ts +1 -0
- package/dist/guards/index.js +1 -0
- package/dist/guards/release-schema-complete.d.ts +22 -0
- package/dist/guards/release-schema-complete.js +144 -0
- package/dist/integrations/a2a-continuations-store.d.ts +1 -0
- package/dist/integrations/a2a-continuations-store.js +1 -1
- package/dist/integrations/awaiting-input-store.d.ts +1 -0
- package/dist/integrations/awaiting-input-store.js +1 -1
- package/dist/integrations/config-store.d.ts +1 -0
- package/dist/integrations/config-store.js +1 -1
- package/dist/integrations/controls-store.d.ts +1 -0
- package/dist/integrations/controls-store.js +1 -1
- package/dist/integrations/identity-links-store.d.ts +1 -0
- package/dist/integrations/identity-links-store.js +1 -1
- package/dist/integrations/installations-store.d.ts +1 -0
- package/dist/integrations/installations-store.js +1 -1
- package/dist/integrations/remote-commands-store.d.ts +1 -0
- package/dist/integrations/remote-commands-store.js +1 -1
- package/dist/integrations/remote-devices-store.d.ts +1 -0
- package/dist/integrations/remote-devices-store.js +1 -1
- package/dist/integrations/remote-push-store.d.ts +1 -0
- package/dist/integrations/remote-push-store.js +1 -1
- package/dist/integrations/remote-run-events-store.d.ts +1 -0
- package/dist/integrations/remote-run-events-store.js +1 -1
- package/dist/integrations/scope-store.d.ts +1 -0
- package/dist/integrations/scope-store.js +1 -1
- package/dist/integrations/thread-mapping-store.d.ts +1 -0
- package/dist/integrations/thread-mapping-store.js +1 -1
- package/dist/integrations/usage-budget-store.d.ts +1 -0
- package/dist/integrations/usage-budget-store.js +1 -1
- package/dist/jobs/background-automation-runner.js +111 -9
- package/dist/jobs/run-history.d.ts +1 -0
- package/dist/jobs/run-history.js +1 -1
- package/dist/jobs/scheduler-health.d.ts +1 -0
- package/dist/jobs/scheduler-health.js +1 -1
- package/dist/mcp/approval-store.d.ts +1 -0
- package/dist/mcp/approval-store.js +1 -1
- package/dist/mcp/connect-store.d.ts +1 -0
- package/dist/mcp/connect-store.js +1 -1
- package/dist/mcp/oauth-store.d.ts +1 -0
- package/dist/mcp/oauth-store.js +1 -1
- package/dist/notifications/store.d.ts +1 -0
- package/dist/notifications/store.js +1 -1
- package/dist/oauth-tokens/store.d.ts +1 -0
- package/dist/oauth-tokens/store.js +1 -1
- package/dist/observability/routes.d.ts +5 -5
- package/dist/progress/routes.d.ts +1 -1
- package/dist/progress/store.d.ts +1 -0
- package/dist/progress/store.js +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +5 -5
- package/dist/provider-api/actions/provider-api.d.ts +4 -4
- package/dist/provider-api/corpus-jobs-store.d.ts +1 -0
- package/dist/provider-api/corpus-jobs-store.js +1 -1
- package/dist/provider-api/custom-registry.d.ts +1 -0
- package/dist/provider-api/custom-registry.js +1 -1
- package/dist/provider-api/quota-governor.d.ts +1 -0
- package/dist/provider-api/quota-governor.js +1 -1
- package/dist/provider-api/staged-datasets-store.d.ts +1 -0
- package/dist/provider-api/staged-datasets-store.js +1 -1
- package/dist/resources/handlers.d.ts +3 -3
- package/dist/resources/store.d.ts +1 -0
- package/dist/resources/store.js +1 -1
- package/dist/scripts/dev/index.js +15 -1
- package/dist/search/index.js +3 -0
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/secrets/storage.d.ts +1 -0
- package/dist/secrets/storage.js +1 -1
- package/dist/server/agent-chat-plugin.js +38 -9
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/agent-teams-run-queue.d.ts +1 -0
- package/dist/server/agent-teams-run-queue.js +1 -1
- package/dist/server/auth-marketing.js +3 -1
- package/dist/server/auth.d.ts +18 -1
- package/dist/server/auth.js +370 -154
- package/dist/server/embed-session.d.ts +1 -0
- package/dist/server/embed-session.js +1 -1
- package/dist/server/google-auth-plugin.js +3 -1
- package/dist/server/google-oauth.d.ts +10 -0
- package/dist/server/google-oauth.js +25 -1
- package/dist/server/identity-sso-store.d.ts +1 -0
- package/dist/server/identity-sso-store.js +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/onboarding-html.js +200 -31
- package/dist/server/poll.d.ts +2 -0
- package/dist/server/poll.js +19 -1
- package/dist/server/realtime-token.d.ts +1 -1
- package/dist/server/release-migrations.js +5 -0
- package/dist/server/release-schema.d.ts +46 -0
- package/dist/server/release-schema.js +307 -0
- package/dist/settings/store.d.ts +1 -0
- package/dist/settings/store.js +1 -1
- package/dist/shared/environment-lanes.d.ts +28 -0
- package/dist/shared/environment-lanes.js +61 -0
- package/dist/sharing/actions/share-resource.js +22 -2
- package/dist/styles/agent-native.css +17 -15
- package/dist/triggers/routes.d.ts +11 -0
- package/dist/triggers/routes.js +10 -0
- package/dist/usage/alerts-store.d.ts +1 -0
- package/dist/usage/alerts-store.js +1 -1
- package/dist/usage/store.d.ts +1 -0
- package/dist/usage/store.js +1 -1
- package/docs/content/actions-access-control.mdx +136 -2
- package/docs/content/actions-agent-tools.mdx +101 -0
- package/docs/content/actions-defining.mdx +2 -2
- package/docs/content/audit-log.mdx +1 -1
- package/docs/content/authentication.mdx +1 -1
- package/docs/content/cloudflare.mdx +43 -0
- package/docs/content/creating-templates.mdx +1 -1
- package/docs/content/deploy-an-app.mdx +109 -0
- package/docs/content/deployment-environment-variables.mdx +101 -0
- package/docs/content/deployment.mdx +125 -792
- package/docs/content/docs-components.mdx +2 -2
- package/docs/content/environment-variables.mdx +41 -41
- package/docs/content/file-uploads.mdx +74 -40
- package/docs/content/harness-agents.mdx +2 -2
- package/docs/content/internationalization.mdx +61 -65
- package/docs/content/key-concepts.mdx +3 -3
- package/docs/content/multi-app-workspace.mdx +2 -2
- package/docs/content/netlify.mdx +47 -0
- package/docs/content/node-docker.mdx +138 -0
- package/docs/content/organizations-teams-permissions.mdx +5 -5
- package/docs/content/other-platforms.mdx +27 -0
- package/docs/content/ssr-caching.mdx +45 -0
- package/docs/content/template-assets-developers.mdx +2 -2
- package/docs/content/template-chat-developers.mdx +2 -2
- package/docs/content/template-content-developers.mdx +2 -2
- package/docs/content/{local-file-mode.mdx → template-content-local-files.mdx} +2 -1
- package/docs/content/template-content-sync.mdx +2 -2
- package/docs/content/toolkit-agent-ux.mdx +1 -1
- package/docs/content/toolkit-resources.mdx +2 -2
- package/docs/content/updating-ui-in-production.mdx +35 -0
- package/docs/content/vercel.mdx +38 -0
- package/docs/content/what-is-agent-native.mdx +1 -1
- package/docs/content/workspace-deployment.mdx +350 -0
- package/package.json +2 -2
- package/docs/content/agents.mdx +0 -9
- package/docs/content/database.mdx +0 -317
- package/docs/content/human-approval.mdx +0 -156
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Release-time creation of every framework-owned table that a store would
|
|
3
|
+
* otherwise create on first use.
|
|
4
|
+
*
|
|
5
|
+
* `ensureTable()` is the framework's schema definition: the DDL lives next to
|
|
6
|
+
* the store that owns it, and there is no second copy in a migration list. On a
|
|
7
|
+
* long-lived server that works, because the first request creates what is
|
|
8
|
+
* missing. On production serverless it does NOT: `schemaEnsureDisabled()` turns
|
|
9
|
+
* every probe into "already present" so a cold start never pays for ~390
|
|
10
|
+
* probes, which means nothing on the request path can create a table.
|
|
11
|
+
*
|
|
12
|
+
* So the release step has to run the same paths, and this module is the list
|
|
13
|
+
* that makes it complete. It is deliberately explicit rather than a
|
|
14
|
+
* side-effect-import registry: `package.json#sideEffects` is a narrow
|
|
15
|
+
* allow-list, so an import kept only for its registration is exactly what a
|
|
16
|
+
* bundler is entitled to drop — and the symptom would be a missing table in
|
|
17
|
+
* production, months later.
|
|
18
|
+
*
|
|
19
|
+
* The imports are dynamic on purpose. `server/index.ts` and `server/edge.ts`
|
|
20
|
+
* re-export `runFrameworkReleaseMigrations`, so a static list here would pull
|
|
21
|
+
* all 60 store modules into the graph of every server boot to serve a path
|
|
22
|
+
* that runs once, at release. Loading them inside the step keeps request cold
|
|
23
|
+
* starts unchanged.
|
|
24
|
+
*
|
|
25
|
+
* `guard:release-schema-complete` fails the build when a module defines schema
|
|
26
|
+
* and is not listed here.
|
|
27
|
+
*/
|
|
28
|
+
const FRAMEWORK_SCHEMA_ENSURES = [
|
|
29
|
+
[
|
|
30
|
+
"A2aContinuations",
|
|
31
|
+
() => import("../integrations/a2a-continuations-store.js").then((m) => m.ensureTable()),
|
|
32
|
+
],
|
|
33
|
+
[
|
|
34
|
+
"A2aTaskStore",
|
|
35
|
+
() => import("../a2a/task-store.js").then((m) => m.ensureTable()),
|
|
36
|
+
],
|
|
37
|
+
[
|
|
38
|
+
"AgentHarnessSessions",
|
|
39
|
+
() => import("../agent/harness/store.js").then((m) => m.ensureAgentHarnessSessionTables()),
|
|
40
|
+
],
|
|
41
|
+
[
|
|
42
|
+
"AgentRuns",
|
|
43
|
+
() => import("../agent/run-store.js").then((m) => m.ensureRunTables()),
|
|
44
|
+
],
|
|
45
|
+
[
|
|
46
|
+
"AgentTeamRunQueue",
|
|
47
|
+
() => import("./agent-teams-run-queue.js").then((m) => m.ensureTable()),
|
|
48
|
+
],
|
|
49
|
+
[
|
|
50
|
+
"AgentToolApprovals",
|
|
51
|
+
() => import("../agent/tool-approval-store.js").then((m) => m.ensureAgentToolApprovalTable()),
|
|
52
|
+
],
|
|
53
|
+
[
|
|
54
|
+
"AppSecrets",
|
|
55
|
+
() => import("../secrets/storage.js").then((m) => m.ensureTable()),
|
|
56
|
+
],
|
|
57
|
+
[
|
|
58
|
+
"ApplicationState",
|
|
59
|
+
() => import("../application-state/store.js").then((m) => m.ensureTable()),
|
|
60
|
+
],
|
|
61
|
+
[
|
|
62
|
+
"Audit",
|
|
63
|
+
() => import("../audit/store.js").then((m) => m.ensureAuditTables()),
|
|
64
|
+
],
|
|
65
|
+
[
|
|
66
|
+
"AuthSessions",
|
|
67
|
+
() => import("./auth.js").then((m) => m.ensureSessionTable()),
|
|
68
|
+
],
|
|
69
|
+
[
|
|
70
|
+
"AutomationRunHistory",
|
|
71
|
+
() => import("../jobs/run-history.js").then((m) => m.ensureTable()),
|
|
72
|
+
],
|
|
73
|
+
[
|
|
74
|
+
"AwaitingInputs",
|
|
75
|
+
() => import("../integrations/awaiting-input-store.js").then((m) => m.ensureTable()),
|
|
76
|
+
],
|
|
77
|
+
[
|
|
78
|
+
"BrowserSessions",
|
|
79
|
+
() => import("../browser-sessions/store.js").then((m) => m.ensureTables()),
|
|
80
|
+
],
|
|
81
|
+
[
|
|
82
|
+
"ChatThreads",
|
|
83
|
+
() => import("../chat-threads/store.js").then((m) => m.ensureChatThreadTables()),
|
|
84
|
+
],
|
|
85
|
+
[
|
|
86
|
+
"Checkpoints",
|
|
87
|
+
() => import("../checkpoints/store.js").then((m) => m.ensureCheckpointTable()),
|
|
88
|
+
],
|
|
89
|
+
[
|
|
90
|
+
"CollabAwareness",
|
|
91
|
+
() => import("../collab/awareness-store.js").then((m) => m.ensureTable()),
|
|
92
|
+
],
|
|
93
|
+
[
|
|
94
|
+
"CollabDocs",
|
|
95
|
+
() => import("../collab/storage.js").then((m) => m.ensureTable()),
|
|
96
|
+
],
|
|
97
|
+
[
|
|
98
|
+
"ComputerApprovals",
|
|
99
|
+
() => import("../integrations/computer-supervision-store.js").then((m) => m.ensureComputerApprovalStore()),
|
|
100
|
+
],
|
|
101
|
+
[
|
|
102
|
+
"ConversationScopes",
|
|
103
|
+
() => import("../integrations/scope-store.js").then((m) => m.ensureTable()),
|
|
104
|
+
],
|
|
105
|
+
[
|
|
106
|
+
"CustomApiProviders",
|
|
107
|
+
() => import("../provider-api/custom-registry.js").then((m) => m.ensureTable()),
|
|
108
|
+
],
|
|
109
|
+
[
|
|
110
|
+
"DataPrograms",
|
|
111
|
+
() => import("../data-programs/store.js").then((m) => m.ensureDataProgramTables()),
|
|
112
|
+
],
|
|
113
|
+
[
|
|
114
|
+
"EmailLog",
|
|
115
|
+
() => import("../email-catalog/log.js").then((m) => m.ensureTable()),
|
|
116
|
+
],
|
|
117
|
+
[
|
|
118
|
+
"EmbedSessions",
|
|
119
|
+
() => import("./embed-session.js").then((m) => m.ensureTable()),
|
|
120
|
+
],
|
|
121
|
+
[
|
|
122
|
+
"ExtensionSlots",
|
|
123
|
+
() => import("../extensions/slots/store.js").then((m) => m.ensureSlotTables()),
|
|
124
|
+
],
|
|
125
|
+
[
|
|
126
|
+
"Extensions",
|
|
127
|
+
() => import("../extensions/store.js").then((m) => m.ensureExtensionsTables()),
|
|
128
|
+
],
|
|
129
|
+
[
|
|
130
|
+
"IdentityLinks",
|
|
131
|
+
() => import("../integrations/identity-links-store.js").then((m) => m.ensureTable()),
|
|
132
|
+
],
|
|
133
|
+
[
|
|
134
|
+
"IdentitySso",
|
|
135
|
+
() => import("./identity-sso-store.js").then((m) => m.ensureTable()),
|
|
136
|
+
],
|
|
137
|
+
[
|
|
138
|
+
"Installations",
|
|
139
|
+
() => import("../integrations/installations-store.js").then((m) => m.ensureTable()),
|
|
140
|
+
],
|
|
141
|
+
[
|
|
142
|
+
"IntegrationCampaigns",
|
|
143
|
+
() => import("../integrations/integration-campaigns-store.js").then((m) => m.ensureIntegrationCampaignsTable()),
|
|
144
|
+
],
|
|
145
|
+
[
|
|
146
|
+
"IntegrationConfigs",
|
|
147
|
+
() => import("../integrations/config-store.js").then((m) => m.ensureTable()),
|
|
148
|
+
],
|
|
149
|
+
[
|
|
150
|
+
"IntegrationControls",
|
|
151
|
+
() => import("../integrations/controls-store.js").then((m) => m.ensureTable()),
|
|
152
|
+
],
|
|
153
|
+
[
|
|
154
|
+
"McpApprovals",
|
|
155
|
+
() => import("../mcp/approval-store.js").then((m) => m.ensureApprovalTable()),
|
|
156
|
+
],
|
|
157
|
+
[
|
|
158
|
+
"McpConnect",
|
|
159
|
+
() => import("../mcp/connect-store.js").then((m) => m.ensureTable()),
|
|
160
|
+
],
|
|
161
|
+
[
|
|
162
|
+
"McpOauth",
|
|
163
|
+
() => import("../mcp/oauth-store.js").then((m) => m.ensureTable()),
|
|
164
|
+
],
|
|
165
|
+
[
|
|
166
|
+
"Notifications",
|
|
167
|
+
() => import("../notifications/store.js").then((m) => m.ensureTable()),
|
|
168
|
+
],
|
|
169
|
+
[
|
|
170
|
+
"OauthTokens",
|
|
171
|
+
() => import("../oauth-tokens/store.js").then((m) => m.ensureTable()),
|
|
172
|
+
],
|
|
173
|
+
[
|
|
174
|
+
"Observability",
|
|
175
|
+
() => import("../observability/store.js").then((m) => m.ensureObservabilityTables()),
|
|
176
|
+
],
|
|
177
|
+
[
|
|
178
|
+
"ObservationalMemory",
|
|
179
|
+
() => import("../agent/observational-memory/store.js").then((m) => m.ensureTable()),
|
|
180
|
+
],
|
|
181
|
+
[
|
|
182
|
+
"PendingTasks",
|
|
183
|
+
() => import("../integrations/pending-tasks-store.js").then((m) => m.ensurePendingTasksTable()),
|
|
184
|
+
],
|
|
185
|
+
[
|
|
186
|
+
"Progress",
|
|
187
|
+
() => import("../progress/store.js").then((m) => m.ensureTable()),
|
|
188
|
+
],
|
|
189
|
+
[
|
|
190
|
+
"ProviderCorpusJobs",
|
|
191
|
+
() => import("../provider-api/corpus-jobs-store.js").then((m) => m.ensureTables()),
|
|
192
|
+
],
|
|
193
|
+
[
|
|
194
|
+
"ProviderQuotaCooldowns",
|
|
195
|
+
() => import("../provider-api/quota-governor.js").then((m) => m.ensureCooldownTable()),
|
|
196
|
+
],
|
|
197
|
+
[
|
|
198
|
+
"RecapImages",
|
|
199
|
+
() => import("./recap-image-store.js").then((m) => m.ensureRecapImageTable()),
|
|
200
|
+
],
|
|
201
|
+
[
|
|
202
|
+
"RemoteCommands",
|
|
203
|
+
() => import("../integrations/remote-commands-store.js").then((m) => m.ensureTable()),
|
|
204
|
+
],
|
|
205
|
+
[
|
|
206
|
+
"RemoteDevices",
|
|
207
|
+
() => import("../integrations/remote-devices-store.js").then((m) => m.ensureTable()),
|
|
208
|
+
],
|
|
209
|
+
[
|
|
210
|
+
"RemotePush",
|
|
211
|
+
() => import("../integrations/remote-push-store.js").then((m) => m.ensureTables()),
|
|
212
|
+
],
|
|
213
|
+
[
|
|
214
|
+
"RemoteRunEvents",
|
|
215
|
+
() => import("../integrations/remote-run-events-store.js").then((m) => m.ensureTable()),
|
|
216
|
+
],
|
|
217
|
+
[
|
|
218
|
+
"ResourceVersions",
|
|
219
|
+
() => import("../history/store.js").then((m) => m.ensureResourceVersionsTable()),
|
|
220
|
+
],
|
|
221
|
+
[
|
|
222
|
+
"Resources",
|
|
223
|
+
() => import("../resources/store.js").then((m) => m.ensureTable()),
|
|
224
|
+
],
|
|
225
|
+
[
|
|
226
|
+
"Review",
|
|
227
|
+
() => import("../review/store.js").then((m) => m.ensureReviewTables()),
|
|
228
|
+
],
|
|
229
|
+
[
|
|
230
|
+
"SandboxExecutions",
|
|
231
|
+
() => import("../coding-tools/sandbox/executions-store.js").then((m) => m.ensureTable()),
|
|
232
|
+
],
|
|
233
|
+
[
|
|
234
|
+
"SchedulerHealth",
|
|
235
|
+
() => import("../jobs/scheduler-health.js").then((m) => m.ensureHealthTable()),
|
|
236
|
+
],
|
|
237
|
+
[
|
|
238
|
+
"Settings",
|
|
239
|
+
() => import("../settings/store.js").then((m) => m.ensureTable()),
|
|
240
|
+
],
|
|
241
|
+
[
|
|
242
|
+
"StagedDatasets",
|
|
243
|
+
() => import("../provider-api/staged-datasets-store.js").then((m) => m.ensureTables()),
|
|
244
|
+
],
|
|
245
|
+
[
|
|
246
|
+
"SyncEvents",
|
|
247
|
+
() => import("./poll.js").then((m) => m
|
|
248
|
+
.getDefaultAppSyncState()
|
|
249
|
+
.ensureSyncEventsTable()
|
|
250
|
+
.then(() => { })),
|
|
251
|
+
],
|
|
252
|
+
[
|
|
253
|
+
"ThreadMappings",
|
|
254
|
+
() => import("../integrations/thread-mapping-store.js").then((m) => m.ensureTable()),
|
|
255
|
+
],
|
|
256
|
+
[
|
|
257
|
+
"Usage",
|
|
258
|
+
() => import("../usage/store.js").then((m) => m.ensureUsageTable()),
|
|
259
|
+
],
|
|
260
|
+
[
|
|
261
|
+
"UsageAlerts",
|
|
262
|
+
() => import("../usage/alerts-store.js").then((m) => m.ensureTables()),
|
|
263
|
+
],
|
|
264
|
+
[
|
|
265
|
+
"UsageBudgets",
|
|
266
|
+
() => import("../integrations/usage-budget-store.js").then((m) => m.ensureTables()),
|
|
267
|
+
],
|
|
268
|
+
[
|
|
269
|
+
"WorkspaceConnections",
|
|
270
|
+
() => import("../workspace-connections/store.js").then((m) => m.ensureWorkspaceConnectionsTable()),
|
|
271
|
+
],
|
|
272
|
+
[
|
|
273
|
+
"WorkspaceUserGroups",
|
|
274
|
+
() => import("../workspace-connections/groups.js").then((m) => m.ensureWorkspaceUserGroupsTable()),
|
|
275
|
+
],
|
|
276
|
+
];
|
|
277
|
+
/** Store names in release order. Exported for the guard and its tests. */
|
|
278
|
+
export function frameworkSchemaEnsureNames() {
|
|
279
|
+
return FRAMEWORK_SCHEMA_ENSURES.map(([name]) => name);
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Create every framework-owned table, in one pass, before the app serves
|
|
283
|
+
* traffic. Callers must already hold migration duty via `withMigrationRuntime`;
|
|
284
|
+
* without it `schemaEnsureDisabled()` reports every table present and this
|
|
285
|
+
* whole pass silently creates nothing.
|
|
286
|
+
*
|
|
287
|
+
* Sequential on purpose: these run against one database at release time, where
|
|
288
|
+
* total wall clock does not matter and concurrent `CREATE TABLE` on a shared
|
|
289
|
+
* Neon instance contends for `ACCESS EXCLUSIVE` locks.
|
|
290
|
+
*
|
|
291
|
+
* A failure aborts the release rather than being collected and reported at the
|
|
292
|
+
* end. A half-created schema that reports success is the failure mode this
|
|
293
|
+
* module exists to remove.
|
|
294
|
+
*/
|
|
295
|
+
export async function runFrameworkSchemaEnsures(
|
|
296
|
+
// Injectable so the ordering and failure contract can be tested without
|
|
297
|
+
// standing up 60 real stores; production callers pass nothing.
|
|
298
|
+
ensures = FRAMEWORK_SCHEMA_ENSURES) {
|
|
299
|
+
for (const [name, run] of ensures) {
|
|
300
|
+
try {
|
|
301
|
+
await run();
|
|
302
|
+
}
|
|
303
|
+
catch (err) {
|
|
304
|
+
throw new Error(`Release schema step failed while creating ${name}: ${err?.message ?? String(err)}`, { cause: err });
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
package/dist/settings/store.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { EventEmitter } from "node:events";
|
|
2
2
|
export declare function getSettingsEmitter(): EventEmitter;
|
|
3
|
+
export declare function ensureTable(): Promise<void>;
|
|
3
4
|
export declare function getSetting(key: string): Promise<Record<string, unknown> | null>;
|
|
4
5
|
export interface StoreWriteOptions {
|
|
5
6
|
/** Tag identifying who initiated this write (e.g. a tab ID). */
|
package/dist/settings/store.js
CHANGED
|
@@ -58,7 +58,7 @@ export function getSettingsEmitter() {
|
|
|
58
58
|
function settingsTable() {
|
|
59
59
|
return isPostgres() ? "public.settings" : "settings";
|
|
60
60
|
}
|
|
61
|
-
async function ensureTable() {
|
|
61
|
+
export async function ensureTable() {
|
|
62
62
|
if (!_initPromise) {
|
|
63
63
|
_initPromise = (async () => {
|
|
64
64
|
const client = getDbExec();
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare const BETA_OPT_OUT_QUERY_PARAM = "agentNativeBetaOptOut";
|
|
2
|
+
export declare const BETA_OPT_OUT_DURATION_MS: number;
|
|
3
|
+
export declare const ENVIRONMENT_BETA_HOSTS: {
|
|
4
|
+
readonly "agent-workspace.builder.io": "beta.agent-workspace.builder.io";
|
|
5
|
+
readonly "analytics.agent-native.com": "beta.analytics.agent-native.com";
|
|
6
|
+
readonly "assets.agent-native.com": "beta.assets.agent-native.com";
|
|
7
|
+
readonly "brain.agent-native.com": "beta.brain.agent-native.com";
|
|
8
|
+
readonly "calendar.agent-native.com": "beta.calendar.agent-native.com";
|
|
9
|
+
readonly "chat.agent-native.com": "beta.chat.agent-native.com";
|
|
10
|
+
readonly "clips.agent-native.com": "beta.clips.agent-native.com";
|
|
11
|
+
readonly "content.agent-native.com": "beta.content.agent-native.com";
|
|
12
|
+
readonly "crm.agent-native.com": "beta.crm.agent-native.com";
|
|
13
|
+
readonly "design.agent-native.com": "beta.design.agent-native.com";
|
|
14
|
+
readonly "dispatch.agent-native.com": "beta.dispatch.agent-native.com";
|
|
15
|
+
readonly "factory.agent-native.com": "beta.factory.agent-native.com";
|
|
16
|
+
readonly "forms.agent-native.com": "beta.forms.agent-native.com";
|
|
17
|
+
readonly "macros.agent-native.com": "beta.macros.agent-native.com";
|
|
18
|
+
readonly "mail.agent-native.com": "beta.mail.agent-native.com";
|
|
19
|
+
readonly "plan.agent-native.com": "beta.plan.agent-native.com";
|
|
20
|
+
readonly "slides.agent-native.com": "beta.slides.agent-native.com";
|
|
21
|
+
};
|
|
22
|
+
export interface EnvironmentBadgeTargets {
|
|
23
|
+
betaHost: string;
|
|
24
|
+
productionHost: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function resolveEnvironmentTargets(hostname: string | undefined): EnvironmentBadgeTargets | null;
|
|
27
|
+
export declare function buildEnvironmentUrl(sourceHref: string, targetHost: string): string | null;
|
|
28
|
+
export declare function buildEnvironmentOptOutUrl(sourceHref: string, targetHost: string, now?: number): string | null;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export const BETA_OPT_OUT_QUERY_PARAM = "agentNativeBetaOptOut";
|
|
2
|
+
export const BETA_OPT_OUT_DURATION_MS = 24 * 60 * 60 * 1000;
|
|
3
|
+
export const ENVIRONMENT_BETA_HOSTS = {
|
|
4
|
+
"agent-workspace.builder.io": "beta.agent-workspace.builder.io",
|
|
5
|
+
"analytics.agent-native.com": "beta.analytics.agent-native.com",
|
|
6
|
+
"assets.agent-native.com": "beta.assets.agent-native.com",
|
|
7
|
+
"brain.agent-native.com": "beta.brain.agent-native.com",
|
|
8
|
+
"calendar.agent-native.com": "beta.calendar.agent-native.com",
|
|
9
|
+
"chat.agent-native.com": "beta.chat.agent-native.com",
|
|
10
|
+
"clips.agent-native.com": "beta.clips.agent-native.com",
|
|
11
|
+
"content.agent-native.com": "beta.content.agent-native.com",
|
|
12
|
+
"crm.agent-native.com": "beta.crm.agent-native.com",
|
|
13
|
+
"design.agent-native.com": "beta.design.agent-native.com",
|
|
14
|
+
"dispatch.agent-native.com": "beta.dispatch.agent-native.com",
|
|
15
|
+
"factory.agent-native.com": "beta.factory.agent-native.com",
|
|
16
|
+
"forms.agent-native.com": "beta.forms.agent-native.com",
|
|
17
|
+
"macros.agent-native.com": "beta.macros.agent-native.com",
|
|
18
|
+
"mail.agent-native.com": "beta.mail.agent-native.com",
|
|
19
|
+
"plan.agent-native.com": "beta.plan.agent-native.com",
|
|
20
|
+
"slides.agent-native.com": "beta.slides.agent-native.com",
|
|
21
|
+
};
|
|
22
|
+
export function resolveEnvironmentTargets(hostname) {
|
|
23
|
+
const normalized = hostname?.trim().toLowerCase().replace(/\.$/, "");
|
|
24
|
+
if (!normalized)
|
|
25
|
+
return null;
|
|
26
|
+
const productionHost = normalized.replace(/^beta\./, "");
|
|
27
|
+
const betaHost = ENVIRONMENT_BETA_HOSTS[productionHost];
|
|
28
|
+
if (!betaHost)
|
|
29
|
+
return null;
|
|
30
|
+
return {
|
|
31
|
+
betaHost,
|
|
32
|
+
productionHost,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export function buildEnvironmentUrl(sourceHref, targetHost) {
|
|
36
|
+
try {
|
|
37
|
+
const target = new URL(sourceHref);
|
|
38
|
+
target.protocol = "https:";
|
|
39
|
+
target.hostname = targetHost;
|
|
40
|
+
target.port = "";
|
|
41
|
+
return target.toString();
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
// coercion-ok: Invalid navigation input is an explicit absent target.
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export function buildEnvironmentOptOutUrl(sourceHref, targetHost, now = Date.now()) {
|
|
49
|
+
const targetHref = buildEnvironmentUrl(sourceHref, targetHost);
|
|
50
|
+
if (!targetHref)
|
|
51
|
+
return null;
|
|
52
|
+
try {
|
|
53
|
+
const target = new URL(targetHref);
|
|
54
|
+
target.searchParams.set(BETA_OPT_OUT_QUERY_PARAM, String(now + BETA_OPT_OUT_DURATION_MS));
|
|
55
|
+
return target.toString();
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
// coercion-ok: buildEnvironmentUrl already validated the URL.
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -224,7 +224,9 @@ export default defineAction({
|
|
|
224
224
|
return { id: existing.id, updated: true };
|
|
225
225
|
}
|
|
226
226
|
const id = nanoid();
|
|
227
|
-
await db
|
|
227
|
+
const [inserted] = await db
|
|
228
|
+
.insert(reg.sharesTable)
|
|
229
|
+
.values({
|
|
228
230
|
id,
|
|
229
231
|
resourceId: args.resourceId,
|
|
230
232
|
principalType: args.principalType,
|
|
@@ -232,7 +234,25 @@ export default defineAction({
|
|
|
232
234
|
role: args.role,
|
|
233
235
|
createdBy: actor,
|
|
234
236
|
createdAt: new Date().toISOString(),
|
|
235
|
-
})
|
|
237
|
+
})
|
|
238
|
+
.onConflictDoNothing()
|
|
239
|
+
.returning({ id: reg.sharesTable.id });
|
|
240
|
+
if (!inserted) {
|
|
241
|
+
const [existingAfterConflict] = await db
|
|
242
|
+
.select()
|
|
243
|
+
.from(reg.sharesTable)
|
|
244
|
+
.where(and(eq(reg.sharesTable.resourceId, args.resourceId), eq(reg.sharesTable.principalType, args.principalType), principalIdMatches(reg.sharesTable, args.principalType, principalId)));
|
|
245
|
+
if (!existingAfterConflict) {
|
|
246
|
+
throw new Error("Share conflict could not be resolved.");
|
|
247
|
+
}
|
|
248
|
+
await db
|
|
249
|
+
.update(reg.sharesTable)
|
|
250
|
+
.set({ role: args.role })
|
|
251
|
+
.where(eq(reg.sharesTable.id, existingAfterConflict.id));
|
|
252
|
+
invalidateCollabAccessCache(args.resourceType, args.resourceId);
|
|
253
|
+
await notifyExtensionShareChanged(args.resourceType, args.resourceId, beforeExtensionTargets);
|
|
254
|
+
return { id: existingAfterConflict.id, updated: true };
|
|
255
|
+
}
|
|
236
256
|
invalidateCollabAccessCache(args.resourceType, args.resourceId);
|
|
237
257
|
await notifyExtensionShareChanged(args.resourceType, args.resourceId, beforeExtensionTargets);
|
|
238
258
|
if (args.notify !== false &&
|
|
@@ -835,9 +835,16 @@
|
|
|
835
835
|
/* Connect AI card: use the card width, not the viewport, so narrow embedded
|
|
836
836
|
sidebars stack the copy and actions before the secondary button clips. */
|
|
837
837
|
.agent-builder-setup-card {
|
|
838
|
+
container-type: inline-size;
|
|
839
|
+
container-name: agent-builder-setup;
|
|
838
840
|
min-inline-size: min(18rem, 100%);
|
|
839
841
|
}
|
|
840
842
|
|
|
843
|
+
.agent-builder-setup-content {
|
|
844
|
+
container-type: inline-size;
|
|
845
|
+
container-name: agent-builder-setup;
|
|
846
|
+
}
|
|
847
|
+
|
|
841
848
|
/* Provider setup tucks behind the composer. The extra bottom paint is hidden
|
|
842
849
|
by the higher composer layer, leaving one connected control. */
|
|
843
850
|
.agent-builder-setup-card--attached {
|
|
@@ -887,11 +894,6 @@
|
|
|
887
894
|
box-shadow: none;
|
|
888
895
|
}
|
|
889
896
|
|
|
890
|
-
.agent-builder-setup-card--sidebar {
|
|
891
|
-
container-type: inline-size;
|
|
892
|
-
container-name: agent-builder-setup;
|
|
893
|
-
}
|
|
894
|
-
|
|
895
897
|
.agent-builder-setup-card--sidebar .agent-builder-setup-card__actions {
|
|
896
898
|
gap: 0.25rem;
|
|
897
899
|
}
|
|
@@ -925,16 +927,15 @@
|
|
|
925
927
|
}
|
|
926
928
|
|
|
927
929
|
.agent-builder-setup-card__actions {
|
|
928
|
-
align-items:
|
|
929
|
-
flex-direction:
|
|
930
|
-
flex-wrap: wrap;
|
|
930
|
+
align-items: stretch;
|
|
931
|
+
flex-direction: column;
|
|
931
932
|
gap: 0.5rem;
|
|
932
933
|
width: 100%;
|
|
933
934
|
}
|
|
934
935
|
|
|
935
936
|
.agent-builder-setup-card__builder-cta {
|
|
936
937
|
align-items: stretch;
|
|
937
|
-
|
|
938
|
+
width: 100%;
|
|
938
939
|
}
|
|
939
940
|
|
|
940
941
|
.agent-builder-setup-card__builder-button {
|
|
@@ -946,14 +947,15 @@
|
|
|
946
947
|
.agent-builder-setup-card__key-button {
|
|
947
948
|
flex: 0 0 auto;
|
|
948
949
|
min-width: 0;
|
|
949
|
-
width:
|
|
950
|
+
width: 100%;
|
|
950
951
|
}
|
|
951
|
-
}
|
|
952
952
|
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
953
|
+
.agent-builder-setup-card--sidebar .agent-builder-setup-card__builder-button {
|
|
954
|
+
width: 100%;
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
.agent-builder-setup-card--sidebar .agent-builder-setup-card__key-button {
|
|
958
|
+
width: 100%;
|
|
957
959
|
}
|
|
958
960
|
}
|
|
959
961
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type H3Event } from "h3";
|
|
2
|
+
import { type JobFrontmatter } from "../jobs/frontmatter.js";
|
|
2
3
|
import type { TriggerFrontmatter } from "./types.js";
|
|
3
4
|
export interface AutomationRouteItem {
|
|
4
5
|
id: string;
|
|
@@ -6,6 +7,7 @@ export interface AutomationRouteItem {
|
|
|
6
7
|
path: string;
|
|
7
8
|
owner: string;
|
|
8
9
|
appId?: string;
|
|
10
|
+
orgId?: string;
|
|
9
11
|
scope: "personal" | "organization";
|
|
10
12
|
canUpdate: boolean;
|
|
11
13
|
triggerType: TriggerFrontmatter["triggerType"];
|
|
@@ -24,6 +26,15 @@ export interface AutomationRouteItem {
|
|
|
24
26
|
nextRun?: string;
|
|
25
27
|
createdBy?: string;
|
|
26
28
|
body: string;
|
|
29
|
+
model?: string;
|
|
30
|
+
mcpTools: string[];
|
|
31
|
+
runAs?: JobFrontmatter["runAs"];
|
|
32
|
+
executionHostId?: string;
|
|
33
|
+
executionEngine?: string;
|
|
34
|
+
executionCwd?: string;
|
|
35
|
+
deliveryPlatform?: string;
|
|
36
|
+
deliveryDestination?: string;
|
|
37
|
+
deliveryThreadRef?: string;
|
|
27
38
|
}
|
|
28
39
|
interface SetAutomationEnabledInput {
|
|
29
40
|
owner?: string;
|
package/dist/triggers/routes.js
CHANGED
|
@@ -123,6 +123,7 @@ async function resourceToAutomationItem(event, userEmail, resource) {
|
|
|
123
123
|
path: resource.path,
|
|
124
124
|
owner: resource.owner,
|
|
125
125
|
appId: meta.appId,
|
|
126
|
+
orgId: meta.orgId,
|
|
126
127
|
scope: resource.owner === userEmail && !meta.orgId ? "personal" : "organization",
|
|
127
128
|
canUpdate: await currentUserCanUpdateAutomation(event, userEmail, resource, meta),
|
|
128
129
|
triggerType: meta.triggerType,
|
|
@@ -141,6 +142,15 @@ async function resourceToAutomationItem(event, userEmail, resource) {
|
|
|
141
142
|
nextRun: nextRunForMeta(meta),
|
|
142
143
|
createdBy: meta.createdBy,
|
|
143
144
|
body: parsed.body,
|
|
145
|
+
model: meta.model,
|
|
146
|
+
mcpTools: meta.mcpTools ?? [],
|
|
147
|
+
runAs: meta.runAs,
|
|
148
|
+
executionHostId: meta.executionHostId,
|
|
149
|
+
executionEngine: meta.executionEngine,
|
|
150
|
+
executionCwd: meta.executionCwd,
|
|
151
|
+
deliveryPlatform: meta.deliveryPlatform,
|
|
152
|
+
deliveryDestination: meta.deliveryDestination,
|
|
153
|
+
deliveryThreadRef: meta.deliveryThreadRef,
|
|
144
154
|
};
|
|
145
155
|
}
|
|
146
156
|
export async function listAutomationsForOwner(event, userEmail) {
|
|
@@ -58,6 +58,7 @@ export interface UsageAlertMutationResult {
|
|
|
58
58
|
rules: UsageAlertRule[];
|
|
59
59
|
current: UsageAlertEventSummary | null;
|
|
60
60
|
}
|
|
61
|
+
export declare function ensureTables(): Promise<void>;
|
|
61
62
|
export declare function listUsageAlerts(input: UsageAlertListOptions, access: UsageAlertAccess): Promise<UsageAlertRule[]>;
|
|
62
63
|
export declare function saveUsageAlert(input: SaveUsageAlertInput, access: UsageAlertAccess): Promise<UsageAlertMutationResult>;
|
|
63
64
|
export declare function setUsageAlertEnabled(ruleId: string, scope: UsageAlertScope, enabled: boolean, access: UsageAlertAccess): Promise<UsageAlertMutationResult>;
|
|
@@ -80,7 +80,7 @@ function ruleIdFor(partition, appId, unit, period) {
|
|
|
80
80
|
: `user:${partition.ownerEmail}`;
|
|
81
81
|
return `usage-alert:${partition.scope}:${principal}:${appId ?? "all"}:${unit}:${period}`;
|
|
82
82
|
}
|
|
83
|
-
async function ensureTables() {
|
|
83
|
+
export async function ensureTables() {
|
|
84
84
|
if (!initPromise) {
|
|
85
85
|
initPromise = (async () => {
|
|
86
86
|
const db = getDbExec();
|
package/dist/usage/store.d.ts
CHANGED
|
@@ -47,6 +47,7 @@ export interface UsageRecord {
|
|
|
47
47
|
sourceId?: string;
|
|
48
48
|
}
|
|
49
49
|
export type UsageCostSource = "reported" | "estimated" | "unavailable";
|
|
50
|
+
export declare function ensureUsageTable(): Promise<void>;
|
|
50
51
|
/**
|
|
51
52
|
* Calculate cost in centicents (1/100th of a cent).
|
|
52
53
|
* Accepts cache tokens so callers that use prompt caching are priced
|
package/dist/usage/store.js
CHANGED
|
@@ -139,7 +139,7 @@ function pricingFor(model) {
|
|
|
139
139
|
return PRICING[PRICING.length - 1].pricing;
|
|
140
140
|
}
|
|
141
141
|
let _initPromise;
|
|
142
|
-
async function ensureUsageTable() {
|
|
142
|
+
export async function ensureUsageTable() {
|
|
143
143
|
if (!_initPromise) {
|
|
144
144
|
_initPromise = (async () => {
|
|
145
145
|
const client = getDbExec();
|