@agent-native/dispatch 0.6.1 → 0.8.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.
- package/README.md +38 -1
- package/dist/actions/apply-dream-proposal.d.ts +3 -0
- package/dist/actions/apply-dream-proposal.d.ts.map +1 -0
- package/dist/actions/apply-dream-proposal.js +11 -0
- package/dist/actions/apply-dream-proposal.js.map +1 -0
- package/dist/actions/create-dream-report.d.ts +3 -0
- package/dist/actions/create-dream-report.d.ts.map +1 -0
- package/dist/actions/create-dream-report.js +67 -0
- package/dist/actions/create-dream-report.js.map +1 -0
- package/dist/actions/create-pylon-ticket.d.ts +3 -0
- package/dist/actions/create-pylon-ticket.d.ts.map +1 -0
- package/dist/actions/create-pylon-ticket.js +94 -0
- package/dist/actions/create-pylon-ticket.js.map +1 -0
- package/dist/actions/create-vault-grant.js +1 -1
- package/dist/actions/create-vault-grant.js.map +1 -1
- package/dist/actions/create-vault-secret.d.ts.map +1 -1
- package/dist/actions/create-vault-secret.js +4 -3
- package/dist/actions/create-vault-secret.js.map +1 -1
- package/dist/actions/create-workspace-resource.js +3 -3
- package/dist/actions/create-workspace-resource.js.map +1 -1
- package/dist/actions/delete-workspace-resource.js +1 -1
- package/dist/actions/delete-workspace-resource.js.map +1 -1
- package/dist/actions/ensure-dream-job.d.ts +3 -0
- package/dist/actions/ensure-dream-job.d.ts.map +1 -0
- package/dist/actions/ensure-dream-job.js +73 -0
- package/dist/actions/ensure-dream-job.js.map +1 -0
- package/dist/actions/get-dream-settings.d.ts +3 -0
- package/dist/actions/get-dream-settings.d.ts.map +1 -0
- package/dist/actions/get-dream-settings.js +11 -0
- package/dist/actions/get-dream-settings.js.map +1 -0
- package/dist/actions/get-dream.d.ts +3 -0
- package/dist/actions/get-dream.d.ts.map +1 -0
- package/dist/actions/get-dream.js +13 -0
- package/dist/actions/get-dream.js.map +1 -0
- package/dist/actions/get-vault-access-settings.d.ts +3 -0
- package/dist/actions/get-vault-access-settings.d.ts.map +1 -0
- package/dist/actions/get-vault-access-settings.js +10 -0
- package/dist/actions/get-vault-access-settings.js.map +1 -0
- package/dist/actions/get-workspace-resource-effective-context.d.ts +3 -0
- package/dist/actions/get-workspace-resource-effective-context.d.ts.map +1 -0
- package/dist/actions/get-workspace-resource-effective-context.js +27 -0
- package/dist/actions/get-workspace-resource-effective-context.js.map +1 -0
- package/dist/actions/grant-vault-secrets-to-app.js +1 -1
- package/dist/actions/grant-vault-secrets-to-app.js.map +1 -1
- package/dist/actions/index.d.ts.map +1 -1
- package/dist/actions/index.js +38 -4
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/list-dream-candidates.d.ts +3 -0
- package/dist/actions/list-dream-candidates.d.ts.map +1 -0
- package/dist/actions/list-dream-candidates.js +68 -0
- package/dist/actions/list-dream-candidates.js.map +1 -0
- package/dist/actions/list-dreams.d.ts +3 -0
- package/dist/actions/list-dreams.d.ts.map +1 -0
- package/dist/actions/list-dreams.js +17 -0
- package/dist/actions/list-dreams.js.map +1 -0
- package/dist/actions/list-integrations-catalog.js +1 -1
- package/dist/actions/list-integrations-catalog.js.map +1 -1
- package/dist/actions/list-vault-grants.js +1 -1
- package/dist/actions/list-vault-grants.js.map +1 -1
- package/dist/actions/list-workspace-apps.d.ts.map +1 -1
- package/dist/actions/list-workspace-apps.js +5 -1
- package/dist/actions/list-workspace-apps.js.map +1 -1
- package/dist/actions/list-workspace-resources-for-app.d.ts +3 -0
- package/dist/actions/list-workspace-resources-for-app.d.ts.map +1 -0
- package/dist/actions/list-workspace-resources-for-app.js +12 -0
- package/dist/actions/list-workspace-resources-for-app.js.map +1 -0
- package/dist/actions/list-workspace-resources.js +1 -1
- package/dist/actions/list-workspace-resources.js.map +1 -1
- package/dist/actions/navigate.d.ts +1 -0
- package/dist/actions/navigate.d.ts.map +1 -1
- package/dist/actions/navigate.js +2 -1
- package/dist/actions/navigate.js.map +1 -1
- package/dist/actions/preview-dream-proposal.d.ts +3 -0
- package/dist/actions/preview-dream-proposal.d.ts.map +1 -0
- package/dist/actions/preview-dream-proposal.js +13 -0
- package/dist/actions/preview-dream-proposal.js.map +1 -0
- package/dist/actions/preview-workspace-resource-change.d.ts +3 -0
- package/dist/actions/preview-workspace-resource-change.d.ts.map +1 -0
- package/dist/actions/preview-workspace-resource-change.js +24 -0
- package/dist/actions/preview-workspace-resource-change.js.map +1 -0
- package/dist/actions/reject-dream-proposal.d.ts +3 -0
- package/dist/actions/reject-dream-proposal.d.ts.map +1 -0
- package/dist/actions/reject-dream-proposal.js +12 -0
- package/dist/actions/reject-dream-proposal.js.map +1 -0
- package/dist/actions/restore-starter-workspace-resources.d.ts +3 -0
- package/dist/actions/restore-starter-workspace-resources.d.ts.map +1 -0
- package/dist/actions/restore-starter-workspace-resources.js +14 -0
- package/dist/actions/restore-starter-workspace-resources.js.map +1 -0
- package/dist/actions/send-code-agent-remote-command.d.ts +3 -0
- package/dist/actions/send-code-agent-remote-command.d.ts.map +1 -0
- package/dist/actions/send-code-agent-remote-command.js +53 -0
- package/dist/actions/send-code-agent-remote-command.js.map +1 -0
- package/dist/actions/set-dream-settings.d.ts +3 -0
- package/dist/actions/set-dream-settings.d.ts.map +1 -0
- package/dist/actions/set-dream-settings.js +41 -0
- package/dist/actions/set-dream-settings.js.map +1 -0
- package/dist/actions/set-vault-access-settings.d.ts +3 -0
- package/dist/actions/set-vault-access-settings.d.ts.map +1 -0
- package/dist/actions/set-vault-access-settings.js +13 -0
- package/dist/actions/set-vault-access-settings.js.map +1 -0
- package/dist/actions/start-workspace-app-creation.d.ts.map +1 -1
- package/dist/actions/start-workspace-app-creation.js +6 -0
- package/dist/actions/start-workspace-app-creation.js.map +1 -1
- package/dist/actions/sync-vault-to-app.js +1 -1
- package/dist/actions/sync-vault-to-app.js.map +1 -1
- package/dist/actions/update-workspace-app-metadata.d.ts +3 -0
- package/dist/actions/update-workspace-app-metadata.d.ts.map +1 -0
- package/dist/actions/update-workspace-app-metadata.js +30 -0
- package/dist/actions/update-workspace-app-metadata.js.map +1 -0
- package/dist/actions/update-workspace-resource.js +1 -1
- package/dist/actions/update-workspace-resource.js.map +1 -1
- package/dist/actions/view-screen.d.ts.map +1 -1
- package/dist/actions/view-screen.js +77 -4
- package/dist/actions/view-screen.js.map +1 -1
- package/dist/components/app-keys-popover.js +16 -5
- package/dist/components/app-keys-popover.js.map +1 -1
- package/dist/components/approval-value-block.d.ts +7 -0
- package/dist/components/approval-value-block.d.ts.map +1 -0
- package/dist/components/approval-value-block.js +22 -0
- package/dist/components/approval-value-block.js.map +1 -0
- package/dist/components/create-app-popover.d.ts.map +1 -1
- package/dist/components/create-app-popover.js +41 -16
- package/dist/components/create-app-popover.js.map +1 -1
- package/dist/components/dispatch-shell.d.ts +4 -4
- package/dist/components/dispatch-shell.d.ts.map +1 -1
- package/dist/components/dispatch-shell.js +6 -6
- package/dist/components/dispatch-shell.js.map +1 -1
- package/dist/components/layout/Layout.d.ts.map +1 -1
- package/dist/components/layout/Layout.js +18 -4
- package/dist/components/layout/Layout.js.map +1 -1
- package/dist/components/messaging-setup-panel.d.ts.map +1 -1
- package/dist/components/messaging-setup-panel.js +2 -2
- package/dist/components/messaging-setup-panel.js.map +1 -1
- package/dist/components/ui/chart.d.ts +1 -1
- package/dist/components/workspace-app-card.d.ts.map +1 -1
- package/dist/components/workspace-app-card.js +63 -3
- package/dist/components/workspace-app-card.js.map +1 -1
- package/dist/components/workspace-resource-effective-stack.d.ts +11 -0
- package/dist/components/workspace-resource-effective-stack.d.ts.map +1 -0
- package/dist/components/workspace-resource-effective-stack.js +59 -0
- package/dist/components/workspace-resource-effective-stack.js.map +1 -0
- package/dist/components/workspace-resource-impact-preview.d.ts +9 -0
- package/dist/components/workspace-resource-impact-preview.d.ts.map +1 -0
- package/dist/components/workspace-resource-impact-preview.js +39 -0
- package/dist/components/workspace-resource-impact-preview.js.map +1 -0
- package/dist/db/migrations.d.ts.map +1 -1
- package/dist/db/migrations.js +59 -0
- package/dist/db/migrations.js.map +1 -1
- package/dist/db/schema.d.ts +714 -0
- package/dist/db/schema.d.ts.map +1 -1
- package/dist/db/schema.js +44 -2
- package/dist/db/schema.js.map +1 -1
- package/dist/hooks/use-navigation-state.d.ts +3 -0
- package/dist/hooks/use-navigation-state.d.ts.map +1 -1
- package/dist/hooks/use-navigation-state.js +35 -8
- package/dist/hooks/use-navigation-state.js.map +1 -1
- package/dist/lib/catch-all-target.d.ts +2 -0
- package/dist/lib/catch-all-target.d.ts.map +1 -0
- package/dist/lib/catch-all-target.js +95 -0
- package/dist/lib/catch-all-target.js.map +1 -0
- package/dist/lib/utils.d.ts +2 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +5 -1
- package/dist/lib/utils.js.map +1 -1
- package/dist/lib/workspace-apps.d.ts +9 -0
- package/dist/lib/workspace-apps.d.ts.map +1 -1
- package/dist/lib/workspace-apps.js.map +1 -1
- package/dist/routes/index.d.ts.map +1 -1
- package/dist/routes/index.js +1 -0
- package/dist/routes/index.js.map +1 -1
- package/dist/routes/pages/$appId.d.ts +2 -2
- package/dist/routes/pages/$appId.d.ts.map +1 -1
- package/dist/routes/pages/$appId.js +17 -8
- package/dist/routes/pages/$appId.js.map +1 -1
- package/dist/routes/pages/approval.d.ts.map +1 -1
- package/dist/routes/pages/approval.js +4 -1
- package/dist/routes/pages/approval.js.map +1 -1
- package/dist/routes/pages/approvals.js +1 -1
- package/dist/routes/pages/approvals.js.map +1 -1
- package/dist/routes/pages/dream-settings.d.ts +34 -0
- package/dist/routes/pages/dream-settings.d.ts.map +1 -0
- package/dist/routes/pages/dream-settings.js +68 -0
- package/dist/routes/pages/dream-settings.js.map +1 -0
- package/dist/routes/pages/dreams.d.ts +5 -0
- package/dist/routes/pages/dreams.d.ts.map +1 -0
- package/dist/routes/pages/dreams.js +435 -0
- package/dist/routes/pages/dreams.js.map +1 -0
- package/dist/routes/pages/integrations.d.ts.map +1 -1
- package/dist/routes/pages/integrations.js +20 -15
- package/dist/routes/pages/integrations.js.map +1 -1
- package/dist/routes/pages/new-app.js +1 -1
- package/dist/routes/pages/new-app.js.map +1 -1
- package/dist/routes/pages/overview.d.ts.map +1 -1
- package/dist/routes/pages/overview.js +5 -1
- package/dist/routes/pages/overview.js.map +1 -1
- package/dist/routes/pages/vault.d.ts.map +1 -1
- package/dist/routes/pages/vault.js +23 -5
- package/dist/routes/pages/vault.js.map +1 -1
- package/dist/routes/pages/workspace.d.ts.map +1 -1
- package/dist/routes/pages/workspace.js +187 -35
- package/dist/routes/pages/workspace.js.map +1 -1
- package/dist/server/lib/app-creation-store.d.ts +13 -0
- package/dist/server/lib/app-creation-store.d.ts.map +1 -1
- package/dist/server/lib/app-creation-store.js +298 -11
- package/dist/server/lib/app-creation-store.js.map +1 -1
- package/dist/server/lib/dispatch-integrations.d.ts +1 -1
- package/dist/server/lib/dispatch-integrations.d.ts.map +1 -1
- package/dist/server/lib/dispatch-integrations.js +9 -4
- package/dist/server/lib/dispatch-integrations.js.map +1 -1
- package/dist/server/lib/dispatch-remote-commands.d.ts +83 -0
- package/dist/server/lib/dispatch-remote-commands.d.ts.map +1 -0
- package/dist/server/lib/dispatch-remote-commands.js +256 -0
- package/dist/server/lib/dispatch-remote-commands.js.map +1 -0
- package/dist/server/lib/dispatch-store.d.ts +26 -0
- package/dist/server/lib/dispatch-store.d.ts.map +1 -1
- package/dist/server/lib/dispatch-store.js +17 -1
- package/dist/server/lib/dispatch-store.js.map +1 -1
- package/dist/server/lib/dreams-store.d.ts +398 -0
- package/dist/server/lib/dreams-store.d.ts.map +1 -0
- package/dist/server/lib/dreams-store.js +2330 -0
- package/dist/server/lib/dreams-store.js.map +1 -0
- package/dist/server/lib/env-config.d.ts.map +1 -1
- package/dist/server/lib/env-config.js +5 -0
- package/dist/server/lib/env-config.js.map +1 -1
- package/dist/server/lib/onboarding-steps.d.ts +12 -0
- package/dist/server/lib/onboarding-steps.d.ts.map +1 -0
- package/dist/server/lib/onboarding-steps.js +47 -0
- package/dist/server/lib/onboarding-steps.js.map +1 -0
- package/dist/server/lib/thread-debug-store.d.ts +2 -2
- package/dist/server/lib/vault-store.d.ts +55 -0
- package/dist/server/lib/vault-store.d.ts.map +1 -1
- package/dist/server/lib/vault-store.js +210 -41
- package/dist/server/lib/vault-store.js.map +1 -1
- package/dist/server/lib/workspace-resources-store.d.ts +181 -17
- package/dist/server/lib/workspace-resources-store.d.ts.map +1 -1
- package/dist/server/lib/workspace-resources-store.js +737 -108
- package/dist/server/lib/workspace-resources-store.js.map +1 -1
- package/dist/server/plugins/agent-chat.d.ts.map +1 -1
- package/dist/server/plugins/agent-chat.js +2 -1
- package/dist/server/plugins/agent-chat.js.map +1 -1
- package/dist/server/plugins/core-routes.d.ts.map +1 -1
- package/dist/server/plugins/core-routes.js +4 -0
- package/dist/server/plugins/core-routes.js.map +1 -1
- package/dist/server/plugins/integrations.js +2 -2
- package/dist/server/plugins/integrations.js.map +1 -1
- package/package.json +15 -11
- package/src/actions/apply-dream-proposal.ts +12 -0
- package/src/actions/create-dream-report.ts +76 -0
- package/src/actions/create-pylon-ticket.ts +109 -0
- package/src/actions/create-vault-grant.ts +1 -1
- package/src/actions/create-vault-secret.ts +4 -3
- package/src/actions/create-workspace-resource.ts +3 -3
- package/src/actions/delete-workspace-resource.ts +1 -1
- package/src/actions/ensure-dream-job.ts +76 -0
- package/src/actions/get-dream-settings.ts +12 -0
- package/src/actions/get-dream.ts +14 -0
- package/src/actions/get-vault-access-settings.ts +11 -0
- package/src/actions/get-workspace-resource-effective-context.ts +34 -0
- package/src/actions/grant-vault-secrets-to-app.ts +1 -1
- package/src/actions/index.spec.ts +26 -0
- package/src/actions/index.ts +39 -4
- package/src/actions/list-dream-candidates.ts +77 -0
- package/src/actions/list-dreams.ts +17 -0
- package/src/actions/list-integrations-catalog.ts +1 -1
- package/src/actions/list-vault-grants.ts +1 -1
- package/src/actions/list-workspace-apps.ts +5 -1
- package/src/actions/list-workspace-resources-for-app.ts +13 -0
- package/src/actions/list-workspace-resources.ts +1 -1
- package/src/actions/navigate.ts +2 -1
- package/src/actions/preview-dream-proposal.ts +14 -0
- package/src/actions/preview-workspace-resource-change.ts +25 -0
- package/src/actions/reject-dream-proposal.ts +12 -0
- package/src/actions/restore-starter-workspace-resources.ts +17 -0
- package/src/actions/send-code-agent-remote-command.ts +59 -0
- package/src/actions/set-dream-settings.spec.ts +81 -0
- package/src/actions/set-dream-settings.ts +44 -0
- package/src/actions/set-vault-access-settings.ts +16 -0
- package/src/actions/start-workspace-app-creation.ts +8 -0
- package/src/actions/sync-vault-to-app.ts +1 -1
- package/src/actions/update-workspace-app-metadata.ts +32 -0
- package/src/actions/update-workspace-resource.ts +1 -1
- package/src/actions/view-screen.ts +94 -3
- package/src/components/app-keys-popover.tsx +23 -7
- package/src/components/approval-value-block.spec.tsx +59 -0
- package/src/components/approval-value-block.tsx +33 -0
- package/src/components/create-app-popover.tsx +50 -16
- package/src/components/dispatch-shell.tsx +16 -15
- package/src/components/layout/Layout.tsx +19 -5
- package/src/components/messaging-setup-panel.tsx +54 -39
- package/src/components/workspace-app-card.tsx +268 -1
- package/src/components/workspace-resource-effective-stack.spec.tsx +125 -0
- package/src/components/workspace-resource-effective-stack.tsx +141 -0
- package/src/components/workspace-resource-impact-preview.spec.tsx +147 -0
- package/src/components/workspace-resource-impact-preview.tsx +116 -0
- package/src/db/migrations.ts +59 -0
- package/src/db/schema.ts +46 -2
- package/src/hooks/use-navigation-state.ts +34 -9
- package/src/lib/catch-all-target.spec.ts +218 -0
- package/src/lib/catch-all-target.ts +99 -0
- package/src/lib/utils.ts +6 -1
- package/src/lib/workspace-apps.ts +9 -0
- package/src/routes/index.ts +1 -0
- package/src/routes/pages/$appId.tsx +21 -8
- package/src/routes/pages/approval.tsx +14 -1
- package/src/routes/pages/approvals.tsx +1 -1
- package/src/routes/pages/dream-settings.spec.ts +130 -0
- package/src/routes/pages/dream-settings.ts +103 -0
- package/src/routes/pages/dreams.tsx +1828 -0
- package/src/routes/pages/integrations.tsx +57 -18
- package/src/routes/pages/new-app.tsx +1 -1
- package/src/routes/pages/overview.tsx +11 -3
- package/src/routes/pages/vault.tsx +76 -9
- package/src/routes/pages/workspace.tsx +577 -97
- package/src/server/lib/app-creation-store.spec.ts +61 -2
- package/src/server/lib/app-creation-store.ts +389 -13
- package/src/server/lib/dispatch-integrations.ts +10 -3
- package/src/server/lib/dispatch-remote-commands.spec.ts +167 -0
- package/src/server/lib/dispatch-remote-commands.ts +375 -0
- package/src/server/lib/dispatch-store.ts +37 -1
- package/src/server/lib/dreams-store.spec.ts +1492 -0
- package/src/server/lib/dreams-store.ts +3168 -0
- package/src/server/lib/env-config.ts +5 -0
- package/src/server/lib/onboarding-steps.ts +49 -0
- package/src/server/lib/vault-store.spec.ts +69 -0
- package/src/server/lib/vault-store.ts +266 -49
- package/src/server/lib/workspace-resource-approval-lifecycle.spec.ts +236 -0
- package/src/server/lib/workspace-resources-store.spec.ts +1106 -0
- package/src/server/lib/workspace-resources-store.ts +1001 -134
- package/src/server/plugins/agent-chat.ts +2 -1
- package/src/server/plugins/core-routes.ts +5 -0
- package/src/server/plugins/integrations.ts +2 -2
- package/dist/actions/sync-workspace-resources-to-all.d.ts +0 -3
- package/dist/actions/sync-workspace-resources-to-all.d.ts.map +0 -1
- package/dist/actions/sync-workspace-resources-to-all.js +0 -9
- package/dist/actions/sync-workspace-resources-to-all.js.map +0 -1
- package/dist/actions/sync-workspace-resources-to-app.d.ts +0 -3
- package/dist/actions/sync-workspace-resources-to-app.d.ts.map +0 -1
- package/dist/actions/sync-workspace-resources-to-app.js +0 -11
- package/dist/actions/sync-workspace-resources-to-app.js.map +0 -1
- package/src/actions/sync-workspace-resources-to-all.ts +0 -10
- package/src/actions/sync-workspace-resources-to-app.ts +0 -12
package/dist/db/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/db/schema.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB;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;;;;;;;;;;;;;;;;;;;;EAUlC,CAAC"}
|
package/dist/db/schema.js
CHANGED
|
@@ -67,6 +67,48 @@ export const dispatchAuditEvents = table("dispatch_audit_events", {
|
|
|
67
67
|
metadata: text("metadata"),
|
|
68
68
|
createdAt: integer("created_at").notNull(),
|
|
69
69
|
});
|
|
70
|
+
export const dispatchDreams = table("dispatch_dreams", {
|
|
71
|
+
id: text("id").primaryKey(),
|
|
72
|
+
ownerEmail: text("owner_email").notNull(),
|
|
73
|
+
orgId: text("org_id"),
|
|
74
|
+
sourceId: text("source_id").notNull(),
|
|
75
|
+
title: text("title").notNull(),
|
|
76
|
+
status: text("status").notNull(),
|
|
77
|
+
query: text("query"),
|
|
78
|
+
report: text("report"),
|
|
79
|
+
summary: text("summary"),
|
|
80
|
+
sourceHealth: text("source_health"),
|
|
81
|
+
candidateCount: integer("candidate_count").notNull(),
|
|
82
|
+
inspectedThreadCount: integer("inspected_thread_count").notNull(),
|
|
83
|
+
createdBy: text("created_by").notNull(),
|
|
84
|
+
error: text("error"),
|
|
85
|
+
startedAt: integer("started_at").notNull(),
|
|
86
|
+
completedAt: integer("completed_at"),
|
|
87
|
+
createdAt: integer("created_at").notNull(),
|
|
88
|
+
updatedAt: integer("updated_at").notNull(),
|
|
89
|
+
});
|
|
90
|
+
export const dispatchDreamProposals = table("dispatch_dream_proposals", {
|
|
91
|
+
id: text("id").primaryKey(),
|
|
92
|
+
dreamId: text("dream_id").notNull(),
|
|
93
|
+
ownerEmail: text("owner_email").notNull(),
|
|
94
|
+
orgId: text("org_id"),
|
|
95
|
+
targetType: text("target_type").notNull(),
|
|
96
|
+
targetPath: text("target_path").notNull(),
|
|
97
|
+
title: text("title").notNull(),
|
|
98
|
+
summary: text("summary").notNull(),
|
|
99
|
+
rationale: text("rationale").notNull(),
|
|
100
|
+
content: text("content").notNull(),
|
|
101
|
+
evidence: text("evidence").notNull(),
|
|
102
|
+
confidence: integer("confidence").notNull(),
|
|
103
|
+
risk: text("risk").notNull(),
|
|
104
|
+
status: text("status").notNull(),
|
|
105
|
+
appliedBy: text("applied_by"),
|
|
106
|
+
appliedAt: integer("applied_at"),
|
|
107
|
+
rejectedBy: text("rejected_by"),
|
|
108
|
+
rejectedAt: integer("rejected_at"),
|
|
109
|
+
createdAt: integer("created_at").notNull(),
|
|
110
|
+
updatedAt: integer("updated_at").notNull(),
|
|
111
|
+
});
|
|
70
112
|
// ─── Vault: workspace-wide secret management ───────────────────────
|
|
71
113
|
export const vaultSecrets = table("vault_secrets", {
|
|
72
114
|
id: text("id").primaryKey(),
|
|
@@ -129,7 +171,7 @@ export const workspaceResources = table("workspace_resources", {
|
|
|
129
171
|
description: text("description"),
|
|
130
172
|
path: text("path").notNull(), // resource path, e.g. "skills/designer.md"
|
|
131
173
|
content: text("content").notNull(),
|
|
132
|
-
scope: text("scope").notNull(), // "all" (
|
|
174
|
+
scope: text("scope").notNull(), // "all" (runtime inherited) | "selected" (grant per-app)
|
|
133
175
|
createdBy: text("created_by").notNull(),
|
|
134
176
|
createdAt: integer("created_at").notNull(),
|
|
135
177
|
updatedAt: integer("updated_at").notNull(),
|
|
@@ -141,7 +183,7 @@ export const workspaceResourceGrants = table("workspace_resource_grants", {
|
|
|
141
183
|
resourceId: text("resource_id").notNull(),
|
|
142
184
|
appId: text("app_id").notNull(),
|
|
143
185
|
status: text("status").notNull(), // "active" | "revoked"
|
|
144
|
-
syncedAt: integer("synced_at"),
|
|
186
|
+
syncedAt: integer("synced_at"), // legacy column retained for older rows
|
|
145
187
|
createdAt: integer("created_at").notNull(),
|
|
146
188
|
updatedAt: integer("updated_at").notNull(),
|
|
147
189
|
});
|
package/dist/db/schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/db/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAEpE,MAAM,CAAC,MAAM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,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC;IACrB,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,EAAE;IACzC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE;IAC/B,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,EAAE,uBAAuB;IACzD,QAAQ,EAAE,OAAO,CAAC,WAAW,CAAC;IAC9B,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;IAC1C,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;CAC3C,CAAC,CAAC","sourcesContent":["import { table, text, integer } from \"@agent-native/core/db/schema\";\n\nexport const dispatchDestinations = table(\"dispatch_destinations\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n name: text(\"name\").notNull(),\n platform: text(\"platform\").notNull(),\n destination: text(\"destination\").notNull(),\n threadRef: text(\"thread_ref\"),\n notes: text(\"notes\"),\n createdBy: text(\"created_by\").notNull(),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\nexport const dispatchIdentityLinks = table(\"dispatch_identity_links\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n platform: text(\"platform\").notNull(),\n externalUserId: text(\"external_user_id\").notNull(),\n externalUserName: text(\"external_user_name\"),\n linkedBy: text(\"linked_by\").notNull(),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\nexport const dispatchLinkTokens = table(\"dispatch_link_tokens\", {\n id: text(\"id\").primaryKey(),\n token: text(\"token\").notNull(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n platform: text(\"platform\").notNull(),\n createdBy: text(\"created_by\").notNull(),\n expiresAt: integer(\"expires_at\").notNull(),\n claimedAt: integer(\"claimed_at\"),\n claimedByExternalUserId: text(\"claimed_by_external_user_id\"),\n claimedByExternalUserName: text(\"claimed_by_external_user_name\"),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\nexport const dispatchApprovalRequests = table(\"dispatch_approval_requests\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n changeType: text(\"change_type\").notNull(),\n targetType: text(\"target_type\").notNull(),\n targetId: text(\"target_id\"),\n status: text(\"status\").notNull(),\n summary: text(\"summary\").notNull(),\n payload: text(\"payload\").notNull(),\n beforeValue: text(\"before_value\"),\n afterValue: text(\"after_value\"),\n requestedBy: text(\"requested_by\").notNull(),\n reviewedBy: text(\"reviewed_by\"),\n reviewedAt: integer(\"reviewed_at\"),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\nexport const dispatchAuditEvents = table(\"dispatch_audit_events\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n actor: text(\"actor\").notNull(),\n action: text(\"action\").notNull(),\n targetType: text(\"target_type\").notNull(),\n targetId: text(\"target_id\"),\n summary: text(\"summary\").notNull(),\n metadata: text(\"metadata\"),\n createdAt: integer(\"created_at\").notNull(),\n});\n\n// ─── Vault: workspace-wide secret management ───────────────────────\n\nexport const vaultSecrets = table(\"vault_secrets\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n name: text(\"name\").notNull(),\n credentialKey: text(\"credential_key\").notNull(),\n value: text(\"value\").notNull(),\n provider: text(\"provider\"),\n description: text(\"description\"),\n createdBy: text(\"created_by\").notNull(),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\nexport const vaultGrants = table(\"vault_grants\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n secretId: text(\"secret_id\").notNull(),\n appId: text(\"app_id\").notNull(),\n grantedBy: text(\"granted_by\").notNull(),\n status: text(\"status\").notNull(),\n syncedAt: integer(\"synced_at\"),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\nexport const vaultRequests = table(\"vault_requests\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n credentialKey: text(\"credential_key\").notNull(),\n appId: text(\"app_id\").notNull(),\n reason: text(\"reason\"),\n requestedBy: text(\"requested_by\").notNull(),\n status: text(\"status\").notNull(),\n reviewedBy: text(\"reviewed_by\"),\n reviewedAt: integer(\"reviewed_at\"),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\nexport const vaultAuditLog = table(\"vault_audit_log\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n secretId: text(\"secret_id\"),\n appId: text(\"app_id\"),\n action: text(\"action\").notNull(),\n actor: text(\"actor\").notNull(),\n summary: text(\"summary\").notNull(),\n metadata: text(\"metadata\"),\n createdAt: integer(\"created_at\").notNull(),\n});\n\n// ─── Workspace Resources: shared skills, instructions, agents, knowledge ──────\n\nexport const workspaceResources = table(\"workspace_resources\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n kind: text(\"kind\").notNull(), // \"skill\" | \"instruction\" | \"agent\" | \"knowledge\"\n name: text(\"name\").notNull(),\n description: text(\"description\"),\n path: text(\"path\").notNull(), // resource path, e.g. \"skills/designer.md\"\n content: text(\"content\").notNull(),\n scope: text(\"scope\").notNull(), // \"all\" (push to all apps) | \"selected\" (grant per-app)\n createdBy: text(\"created_by\").notNull(),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\nexport const workspaceResourceGrants = table(\"workspace_resource_grants\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n resourceId: text(\"resource_id\").notNull(),\n appId: text(\"app_id\").notNull(),\n status: text(\"status\").notNull(), // \"active\" | \"revoked\"\n syncedAt: integer(\"synced_at\"),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n"]}
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/db/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAEpE,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC,uBAAuB,EAAE;IACjE,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE;IAC3B,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,EAAE;IACzC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC;IACrB,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE;IAC5B,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE;IACpC,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,EAAE;IAC1C,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC;IAC7B,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC;IACpB,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;IACvC,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;IAC1C,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;CAC3C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC,yBAAyB,EAAE;IACpE,EAAE,EAAE,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IAC1C,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;CAC3C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,CAAC,2BAA2B,EAAE;IACxE,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE;IAC3B,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,EAAE;IACzC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC;IACrB,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,EAAE;IACzC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE;IAC/B,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,EAAE,uBAAuB;IACzD,QAAQ,EAAE,OAAO,CAAC,WAAW,CAAC,EAAE,wCAAwC;IACxE,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;IAC1C,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;CAC3C,CAAC,CAAC","sourcesContent":["import { table, text, integer } from \"@agent-native/core/db/schema\";\n\nexport const dispatchDestinations = table(\"dispatch_destinations\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n name: text(\"name\").notNull(),\n platform: text(\"platform\").notNull(),\n destination: text(\"destination\").notNull(),\n threadRef: text(\"thread_ref\"),\n notes: text(\"notes\"),\n createdBy: text(\"created_by\").notNull(),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\nexport const dispatchIdentityLinks = table(\"dispatch_identity_links\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n platform: text(\"platform\").notNull(),\n externalUserId: text(\"external_user_id\").notNull(),\n externalUserName: text(\"external_user_name\"),\n linkedBy: text(\"linked_by\").notNull(),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\nexport const dispatchLinkTokens = table(\"dispatch_link_tokens\", {\n id: text(\"id\").primaryKey(),\n token: text(\"token\").notNull(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n platform: text(\"platform\").notNull(),\n createdBy: text(\"created_by\").notNull(),\n expiresAt: integer(\"expires_at\").notNull(),\n claimedAt: integer(\"claimed_at\"),\n claimedByExternalUserId: text(\"claimed_by_external_user_id\"),\n claimedByExternalUserName: text(\"claimed_by_external_user_name\"),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\nexport const dispatchApprovalRequests = table(\"dispatch_approval_requests\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n changeType: text(\"change_type\").notNull(),\n targetType: text(\"target_type\").notNull(),\n targetId: text(\"target_id\"),\n status: text(\"status\").notNull(),\n summary: text(\"summary\").notNull(),\n payload: text(\"payload\").notNull(),\n beforeValue: text(\"before_value\"),\n afterValue: text(\"after_value\"),\n requestedBy: text(\"requested_by\").notNull(),\n reviewedBy: text(\"reviewed_by\"),\n reviewedAt: integer(\"reviewed_at\"),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\nexport const dispatchAuditEvents = table(\"dispatch_audit_events\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n actor: text(\"actor\").notNull(),\n action: text(\"action\").notNull(),\n targetType: text(\"target_type\").notNull(),\n targetId: text(\"target_id\"),\n summary: text(\"summary\").notNull(),\n metadata: text(\"metadata\"),\n createdAt: integer(\"created_at\").notNull(),\n});\n\nexport const dispatchDreams = table(\"dispatch_dreams\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n sourceId: text(\"source_id\").notNull(),\n title: text(\"title\").notNull(),\n status: text(\"status\").notNull(),\n query: text(\"query\"),\n report: text(\"report\"),\n summary: text(\"summary\"),\n sourceHealth: text(\"source_health\"),\n candidateCount: integer(\"candidate_count\").notNull(),\n inspectedThreadCount: integer(\"inspected_thread_count\").notNull(),\n createdBy: text(\"created_by\").notNull(),\n error: text(\"error\"),\n startedAt: integer(\"started_at\").notNull(),\n completedAt: integer(\"completed_at\"),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\nexport const dispatchDreamProposals = table(\"dispatch_dream_proposals\", {\n id: text(\"id\").primaryKey(),\n dreamId: text(\"dream_id\").notNull(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n targetType: text(\"target_type\").notNull(),\n targetPath: text(\"target_path\").notNull(),\n title: text(\"title\").notNull(),\n summary: text(\"summary\").notNull(),\n rationale: text(\"rationale\").notNull(),\n content: text(\"content\").notNull(),\n evidence: text(\"evidence\").notNull(),\n confidence: integer(\"confidence\").notNull(),\n risk: text(\"risk\").notNull(),\n status: text(\"status\").notNull(),\n appliedBy: text(\"applied_by\"),\n appliedAt: integer(\"applied_at\"),\n rejectedBy: text(\"rejected_by\"),\n rejectedAt: integer(\"rejected_at\"),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\n// ─── Vault: workspace-wide secret management ───────────────────────\n\nexport const vaultSecrets = table(\"vault_secrets\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n name: text(\"name\").notNull(),\n credentialKey: text(\"credential_key\").notNull(),\n value: text(\"value\").notNull(),\n provider: text(\"provider\"),\n description: text(\"description\"),\n createdBy: text(\"created_by\").notNull(),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\nexport const vaultGrants = table(\"vault_grants\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n secretId: text(\"secret_id\").notNull(),\n appId: text(\"app_id\").notNull(),\n grantedBy: text(\"granted_by\").notNull(),\n status: text(\"status\").notNull(),\n syncedAt: integer(\"synced_at\"),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\nexport const vaultRequests = table(\"vault_requests\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n credentialKey: text(\"credential_key\").notNull(),\n appId: text(\"app_id\").notNull(),\n reason: text(\"reason\"),\n requestedBy: text(\"requested_by\").notNull(),\n status: text(\"status\").notNull(),\n reviewedBy: text(\"reviewed_by\"),\n reviewedAt: integer(\"reviewed_at\"),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\nexport const vaultAuditLog = table(\"vault_audit_log\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n secretId: text(\"secret_id\"),\n appId: text(\"app_id\"),\n action: text(\"action\").notNull(),\n actor: text(\"actor\").notNull(),\n summary: text(\"summary\").notNull(),\n metadata: text(\"metadata\"),\n createdAt: integer(\"created_at\").notNull(),\n});\n\n// ─── Workspace Resources: shared skills, instructions, agents, knowledge ──────\n\nexport const workspaceResources = table(\"workspace_resources\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n kind: text(\"kind\").notNull(), // \"skill\" | \"instruction\" | \"agent\" | \"knowledge\"\n name: text(\"name\").notNull(),\n description: text(\"description\"),\n path: text(\"path\").notNull(), // resource path, e.g. \"skills/designer.md\"\n content: text(\"content\").notNull(),\n scope: text(\"scope\").notNull(), // \"all\" (runtime inherited) | \"selected\" (grant per-app)\n createdBy: text(\"created_by\").notNull(),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\nexport const workspaceResourceGrants = table(\"workspace_resource_grants\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n resourceId: text(\"resource_id\").notNull(),\n appId: text(\"app_id\").notNull(),\n status: text(\"status\").notNull(), // \"active\" | \"revoked\"\n syncedAt: integer(\"synced_at\"), // legacy column retained for older rows\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n"]}
|
|
@@ -2,6 +2,9 @@ import type { DispatchExtensionConfig } from "../components/index.js";
|
|
|
2
2
|
export interface NavigationState {
|
|
3
3
|
view: string;
|
|
4
4
|
path?: string;
|
|
5
|
+
dreamId?: string;
|
|
6
|
+
sourceId?: string;
|
|
7
|
+
query?: string;
|
|
5
8
|
}
|
|
6
9
|
export declare function useNavigationState(extensions?: DispatchExtensionConfig): void;
|
|
7
10
|
//# sourceMappingURL=use-navigation-state.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-navigation-state.d.ts","sourceRoot":"","sources":["../../src/hooks/use-navigation-state.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,uBAAuB,EAExB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"use-navigation-state.d.ts","sourceRoot":"","sources":["../../src/hooks/use-navigation-state.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,uBAAuB,EAExB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,kBAAkB,CAAC,UAAU,CAAC,EAAE,uBAAuB,QAqEtE"}
|
|
@@ -9,17 +9,29 @@ export function useNavigationState(extensions) {
|
|
|
9
9
|
// Sync current route to application state
|
|
10
10
|
useEffect(() => {
|
|
11
11
|
const localPathname = routerPath(location.pathname);
|
|
12
|
+
const params = new URLSearchParams(location.search);
|
|
12
13
|
const state = {
|
|
13
14
|
view: resolveView(localPathname, extensions),
|
|
14
15
|
path: appPath(localPathname),
|
|
15
16
|
};
|
|
17
|
+
if (state.view === "dreams") {
|
|
18
|
+
const dreamId = params.get("dreamId");
|
|
19
|
+
const sourceId = params.get("sourceId");
|
|
20
|
+
const query = params.get("query");
|
|
21
|
+
if (dreamId)
|
|
22
|
+
state.dreamId = dreamId;
|
|
23
|
+
if (sourceId)
|
|
24
|
+
state.sourceId = sourceId;
|
|
25
|
+
if (query)
|
|
26
|
+
state.query = query;
|
|
27
|
+
}
|
|
16
28
|
fetch(agentNativePath("/_agent-native/application-state/navigation"), {
|
|
17
29
|
method: "PUT",
|
|
18
30
|
keepalive: true,
|
|
19
31
|
headers: { "Content-Type": "application/json" },
|
|
20
32
|
body: JSON.stringify(state),
|
|
21
33
|
}).catch(() => { });
|
|
22
|
-
}, [extensions, location.pathname]);
|
|
34
|
+
}, [extensions, location.pathname, location.search]);
|
|
23
35
|
// Listen for navigate commands from agent
|
|
24
36
|
const { data: navCommand } = useQuery({
|
|
25
37
|
queryKey: ["navigate-command"],
|
|
@@ -47,8 +59,12 @@ export function useNavigationState(extensions) {
|
|
|
47
59
|
}).catch(() => { });
|
|
48
60
|
const cmd = navCommand;
|
|
49
61
|
// Navigate to a specific path or resolve view name to path
|
|
50
|
-
const
|
|
51
|
-
|
|
62
|
+
const resolvedPath = cmd.path || resolvePath(cmd.view, extensions) || "/overview";
|
|
63
|
+
const path = cmd.view === "dreams" && cmd.dreamId && !resolvedPath.includes("?")
|
|
64
|
+
? `${resolvedPath}?dreamId=${encodeURIComponent(cmd.dreamId)}`
|
|
65
|
+
: resolvedPath;
|
|
66
|
+
const nextPath = routerPath(path);
|
|
67
|
+
navigate(nextPath);
|
|
52
68
|
qc.setQueryData(["navigate-command"], null);
|
|
53
69
|
}, [extensions, navCommand, navigate, qc]);
|
|
54
70
|
}
|
|
@@ -56,12 +72,19 @@ function routerPath(path) {
|
|
|
56
72
|
const basePath = appBasePath();
|
|
57
73
|
if (!basePath)
|
|
58
74
|
return path;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
75
|
+
let result = path;
|
|
76
|
+
// Iteratively strip basename. A path that arrives doubly-prefixed
|
|
77
|
+
// (e.g. "/dispatch/dispatch/overview", possibly from a stale link or a
|
|
78
|
+
// prior bug) would otherwise get partially stripped here and then
|
|
79
|
+
// re-prefixed by react-router's basename, restoring the bad URL.
|
|
80
|
+
for (let i = 0; i < 4; i += 1) {
|
|
81
|
+
if (result === basePath)
|
|
82
|
+
return "/";
|
|
83
|
+
if (!result.startsWith(`${basePath}/`))
|
|
84
|
+
break;
|
|
85
|
+
result = result.slice(basePath.length) || "/";
|
|
63
86
|
}
|
|
64
|
-
return
|
|
87
|
+
return result;
|
|
65
88
|
}
|
|
66
89
|
function extensionItemMatchesPath(item, pathname) {
|
|
67
90
|
if (item.match) {
|
|
@@ -111,6 +134,8 @@ function resolveView(pathname, extensions) {
|
|
|
111
134
|
return "approvals";
|
|
112
135
|
if (pathname.startsWith("/audit"))
|
|
113
136
|
return "audit";
|
|
137
|
+
if (pathname.startsWith("/dreams"))
|
|
138
|
+
return "dreams";
|
|
114
139
|
if (pathname.startsWith("/thread-debug"))
|
|
115
140
|
return "thread-debug";
|
|
116
141
|
if (pathname.startsWith("/team"))
|
|
@@ -150,6 +175,8 @@ function resolvePath(view, extensions) {
|
|
|
150
175
|
return "/approvals";
|
|
151
176
|
case "audit":
|
|
152
177
|
return "/audit";
|
|
178
|
+
case "dreams":
|
|
179
|
+
return "/dreams";
|
|
153
180
|
case "thread-debug":
|
|
154
181
|
case "threads":
|
|
155
182
|
return "/thread-debug";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-navigation-state.js","sourceRoot":"","sources":["../../src/hooks/use-navigation-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EACL,eAAe,EACf,WAAW,EACX,OAAO,GACR,MAAM,2BAA2B,CAAC;AAWnC,MAAM,UAAU,kBAAkB,CAAC,UAAoC;IACrE,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,EAAE,GAAG,cAAc,EAAE,CAAC;IAE5B,0CAA0C;IAC1C,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,aAAa,GAAG,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACpD,MAAM,KAAK,GAAoB;YAC7B,IAAI,EAAE,WAAW,CAAC,aAAa,EAAE,UAAU,CAAC;YAC5C,IAAI,EAAE,OAAO,CAAC,aAAa,CAAC;SAC7B,CAAC;QAEF,KAAK,CAAC,eAAe,CAAC,6CAA6C,CAAC,EAAE;YACpE,MAAM,EAAE,KAAK;YACb,SAAS,EAAE,IAAI;YACf,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;YAC/C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;SAC5B,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IACrB,CAAC,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEpC,0CAA0C;IAC1C,MAAM,EAAE,IAAI,EAAE,UAAU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C;IAEpC,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,UAAU;YACb,OAAO,WAAW,CAAC;QACrB,KAAK,MAAM;YACT,OAAO,OAAO,CAAC;QACjB,KAAK,SAAS,CAAC;QACf,KAAK,OAAO;YACV,OAAO,UAAU,CAAC;QACpB,KAAK,SAAS,CAAC;QACf,KAAK,YAAY;YACf,OAAO,UAAU,CAAC;QACpB,KAAK,OAAO,CAAC;QACb,KAAK,SAAS;YACZ,OAAO,QAAQ,CAAC;QAClB,KAAK,cAAc;YACjB,OAAO,eAAe,CAAC;QACzB,KAAK,WAAW,CAAC;QACjB,KAAK,WAAW;YACd,OAAO,YAAY,CAAC;QACtB,KAAK,QAAQ;YACX,OAAO,SAAS,CAAC;QACnB,KAAK,WAAW;YACd,OAAO,YAAY,CAAC;QACtB,KAAK,cAAc,CAAC;QACpB,KAAK,QAAQ;YACX,OAAO,eAAe,CAAC;QACzB,KAAK,YAAY;YACf,OAAO,aAAa,CAAC;QACvB,KAAK,WAAW;YACd,OAAO,YAAY,CAAC;QACtB,KAAK,OAAO;YACV,OAAO,QAAQ,CAAC;QAClB,KAAK,cAAc,CAAC;QACpB,KAAK,SAAS;YACZ,OAAO,eAAe,CAAC;QACzB,KAAK,MAAM;YACT,OAAO,OAAO,CAAC;QACjB;YACE,OAAO,oBAAoB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAClD,CAAC;AACH,CAAC","sourcesContent":["import { useEffect } from \"react\";\nimport { useLocation, useNavigate } from \"react-router\";\nimport { useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport {\n agentNativePath,\n appBasePath,\n appPath,\n} from \"@agent-native/core/client\";\nimport type {\n DispatchExtensionConfig,\n DispatchNavItem,\n} from \"../components/index.js\";\n\nexport interface NavigationState {\n view: string;\n path?: string;\n}\n\nexport function useNavigationState(extensions?: DispatchExtensionConfig) {\n const location = useLocation();\n const navigate = useNavigate();\n const qc = useQueryClient();\n\n // Sync current route to application state\n useEffect(() => {\n const localPathname = routerPath(location.pathname);\n const state: NavigationState = {\n view: resolveView(localPathname, extensions),\n path: appPath(localPathname),\n };\n\n fetch(agentNativePath(\"/_agent-native/application-state/navigation\"), {\n method: \"PUT\",\n keepalive: true,\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(state),\n }).catch(() => {});\n }, [extensions, location.pathname]);\n\n // Listen for navigate commands from agent\n const { data: navCommand } = useQuery({\n queryKey: [\"navigate-command\"],\n queryFn: async () => {\n const res = await fetch(\n agentNativePath(\"/_agent-native/application-state/navigate\"),\n );\n if (!res.ok) return null;\n const data = await res.json();\n if (data) {\n // Return with a timestamp to ensure uniqueness\n return { ...data, _ts: Date.now() };\n }\n return null;\n },\n refetchInterval: 2_000,\n structuralSharing: false,\n });\n\n useEffect(() => {\n if (!navCommand) return;\n // Delete the one-shot command AFTER reading it\n fetch(agentNativePath(\"/_agent-native/application-state/navigate\"), {\n method: \"DELETE\",\n headers: { \"X-Agent-Native-CSRF\": \"1\" },\n }).catch(() => {});\n const cmd = navCommand as NavigationState;\n\n // Navigate to a specific path or resolve view name to path\n const path = routerPath(\n cmd.path || resolvePath(cmd.view, extensions) || \"/overview\",\n );\n navigate(path);\n qc.setQueryData([\"navigate-command\"], null);\n }, [extensions, navCommand, navigate, qc]);\n}\n\nfunction routerPath(path: string): string {\n const basePath = appBasePath();\n if (!basePath) return path;\n if (path === basePath) return \"/\";\n if (path.startsWith(`${basePath}/`)) {\n return path.slice(basePath.length) || \"/\";\n }\n return path;\n}\n\nfunction extensionItemMatchesPath(\n item: DispatchNavItem,\n pathname: string,\n): boolean {\n if (item.match) {\n try {\n if (item.match(pathname)) return true;\n } catch {\n return false;\n }\n }\n return pathname === item.to || pathname.startsWith(`${item.to}/`);\n}\n\nfunction resolveExtensionView(\n pathname: string,\n extensions?: DispatchExtensionConfig,\n): string | undefined {\n return extensions?.navItems?.find((item) =>\n extensionItemMatchesPath(item, pathname),\n )?.id;\n}\n\nfunction resolveExtensionPath(\n view: string | undefined,\n extensions?: DispatchExtensionConfig,\n): string | undefined {\n if (!view) return undefined;\n return extensions?.navItems?.find((item) => item.id === view)?.to;\n}\n\nfunction resolveView(\n pathname: string,\n extensions?: DispatchExtensionConfig,\n): string {\n const extensionView = resolveExtensionView(pathname, extensions);\n if (extensionView) return extensionView;\n if (pathname.startsWith(\"/apps\")) return \"apps\";\n if (pathname.startsWith(\"/metrics\")) return \"metrics\";\n if (pathname.startsWith(\"/new-app\")) return \"new-app\";\n if (pathname.startsWith(\"/vault\")) return \"vault\";\n if (pathname.startsWith(\"/integrations\")) return \"integrations\";\n if (pathname.startsWith(\"/workspace\")) return \"workspace\";\n if (pathname.startsWith(\"/agents\")) return \"agents\";\n if (pathname.startsWith(\"/messaging\")) return \"messaging\";\n if (pathname.startsWith(\"/destinations\")) return \"destinations\";\n if (pathname.startsWith(\"/identities\")) return \"identities\";\n if (pathname.startsWith(\"/approvals\")) return \"approvals\";\n if (pathname.startsWith(\"/audit\")) return \"audit\";\n if (pathname.startsWith(\"/thread-debug\")) return \"thread-debug\";\n if (pathname.startsWith(\"/team\")) return \"team\";\n return \"overview\";\n}\n\nfunction resolvePath(\n view?: string,\n extensions?: DispatchExtensionConfig,\n): string | undefined {\n switch (view) {\n case \"overview\":\n return \"/overview\";\n case \"apps\":\n return \"/apps\";\n case \"metrics\":\n case \"usage\":\n return \"/metrics\";\n case \"new-app\":\n case \"create-app\":\n return \"/new-app\";\n case \"vault\":\n case \"secrets\":\n return \"/vault\";\n case \"integrations\":\n return \"/integrations\";\n case \"workspace\":\n case \"resources\":\n return \"/workspace\";\n case \"agents\":\n return \"/agents\";\n case \"messaging\":\n return \"/messaging\";\n case \"destinations\":\n case \"routes\":\n return \"/destinations\";\n case \"identities\":\n return \"/identities\";\n case \"approvals\":\n return \"/approvals\";\n case \"audit\":\n return \"/audit\";\n case \"thread-debug\":\n case \"threads\":\n return \"/thread-debug\";\n case \"team\":\n return \"/team\";\n default:\n return resolveExtensionPath(view, extensions);\n }\n}\n"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AC;QACf,KAAK,YAAY;YACf,OAAO,UAAU,CAAC;QACpB,KAAK,OAAO,CAAC;QACb,KAAK,SAAS;YACZ,OAAO,QAAQ,CAAC;QAClB,KAAK,cAAc;YACjB,OAAO,eAAe,CAAC;QACzB,KAAK,WAAW,CAAC;QACjB,KAAK,WAAW;YACd,OAAO,YAAY,CAAC;QACtB,KAAK,QAAQ;YACX,OAAO,SAAS,CAAC;QACnB,KAAK,WAAW;YACd,OAAO,YAAY,CAAC;QACtB,KAAK,cAAc,CAAC;QACpB,KAAK,QAAQ;YACX,OAAO,eAAe,CAAC;QACzB,KAAK,YAAY;YACf,OAAO,aAAa,CAAC;QACvB,KAAK,WAAW;YACd,OAAO,YAAY,CAAC;QACtB,KAAK,OAAO;YACV,OAAO,QAAQ,CAAC;QAClB,KAAK,QAAQ;YACX,OAAO,SAAS,CAAC;QACnB,KAAK,cAAc,CAAC;QACpB,KAAK,SAAS;YACZ,OAAO,eAAe,CAAC;QACzB,KAAK,MAAM;YACT,OAAO,OAAO,CAAC;QACjB;YACE,OAAO,oBAAoB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAClD,CAAC;AACH,CAAC","sourcesContent":["import { useEffect } from \"react\";\nimport { useLocation, useNavigate } from \"react-router\";\nimport { useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport {\n agentNativePath,\n appBasePath,\n appPath,\n} from \"@agent-native/core/client\";\nimport type {\n DispatchExtensionConfig,\n DispatchNavItem,\n} from \"../components/index.js\";\n\nexport interface NavigationState {\n view: string;\n path?: string;\n dreamId?: string;\n sourceId?: string;\n query?: string;\n}\n\nexport function useNavigationState(extensions?: DispatchExtensionConfig) {\n const location = useLocation();\n const navigate = useNavigate();\n const qc = useQueryClient();\n\n // Sync current route to application state\n useEffect(() => {\n const localPathname = routerPath(location.pathname);\n const params = new URLSearchParams(location.search);\n const state: NavigationState = {\n view: resolveView(localPathname, extensions),\n path: appPath(localPathname),\n };\n if (state.view === \"dreams\") {\n const dreamId = params.get(\"dreamId\");\n const sourceId = params.get(\"sourceId\");\n const query = params.get(\"query\");\n if (dreamId) state.dreamId = dreamId;\n if (sourceId) state.sourceId = sourceId;\n if (query) state.query = query;\n }\n\n fetch(agentNativePath(\"/_agent-native/application-state/navigation\"), {\n method: \"PUT\",\n keepalive: true,\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(state),\n }).catch(() => {});\n }, [extensions, location.pathname, location.search]);\n\n // Listen for navigate commands from agent\n const { data: navCommand } = useQuery({\n queryKey: [\"navigate-command\"],\n queryFn: async () => {\n const res = await fetch(\n agentNativePath(\"/_agent-native/application-state/navigate\"),\n );\n if (!res.ok) return null;\n const data = await res.json();\n if (data) {\n // Return with a timestamp to ensure uniqueness\n return { ...data, _ts: Date.now() };\n }\n return null;\n },\n refetchInterval: 2_000,\n structuralSharing: false,\n });\n\n useEffect(() => {\n if (!navCommand) return;\n // Delete the one-shot command AFTER reading it\n fetch(agentNativePath(\"/_agent-native/application-state/navigate\"), {\n method: \"DELETE\",\n headers: { \"X-Agent-Native-CSRF\": \"1\" },\n }).catch(() => {});\n const cmd = navCommand as NavigationState;\n\n // Navigate to a specific path or resolve view name to path\n const resolvedPath =\n cmd.path || resolvePath(cmd.view, extensions) || \"/overview\";\n const path =\n cmd.view === \"dreams\" && cmd.dreamId && !resolvedPath.includes(\"?\")\n ? `${resolvedPath}?dreamId=${encodeURIComponent(cmd.dreamId)}`\n : resolvedPath;\n const nextPath = routerPath(path);\n navigate(nextPath);\n qc.setQueryData([\"navigate-command\"], null);\n }, [extensions, navCommand, navigate, qc]);\n}\n\nfunction routerPath(path: string): string {\n const basePath = appBasePath();\n if (!basePath) return path;\n let result = path;\n // Iteratively strip basename. A path that arrives doubly-prefixed\n // (e.g. \"/dispatch/dispatch/overview\", possibly from a stale link or a\n // prior bug) would otherwise get partially stripped here and then\n // re-prefixed by react-router's basename, restoring the bad URL.\n for (let i = 0; i < 4; i += 1) {\n if (result === basePath) return \"/\";\n if (!result.startsWith(`${basePath}/`)) break;\n result = result.slice(basePath.length) || \"/\";\n }\n return result;\n}\n\nfunction extensionItemMatchesPath(\n item: DispatchNavItem,\n pathname: string,\n): boolean {\n if (item.match) {\n try {\n if (item.match(pathname)) return true;\n } catch {\n return false;\n }\n }\n return pathname === item.to || pathname.startsWith(`${item.to}/`);\n}\n\nfunction resolveExtensionView(\n pathname: string,\n extensions?: DispatchExtensionConfig,\n): string | undefined {\n return extensions?.navItems?.find((item) =>\n extensionItemMatchesPath(item, pathname),\n )?.id;\n}\n\nfunction resolveExtensionPath(\n view: string | undefined,\n extensions?: DispatchExtensionConfig,\n): string | undefined {\n if (!view) return undefined;\n return extensions?.navItems?.find((item) => item.id === view)?.to;\n}\n\nfunction resolveView(\n pathname: string,\n extensions?: DispatchExtensionConfig,\n): string {\n const extensionView = resolveExtensionView(pathname, extensions);\n if (extensionView) return extensionView;\n if (pathname.startsWith(\"/apps\")) return \"apps\";\n if (pathname.startsWith(\"/metrics\")) return \"metrics\";\n if (pathname.startsWith(\"/new-app\")) return \"new-app\";\n if (pathname.startsWith(\"/vault\")) return \"vault\";\n if (pathname.startsWith(\"/integrations\")) return \"integrations\";\n if (pathname.startsWith(\"/workspace\")) return \"workspace\";\n if (pathname.startsWith(\"/agents\")) return \"agents\";\n if (pathname.startsWith(\"/messaging\")) return \"messaging\";\n if (pathname.startsWith(\"/destinations\")) return \"destinations\";\n if (pathname.startsWith(\"/identities\")) return \"identities\";\n if (pathname.startsWith(\"/approvals\")) return \"approvals\";\n if (pathname.startsWith(\"/audit\")) return \"audit\";\n if (pathname.startsWith(\"/dreams\")) return \"dreams\";\n if (pathname.startsWith(\"/thread-debug\")) return \"thread-debug\";\n if (pathname.startsWith(\"/team\")) return \"team\";\n return \"overview\";\n}\n\nfunction resolvePath(\n view?: string,\n extensions?: DispatchExtensionConfig,\n): string | undefined {\n switch (view) {\n case \"overview\":\n return \"/overview\";\n case \"apps\":\n return \"/apps\";\n case \"metrics\":\n case \"usage\":\n return \"/metrics\";\n case \"new-app\":\n case \"create-app\":\n return \"/new-app\";\n case \"vault\":\n case \"secrets\":\n return \"/vault\";\n case \"integrations\":\n return \"/integrations\";\n case \"workspace\":\n case \"resources\":\n return \"/workspace\";\n case \"agents\":\n return \"/agents\";\n case \"messaging\":\n return \"/messaging\";\n case \"destinations\":\n case \"routes\":\n return \"/destinations\";\n case \"identities\":\n return \"/identities\";\n case \"approvals\":\n return \"/approvals\";\n case \"audit\":\n return \"/audit\";\n case \"dreams\":\n return \"/dreams\";\n case \"thread-debug\":\n case \"threads\":\n return \"/thread-debug\";\n case \"team\":\n return \"/team\";\n default:\n return resolveExtensionPath(view, extensions);\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catch-all-target.d.ts","sourceRoot":"","sources":["../../src/lib/catch-all-target.ts"],"names":[],"mappings":"AAoDA,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA8ClE"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { getBuiltinAgents, loadWorkspaceAppsManifest, } from "@agent-native/core/server/agent-discovery";
|
|
2
|
+
/**
|
|
3
|
+
* Resolve where `/dispatch/<appId>` should bounce to when it doesn't match
|
|
4
|
+
* an explicit dispatch route. Used by the `$appId` catch-all route loader.
|
|
5
|
+
*
|
|
6
|
+
* Resolution order:
|
|
7
|
+
*
|
|
8
|
+
* 1. Workspace apps manifest (env, .agent-native/workspace-apps.json, or a
|
|
9
|
+
* filesystem scan of `apps/`).
|
|
10
|
+
* - `app.url` (absolute URL — externally hosted workspace app) wins if
|
|
11
|
+
* present.
|
|
12
|
+
* - Otherwise the `app.path` mounted under the workspace gateway is
|
|
13
|
+
* used. Path is normalized to a leading slash if missing
|
|
14
|
+
* (e.g. manifest entry `path: "my-forms"` → `/my-forms`), so an app
|
|
15
|
+
* whose mounted path differs from its id ends up at the right place
|
|
16
|
+
* instead of being silently rewritten to `/${appId}`.
|
|
17
|
+
* - Bare entry with no path / url falls back to `/${appId}`.
|
|
18
|
+
* 2. First-party template registry. When no workspace manifest matches
|
|
19
|
+
* (framework dev with each template on its own port, hosted dispatch
|
|
20
|
+
* with no sibling apps), return the matching template's deploy URL —
|
|
21
|
+
* dev URL in development (e.g. http://localhost:8084 for forms), prod
|
|
22
|
+
* URL in production (e.g. https://forms.agent-native.com).
|
|
23
|
+
*
|
|
24
|
+
* Returns `null` if neither lookup matches, letting the route render its
|
|
25
|
+
* "Page not found" pane.
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* Validate `app.url` is an absolute http(s) URL before we trust it as a
|
|
29
|
+
* redirect target. A bare hostname (`"forms.example.com"`) or a
|
|
30
|
+
* `javascript:` scheme would otherwise get returned verbatim from
|
|
31
|
+
* `resolveCatchAllTarget` and produce a broken redirect (or a phishing
|
|
32
|
+
* vector). Mirrors `normalizeWorkspaceAppUrl` in
|
|
33
|
+
* `packages/core/src/deploy/workspace-deploy.ts` — but inlined to avoid
|
|
34
|
+
* pulling the deploy CLI module into a runtime path.
|
|
35
|
+
*/
|
|
36
|
+
function validatedAbsoluteUrl(value) {
|
|
37
|
+
if (typeof value !== "string" || !value.trim())
|
|
38
|
+
return undefined;
|
|
39
|
+
try {
|
|
40
|
+
const parsed = new URL(value.trim());
|
|
41
|
+
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
return parsed.toString().replace(/\/$/, "");
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
export function resolveCatchAllTarget(appId) {
|
|
51
|
+
const apps = loadWorkspaceAppsManifest();
|
|
52
|
+
if (apps) {
|
|
53
|
+
const app = apps.find((entry) => entry?.id === appId);
|
|
54
|
+
if (app) {
|
|
55
|
+
// Explicit externally-hosted URL wins. Workspaces that point at a
|
|
56
|
+
// remote deploy (e.g. a sibling app on Netlify) set `url` and we
|
|
57
|
+
// should bounce the user there rather than mounting a local path
|
|
58
|
+
// that doesn't exist inside the gateway. Validate the URL first —
|
|
59
|
+
// a bare hostname or non-http(s) scheme would produce a broken
|
|
60
|
+
// redirect (and a `javascript:` value would be a phishing vector).
|
|
61
|
+
const url = validatedAbsoluteUrl(app.url);
|
|
62
|
+
if (url) {
|
|
63
|
+
return url;
|
|
64
|
+
}
|
|
65
|
+
// Fall back to the mounted path. Normalize to leading slash so an
|
|
66
|
+
// entry whose path differs from its id (e.g. `id: "forms"`,
|
|
67
|
+
// `path: "my-forms"`) still lands on the correct gateway mount —
|
|
68
|
+
// not on `/${appId}`, which would silently route to the wrong app.
|
|
69
|
+
//
|
|
70
|
+
// Reject scheme-relative paths. Three variants reach this point —
|
|
71
|
+
// all of them get collapsed to a single leading slash so the
|
|
72
|
+
// redirect stays on the gateway:
|
|
73
|
+
//
|
|
74
|
+
// `//evil.example` — network-path reference, browser treats as
|
|
75
|
+
// absolute (https://evil.example).
|
|
76
|
+
// `/\evil.example` — browsers normalize backslashes to forward
|
|
77
|
+
// slashes during URL parsing, same result.
|
|
78
|
+
// `\/evil.example` — same idea, leading-backslash variant.
|
|
79
|
+
//
|
|
80
|
+
// The manifest parser only checks `startsWith("/")` for the first
|
|
81
|
+
// case, and even that allows `//evil…`. Defend in depth here by
|
|
82
|
+
// collapsing any run of leading slashes-or-backslashes to one
|
|
83
|
+
// forward slash. Same phishing vector that `validatedAbsoluteUrl`
|
|
84
|
+
// closes for `app.url`.
|
|
85
|
+
if (typeof app.path === "string" && app.path.trim()) {
|
|
86
|
+
const normalized = app.path.trim().replace(/^[/\\]+/, "/");
|
|
87
|
+
return normalized.startsWith("/") ? normalized : `/${normalized}`;
|
|
88
|
+
}
|
|
89
|
+
return `/${appId}`;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
const builtin = getBuiltinAgents("dispatch").find((agent) => agent.id === appId);
|
|
93
|
+
return builtin?.url ?? null;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=catch-all-target.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catch-all-target.js","sourceRoot":"","sources":["../../src/lib/catch-all-target.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,yBAAyB,GAC1B,MAAM,2CAA2C,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH;;;;;;;;GAQG;AACH,SAAS,oBAAoB,CAAC,KAAc;IAC1C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;QAAE,OAAO,SAAS,CAAC;IACjE,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;QACrC,IAAI,MAAM,CAAC,QAAQ,KAAK,OAAO,IAAI,MAAM,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;YAChE,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC9C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,KAAa;IACjD,MAAM,IAAI,GAAG,yBAAyB,EAAE,CAAC;IACzC,IAAI,IAAI,EAAE,CAAC;QACT,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,EAAE,KAAK,KAAK,CAAC,CAAC;QACtD,IAAI,GAAG,EAAE,CAAC;YACR,kEAAkE;YAClE,iEAAiE;YACjE,iEAAiE;YACjE,kEAAkE;YAClE,+DAA+D;YAC/D,mEAAmE;YACnE,MAAM,GAAG,GAAG,oBAAoB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC1C,IAAI,GAAG,EAAE,CAAC;gBACR,OAAO,GAAG,CAAC;YACb,CAAC;YACD,kEAAkE;YAClE,4DAA4D;YAC5D,iEAAiE;YACjE,mEAAmE;YACnE,EAAE;YACF,kEAAkE;YAClE,6DAA6D;YAC7D,iCAAiC;YACjC,EAAE;YACF,mEAAmE;YACnE,0DAA0D;YAC1D,mEAAmE;YACnE,kEAAkE;YAClE,+DAA+D;YAC/D,EAAE;YACF,kEAAkE;YAClE,gEAAgE;YAChE,8DAA8D;YAC9D,kEAAkE;YAClE,wBAAwB;YACxB,IAAI,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;gBACpD,MAAM,UAAU,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;gBAC3D,OAAO,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,UAAU,EAAE,CAAC;YACpE,CAAC;YACD,OAAO,IAAI,KAAK,EAAE,CAAC;QACrB,CAAC;IACH,CAAC;IACD,MAAM,OAAO,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC,IAAI,CAC/C,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,KAAK,CAC9B,CAAC;IACF,OAAO,OAAO,EAAE,GAAG,IAAI,IAAI,CAAC;AAC9B,CAAC","sourcesContent":["import {\n getBuiltinAgents,\n loadWorkspaceAppsManifest,\n} from \"@agent-native/core/server/agent-discovery\";\n\n/**\n * Resolve where `/dispatch/<appId>` should bounce to when it doesn't match\n * an explicit dispatch route. Used by the `$appId` catch-all route loader.\n *\n * Resolution order:\n *\n * 1. Workspace apps manifest (env, .agent-native/workspace-apps.json, or a\n * filesystem scan of `apps/`).\n * - `app.url` (absolute URL — externally hosted workspace app) wins if\n * present.\n * - Otherwise the `app.path` mounted under the workspace gateway is\n * used. Path is normalized to a leading slash if missing\n * (e.g. manifest entry `path: \"my-forms\"` → `/my-forms`), so an app\n * whose mounted path differs from its id ends up at the right place\n * instead of being silently rewritten to `/${appId}`.\n * - Bare entry with no path / url falls back to `/${appId}`.\n * 2. First-party template registry. When no workspace manifest matches\n * (framework dev with each template on its own port, hosted dispatch\n * with no sibling apps), return the matching template's deploy URL —\n * dev URL in development (e.g. http://localhost:8084 for forms), prod\n * URL in production (e.g. https://forms.agent-native.com).\n *\n * Returns `null` if neither lookup matches, letting the route render its\n * \"Page not found\" pane.\n */\n/**\n * Validate `app.url` is an absolute http(s) URL before we trust it as a\n * redirect target. A bare hostname (`\"forms.example.com\"`) or a\n * `javascript:` scheme would otherwise get returned verbatim from\n * `resolveCatchAllTarget` and produce a broken redirect (or a phishing\n * vector). Mirrors `normalizeWorkspaceAppUrl` in\n * `packages/core/src/deploy/workspace-deploy.ts` — but inlined to avoid\n * pulling the deploy CLI module into a runtime path.\n */\nfunction validatedAbsoluteUrl(value: unknown): string | undefined {\n if (typeof value !== \"string\" || !value.trim()) return undefined;\n try {\n const parsed = new URL(value.trim());\n if (parsed.protocol !== \"http:\" && parsed.protocol !== \"https:\") {\n return undefined;\n }\n return parsed.toString().replace(/\\/$/, \"\");\n } catch {\n return undefined;\n }\n}\n\nexport function resolveCatchAllTarget(appId: string): string | null {\n const apps = loadWorkspaceAppsManifest();\n if (apps) {\n const app = apps.find((entry) => entry?.id === appId);\n if (app) {\n // Explicit externally-hosted URL wins. Workspaces that point at a\n // remote deploy (e.g. a sibling app on Netlify) set `url` and we\n // should bounce the user there rather than mounting a local path\n // that doesn't exist inside the gateway. Validate the URL first —\n // a bare hostname or non-http(s) scheme would produce a broken\n // redirect (and a `javascript:` value would be a phishing vector).\n const url = validatedAbsoluteUrl(app.url);\n if (url) {\n return url;\n }\n // Fall back to the mounted path. Normalize to leading slash so an\n // entry whose path differs from its id (e.g. `id: \"forms\"`,\n // `path: \"my-forms\"`) still lands on the correct gateway mount —\n // not on `/${appId}`, which would silently route to the wrong app.\n //\n // Reject scheme-relative paths. Three variants reach this point —\n // all of them get collapsed to a single leading slash so the\n // redirect stays on the gateway:\n //\n // `//evil.example` — network-path reference, browser treats as\n // absolute (https://evil.example).\n // `/\\evil.example` — browsers normalize backslashes to forward\n // slashes during URL parsing, same result.\n // `\\/evil.example` — same idea, leading-backslash variant.\n //\n // The manifest parser only checks `startsWith(\"/\")` for the first\n // case, and even that allows `//evil…`. Defend in depth here by\n // collapsing any run of leading slashes-or-backslashes to one\n // forward slash. Same phishing vector that `validatedAbsoluteUrl`\n // closes for `app.url`.\n if (typeof app.path === \"string\" && app.path.trim()) {\n const normalized = app.path.trim().replace(/^[/\\\\]+/, \"/\");\n return normalized.startsWith(\"/\") ? normalized : `/${normalized}`;\n }\n return `/${appId}`;\n }\n }\n const builtin = getBuiltinAgents(\"dispatch\").find(\n (agent) => agent.id === appId,\n );\n return builtin?.url ?? null;\n}\n"]}
|
package/dist/lib/utils.d.ts
CHANGED
package/dist/lib/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAC;AAG7C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
|
package/dist/lib/utils.js
CHANGED
package/dist/lib/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,IAAI,EAAE,MAAM,MAAM,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,MAAM,UAAU,EAAE,CAAC,GAAG,MAAoB;IACxC,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AAC/B,CAAC","sourcesContent":["import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"]}
|
|
@@ -5,10 +5,19 @@ export interface WorkspaceAppSummary {
|
|
|
5
5
|
path: string;
|
|
6
6
|
url?: string | null;
|
|
7
7
|
isDispatch?: boolean;
|
|
8
|
+
audience?: "internal" | "public";
|
|
9
|
+
publicPaths?: string[];
|
|
10
|
+
protectedPaths?: string[];
|
|
8
11
|
status?: "ready" | "pending";
|
|
9
12
|
statusLabel?: string;
|
|
10
13
|
builderUrl?: string | null;
|
|
11
14
|
branchName?: string | null;
|
|
15
|
+
createdAt?: string | null;
|
|
16
|
+
agentCardUrl?: string | null;
|
|
17
|
+
agentCardReachable?: boolean;
|
|
18
|
+
a2aEndpointUrl?: string | null;
|
|
19
|
+
agentName?: string | null;
|
|
20
|
+
agentSkillsCount?: number | null;
|
|
12
21
|
archived?: boolean;
|
|
13
22
|
}
|
|
14
23
|
export declare function workspaceAppHref(app: WorkspaceAppSummary): string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-apps.d.ts","sourceRoot":"","sources":["../../src/lib/workspace-apps.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,UAAU,CAAC,E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AS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,mBAAmB,GAAG,MAAM,GAAG,IAAI,CAGxE;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,mBAAmB,GAAG,OAAO,CAEtE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-apps.js","sourceRoot":"","sources":["../../src/lib/workspace-apps.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"workspace-apps.js","sourceRoot":"","sources":["../../src/lib/workspace-apps.ts"],"names":[],"mappings":"AAuBA,MAAM,UAAU,gBAAgB,CAAC,GAAwB;IACvD,IAAI,GAAG,CAAC,MAAM,KAAK,SAAS;QAAE,OAAO,GAAG,CAAC,UAAU,IAAI,IAAI,CAAC;IAC5D,OAAO,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,GAAG,IAAI,IAAI,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,GAAwB;IAC3D,OAAO,GAAG,CAAC,MAAM,KAAK,SAAS,IAAI,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC;AACtD,CAAC","sourcesContent":["export interface WorkspaceAppSummary {\n id: string;\n name: string;\n description?: string;\n path: string;\n url?: string | null;\n isDispatch?: boolean;\n audience?: \"internal\" | \"public\";\n publicPaths?: string[];\n protectedPaths?: string[];\n status?: \"ready\" | \"pending\";\n statusLabel?: string;\n builderUrl?: string | null;\n branchName?: string | null;\n createdAt?: string | null;\n agentCardUrl?: string | null;\n agentCardReachable?: boolean;\n a2aEndpointUrl?: string | null;\n agentName?: string | null;\n agentSkillsCount?: number | null;\n archived?: boolean;\n}\n\nexport function workspaceAppHref(app: WorkspaceAppSummary): string | null {\n if (app.status === \"pending\") return app.builderUrl || null;\n return app.path || app.url || null;\n}\n\nexport function isPendingBuilderHref(app: WorkspaceAppSummary): boolean {\n return app.status === \"pending\" && !!app.builderUrl;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/routes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAgB,MAAM,0BAA0B,CAAC;AAE1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/routes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAgB,MAAM,0BAA0B,CAAC;AAE1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,cAAc,EAAE,WA2B5B,CAAC"}
|
package/dist/routes/index.js
CHANGED
|
@@ -45,6 +45,7 @@ export const dispatchRoutes = [
|
|
|
45
45
|
route("approval", "./pages/approval.js"),
|
|
46
46
|
route("approvals", "./pages/approvals.js"),
|
|
47
47
|
route("audit", "./pages/audit.js"),
|
|
48
|
+
route("dreams", "./pages/dreams.js"),
|
|
48
49
|
route("thread-debug", "./pages/thread-debug.js"),
|
|
49
50
|
route("team", "./pages/team.js"),
|
|
50
51
|
route("extensions", "./pages/extensions._index.js"),
|
package/dist/routes/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/routes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAE1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,CAAC,MAAM,cAAc,GAAgB;IACzC,KAAK,CAAC,mBAAmB,CAAC;IAC1B,KAAK,CAAC,UAAU,EAAE,qBAAqB,CAAC;IACxC,KAAK,CAAC,SAAS,EAAE,oBAAoB,CAAC;IACtC,KAAK,CAAC,MAAM,EAAE,iBAAiB,CAAC;IAChC,KAAK,CAAC,aAAa,EAAE,wBAAwB,CAAC;IAC9C,KAAK,CAAC,SAAS,EAAE,oBAAoB,CAAC;IACtC,KAAK,CAAC,OAAO,EAAE,kBAAkB,CAAC;IAClC,KAAK,CAAC,cAAc,EAAE,yBAAyB,CAAC;IAChD,KAAK,CAAC,QAAQ,EAAE,mBAAmB,CAAC;IACpC,KAAK,CAAC,WAAW,EAAE,sBAAsB,CAAC;IAC1C,KAAK,CAAC,WAAW,EAAE,sBAAsB,CAAC;IAC1C,KAAK,CAAC,cAAc,EAAE,yBAAyB,CAAC;IAChD,KAAK,CAAC,YAAY,EAAE,uBAAuB,CAAC;IAC5C,KAAK,CAAC,UAAU,EAAE,qBAAqB,CAAC;IACxC,KAAK,CAAC,WAAW,EAAE,sBAAsB,CAAC;IAC1C,KAAK,CAAC,OAAO,EAAE,kBAAkB,CAAC;IAClC,KAAK,CAAC,cAAc,EAAE,yBAAyB,CAAC;IAChD,KAAK,CAAC,MAAM,EAAE,iBAAiB,CAAC;IAChC,KAAK,CAAC,YAAY,EAAE,8BAA8B,CAAC;IACnD,KAAK,CAAC,gBAAgB,EAAE,2BAA2B,CAAC;IACpD,yEAAyE;IACzE,0EAA0E;IAC1E,2EAA2E;IAC3E,wEAAwE;IACxE,KAAK,CAAC,QAAQ,EAAE,mBAAmB,CAAC;CACrC,CAAC","sourcesContent":["import { type RouteConfig, route, index } from \"@react-router/dev/routes\";\n\n/**\n * Dispatch's routes as a programmatic `RouteConfig[]`. Splat into the\n * consumer's `app/routes.ts`:\n *\n * ```ts\n * import { type RouteConfig } from \"@react-router/dev/routes\";\n * import { dispatchRoutes } from \"@agent-native/dispatch/routes\";\n *\n * export default [\n * ...localRoutes, // consumer's own routes win on collision\n * ...dispatchRoutes, // dispatch fills in everything else\n * ] satisfies RouteConfig;\n * ```\n *\n * Route precedence: React Router 7 matches in declaration order, so\n * placing `dispatchRoutes` LAST means consumer-defined routes with the\n * same path take precedence. To override a single dispatch route, define\n * it in your local routes; to keep it, omit it.\n *\n * The `file` paths below resolve relative to this file at runtime — they\n * point into `packages/dispatch/dist/routes/pages/*.js` after build.\n *\n * Naming maps the original flatRoutes file conventions:\n * `_index.tsx` → `index(...)`\n * `<name>.tsx` → `route(\"<name>\", ...)`\n * `<a>.$<param>.tsx` → `route(\"<a>/:<param>\", ...)`\n * `<a>._index.tsx` → flattened as `route(\"<a>\", ...)` (workspace\n * versions are bare and don't wrap a parent layout)\n */\nexport const dispatchRoutes: RouteConfig = [\n index(\"./pages/_index.js\"),\n route(\"overview\", \"./pages/overview.js\"),\n route(\"metrics\", \"./pages/metrics.js\"),\n route(\"apps\", \"./pages/apps.js\"),\n route(\"apps/:appId\", \"./pages/apps.$appId.js\"),\n route(\"new-app\", \"./pages/new-app.js\"),\n route(\"vault\", \"./pages/vault.js\"),\n route(\"integrations\", \"./pages/integrations.js\"),\n route(\"agents\", \"./pages/agents.js\"),\n route(\"workspace\", \"./pages/workspace.js\"),\n route(\"messaging\", \"./pages/messaging.js\"),\n route(\"destinations\", \"./pages/destinations.js\"),\n route(\"identities\", \"./pages/identities.js\"),\n route(\"approval\", \"./pages/approval.js\"),\n route(\"approvals\", \"./pages/approvals.js\"),\n route(\"audit\", \"./pages/audit.js\"),\n route(\"thread-debug\", \"./pages/thread-debug.js\"),\n route(\"team\", \"./pages/team.js\"),\n route(\"extensions\", \"./pages/extensions._index.js\"),\n route(\"extensions/:id\", \"./pages/extensions.$id.js\"),\n // Catch-all for /:appId — bounces /dispatch/<appId> to /<appId> when the\n // segment names a workspace app sibling (e.g. Builder.io routing a \"go to\n // /todo\" call through Dispatch's mount). Declared last so React Router 7's\n // specificity ranking still matches explicit static routes above first.\n route(\":appId\", \"./pages/$appId.js\"),\n];\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/routes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,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\n * Dispatch's routes as a programmatic `RouteConfig[]`. Splat into the\n * consumer's `app/routes.ts`:\n *\n * ```ts\n * import { type RouteConfig } from \"@react-router/dev/routes\";\n * import { dispatchRoutes } from \"@agent-native/dispatch/routes\";\n *\n * export default [\n * ...localRoutes, // consumer's own routes win on collision\n * ...dispatchRoutes, // dispatch fills in everything else\n * ] satisfies RouteConfig;\n * ```\n *\n * Route precedence: React Router 7 matches in declaration order, so\n * placing `dispatchRoutes` LAST means consumer-defined routes with the\n * same path take precedence. To override a single dispatch route, define\n * it in your local routes; to keep it, omit it.\n *\n * The `file` paths below resolve relative to this file at runtime — they\n * point into `packages/dispatch/dist/routes/pages/*.js` after build.\n *\n * Naming maps the original flatRoutes file conventions:\n * `_index.tsx` → `index(...)`\n * `<name>.tsx` → `route(\"<name>\", ...)`\n * `<a>.$<param>.tsx` → `route(\"<a>/:<param>\", ...)`\n * `<a>._index.tsx` → flattened as `route(\"<a>\", ...)` (workspace\n * versions are bare and don't wrap a parent layout)\n */\nexport const dispatchRoutes: RouteConfig = [\n index(\"./pages/_index.js\"),\n route(\"overview\", \"./pages/overview.js\"),\n route(\"metrics\", \"./pages/metrics.js\"),\n route(\"apps\", \"./pages/apps.js\"),\n route(\"apps/:appId\", \"./pages/apps.$appId.js\"),\n route(\"new-app\", \"./pages/new-app.js\"),\n route(\"vault\", \"./pages/vault.js\"),\n route(\"integrations\", \"./pages/integrations.js\"),\n route(\"agents\", \"./pages/agents.js\"),\n route(\"workspace\", \"./pages/workspace.js\"),\n route(\"messaging\", \"./pages/messaging.js\"),\n route(\"destinations\", \"./pages/destinations.js\"),\n route(\"identities\", \"./pages/identities.js\"),\n route(\"approval\", \"./pages/approval.js\"),\n route(\"approvals\", \"./pages/approvals.js\"),\n route(\"audit\", \"./pages/audit.js\"),\n route(\"dreams\", \"./pages/dreams.js\"),\n route(\"thread-debug\", \"./pages/thread-debug.js\"),\n route(\"team\", \"./pages/team.js\"),\n route(\"extensions\", \"./pages/extensions._index.js\"),\n route(\"extensions/:id\", \"./pages/extensions.$id.js\"),\n // Catch-all for /:appId — bounces /dispatch/<appId> to /<appId> when the\n // segment names a workspace app sibling (e.g. Builder.io routing a \"go to\n // /todo\" call through Dispatch's mount). Declared last so React Router 7's\n // specificity ranking still matches explicit static routes above first.\n route(\":appId\", \"./pages/$appId.js\"),\n];\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type LoaderFunctionArgs } from "react-router";
|
|
1
|
+
import { type ClientLoaderFunctionArgs, type LoaderFunctionArgs } from "react-router";
|
|
2
2
|
export declare function meta(): {
|
|
3
3
|
title: string;
|
|
4
4
|
}[];
|
|
5
5
|
export declare function loader({ params }: LoaderFunctionArgs): any;
|
|
6
|
-
export declare function clientLoader({ params }:
|
|
6
|
+
export declare function clientLoader({ params, serverLoader, }: ClientLoaderFunctionArgs): Promise<unknown>;
|
|
7
7
|
export default function WorkspaceAppCatchAllRoute(): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
//# sourceMappingURL=$appId.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"$appId.d.ts","sourceRoot":"","sources":["../../../src/routes/pages/$appId.tsx"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AAiBtB,wBAAgB,IAAI;;IAEnB;
|
|
1
|
+
{"version":3,"file":"$appId.d.ts","sourceRoot":"","sources":["../../../src/routes/pages/$appId.tsx"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AAiBtB,wBAAgB,IAAI;;IAEnB;AA2CD,wBAAgB,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,kBAAkB,OAQpD;AAED,wBAAsB,YAAY,CAAC,EACjC,MAAM,EACN,YAAY,GACb,EAAE,wBAAwB,oBAS1B;AAED,MAAM,CAAC,OAAO,UAAU,yBAAyB,4CAgGhD"}
|