@agent-native/dispatch 0.15.24 → 0.15.26

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 (68) hide show
  1. package/dist/actions/get-agent-thread-debug.d.ts +7 -1
  2. package/dist/actions/get-agent-thread-debug.js +16 -3
  3. package/dist/actions/get-agent-thread-debug.js.map +1 -1
  4. package/dist/actions/list-connected-agents.js +7 -3
  5. package/dist/actions/list-connected-agents.js.map +1 -1
  6. package/dist/actions/list-curated-workspace-templates.js +1 -1
  7. package/dist/actions/list-curated-workspace-templates.js.map +1 -1
  8. package/dist/actions/provider-api-register.d.ts +14 -14
  9. package/dist/actions/remix-workspace-template.js +5 -5
  10. package/dist/actions/remix-workspace-template.js.map +1 -1
  11. package/dist/actions/search-agent-threads.js +1 -1
  12. package/dist/actions/search-agent-threads.js.map +1 -1
  13. package/dist/actions/start-workspace-app-creation.js +1 -1
  14. package/dist/actions/start-workspace-app-creation.js.map +1 -1
  15. package/dist/components/create-app-popover.js +2 -2
  16. package/dist/components/create-app-popover.js.map +1 -1
  17. package/dist/components/dispatch-control-plane.d.ts.map +1 -1
  18. package/dist/components/dispatch-control-plane.js +13 -3
  19. package/dist/components/dispatch-control-plane.js.map +1 -1
  20. package/dist/components/workspace-app-card.d.ts.map +1 -1
  21. package/dist/components/workspace-app-card.js +35 -4
  22. package/dist/components/workspace-app-card.js.map +1 -1
  23. package/dist/components/workspace-template-card.js +4 -4
  24. package/dist/components/workspace-template-card.js.map +1 -1
  25. package/dist/lib/workspace-apps.d.ts +3 -0
  26. package/dist/lib/workspace-apps.d.ts.map +1 -1
  27. package/dist/lib/workspace-apps.js.map +1 -1
  28. package/dist/routes/pages/apps.d.ts.map +1 -1
  29. package/dist/routes/pages/apps.js +19 -4
  30. package/dist/routes/pages/apps.js.map +1 -1
  31. package/dist/routes/pages/thread-debug.d.ts.map +1 -1
  32. package/dist/routes/pages/thread-debug.js +25 -11
  33. package/dist/routes/pages/thread-debug.js.map +1 -1
  34. package/dist/server/lib/app-creation-store.d.ts +3 -0
  35. package/dist/server/lib/app-creation-store.d.ts.map +1 -1
  36. package/dist/server/lib/app-creation-store.js +54 -2
  37. package/dist/server/lib/app-creation-store.js.map +1 -1
  38. package/dist/server/lib/curated-workspace-templates.d.ts +1 -1
  39. package/dist/server/lib/curated-workspace-templates.js +2 -2
  40. package/dist/server/lib/curated-workspace-templates.js.map +1 -1
  41. package/dist/server/lib/thread-debug-store.d.ts +7 -1
  42. package/dist/server/lib/thread-debug-store.d.ts.map +1 -1
  43. package/dist/server/lib/thread-debug-store.js +43 -5
  44. package/dist/server/lib/thread-debug-store.js.map +1 -1
  45. package/dist/server/plugins/integrations.js +1 -1
  46. package/dist/server/plugins/integrations.js.map +1 -1
  47. package/package.json +3 -3
  48. package/src/actions/get-agent-thread-debug.ts +30 -15
  49. package/src/actions/list-connected-agents.ts +7 -2
  50. package/src/actions/list-curated-workspace-templates.ts +1 -1
  51. package/src/actions/remix-workspace-template.spec.ts +2 -2
  52. package/src/actions/remix-workspace-template.ts +5 -5
  53. package/src/actions/search-agent-threads.ts +1 -1
  54. package/src/actions/start-workspace-app-creation.ts +1 -1
  55. package/src/components/create-app-popover.tsx +2 -2
  56. package/src/components/dispatch-control-plane.tsx +70 -4
  57. package/src/components/workspace-app-card.spec.tsx +43 -0
  58. package/src/components/workspace-app-card.tsx +97 -1
  59. package/src/components/workspace-template-card.spec.tsx +4 -4
  60. package/src/components/workspace-template-card.tsx +4 -4
  61. package/src/lib/workspace-apps.ts +3 -0
  62. package/src/routes/pages/apps.tsx +84 -4
  63. package/src/routes/pages/thread-debug.tsx +34 -14
  64. package/src/server/lib/app-creation-store.ts +95 -2
  65. package/src/server/lib/curated-workspace-templates.ts +2 -2
  66. package/src/server/lib/thread-debug-store.spec.ts +82 -0
  67. package/src/server/lib/thread-debug-store.ts +62 -6
  68. package/src/server/plugins/integrations.ts +1 -1
