@agent-native/dispatch 0.2.9 → 0.2.11

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 (30) hide show
  1. package/dist/components/create-app-popover.d.ts.map +1 -1
  2. package/dist/components/create-app-popover.js +5 -1
  3. package/dist/components/create-app-popover.js.map +1 -1
  4. package/dist/components/layout/Layout.d.ts.map +1 -1
  5. package/dist/components/layout/Layout.js +1 -1
  6. package/dist/components/layout/Layout.js.map +1 -1
  7. package/dist/routes/pages/apps.$appId.js +1 -1
  8. package/dist/routes/pages/apps.$appId.js.map +1 -1
  9. package/dist/routes/pages/apps.js +1 -1
  10. package/dist/routes/pages/apps.js.map +1 -1
  11. package/dist/routes/pages/overview.d.ts.map +1 -1
  12. package/dist/routes/pages/overview.js +7 -7
  13. package/dist/routes/pages/overview.js.map +1 -1
  14. package/dist/server/lib/app-creation-store.d.ts.map +1 -1
  15. package/dist/server/lib/app-creation-store.js +34 -25
  16. package/dist/server/lib/app-creation-store.js.map +1 -1
  17. package/dist/server/plugins/agent-chat.d.ts.map +1 -1
  18. package/dist/server/plugins/agent-chat.js +1 -0
  19. package/dist/server/plugins/agent-chat.js.map +1 -1
  20. package/dist/server/plugins/integrations.js +1 -1
  21. package/dist/server/plugins/integrations.js.map +1 -1
  22. package/package.json +2 -3
  23. package/src/components/create-app-popover.tsx +5 -1
  24. package/src/components/layout/Layout.tsx +31 -21
  25. package/src/routes/pages/apps.$appId.tsx +1 -1
  26. package/src/routes/pages/apps.tsx +1 -1
  27. package/src/routes/pages/overview.tsx +22 -20
  28. package/src/server/lib/app-creation-store.ts +42 -28
  29. package/src/server/plugins/agent-chat.ts +1 -0
  30. package/src/server/plugins/integrations.ts +1 -1
@@ -482,6 +482,35 @@ function readWorkspaceAppsFromManifestFile(): WorkspaceAppSummary[] | null {
482
482
  return null;
483
483
  }
484
484
 
