@agent-native/core 0.214.0 → 0.216.0

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 (161) hide show
  1. package/dist/action.js +54 -1
  2. package/dist/agent/actions/disconnect-chatgpt-subscription.js +5 -0
  3. package/dist/agent/actions/get-agentkit-capabilities.js +3 -3
  4. package/dist/agent/actions/manage-builder-connection.js +5 -0
  5. package/dist/agent/actions/manage-provider-key-policy.js +5 -0
  6. package/dist/agent/actions/manage-provider-models.js +5 -0
  7. package/dist/agent/actions/manage-service-providers.js +5 -0
  8. package/dist/agent/actions/select-chatgpt-subscription-account.js +5 -0
  9. package/dist/agent/context-xray/actions/context-evict.js +5 -0
  10. package/dist/agent/context-xray/actions/context-pin.js +5 -0
  11. package/dist/agent/context-xray/actions/context-report.js +5 -0
  12. package/dist/agent/context-xray/actions/context-restore.js +5 -0
  13. package/dist/agent/execution-fence.d.ts +1 -0
  14. package/dist/agent/execution-fence.js +5 -0
  15. package/dist/agent/production-agent.d.ts +35 -2
  16. package/dist/agent/production-agent.js +629 -32
  17. package/dist/agent/run-manager.d.ts +2 -0
  18. package/dist/agent/run-manager.js +397 -115
  19. package/dist/agent/run-slot-lock.d.ts +2 -0
  20. package/dist/agent/run-slot-lock.js +6 -0
  21. package/dist/agent/run-store.d.ts +5 -0
  22. package/dist/agent/run-store.js +423 -156
  23. package/dist/agent/thread-data-builder.js +27 -5
  24. package/dist/agent/types.d.ts +6 -12
  25. package/dist/agentkit/capabilities.d.ts +1 -1
  26. package/dist/application-state/store.d.ts +5 -0
  27. package/dist/application-state/store.js +26 -0
  28. package/dist/chat-threads/schema-migrations.js +17 -0
  29. package/dist/chat-threads/store.d.ts +21 -1
  30. package/dist/chat-threads/store.js +223 -41
  31. package/dist/cli/skills-content/turn-into-app-skill.d.ts +1 -1
  32. package/dist/cli/skills-content/turn-into-app-skill.js +20 -18
  33. package/dist/cli/templates-meta.js +14 -0
  34. package/dist/client/analytics.js +167 -17
  35. package/dist/client/chat/agentkit-agent-native.js +79 -3
  36. package/dist/client/chat/agentkit-protocol.js +80 -42
  37. package/dist/client/chat/runtime.d.ts +5 -1
  38. package/dist/client/chat/runtime.js +46 -3
  39. package/dist/client/consent.d.ts +36 -0
  40. package/dist/client/consent.js +283 -0
  41. package/dist/client/review/use-review.d.ts +2 -0
  42. package/dist/client/review/use-review.js +28 -1
  43. package/dist/client/sharing/useResourceAccessGate.d.ts +3 -2
  44. package/dist/client/sharing/useResourceAccessGate.js +9 -1
  45. package/dist/client/use-chat-thread-list.d.ts +2 -0
  46. package/dist/client/use-chat-thread-list.js +12 -2
  47. package/dist/client/use-chat-threads.d.ts +1 -0
  48. package/dist/client/use-chat-threads.js +2 -0
  49. package/dist/collab/awareness.d.ts +2 -2
  50. package/dist/collab/routes.d.ts +2 -2
  51. package/dist/collab/struct-routes.d.ts +1 -1
  52. package/dist/connections/catalog.d.ts +5 -5
  53. package/dist/connections/catalog.js +22 -3
  54. package/dist/data-widgets/index.d.ts +36 -2
  55. package/dist/data-widgets/index.js +94 -6
  56. package/dist/db/migrations.js +4 -1
  57. package/dist/db/schema-snapshot.generated.js +8 -1
  58. package/dist/feature-flags/actions/set-feature-flag.js +5 -0
  59. package/dist/feature-flags/index.d.ts +1 -1
  60. package/dist/feature-flags/index.js +1 -1
  61. package/dist/feature-flags/store.d.ts +12 -0
  62. package/dist/feature-flags/store.js +79 -7
  63. package/dist/file-upload/actions/manage-file-storage.js +5 -0
  64. package/dist/file-upload/actions/upload-image.d.ts +1 -1
  65. package/dist/file-upload/actions/upload-image.js +5 -0
  66. package/dist/history/actions/create-resource-version.js +5 -0
  67. package/dist/history/actions/restore-resource-version.js +5 -0
  68. package/dist/ingestion/index.d.ts +1 -1
  69. package/dist/ingestion/index.js +1 -1
  70. package/dist/ingestion/pptx.d.ts +11 -0
  71. package/dist/ingestion/pptx.js +81 -1
  72. package/dist/integrations/actions/manage-messaging-channel.js +5 -0
  73. package/dist/jobs/scheduler.js +17 -1
  74. package/dist/labs/actions/set-lab.js +5 -0
  75. package/dist/localization/actions/set-localization-preference.js +5 -0
  76. package/dist/observability/actions/save-observability-instruction-update.js +5 -0
  77. package/dist/observability/actions/save-observability-review-summary.js +5 -0
  78. package/dist/progress/routes.d.ts +1 -1
  79. package/dist/provider-api/actions/custom-provider-registration.d.ts +18 -18
  80. package/dist/provider-api/actions/provider-api.d.ts +14 -14
  81. package/dist/provider-api/corpus-jobs.d.ts +2 -2
  82. package/dist/provider-api/index.js +9 -2
  83. package/dist/review/actions/consume-review-feedback.js +5 -0
  84. package/dist/review/actions/create-review-comment.js +5 -0
  85. package/dist/review/actions/delete-review-comment.js +5 -0
  86. package/dist/review/actions/react-to-review-comment.js +5 -0
  87. package/dist/review/actions/reply-review-comment.js +5 -0
  88. package/dist/review/actions/resolve-review-thread.js +5 -0
  89. package/dist/review/actions/send-review-thread-to-agent.js +5 -0
  90. package/dist/review/actions/set-review-status.js +5 -0
  91. package/dist/review/actions/set-review-thread-muted.js +5 -0
  92. package/dist/review/actions/set-review-thread-unread.js +5 -0
  93. package/dist/review/actions/set-review-threads-unread.js +5 -0
  94. package/dist/review/actions/update-review-comment-anchor.js +5 -0
  95. package/dist/review/actions/update-review-comment.js +5 -0
  96. package/dist/review/suggestions/actions.js +60 -21
  97. package/dist/review/suggestions/store.d.ts +2 -0
  98. package/dist/review/suggestions/store.js +28 -0
  99. package/dist/secrets/actions/delete-api-key.js +5 -0
  100. package/dist/secrets/routes.d.ts +6 -6
  101. package/dist/server/agent-chat/context-tools.js +63 -2
  102. package/dist/server/agent-chat-plugin.d.ts +2 -0
  103. package/dist/server/agent-chat-plugin.js +242 -54
  104. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  105. package/dist/server/agent-engine-default-model-route.d.ts +2 -2
  106. package/dist/server/agent-engine-ollama-models-route.d.ts +1 -1
  107. package/dist/server/application-state-maintenance.d.ts +2 -0
  108. package/dist/server/application-state-maintenance.js +2 -0
  109. package/dist/server/attribution.d.ts +14 -0
  110. package/dist/server/attribution.js +62 -2
  111. package/dist/server/auth.js +7 -0
  112. package/dist/server/consent-route.d.ts +41 -0
  113. package/dist/server/consent-route.js +102 -0
  114. package/dist/server/first-touch-route.d.ts +39 -0
  115. package/dist/server/first-touch-route.js +115 -0
  116. package/dist/server/index.d.ts +1 -0
  117. package/dist/server/index.js +1 -0
  118. package/dist/server/queued-submission-inbox-drain.d.ts +9 -0
  119. package/dist/server/queued-submission-inbox-drain.js +12 -0
  120. package/dist/server/request-origin.d.ts +6 -0
  121. package/dist/server/request-origin.js +12 -0
  122. package/dist/settings/org-settings.d.ts +2 -1
  123. package/dist/settings/org-settings.js +4 -1
  124. package/dist/settings/store.d.ts +8 -0
  125. package/dist/settings/store.js +14 -5
  126. package/dist/shared/consent.d.ts +31 -0
  127. package/dist/shared/consent.js +145 -0
  128. package/dist/shared/first-touch-persistence.d.ts +31 -0
  129. package/dist/shared/first-touch-persistence.js +53 -0
  130. package/dist/sharing/actions/set-resource-visibility.js +5 -0
  131. package/dist/sharing/actions/share-resource.js +5 -0
  132. package/dist/sharing/actions/unshare-resource.js +5 -0
  133. package/dist/templates/chat/.agents/skills/actions/references/action-fields.md +1 -1
  134. package/dist/templates/default/.agents/skills/actions/references/action-fields.md +1 -1
  135. package/dist/templates/factory/.agents/skills/review-latest-feedback/SKILL.md +36 -80
  136. package/dist/templates/factory/.agents/skills/review-latest-feedback/references/channel-inventory.md +54 -16
  137. package/dist/templates/factory/.agents/skills/review-latest-feedback/references/slack-reaction-replies.md +50 -73
  138. package/dist/templates/headless/.agents/skills/actions/references/action-fields.md +1 -1
  139. package/dist/templates/workspace-core/.agents/skills/actions/references/action-fields.md +1 -1
  140. package/dist/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +20 -18
  141. package/dist/triggers/actions/manage-automation.d.ts +1 -1
  142. package/dist/usage/actions/get-usage-metrics.js +27 -4
  143. package/dist/usage/actions/manage-usage-alert.js +5 -0
  144. package/dist/vite/client.js +8 -6
  145. package/dist/workspace-connections/actions/bulk-update-workspace-user-groups.js +5 -0
  146. package/dist/workspace-connections/actions/delete-workspace-user-group.js +5 -0
  147. package/dist/workspace-connections/actions/upsert-workspace-user-group.js +5 -0
  148. package/docs/content/actions-access-control.mdx +8 -8
  149. package/docs/content/actions-defining.mdx +9 -8
  150. package/docs/content/template-design-developers.mdx +9 -9
  151. package/docs/content/template-design-features.mdx +1 -3
  152. package/docs/content/turn-into-app.mdx +4 -0
  153. package/package.json +4 -3
  154. package/src/templates/chat/.agents/skills/actions/references/action-fields.md +1 -1
  155. package/src/templates/default/.agents/skills/actions/references/action-fields.md +1 -1
  156. package/src/templates/factory/.agents/skills/review-latest-feedback/SKILL.md +36 -80
  157. package/src/templates/factory/.agents/skills/review-latest-feedback/references/channel-inventory.md +54 -16
  158. package/src/templates/factory/.agents/skills/review-latest-feedback/references/slack-reaction-replies.md +50 -73
  159. package/src/templates/headless/.agents/skills/actions/references/action-fields.md +1 -1
  160. package/src/templates/workspace-core/.agents/skills/actions/references/action-fields.md +1 -1
  161. package/src/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +20 -18
