@agent-native/core 0.157.8 → 0.157.10

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.
Files changed (154) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/templates/analytics/actions/purge-first-party-analytics-postgres.ts +26 -8
  3. package/corpus/templates/analytics/scripts/first-party-analytics-postgres-retention-dry-run.sql +261 -0
  4. package/corpus/templates/analytics/server/lib/first-party-analytics-backend.ts +3 -1
  5. package/corpus/templates/analytics/server/lib/first-party-analytics-purge.ts +75 -31
  6. package/corpus/templates/analytics/server/lib/workspace-feature-flags.ts +4 -1
  7. package/corpus/templates/analytics/server/plugins/db.ts +139 -0
  8. package/corpus/templates/slides/AGENTS.md +14 -10
  9. package/corpus/templates/slides/actions/export-pptx.ts +1311 -121
  10. package/corpus/templates/slides/actions/import-file.ts +28 -1
  11. package/corpus/templates/slides/actions/import-pptx.ts +69 -42
  12. package/corpus/templates/slides/app/components/deck/SlideRenderer.tsx +222 -29
  13. package/corpus/templates/slides/app/components/editor/ExportMenu.tsx +71 -0
  14. package/corpus/templates/slides/app/global.css +19 -1
  15. package/corpus/templates/slides/app/lib/export-google-slides-client.ts +44 -5
  16. package/corpus/templates/slides/app/lib/export-pdf-client.ts +13 -6
  17. package/corpus/templates/slides/app/lib/export-pptx-client.ts +601 -30
  18. package/corpus/templates/slides/app/pages/DeckEditor.tsx +18 -1
  19. package/corpus/templates/slides/server/handlers/import/html-converter.ts +1240 -22
  20. package/corpus/templates/slides/server/handlers/import/pdf-fidelity-parser.ts +329 -64
  21. package/corpus/templates/slides/server/handlers/import/pptx-assets.ts +24 -0
  22. package/corpus/templates/slides/server/lib/source-import.ts +10 -1
  23. package/corpus/templates/slides/shared/aspect-ratios.ts +13 -1
  24. package/dist/agent/harness/migrations.d.ts +4 -0
  25. package/dist/agent/harness/migrations.js +60 -0
  26. package/dist/agent/production-agent.d.ts +2 -0
  27. package/dist/agent/production-agent.js +15 -0
  28. package/dist/agent/run-loop-with-resume.d.ts +1 -0
  29. package/dist/agent/run-loop-with-resume.js +44 -12
  30. package/dist/agent/run-migrations.d.ts +8 -0
  31. package/dist/agent/run-migrations.js +61 -0
  32. package/dist/automations/service.d.ts +6 -0
  33. package/dist/automations/service.js +35 -0
  34. package/dist/chat-threads/migrations.d.ts +1 -0
  35. package/dist/chat-threads/migrations.js +1 -0
  36. package/dist/chat-threads/schema-migrations.d.ts +8 -0
  37. package/dist/chat-threads/schema-migrations.js +60 -0
  38. package/dist/cli/code-agent-connector.d.ts +4 -1
  39. package/dist/cli/code-agent-connector.js +154 -23
  40. package/dist/cli/code-agent-executor.js +255 -13
  41. package/dist/cli/code-agent-runs.d.ts +1 -0
  42. package/dist/cli/code-agent-runs.js +2 -1
  43. package/dist/cli/portal-workspace.d.ts +49 -0
  44. package/dist/cli/portal-workspace.js +320 -0
  45. package/dist/client/AssistantChat.d.ts +1 -1
  46. package/dist/client/AssistantChat.js +43 -61
  47. package/dist/client/ConnectBuilderCard.js +33 -5
  48. package/dist/client/agent-chat-adapter.js +4 -0
  49. package/dist/client/analytics-platform.d.ts +2 -0
  50. package/dist/client/analytics-platform.js +12 -0
  51. package/dist/client/analytics.d.ts +3 -0
  52. package/dist/client/analytics.js +10 -1
  53. package/dist/client/chat/index.d.ts +1 -0
  54. package/dist/client/chat/index.js +1 -0
  55. package/dist/client/chat/message-components.d.ts +2 -0
  56. package/dist/client/chat/message-components.js +11 -1
  57. package/dist/client/chat/run-recovery.d.ts +2 -1
  58. package/dist/client/chat/run-recovery.js +2 -2
  59. package/dist/client/chat-first/apps-rail.d.ts +1 -1
  60. package/dist/client/chat-first/apps-rail.js +11 -11
  61. package/dist/client/chat-first/surface-tabs.d.ts +1 -1
  62. package/dist/client/chat-first/surface-tabs.js +38 -36
  63. package/dist/client/chat-first/types.d.ts +5 -0
  64. package/dist/client/chat-first.d.ts +1 -1
  65. package/dist/client/chat-first.js +4 -4
  66. package/dist/client/desktop-local-code-change.d.ts +10 -0
  67. package/dist/client/desktop-local-code-change.js +16 -0
  68. package/dist/client/index.d.ts +1 -0
  69. package/dist/client/index.js +1 -0
  70. package/dist/client/observability/ThumbsFeedback.js +53 -26
  71. package/dist/client/observability/useObservability.d.ts +1 -1
  72. package/dist/client/observability/useObservability.js +6 -3
  73. package/dist/client/terminal/AgentTerminal.d.ts +9 -1
  74. package/dist/client/terminal/AgentTerminal.js +38 -3
  75. package/dist/client/terminal/index.d.ts +1 -1
  76. package/dist/client/terminal/index.js +1 -1
  77. package/dist/client/track.js +9 -1
  78. package/dist/client/use-action.js +3 -0
  79. package/dist/collab/awareness.d.ts +2 -2
  80. package/dist/deploy/build.js +1 -1
  81. package/dist/feature-flags/a2a-action-route.js +4 -2
  82. package/dist/feature-flags/permissions.d.ts +2 -0
  83. package/dist/feature-flags/permissions.js +6 -1
  84. package/dist/ingestion/pptx.d.ts +92 -1
  85. package/dist/ingestion/pptx.js +1180 -115
  86. package/dist/integrations/index.d.ts +3 -3
  87. package/dist/integrations/index.js +2 -2
  88. package/dist/integrations/plugin.js +95 -6
  89. package/dist/integrations/remote-commands-store.d.ts +5 -0
  90. package/dist/integrations/remote-commands-store.js +63 -22
  91. package/dist/integrations/remote-devices-store.d.ts +2 -1
  92. package/dist/integrations/remote-devices-store.js +46 -0
  93. package/dist/integrations/remote-types.d.ts +20 -0
  94. package/dist/jobs/actions/list-recurring-jobs.d.ts +3 -0
  95. package/dist/jobs/actions/list-recurring-jobs.js +5 -1
  96. package/dist/jobs/frontmatter.d.ts +16 -0
  97. package/dist/jobs/frontmatter.js +53 -0
  98. package/dist/jobs/remote-execution.d.ts +42 -0
  99. package/dist/jobs/remote-execution.js +287 -0
  100. package/dist/jobs/scheduler.js +102 -3
  101. package/dist/jobs/tools.js +50 -3
  102. package/dist/localization/core-messages/ar-SA.js +4 -0
  103. package/dist/localization/core-messages/de-DE.js +4 -0
  104. package/dist/localization/core-messages/en-US.d.ts +4 -0
  105. package/dist/localization/core-messages/en-US.js +4 -0
  106. package/dist/localization/core-messages/es-ES.js +4 -0
  107. package/dist/localization/core-messages/fr-FR.js +4 -0
  108. package/dist/localization/core-messages/hi-IN.js +4 -0
  109. package/dist/localization/core-messages/ja-JP.js +4 -0
  110. package/dist/localization/core-messages/ko-KR.js +4 -0
  111. package/dist/localization/core-messages/pt-BR.js +4 -0
  112. package/dist/localization/core-messages/zh-CN.js +4 -0
  113. package/dist/localization/core-messages/zh-TW.js +4 -0
  114. package/dist/localization/core-messages.d.ts +4 -0
  115. package/dist/notifications/routes.d.ts +3 -3
  116. package/dist/observability/feedback.js +40 -16
  117. package/dist/observability/routes.d.ts +6 -6
  118. package/dist/observability/routes.js +15 -3
  119. package/dist/observability/store.js +2 -0
  120. package/dist/observability/traces.js +5 -1
  121. package/dist/provider-api/actions/custom-provider-registration.d.ts +16 -16
  122. package/dist/provider-api/actions/provider-api.d.ts +13 -13
  123. package/dist/provider-api/corpus-jobs.d.ts +2 -2
  124. package/dist/resources/handlers.d.ts +1 -1
  125. package/dist/secrets/routes.d.ts +9 -9
  126. package/dist/server/action-routes.d.ts +7 -5
  127. package/dist/server/action-routes.js +13 -6
  128. package/dist/server/agent-chat-plugin.js +6 -0
  129. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  130. package/dist/server/agent-run-context.d.ts +1 -0
  131. package/dist/server/agent-run-context.js +9 -0
  132. package/dist/server/better-auth-instance.js +4 -0
  133. package/dist/server/core-routes-plugin.js +8 -1
  134. package/dist/server/realtime-voice.js +2 -1
  135. package/dist/server/release-migrations.js +16 -0
  136. package/dist/server/request-context.d.ts +2 -0
  137. package/dist/server/transcribe-voice.d.ts +1 -1
  138. package/dist/shared/analytics-platform.d.ts +6 -0
  139. package/dist/shared/analytics-platform.js +14 -0
  140. package/dist/shared/mcp-embed-headers.d.ts +1 -1
  141. package/dist/shared/mcp-embed-headers.js +1 -1
  142. package/dist/styles/agent-native.css +83 -103
  143. package/dist/terminal/cli-registry.js +5 -0
  144. package/dist/tracking/registry.js +9 -1
  145. package/dist/triggers/actions/list-automations.d.ts +3 -0
  146. package/dist/triggers/actions/list-automations.js +3 -0
  147. package/dist/triggers/actions/manage-automation.d.ts +9 -0
  148. package/dist/triggers/actions/manage-automation.js +14 -2
  149. package/dist/triggers/actions.js +82 -7
  150. package/dist/usage/migrations.d.ts +4 -0
  151. package/dist/usage/migrations.js +45 -0
  152. package/docs/content/template-content-developers.mdx +48 -0
  153. package/docs/content/toolkit-ui.mdx +57 -0
  154. package/package.json +3 -3