485
+ function readWorkspaceAppsFromFilesystem(
486
+ workspaceRoot: string,
487
+ ): WorkspaceAppSummary[] | null {
488
+ const appsDir = path.join(workspaceRoot, "apps");
489
+ if (!fs.existsSync(appsDir)) return null;
490
+
491
+ const apps = fs
492
+ .readdirSync(appsDir, { withFileTypes: true })
493
+ .filter((entry) => entry.isDirectory())
494
+ .map((entry): WorkspaceAppSummary | null => {
495
+ const appDir = path.join(appsDir, entry.name);
496
+ const pkg = readJson(path.join(appDir, "package.json"));
497
+ if (!pkg) return null;
498
+ return {
499
+ id: entry.name,
500
+ name: pkg.displayName || titleCase(entry.name),
501
+ description: pkg.description || "",
502
+ path: `/${entry.name}`,
503
+ url: workspaceAppUrl(`/${entry.name}`),
504
+ isDispatch: entry.name === "dispatch",
505
+ status: "ready",
506
+ } satisfies WorkspaceAppSummary;
507
+ })
508
+ .filter((app): app is WorkspaceAppSummary => !!app)
509
+ .sort(sortWorkspaceApps);
510
+
511
+ return apps.length ? apps : null;
512
+ }
513
+
485
514
  export function getEnvBuilderProjectId(): string | null {
486
515
  return (
487
516
  process.env.DISPATCH_BUILDER_PROJECT_ID ||
@@ -535,6 +564,18 @@ export function getWorkspaceInfo(): WorkspaceInfo {
535
564
  export async function listWorkspaceApps(
536
565
  options: ListWorkspaceAppsOptions = {},
537
566
  ): Promise<WorkspaceAppSummary[]> {
567
+ const workspaceRoot = findWorkspaceRoot();
568
+ const localFilesystemApps =
569
+ workspaceRoot && isLocalAppCreationRuntime()
570
+ ? readWorkspaceAppsFromFilesystem(workspaceRoot)
571
+ : null;
572
+ if (localFilesystemApps) {
573
+ return maybeIncludeAgentCards(
574
+ await appendPendingWorkspaceApps(localFilesystemApps),
575
+ options,
576
+ );
577
+ }
578
+
538
579
  const manifestApps =
539
580
  readWorkspaceAppsFromEnv() ?? readWorkspaceAppsFromManifestFile();
540
581
  if (manifestApps) {
@@ -544,7 +585,6 @@ export async function listWorkspaceApps(
544
585
  );
545
586
  }
546
587
 
547
- const workspaceRoot = findWorkspaceRoot();
548
588
  if (!workspaceRoot) {
549
589
  return maybeIncludeAgentCards(
550
590
  await appendPendingWorkspaceApps([
@@ -562,33 +602,7 @@ export async function listWorkspaceApps(
562
602
  );
563
603
  }
564
604
 
565
- const appsDir = path.join(workspaceRoot, "apps");
566
- if (!fs.existsSync(appsDir)) {
567
- return maybeIncludeAgentCards(
568
- await appendPendingWorkspaceApps([]),
569
- options,
570
- );
571
- }
572
-
573
- const apps = fs
574
- .readdirSync(appsDir, { withFileTypes: true })
575
- .filter((entry) => entry.isDirectory())
576
- .map((entry): WorkspaceAppSummary | null => {
577
- const appDir = path.join(appsDir, entry.name);
578
- const pkg = readJson(path.join(appDir, "package.json"));
579
- if (!pkg) return null;
580
- return {
581
- id: entry.name,
582
- name: pkg.displayName || titleCase(entry.name),
583
- description: pkg.description || "",
584
- path: `/${entry.name}`,
585
- url: workspaceAppUrl(`/${entry.name}`),
586
- isDispatch: entry.name === "dispatch",
587
- status: "ready",
588
- } satisfies WorkspaceAppSummary;
589
- })
590
- .filter((app): app is WorkspaceAppSummary => !!app)
591
- .sort(sortWorkspaceApps);
605
+ const apps = readWorkspaceAppsFromFilesystem(workspaceRoot) ?? [];
592
606
  return maybeIncludeAgentCards(
593
607
  await appendPendingWorkspaceApps(apps),
594
608
  options,
@@ -28,6 +28,7 @@ Use the standard workspace primitives:
28
28
  - Use recurring jobs for scheduled behavior.
29
29
  - Use custom agent profiles in agents/*.md for local spawned work and remote-agents/*.json for remote A2A apps.
30
30
  - When answering whether workspace apps expose agent cards or A2A endpoints, call list-workspace-apps with includeAgentCards=true. If you have not requested that probe, absence of agent-card fields means unchecked, not unavailable.
31
+ - When creating a new workspace app, create a separate app under apps/<app-id> with apps/<app-id>/package.json, mount it at /<app-id>, use relative /<app-id> links, never hardcode localhost or dev ports, use shadcn/ui with @tabler/icons-react rather than lucide-react, and ensure the React Router client entry preserves APP_BASE_PATH/VITE_APP_BASE_PATH via appBasePath(). There is no separate workspace app registry to edit.
31
32
 
32
33
  When a user asks for something like a digest, reminder, routing rule, or saved behavior:
33
34
  - First decide whether it should be a resource, a recurring job, a destination, or a delegated task.
@@ -21,7 +21,7 @@ When a user asks for something:
21
21
  - After call-agent returns an answer, RELAY IT DIRECTLY to the user with at most a one-line preface — do not rephrase, summarize, or add commentary. The downstream agent already crafted the answer; your job is delivery, not editing. This minimizes round-trips and keeps the user-visible reply fast.
22
22
  - Exception: if the downstream agent reports a missing model/provider credential, do not name exact env vars, Vault keys, tokens, or secrets. Say the target app needs an LLM connection and recommend connecting Builder/managed LLM for that app; keep bring-your-own provider keys as a secondary option only if the user asks.
23
23
  - If the user asks to create, build, make, scaffold, or generate an "agent" from Dispatch chat or by tagging @agent-native in Slack, email, or Telegram, first classify the ask. If it is a simple Dispatch-native behavior like a reminder, digest, monitor, routing rule, saved instruction, or recurring workflow, create or update the recurring job/resource/destination in Dispatch. If it is a robust unique product or teammate that needs its own UI, data model, actions, integrations, or domain workflow, treat it as a new workspace app and call start-workspace-app-creation.
24
- - If the user explicitly asks for a new app or workspace app, call start-workspace-app-creation with their prompt. Do not satisfy a new-app request by adding a route, page, component, or file inside apps/starter or another existing app unless the user explicitly asks to modify that existing app. If the request is too vague to classify, ask one concise follow-up. If the action returns mode "builder", reply with the Builder branch URL; Builder is responsible for creating the separate workspace app under apps/<app-id>, mounting it at /<app-id>, and making it appear in the workspace apps list. If it returns mode "local-agent", tell the user it is ready for the local code agent and include the returned app path/prompt summary. If it returns mode "coming-soon" or "builder-unavailable", explain the missing Builder setup and ask them to connect/configure Builder.
24
+ - If the user explicitly asks for a new app or workspace app, call start-workspace-app-creation with their prompt. Do not satisfy a new-app request by adding a route, page, component, or file inside apps/starter or another existing app unless the user explicitly asks to modify that existing app. If the request is too vague to classify, ask one concise follow-up. If the action returns mode "builder", reply with the Builder branch URL; Builder is responsible for creating the separate workspace app under apps/<app-id>, mounting it at /<app-id>, ensuring apps/<app-id>/package.json exists so Dispatch discovers it, using relative /<app-id> links instead of hardcoded localhost/dev ports, and preserving APP_BASE_PATH/VITE_APP_BASE_PATH via appBasePath() in the React Router client entry. There is no separate workspace app registry to edit. If it returns mode "local-agent", tell the user it is ready for the local code agent and include the returned app path/prompt summary. If it returns mode "coming-soon" or "builder-unavailable", explain the missing Builder setup and ask them to connect/configure Builder.
25
25
  - For digests, reminders, or saved behavior, prefer recurring jobs, resources, or destinations over chat replies.
26
26
  - Keep responses concise and operational — messaging platforms have character limits.
27
27
  - Use markdown sparingly (bold and lists are fine, avoid complex formatting).