@@ -10,6 +10,11 @@ export default defineAction({
10
10
  threadId: z.string().min(1),
11
11
  muted: z.boolean(),
12
12
  }),
13
+ mcpAnnotations: {
14
+ readOnlyHint: false,
15
+ destructiveHint: false,
16
+ openWorldHint: false,
17
+ },
13
18
  run: async (args, ctx) => {
14
19
  await assertReviewableResourceAccess(args.resourceType, args.resourceId, ctx, "viewer");
15
20
  const root = await getReviewThreadRoot(args.threadId, { resourceType: args.resourceType, resourceId: args.resourceId }, { userEmail: ctx?.userEmail, orgId: ctx?.orgId }, { bypassScope: true });
@@ -10,6 +10,11 @@ export default defineAction({
10
10
  threadId: z.string().min(1),
11
11
  unread: z.boolean(),
12
12
  }),
13
+ mcpAnnotations: {
14
+ readOnlyHint: false,
15
+ destructiveHint: false,
16
+ openWorldHint: false,
17
+ },
13
18
  run: async (args, ctx) => {
14
19
  await assertReviewableResourceAccess(args.resourceType, args.resourceId, ctx, "viewer");
15
20
  const root = await getReviewThreadRoot(args.threadId, { resourceType: args.resourceType, resourceId: args.resourceId }, { userEmail: ctx?.userEmail, orgId: ctx?.orgId }, { bypassScope: true });
@@ -10,6 +10,11 @@ export default defineAction({
10
10
  threadIds: z.array(z.string().min(1)).min(1).max(500),
11
11
  unread: z.boolean(),
12
12
  }),
13
+ mcpAnnotations: {
14
+ readOnlyHint: false,
15
+ destructiveHint: false,
16
+ openWorldHint: false,
17
+ },
13
18
  run: async (args, ctx) => {
14
19
  await assertReviewableResourceAccess(args.resourceType, args.resourceId, ctx, "viewer");
15
20
  const userEmail = ctx?.userEmail;
@@ -13,6 +13,11 @@ const schema = z.object({
13
13
  export default defineAction({
14
14
  description: "Move an anchored review comment to a new canvas position.",
15
15
  schema,
16
+ mcpAnnotations: {
17
+ readOnlyHint: false,
18
+ destructiveHint: true,
19
+ openWorldHint: false,
20
+ },
16
21
  run: async (args, ctx) => {
17
22
  const actionCtx = ctx;
18
23
  const userEmail = actionCtx?.userEmail?.trim().toLowerCase();
@@ -25,6 +25,11 @@ const schema = z
25
25
  export default defineAction({
26
26
  description: "Update an authored review comment body or canvas anchor.",
27
27
  schema,
28
+ mcpAnnotations: {
29
+ readOnlyHint: false,
30
+ destructiveHint: true,
31
+ openWorldHint: false,
32
+ },
28
33
  run: async (args, ctx) => {
29
34
  const actionCtx = ctx;
30
35
  const scope = {
@@ -6,7 +6,7 @@ import { assertReviewableResourceAccess } from "../registry.js";
6
6
  import { ensureReviewTables, insertReviewCommentWithClient, resolveReviewThreadWithClient, } from "../store.js";
7
7
  import { suggestionActorKind, suggestionActorKindMatchesReceipt, } from "./actor-kind.js";
8
8
  import { getSuggestionAdapter } from "./registry.js";
9
- import { getSuggestion, ensureSuggestionTables, insertSuggestion, listSuggestions, recordDecision, getDecision, getSuggestionByCreationKey, recordSuggestionCreation, updateSuggestionStatus, getSuggestionAmendment, amendSuggestion, deleteUnclaimedSuggestion, getSuggestionProposal, insertSuggestionProposal, getProposalCreation, recordProposalCreation, getProposalDecision, recordProposalDecision, } from "./store.js";
9
+ import { getSuggestion, getSuggestions, ensureSuggestionTables, insertSuggestion, listSuggestions, recordDecision, getDecision, getSuggestionByCreationKey, recordSuggestionCreation, updateSuggestionStatus, getSuggestionAmendment, amendSuggestion, deleteUnclaimedSuggestion, getSuggestionProposal, insertSuggestionProposal, getProposalCreation, recordProposalCreation, getProposalDecision, recordProposalDecision, } from "./store.js";
10
10
  const base = { resourceType: z.string().min(1), resourceId: z.string().min(1) };
11
11
  const operation = z.object({
12
12
  ordinal: z.number().int().nonnegative(),
@@ -123,6 +123,12 @@ export const createResourceSuggestion = defineAction({
123
123
  const url = getSuggestionAdapter(args.adapterKind)?.buildUrl?.(args.resourceId, suggestion.id);
124
124
  return url ? { url, label: "Open suggestion" } : null;
125
125
  },
126
+ mcpAnnotations: {
127
+ readOnlyHint: false,
128
+ destructiveHint: true,
129
+ openWorldHint: true,
130
+ idempotentHint: true,
131
+ },
126
132
  run: async (args, ctx) => {
127
133
  const access = await assertReviewableResourceAccess(args.resourceType, args.resourceId, ctx, "commenter");
128
134
  const adapter = getSuggestionAdapter(args.adapterKind);
@@ -239,6 +245,12 @@ export const updateResourceSuggestion = defineAction({
239
245
  .optional()
240
246
  .describe("Optional replacement summary; omission preserves the existing summary."),
241
247
  }),
248
+ mcpAnnotations: {
249
+ readOnlyHint: false,
250
+ destructiveHint: true,
251
+ openWorldHint: false,
252
+ idempotentHint: true,
253
+ },
242
254
  run: async (args, ctx) => {
243
255
  const initial = await getSuggestion(args.id);
244
256
  if (!initial)
@@ -387,6 +399,12 @@ export const decideResourceSuggestion = defineAction({
387
399
  observedBase: z.string().min(1),
388
400
  observedRevision: z.number().int().positive().optional(),
389
401
  }),
402
+ mcpAnnotations: {
403
+ readOnlyHint: false,
404
+ destructiveHint: true,
405
+ openWorldHint: false,
406
+ idempotentHint: true,
407
+ },
390
408
  run: async (args, ctx) => {
391
409
  const suggestion = await getSuggestion(args.id);
392
410
  if (!suggestion)
@@ -577,6 +595,12 @@ export const getResourceSuggestionProposalByCreationKey = defineAction({
577
595
  export const createResourceSuggestionProposal = defineAction({
578
596
  description: "Create or append independently reviewable suggestions under one durable proposal. Pass supersedes to replace your own earlier pending suggestions on the same resource in the same step.",
579
597
  schema: proposalCreationSchema,
598
+ mcpAnnotations: {
599
+ readOnlyHint: false,
600
+ destructiveHint: false,
601
+ openWorldHint: true,
602
+ idempotentHint: true,
603
+ },
580
604
  run: async (args, ctx) => {
581
605
  await assertReviewableResourceAccess(args.resourceType, args.resourceId, ctx, "commenter");
582
606
  const adapter = getSuggestionAdapter(args.adapterKind);
@@ -759,6 +783,12 @@ export const decideResourceSuggestionProposal = defineAction({
759
783
  }))
760
784
  .min(1),
761
785
  }),
786
+ mcpAnnotations: {
787
+ readOnlyHint: false,
788
+ destructiveHint: true,
789
+ openWorldHint: false,
790
+ idempotentHint: true,
791
+ },
762
792
  run: async (args, ctx) => {
763
793
  await ensureSuggestionTables();
764
794
  const db = getDbExec();
@@ -804,7 +834,7 @@ export const decideResourceSuggestionProposal = defineAction({
804
834
  const currentProposal = await getSuggestionProposal(tx, args.proposalId);
805
835
  if (!currentProposal)
806
836
  throw new Error("Proposal decision receipt references a missing proposal");
807
- const suggestions = await Promise.all(prior.suggestionIds.map((id) => getSuggestion(id, tx)));
837
+ const suggestions = await getSuggestions(prior.suggestionIds, tx);
808
838
  if (suggestions.some((suggestion) => !suggestion))
809
839
  throw new Error("Proposal decision receipt references a missing suggestion");
810
840
  return {
@@ -824,8 +854,9 @@ export const decideResourceSuggestionProposal = defineAction({
824
854
  if (prior)
825
855
  return replayDecision(tx, prior);
826
856
  const suggestions = [];
827
- for (const observed of members) {
828
- const current = await getSuggestion(observed.id, tx);
857
+ const loaded = await getSuggestions(members.map((member) => member.id), tx);
858
+ for (const [index, observed] of members.entries()) {
859
+ const current = loaded[index];
829
860
  if (!current ||
830
861
  current.proposalId !== proposal.id ||
831
862
  current.resourceType !== proposal.resourceType ||
@@ -842,6 +873,15 @@ export const decideResourceSuggestionProposal = defineAction({
842
873
  }
843
874
  suggestions.push(current);
844
875
  }
876
+ const staleProposal = (error) => {
877
+ if (error instanceof Error && error.name === "SuggestionStaleError") {
878
+ fail("A proposal member is stale; no proposal edits were applied", {
879
+ statusCode: 409,
880
+ errorCode: "suggestion_stale",
881
+ });
882
+ }
883
+ throw error;
884
+ };
845
885
  for (const suggestion of suggestions) {
846
886
  const updated = await updateSuggestionStatus(tx, suggestion.id, args.decision, suggestion.revision);
847
887
  if (!updated)
@@ -867,11 +907,7 @@ export const decideResourceSuggestionProposal = defineAction({
867
907
  });
868
908
  }
869
909
  catch (error) {
870
- if (error instanceof Error &&
871
- error.name === "SuggestionStaleError") {
872
- fail("A proposal member is stale; no proposal edits were applied", { statusCode: 409, errorCode: "suggestion_stale" });
873
- }
874
- throw error;
910
+ staleProposal(error);
875
911
  }
876
912
  }
877
913
  await resolveReviewThreadWithClient(tx, suggestion.threadId, reviewer, {
@@ -880,22 +916,25 @@ export const decideResourceSuggestionProposal = defineAction({
880
916
  }, args.decision);
881
917
  }
882
918
  if (args.decision === "accepted") {
883
- await adapter.finalizeProposalDecision?.({
884
- resourceType: proposal.resourceType,
885
- resourceId: proposal.resourceId,
886
- transaction: tx,
887
- coordination,
888
- });
919
+ try {
920
+ await adapter.finalizeProposalDecision?.({
921
+ resourceType: proposal.resourceType,
922
+ resourceId: proposal.resourceId,
923
+ transaction: tx,
924
+ coordination,
925
+ });
926
+ }
927
+ catch (error) {
928
+ staleProposal(error);
929
+ }
889
930
  }
890
931
  await recordProposalDecision(tx, args.idempotencyKey, proposal.id, reviewer, args.decision, request, suggestions.map((suggestion) => suggestion.id));
932
+ const decided = await getSuggestions(suggestions.map((suggestion) => suggestion.id), tx);
933
+ if (decided.some((suggestion) => !suggestion))
934
+ throw new Error("Decided suggestion disappeared");
891
935
  return {
892
936
  proposal: currentProposal,
893
- suggestions: await Promise.all(suggestions.map(async (suggestion) => {
894
- const latest = await getSuggestion(suggestion.id, tx);
895
- if (!latest)
896
- throw new Error("Decided suggestion disappeared");
897
- return latest;
898
- })),
937
+ suggestions: decided,
899
938
  };
900
939
  }).catch(async (error) => {
901
940
  const prior = await getProposalDecision(db, args.idempotencyKey);
@@ -22,6 +22,8 @@ export declare function getSuggestionAmendment(client: DbExec, key: string): Pro
22
22
  }>;
23
23
  export declare function amendSuggestion(client: DbExec, before: ResourceSuggestion, operations: SuggestionOperation[], summary: string, idempotencyKey: string, request: string): Promise<ResourceSuggestion | null>;
24
24
  export declare function getSuggestion(suggestionId: string, client?: DbExec): Promise<ResourceSuggestion | null>;
25
+ /** Loads several suggestions in two queries; missing ids come back as null. */
26
+ export declare function getSuggestions(suggestionIds: readonly string[], client?: DbExec): Promise<(ResourceSuggestion | null)[]>;
25
27
  export declare function listSuggestions(resourceType: string, resourceId: string, statuses?: readonly SuggestionStatus[], client?: DbExec): Promise<ResourceSuggestion[]>;
26
28
  export interface SuggestionDecisionRecord {
27
29
  id: string;
@@ -253,6 +253,34 @@ export async function getSuggestion(suggestionId, client = getDbExec()) {
253
253
  })).rows;
254
254
  return suggestionFromRows(row, rows);
255
255
  }
256
+ /** Loads several suggestions in two queries; missing ids come back as null. */
257
+ export async function getSuggestions(suggestionIds, client = getDbExec()) {
258
+ await ensureSuggestionTables(client);
259
+ if (suggestionIds.length === 0)
260
+ return [];
261
+ const placeholders = suggestionIds.map(() => "?").join(",");
262
+ const rows = (await client.execute({
263
+ sql: `SELECT s.*,p.summary AS proposal_summary FROM agent_review_suggestions s LEFT JOIN agent_review_suggestion_proposals p ON p.id = s.proposal_id WHERE s.id IN (${placeholders})`,
264
+ args: [...suggestionIds],
265
+ })).rows;
266
+ const operations = new Map();
267
+ for (const operation of (await client.execute({
268
+ sql: `SELECT * FROM agent_review_suggestion_operations WHERE suggestion_id IN (${placeholders}) ORDER BY suggestion_id,ordinal`,
269
+ args: [...suggestionIds],
270
+ })).rows) {
271
+ const id = String(operation.suggestion_id);
272
+ const list = operations.get(id);
273
+ if (list)
274
+ list.push(operation);
275
+ else
276
+ operations.set(id, [operation]);
277
+ }
278
+ const byId = new Map(rows.map((row) => [
279
+ String(row.id),
280
+ suggestionFromRows(row, operations.get(String(row.id)) ?? []),
281
+ ]));
282
+ return suggestionIds.map((id) => byId.get(id) ?? null);
283
+ }
256
284
  function suggestionFromRows(row, operationRows) {
257
285
  return {
258
286
  id: String(row.id),
@@ -29,6 +29,11 @@ export default defineAction({
29
29
  ? `Deleted organization key ${args.name}`
30
30
  : `Deleted personal key ${args.name}`,
31
31
  },
32
+ mcpAnnotations: {
33
+ readOnlyHint: false,
34
+ destructiveHint: true,
35
+ openWorldHint: false,
36
+ },
32
37
  // It creates, changes, or revokes a credential or who may use one: every
33
38
  // call needs the user's approval, and "always allow" is not offered.
34
39
  needsApproval: true,
@@ -65,31 +65,31 @@ export declare function createWriteSecretHandler(): import("h3").EventHandlerWit
65
65
  status?: undefined;
66
66
  ok?: undefined;
67
67
  } | {
68
- error?: undefined;
69
68
  errorCode?: undefined;
70
69
  ok: boolean;
71
70
  status: string;
71
+ error?: undefined;
72
72
  } | {
73
73
  error: string;
74
74
  removed?: undefined;
75
75
  ok?: undefined;
76
76
  } | {
77
- error?: undefined;
78
77
  ok: boolean;
79
78
  removed: boolean;
79
+ error?: undefined;
80
80
  }>>;
81
81
  export declare function createTestSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
82
82
  error: string;
83
83
  note?: undefined;
84
84
  ok?: undefined;
85
85
  } | {
86
- error?: undefined;
87
86
  ok: boolean;
88
87
  note?: undefined;
89
- } | {
90
88
  error?: undefined;
89
+ } | {
91
90
  ok: boolean;
92
91
  note: string;
92
+ error?: undefined;
93
93
  } | {
94
94
  note?: undefined;
95
95
  ok: boolean;
@@ -117,11 +117,11 @@ export declare function createAdHocSecretHandler(): import("h3").EventHandlerWit
117
117
  } | {
118
118
  error: string;
119
119
  } | {
120
- error?: undefined;
121
120
  ok: boolean;
122
121
  key: string;
123
- } | {
124
122
  error?: undefined;
123
+ } | {
125
124
  ok: boolean;
126
125
  removed: boolean;
126
+ error?: undefined;
127
127
  }>>;
@@ -498,7 +498,41 @@ export function createDataWidgetActionEntries() {
498
498
  },
499
499
  display: {
500
500
  type: "object",
501
- description: "Optional display metadata: title, description, primaryAction.",
501
+ description: "Optional display metadata: title, description, primaryAction, sources, and actions.",
502
+ properties: {
503
+ actions: {
504
+ type: "array",
505
+ items: {
506
+ oneOf: [
507
+ {
508
+ type: "object",
509
+ properties: {
510
+ id: { type: "string" },
511
+ type: { type: "string", enum: ["link"] },
512
+ label: { type: "string" },
513
+ href: { type: "string" },
514
+ icon: {
515
+ type: "string",
516
+ enum: ["explore", "camera", "notebook"],
517
+ },
518
+ presentation: { type: "string", enum: ["icon"] },
519
+ },
520
+ required: ["type", "label", "href"],
521
+ },
522
+ {
523
+ type: "object",
524
+ properties: {
525
+ id: { type: "string" },
526
+ type: { type: "string", enum: ["copy"] },
527
+ label: { type: "string" },
528
+ text: { type: "string" },
529
+ },
530
+ required: ["type", "label", "text"],
531
+ },
532
+ ],
533
+ },
534
+ },
535
+ },
502
536
  },
503
537
  table: {
504
538
  type: "object",
@@ -506,7 +540,7 @@ export function createDataWidgetActionEntries() {
506
540
  },
507
541
  chartSeries: {
508
542
  type: "object",
509
- description: "For data-chart/data-insights: { type: 'bar'|'line'|'area', title?, xKey, series: [{ key, label, color? }], data, sampled? }. Optional display controls include contentHeight from 1 to 1200 px, contentPadding from 0 to 64 px, labelFontFamily (sans, serif, mono), and label font sizes and weights; these apply only to chart rendering.",
543
+ description: "For data-chart/data-insights: { type: 'bar'|'line'|'area', title?, xKey, series: [{ key, label, color? }], data, sampled? }. Optional display controls include contentHeight from 1 to 1200 px, contentPadding from 0 to 64 px, labelFontFamily (sans, serif, mono), label font sizes and weights, valueAxisTickInterval, and horizontalCategoryGapRatio; these apply only to chart rendering.",
510
544
  properties: {
511
545
  contentHeight: {
512
546
  type: "number",
@@ -548,6 +582,33 @@ export function createDataWidgetActionEntries() {
548
582
  type: "number",
549
583
  enum: [400, 500],
550
584
  },
585
+ valueAxisTickInterval: {
586
+ type: "number",
587
+ minimum: 1e-12,
588
+ description: "Optional positive step for numeric value-axis labels and grid lines; it must produce between 1 and 100 ticks for the chart's value range.",
589
+ },
590
+ horizontalCategoryGapRatio: {
591
+ type: "number",
592
+ minimum: 0,
593
+ maximum: 0.9,
594
+ description: "Optional fraction of each horizontal-bar category slot left empty. Defaults to the existing spacing; use 0.08 for an 8% gap.",
595
+ },
596
+ actions: {
597
+ type: "array",
598
+ items: {
599
+ type: "object",
600
+ properties: {
601
+ label: { type: "string" },
602
+ href: { type: "string" },
603
+ icon: {
604
+ type: "string",
605
+ enum: ["explore", "camera", "notebook"],
606
+ },
607
+ presentation: { type: "string", enum: ["icon"] },
608
+ },
609
+ required: ["label", "href"],
610
+ },
611
+ },
551
612
  },
552
613
  },
553
614
  },
@@ -54,6 +54,8 @@ export declare function runPostAgentRunComplete(callback: AgentChatPluginOptions
54
54
  }): Promise<void>;
55
55
  export declare function runPreAgentTurnAutosave(callback: AgentChatPluginOptions["onAgentTurnStart"] | undefined, scope: AgentChatScope | null | undefined, run: Pick<ActiveRun, "threadId" | "runId">): Promise<void>;
56
56
  export { foldAgentChatRunCompletion };
57
+ export declare function assertAgentChatRunProjectionUpdated(updated: boolean, threadId: string, runId: string): void;
58
+ export declare function runAgentChatRunCompletionHooksAfterProjection(persistProjection: () => Promise<void>, runCompletionHooks: () => Promise<void>): Promise<void>;
57
59
  /**
58
60
  * The model this mount runs with, when the caller does not pass one per request.
59
61
  *