@@ -27,10 +27,10 @@ export declare function resolveAgentEngineApiKeyWriteTarget(event: H3Event, scop
27
27
  export declare function createAgentEngineApiKeyHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
28
28
  error: any;
29
29
  } | {
30
+ error?: undefined;
30
31
  ok: boolean;
31
32
  key: string;
32
33
  baseUrlKey?: string;
33
34
  scope: AgentEngineApiKeyScope;
34
- error?: undefined;
35
35
  }>>;
36
36
  export {};
@@ -25,6 +25,7 @@ export declare function readAgentRunTimezone(event: H3Event): string | undefined
25
25
  * action calls and the agent's.
26
26
  */
27
27
  export declare function readBrowserSessionIdHeader(event: H3Event): string | undefined;
28
+ export declare function readAnalyticsClientPlatformHeader(event: H3Event): import("../shared/analytics-platform.js").AnalyticsClientPlatform | undefined;
28
29
  export declare function seedAgentRunOwnerContext(event: H3Event, ownerContext: AgentRunOwnerContext): AgentRunOwnerContext;
29
30
  export declare function seedBackgroundAgentRunOwnerContext(event: H3Event, runId: string, orgId?: string | null): Promise<AgentRunOwnerContext | null>;
30
31
  export declare function resolveAgentRunOwnerContext(event: H3Event, options?: {
@@ -1,5 +1,6 @@
1
1
  import { createError, getHeader } from "h3";
2
2
  import { resolveOrgIdForEmail, getOrgContext } from "../org/context.js";
3
+ import { ANALYTICS_CLIENT_PLATFORM_BODY_FIELD, ANALYTICS_CLIENT_PLATFORM_HEADER, normalizeAnalyticsClientPlatform, } from "../shared/analytics-platform.js";
3
4
  import { getSession } from "./auth.js";
4
5
  import { runWithRequestContext, } from "./request-context.js";
5
6
  export const AGENT_RUN_OWNER_CONTEXT_KEY = "__agentNativeOwnerContext";
@@ -62,6 +63,12 @@ export function readBrowserSessionIdHeader(event) {
62
63
  ? value.trim()
63
64
  : undefined;
64
65
  }
66
+ export function readAnalyticsClientPlatformHeader(event) {
67
+ const raw = readHeaderValue(event, ANALYTICS_CLIENT_PLATFORM_HEADER);
68
+ const value = Array.isArray(raw) ? raw[0] : raw;
69
+ return (normalizeAnalyticsClientPlatform(value) ??
70
+ normalizeAnalyticsClientPlatform(event.context?.[ANALYTICS_CLIENT_PLATFORM_BODY_FIELD]));
71
+ }
65
72
  export function seedAgentRunOwnerContext(event, ownerContext) {
66
73
  eventContext(event)[AGENT_RUN_OWNER_CONTEXT_KEY] =
67
74
  ownerContext;
@@ -150,6 +157,7 @@ export async function resolveAgentRunRequestContext(options) {
150
157
  const orgId = await resolveAgentRunOrgId(options);
151
158
  const timezone = readAgentRunTimezone(options.event);
152
159
  const browserSessionId = readBrowserSessionIdHeader(options.event);
160
+ const clientPlatform = readAnalyticsClientPlatformHeader(options.event);
153
161
  const waitUntil = requestWaitUntil(options.event);
154
162
  const run = {
155
163
  ...(options.isBackgroundWorker ? { isBackgroundWorker: true } : {}),
@@ -161,6 +169,7 @@ export async function resolveAgentRunRequestContext(options) {
161
169
  orgId,
162
170
  timezone,
163
171
  ...(browserSessionId ? { browserSessionId } : {}),
172
+ ...(clientPlatform ? { clientPlatform } : {}),
164
173
  ...(Object.keys(run).length > 0 ? { run } : {}),
165
174
  };
166
175
  }
@@ -854,6 +854,10 @@ async function createBetterAuthInstance(config) {
854
854
  basePath,
855
855
  baseURL: appUrl,
856
856
  database,
857
+ // Auth schema relations are intentionally not registered here. Keep the
858
+ // experimental relational-query path off so a bundled Drizzle adapter
859
+ // cannot recurse while resolving a session or account join.
860
+ experimental: { joins: false },
857
861
  secret,
858
862
  emailAndPassword: {
859
863
  enabled: true,
@@ -24,6 +24,7 @@ import { registerFrameworkSecrets } from "../secrets/register-framework-secrets.
24
24
  import { createListSecretsHandler, createWriteSecretHandler, createTestSecretHandler, createAdHocSecretHandler, } from "../secrets/routes.js";
25
25
  import { getSetting, putSetting, deleteSetting } from "../settings/store.js";
26
26
  import { getUserSetting, putUserSetting, deleteUserSetting, } from "../settings/user-settings.js";
27
+ import { ANALYTICS_CLIENT_PLATFORM_PROPERTY } from "../shared/analytics-platform.js";
27
28
  import { EMPTY_SPECULATION_RULES, resolveSsrCacheHeaders, } from "../shared/cache-control.js";
28
29
  import { EMBED_TARGET_HEADER } from "../shared/embed-auth.js";
29
30
  import { llmConnectionTrackingProperties } from "../shared/llm-connection.js";
@@ -35,7 +36,7 @@ import { registerBuiltinProviders } from "../tracking/providers.js";
35
36
  import { validateTrackPayload } from "../tracking/route.js";
36
37
  import { createAutomationsHandler } from "../triggers/routes.js";
37
38
  import { createAgentEngineApiKeyHandler } from "./agent-engine-api-key-route.js";
38
- import { readBrowserSessionIdHeader } from "./agent-run-context.js";
39
+ import { readAnalyticsClientPlatformHeader, readBrowserSessionIdHeader, } from "./agent-run-context.js";
39
40
  import { getConfiguredAppBasePath, stripAppBasePath } from "./app-base-path.js";
40
41
  import { getAppName } from "./app-name.js";
41
42
  import { getSession } from "./auth.js";
@@ -2608,8 +2609,14 @@ export function createCoreRoutesPlugin(options = {}) {
2608
2609
  catch {
2609
2610
  /* org module not present in this template — keep userEmail-only */
2610
2611
  }
2612
+ const clientPlatform = readAnalyticsClientPlatformHeader(event);
2611
2613
  const properties = {
2612
2614
  ...(validation.properties ?? {}),
2615
+ ...(clientPlatform
2616
+ ? {
2617
+ [ANALYTICS_CLIENT_PLATFORM_PROPERTY]: clientPlatform,
2618
+ }
2619
+ : {}),
2613
2620
  source: "client",
2614
2621
  };
2615
2622
  if (orgId)
@@ -25,7 +25,7 @@ export const REALTIME_VOICE_CAPABILITY_HEADER = "X-Agent-Native-Realtime-Capabil
25
25
  const OPENAI_REALTIME_CALLS_URL = "https://api.openai.com/v1/realtime/calls";
26
26
  const DEFAULT_MODEL = "gpt-realtime-2.1";
27
27
  const DEFAULT_VOICE = "marin";
28
- const DEFAULT_INSTRUCTIONS = "You are the live voice interface for this Agent Native app. Speak naturally, briefly, and conversationally. Use the available function tools when the user asks you to navigate or take an action. Never claim an action succeeded until its tool result confirms success. If a tool requires approval, explain that the user must approve it in chat.";
28
+ const DEFAULT_INSTRUCTIONS = "You are the live voice interface for this Agent Native app. Speak naturally, briefly, and conversationally. Use the available function tools when the user asks you to navigate or take an action. When the user asks about a previous conversation, saved chat details, or something they told you before, search with the `chat-history` tool before saying you cannot access it. Summarize a matching result and open a thread only when the user asks. If the user repeats a request, acknowledge the prior attempt and finish or correct the missing part instead of restarting from scratch or asking the same clarification again. Never claim an action succeeded until its tool result confirms success. If a tool requires approval, explain that the user must approve it in chat.";
29
29
  const MAX_INSTRUCTIONS_CHARS = 16_000;
30
30
  const MAX_TOOL_DESCRIPTION_CHARS = 2_000;
31
31
  const MAX_APPROVAL_KEY_CHARS = 1_024;
@@ -61,6 +61,7 @@ const REALTIME_VOICE_PRIORITY_TOOLS = [
61
61
  "set-url-path",
62
62
  "set-search-params",
63
63
  "view-screen",
64
+ "chat-history",
64
65
  TOOL_SEARCH_ACTION_NAME,
65
66
  ];
66
67
  function readSafeHeader(event, name) {
@@ -1,11 +1,15 @@
1
1
  import { CONTEXT_XRAY_MIGRATIONS } from "../agent/context-xray/migrations.js";
2
+ import { AGENT_HARNESS_SESSION_MIGRATIONS, AGENT_HARNESS_SESSION_MIGRATIONS_TABLE, } from "../agent/harness/migrations.js";
2
3
  import { OBSERVATIONAL_MEMORY_MIGRATIONS } from "../agent/observational-memory/migrations.js";
4
+ import { AGENT_RUN_MIGRATIONS, AGENT_RUN_MIGRATIONS_TABLE, } from "../agent/run-migrations.js";
3
5
  import { AGENT_TOOL_APPROVAL_MIGRATIONS, AGENT_TOOL_APPROVAL_MIGRATIONS_TABLE, } from "../agent/tool-approval-migrations.js";
6
+ import { CHAT_THREAD_SCHEMA_MIGRATIONS, CHAT_THREAD_SCHEMA_MIGRATIONS_TABLE, } from "../chat-threads/schema-migrations.js";
4
7
  import { runMigrations } from "../db/migrations.js";
5
8
  import { runAutomationRunMigrations } from "../jobs/run-history.js";
6
9
  import { runAutomationSchedulerHealthMigrations } from "../jobs/scheduler-health.js";
7
10
  import { OAUTH_TOKEN_MIGRATIONS, OAUTH_TOKEN_MIGRATIONS_TABLE, } from "../oauth-tokens/migrations.js";
8
11
  import { ORG_MIGRATIONS } from "../org/migrations.js";
12
+ import { USAGE_ALERT_MIGRATIONS, USAGE_ALERT_MIGRATIONS_TABLE, } from "../usage/migrations.js";
9
13
  import { runBetterAuthMigrations } from "./better-auth-migrations.js";
10
14
  import { IDENTITY_SSO_MIGRATIONS } from "./identity-sso-migrations.js";
11
15
  /**
@@ -23,6 +27,18 @@ export async function runFrameworkReleaseMigrations(nitroApp) {
23
27
  await runMigrations(OAUTH_TOKEN_MIGRATIONS, {
24
28
  table: OAUTH_TOKEN_MIGRATIONS_TABLE,
25
29
  })(nitroApp);
30
+ await runMigrations(CHAT_THREAD_SCHEMA_MIGRATIONS, {
31
+ table: CHAT_THREAD_SCHEMA_MIGRATIONS_TABLE,
32
+ })(nitroApp);
33
+ await runMigrations(AGENT_RUN_MIGRATIONS, {
34
+ table: AGENT_RUN_MIGRATIONS_TABLE,
35
+ })(nitroApp);
36
+ await runMigrations(AGENT_HARNESS_SESSION_MIGRATIONS, {
37
+ table: AGENT_HARNESS_SESSION_MIGRATIONS_TABLE,
38
+ })(nitroApp);
39
+ await runMigrations(USAGE_ALERT_MIGRATIONS, {
40
+ table: USAGE_ALERT_MIGRATIONS_TABLE,
41
+ })(nitroApp);
26
42
  await runMigrations(ORG_MIGRATIONS, { table: "_org_migrations" })(nitroApp);
27
43
  await runMigrations(IDENTITY_SSO_MIGRATIONS, {
28
44
  table: "_identity_sso_migrations",
@@ -109,6 +109,8 @@ export interface RequestContext {
109
109
  * replay; never used for authorization.
110
110
  */
111
111
  browserSessionId?: string;
112
+ /** Canonical client surface for analytics attribution. */
113
+ clientPlatform?: import("../shared/analytics-platform.js").AnalyticsClientPlatform;
112
114
  /**
113
115
  * Set when code reads authenticated request context. Public SSR shell/data
114
116
  * should not depend on this value; user/org-specific reads belong behind
@@ -20,6 +20,6 @@ export declare function createTranscribeVoiceHandler(): import("h3").EventHandle
20
20
  error: string;
21
21
  text?: undefined;
22
22
  } | {
23
- error?: undefined;
24
23
  text: string;
24
+ error?: undefined;
25
25
  }>>;
@@ -0,0 +1,6 @@
1
+ export declare const ANALYTICS_CLIENT_PLATFORM_HEADER = "X-Agent-Native-Client-Platform";
2
+ export declare const ANALYTICS_CLIENT_PLATFORM_PROPERTY = "client_platform";
3
+ export declare const ANALYTICS_CLIENT_PLATFORM_BODY_FIELD = "__agentNativeClientPlatform";
4
+ export declare const ANALYTICS_CLIENT_PLATFORMS: readonly ["web", "electron", "mobile"];
5
+ export type AnalyticsClientPlatform = (typeof ANALYTICS_CLIENT_PLATFORMS)[number];
6
+ export declare function normalizeAnalyticsClientPlatform(value: unknown): AnalyticsClientPlatform | undefined;
@@ -0,0 +1,14 @@
1
+ export const ANALYTICS_CLIENT_PLATFORM_HEADER = "X-Agent-Native-Client-Platform";
2
+ export const ANALYTICS_CLIENT_PLATFORM_PROPERTY = "client_platform";
3
+ export const ANALYTICS_CLIENT_PLATFORM_BODY_FIELD = "__agentNativeClientPlatform";
4
+ export const ANALYTICS_CLIENT_PLATFORMS = [
5
+ "web",
6
+ "electron",
7
+ "mobile",
8
+ ];
9
+ export function normalizeAnalyticsClientPlatform(value) {
10
+ return typeof value === "string" &&
11
+ ANALYTICS_CLIENT_PLATFORMS.includes(value)
12
+ ? value
13
+ : undefined;
14
+ }
@@ -1,4 +1,4 @@
1
- export declare const MCP_EMBED_CORS_ALLOW_HEADERS = "Content-Type,Authorization,X-Requested-With,X-Request-Source,X-Agent-Native-CSRF,X-Agent-Native-Frontend,X-Agent-Native-Client-Compatibility,X-Agent-Native-Build-Id,X-User-Timezone,X-Agent-Native-Session-Id,X-Agent-Native-Embed-Target,X-Agent-Native-Embed-Transplant";
1
+ export declare const MCP_EMBED_CORS_ALLOW_HEADERS = "Content-Type,Authorization,X-Requested-With,X-Request-Source,X-Agent-Native-CSRF,X-Agent-Native-Frontend,X-Agent-Native-Client-Compatibility,X-Agent-Native-Build-Id,X-User-Timezone,X-Agent-Native-Session-Id,X-Agent-Native-Client-Platform,X-Agent-Native-Embed-Target,X-Agent-Native-Embed-Transplant";
2
2
  export declare const EMBED_TRANSPLANT_HEADER = "x-agent-native-embed-transplant";
3
3
  export declare function isLocalMcpEmbedOrigin(origin: string | null | undefined): boolean;
4
4
  export declare function isClaudeMcpContentOrigin(origin: string | null | undefined): boolean;
@@ -1,4 +1,4 @@
1
- export const MCP_EMBED_CORS_ALLOW_HEADERS = "Content-Type,Authorization,X-Requested-With,X-Request-Source,X-Agent-Native-CSRF,X-Agent-Native-Frontend,X-Agent-Native-Client-Compatibility,X-Agent-Native-Build-Id,X-User-Timezone,X-Agent-Native-Session-Id,X-Agent-Native-Embed-Target,X-Agent-Native-Embed-Transplant";
1
+ export const MCP_EMBED_CORS_ALLOW_HEADERS = "Content-Type,Authorization,X-Requested-With,X-Request-Source,X-Agent-Native-CSRF,X-Agent-Native-Frontend,X-Agent-Native-Client-Compatibility,X-Agent-Native-Build-Id,X-User-Timezone,X-Agent-Native-Session-Id,X-Agent-Native-Client-Platform,X-Agent-Native-Embed-Target,X-Agent-Native-Embed-Transplant";
2
2
  export const EMBED_TRANSPLANT_HEADER = "x-agent-native-embed-transplant";
3
3
  const CLAUDE_MCP_CONTENT_HOST_RE = /^[a-f0-9]{32}\.claudemcpcontent\.com$/i;
4
4
  const CHATGPT_MCP_SANDBOX_HOST_RE = /^(?:[^.]+\.)?web-sandbox\.oaiusercontent\.com$/i;
@@ -492,7 +492,7 @@
492
492
 
493
493
  --animate-accordion-down: accordion-down 0.2s ease-out;
494
494
  --animate-accordion-up: accordion-up 0.2s ease-out;
495
- --animate-bounce-once: bounce-once 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
495
+ --animate-bounce-once: bounce-once 0.46s cubic-bezier(0.34, 1.56, 0.64, 1);
496
496
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
497
497
  --ease-collapse: cubic-bezier(0.2, 0, 0, 1);
498
498
  --ease-out-strong: cubic-bezier(0.23, 1, 0.32, 1);
@@ -518,10 +518,10 @@
518
518
  transform: translateY(0);
519
519
  }
520
520
  35% {
521
- transform: translateY(-8px);
521
+ transform: translateY(-5px);
522
522
  }
523
523
  65% {
524
- transform: translateY(-2px);
524
+ transform: translateY(-1px);
525
525
  }
526
526
  100% {
527
527
  transform: translateY(0);
@@ -838,6 +838,55 @@
838
838
  min-inline-size: min(18rem, 100%);
839
839
  }
840
840
 
841
+ /* Provider setup tucks behind the composer. The extra bottom paint is hidden
842
+ by the higher composer layer, leaving one connected control. */
843
+ .agent-builder-setup-card--attached {
844
+ position: relative;
845
+ z-index: 1;
846
+ margin-bottom: -2.5rem;
847
+ padding-bottom: 0 !important;
848
+ }
849
+
850
+ .agent-builder-setup-card--attached .agent-builder-setup-card__panel {
851
+ padding-bottom: calc(0.75rem + 1.875rem);
852
+ border-bottom-color: transparent;
853
+ border-bottom-left-radius: 0;
854
+ border-bottom-right-radius: 0;
855
+ background: color-mix(
856
+ in srgb,
857
+ hsl(var(--card)) 97%,
858
+ hsl(var(--foreground)) 3%
859
+ );
860
+ box-shadow: none;
861
+ }
862
+
863
+ .agent-builder-setup-card--attached.agent-builder-setup-card--sidebar
864
+ .agent-builder-setup-card__panel {
865
+ padding-bottom: calc(0.625rem + 1.875rem);
866
+ }
867
+
868
+ .agent-builder-setup-card--attached:not(.agent-builder-setup-card--sidebar) {
869
+ max-inline-size: min(100%, 750px);
870
+ margin-inline: auto;
871
+ padding-inline: 0 !important;
872
+ }
873
+
874
+ .agent-builder-setup-inline--attached {
875
+ position: relative;
876
+ z-index: 1;
877
+ margin-bottom: -2.5rem !important;
878
+ padding-bottom: calc(0.625rem + 1.875rem) !important;
879
+ border-bottom-color: transparent;
880
+ border-bottom-left-radius: 0;
881
+ border-bottom-right-radius: 0;
882
+ background: color-mix(
883
+ in srgb,
884
+ hsl(var(--card)) 97%,
885
+ hsl(var(--foreground)) 3%
886
+ );
887
+ box-shadow: none;
888
+ }
889
+
841
890
  .agent-builder-setup-card--sidebar {
842
891
  container-type: inline-size;
843
892
  container-name: agent-builder-setup;
@@ -913,6 +962,37 @@
913
962
  padding-block: 0.5rem;
914
963
  }
915
964
 
965
+ .agent-composer-area--attached-above {
966
+ padding-top: 0 !important;
967
+ }
968
+
969
+ .agent-composer-area--attached-above .agent-composer-root {
970
+ position: relative;
971
+ z-index: 3;
972
+ background: hsl(var(--muted));
973
+ background: color-mix(
974
+ in srgb,
975
+ hsl(var(--card)) 98%,
976
+ hsl(var(--foreground)) 2%
977
+ );
978
+ }
979
+
980
+ .dark .agent-composer-area--attached-above .agent-composer-root {
981
+ background: hsl(var(--card));
982
+ }
983
+
984
+ @media (prefers-color-scheme: dark) {
985
+ :root:not(.light) .agent-composer-area--attached-above .agent-composer-root {
986
+ background: hsl(var(--card));
987
+ }
988
+ }
989
+
990
+ @media (prefers-reduced-motion: reduce) {
991
+ .agent-builder-setup-card--attached.animate-bounce-once {
992
+ animation: none;
993
+ }
994
+ }
995
+
916
996
  .agent-composer-root--hero {
917
997
  min-height: 5.625rem;
918
998
  border-radius: 1rem;
@@ -937,106 +1017,6 @@
937
1017
  line-height: 1.75rem;
938
1018
  }
939
1019
 
940
- .agent-composer-root--missing-key {
941
- overflow: visible;
942
- }
943
-
944
- .agent-composer-missing-key-trigger {
945
- display: flex;
946
- cursor: pointer;
947
- min-height: 4.5rem;
948
- width: 100%;
949
- flex: 1;
950
- align-items: center;
951
- justify-content: flex-start;
952
- border: 0;
953
- border-radius: inherit;
954
- background: transparent;
955
- padding: 0.875rem;
956
- text-align: start;
957
- color: hsl(var(--foreground));
958
- outline: none;
959
- transition:
960
- background-color 150ms ease-out,
961
- box-shadow 150ms ease-out;
962
- }
963
-
964
- .agent-composer-missing-key-trigger:hover {
965
- background: hsl(var(--accent) / 0.45);
966
- }
967
-
968
- .agent-composer-missing-key-trigger:focus-visible {
969
- box-shadow: inset 0 0 0 2px hsl(var(--ring));
970
- }
971
-
972
- .agent-composer-missing-key-content {
973
- display: flex;
974
- min-width: 0;
975
- flex-direction: column;
976
- align-items: flex-start;
977
- gap: 0.5rem;
978
- }
979
-
980
- .agent-composer-missing-key-copy {
981
- display: flex;
982
- min-width: 0;
983
- flex-direction: column;
984
- gap: 0.25rem;
985
- }
986
-
987
- .agent-composer-missing-key-title {
988
- font-size: 0.8125rem;
989
- font-weight: 500;
990
- line-height: 1.25rem;
991
- }
992
-
993
- .agent-composer-missing-key-description {
994
- font-size: 0.6875rem;
995
- line-height: 1rem;
996
- color: hsl(var(--muted-foreground));
997
- }
998
-
999
- .agent-composer-missing-key-cta {
1000
- display: inline-flex;
1001
- min-height: 2rem;
1002
- align-items: center;
1003
- justify-content: center;
1004
- border-radius: 0.375rem;
1005
- background: hsl(var(--foreground));
1006
- padding: 0.5rem 0.75rem;
1007
- color: hsl(var(--background));
1008
- font-size: 0.75rem;
1009
- font-weight: 600;
1010
- line-height: 1rem;
1011
- transition:
1012
- opacity 150ms ease-out,
1013
- transform 150ms ease-out;
1014
- }
1015
-
1016
- .agent-composer-missing-key-trigger:hover .agent-composer-missing-key-cta {
1017
- opacity: 0.9;
1018
- }
1019
-
1020
- .agent-composer-missing-key-trigger:active .agent-composer-missing-key-cta {
1021
- transform: scale(0.98);
1022
- }
1023
-
1024
- .agent-composer-root--hero .agent-composer-missing-key-trigger {
1025
- min-height: 7.5rem;
1026
- justify-content: center;
1027
- padding: 1.25rem;
1028
- text-align: center;
1029
- }
1030
-
1031
- .agent-composer-root--hero .agent-composer-missing-key-title {
1032
- font-size: 0.9375rem;
1033
- line-height: 1.375rem;
1034
- }
1035
-
1036
- .agent-composer-root--hero .agent-composer-missing-key-content {
1037
- align-items: center;
1038
- }
1039
-
1040
1020
  .agent-composer-stack {
1041
1021
  position: relative;
1042
1022
  flex-shrink: 0;
@@ -28,6 +28,11 @@ export const CLI_REGISTRY = {
28
28
  installPackage: "opencode-ai",
29
29
  stripEnv: [],
30
30
  },
31
+ pi: {
32
+ label: "Pi",
33
+ installPackage: "",
34
+ stripEnv: [],
35
+ },
31
36
  };
32
37
  /** Check if a command name is in the CLI_REGISTRY allowlist */
33
38
  export function isAllowedCommand(cmd) {
@@ -1,4 +1,5 @@
1
1
  import { getRequestContext } from "../server/request-context.js";
2
+ import { ANALYTICS_CLIENT_PLATFORM_PROPERTY } from "../shared/analytics-platform.js";
2
3
  const REGISTRY_KEY = Symbol.for("@agent-native/core/tracking.registry");
3
4
  function getRegistry() {
4
5
  const g = globalThis;
@@ -44,9 +45,16 @@ function resolveTrackingSource(source) {
44
45
  }
45
46
  export function track(name, properties, source) {
46
47
  const { userId, anonymousId, sessionId } = resolveTrackingSource(source);
48
+ const clientPlatform = getRequestContext()?.clientPlatform;
49
+ const trackedProperties = clientPlatform
50
+ ? {
51
+ ...(properties ?? {}),
52
+ [ANALYTICS_CLIENT_PLATFORM_PROPERTY]: clientPlatform,
53
+ }
54
+ : properties;
47
55
  const event = {
48
56
  name,
49
- properties,
57
+ properties: trackedProperties,
50
58
  timestamp: new Date().toISOString(),
51
59
  userId,
52
60
  anonymousId,
@@ -18,6 +18,9 @@ export interface AutomationActionItem {
18
18
  nextRun: string | null;
19
19
  createdBy: string | null;
20
20
  model: string | null;
21
+ executionHostId: string | null;
22
+ executionEngine: string | null;
23
+ executionCwd: string | null;
21
24
  mcpTools: string[];
22
25
  originScopeId: string | null;
23
26
  deliveryPlatform: string | null;
@@ -58,6 +58,9 @@ export default defineAction({
58
58
  nextRun: nextRun(meta),
59
59
  createdBy: meta.createdBy ?? null,
60
60
  model: meta.model ?? null,
61
+ executionHostId: meta.executionHostId ?? null,
62
+ executionEngine: meta.executionEngine ?? null,
63
+ executionCwd: meta.executionCwd ?? null,
61
64
  mcpTools: meta.mcpTools ?? [],
62
65
  originScopeId: meta.originScopeId ?? null,
63
66
  deliveryPlatform: meta.deliveryPlatform ?? null,
@@ -5,12 +5,18 @@ declare const _default: import("../../action.js").ActionDefinition<{
5
5
  enabled?: boolean;
6
6
  schedule?: string;
7
7
  timezone?: string;
8
+ executionHostId?: string;
9
+ executionEngine?: string;
10
+ executionCwd?: string;
8
11
  }, {
9
12
  deleted: boolean;
10
13
  name: string;
11
14
  enabled?: undefined;
12
15
  schedule?: undefined;
13
16
  timezone?: undefined;
17
+ executionHostId?: undefined;
18
+ executionEngine?: undefined;
19
+ executionCwd?: undefined;
14
20
  nextRun?: undefined;
15
21
  } | {
16
22
  deleted?: undefined;
@@ -18,6 +24,9 @@ declare const _default: import("../../action.js").ActionDefinition<{
18
24
  enabled: boolean;
19
25
  schedule: string;
20
26
  timezone: string;
27
+ executionHostId: string;
28
+ executionEngine: string;
29
+ executionCwd: string;
21
30
  nextRun: string;
22
31
  }>;
23
32
  export default _default;
@@ -12,8 +12,11 @@ export default defineAction({
12
12
  enabled: z.boolean().optional(),
13
13
  schedule: z.string().min(1).optional(),
14
14
  timezone: z.string().min(1).optional(),
15
+ executionHostId: z.string().min(1).nullable().optional(),
16
+ executionEngine: z.string().min(1).nullable().optional(),
17
+ executionCwd: z.string().min(1).nullable().optional(),
15
18
  }),
16
- run: async ({ operation, name, scope, enabled, schedule, timezone }, ctx) => {
19
+ run: async ({ operation, name, scope, enabled, schedule, timezone, executionHostId, executionEngine, executionCwd, }, ctx) => {
17
20
  const userEmail = ctx?.userEmail;
18
21
  if (!userEmail)
19
22
  throw new Error("Not authenticated.");
@@ -29,7 +32,10 @@ export default defineAction({
29
32
  }
30
33
  if (enabled === undefined &&
31
34
  schedule === undefined &&
32
- timezone === undefined) {
35
+ timezone === undefined &&
36
+ executionHostId === undefined &&
37
+ executionEngine === undefined &&
38
+ executionCwd === undefined) {
33
39
  throw Object.assign(new Error("enabled, schedule, or timezone is required for update."), { statusCode: 400 });
34
40
  }
35
41
  const definition = await updateAutomation(actor, {
@@ -38,6 +44,9 @@ export default defineAction({
38
44
  ...(enabled === undefined ? {} : { enabled }),
39
45
  ...(schedule === undefined ? {} : { schedule }),
40
46
  ...(timezone === undefined ? {} : { timezone }),
47
+ ...(executionHostId === undefined ? {} : { executionHostId }),
48
+ ...(executionEngine === undefined ? {} : { executionEngine }),
49
+ ...(executionCwd === undefined ? {} : { executionCwd }),
41
50
  });
42
51
  await refreshEventSubscriptions();
43
52
  return {
@@ -45,6 +54,9 @@ export default defineAction({
45
54
  enabled: definition.meta.enabled,
46
55
  schedule: definition.meta.schedule || null,
47
56
  timezone: definition.meta.timezone ?? null,
57
+ executionHostId: definition.meta.executionHostId ?? null,
58
+ executionEngine: definition.meta.executionEngine ?? null,
59
+ executionCwd: definition.meta.executionCwd ?? null,
48
60
  nextRun: definition.meta.nextRun ?? null,
49
61
  };
50
62
  },