@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.
- package/corpus/README.md +1 -1
- package/corpus/templates/analytics/actions/purge-first-party-analytics-postgres.ts +26 -8
- package/corpus/templates/analytics/scripts/first-party-analytics-postgres-retention-dry-run.sql +261 -0
- package/corpus/templates/analytics/server/lib/first-party-analytics-backend.ts +3 -1
- package/corpus/templates/analytics/server/lib/first-party-analytics-purge.ts +75 -31
- package/corpus/templates/analytics/server/lib/workspace-feature-flags.ts +4 -1
- package/corpus/templates/analytics/server/plugins/db.ts +139 -0
- package/corpus/templates/slides/AGENTS.md +14 -10
- package/corpus/templates/slides/actions/export-pptx.ts +1311 -121
- package/corpus/templates/slides/actions/import-file.ts +28 -1
- package/corpus/templates/slides/actions/import-pptx.ts +69 -42
- package/corpus/templates/slides/app/components/deck/SlideRenderer.tsx +222 -29
- package/corpus/templates/slides/app/components/editor/ExportMenu.tsx +71 -0
- package/corpus/templates/slides/app/global.css +19 -1
- package/corpus/templates/slides/app/lib/export-google-slides-client.ts +44 -5
- package/corpus/templates/slides/app/lib/export-pdf-client.ts +13 -6
- package/corpus/templates/slides/app/lib/export-pptx-client.ts +601 -30
- package/corpus/templates/slides/app/pages/DeckEditor.tsx +18 -1
- package/corpus/templates/slides/server/handlers/import/html-converter.ts +1240 -22
- package/corpus/templates/slides/server/handlers/import/pdf-fidelity-parser.ts +329 -64
- package/corpus/templates/slides/server/handlers/import/pptx-assets.ts +24 -0
- package/corpus/templates/slides/server/lib/source-import.ts +10 -1
- package/corpus/templates/slides/shared/aspect-ratios.ts +13 -1
- package/dist/agent/harness/migrations.d.ts +4 -0
- package/dist/agent/harness/migrations.js +60 -0
- package/dist/agent/production-agent.d.ts +2 -0
- package/dist/agent/production-agent.js +15 -0
- package/dist/agent/run-loop-with-resume.d.ts +1 -0
- package/dist/agent/run-loop-with-resume.js +44 -12
- package/dist/agent/run-migrations.d.ts +8 -0
- package/dist/agent/run-migrations.js +61 -0
- package/dist/automations/service.d.ts +6 -0
- package/dist/automations/service.js +35 -0
- package/dist/chat-threads/migrations.d.ts +1 -0
- package/dist/chat-threads/migrations.js +1 -0
- package/dist/chat-threads/schema-migrations.d.ts +8 -0
- package/dist/chat-threads/schema-migrations.js +60 -0
- package/dist/cli/code-agent-connector.d.ts +4 -1
- package/dist/cli/code-agent-connector.js +154 -23
- package/dist/cli/code-agent-executor.js +255 -13
- package/dist/cli/code-agent-runs.d.ts +1 -0
- package/dist/cli/code-agent-runs.js +2 -1
- package/dist/cli/portal-workspace.d.ts +49 -0
- package/dist/cli/portal-workspace.js +320 -0
- package/dist/client/AssistantChat.d.ts +1 -1
- package/dist/client/AssistantChat.js +43 -61
- package/dist/client/ConnectBuilderCard.js +33 -5
- package/dist/client/agent-chat-adapter.js +4 -0
- package/dist/client/analytics-platform.d.ts +2 -0
- package/dist/client/analytics-platform.js +12 -0
- package/dist/client/analytics.d.ts +3 -0
- package/dist/client/analytics.js +10 -1
- package/dist/client/chat/index.d.ts +1 -0
- package/dist/client/chat/index.js +1 -0
- package/dist/client/chat/message-components.d.ts +2 -0
- package/dist/client/chat/message-components.js +11 -1
- package/dist/client/chat/run-recovery.d.ts +2 -1
- package/dist/client/chat/run-recovery.js +2 -2
- package/dist/client/chat-first/apps-rail.d.ts +1 -1
- package/dist/client/chat-first/apps-rail.js +11 -11
- package/dist/client/chat-first/surface-tabs.d.ts +1 -1
- package/dist/client/chat-first/surface-tabs.js +38 -36
- package/dist/client/chat-first/types.d.ts +5 -0
- package/dist/client/chat-first.d.ts +1 -1
- package/dist/client/chat-first.js +4 -4
- package/dist/client/desktop-local-code-change.d.ts +10 -0
- package/dist/client/desktop-local-code-change.js +16 -0
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.js +1 -0
- package/dist/client/observability/ThumbsFeedback.js +53 -26
- package/dist/client/observability/useObservability.d.ts +1 -1
- package/dist/client/observability/useObservability.js +6 -3
- package/dist/client/terminal/AgentTerminal.d.ts +9 -1
- package/dist/client/terminal/AgentTerminal.js +38 -3
- package/dist/client/terminal/index.d.ts +1 -1
- package/dist/client/terminal/index.js +1 -1
- package/dist/client/track.js +9 -1
- package/dist/client/use-action.js +3 -0
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/deploy/build.js +1 -1
- package/dist/feature-flags/a2a-action-route.js +4 -2
- package/dist/feature-flags/permissions.d.ts +2 -0
- package/dist/feature-flags/permissions.js +6 -1
- package/dist/ingestion/pptx.d.ts +92 -1
- package/dist/ingestion/pptx.js +1180 -115
- package/dist/integrations/index.d.ts +3 -3
- package/dist/integrations/index.js +2 -2
- package/dist/integrations/plugin.js +95 -6
- package/dist/integrations/remote-commands-store.d.ts +5 -0
- package/dist/integrations/remote-commands-store.js +63 -22
- package/dist/integrations/remote-devices-store.d.ts +2 -1
- package/dist/integrations/remote-devices-store.js +46 -0
- package/dist/integrations/remote-types.d.ts +20 -0
- package/dist/jobs/actions/list-recurring-jobs.d.ts +3 -0
- package/dist/jobs/actions/list-recurring-jobs.js +5 -1
- package/dist/jobs/frontmatter.d.ts +16 -0
- package/dist/jobs/frontmatter.js +53 -0
- package/dist/jobs/remote-execution.d.ts +42 -0
- package/dist/jobs/remote-execution.js +287 -0
- package/dist/jobs/scheduler.js +102 -3
- package/dist/jobs/tools.js +50 -3
- package/dist/localization/core-messages/ar-SA.js +4 -0
- package/dist/localization/core-messages/de-DE.js +4 -0
- package/dist/localization/core-messages/en-US.d.ts +4 -0
- package/dist/localization/core-messages/en-US.js +4 -0
- package/dist/localization/core-messages/es-ES.js +4 -0
- package/dist/localization/core-messages/fr-FR.js +4 -0
- package/dist/localization/core-messages/hi-IN.js +4 -0
- package/dist/localization/core-messages/ja-JP.js +4 -0
- package/dist/localization/core-messages/ko-KR.js +4 -0
- package/dist/localization/core-messages/pt-BR.js +4 -0
- package/dist/localization/core-messages/zh-CN.js +4 -0
- package/dist/localization/core-messages/zh-TW.js +4 -0
- package/dist/localization/core-messages.d.ts +4 -0
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/observability/feedback.js +40 -16
- package/dist/observability/routes.d.ts +6 -6
- package/dist/observability/routes.js +15 -3
- package/dist/observability/store.js +2 -0
- package/dist/observability/traces.js +5 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +16 -16
- package/dist/provider-api/actions/provider-api.d.ts +13 -13
- package/dist/provider-api/corpus-jobs.d.ts +2 -2
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/server/action-routes.d.ts +7 -5
- package/dist/server/action-routes.js +13 -6
- package/dist/server/agent-chat-plugin.js +6 -0
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/agent-run-context.d.ts +1 -0
- package/dist/server/agent-run-context.js +9 -0
- package/dist/server/better-auth-instance.js +4 -0
- package/dist/server/core-routes-plugin.js +8 -1
- package/dist/server/realtime-voice.js +2 -1
- package/dist/server/release-migrations.js +16 -0
- package/dist/server/request-context.d.ts +2 -0
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/shared/analytics-platform.d.ts +6 -0
- package/dist/shared/analytics-platform.js +14 -0
- package/dist/shared/mcp-embed-headers.d.ts +1 -1
- package/dist/shared/mcp-embed-headers.js +1 -1
- package/dist/styles/agent-native.css +83 -103
- package/dist/terminal/cli-registry.js +5 -0
- package/dist/tracking/registry.js +9 -1
- package/dist/triggers/actions/list-automations.d.ts +3 -0
- package/dist/triggers/actions/list-automations.js +3 -0
- package/dist/triggers/actions/manage-automation.d.ts +9 -0
- package/dist/triggers/actions/manage-automation.js +14 -2
- package/dist/triggers/actions.js +82 -7
- package/dist/usage/migrations.d.ts +4 -0
- package/dist/usage/migrations.js +45 -0
- package/docs/content/template-content-developers.mdx +48 -0
- package/docs/content/toolkit-ui.mdx +57 -0
- 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
|
|
@@ -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.
|
|
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(-
|
|
521
|
+
transform: translateY(-5px);
|
|
522
522
|
}
|
|
523
523
|
65% {
|
|
524
|
-
transform: translateY(-
|
|
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
|
},
|