@@ -1,6 +1,7 @@
1
1
  declare const _default: import("@agent-native/core").ActionDefinition<{
2
2
  sourceId?: string | undefined;
3
- threadId: string;
3
+ threadId?: string | undefined;
4
+ runId?: string | undefined;
4
5
  ownerEmail?: string | undefined;
5
6
  maxRuns?: unknown;
6
7
  maxEvents?: unknown;
@@ -26,6 +27,11 @@ declare const _default: import("@agent-native/core").ActionDefinition<{
26
27
  createdAt: number;
27
28
  updatedAt: number;
28
29
  };
30
+ lookup: {
31
+ requestedId: string;
32
+ threadId: string;
33
+ runId: string | null;
34
+ };
29
35
  messages: any;
30
36
  debug: any;
31
37
  debugRuns: any;
@@ -2,13 +2,23 @@ import { defineAction } from "@agent-native/core";
2
2
  import { z } from "zod";
3
3
  import { getAgentThreadDebug } from "../server/lib/thread-debug-store.js";
4
4
  export default defineAction({
5
- description: "Get a full read-only debug snapshot for an agent chat thread, including persisted messages, raw thread_data, run events, traces, feedback, evals, and checkpoints when present.",
6
- schema: z.object({
5
+ description: "Get a full read-only debug snapshot by chat thread ID or copied request/run ID, including persisted messages, raw thread_data, run events, traces, feedback, evals, and checkpoints when present.",
6
+ schema: z
7
+ .object({
7
8
  sourceId: z
8
9
  .string()
9
10
  .default("current")
10
11
  .describe("Thread debug source id from list-agent-thread-sources."),
11
- threadId: z.string().min(1).describe("Agent chat thread id to inspect."),
12
+ threadId: z
13
+ .string()
14
+ .min(1)
15
+ .optional()
16
+ .describe("Agent chat thread ID to inspect."),
17
+ runId: z
18
+ .string()
19
+ .min(1)
20
+ .optional()
21
+ .describe("Copied Agent Native request/run ID, usually shown as run-..., to resolve to its owning chat thread."),
12
22
  ownerEmail: z
13
23
  .string()
14
24
  .optional()
@@ -16,6 +26,9 @@ export default defineAction({
16
26
  maxRuns: z.coerce.number().int().min(1).max(50).default(20),
17
27
  maxEvents: z.coerce.number().int().min(1).max(2000).default(600),
18
28
  maxTraceSpans: z.coerce.number().int().min(1).max(2000).default(500),
29
+ })
30
+ .refine((input) => Boolean(input.threadId || input.runId), {
31
+ message: "Provide either threadId or runId.",
19
32
  }),
20
33
  http: { method: "GET" },
21
34
  readOnly: true,
@@ -1 +1 @@
1
- {"version":3,"file":"get-agent-thread-debug.js","sourceRoot":"","sources":["../../src/actions/get-agent-thread-debug.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAE1E,eAAe,YAAY,CAAC;IAC1B,WAAW,EACT,iLAAiL;IACnL,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,QAAQ,EAAE,CAAC;aACR,MAAM,EAAE;aACR,OAAO,CAAC,SAAS,CAAC;aAClB,QAAQ,CAAC,wDAAwD,CAAC;QACrE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,kCAAkC,CAAC;QACxE,UAAU,EAAE,CAAC;aACV,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,0DAA0D,CAAC;QACvE,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3D,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC;QAChE,aAAa,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC;KACrE,CAAC;IACF,IAAI,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;IACvB,QAAQ,EAAE,IAAI;IACd,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,mBAAmB,CAAC,KAAK,CAAC;CACjD,CAAC,CAAC","sourcesContent":["import { defineAction } from \"@agent-native/core\";\nimport { z } from \"zod\";\n\nimport { getAgentThreadDebug } from \"../server/lib/thread-debug-store.js\";\n\nexport default defineAction({\n description:\n \"Get a full read-only debug snapshot for an agent chat thread, including persisted messages, raw thread_data, run events, traces, feedback, evals, and checkpoints when present.\",\n schema: z.object({\n sourceId: z\n .string()\n .default(\"current\")\n .describe(\"Thread debug source id from list-agent-thread-sources.\"),\n threadId: z.string().min(1).describe(\"Agent chat thread id to inspect.\"),\n ownerEmail: z\n .string()\n .optional()\n .describe(\"Optional owner email scope for admin cross-user lookups.\"),\n maxRuns: z.coerce.number().int().min(1).max(50).default(20),\n maxEvents: z.coerce.number().int().min(1).max(2000).default(600),\n maxTraceSpans: z.coerce.number().int().min(1).max(2000).default(500),\n }),\n http: { method: \"GET\" },\n readOnly: true,\n run: async (input) => getAgentThreadDebug(input),\n});\n"]}
1
+ {"version":3,"file":"get-agent-thread-debug.js","sourceRoot":"","sources":["../../src/actions/get-agent-thread-debug.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAE1E,eAAe,YAAY,CAAC;IAC1B,WAAW,EACT,mMAAmM;IACrM,MAAM,EAAE,CAAC;SACN,MAAM,CAAC;QACN,QAAQ,EAAE,CAAC;aACR,MAAM,EAAE;aACR,OAAO,CAAC,SAAS,CAAC;aAClB,QAAQ,CAAC,wDAAwD,CAAC;QACrE,QAAQ,EAAE,CAAC;aACR,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,EAAE;aACV,QAAQ,CAAC,kCAAkC,CAAC;QAC/C,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,EAAE;aACV,QAAQ,CACP,qGAAqG,CACtG;QACH,UAAU,EAAE,CAAC;aACV,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,0DAA0D,CAAC;QACvE,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3D,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC;QAChE,aAAa,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC;KACrE,CAAC;SACD,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,KAAK,CAAC,EAAE;QACzD,OAAO,EAAE,mCAAmC;KAC7C,CAAC;IACJ,IAAI,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;IACvB,QAAQ,EAAE,IAAI;IACd,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,mBAAmB,CAAC,KAAK,CAAC;CACjD,CAAC,CAAC","sourcesContent":["import { defineAction } from \"@agent-native/core\";\nimport { z } from \"zod\";\n\nimport { getAgentThreadDebug } from \"../server/lib/thread-debug-store.js\";\n\nexport default defineAction({\n description:\n \"Get a full read-only debug snapshot by chat thread ID or copied request/run ID, including persisted messages, raw thread_data, run events, traces, feedback, evals, and checkpoints when present.\",\n schema: z\n .object({\n sourceId: z\n .string()\n .default(\"current\")\n .describe(\"Thread debug source id from list-agent-thread-sources.\"),\n threadId: z\n .string()\n .min(1)\n .optional()\n .describe(\"Agent chat thread ID to inspect.\"),\n runId: z\n .string()\n .min(1)\n .optional()\n .describe(\n \"Copied Agent Native request/run ID, usually shown as run-..., to resolve to its owning chat thread.\",\n ),\n ownerEmail: z\n .string()\n .optional()\n .describe(\"Optional owner email scope for admin cross-user lookups.\"),\n maxRuns: z.coerce.number().int().min(1).max(50).default(20),\n maxEvents: z.coerce.number().int().min(1).max(2000).default(600),\n maxTraceSpans: z.coerce.number().int().min(1).max(2000).default(500),\n })\n .refine((input) => Boolean(input.threadId || input.runId), {\n message: \"Provide either threadId or runId.\",\n }),\n http: { method: \"GET\" },\n readOnly: true,\n run: async (input) => getAgentThreadDebug(input),\n});\n"]}
@@ -2,7 +2,7 @@ import { defineAction } from "@agent-native/core";
2
2
  import { REMOTE_AGENT_RESOURCE_PREFIXES, parseRemoteAgentManifest, } from "@agent-native/core/resources/metadata";
3
3
  import { resourceGet, resourceListAccessible, SHARED_OWNER, } from "@agent-native/core/resources/store";
4
4
  import { getRequestUserEmail } from "@agent-native/core/server";
5
- import { discoverAgents, getBuiltinAgents, shouldIncludeRemoteAgentManifest, } from "@agent-native/core/server/agent-discovery";
5
+ import { discoverAgents, getBuiltinAgents, normalizeAgentId, shouldIncludeRemoteAgentManifest, } from "@agent-native/core/server/agent-discovery";
6
6
  import { z } from "zod";
7
7
  export default defineAction({
8
8
  description: "List agents available to dispatch for A2A delegation, including built-in apps and connected remote agents.",
@@ -34,9 +34,13 @@ export default defineAction({
34
34
  continue;
35
35
  if (!shouldIncludeRemoteAgentManifest(manifest, "dispatch"))
36
36
  continue;
37
- if (builtinIds.has(manifest.id))
37
+ // discoverAgents keys agents by the normalized id (image/images/asset
38
+ // all collapse to assets). Keying this map by the raw manifest id makes
39
+ // the id lookups below miss, so the same agent lands in the list twice.
40
+ const manifestId = normalizeAgentId(manifest.id);
41
+ if (builtinIds.has(manifestId))
38
42
  continue;
39
- customById.set(manifest.id, {
43
+ customById.set(manifestId, {
40
44
  resourceId: resource.id,
41
45
  path: resource.path,
42
46
  scope: resource.owner === SHARED_OWNER ? "shared" : "personal",
@@ -1 +1 @@
1
- {"version":3,"file":"list-connected-agents.js","sourceRoot":"","sources":["../../src/actions/list-connected-agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EACL,8BAA8B,EAC9B,wBAAwB,GACzB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,WAAW,EACX,sBAAsB,EACtB,YAAY,GACb,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,gCAAgC,GACjC,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAe,YAAY,CAAC;IAC1B,WAAW,EACT,4GAA4G;IAC9G,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IACpB,IAAI,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;IACvB,GAAG,EAAE,KAAK,IAAI,EAAE;QACd,MAAM,EAAE,cAAc,GAAG,EAAE,EAAE,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC,IAAI,CACrE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAC7B,CAAC;QACF,MAAM,UAAU,GAAG,MAAM,cAAc,CAAC,UAAU,CAAC,CAAC;QACpD,MAAM,UAAU,GAAG,IAAI,GAAG,CACxB,gBAAgB,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CACtD,CAAC;QACF,MAAM,UAAU,GAAG,mBAAmB,EAAE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C,IAAI;gBACjB,KAAK,EAAE,MAAM,CAAC,KAAK;aACpB,CAAC,CAAC;QACL,CAAC;QAED,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACjE,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { defineAction } from \"@agent-native/core\";\nimport {\n REMOTE_AGENT_RESOURCE_PREFIXES,\n parseRemoteAgentManifest,\n} from \"@agent-native/core/resources/metadata\";\nimport {\n resourceGet,\n resourceListAccessible,\n SHARED_OWNER,\n} from \"@agent-native/core/resources/store\";\nimport { getRequestUserEmail } from \"@agent-native/core/server\";\nimport {\n discoverAgents,\n getBuiltinAgents,\n shouldIncludeRemoteAgentManifest,\n} from \"@agent-native/core/server/agent-discovery\";\nimport { z } from \"zod\";\n\nexport default defineAction({\n description:\n \"List agents available to dispatch for A2A delegation, including built-in apps and connected remote agents.\",\n schema: z.object({}),\n http: { method: \"GET\" },\n run: async () => {\n const { hiddenAgentIds = [] } = await import(\"../server/index.js\").then(\n (m) => m.getDispatchConfig(),\n );\n const discovered = await discoverAgents(\"dispatch\");\n const builtinIds = new Set(\n getBuiltinAgents(\"dispatch\").map((agent) => agent.id),\n );\n const ownerEmail = getRequestUserEmail();\n if (!ownerEmail) throw new Error(\"no authenticated user\");\n const resources: Array<{ id: string; path: string; owner: string }> = [];\n for (const prefix of [...REMOTE_AGENT_RESOURCE_PREFIXES].reverse()) {\n resources.push(...(await resourceListAccessible(ownerEmail, prefix)));\n }\n const customById = new Map<\n string,\n {\n resourceId: string;\n path: string;\n scope: \"shared\" | \"personal\";\n name: string;\n description: string;\n url: string;\n color: string;\n }\n >();\n\n // Only treat a resource as a \"custom\" agent if its id is not a builtin.\n // Built-in agents may also be seeded as shared resources so the agent-chat\n // plugin can overlay them — those should still be reported as builtin.\n for (const resource of resources) {\n if (!resource.path.endsWith(\".json\")) continue;\n const full = await resourceGet(resource.id);\n if (!full) continue;\n const manifest = parseRemoteAgentManifest(full.content, resource.path);\n if (!manifest) continue;\n if (!shouldIncludeRemoteAgentManifest(manifest, \"dispatch\")) continue;\n if (builtinIds.has(manifest.id)) continue;\n customById.set(manifest.id, {\n resourceId: resource.id,\n path: resource.path,\n scope: resource.owner === SHARED_OWNER ? \"shared\" : \"personal\",\n name: manifest.name,\n description: manifest.description || \"\",\n url: manifest.url,\n color: manifest.color || \"#6B7280\",\n });\n }\n\n const connected = discovered.map((agent) => {\n const custom = customById.get(agent.id);\n const isBuiltin = builtinIds.has(agent.id);\n return {\n ...agent,\n source: isBuiltin ? \"builtin\" : custom ? \"custom\" : \"workspace\",\n resourceId: custom?.resourceId,\n path: custom?.path,\n scope: custom?.scope,\n };\n });\n\n const discoveredIds = new Set(connected.map((agent) => agent.id));\n for (const [id, custom] of customById) {\n if (discoveredIds.has(id)) continue;\n connected.push({\n id,\n name: custom.name,\n description: custom.description,\n url: custom.url,\n color: custom.color,\n source: \"custom\",\n resourceId: custom.resourceId,\n path: custom.path,\n scope: custom.scope,\n });\n }\n\n return connected.filter((a) => !hiddenAgentIds.includes(a.id));\n },\n});\n"]}
1
+ {"version":3,"file":"list-connected-agents.js","sourceRoot":"","sources":["../../src/actions/list-connected-agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EACL,8BAA8B,EAC9B,wBAAwB,GACzB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,WAAW,EACX,sBAAsB,EACtB,YAAY,GACb,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,gCAAgC,GACjC,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAe,YAAY,CAAC;IA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;gBAC9B,IAAI,EAAE,MAAM,EAAE,IAAI;gBAClB,KAAK,EAAE,MAAM,EAAE,KAAK;aACrB,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;QAClE,KAAK,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,UAAU,EAAE,CAAC;YACtC,IAAI,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC;gBAAE,SAAS;YACpC,SAAS,CAAC,IAAI,CAAC;gBACb,EAAE;gBACF,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,WAAW,EAAE,MAAM,CAAC,WAAW;gBAC/B,GAAG,EAAE,MAAM,CAAC,GAAG;gBACf,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,MAAM,EAAE,QAAQ;gBAChB,UAAU,EAAE,MAAM,CAAC,UAAU;gBAC7B,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,KAAK,EAAE,MAAM,CAAC,KAAK;aACpB,CAAC,CAAC;QACL,CAAC;QAED,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACjE,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { defineAction } from \"@agent-native/core\";\nimport {\n REMOTE_AGENT_RESOURCE_PREFIXES,\n parseRemoteAgentManifest,\n} from \"@agent-native/core/resources/metadata\";\nimport {\n resourceGet,\n resourceListAccessible,\n SHARED_OWNER,\n} from \"@agent-native/core/resources/store\";\nimport { getRequestUserEmail } from \"@agent-native/core/server\";\nimport {\n discoverAgents,\n getBuiltinAgents,\n normalizeAgentId,\n shouldIncludeRemoteAgentManifest,\n} from \"@agent-native/core/server/agent-discovery\";\nimport { z } from \"zod\";\n\nexport default defineAction({\n description:\n \"List agents available to dispatch for A2A delegation, including built-in apps and connected remote agents.\",\n schema: z.object({}),\n http: { method: \"GET\" },\n run: async () => {\n const { hiddenAgentIds = [] } = await import(\"../server/index.js\").then(\n (m) => m.getDispatchConfig(),\n );\n const discovered = await discoverAgents(\"dispatch\");\n const builtinIds = new Set(\n getBuiltinAgents(\"dispatch\").map((agent) => agent.id),\n );\n const ownerEmail = getRequestUserEmail();\n if (!ownerEmail) throw new Error(\"no authenticated user\");\n const resources: Array<{ id: string; path: string; owner: string }> = [];\n for (const prefix of [...REMOTE_AGENT_RESOURCE_PREFIXES].reverse()) {\n resources.push(...(await resourceListAccessible(ownerEmail, prefix)));\n }\n const customById = new Map<\n string,\n {\n resourceId: string;\n path: string;\n scope: \"shared\" | \"personal\";\n name: string;\n description: string;\n url: string;\n color: string;\n }\n >();\n\n // Only treat a resource as a \"custom\" agent if its id is not a builtin.\n // Built-in agents may also be seeded as shared resources so the agent-chat\n // plugin can overlay them — those should still be reported as builtin.\n for (const resource of resources) {\n if (!resource.path.endsWith(\".json\")) continue;\n const full = await resourceGet(resource.id);\n if (!full) continue;\n const manifest = parseRemoteAgentManifest(full.content, resource.path);\n if (!manifest) continue;\n if (!shouldIncludeRemoteAgentManifest(manifest, \"dispatch\")) continue;\n // discoverAgents keys agents by the normalized id (image/images/asset\n // all collapse to assets). Keying this map by the raw manifest id makes\n // the id lookups below miss, so the same agent lands in the list twice.\n const manifestId = normalizeAgentId(manifest.id);\n if (builtinIds.has(manifestId)) continue;\n customById.set(manifestId, {\n resourceId: resource.id,\n path: resource.path,\n scope: resource.owner === SHARED_OWNER ? \"shared\" : \"personal\",\n name: manifest.name,\n description: manifest.description || \"\",\n url: manifest.url,\n color: manifest.color || \"#6B7280\",\n });\n }\n\n const connected = discovered.map((agent) => {\n const custom = customById.get(agent.id);\n const isBuiltin = builtinIds.has(agent.id);\n return {\n ...agent,\n source: isBuiltin ? \"builtin\" : custom ? \"custom\" : \"workspace\",\n resourceId: custom?.resourceId,\n path: custom?.path,\n scope: custom?.scope,\n };\n });\n\n const discoveredIds = new Set(connected.map((agent) => agent.id));\n for (const [id, custom] of customById) {\n if (discoveredIds.has(id)) continue;\n connected.push({\n id,\n name: custom.name,\n description: custom.description,\n url: custom.url,\n color: custom.color,\n source: \"custom\",\n resourceId: custom.resourceId,\n path: custom.path,\n scope: custom.scope,\n });\n }\n\n return connected.filter((a) => !hiddenAgentIds.includes(a.id));\n },\n});\n"]}
@@ -2,7 +2,7 @@ import { defineAction } from "@agent-native/core";
2
2
  import { z } from "zod";
3
3
  import { listCuratedWorkspaceTemplates } from "../server/lib/curated-workspace-templates.js";
4
4
  export default defineAction({
5
- description: "List the curated first-party workspace templates available for private remixing. Returns stable template metadata, the product/live URL (not a public-demo claim), setup guidance, and whether each source template is already installed in the current workspace.",
5
+ description: "List the curated first-party workspace templates available for creating private apps. Returns stable template metadata, the product/live URL (not a public-demo claim), setup guidance, and whether each source template is already installed in the current workspace.",
6
6
  schema: z.object({}),
7
7
  http: { method: "GET" },
8
8
  run: async () => listCuratedWorkspaceTemplates(),
@@ -1 +1 @@
1
- {"version":3,"file":"list-curated-workspace-templates.js","sourceRoot":"","sources":["../../src/actions/list-curated-workspace-templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAE7F,eAAe,YAAY,CAAC;IAC1B,WAAW,EACT,oQAAoQ;IACtQ,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IACpB,IAAI,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;IACvB,GAAG,EAAE,KAAK,IAAI,EAAE,CAAC,6BAA6B,EAAE;CACjD,CAAC,CAAC","sourcesContent":["import { defineAction } from \"@agent-native/core\";\nimport { z } from \"zod\";\n\nimport { listCuratedWorkspaceTemplates } from \"../server/lib/curated-workspace-templates.js\";\n\nexport default defineAction({\n description:\n \"List the curated first-party workspace templates available for private remixing. Returns stable template metadata, the product/live URL (not a public-demo claim), setup guidance, and whether each source template is already installed in the current workspace.\",\n schema: z.object({}),\n http: { method: \"GET\" },\n run: async () => listCuratedWorkspaceTemplates(),\n});\n"]}
1
+ {"version":3,"file":"list-curated-workspace-templates.js","sourceRoot":"","sources":["../../src/actions/list-curated-workspace-templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAE7F,eAAe,YAAY,CAAC;IAC1B,WAAW,EACT,yQAAyQ;IAC3Q,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IACpB,IAAI,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;IACvB,GAAG,EAAE,KAAK,IAAI,EAAE,CAAC,6BAA6B,EAAE;CACjD,CAAC,CAAC","sourcesContent":["import { defineAction } from \"@agent-native/core\";\nimport { z } from \"zod\";\n\nimport { listCuratedWorkspaceTemplates } from \"../server/lib/curated-workspace-templates.js\";\n\nexport default defineAction({\n description:\n \"List the curated first-party workspace templates available for creating private apps. Returns stable template metadata, the product/live URL (not a public-demo claim), setup guidance, and whether each source template is already installed in the current workspace.\",\n schema: z.object({}),\n http: { method: \"GET\" },\n run: async () => listCuratedWorkspaceTemplates(),\n});\n"]}
@@ -48,8 +48,9 @@ declare const _default: import("node_modules/@agent-native/core/dist").ActionDef
48
48
  scope?: "org" | "user" | undefined;
49
49
  }, {
50
50
  id?: undefined;
51
- provider?: undefined;
52
51
  deleted?: undefined;
52
+ found?: undefined;
53
+ message?: undefined;
53
54
  providers: {
54
55
  id: string;
55
56
  label: string;
@@ -60,46 +61,45 @@ declare const _default: import("node_modules/@agent-native/core/dist").ActionDef
60
61
  updatedAt: number;
61
62
  }[];
62
63
  count: number;
63
- found?: undefined;
64
+ provider?: undefined;
64
65
  registered?: undefined;
65
66
  label?: undefined;
66
- message?: undefined;
67
67
  } | {
68
+ count?: undefined;
68
69
  id?: undefined;
69
70
  deleted?: undefined;
71
+ message?: undefined;
70
72
  providers?: undefined;
71
- count?: undefined;
72
73
  found: boolean;
73
74
  provider: import("node_modules/@agent-native/core/dist/provider-api").CustomProviderConfig;
74
75
  registered?: undefined;
75
76
  label?: undefined;
76
- message?: undefined;
77
77
  } | {
78
- provider?: undefined;
78
+ count?: undefined;
79
79
  deleted?: undefined;
80
+ message?: undefined;
80
81
  providers?: undefined;
81
- count?: undefined;
82
+ provider?: undefined;
82
83
  found: boolean;
83
84
  id: string;
84
85
  registered?: undefined;
85
86
  label?: undefined;
86
- message?: undefined;
87
87
  } | {
88
- provider?: undefined;
89
- providers?: undefined;
90
88
  count?: undefined;
91
89
  found?: undefined;
90
+ message?: undefined;
91
+ providers?: undefined;
92
+ provider?: undefined;
92
93
  deleted: boolean;
93
94
  id: string;
94
95
  registered?: undefined;
95
96
  label?: undefined;
96
- message?: undefined;
97
97
  } | {
98
- provider?: undefined;
99
- deleted?: undefined;
100
- providers?: undefined;
101
98
  count?: undefined;
99
+ deleted?: undefined;
102
100
  found?: undefined;
101
+ providers?: undefined;
102
+ provider?: undefined;
103
103
  registered: boolean;
104
104
  id: string;
105
105
  label: string;
@@ -6,11 +6,11 @@ import { getCuratedWorkspaceTemplate } from "../server/lib/curated-workspace-tem
6
6
  import { recordAudit } from "../server/lib/dispatch-store.js";
7
7
  function buildRemixPrompt(input) {
8
8
  return [
9
- "Create a private workspace remix of a curated first-party template.",
9
+ "Create a private workspace app from a curated first-party template.",
10
10
  `Source template: ${input.templateName} (${input.templateId}).`,
11
11
  "Recreate the source template's product shape and capabilities as an independent workspace app.",
12
12
  "Never copy source-app data, records, user content, secrets, credentials, tokens, API keys, or private configuration.",
13
- "Use empty or synthetic seed data only, keep the remix private to the current workspace, and do not create a public demo.",
13
+ "Use empty or synthetic seed data only, keep the new app private to the current workspace, and do not create a public demo.",
14
14
  `Setup note: ${input.setupNote}`,
15
15
  input.description?.trim()
16
16
  ? `Requested customization: ${input.description.trim()}`
@@ -18,7 +18,7 @@ function buildRemixPrompt(input) {
18
18
  ].join(" ");
19
19
  }
20
20
  export default defineAction({
21
- description: "Create a private, independent remix of one of Dispatch's curated first-party workspace templates. Valid templates are mail, calendar, analytics, slides, content, clips, brain, assets, forms, and design. The remix must not copy source-app data, secrets, credentials, or private configuration; local workspaces scaffold the template, while hosted workspaces start a Builder app-creation branch.",
21
+ description: "Create a private, independent app from one of Dispatch's curated first-party workspace templates. Valid templates are mail, calendar, analytics, slides, content, clips, brain, assets, forms, and design. The new app must not copy source-app data, secrets, credentials, or private configuration; local workspaces scaffold the template, while hosted workspaces start a Builder app-creation branch.",
22
22
  schema: z.object({
23
23
  templateId: z
24
24
  .string()
@@ -38,7 +38,7 @@ export default defineAction({
38
38
  .max(500)
39
39
  .optional()
40
40
  .nullable()
41
- .describe("Optional customization or purpose for the private remix."),
41
+ .describe("Optional customization or purpose for the private app."),
42
42
  }),
43
43
  run: async (input) => {
44
44
  const sourceTemplate = getCuratedWorkspaceTemplate(input.templateId);
@@ -63,7 +63,7 @@ export default defineAction({
63
63
  action: "workspace-app.remix-requested",
64
64
  targetType: "workspace-app",
65
65
  targetId: appId,
66
- summary: `Requested private remix of ${sourceTemplate.name}`,
66
+ summary: `Requested private app from ${sourceTemplate.name}`,
67
67
  metadata: {
68
68
  sourceTemplate: sourceTemplate.template,
69
69
  mode: result && typeof result === "object" && "mode" in result
@@ -1 +1 @@
1
- {"version":3,"file":"remix-workspace-template.js","sourceRoot":"","sources":["../../src/actions/remix-workspace-template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO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,CAAC","sourcesContent":["import { defineAction } from \"@agent-native/core\";\nimport { getWorkspaceAppIdValidationError } from \"@agent-native/core/shared\";\nimport { z } from \"zod\";\n\nimport {\n isLocalAppCreationRuntime,\n scaffoldWorkspaceAppFromTemplate,\n startWorkspaceAppCreation,\n} from \"../server/lib/app-creation-store.js\";\nimport { getCuratedWorkspaceTemplate } from \"../server/lib/curated-workspace-templates.js\";\nimport { recordAudit } from \"../server/lib/dispatch-store.js\";\n\nfunction buildRemixPrompt(input: {\n templateName: string;\n templateId: string;\n setupNote: string;\n description?: string | null;\n}): string {\n return [\n \"Create a private workspace remix of a curated first-party template.\",\n `Source template: ${input.templateName} (${input.templateId}).`,\n \"Recreate the source template's product shape and capabilities as an independent workspace app.\",\n \"Never copy source-app data, records, user content, secrets, credentials, tokens, API keys, or private configuration.\",\n \"Use empty or synthetic seed data only, keep the remix private to the current workspace, and do not create a public demo.\",\n `Setup note: ${input.setupNote}`,\n input.description?.trim()\n ? `Requested customization: ${input.description.trim()}`\n : \"Keep the first version close to the curated source template while preserving independent ownership.\",\n ].join(\" \");\n}\n\nexport default defineAction({\n description:\n \"Create a private, independent remix of one of Dispatch's curated first-party workspace templates. Valid templates are mail, calendar, analytics, slides, content, clips, brain, assets, forms, and design. The remix must not copy source-app data, secrets, credentials, or private configuration; local workspaces scaffold the template, while hosted workspaces start a Builder app-creation branch.\",\n schema: z.object({\n templateId: z\n .string()\n .min(1)\n .describe(\n \"Curated source template id: mail, calendar, analytics, slides, content, clips, brain, assets, forms, or design.\",\n ),\n appId: z\n .string()\n .max(64)\n .optional()\n .nullable()\n .refine((appId) => !appId || !getWorkspaceAppIdValidationError(appId), {\n message:\n \"Use a non-reserved app id with lowercase letters, numbers, and hyphens.\",\n })\n .describe(\n \"Optional target workspace app id. Defaults to <template>-remix so the source app remains independent.\",\n ),\n description: z\n .string()\n .max(500)\n .optional()\n .nullable()\n .describe(\"Optional customization or purpose for the private remix.\"),\n }),\n run: async (input) => {\n const sourceTemplate = getCuratedWorkspaceTemplate(input.templateId);\n const appId = input.appId?.trim() || `${sourceTemplate.template}-remix`;\n\n const result = isLocalAppCreationRuntime()\n ? await scaffoldWorkspaceAppFromTemplate({\n template: sourceTemplate.template,\n appId,\n })\n : await startWorkspaceAppCreation({\n prompt: buildRemixPrompt({\n templateName: sourceTemplate.name,\n templateId: sourceTemplate.template,\n setupNote: sourceTemplate.setupNote,\n description: input.description,\n }),\n appId,\n description: input.description,\n template: sourceTemplate.template,\n });\n\n await recordAudit({\n action: \"workspace-app.remix-requested\",\n targetType: \"workspace-app\",\n targetId: appId,\n summary: `Requested private remix of ${sourceTemplate.name}`,\n metadata: {\n sourceTemplate: sourceTemplate.template,\n mode:\n result && typeof result === \"object\" && \"mode\" in result\n ? result.mode\n : \"local\",\n descriptionConfigured: !!input.description?.trim(),\n },\n });\n\n return { ...result, sourceTemplate };\n },\n});\n"]}
1
+ {"version":3,"file":"remix-workspace-template.js","sourceRoot":"","sources":["../../src/actions/remix-workspace-template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,yBAAyB,EACzB,gCAAgC,EAChC,yBAAyB,GAC1B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAC3F,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,SAAS,gBAAgB,CAAC,KAKzB;IACC,OAAO;QACL,qEAAqE;QACrE,oBAAoB,KAAK,CAAC,YAAY,KAAK,KAAK,CAAC,UAAU,IAAI;QAC/D,gGAAgG;QAChG,sHAAsH;QACtH,4HAA4H;QAC5H,eAAe,KAAK,CAAC,SAAS,EAAE;QAChC,KAAK,CAAC,WAAW,EAAE,IAAI,EAAE;YACvB,CAAC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oBACjC,UAAU,EAAE,cAAc,CAAC,QAAQ;oBACnC,SAAS,EAAE,cAAc,CAAC,SAAS;oBACnC,WAAW,EAAE,KAAK,CAAC,WAAW;iBAC/B,CAAC;gBACF,KAAK;gBACL,WAAW,EAAE,KAAK,CAAC,WAAW;gBAC9B,QAAQ,EAAE,cAAc,CAAC,QAAQ;aAClC,CAAC,CAAC;QAEP,MAAM,WAAW,CAAC;YAChB,MAAM,EAAE,+BAA+B;YACvC,UAAU,EAAE,eAAe;YAC3B,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,8BAA8B,cAAc,CAAC,IAAI,EAAE;YAC5D,QAAQ,EAAE;gBACR,cAAc,EAAE,cAAc,CAAC,QAAQ;gBACvC,IAAI,EACF,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,IAAI,MAAM;oBACtD,CAAC,CAAC,MAAM,CAAC,IAAI;oBACb,CAAC,CAAC,OAAO;gBACb,qBAAqB,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,IAAI,EAAE;aACnD;SACF,CAAC,CAAC;QAEH,OAAO,EAAE,GAAG,MAAM,EAAE,cAAc,EAAE,CAAC;IACvC,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { defineAction } from \"@agent-native/core\";\nimport { getWorkspaceAppIdValidationError } from \"@agent-native/core/shared\";\nimport { z } from \"zod\";\n\nimport {\n isLocalAppCreationRuntime,\n scaffoldWorkspaceAppFromTemplate,\n startWorkspaceAppCreation,\n} from \"../server/lib/app-creation-store.js\";\nimport { getCuratedWorkspaceTemplate } from \"../server/lib/curated-workspace-templates.js\";\nimport { recordAudit } from \"../server/lib/dispatch-store.js\";\n\nfunction buildRemixPrompt(input: {\n templateName: string;\n templateId: string;\n setupNote: string;\n description?: string | null;\n}): string {\n return [\n \"Create a private workspace app from a curated first-party template.\",\n `Source template: ${input.templateName} (${input.templateId}).`,\n \"Recreate the source template's product shape and capabilities as an independent workspace app.\",\n \"Never copy source-app data, records, user content, secrets, credentials, tokens, API keys, or private configuration.\",\n \"Use empty or synthetic seed data only, keep the new app private to the current workspace, and do not create a public demo.\",\n `Setup note: ${input.setupNote}`,\n input.description?.trim()\n ? `Requested customization: ${input.description.trim()}`\n : \"Keep the first version close to the curated source template while preserving independent ownership.\",\n ].join(\" \");\n}\n\nexport default defineAction({\n description:\n \"Create a private, independent app from one of Dispatch's curated first-party workspace templates. Valid templates are mail, calendar, analytics, slides, content, clips, brain, assets, forms, and design. The new app must not copy source-app data, secrets, credentials, or private configuration; local workspaces scaffold the template, while hosted workspaces start a Builder app-creation branch.\",\n schema: z.object({\n templateId: z\n .string()\n .min(1)\n .describe(\n \"Curated source template id: mail, calendar, analytics, slides, content, clips, brain, assets, forms, or design.\",\n ),\n appId: z\n .string()\n .max(64)\n .optional()\n .nullable()\n .refine((appId) => !appId || !getWorkspaceAppIdValidationError(appId), {\n message:\n \"Use a non-reserved app id with lowercase letters, numbers, and hyphens.\",\n })\n .describe(\n \"Optional target workspace app id. Defaults to <template>-remix so the source app remains independent.\",\n ),\n description: z\n .string()\n .max(500)\n .optional()\n .nullable()\n .describe(\"Optional customization or purpose for the private app.\"),\n }),\n run: async (input) => {\n const sourceTemplate = getCuratedWorkspaceTemplate(input.templateId);\n const appId = input.appId?.trim() || `${sourceTemplate.template}-remix`;\n\n const result = isLocalAppCreationRuntime()\n ? await scaffoldWorkspaceAppFromTemplate({\n template: sourceTemplate.template,\n appId,\n })\n : await startWorkspaceAppCreation({\n prompt: buildRemixPrompt({\n templateName: sourceTemplate.name,\n templateId: sourceTemplate.template,\n setupNote: sourceTemplate.setupNote,\n description: input.description,\n }),\n appId,\n description: input.description,\n template: sourceTemplate.template,\n });\n\n await recordAudit({\n action: \"workspace-app.remix-requested\",\n targetType: \"workspace-app\",\n targetId: appId,\n summary: `Requested private app from ${sourceTemplate.name}`,\n metadata: {\n sourceTemplate: sourceTemplate.template,\n mode:\n result && typeof result === \"object\" && \"mode\" in result\n ? result.mode\n : \"local\",\n descriptionConfigured: !!input.description?.trim(),\n },\n });\n\n return { ...result, sourceTemplate };\n },\n});\n"]}
@@ -2,7 +2,7 @@ import { defineAction } from "@agent-native/core";
2
2
  import { z } from "zod";
3
3
  import { searchAgentThreads } from "../server/lib/thread-debug-store.js";
4
4
  export default defineAction({
5
- description: "Search agent chat threads by title, preview, or full persisted thread content. Non-admins are limited to their own current Dispatch DB threads.",
5
+ description: "Search agent chat threads by title, preview, full persisted thread content, or an exact request/run ID. Non-admins are limited to their own current Dispatch DB threads.",
6
6
  schema: z.object({
7
7
  sourceId: z
8
8
  .string()
@@ -1 +1 @@
1
- {"version":3,"file":"search-agent-threads.js","sourceRoot":"","sources":["../../src/actions/search-agent-threads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAEzE,eAAe,YAAY,CAAC;IAC1B,WAAW,EACT,iJAAiJ;IACnJ,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,QAAQ,EAAE,CAAC;aACR,MAAM,EAAE;aACR,OAAO,CAAC,SAAS,CAAC;aAClB,QAAQ,CAAC,wDAAwD,CAAC;QACrE,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,wEAAwE,CACzE;QACH,UAAU,EAAE,CAAC;aACV,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,6FAA6F,CAC9F;QACH,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;KAC3D,CAAC;IACF,IAAI,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;IACvB,QAAQ,EAAE,IAAI;IACd,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,kBAAkB,CAAC,KAAK,CAAC;CAChD,CAAC,CAAC","sourcesContent":["import { defineAction } from \"@agent-native/core\";\nimport { z } from \"zod\";\n\nimport { searchAgentThreads } from \"../server/lib/thread-debug-store.js\";\n\nexport default defineAction({\n description:\n \"Search agent chat threads by title, preview, or full persisted thread content. Non-admins are limited to their own current Dispatch DB threads.\",\n schema: z.object({\n sourceId: z\n .string()\n .default(\"current\")\n .describe(\"Thread debug source id from list-agent-thread-sources.\"),\n query: z\n .string()\n .optional()\n .describe(\n \"Full-text search term matched against title, preview, and thread data.\",\n ),\n ownerEmail: z\n .string()\n .optional()\n .describe(\n \"Optional owner email filter. Admins may pass '*' or omit to search the admin-visible scope.\",\n ),\n limit: z.coerce.number().int().min(1).max(100).default(25),\n }),\n http: { method: \"GET\" },\n readOnly: true,\n run: async (input) => searchAgentThreads(input),\n});\n"]}
1
+ {"version":3,"file":"search-agent-threads.js","sourceRoot":"","sources":["../../src/actions/search-agent-threads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAEzE,eAAe,YAAY,CAAC;IAC1B,WAAW,EACT,0KAA0K;IAC5K,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,QAAQ,EAAE,CAAC;aACR,MAAM,EAAE;aACR,OAAO,CAAC,SAAS,CAAC;aAClB,QAAQ,CAAC,wDAAwD,CAAC;QACrE,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,wEAAwE,CACzE;QACH,UAAU,EAAE,CAAC;aACV,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,6FAA6F,CAC9F;QACH,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;KAC3D,CAAC;IACF,IAAI,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;IACvB,QAAQ,EAAE,IAAI;IACd,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,kBAAkB,CAAC,KAAK,CAAC;CAChD,CAAC,CAAC","sourcesContent":["import { defineAction } from \"@agent-native/core\";\nimport { z } from \"zod\";\n\nimport { searchAgentThreads } from \"../server/lib/thread-debug-store.js\";\n\nexport default defineAction({\n description:\n \"Search agent chat threads by title, preview, full persisted thread content, or an exact request/run ID. Non-admins are limited to their own current Dispatch DB threads.\",\n schema: z.object({\n sourceId: z\n .string()\n .default(\"current\")\n .describe(\"Thread debug source id from list-agent-thread-sources.\"),\n query: z\n .string()\n .optional()\n .describe(\n \"Full-text search term matched against title, preview, and thread data.\",\n ),\n ownerEmail: z\n .string()\n .optional()\n .describe(\n \"Optional owner email filter. Admins may pass '*' or omit to search the admin-visible scope.\",\n ),\n limit: z.coerce.number().int().min(1).max(100).default(25),\n }),\n http: { method: \"GET\" },\n readOnly: true,\n run: async (input) => searchAgentThreads(input),\n});\n"]}
@@ -3,7 +3,7 @@ import { getWorkspaceAppIdValidationError } from "@agent-native/core/shared";
3
3
  import { z } from "zod";
4
4
  import { startWorkspaceAppCreation } from "../server/lib/app-creation-store.js";
5
5
  export default defineAction({
6
- description: 'Start creating a new workspace app from Dispatch when the request truly needs its own app. Callers should include a concise generated description by default; Dispatch generates one from the prompt when omitted. In local dev this returns a code-agent prompt; in production it creates a Builder branch only when a Builder branch project is configured. If the result mode is "coming-soon", the work still requires a code change but no Builder Cloud Agent can run here; tell the user to edit locally or use Builder.io to edit this code in the cloud and continue customizing the app any way they like, and do not send them to Builder org/beta settings. The result must be a separate workspace app under apps/<app-id>, not a new route or file in apps/chat. If chat is used as the source template, the finished app must be branded as the requested app and must not leave visible "Chat", "Starter", "Blank app", or "New app" UI behind. If the request needs Mail, Calendar, Analytics, Brain, Assets, or another first-party app, use the existing hosted/connected app via links or A2A; do not clone, wrap, or nest those templates inside the new app unless the user explicitly asks for a customized copy.',
6
+ description: 'Start creating a new workspace app from Dispatch when the request truly needs its own app. Callers should include a concise generated description by default; Dispatch generates one from the prompt when omitted. In local dev this returns a code-agent prompt; in production it creates a Builder branch only when a Builder branch project is configured. If the result mode is "coming-soon", the work still requires a code change but no Builder Cloud Agent can run here; tell the user to edit locally or use Builder.io to edit this code in the cloud and continue customizing the app any way they like, and do not send them to Builder org/beta settings. The result must be a separate workspace app under apps/<app-id>, not a new route or file in apps/chat. If chat is used as the source template, the finished app must be branded as the requested app and must not leave visible "Chat", "Starter", "Blank app", or "New app" UI behind. If the request needs Mail, Calendar, Analytics, Brain, Assets, or another first-party app, use the existing hosted/connected app via links or A2A; do not wrap or nest those apps inside the new app unless the user explicitly asks for a customized app from that template.',
7
7
  schema: z.object({
8
8
  prompt: z.string().min(1).describe("The user's app creation request"),
9
9
  appId: z
@@ -1 +1 @@
1
- {"version":3,"file":"start-workspace-app-creation.js","sourceRoot":"","sources":["../../src/actions/start-workspace-app-creation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAEhF,eAAe,YAAY,CAAC;IAC1B,WAAW,EACT,0qCAA0qC;IAC5qC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,iCAAiC,CAAC;QACrE,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,GAAG,CAAC,EAAE,CAAC;aACP,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,gCAAgC,CAAC,KAAK,CAAC,EAAE;YAC3D,OAAO,EACL,yEAAyE;SAC5E,CAAC;aACD,QAAQ,EAAE;aACV,QAAQ,EAAE;aACV,QAAQ,CAAC,+BAA+B,CAAC;QAC5C,QAAQ,EAAE,CAAC;aACR,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,EAAE;aACV,QAAQ,CAAC,wBAAwB,CAAC;QACrC,WAAW,EAAE,CAAC;aACX,MAAM,EAAE;aACR,GAAG,CAAC,GAAG,CAAC;aACR,QAAQ,EAAE;aACV,QAAQ,EAAE;aACV,QAAQ,CACP,6HAA6H,CAC9H;QACH,SAAS,EAAE,CAAC;aACT,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;aACjB,GAAG,CAAC,GAAG,CAAC;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,+CAA+C,CAAC;QAC5D,WAAW,EAAE,CAAC;aACX,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;aACjB,GAAG,CAAC,GAAG,CAAC;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,wEAAwE,CACzE;KACJ,CAAC;IACF,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,yBAAyB,CAAC,IAAI,CAAC;CACrD,CAAC,CAAC","sourcesContent":["import { defineAction } from \"@agent-native/core\";\nimport { getWorkspaceAppIdValidationError } from \"@agent-native/core/shared\";\nimport { z } from \"zod\";\n\nimport { startWorkspaceAppCreation } from \"../server/lib/app-creation-store.js\";\n\nexport default defineAction({\n description:\n 'Start creating a new workspace app from Dispatch when the request truly needs its own app. Callers should include a concise generated description by default; Dispatch generates one from the prompt when omitted. In local dev this returns a code-agent prompt; in production it creates a Builder branch only when a Builder branch project is configured. If the result mode is \"coming-soon\", the work still requires a code change but no Builder Cloud Agent can run here; tell the user to edit locally or use Builder.io to edit this code in the cloud and continue customizing the app any way they like, and do not send them to Builder org/beta settings. The result must be a separate workspace app under apps/<app-id>, not a new route or file in apps/chat. If chat is used as the source template, the finished app must be branded as the requested app and must not leave visible \"Chat\", \"Starter\", \"Blank app\", or \"New app\" UI behind. If the request needs Mail, Calendar, Analytics, Brain, Assets, or another first-party app, use the existing hosted/connected app via links or A2A; do not clone, wrap, or nest those templates inside the new app unless the user explicitly asks for a customized copy.',\n schema: z.object({\n prompt: z.string().min(1).describe(\"The user's app creation request\"),\n appId: z\n .string()\n .max(64)\n .refine((appId) => !getWorkspaceAppIdValidationError(appId), {\n message:\n \"Use a non-reserved app id with lowercase letters, numbers, and hyphens.\",\n })\n .optional()\n .nullable()\n .describe(\"Desired workspace app id/path\"),\n template: z\n .string()\n .optional()\n .nullable()\n .describe(\"Template to start from\"),\n description: z\n .string()\n .max(500)\n .optional()\n .nullable()\n .describe(\n \"Concise AI-generated description of the app based on the user's prompt. Dispatch saves this while the app is being created.\",\n ),\n secretIds: z\n .array(z.string())\n .max(100)\n .optional()\n .describe(\"Dispatch vault secret IDs to grant to the app\"),\n resourceIds: z\n .array(z.string())\n .max(100)\n .optional()\n .describe(\n \"Dispatch workspace resource IDs or knowledge packs to grant to the app\",\n ),\n }),\n run: async (args) => startWorkspaceAppCreation(args),\n});\n"]}
1
+ {"version":3,"file":"start-workspace-app-creation.js","sourceRoot":"","sources":["../../src/actions/start-workspace-app-creation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAEhF,eAAe,YAAY,CAAC;IAC1B,WAAW,EACT,+qCAA+qC;IACjrC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,iCAAiC,CAAC;QACrE,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,GAAG,CAAC,EAAE,CAAC;aACP,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,gCAAgC,CAAC,KAAK,CAAC,EAAE;YAC3D,OAAO,EACL,yEAAyE;SAC5E,CAAC;aACD,QAAQ,EAAE;aACV,QAAQ,EAAE;aACV,QAAQ,CAAC,+BAA+B,CAAC;QAC5C,QAAQ,EAAE,CAAC;aACR,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,EAAE;aACV,QAAQ,CAAC,wBAAwB,CAAC;QACrC,WAAW,EAAE,CAAC;aACX,MAAM,EAAE;aACR,GAAG,CAAC,GAAG,CAAC;aACR,QAAQ,EAAE;aACV,QAAQ,EAAE;aACV,QAAQ,CACP,6HAA6H,CAC9H;QACH,SAAS,EAAE,CAAC;aACT,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;aACjB,GAAG,CAAC,GAAG,CAAC;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,+CAA+C,CAAC;QAC5D,WAAW,EAAE,CAAC;aACX,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;aACjB,GAAG,CAAC,GAAG,CAAC;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,wEAAwE,CACzE;KACJ,CAAC;IACF,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,yBAAyB,CAAC,IAAI,CAAC;CACrD,CAAC,CAAC","sourcesContent":["import { defineAction } from \"@agent-native/core\";\nimport { getWorkspaceAppIdValidationError } from \"@agent-native/core/shared\";\nimport { z } from \"zod\";\n\nimport { startWorkspaceAppCreation } from \"../server/lib/app-creation-store.js\";\n\nexport default defineAction({\n description:\n 'Start creating a new workspace app from Dispatch when the request truly needs its own app. Callers should include a concise generated description by default; Dispatch generates one from the prompt when omitted. In local dev this returns a code-agent prompt; in production it creates a Builder branch only when a Builder branch project is configured. If the result mode is \"coming-soon\", the work still requires a code change but no Builder Cloud Agent can run here; tell the user to edit locally or use Builder.io to edit this code in the cloud and continue customizing the app any way they like, and do not send them to Builder org/beta settings. The result must be a separate workspace app under apps/<app-id>, not a new route or file in apps/chat. If chat is used as the source template, the finished app must be branded as the requested app and must not leave visible \"Chat\", \"Starter\", \"Blank app\", or \"New app\" UI behind. If the request needs Mail, Calendar, Analytics, Brain, Assets, or another first-party app, use the existing hosted/connected app via links or A2A; do not wrap or nest those apps inside the new app unless the user explicitly asks for a customized app from that template.',\n schema: z.object({\n prompt: z.string().min(1).describe(\"The user's app creation request\"),\n appId: z\n .string()\n .max(64)\n .refine((appId) => !getWorkspaceAppIdValidationError(appId), {\n message:\n \"Use a non-reserved app id with lowercase letters, numbers, and hyphens.\",\n })\n .optional()\n .nullable()\n .describe(\"Desired workspace app id/path\"),\n template: z\n .string()\n .optional()\n .nullable()\n .describe(\"Template to start from\"),\n description: z\n .string()\n .max(500)\n .optional()\n .nullable()\n .describe(\n \"Concise AI-generated description of the app based on the user's prompt. Dispatch saves this while the app is being created.\",\n ),\n secretIds: z\n .array(z.string())\n .max(100)\n .optional()\n .describe(\"Dispatch vault secret IDs to grant to the app\"),\n resourceIds: z\n .array(z.string())\n .max(100)\n .optional()\n .describe(\n \"Dispatch workspace resource IDs or knowledge packs to grant to the app\",\n ),\n }),\n run: async (args) => startWorkspaceAppCreation(args),\n});\n"]}
@@ -57,8 +57,8 @@ function buildAppCreationPrompt(input) {
57
57
  `Use relative workspace links like /${input.appId}. Do not hardcode localhost, 127.0.0.1, 8080, 8100, or any dev port; the active workspace gateway/browser origin owns the port.`,
58
58
  `Use the framework/template UI stack: shadcn/ui components and @tabler/icons-react. Do not add lucide-react or another icon library for standard UI.`,
59
59
  `Existing first-party apps are neighbors, not implementation details for this app. If the user's prompt mentions Mail, Calendar, Analytics, Brain, Assets, Dispatch, or other templates, treat them as existing hosted/connected apps that this app can link to or call through A2A/default connected agents. For example, Mail, Calendar, Analytics, Brain, and Assets already exist at https://mail.agent-native.com, https://calendar.agent-native.com, https://analytics.agent-native.com, https://brain.agent-native.com, and https://assets.agent-native.com.`,
60
- `Do not clone first-party templates, create wrapper apps, or scaffold child apps/routes for Mail, Calendar, Analytics, Brain, Assets, etc. inside apps/${input.appId} just so this app can access them. If the request is a cross-app dashboard or overview, build only the new dashboard/overview app and delegate to the existing apps for domain work.`,
61
- `Only create another first-party app copy when the user explicitly asks for a customized fork/copy of that app; otherwise keep using the hosted/shared app so improvements to the base template keep flowing to users.`,
60
+ `Do not create wrapper apps or scaffold child apps/routes for Mail, Calendar, Analytics, Brain, Assets, etc. inside apps/${input.appId} just so this app can access them. If the request is a cross-app dashboard or overview, build only the new dashboard/overview app and delegate to the existing apps for domain work.`,
61
+ `Only create another first-party app when the user explicitly asks for a customized app from that template; otherwise keep using the hosted/shared app so improvements to the base app keep flowing to users.`,
62
62
  `Do not satisfy this by adding a route, page, component, or file inside apps/chat or another existing app unless the user explicitly asks to modify that existing app.`,
63
63
  input.vaultAccessMode === "all-apps"
64
64
  ? `Do not create per-app Dispatch vault grants unless the workspace switches vault access to manual or the user explicitly asks for manual grants.`