@agent-native/core 0.232.0 → 0.233.0-nightly-20261124004026
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/dist/a2a/handlers.js +60 -1
- package/dist/a2a/server.js +9 -0
- package/dist/action-call-classification.d.ts +9 -0
- package/dist/action-call-classification.js +18 -0
- package/dist/action-conformance.d.ts +81 -0
- package/dist/action-conformance.js +392 -0
- package/dist/action.d.ts +18 -0
- package/dist/action.js +68 -5
- package/dist/agent/execution-fence.d.ts +3 -1
- package/dist/agent/execution-fence.js +13 -2
- package/dist/agent/production-agent.d.ts +3 -0
- package/dist/agent/production-agent.js +301 -145
- package/dist/agent/run-store.js +11 -0
- package/dist/agent/thread-data-builder.d.ts +2 -0
- package/dist/agent/thread-data-builder.js +5 -1
- package/dist/app-config/schema.d.ts +24 -1
- package/dist/application-state/handlers.d.ts +1 -1
- package/dist/application-state/navigate-write-guard.d.ts +4 -1
- package/dist/application-state/navigate-write-guard.js +15 -1
- package/dist/cli/design-connect.js +5 -1
- package/dist/cli/matched-check.d.ts +1 -0
- package/dist/cli/matched-check.js +76 -0
- package/dist/client/agent-chat/index.d.ts +1 -1
- package/dist/client/agent-chat/index.js +1 -1
- package/dist/client/analytics/index.d.ts +1 -1
- package/dist/client/analytics.d.ts +13 -1
- package/dist/client/analytics.js +5 -2
- package/dist/client/application-state.d.ts +11 -0
- package/dist/client/application-state.js +219 -23
- package/dist/client/chat/agentkit-agent-native.js +52 -11
- package/dist/client/chat/agentkit-protocol.js +23 -2
- package/dist/client/chat-first-state.d.ts +6 -0
- package/dist/client/chat-first-state.js +36 -1
- package/dist/client/feature-flags/use-feature-flag.js +14 -6
- package/dist/client/navigation/index.d.ts +2 -0
- package/dist/client/navigation/index.js +2 -0
- package/dist/client/route-state.js +60 -18
- package/dist/client/screen-settled.d.ts +71 -1
- package/dist/client/screen-settled.js +221 -3
- package/dist/client/sse-event-processor.d.ts +1 -0
- package/dist/client/sse-event-processor.js +89 -10
- package/dist/client/theme.d.ts +6 -0
- package/dist/client/theme.js +7 -1
- package/dist/client/use-action.js +32 -10
- package/dist/client/use-session.js +36 -18
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/db/client.js +2 -2
- package/dist/db/errors.d.ts +2 -0
- package/dist/db/errors.js +38 -6
- package/dist/feature-flags/actions/get-feature-flags.js +9 -2
- package/dist/file-upload/actions/upload-image.d.ts +2 -2
- package/dist/framework-package-versions.json +8 -8
- package/dist/ingestion/index.d.ts +1 -0
- package/dist/ingestion/index.js +1 -0
- package/dist/ingestion/matched-capture.d.ts +173 -0
- package/dist/ingestion/matched-capture.js +574 -0
- package/dist/ingestion/pptx.d.ts +1 -0
- package/dist/ingestion/pptx.js +4 -2
- package/dist/labs/store.d.ts +3 -1
- package/dist/labs/store.js +8 -4
- package/dist/manifest/index.d.ts +142 -3
- package/dist/manifest/index.js +249 -19
- package/dist/mcp/build-server.d.ts +2 -0
- package/dist/mcp/build-server.js +8 -1
- package/dist/mcp/server.js +3 -1
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/observability/metrics.d.ts +2 -0
- package/dist/observability/metrics.js +7 -0
- package/dist/org/index.d.ts +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +10 -10
- package/dist/provider-api/actions/provider-api.d.ts +14 -14
- package/dist/server/action-routes.js +9 -0
- package/dist/server/agent-chat/prompt-resources.js +107 -83
- package/dist/server/agent-run-context.d.ts +3 -0
- package/dist/server/agent-run-context.js +7 -0
- package/dist/server/builder-oauth.d.ts +1 -0
- package/dist/server/builder-oauth.js +40 -2
- package/dist/server/filesystem-action-entry.js +5 -0
- package/dist/server/first-touch-route.d.ts +2 -2
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +2 -2
- package/dist/server/open-route.js +10 -4
- package/dist/server/poll.d.ts +3 -0
- package/dist/server/poll.js +74 -14
- package/dist/server/request-context.d.ts +16 -6
- package/dist/server/request-context.js +4 -0
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/shared/analytics-events.d.ts +7 -0
- package/dist/shared/viewport-mode.d.ts +2 -0
- package/dist/shared/viewport-mode.js +9 -0
- package/dist/templates/chat/.agents/skills/actions/SKILL.md +1 -0
- package/dist/templates/chat/.agents/skills/build-an-app/SKILL.md +38 -17
- package/dist/templates/chat/.agents/skills/shadcn-ui/SKILL.md +3 -2
- package/dist/templates/default/.agents/skills/actions/SKILL.md +1 -0
- package/dist/templates/default/.agents/skills/build-an-app/SKILL.md +38 -17
- package/dist/templates/default/.agents/skills/shadcn-ui/SKILL.md +3 -2
- package/dist/templates/factory/.agents/skills/review-latest-feedback/SKILL.md +3 -2
- package/dist/templates/headless/.agents/skills/actions/SKILL.md +1 -0
- package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +1 -0
- package/dist/templates/workspace-core/.agents/skills/build-an-app/SKILL.md +38 -17
- package/dist/templates/workspace-core/.agents/skills/shadcn-ui/SKILL.md +3 -2
- package/dist/testing.d.ts +1 -0
- package/dist/testing.js +1 -0
- package/dist/tracking/action-lifecycle.d.ts +2 -0
- package/dist/tracking/action-lifecycle.js +16 -5
- package/docs/content/actions-defining.mdx +7 -0
- package/docs/content/custom-design-system.mdx +4 -2
- package/package.json +3 -3
- package/src/templates/chat/.agents/skills/actions/SKILL.md +1 -0
- package/src/templates/chat/.agents/skills/build-an-app/SKILL.md +38 -17
- package/src/templates/chat/.agents/skills/shadcn-ui/SKILL.md +3 -2
- package/src/templates/default/.agents/skills/actions/SKILL.md +1 -0
- package/src/templates/default/.agents/skills/build-an-app/SKILL.md +38 -17
- package/src/templates/default/.agents/skills/shadcn-ui/SKILL.md +3 -2
- package/src/templates/factory/.agents/skills/review-latest-feedback/SKILL.md +3 -2
- package/src/templates/headless/.agents/skills/actions/SKILL.md +1 -0
- package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +1 -0
- package/src/templates/workspace-core/.agents/skills/build-an-app/SKILL.md +38 -17
- package/src/templates/workspace-core/.agents/skills/shadcn-ui/SKILL.md +3 -2
|
@@ -75,9 +75,10 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
|
|
|
75
75
|
user: "user";
|
|
76
76
|
}>>;
|
|
77
77
|
}, z.core.$strip>>, {
|
|
78
|
-
message?: undefined;
|
|
79
|
-
id?: undefined;
|
|
80
78
|
deleted?: undefined;
|
|
79
|
+
id?: undefined;
|
|
80
|
+
provider?: undefined;
|
|
81
|
+
message?: undefined;
|
|
81
82
|
providers: {
|
|
82
83
|
id: string;
|
|
83
84
|
label: string;
|
|
@@ -88,45 +89,44 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
|
|
|
88
89
|
updatedAt: number;
|
|
89
90
|
}[];
|
|
90
91
|
count: number;
|
|
91
|
-
provider?: undefined;
|
|
92
92
|
found?: undefined;
|
|
93
93
|
registered?: undefined;
|
|
94
94
|
label?: undefined;
|
|
95
95
|
} | {
|
|
96
|
-
|
|
96
|
+
deleted?: undefined;
|
|
97
97
|
id?: undefined;
|
|
98
|
+
message?: undefined;
|
|
98
99
|
count?: undefined;
|
|
99
|
-
deleted?: undefined;
|
|
100
100
|
providers?: undefined;
|
|
101
101
|
found: boolean;
|
|
102
102
|
provider: import("../custom-registry.js").CustomProviderConfig;
|
|
103
103
|
registered?: undefined;
|
|
104
104
|
label?: undefined;
|
|
105
105
|
} | {
|
|
106
|
+
deleted?: undefined;
|
|
107
|
+
provider?: undefined;
|
|
106
108
|
message?: undefined;
|
|
107
109
|
count?: undefined;
|
|
108
|
-
deleted?: undefined;
|
|
109
110
|
providers?: undefined;
|
|
110
|
-
provider?: undefined;
|
|
111
111
|
found: boolean;
|
|
112
112
|
id: string;
|
|
113
113
|
registered?: undefined;
|
|
114
114
|
label?: undefined;
|
|
115
115
|
} | {
|
|
116
|
+
provider?: undefined;
|
|
116
117
|
message?: undefined;
|
|
117
118
|
count?: undefined;
|
|
118
119
|
providers?: undefined;
|
|
119
|
-
provider?: undefined;
|
|
120
120
|
found?: undefined;
|
|
121
121
|
deleted: boolean;
|
|
122
122
|
id: string;
|
|
123
123
|
registered?: undefined;
|
|
124
124
|
label?: undefined;
|
|
125
125
|
} | {
|
|
126
|
-
count?: undefined;
|
|
127
126
|
deleted?: undefined;
|
|
128
|
-
providers?: undefined;
|
|
129
127
|
provider?: undefined;
|
|
128
|
+
count?: undefined;
|
|
129
|
+
providers?: undefined;
|
|
130
130
|
found?: undefined;
|
|
131
131
|
registered: boolean;
|
|
132
132
|
id: string;
|
|
@@ -320,10 +320,8 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
|
|
|
320
320
|
notes?: string | undefined;
|
|
321
321
|
scope?: "org" | "user" | undefined;
|
|
322
322
|
}, {
|
|
323
|
-
deleted?: undefined;
|
|
324
|
-
id?: undefined;
|
|
325
|
-
provider?: undefined;
|
|
326
323
|
message?: undefined;
|
|
324
|
+
id?: undefined;
|
|
327
325
|
providers: {
|
|
328
326
|
id: string;
|
|
329
327
|
label: string;
|
|
@@ -334,45 +332,47 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
|
|
|
334
332
|
updatedAt: number;
|
|
335
333
|
}[];
|
|
336
334
|
count: number;
|
|
335
|
+
provider?: undefined;
|
|
337
336
|
found?: undefined;
|
|
337
|
+
deleted?: undefined;
|
|
338
338
|
registered?: undefined;
|
|
339
339
|
label?: undefined;
|
|
340
340
|
} | {
|
|
341
|
-
deleted?: undefined;
|
|
342
|
-
id?: undefined;
|
|
343
341
|
message?: undefined;
|
|
344
|
-
|
|
342
|
+
id?: undefined;
|
|
345
343
|
count?: undefined;
|
|
344
|
+
providers?: undefined;
|
|
346
345
|
found: boolean;
|
|
347
346
|
provider: import("../custom-registry.js").CustomProviderConfig;
|
|
347
|
+
deleted?: undefined;
|
|
348
348
|
registered?: undefined;
|
|
349
349
|
label?: undefined;
|
|
350
350
|
} | {
|
|
351
|
-
deleted?: undefined;
|
|
352
|
-
provider?: undefined;
|
|
353
351
|
message?: undefined;
|
|
354
|
-
providers?: undefined;
|
|
355
352
|
count?: undefined;
|
|
353
|
+
providers?: undefined;
|
|
354
|
+
provider?: undefined;
|
|
356
355
|
found: boolean;
|
|
357
356
|
id: string;
|
|
357
|
+
deleted?: undefined;
|
|
358
358
|
registered?: undefined;
|
|
359
359
|
label?: undefined;
|
|
360
360
|
} | {
|
|
361
|
-
provider?: undefined;
|
|
362
361
|
message?: undefined;
|
|
363
|
-
providers?: undefined;
|
|
364
362
|
count?: undefined;
|
|
363
|
+
providers?: undefined;
|
|
364
|
+
provider?: undefined;
|
|
365
365
|
found?: undefined;
|
|
366
366
|
deleted: boolean;
|
|
367
367
|
id: string;
|
|
368
368
|
registered?: undefined;
|
|
369
369
|
label?: undefined;
|
|
370
370
|
} | {
|
|
371
|
-
deleted?: undefined;
|
|
372
|
-
provider?: undefined;
|
|
373
|
-
providers?: undefined;
|
|
374
371
|
count?: undefined;
|
|
372
|
+
providers?: undefined;
|
|
373
|
+
provider?: undefined;
|
|
375
374
|
found?: undefined;
|
|
375
|
+
deleted?: undefined;
|
|
376
376
|
registered: boolean;
|
|
377
377
|
id: string;
|
|
378
378
|
label: string;
|
|
@@ -157,6 +157,13 @@ function isFrontendActionRequest(event) {
|
|
|
157
157
|
return false;
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
+
function isAppPageRequest(event, caller, userEmail, embedded) {
|
|
161
|
+
return (caller === "frontend" &&
|
|
162
|
+
!!userEmail &&
|
|
163
|
+
!embedded &&
|
|
164
|
+
!getHeader(event, "authorization") &&
|
|
165
|
+
hasSameOriginBrowserEvidence(event));
|
|
166
|
+
}
|
|
160
167
|
/**
|
|
161
168
|
* The frontend header is only the client's claim. A request proves it came
|
|
162
169
|
* from this app's signed-in UI with a browser-cookie identity, a same-origin
|
|
@@ -973,6 +980,8 @@ function mountActionRoutesInternal(nitroApp, actions, options) {
|
|
|
973
980
|
...(requestId ? { requestId } : {}),
|
|
974
981
|
userEmail,
|
|
975
982
|
provenUiRequest,
|
|
983
|
+
appPageRequest: provenUiRequest ||
|
|
984
|
+
isAppPageRequest(event, requestCaller, userEmail, embedded),
|
|
976
985
|
...(verifiedServiceIdentity &&
|
|
977
986
|
verifiedServiceIdentity.userEmail.trim().toLowerCase() ===
|
|
978
987
|
userEmail?.trim().toLowerCase() &&
|
|
@@ -1489,44 +1489,10 @@ export async function loadResourcesForPrompt(owner, compact = false, selfAppId,
|
|
|
1489
1489
|
}
|
|
1490
1490
|
}
|
|
1491
1491
|
const workspaceOwner = workspaceResourceOwner(orgId);
|
|
1492
|
-
const workspaceAgents = await loadAgentsResourceForPrompt(workspaceOwner, "workspace", promptResourceMaxChars, orgId, resourceReadHint);
|
|
1493
|
-
addSection(workspaceAgents, "required");
|
|
1494
|
-
addSections(await loadInstructionResourcesForPrompt(workspaceOwner, "workspace-instruction", promptResourceMaxChars, compact && runtimeToolHints, orgId, resourceReadHint));
|
|
1495
1492
|
const organizationOwner = sharedResourceOwner(orgId);
|
|
1496
|
-
const
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
? "shared-instruction"
|
|
1500
|
-
: "app-default-instruction", promptResourceMaxChars, compact && runtimeToolHints, orgId, resourceReadHint));
|
|
1501
|
-
if (organizationOwner !== SHARED_OWNER) {
|
|
1502
|
-
const organizationAgents = await loadAgentsResourceForPrompt(organizationOwner, "organization", promptResourceMaxChars, orgId, resourceReadHint);
|
|
1503
|
-
addSection(organizationAgents, "required");
|
|
1504
|
-
addSections(await loadInstructionResourcesForPrompt(organizationOwner, "organization-instruction", promptResourceMaxChars, compact && runtimeToolHints, orgId, resourceReadHint));
|
|
1505
|
-
}
|
|
1506
|
-
if (owner !== SHARED_OWNER && !isWorkspaceResourceOwner(owner)) {
|
|
1507
|
-
const personalAgents = await loadAgentsResourceForPrompt(owner, "personal", promptResourceMaxChars, orgId, resourceReadHint);
|
|
1508
|
-
addSection(personalAgents, "required");
|
|
1509
|
-
addSections(await loadInstructionResourcesForPrompt(owner, "personal-instruction", promptResourceMaxChars, compact && runtimeToolHints, orgId, resourceReadHint), "user");
|
|
1510
|
-
let memoryInstructions;
|
|
1511
|
-
try {
|
|
1512
|
-
memoryInstructions = await resourceGetByPath(owner, "memory/INSTRUCTIONS.md", { orgId });
|
|
1513
|
-
}
|
|
1514
|
-
catch (error) {
|
|
1515
|
-
throw new Error(`Unable to read personal memory instructions for ${owner}. The run cannot safely continue without them.`, { cause: error });
|
|
1516
|
-
}
|
|
1517
|
-
if (memoryInstructions?.content.trim()) {
|
|
1518
|
-
addSection(promptResourceBlock({
|
|
1519
|
-
name: "memory/INSTRUCTIONS.md",
|
|
1520
|
-
scope: "personal",
|
|
1521
|
-
path: "memory/INSTRUCTIONS.md",
|
|
1522
|
-
content: memoryInstructions.content,
|
|
1523
|
-
maxChars: promptResourceMaxChars,
|
|
1524
|
-
readHint: runtimeToolHints
|
|
1525
|
-
? 'Use the `resources` tool with `action: "read"` and `path: "memory/INSTRUCTIONS.md"` to read the full instructions.'
|
|
1526
|
-
: null,
|
|
1527
|
-
}), "required");
|
|
1528
|
-
}
|
|
1529
|
-
}
|
|
1493
|
+
const includePersonalResources = owner !== SHARED_OWNER && !isWorkspaceResourceOwner(owner);
|
|
1494
|
+
const includeOrganizationResources = organizationOwner !== SHARED_OWNER;
|
|
1495
|
+
const includePersonalMemoryIndex = owner !== SHARED_OWNER;
|
|
1530
1496
|
const appDiscoveryPromise = frameworkGroupEnabled(opts?.disabledFrameworkGroups, "workspaceApps")
|
|
1531
1497
|
? (async () => {
|
|
1532
1498
|
try {
|
|
@@ -1549,19 +1515,93 @@ export async function loadResourcesForPrompt(owner, compact = false, selfAppId,
|
|
|
1549
1515
|
}
|
|
1550
1516
|
})()
|
|
1551
1517
|
: undefined;
|
|
1552
|
-
const resourceSkillsBlock
|
|
1518
|
+
const [workspaceAgents, workspaceInstructions, appDefaultAgents, appDefaultInstructions, organizationAgents, organizationInstructions, personalAgents, personalInstructions, memoryInstructionsResult, resourceSkillsBlock, organizationLearningsResult, appDefaultLearnings, memoryIndex, workspaceResourceIndex, appDefaultResourceIndex, organizationResourceIndex, promptContextProviderBlocks,] = await Promise.all([
|
|
1519
|
+
loadAgentsResourceForPrompt(workspaceOwner, "workspace", promptResourceMaxChars, orgId, resourceReadHint),
|
|
1520
|
+
loadInstructionResourcesForPrompt(workspaceOwner, "workspace-instruction", promptResourceMaxChars, compact && runtimeToolHints, orgId, resourceReadHint),
|
|
1521
|
+
loadAgentsResourceForPrompt(SHARED_OWNER, includeOrganizationResources ? "app-default" : "shared", promptResourceMaxChars, orgId, resourceReadHint),
|
|
1522
|
+
loadInstructionResourcesForPrompt(SHARED_OWNER, includeOrganizationResources
|
|
1523
|
+
? "app-default-instruction"
|
|
1524
|
+
: "shared-instruction", promptResourceMaxChars, compact && runtimeToolHints, orgId, resourceReadHint),
|
|
1525
|
+
includeOrganizationResources
|
|
1526
|
+
? loadAgentsResourceForPrompt(organizationOwner, "organization", promptResourceMaxChars, orgId, resourceReadHint)
|
|
1527
|
+
: Promise.resolve(null),
|
|
1528
|
+
includeOrganizationResources
|
|
1529
|
+
? loadInstructionResourcesForPrompt(organizationOwner, "organization-instruction", promptResourceMaxChars, compact && runtimeToolHints, orgId, resourceReadHint)
|
|
1530
|
+
: Promise.resolve([]),
|
|
1531
|
+
includePersonalResources
|
|
1532
|
+
? loadAgentsResourceForPrompt(owner, "personal", promptResourceMaxChars, orgId, resourceReadHint)
|
|
1533
|
+
: Promise.resolve(null),
|
|
1534
|
+
includePersonalResources
|
|
1535
|
+
? loadInstructionResourcesForPrompt(owner, "personal-instruction", promptResourceMaxChars, compact && runtimeToolHints, orgId, resourceReadHint)
|
|
1536
|
+
: Promise.resolve([]),
|
|
1537
|
+
includePersonalResources
|
|
1538
|
+
? resourceGetByPath(owner, "memory/INSTRUCTIONS.md", { orgId }).then((value) => ({ ok: true, value }), (error) => ({ ok: false, error }))
|
|
1539
|
+
: Promise.resolve({
|
|
1540
|
+
ok: true,
|
|
1541
|
+
value: null,
|
|
1542
|
+
}),
|
|
1543
|
+
loadResourceSkillsPromptBlock(owner, orgId, runtimeToolHints, includeSupportingFiles),
|
|
1544
|
+
includeOrganizationResources
|
|
1545
|
+
? resourceGetByPath(organizationOwner, "LEARNINGS.md", { orgId }).then((value) => ({ ok: true, value }), (error) => ({ ok: false, error }))
|
|
1546
|
+
: Promise.resolve({ ok: true, value: null }),
|
|
1547
|
+
resourceGetByPath(SHARED_OWNER, "LEARNINGS.md", { orgId }).catch(() => null),
|
|
1548
|
+
includePersonalMemoryIndex
|
|
1549
|
+
? resourceGetByPath(owner, "memory/MEMORY.md", { orgId }).catch((error) => {
|
|
1550
|
+
console.warn("[agent-chat] Could not load personal memory index:", error);
|
|
1551
|
+
return null;
|
|
1552
|
+
})
|
|
1553
|
+
: Promise.resolve(null),
|
|
1554
|
+
runtimeToolHints
|
|
1555
|
+
? loadResourceIndexForPrompt(workspaceOwner, "workspace", orgId)
|
|
1556
|
+
: Promise.resolve(null),
|
|
1557
|
+
runtimeToolHints
|
|
1558
|
+
? loadResourceIndexForPrompt(SHARED_OWNER, "shared", orgId)
|
|
1559
|
+
: Promise.resolve(null),
|
|
1560
|
+
runtimeToolHints && includeOrganizationResources
|
|
1561
|
+
? loadResourceIndexForPrompt(organizationOwner, "shared", orgId)
|
|
1562
|
+
: Promise.resolve(null),
|
|
1563
|
+
loadPromptContextProviderBlocks({
|
|
1564
|
+
owner,
|
|
1565
|
+
compact,
|
|
1566
|
+
...(selfAppId !== undefined ? { selfAppId } : {}),
|
|
1567
|
+
orgId,
|
|
1568
|
+
}),
|
|
1569
|
+
]);
|
|
1570
|
+
if (!memoryInstructionsResult.ok) {
|
|
1571
|
+
throw new Error(`Unable to read personal memory instructions for ${owner}. The run cannot safely continue without them.`, { cause: memoryInstructionsResult.error });
|
|
1572
|
+
}
|
|
1573
|
+
addSection(workspaceAgents, "required");
|
|
1574
|
+
addSections(workspaceInstructions);
|
|
1575
|
+
addSection(appDefaultAgents, "required");
|
|
1576
|
+
addSections(appDefaultInstructions);
|
|
1577
|
+
if (includeOrganizationResources) {
|
|
1578
|
+
addSection(organizationAgents, "required");
|
|
1579
|
+
addSections(organizationInstructions);
|
|
1580
|
+
}
|
|
1581
|
+
if (includePersonalResources) {
|
|
1582
|
+
addSection(personalAgents, "required");
|
|
1583
|
+
addSections(personalInstructions, "user");
|
|
1584
|
+
const memoryInstructions = memoryInstructionsResult.value;
|
|
1585
|
+
if (memoryInstructions?.content.trim()) {
|
|
1586
|
+
addSection(promptResourceBlock({
|
|
1587
|
+
name: "memory/INSTRUCTIONS.md",
|
|
1588
|
+
scope: "personal",
|
|
1589
|
+
path: "memory/INSTRUCTIONS.md",
|
|
1590
|
+
content: memoryInstructions.content,
|
|
1591
|
+
maxChars: promptResourceMaxChars,
|
|
1592
|
+
readHint: runtimeToolHints
|
|
1593
|
+
? 'Use the `resources` tool with `action: "read"` and `path: "memory/INSTRUCTIONS.md"` to read the full instructions.'
|
|
1594
|
+
: null,
|
|
1595
|
+
}), "required");
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1553
1598
|
addSection(resourceSkillsBlock);
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
? await resourceGetByPath(organizationOwner, "LEARNINGS.md", {
|
|
1559
|
-
orgId,
|
|
1560
|
-
})
|
|
1561
|
-
: null) ??
|
|
1562
|
-
(await resourceGetByPath(SHARED_OWNER, "LEARNINGS.md", { orgId }));
|
|
1599
|
+
if (!organizationLearningsResult.ok) {
|
|
1600
|
+
throw new Error("Unable to read organization learnings.", {
|
|
1601
|
+
cause: organizationLearningsResult.error,
|
|
1602
|
+
});
|
|
1563
1603
|
}
|
|
1564
|
-
|
|
1604
|
+
const sharedLearnings = organizationLearningsResult.value ?? appDefaultLearnings;
|
|
1565
1605
|
if (compact) {
|
|
1566
1606
|
if (sharedLearnings?.content?.trim()) {
|
|
1567
1607
|
const block = promptResourceBlock({
|
|
@@ -1590,50 +1630,34 @@ export async function loadResourcesForPrompt(owner, compact = false, selfAppId,
|
|
|
1590
1630
|
addSection(block);
|
|
1591
1631
|
}
|
|
1592
1632
|
}
|
|
1593
|
-
if (
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1633
|
+
if (includePersonalMemoryIndex && memoryIndex) {
|
|
1634
|
+
const trimmedMemoryIndex = memoryIndex.content.trim();
|
|
1635
|
+
const hasMemoryContent = trimmedMemoryIndex.length > 0 &&
|
|
1636
|
+
(!compact || trimmedMemoryIndex !== "# Memory Index");
|
|
1637
|
+
if (hasMemoryContent) {
|
|
1638
|
+
const block = promptResourceBlock({
|
|
1639
|
+
name: "memory/MEMORY.md",
|
|
1640
|
+
scope: "personal",
|
|
1641
|
+
path: "memory/MEMORY.md",
|
|
1642
|
+
content: memoryIndex.content,
|
|
1643
|
+
maxChars: compact
|
|
1644
|
+
? COMPACT_PROMPT_RESOURCE_MAX_CHARS
|
|
1645
|
+
: SHARED_PROMPT_RESOURCE_MAX_CHARS,
|
|
1646
|
+
...(resourceReadHint === undefined
|
|
1647
|
+
? {}
|
|
1648
|
+
: { readHint: resourceReadHint }),
|
|
1597
1649
|
});
|
|
1598
|
-
|
|
1599
|
-
const hasMemoryContent = trimmedMemoryIndex.length > 0 &&
|
|
1600
|
-
(!compact || trimmedMemoryIndex !== "# Memory Index");
|
|
1601
|
-
if (memoryIndex && hasMemoryContent) {
|
|
1602
|
-
const block = promptResourceBlock({
|
|
1603
|
-
name: "memory/MEMORY.md",
|
|
1604
|
-
scope: "personal",
|
|
1605
|
-
path: "memory/MEMORY.md",
|
|
1606
|
-
content: memoryIndex.content,
|
|
1607
|
-
maxChars: compact
|
|
1608
|
-
? COMPACT_PROMPT_RESOURCE_MAX_CHARS
|
|
1609
|
-
: SHARED_PROMPT_RESOURCE_MAX_CHARS,
|
|
1610
|
-
...(resourceReadHint === undefined
|
|
1611
|
-
? {}
|
|
1612
|
-
: { readHint: resourceReadHint }),
|
|
1613
|
-
});
|
|
1614
|
-
addSection(block, "user");
|
|
1615
|
-
}
|
|
1616
|
-
}
|
|
1617
|
-
catch (error) {
|
|
1618
|
-
console.warn("[agent-chat] Could not load personal memory index:", error);
|
|
1650
|
+
addSection(block, "user");
|
|
1619
1651
|
}
|
|
1620
1652
|
}
|
|
1621
1653
|
if (runtimeToolHints) {
|
|
1622
|
-
const workspaceResourceIndex = await loadResourceIndexForPrompt(workspaceOwner, "workspace", orgId);
|
|
1623
1654
|
addSection(workspaceResourceIndex);
|
|
1624
|
-
const appDefaultResourceIndex = await loadResourceIndexForPrompt(SHARED_OWNER, "shared", orgId);
|
|
1625
1655
|
addSection(appDefaultResourceIndex);
|
|
1626
|
-
if (
|
|
1627
|
-
const organizationResourceIndex = await loadResourceIndexForPrompt(organizationOwner, "shared", orgId);
|
|
1656
|
+
if (includeOrganizationResources) {
|
|
1628
1657
|
addSection(organizationResourceIndex);
|
|
1629
1658
|
}
|
|
1630
1659
|
}
|
|
1631
|
-
addSections(
|
|
1632
|
-
owner,
|
|
1633
|
-
compact,
|
|
1634
|
-
selfAppId,
|
|
1635
|
-
orgId,
|
|
1636
|
-
}));
|
|
1660
|
+
addSections(promptContextProviderBlocks);
|
|
1637
1661
|
if (appDiscoveryPromise) {
|
|
1638
1662
|
const discovery = await appDiscoveryPromise;
|
|
1639
1663
|
try {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type H3Event } from "h3";
|
|
2
|
+
import { type ViewportMode } from "../shared/viewport-mode.js";
|
|
2
3
|
import { type RequestContext } from "./request-context.js";
|
|
3
4
|
export type AgentRunOwnerContext = {
|
|
4
5
|
owner: string;
|
|
@@ -14,7 +15,9 @@ type AnonymousOwnerResolver = (event: H3Event) => string | null | Promise<string
|
|
|
14
15
|
type OrgIdResolver = (event: H3Event) => string | null | undefined | Promise<string | null | undefined>;
|
|
15
16
|
export declare function readAgentRunTimezone(event: H3Event): string | undefined;
|
|
16
17
|
export declare function readBrowserSessionIdHeader(event: H3Event): string | undefined;
|
|
18
|
+
export declare const VIEWPORT_MODE_HEADER = "x-agent-native-viewport-mode";
|
|
17
19
|
export declare function readBrowserTabIdHeader(event: H3Event): string | undefined;
|
|
20
|
+
export declare function readViewportModeHeader(event: H3Event): ViewportMode | undefined;
|
|
18
21
|
export declare function readAnalyticsClientPlatformHeader(event: H3Event): import("../shared/analytics-platform.js").AnalyticsClientPlatform | undefined;
|
|
19
22
|
export declare function readSyntheticTrafficHeader(event: H3Event): boolean;
|
|
20
23
|
export declare function seedAgentRunOwnerContext(event: H3Event, ownerContext: AgentRunOwnerContext): AgentRunOwnerContext;
|
|
@@ -5,6 +5,7 @@ import { getAppConfig } from "../app-config/index.js";
|
|
|
5
5
|
import { runWithProviderInteractiveScope, } from "../provider-api/interactive-scope.js";
|
|
6
6
|
import { ANALYTICS_CLIENT_PLATFORM_BODY_FIELD, ANALYTICS_CLIENT_PLATFORM_HEADER, normalizeAnalyticsClientPlatform, } from "../shared/analytics-platform.js";
|
|
7
7
|
import { SYNTHETIC_TRAFFIC_HEADER, isSyntheticTrafficValue, } from "../shared/test-traffic.js";
|
|
8
|
+
import { normalizeViewportMode, } from "../shared/viewport-mode.js";
|
|
8
9
|
import { ForbiddenError } from "../sharing/errors.js";
|
|
9
10
|
import { CREDENTIAL_MEMBERSHIP_UNAVAILABLE_MESSAGE, isCredentialMembershipUnavailable, } from "./credential-membership-unavailable.js";
|
|
10
11
|
import { isDirectLoopbackRequest, isLoopbackRequest } from "./loopback.js";
|
|
@@ -95,6 +96,7 @@ function readDurableBrowserSessionId(event) {
|
|
|
95
96
|
throw new Error("Malformed browser session id in durable agent run payload.");
|
|
96
97
|
}
|
|
97
98
|
const SAFE_BROWSER_TAB_ID_RE = /^[A-Za-z0-9_-]{1,96}$/;
|
|
99
|
+
export const VIEWPORT_MODE_HEADER = "x-agent-native-viewport-mode";
|
|
98
100
|
export function readBrowserTabIdHeader(event) {
|
|
99
101
|
const raw = readHeaderValue(event, "x-agent-native-browser-tab");
|
|
100
102
|
const value = Array.isArray(raw) ? raw[0] : raw;
|
|
@@ -103,6 +105,11 @@ export function readBrowserTabIdHeader(event) {
|
|
|
103
105
|
const trimmed = value.trim();
|
|
104
106
|
return SAFE_BROWSER_TAB_ID_RE.test(trimmed) ? trimmed : undefined;
|
|
105
107
|
}
|
|
108
|
+
export function readViewportModeHeader(event) {
|
|
109
|
+
const raw = readHeaderValue(event, VIEWPORT_MODE_HEADER);
|
|
110
|
+
const value = Array.isArray(raw) ? raw[0] : raw;
|
|
111
|
+
return normalizeViewportMode(value);
|
|
112
|
+
}
|
|
106
113
|
export function readAnalyticsClientPlatformHeader(event) {
|
|
107
114
|
const raw = readHeaderValue(event, ANALYTICS_CLIENT_PLATFORM_HEADER);
|
|
108
115
|
const value = Array.isArray(raw) ? raw[0] : raw;
|
|
@@ -109,6 +109,7 @@ export declare function hasBuilderOAuthSession(ownerEmail: string, orgId?: strin
|
|
|
109
109
|
export declare function hasStoredBuilderOAuthGrantForUse(ownerEmail: string, orgId?: string | null, access?: {
|
|
110
110
|
orgOnly?: boolean;
|
|
111
111
|
}): Promise<boolean>;
|
|
112
|
+
export declare function hasOwnStoredBuilderOAuthGrantForUse(ownerEmail: string, orgId?: string | null): Promise<boolean>;
|
|
112
113
|
/**
|
|
113
114
|
* Read the saved Builder grant without refreshing its access token. The
|
|
114
115
|
* status route and chat preflight need a cheap readiness answer; runtime
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { OAuthError, OAuthErrorCode } from "@modelcontextprotocol/client";
|
|
3
|
-
import { finishMcpOAuthAuthorization, getMcpOAuthAccessToken, McpOAuthReauthorizationRequiredError, McpOAuthRefreshUnavailableError, markMcpOAuthReconnectRequired, readMcpOAuthCredentials, resolveMcpOAuthCredentialAccess, revokeMcpOAuthCredentials, saveMcpOAuthCredentials, startMcpOAuthAuthorization, validateMcpOAuthCallbackIssuer, } from "../mcp-client/oauth-client.js";
|
|
3
|
+
import { finishMcpOAuthAuthorization, getMcpOAuthConnectionState, getMcpOAuthAccessToken, McpOAuthReauthorizationRequiredError, McpOAuthRefreshUnavailableError, markMcpOAuthReconnectRequired, readMcpOAuthCredentials, resolveMcpOAuthCredentialAccess, revokeMcpOAuthCredentials, saveMcpOAuthCredentials, startMcpOAuthAuthorization, validateMcpOAuthCallbackIssuer, } from "../mcp-client/oauth-client.js";
|
|
4
4
|
import { getOAuthTokens, listOAuthTokenOwners } from "../oauth-tokens/store.js";
|
|
5
5
|
import { invalidateAgentEngineStatusCache } from "./agent-engine-status-cache.js";
|
|
6
6
|
import { orderCredentialScopes } from "./credential-read-order.js";
|
|
@@ -248,7 +248,13 @@ export async function saveBuilderOAuthCredentials(input) {
|
|
|
248
248
|
const options = await writeBuilderOAuthOptions(input);
|
|
249
249
|
await saveMcpOAuthCredentials({
|
|
250
250
|
...options,
|
|
251
|
-
credentials: {
|
|
251
|
+
credentials: {
|
|
252
|
+
...input.credentials,
|
|
253
|
+
connectedAt: Date.now(),
|
|
254
|
+
...(options.scope === "org"
|
|
255
|
+
? { connectedBy: normalizeOwnerEmail(input.ownerEmail) }
|
|
256
|
+
: {}),
|
|
257
|
+
},
|
|
252
258
|
});
|
|
253
259
|
invalidateAgentEngineStatusCache();
|
|
254
260
|
return options.scope;
|
|
@@ -364,6 +370,38 @@ export async function hasStoredBuilderOAuthGrantForUse(ownerEmail, orgId, access
|
|
|
364
370
|
}
|
|
365
371
|
return false;
|
|
366
372
|
}
|
|
373
|
+
export async function hasOwnStoredBuilderOAuthGrantForUse(ownerEmail, orgId) {
|
|
374
|
+
const email = normalizeOwnerEmail(ownerEmail);
|
|
375
|
+
const resolvedOrgId = orgId === undefined
|
|
376
|
+
? await resolveOrgIdForEmail(email)
|
|
377
|
+
: orgId?.trim() || null;
|
|
378
|
+
const options = await resolveBuilderOAuthOptions(email, resolvedOrgId, {
|
|
379
|
+
forUse: true,
|
|
380
|
+
});
|
|
381
|
+
for (const candidate of options) {
|
|
382
|
+
const state = await getMcpOAuthConnectionState(candidate);
|
|
383
|
+
if (state.kind === "missing")
|
|
384
|
+
continue;
|
|
385
|
+
if (state.kind === "malformed" || !isBuilderCredential(state.credential)) {
|
|
386
|
+
throw new Error("The stored Builder OAuth grant could not be read.");
|
|
387
|
+
}
|
|
388
|
+
if (candidate.scope === "org" && state.credential.connectedBy !== email) {
|
|
389
|
+
continue;
|
|
390
|
+
}
|
|
391
|
+
if (state.kind === "connected")
|
|
392
|
+
return true;
|
|
393
|
+
if (state.kind === "reconnect_required")
|
|
394
|
+
continue;
|
|
395
|
+
const accessToken = await getMcpOAuthAccessToken({
|
|
396
|
+
...candidate,
|
|
397
|
+
throwOnTransientRefreshFailure: true,
|
|
398
|
+
shouldMarkReconnectRequiredOnRefreshFailure: shouldMarkBuilderReconnectRequiredOnRefreshFailure,
|
|
399
|
+
});
|
|
400
|
+
if (accessToken)
|
|
401
|
+
return true;
|
|
402
|
+
}
|
|
403
|
+
return false;
|
|
404
|
+
}
|
|
367
405
|
/**
|
|
368
406
|
* Read the saved Builder grant without refreshing its access token. The
|
|
369
407
|
* status route and chat preflight need a cheap readiness answer; runtime
|
|
@@ -52,6 +52,11 @@ export function preserveActionFlags(entry, actionName) {
|
|
|
52
52
|
"~standard" in entry.schema) {
|
|
53
53
|
out.schema = entry.schema;
|
|
54
54
|
}
|
|
55
|
+
if (entry.outputSchema &&
|
|
56
|
+
typeof entry.outputSchema === "object" &&
|
|
57
|
+
"~standard" in entry.outputSchema) {
|
|
58
|
+
out.outputSchema = entry.outputSchema;
|
|
59
|
+
}
|
|
55
60
|
if (entry.agentInputSchema &&
|
|
56
61
|
typeof entry.agentInputSchema === "object" &&
|
|
57
62
|
"~standard" in entry.agentInputSchema) {
|
|
@@ -17,9 +17,9 @@ export type FirstTouchSyncResult = {
|
|
|
17
17
|
* browser's `an_ft` and `an_lt` again, so Safari keeps them their 30 days.
|
|
18
18
|
*/
|
|
19
19
|
export declare function createFirstTouchHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
20
|
-
error: string;
|
|
21
|
-
reason?: undefined;
|
|
22
20
|
stored?: undefined;
|
|
21
|
+
reason?: undefined;
|
|
22
|
+
error: string;
|
|
23
23
|
firstTouch?: undefined;
|
|
24
24
|
} | {
|
|
25
25
|
error?: undefined;
|
package/dist/server/index.d.ts
CHANGED
|
@@ -100,7 +100,7 @@ export { filterFrameworkToolGroups, frameworkGroupEnabled, resolveFrameworkTools
|
|
|
100
100
|
export { buildCompactSkillsSummary, registerPromptContextProvider, type PromptContextProvider, type PromptContextProviderContext, type PromptContextProviderContribution, } from "./agent-chat/prompt-resources.js";
|
|
101
101
|
export { mountActionRoutes, type MountActionRoutesOptions, type ActionRouteAuthAdapter, type ActionRouteResolvedCaller, } from "./action-routes.js";
|
|
102
102
|
export { AGENT_RUN_OWNER_CONTEXT_KEY, readBrowserSessionIdHeader, seedAgentRunOwnerContext, type AgentRunOwnerContext, } from "./agent-run-context.js";
|
|
103
|
-
export { runWithRequestContext, hasRequestContext, hasRequestBoundary, getRequestContext, getRequestUserEmail, getRequestUserName, getRequestOrgId, getRequestIdentityAuthenticatedAtMs, getAmbientUserEmail, getAmbientOrgId, getRequestTimezone, getRequestRunContext, getCredentialContext, isIntegrationCallerRequest, type RequestContext, type RequestRunContext, } from "./request-context.js";
|
|
103
|
+
export { runWithRequestContext, hasRequestContext, hasRequestBoundary, getRequestContext, getRequestUserEmail, getRequestUserName, getRequestOrgId, getRequestIdentityAuthenticatedAtMs, getAmbientUserEmail, getAmbientOrgId, getRequestTimezone, getRequestRunContext, getCredentialContext, isIntegrationCallerRequest, normalizeViewportMode, type RequestContext, type RequestRunContext, type ViewportMode, } from "./request-context.js";
|
|
104
104
|
export { loadFirstRunBuilderCreditsV2Assignment, resolveFirstRunBuilderCreditsV2Assignment, recordFirstRunBuilderCreditsV2Exposure, } from "../onboarding/first-run-builder-credits-experiment.js";
|
|
105
105
|
export { formatDateInTimezone, todayInTimezone } from "./date-utils.js";
|
|
106
106
|
export { createOnboardingPlugin, defaultOnboardingPlugin, } from "../onboarding/plugin.js";
|
|
@@ -117,7 +117,7 @@ export { resolveDeployPlatform, type DeployPlatform, } from "./deploy-environmen
|
|
|
117
117
|
export { isServerlessRuntime } from "../db/client.js";
|
|
118
118
|
export { BUILDER_PUBLISH_MCP_RESOURCE, canAuthorizeBuilderApiRequest, hasBuilderApiCredentialCustody, resolveBuilderApiAuthorization, resolveBuilderLegacyRequestAuthorization, resolveBuilderRequestAuthorization, type BuilderLegacyCredentialKey, type BuilderRequestAuthorization, } from "./builder-api-auth.js";
|
|
119
119
|
export { createFusionAgentFeed, fusionStepToAgentChatEvents, type FusionAgentFeedSummary, } from "./fusion-agent-feed.js";
|
|
120
|
-
export { BUILDER_ASSETS_WRITE_SCOPE, BUILDER_CONTENT_READ_SCOPE, BUILDER_CONTENT_WRITE_SCOPE, BUILDER_OAUTH_RESOURCE, BUILDER_OAUTH_SCOPE, resolveBuilderOAuthRequestAccessState, type BuilderOAuthPermissionScope, type BuilderOAuthRequestAccessState, } from "./builder-oauth.js";
|
|
120
|
+
export { BUILDER_ASSETS_WRITE_SCOPE, BUILDER_CONTENT_READ_SCOPE, BUILDER_CONTENT_WRITE_SCOPE, BUILDER_OAUTH_RESOURCE, BUILDER_OAUTH_SCOPE, hasOwnStoredBuilderOAuthGrantForUse, resolveBuilderOAuthRequestAccessState, type BuilderOAuthPermissionScope, type BuilderOAuthRequestAccessState, } from "./builder-oauth.js";
|
|
121
121
|
export { assertBuilderDesignSystemCodeIndexingAllowed, builderDesignSystemUrl, builderProjectBranchUrl, buildBuilderDesignSystemIndexFiles, collectBuilderDesignSystemGitHubFiles, createBuilderDesignSystemProxyFields, designSystemTierUpgradeUrl, fetchBuilderDesignSystemDecodeJobStatus, fetchBuilderDesignSystemDocs, fetchBuilderDesignSystemDocumentCount, fetchBuilderDesignSystemRecord, fetchBuilderDesignSystemTierLimit, getBuilderDesignSystemsBaseUrl, hydrateBuilderDesignSystemReference, indexBuilderDesignSystem, isBuilderDesignSystemReadyByCount, localBuilderDesignSystemId, mimeTypeForBuilderDesignSystemFilename, parseBuilderDesignSystemProxyReference, startBuilderDesignSystemIndex, startBuilderDesignSystemUpload, type BuildBuilderDesignSystemIndexFilesOptions, type BuilderDesignSystemCodeFileInput, type BuilderDesignSystemDecodeJobStatus, type BuilderDesignSystemDocsOptions, type BuilderDesignSystemDocument, type BuilderDesignSystemDocumentCountResult, type BuilderDesignSystemHydratedReference, type BuilderDesignSystemIndexFile, type BuilderDesignSystemIndexFromSourcesOptions, type BuilderDesignSystemIndexOptions, type BuilderDesignSystemIndexResult, type BuilderDesignSystemRecord, type BuilderDesignSystemStatus, type BuilderDesignSystemTierLimit, type BuilderDesignSystemGitHubFile, type BuilderDesignSystemGitHubFileCollection, type BuilderDesignSystemGitHubSource, type BuilderDesignSystemUploadAttachment, type BuilderDesignSystemUploadSlot, type BuilderDesignSystemProxyFields, type BuilderDesignSystemProxyFieldsOptions, type BuilderDesignSystemProxyReference, type BuilderDesignSystemSourceKind, } from "./builder-design-systems.js";
|
|
122
122
|
export { cdnSafeOriginStatus, createBuilderProject, getBuilderWorkspaceProjectId, getBuilderWorkspaceUrl, ensureBuilderProject, findBuilderProjectForRepo, getBuilderBranchProjectId, isBuilderBranchingEnabled, registerBuilderBranchProject, requestBuilderBrowserConnection, resolveBuilderBranchProjectId, resolveBuilderHandoffProjectId, resolveIsBuilderBranchingEnabled, normalizeBuilderAgentAttachments, runBuilderAgent, type BuilderAgentAttachment, type BuilderAgentUploadAttachment, type BuilderAgentUrlAttachment, type BuilderProjectResult, type RunBuilderAgentResult, } from "./builder-browser.js";
|
|
123
123
|
export { BuilderBranchError, getBuilderBranchStatus, sendBuilderBranchMessage, type BuilderBranchAgentState, type BuilderBranchErrorCode, type BuilderBranchOperation, type BuilderBranchPrStatus, type BuilderBranchRef, type BuilderBranchState, type BuilderBranchStatus, type GetBuilderBranchStatusOptions, type SendBuilderBranchMessageOptions, type SendBuilderBranchMessageResult, } from "./builder-branch.js";
|
package/dist/server/index.js
CHANGED
|
@@ -93,7 +93,7 @@ export { filterFrameworkToolGroups, frameworkGroupEnabled, resolveFrameworkTools
|
|
|
93
93
|
export { buildCompactSkillsSummary, registerPromptContextProvider, } from "./agent-chat/prompt-resources.js";
|
|
94
94
|
export { mountActionRoutes, } from "./action-routes.js";
|
|
95
95
|
export { AGENT_RUN_OWNER_CONTEXT_KEY, readBrowserSessionIdHeader, seedAgentRunOwnerContext, } from "./agent-run-context.js";
|
|
96
|
-
export { runWithRequestContext, hasRequestContext, hasRequestBoundary, getRequestContext, getRequestUserEmail, getRequestUserName, getRequestOrgId, getRequestIdentityAuthenticatedAtMs, getAmbientUserEmail, getAmbientOrgId, getRequestTimezone, getRequestRunContext, getCredentialContext, isIntegrationCallerRequest, } from "./request-context.js";
|
|
96
|
+
export { runWithRequestContext, hasRequestContext, hasRequestBoundary, getRequestContext, getRequestUserEmail, getRequestUserName, getRequestOrgId, getRequestIdentityAuthenticatedAtMs, getAmbientUserEmail, getAmbientOrgId, getRequestTimezone, getRequestRunContext, getCredentialContext, isIntegrationCallerRequest, normalizeViewportMode, } from "./request-context.js";
|
|
97
97
|
export { loadFirstRunBuilderCreditsV2Assignment, resolveFirstRunBuilderCreditsV2Assignment, recordFirstRunBuilderCreditsV2Exposure, } from "../onboarding/first-run-builder-credits-experiment.js";
|
|
98
98
|
export { formatDateInTimezone, todayInTimezone } from "./date-utils.js";
|
|
99
99
|
export { createOnboardingPlugin, defaultOnboardingPlugin, } from "../onboarding/plugin.js";
|
|
@@ -110,7 +110,7 @@ export { resolveDeployPlatform, } from "./deploy-environment.js";
|
|
|
110
110
|
export { isServerlessRuntime } from "../db/client.js";
|
|
111
111
|
export { BUILDER_PUBLISH_MCP_RESOURCE, canAuthorizeBuilderApiRequest, hasBuilderApiCredentialCustody, resolveBuilderApiAuthorization, resolveBuilderLegacyRequestAuthorization, resolveBuilderRequestAuthorization, } from "./builder-api-auth.js";
|
|
112
112
|
export { createFusionAgentFeed, fusionStepToAgentChatEvents, } from "./fusion-agent-feed.js";
|
|
113
|
-
export { BUILDER_ASSETS_WRITE_SCOPE, BUILDER_CONTENT_READ_SCOPE, BUILDER_CONTENT_WRITE_SCOPE, BUILDER_OAUTH_RESOURCE, BUILDER_OAUTH_SCOPE, resolveBuilderOAuthRequestAccessState, } from "./builder-oauth.js";
|
|
113
|
+
export { BUILDER_ASSETS_WRITE_SCOPE, BUILDER_CONTENT_READ_SCOPE, BUILDER_CONTENT_WRITE_SCOPE, BUILDER_OAUTH_RESOURCE, BUILDER_OAUTH_SCOPE, hasOwnStoredBuilderOAuthGrantForUse, resolveBuilderOAuthRequestAccessState, } from "./builder-oauth.js";
|
|
114
114
|
export { assertBuilderDesignSystemCodeIndexingAllowed, builderDesignSystemUrl, builderProjectBranchUrl, buildBuilderDesignSystemIndexFiles, collectBuilderDesignSystemGitHubFiles, createBuilderDesignSystemProxyFields, designSystemTierUpgradeUrl, fetchBuilderDesignSystemDecodeJobStatus, fetchBuilderDesignSystemDocs, fetchBuilderDesignSystemDocumentCount, fetchBuilderDesignSystemRecord, fetchBuilderDesignSystemTierLimit, getBuilderDesignSystemsBaseUrl, hydrateBuilderDesignSystemReference, indexBuilderDesignSystem, isBuilderDesignSystemReadyByCount, localBuilderDesignSystemId, mimeTypeForBuilderDesignSystemFilename, parseBuilderDesignSystemProxyReference, startBuilderDesignSystemIndex, startBuilderDesignSystemUpload, } from "./builder-design-systems.js";
|
|
115
115
|
export { cdnSafeOriginStatus, createBuilderProject, getBuilderWorkspaceProjectId, getBuilderWorkspaceUrl, ensureBuilderProject, findBuilderProjectForRepo, getBuilderBranchProjectId, isBuilderBranchingEnabled, registerBuilderBranchProject, requestBuilderBrowserConnection, resolveBuilderBranchProjectId, resolveBuilderHandoffProjectId, resolveIsBuilderBranchingEnabled, normalizeBuilderAgentAttachments, runBuilderAgent, } from "./builder-browser.js";
|
|
116
116
|
export { BuilderBranchError, getBuilderBranchStatus, sendBuilderBranchMessage, } from "./builder-branch.js";
|
|
@@ -129,18 +129,24 @@ export function createOpenRouteHandler(options = {}) {
|
|
|
129
129
|
navParams[k] = v;
|
|
130
130
|
}
|
|
131
131
|
const navPayload = { ...navParams };
|
|
132
|
+
delete navPayload.path;
|
|
132
133
|
if (view)
|
|
133
134
|
navPayload.view = view;
|
|
134
|
-
|
|
135
|
-
safeRelativePath(options.resolveOpenPath?.({
|
|
136
|
-
(
|
|
137
|
-
|
|
135
|
+
const resolvedPath = safeRelativePath(toParam) ??
|
|
136
|
+
safeRelativePath(options.resolveOpenPath?.({
|
|
137
|
+
...(app ? { app } : {}),
|
|
138
|
+
...(view ? { view } : {}),
|
|
139
|
+
params: navParams,
|
|
140
|
+
}));
|
|
141
|
+
let target = resolvedPath ?? safeRelativePath(view ? `/${view}` : null) ?? "/";
|
|
138
142
|
const filters = new URLSearchParams();
|
|
139
143
|
for (const [k, v] of search.entries()) {
|
|
140
144
|
if (k.startsWith("f_"))
|
|
141
145
|
filters.set(k, v);
|
|
142
146
|
}
|
|
143
147
|
target = appendSearchParams(target, filters);
|
|
148
|
+
if (resolvedPath)
|
|
149
|
+
navPayload.path = target;
|
|
144
150
|
const embedParams = new URLSearchParams();
|
|
145
151
|
for (const key of [
|
|
146
152
|
EMBED_MODE_QUERY_PARAM,
|
package/dist/server/poll.d.ts
CHANGED
|
@@ -49,9 +49,11 @@ export type ChangeReadResult = {
|
|
|
49
49
|
type: "access-unavailable" | "unknown-scope";
|
|
50
50
|
}>;
|
|
51
51
|
};
|
|
52
|
+
type UnreadableCause = "threw" | "timeout" | "missing-event";
|
|
52
53
|
type UnreadableAt = {
|
|
53
54
|
cursor: SyncCursor;
|
|
54
55
|
type: "access-unavailable" | "unknown-scope";
|
|
56
|
+
cause: UnreadableCause;
|
|
55
57
|
};
|
|
56
58
|
type AccessRead = {
|
|
57
59
|
checking: Set<string>;
|
|
@@ -162,6 +164,7 @@ export declare class AppSyncState {
|
|
|
162
164
|
readMinSyncEventVersion(): Promise<number>;
|
|
163
165
|
invalidateCollabAccessCache(resourceType: string, resourceId: string): void;
|
|
164
166
|
private setAccessCache;
|
|
167
|
+
private unreadableCauseForEvent;
|
|
165
168
|
private scheduleAccessCheck;
|
|
166
169
|
private countRunningAccessWork;
|
|
167
170
|
private endAccessCheck;
|