agent-relay 1.3.0 → 1.3.2
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/.trajectories/active/traj_3yx9dy148mge.json +42 -0
- package/.trajectories/completed/2026-01/traj_1g7yx6qtg4ai.json +49 -0
- package/.trajectories/completed/2026-01/traj_1g7yx6qtg4ai.md +31 -0
- package/.trajectories/completed/2026-01/traj_4qwd4zmhfwp4.json +49 -0
- package/.trajectories/completed/2026-01/traj_4qwd4zmhfwp4.md +31 -0
- package/.trajectories/completed/2026-01/traj_6unwwmgyj5sq.json +109 -0
- package/.trajectories/completed/2026-01/traj_a0tqx8biw9c4.json +49 -0
- package/.trajectories/completed/2026-01/traj_a0tqx8biw9c4.md +31 -0
- package/.trajectories/completed/2026-01/traj_ax8uungxz2qh.json +66 -0
- package/.trajectories/completed/2026-01/traj_ax8uungxz2qh.md +36 -0
- package/.trajectories/completed/2026-01/traj_c9izbh2snpzf.json +49 -0
- package/.trajectories/completed/2026-01/traj_c9izbh2snpzf.md +31 -0
- package/.trajectories/completed/2026-01/traj_cpn70dw066nt.json +65 -0
- package/.trajectories/completed/2026-01/traj_cpn70dw066nt.md +37 -0
- package/.trajectories/completed/2026-01/traj_erglv2f8t9eh.json +36 -0
- package/.trajectories/completed/2026-01/traj_erglv2f8t9eh.md +21 -0
- package/.trajectories/completed/2026-01/traj_he75f24d1xfm.json +101 -0
- package/.trajectories/completed/2026-01/traj_he75f24d1xfm.md +52 -0
- package/.trajectories/completed/2026-01/traj_lgtodco7dp1n.json +61 -0
- package/.trajectories/completed/2026-01/traj_lgtodco7dp1n.md +36 -0
- package/.trajectories/completed/2026-01/traj_oszg9flv74pk.json +73 -0
- package/.trajectories/completed/2026-01/traj_oszg9flv74pk.md +41 -0
- package/.trajectories/completed/2026-01/traj_pulomd3y8cvj.json +77 -0
- package/.trajectories/completed/2026-01/traj_pulomd3y8cvj.md +42 -0
- package/.trajectories/completed/2026-01/traj_rsavt0jipi3c.json +109 -0
- package/.trajectories/completed/2026-01/traj_rsavt0jipi3c.md +56 -0
- package/.trajectories/completed/2026-01/traj_x721m1j9rzup.json +113 -0
- package/.trajectories/completed/2026-01/traj_x721m1j9rzup.md +57 -0
- package/.trajectories/completed/2026-01/traj_xjqvmep5ed3h.json +61 -0
- package/.trajectories/completed/2026-01/traj_xjqvmep5ed3h.md +36 -0
- package/.trajectories/completed/2026-01/traj_y7n6hfbf7dmg.json +49 -0
- package/.trajectories/completed/2026-01/traj_y7n6hfbf7dmg.md +31 -0
- package/.trajectories/completed/2026-01/traj_yvfkwnkdiso2.json +49 -0
- package/.trajectories/completed/2026-01/traj_yvfkwnkdiso2.md +31 -0
- package/.trajectories/index.json +140 -1
- package/TRAIL_GIT_AUTH_FIX.md +113 -0
- package/deploy/workspace/codex.config.toml +1 -1
- package/deploy/workspace/entrypoint.sh +20 -79
- package/deploy/workspace/gh-relay +156 -0
- package/deploy/workspace/git-credential-relay +5 -1
- package/dist/bridge/multi-project-client.js +13 -10
- package/dist/bridge/spawner.d.ts +2 -0
- package/dist/bridge/spawner.js +19 -1
- package/dist/bridge/types.d.ts +2 -0
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +115 -69
- package/dist/cloud/api/admin.js +16 -3
- package/dist/cloud/api/codex-auth-helper.js +28 -8
- package/dist/cloud/api/consensus.d.ts +13 -0
- package/dist/cloud/api/consensus.js +259 -0
- package/dist/cloud/api/daemons.js +205 -1
- package/dist/cloud/api/git.js +37 -7
- package/dist/cloud/api/onboarding.js +4 -1
- package/dist/cloud/api/provider-env.d.ts +5 -0
- package/dist/cloud/api/provider-env.js +27 -0
- package/dist/cloud/api/providers.js +2 -0
- package/dist/cloud/api/test-helpers.js +130 -0
- package/dist/cloud/api/workspaces.js +38 -3
- package/dist/cloud/db/bulk-ingest.d.ts +88 -0
- package/dist/cloud/db/bulk-ingest.js +268 -0
- package/dist/cloud/db/drizzle.d.ts +33 -0
- package/dist/cloud/db/drizzle.js +174 -2
- package/dist/cloud/db/index.d.ts +24 -5
- package/dist/cloud/db/index.js +19 -4
- package/dist/cloud/db/schema.d.ts +397 -3
- package/dist/cloud/db/schema.js +75 -1
- package/dist/cloud/provisioner/index.d.ts +8 -0
- package/dist/cloud/provisioner/index.js +256 -50
- package/dist/cloud/server.js +47 -3
- package/dist/cloud/services/index.d.ts +1 -0
- package/dist/cloud/services/index.js +2 -0
- package/dist/cloud/services/nango.d.ts +3 -4
- package/dist/cloud/services/nango.js +11 -33
- package/dist/cloud/services/workspace-keepalive.d.ts +76 -0
- package/dist/cloud/services/workspace-keepalive.js +234 -0
- package/dist/config/relay-config.d.ts +23 -0
- package/dist/config/relay-config.js +23 -0
- package/dist/daemon/agent-manager.d.ts +20 -1
- package/dist/daemon/agent-manager.js +47 -0
- package/dist/daemon/agent-registry.js +4 -4
- package/dist/daemon/agent-signing.d.ts +158 -0
- package/dist/daemon/agent-signing.js +523 -0
- package/dist/daemon/api.js +18 -1
- package/dist/daemon/cli-auth.d.ts +4 -1
- package/dist/daemon/cli-auth.js +55 -11
- package/dist/daemon/cloud-sync.d.ts +47 -1
- package/dist/daemon/cloud-sync.js +152 -3
- package/dist/daemon/connection.d.ts +28 -0
- package/dist/daemon/connection.js +98 -15
- package/dist/daemon/consensus-integration.d.ts +167 -0
- package/dist/daemon/consensus-integration.js +371 -0
- package/dist/daemon/consensus.d.ts +271 -0
- package/dist/daemon/consensus.js +632 -0
- package/dist/daemon/delivery-tracker.d.ts +34 -0
- package/dist/daemon/delivery-tracker.js +104 -0
- package/dist/daemon/enhanced-features.d.ts +118 -0
- package/dist/daemon/enhanced-features.js +178 -0
- package/dist/daemon/index.d.ts +4 -0
- package/dist/daemon/index.js +5 -0
- package/dist/daemon/rate-limiter.d.ts +68 -0
- package/dist/daemon/rate-limiter.js +130 -0
- package/dist/daemon/router.d.ts +18 -11
- package/dist/daemon/router.js +55 -111
- package/dist/daemon/server.d.ts +13 -1
- package/dist/daemon/server.js +71 -9
- package/dist/daemon/sync-queue.d.ts +116 -0
- package/dist/daemon/sync-queue.js +361 -0
- package/dist/health-worker-manager.d.ts +62 -0
- package/dist/health-worker-manager.js +144 -0
- package/dist/health-worker.d.ts +9 -0
- package/dist/health-worker.js +79 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +5 -1
- package/dist/memory/context-compaction.d.ts +156 -0
- package/dist/memory/context-compaction.js +453 -0
- package/dist/memory/index.d.ts +1 -0
- package/dist/memory/index.js +1 -0
- package/dist/protocol/channels.js +4 -4
- package/dist/protocol/framing.d.ts +72 -10
- package/dist/protocol/framing.js +194 -25
- package/dist/storage/adapter.d.ts +8 -1
- package/dist/storage/adapter.js +11 -0
- package/dist/storage/batched-sqlite-adapter.d.ts +71 -0
- package/dist/storage/batched-sqlite-adapter.js +183 -0
- package/dist/storage/dead-letter-queue.d.ts +196 -0
- package/dist/storage/dead-letter-queue.js +427 -0
- package/dist/storage/dlq-adapter.d.ts +195 -0
- package/dist/storage/dlq-adapter.js +664 -0
- package/dist/trajectory/config.d.ts +32 -14
- package/dist/trajectory/config.js +38 -16
- package/dist/trajectory/integration.js +217 -64
- package/dist/utils/git-remote.d.ts +47 -0
- package/dist/utils/git-remote.js +125 -0
- package/dist/utils/id-generator.d.ts +35 -0
- package/dist/utils/id-generator.js +60 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/precompiled-patterns.d.ts +110 -0
- package/dist/utils/precompiled-patterns.js +322 -0
- package/dist/wrapper/auth-detection.js +1 -1
- package/dist/wrapper/base-wrapper.d.ts +36 -0
- package/dist/wrapper/base-wrapper.js +48 -2
- package/dist/wrapper/client.d.ts +14 -4
- package/dist/wrapper/client.js +84 -31
- package/dist/wrapper/idle-detector.d.ts +102 -0
- package/dist/wrapper/idle-detector.js +279 -0
- package/dist/wrapper/parser.d.ts +4 -0
- package/dist/wrapper/parser.js +19 -1
- package/dist/wrapper/pty-wrapper.d.ts +7 -1
- package/dist/wrapper/pty-wrapper.js +51 -27
- package/dist/wrapper/tmux-wrapper.d.ts +12 -1
- package/dist/wrapper/tmux-wrapper.js +65 -17
- package/package.json +5 -5
- package/scripts/run-migrations.js +43 -0
- package/scripts/verify-schema.js +134 -0
- package/tests/benchmarks/protocol.bench.ts +310 -0
- package/dist/dashboard/out/404.html +0 -1
- package/dist/dashboard/out/_next/static/T1tgCqVWHFIkV7ClEtzD7/_buildManifest.js +0 -1
- package/dist/dashboard/out/_next/static/T1tgCqVWHFIkV7ClEtzD7/_ssgManifest.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/116-2502180def231162.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/117-f7b8ab0809342e77.js +0 -2
- package/dist/dashboard/out/_next/static/chunks/282-980c2eb8fff20123.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/532-bace199897eeab37.js +0 -9
- package/dist/dashboard/out/_next/static/chunks/648-5cc6e1921389a58a.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/766-b54f0853794b78c3.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/83-b51836037078006c.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/891-6cd50de1224f70bb.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/899-bb19a9b3d9b39ea6.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/_not-found/page-53b8a69f76db17d0.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/app/onboarding/page-8939b0fc700f7eca.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/app/page-5af1b6b439858aa6.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/connect-repos/page-f45ecbc3e06134fc.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/history/page-8c8bed33beb2bf1c.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/layout-2433bb48965f4333.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/login/page-16f3b49e55b1e0ed.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/metrics/page-ac39dc0cc3c26fa7.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/page-4a5938c18a11a654.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/pricing/page-982a7000fee44014.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/providers/page-ac3a6ac433fd6001.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/providers/setup/[provider]/page-09f9caae98a18c09.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/signup/page-547dd0ca55ecd0ba.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/e868780c-48e5f147c90a3a41.js +0 -18
- package/dist/dashboard/out/_next/static/chunks/fd9d1056-609918ca7b6280bb.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/framework-f66176bb897dc684.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/main-2ee6beb2ae96d210.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/main-app-5d692157a8eb1fd9.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/pages/_app-72b849fbd24ac258.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/pages/_error-7ba65e1336b92748.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/polyfills-42372ed130431b0a.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/webpack-1cdd8ed57114d5e1.js +0 -1
- package/dist/dashboard/out/_next/static/css/85d2af9c7ac74d62.css +0 -1
- package/dist/dashboard/out/_next/static/css/fe4b28883eeff359.css +0 -1
- package/dist/dashboard/out/alt-logos/agent-relay-logo-128.png +0 -0
- package/dist/dashboard/out/alt-logos/agent-relay-logo-256.png +0 -0
- package/dist/dashboard/out/alt-logos/agent-relay-logo-32.png +0 -0
- package/dist/dashboard/out/alt-logos/agent-relay-logo-512.png +0 -0
- package/dist/dashboard/out/alt-logos/agent-relay-logo-64.png +0 -0
- package/dist/dashboard/out/alt-logos/agent-relay-logo.svg +0 -45
- package/dist/dashboard/out/alt-logos/logo.svg +0 -38
- package/dist/dashboard/out/alt-logos/monogram-logo-128.png +0 -0
- package/dist/dashboard/out/alt-logos/monogram-logo-256.png +0 -0
- package/dist/dashboard/out/alt-logos/monogram-logo-32.png +0 -0
- package/dist/dashboard/out/alt-logos/monogram-logo-512.png +0 -0
- package/dist/dashboard/out/alt-logos/monogram-logo-64.png +0 -0
- package/dist/dashboard/out/alt-logos/monogram-logo.svg +0 -38
- package/dist/dashboard/out/app/onboarding.html +0 -1
- package/dist/dashboard/out/app/onboarding.txt +0 -7
- package/dist/dashboard/out/app.html +0 -1
- package/dist/dashboard/out/app.txt +0 -7
- package/dist/dashboard/out/apple-icon.png +0 -0
- package/dist/dashboard/out/connect-repos.html +0 -1
- package/dist/dashboard/out/connect-repos.txt +0 -7
- package/dist/dashboard/out/history.html +0 -1
- package/dist/dashboard/out/history.txt +0 -7
- package/dist/dashboard/out/index.html +0 -1
- package/dist/dashboard/out/index.txt +0 -7
- package/dist/dashboard/out/login.html +0 -6
- package/dist/dashboard/out/login.txt +0 -7
- package/dist/dashboard/out/metrics.html +0 -1
- package/dist/dashboard/out/metrics.txt +0 -7
- package/dist/dashboard/out/pricing.html +0 -13
- package/dist/dashboard/out/pricing.txt +0 -7
- package/dist/dashboard/out/providers/setup/claude.html +0 -1
- package/dist/dashboard/out/providers/setup/claude.txt +0 -8
- package/dist/dashboard/out/providers/setup/codex.html +0 -1
- package/dist/dashboard/out/providers/setup/codex.txt +0 -8
- package/dist/dashboard/out/providers.html +0 -1
- package/dist/dashboard/out/providers.txt +0 -7
- package/dist/dashboard/out/signup.html +0 -6
- package/dist/dashboard/out/signup.txt +0 -7
- package/dist/dashboard-server/metrics.d.ts +0 -105
- package/dist/dashboard-server/metrics.js +0 -193
- package/dist/dashboard-server/needs-attention.d.ts +0 -24
- package/dist/dashboard-server/needs-attention.js +0 -78
- package/dist/dashboard-server/server.d.ts +0 -15
- package/dist/dashboard-server/server.js +0 -3776
- package/dist/dashboard-server/start.d.ts +0 -6
- package/dist/dashboard-server/start.js +0 -13
- package/dist/dashboard-server/user-bridge.d.ts +0 -103
- package/dist/dashboard-server/user-bridge.js +0 -189
|
@@ -423,6 +423,7 @@ export declare const githubInstallations: import("drizzle-orm/pg-core").PgTableW
|
|
|
423
423
|
identity: undefined;
|
|
424
424
|
generated: undefined;
|
|
425
425
|
}, {}, {
|
|
426
|
+
size: undefined;
|
|
426
427
|
baseBuilder: import("drizzle-orm/pg-core").PgColumnBuilder<{
|
|
427
428
|
name: "events";
|
|
428
429
|
dataType: "string";
|
|
@@ -431,7 +432,6 @@ export declare const githubInstallations: import("drizzle-orm/pg-core").PgTableW
|
|
|
431
432
|
enumValues: [string, ...string[]];
|
|
432
433
|
driverParam: string;
|
|
433
434
|
}, {}, {}, import("drizzle-orm").ColumnBuilderExtraConfig>;
|
|
434
|
-
size: undefined;
|
|
435
435
|
}>;
|
|
436
436
|
suspended: import("drizzle-orm/pg-core").PgColumn<{
|
|
437
437
|
name: "suspended";
|
|
@@ -617,6 +617,7 @@ export declare const credentials: import("drizzle-orm/pg-core").PgTableWithColum
|
|
|
617
617
|
identity: undefined;
|
|
618
618
|
generated: undefined;
|
|
619
619
|
}, {}, {
|
|
620
|
+
size: undefined;
|
|
620
621
|
baseBuilder: import("drizzle-orm/pg-core").PgColumnBuilder<{
|
|
621
622
|
name: "scopes";
|
|
622
623
|
dataType: "string";
|
|
@@ -625,7 +626,6 @@ export declare const credentials: import("drizzle-orm/pg-core").PgTableWithColum
|
|
|
625
626
|
enumValues: [string, ...string[]];
|
|
626
627
|
driverParam: string;
|
|
627
628
|
}, {}, {}, import("drizzle-orm").ColumnBuilderExtraConfig>;
|
|
628
|
-
size: undefined;
|
|
629
629
|
}>;
|
|
630
630
|
providerAccountId: import("drizzle-orm/pg-core").PgColumn<{
|
|
631
631
|
name: "provider_account_id";
|
|
@@ -993,6 +993,8 @@ export declare const workspacesRelations: import("drizzle-orm").Relations<"works
|
|
|
993
993
|
user: import("drizzle-orm").One<"users", true>;
|
|
994
994
|
members: import("drizzle-orm").Many<"workspace_members">;
|
|
995
995
|
repositories: import("drizzle-orm").Many<"repositories">;
|
|
996
|
+
linkedDaemons: import("drizzle-orm").Many<"linked_daemons">;
|
|
997
|
+
messages: import("drizzle-orm").Many<"agent_messages">;
|
|
996
998
|
}>;
|
|
997
999
|
export declare const workspaceMembers: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
998
1000
|
name: "workspace_members";
|
|
@@ -1654,6 +1656,23 @@ export declare const linkedDaemons: import("drizzle-orm/pg-core").PgTableWithCol
|
|
|
1654
1656
|
identity: undefined;
|
|
1655
1657
|
generated: undefined;
|
|
1656
1658
|
}, {}, {}>;
|
|
1659
|
+
workspaceId: import("drizzle-orm/pg-core").PgColumn<{
|
|
1660
|
+
name: "workspace_id";
|
|
1661
|
+
tableName: "linked_daemons";
|
|
1662
|
+
dataType: "string";
|
|
1663
|
+
columnType: "PgUUID";
|
|
1664
|
+
data: string;
|
|
1665
|
+
driverParam: string;
|
|
1666
|
+
notNull: false;
|
|
1667
|
+
hasDefault: false;
|
|
1668
|
+
isPrimaryKey: false;
|
|
1669
|
+
isAutoincrement: false;
|
|
1670
|
+
hasRuntimeDefault: false;
|
|
1671
|
+
enumValues: undefined;
|
|
1672
|
+
baseColumn: never;
|
|
1673
|
+
identity: undefined;
|
|
1674
|
+
generated: undefined;
|
|
1675
|
+
}, {}, {}>;
|
|
1657
1676
|
name: import("drizzle-orm/pg-core").PgColumn<{
|
|
1658
1677
|
name: "name";
|
|
1659
1678
|
tableName: "linked_daemons";
|
|
@@ -1837,6 +1856,8 @@ export declare const linkedDaemons: import("drizzle-orm/pg-core").PgTableWithCol
|
|
|
1837
1856
|
}>;
|
|
1838
1857
|
export declare const linkedDaemonsRelations: import("drizzle-orm").Relations<"linked_daemons", {
|
|
1839
1858
|
user: import("drizzle-orm").One<"users", true>;
|
|
1859
|
+
workspace: import("drizzle-orm").One<"workspaces", false>;
|
|
1860
|
+
messages: import("drizzle-orm").Many<"agent_messages">;
|
|
1840
1861
|
}>;
|
|
1841
1862
|
export declare const subscriptions: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
1842
1863
|
name: "subscriptions";
|
|
@@ -4054,6 +4075,7 @@ export declare const issueAssignments: import("drizzle-orm/pg-core").PgTableWith
|
|
|
4054
4075
|
identity: undefined;
|
|
4055
4076
|
generated: undefined;
|
|
4056
4077
|
}, {}, {
|
|
4078
|
+
size: undefined;
|
|
4057
4079
|
baseBuilder: import("drizzle-orm/pg-core").PgColumnBuilder<{
|
|
4058
4080
|
name: "labels";
|
|
4059
4081
|
dataType: "string";
|
|
@@ -4062,7 +4084,6 @@ export declare const issueAssignments: import("drizzle-orm/pg-core").PgTableWith
|
|
|
4062
4084
|
enumValues: [string, ...string[]];
|
|
4063
4085
|
driverParam: string;
|
|
4064
4086
|
}, {}, {}, import("drizzle-orm").ColumnBuilderExtraConfig>;
|
|
4065
|
-
size: undefined;
|
|
4066
4087
|
}>;
|
|
4067
4088
|
priority: import("drizzle-orm/pg-core").PgColumn<{
|
|
4068
4089
|
name: "priority";
|
|
@@ -4484,4 +4505,377 @@ export type IssueAssignment = typeof issueAssignments.$inferSelect;
|
|
|
4484
4505
|
export type NewIssueAssignment = typeof issueAssignments.$inferInsert;
|
|
4485
4506
|
export type CommentMention = typeof commentMentions.$inferSelect;
|
|
4486
4507
|
export type NewCommentMention = typeof commentMentions.$inferInsert;
|
|
4508
|
+
/**
|
|
4509
|
+
* Message payload metadata (mirrors SendMeta from protocol)
|
|
4510
|
+
*/
|
|
4511
|
+
export interface MessagePayloadMeta {
|
|
4512
|
+
requires_ack?: boolean;
|
|
4513
|
+
ttl_ms?: number;
|
|
4514
|
+
importance?: number;
|
|
4515
|
+
replyTo?: string;
|
|
4516
|
+
}
|
|
4517
|
+
/**
|
|
4518
|
+
* Agent messages table - stores all relay messages for search and history.
|
|
4519
|
+
*
|
|
4520
|
+
* Retention policy:
|
|
4521
|
+
* - Free tier: 30 days (enforced via expires_at)
|
|
4522
|
+
* - Pro tier: 90 days
|
|
4523
|
+
* - Enterprise: Unlimited (no expires_at set)
|
|
4524
|
+
*
|
|
4525
|
+
* Messages are synced from daemon SQLite to cloud PostgreSQL.
|
|
4526
|
+
*/
|
|
4527
|
+
export declare const agentMessages: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
4528
|
+
name: "agent_messages";
|
|
4529
|
+
schema: undefined;
|
|
4530
|
+
columns: {
|
|
4531
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
4532
|
+
name: "id";
|
|
4533
|
+
tableName: "agent_messages";
|
|
4534
|
+
dataType: "string";
|
|
4535
|
+
columnType: "PgUUID";
|
|
4536
|
+
data: string;
|
|
4537
|
+
driverParam: string;
|
|
4538
|
+
notNull: true;
|
|
4539
|
+
hasDefault: true;
|
|
4540
|
+
isPrimaryKey: true;
|
|
4541
|
+
isAutoincrement: false;
|
|
4542
|
+
hasRuntimeDefault: false;
|
|
4543
|
+
enumValues: undefined;
|
|
4544
|
+
baseColumn: never;
|
|
4545
|
+
identity: undefined;
|
|
4546
|
+
generated: undefined;
|
|
4547
|
+
}, {}, {}>;
|
|
4548
|
+
workspaceId: import("drizzle-orm/pg-core").PgColumn<{
|
|
4549
|
+
name: "workspace_id";
|
|
4550
|
+
tableName: "agent_messages";
|
|
4551
|
+
dataType: "string";
|
|
4552
|
+
columnType: "PgUUID";
|
|
4553
|
+
data: string;
|
|
4554
|
+
driverParam: string;
|
|
4555
|
+
notNull: true;
|
|
4556
|
+
hasDefault: false;
|
|
4557
|
+
isPrimaryKey: false;
|
|
4558
|
+
isAutoincrement: false;
|
|
4559
|
+
hasRuntimeDefault: false;
|
|
4560
|
+
enumValues: undefined;
|
|
4561
|
+
baseColumn: never;
|
|
4562
|
+
identity: undefined;
|
|
4563
|
+
generated: undefined;
|
|
4564
|
+
}, {}, {}>;
|
|
4565
|
+
daemonId: import("drizzle-orm/pg-core").PgColumn<{
|
|
4566
|
+
name: "daemon_id";
|
|
4567
|
+
tableName: "agent_messages";
|
|
4568
|
+
dataType: "string";
|
|
4569
|
+
columnType: "PgUUID";
|
|
4570
|
+
data: string;
|
|
4571
|
+
driverParam: string;
|
|
4572
|
+
notNull: false;
|
|
4573
|
+
hasDefault: false;
|
|
4574
|
+
isPrimaryKey: false;
|
|
4575
|
+
isAutoincrement: false;
|
|
4576
|
+
hasRuntimeDefault: false;
|
|
4577
|
+
enumValues: undefined;
|
|
4578
|
+
baseColumn: never;
|
|
4579
|
+
identity: undefined;
|
|
4580
|
+
generated: undefined;
|
|
4581
|
+
}, {}, {}>;
|
|
4582
|
+
originalId: import("drizzle-orm/pg-core").PgColumn<{
|
|
4583
|
+
name: "original_id";
|
|
4584
|
+
tableName: "agent_messages";
|
|
4585
|
+
dataType: "string";
|
|
4586
|
+
columnType: "PgVarchar";
|
|
4587
|
+
data: string;
|
|
4588
|
+
driverParam: string;
|
|
4589
|
+
notNull: true;
|
|
4590
|
+
hasDefault: false;
|
|
4591
|
+
isPrimaryKey: false;
|
|
4592
|
+
isAutoincrement: false;
|
|
4593
|
+
hasRuntimeDefault: false;
|
|
4594
|
+
enumValues: [string, ...string[]];
|
|
4595
|
+
baseColumn: never;
|
|
4596
|
+
identity: undefined;
|
|
4597
|
+
generated: undefined;
|
|
4598
|
+
}, {}, {
|
|
4599
|
+
length: 255;
|
|
4600
|
+
}>;
|
|
4601
|
+
fromAgent: import("drizzle-orm/pg-core").PgColumn<{
|
|
4602
|
+
name: "from_agent";
|
|
4603
|
+
tableName: "agent_messages";
|
|
4604
|
+
dataType: "string";
|
|
4605
|
+
columnType: "PgVarchar";
|
|
4606
|
+
data: string;
|
|
4607
|
+
driverParam: string;
|
|
4608
|
+
notNull: true;
|
|
4609
|
+
hasDefault: false;
|
|
4610
|
+
isPrimaryKey: false;
|
|
4611
|
+
isAutoincrement: false;
|
|
4612
|
+
hasRuntimeDefault: false;
|
|
4613
|
+
enumValues: [string, ...string[]];
|
|
4614
|
+
baseColumn: never;
|
|
4615
|
+
identity: undefined;
|
|
4616
|
+
generated: undefined;
|
|
4617
|
+
}, {}, {
|
|
4618
|
+
length: 255;
|
|
4619
|
+
}>;
|
|
4620
|
+
toAgent: import("drizzle-orm/pg-core").PgColumn<{
|
|
4621
|
+
name: "to_agent";
|
|
4622
|
+
tableName: "agent_messages";
|
|
4623
|
+
dataType: "string";
|
|
4624
|
+
columnType: "PgVarchar";
|
|
4625
|
+
data: string;
|
|
4626
|
+
driverParam: string;
|
|
4627
|
+
notNull: true;
|
|
4628
|
+
hasDefault: false;
|
|
4629
|
+
isPrimaryKey: false;
|
|
4630
|
+
isAutoincrement: false;
|
|
4631
|
+
hasRuntimeDefault: false;
|
|
4632
|
+
enumValues: [string, ...string[]];
|
|
4633
|
+
baseColumn: never;
|
|
4634
|
+
identity: undefined;
|
|
4635
|
+
generated: undefined;
|
|
4636
|
+
}, {}, {
|
|
4637
|
+
length: 255;
|
|
4638
|
+
}>;
|
|
4639
|
+
body: import("drizzle-orm/pg-core").PgColumn<{
|
|
4640
|
+
name: "body";
|
|
4641
|
+
tableName: "agent_messages";
|
|
4642
|
+
dataType: "string";
|
|
4643
|
+
columnType: "PgText";
|
|
4644
|
+
data: string;
|
|
4645
|
+
driverParam: string;
|
|
4646
|
+
notNull: true;
|
|
4647
|
+
hasDefault: false;
|
|
4648
|
+
isPrimaryKey: false;
|
|
4649
|
+
isAutoincrement: false;
|
|
4650
|
+
hasRuntimeDefault: false;
|
|
4651
|
+
enumValues: [string, ...string[]];
|
|
4652
|
+
baseColumn: never;
|
|
4653
|
+
identity: undefined;
|
|
4654
|
+
generated: undefined;
|
|
4655
|
+
}, {}, {}>;
|
|
4656
|
+
kind: import("drizzle-orm/pg-core").PgColumn<{
|
|
4657
|
+
name: "kind";
|
|
4658
|
+
tableName: "agent_messages";
|
|
4659
|
+
dataType: "string";
|
|
4660
|
+
columnType: "PgVarchar";
|
|
4661
|
+
data: string;
|
|
4662
|
+
driverParam: string;
|
|
4663
|
+
notNull: true;
|
|
4664
|
+
hasDefault: true;
|
|
4665
|
+
isPrimaryKey: false;
|
|
4666
|
+
isAutoincrement: false;
|
|
4667
|
+
hasRuntimeDefault: false;
|
|
4668
|
+
enumValues: [string, ...string[]];
|
|
4669
|
+
baseColumn: never;
|
|
4670
|
+
identity: undefined;
|
|
4671
|
+
generated: undefined;
|
|
4672
|
+
}, {}, {
|
|
4673
|
+
length: 50;
|
|
4674
|
+
}>;
|
|
4675
|
+
topic: import("drizzle-orm/pg-core").PgColumn<{
|
|
4676
|
+
name: "topic";
|
|
4677
|
+
tableName: "agent_messages";
|
|
4678
|
+
dataType: "string";
|
|
4679
|
+
columnType: "PgVarchar";
|
|
4680
|
+
data: string;
|
|
4681
|
+
driverParam: string;
|
|
4682
|
+
notNull: false;
|
|
4683
|
+
hasDefault: false;
|
|
4684
|
+
isPrimaryKey: false;
|
|
4685
|
+
isAutoincrement: false;
|
|
4686
|
+
hasRuntimeDefault: false;
|
|
4687
|
+
enumValues: [string, ...string[]];
|
|
4688
|
+
baseColumn: never;
|
|
4689
|
+
identity: undefined;
|
|
4690
|
+
generated: undefined;
|
|
4691
|
+
}, {}, {
|
|
4692
|
+
length: 255;
|
|
4693
|
+
}>;
|
|
4694
|
+
thread: import("drizzle-orm/pg-core").PgColumn<{
|
|
4695
|
+
name: "thread";
|
|
4696
|
+
tableName: "agent_messages";
|
|
4697
|
+
dataType: "string";
|
|
4698
|
+
columnType: "PgVarchar";
|
|
4699
|
+
data: string;
|
|
4700
|
+
driverParam: string;
|
|
4701
|
+
notNull: false;
|
|
4702
|
+
hasDefault: false;
|
|
4703
|
+
isPrimaryKey: false;
|
|
4704
|
+
isAutoincrement: false;
|
|
4705
|
+
hasRuntimeDefault: false;
|
|
4706
|
+
enumValues: [string, ...string[]];
|
|
4707
|
+
baseColumn: never;
|
|
4708
|
+
identity: undefined;
|
|
4709
|
+
generated: undefined;
|
|
4710
|
+
}, {}, {
|
|
4711
|
+
length: 255;
|
|
4712
|
+
}>;
|
|
4713
|
+
channel: import("drizzle-orm/pg-core").PgColumn<{
|
|
4714
|
+
name: "channel";
|
|
4715
|
+
tableName: "agent_messages";
|
|
4716
|
+
dataType: "string";
|
|
4717
|
+
columnType: "PgVarchar";
|
|
4718
|
+
data: string;
|
|
4719
|
+
driverParam: string;
|
|
4720
|
+
notNull: false;
|
|
4721
|
+
hasDefault: false;
|
|
4722
|
+
isPrimaryKey: false;
|
|
4723
|
+
isAutoincrement: false;
|
|
4724
|
+
hasRuntimeDefault: false;
|
|
4725
|
+
enumValues: [string, ...string[]];
|
|
4726
|
+
baseColumn: never;
|
|
4727
|
+
identity: undefined;
|
|
4728
|
+
generated: undefined;
|
|
4729
|
+
}, {}, {
|
|
4730
|
+
length: 255;
|
|
4731
|
+
}>;
|
|
4732
|
+
isBroadcast: import("drizzle-orm/pg-core").PgColumn<{
|
|
4733
|
+
name: "is_broadcast";
|
|
4734
|
+
tableName: "agent_messages";
|
|
4735
|
+
dataType: "boolean";
|
|
4736
|
+
columnType: "PgBoolean";
|
|
4737
|
+
data: boolean;
|
|
4738
|
+
driverParam: boolean;
|
|
4739
|
+
notNull: true;
|
|
4740
|
+
hasDefault: true;
|
|
4741
|
+
isPrimaryKey: false;
|
|
4742
|
+
isAutoincrement: false;
|
|
4743
|
+
hasRuntimeDefault: false;
|
|
4744
|
+
enumValues: undefined;
|
|
4745
|
+
baseColumn: never;
|
|
4746
|
+
identity: undefined;
|
|
4747
|
+
generated: undefined;
|
|
4748
|
+
}, {}, {}>;
|
|
4749
|
+
isUrgent: import("drizzle-orm/pg-core").PgColumn<{
|
|
4750
|
+
name: "is_urgent";
|
|
4751
|
+
tableName: "agent_messages";
|
|
4752
|
+
dataType: "boolean";
|
|
4753
|
+
columnType: "PgBoolean";
|
|
4754
|
+
data: boolean;
|
|
4755
|
+
driverParam: boolean;
|
|
4756
|
+
notNull: true;
|
|
4757
|
+
hasDefault: true;
|
|
4758
|
+
isPrimaryKey: false;
|
|
4759
|
+
isAutoincrement: false;
|
|
4760
|
+
hasRuntimeDefault: false;
|
|
4761
|
+
enumValues: undefined;
|
|
4762
|
+
baseColumn: never;
|
|
4763
|
+
identity: undefined;
|
|
4764
|
+
generated: undefined;
|
|
4765
|
+
}, {}, {}>;
|
|
4766
|
+
data: import("drizzle-orm/pg-core").PgColumn<{
|
|
4767
|
+
name: "data";
|
|
4768
|
+
tableName: "agent_messages";
|
|
4769
|
+
dataType: "json";
|
|
4770
|
+
columnType: "PgJsonb";
|
|
4771
|
+
data: Record<string, unknown>;
|
|
4772
|
+
driverParam: unknown;
|
|
4773
|
+
notNull: false;
|
|
4774
|
+
hasDefault: false;
|
|
4775
|
+
isPrimaryKey: false;
|
|
4776
|
+
isAutoincrement: false;
|
|
4777
|
+
hasRuntimeDefault: false;
|
|
4778
|
+
enumValues: undefined;
|
|
4779
|
+
baseColumn: never;
|
|
4780
|
+
identity: undefined;
|
|
4781
|
+
generated: undefined;
|
|
4782
|
+
}, {}, {
|
|
4783
|
+
$type: Record<string, unknown>;
|
|
4784
|
+
}>;
|
|
4785
|
+
payloadMeta: import("drizzle-orm/pg-core").PgColumn<{
|
|
4786
|
+
name: "payload_meta";
|
|
4787
|
+
tableName: "agent_messages";
|
|
4788
|
+
dataType: "json";
|
|
4789
|
+
columnType: "PgJsonb";
|
|
4790
|
+
data: MessagePayloadMeta;
|
|
4791
|
+
driverParam: unknown;
|
|
4792
|
+
notNull: false;
|
|
4793
|
+
hasDefault: false;
|
|
4794
|
+
isPrimaryKey: false;
|
|
4795
|
+
isAutoincrement: false;
|
|
4796
|
+
hasRuntimeDefault: false;
|
|
4797
|
+
enumValues: undefined;
|
|
4798
|
+
baseColumn: never;
|
|
4799
|
+
identity: undefined;
|
|
4800
|
+
generated: undefined;
|
|
4801
|
+
}, {}, {
|
|
4802
|
+
$type: MessagePayloadMeta;
|
|
4803
|
+
}>;
|
|
4804
|
+
messageTs: import("drizzle-orm/pg-core").PgColumn<{
|
|
4805
|
+
name: "message_ts";
|
|
4806
|
+
tableName: "agent_messages";
|
|
4807
|
+
dataType: "date";
|
|
4808
|
+
columnType: "PgTimestamp";
|
|
4809
|
+
data: Date;
|
|
4810
|
+
driverParam: string;
|
|
4811
|
+
notNull: true;
|
|
4812
|
+
hasDefault: false;
|
|
4813
|
+
isPrimaryKey: false;
|
|
4814
|
+
isAutoincrement: false;
|
|
4815
|
+
hasRuntimeDefault: false;
|
|
4816
|
+
enumValues: undefined;
|
|
4817
|
+
baseColumn: never;
|
|
4818
|
+
identity: undefined;
|
|
4819
|
+
generated: undefined;
|
|
4820
|
+
}, {}, {}>;
|
|
4821
|
+
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
4822
|
+
name: "created_at";
|
|
4823
|
+
tableName: "agent_messages";
|
|
4824
|
+
dataType: "date";
|
|
4825
|
+
columnType: "PgTimestamp";
|
|
4826
|
+
data: Date;
|
|
4827
|
+
driverParam: string;
|
|
4828
|
+
notNull: true;
|
|
4829
|
+
hasDefault: true;
|
|
4830
|
+
isPrimaryKey: false;
|
|
4831
|
+
isAutoincrement: false;
|
|
4832
|
+
hasRuntimeDefault: false;
|
|
4833
|
+
enumValues: undefined;
|
|
4834
|
+
baseColumn: never;
|
|
4835
|
+
identity: undefined;
|
|
4836
|
+
generated: undefined;
|
|
4837
|
+
}, {}, {}>;
|
|
4838
|
+
expiresAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
4839
|
+
name: "expires_at";
|
|
4840
|
+
tableName: "agent_messages";
|
|
4841
|
+
dataType: "date";
|
|
4842
|
+
columnType: "PgTimestamp";
|
|
4843
|
+
data: Date;
|
|
4844
|
+
driverParam: string;
|
|
4845
|
+
notNull: false;
|
|
4846
|
+
hasDefault: false;
|
|
4847
|
+
isPrimaryKey: false;
|
|
4848
|
+
isAutoincrement: false;
|
|
4849
|
+
hasRuntimeDefault: false;
|
|
4850
|
+
enumValues: undefined;
|
|
4851
|
+
baseColumn: never;
|
|
4852
|
+
identity: undefined;
|
|
4853
|
+
generated: undefined;
|
|
4854
|
+
}, {}, {}>;
|
|
4855
|
+
indexedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
4856
|
+
name: "indexed_at";
|
|
4857
|
+
tableName: "agent_messages";
|
|
4858
|
+
dataType: "date";
|
|
4859
|
+
columnType: "PgTimestamp";
|
|
4860
|
+
data: Date;
|
|
4861
|
+
driverParam: string;
|
|
4862
|
+
notNull: false;
|
|
4863
|
+
hasDefault: false;
|
|
4864
|
+
isPrimaryKey: false;
|
|
4865
|
+
isAutoincrement: false;
|
|
4866
|
+
hasRuntimeDefault: false;
|
|
4867
|
+
enumValues: undefined;
|
|
4868
|
+
baseColumn: never;
|
|
4869
|
+
identity: undefined;
|
|
4870
|
+
generated: undefined;
|
|
4871
|
+
}, {}, {}>;
|
|
4872
|
+
};
|
|
4873
|
+
dialect: "pg";
|
|
4874
|
+
}>;
|
|
4875
|
+
export declare const agentMessagesRelations: import("drizzle-orm").Relations<"agent_messages", {
|
|
4876
|
+
workspace: import("drizzle-orm").One<"workspaces", true>;
|
|
4877
|
+
daemon: import("drizzle-orm").One<"linked_daemons", false>;
|
|
4878
|
+
}>;
|
|
4879
|
+
export type AgentMessage = typeof agentMessages.$inferSelect;
|
|
4880
|
+
export type NewAgentMessage = typeof agentMessages.$inferInsert;
|
|
4487
4881
|
//# sourceMappingURL=schema.d.ts.map
|
package/dist/cloud/db/schema.js
CHANGED
|
@@ -118,6 +118,8 @@ export const workspacesRelations = relations(workspaces, ({ one, many }) => ({
|
|
|
118
118
|
}),
|
|
119
119
|
members: many(workspaceMembers),
|
|
120
120
|
repositories: many(repositories),
|
|
121
|
+
linkedDaemons: many(linkedDaemons),
|
|
122
|
+
messages: many(agentMessages),
|
|
121
123
|
}));
|
|
122
124
|
// ============================================================================
|
|
123
125
|
// Workspace Members
|
|
@@ -229,6 +231,7 @@ export const repositoriesRelations = relations(repositories, ({ one }) => ({
|
|
|
229
231
|
export const linkedDaemons = pgTable('linked_daemons', {
|
|
230
232
|
id: uuid('id').primaryKey().defaultRandom(),
|
|
231
233
|
userId: uuid('user_id').notNull().references(() => users.id, { onDelete: 'cascade' }),
|
|
234
|
+
workspaceId: uuid('workspace_id').references(() => workspaces.id, { onDelete: 'set null' }),
|
|
232
235
|
name: varchar('name', { length: 255 }).notNull(),
|
|
233
236
|
machineId: varchar('machine_id', { length: 255 }).notNull(),
|
|
234
237
|
apiKeyHash: varchar('api_key_hash', { length: 255 }).notNull(),
|
|
@@ -242,14 +245,20 @@ export const linkedDaemons = pgTable('linked_daemons', {
|
|
|
242
245
|
}, (table) => ({
|
|
243
246
|
userMachineIdx: unique('linked_daemons_user_machine_unique').on(table.userId, table.machineId),
|
|
244
247
|
userIdIdx: index('idx_linked_daemons_user_id').on(table.userId),
|
|
248
|
+
workspaceIdIdx: index('idx_linked_daemons_workspace_id').on(table.workspaceId),
|
|
245
249
|
apiKeyHashIdx: index('idx_linked_daemons_api_key_hash').on(table.apiKeyHash),
|
|
246
250
|
statusIdx: index('idx_linked_daemons_status').on(table.status),
|
|
247
251
|
}));
|
|
248
|
-
export const linkedDaemonsRelations = relations(linkedDaemons, ({ one }) => ({
|
|
252
|
+
export const linkedDaemonsRelations = relations(linkedDaemons, ({ one, many }) => ({
|
|
249
253
|
user: one(users, {
|
|
250
254
|
fields: [linkedDaemons.userId],
|
|
251
255
|
references: [users.id],
|
|
252
256
|
}),
|
|
257
|
+
workspace: one(workspaces, {
|
|
258
|
+
fields: [linkedDaemons.workspaceId],
|
|
259
|
+
references: [workspaces.id],
|
|
260
|
+
}),
|
|
261
|
+
messages: many(agentMessages),
|
|
253
262
|
}));
|
|
254
263
|
// ============================================================================
|
|
255
264
|
// Subscriptions (billing)
|
|
@@ -545,4 +554,69 @@ export const commentMentionsRelations = relations(commentMentions, ({ one }) =>
|
|
|
545
554
|
references: [repositories.id],
|
|
546
555
|
}),
|
|
547
556
|
}));
|
|
557
|
+
/**
|
|
558
|
+
* Agent messages table - stores all relay messages for search and history.
|
|
559
|
+
*
|
|
560
|
+
* Retention policy:
|
|
561
|
+
* - Free tier: 30 days (enforced via expires_at)
|
|
562
|
+
* - Pro tier: 90 days
|
|
563
|
+
* - Enterprise: Unlimited (no expires_at set)
|
|
564
|
+
*
|
|
565
|
+
* Messages are synced from daemon SQLite to cloud PostgreSQL.
|
|
566
|
+
*/
|
|
567
|
+
export const agentMessages = pgTable('agent_messages', {
|
|
568
|
+
id: uuid('id').primaryKey().defaultRandom(),
|
|
569
|
+
// Scoping
|
|
570
|
+
workspaceId: uuid('workspace_id').notNull().references(() => workspaces.id, { onDelete: 'cascade' }),
|
|
571
|
+
daemonId: uuid('daemon_id').references(() => linkedDaemons.id, { onDelete: 'set null' }),
|
|
572
|
+
// Original message ID from daemon (for deduplication)
|
|
573
|
+
originalId: varchar('original_id', { length: 255 }).notNull(),
|
|
574
|
+
// Core message fields (aligned with StoredMessage)
|
|
575
|
+
fromAgent: varchar('from_agent', { length: 255 }).notNull(),
|
|
576
|
+
toAgent: varchar('to_agent', { length: 255 }).notNull(), // '*' for broadcast
|
|
577
|
+
body: text('body').notNull(),
|
|
578
|
+
// Message classification
|
|
579
|
+
kind: varchar('kind', { length: 50 }).notNull().default('message'), // message, action, state, thinking
|
|
580
|
+
topic: varchar('topic', { length: 255 }),
|
|
581
|
+
thread: varchar('thread', { length: 255 }), // Thread ID for grouping
|
|
582
|
+
channel: varchar('channel', { length: 255 }), // Channel name if channel message
|
|
583
|
+
// Flags
|
|
584
|
+
isBroadcast: boolean('is_broadcast').notNull().default(false),
|
|
585
|
+
isUrgent: boolean('is_urgent').notNull().default(false),
|
|
586
|
+
// Optional structured data
|
|
587
|
+
data: jsonb('data').$type(),
|
|
588
|
+
payloadMeta: jsonb('payload_meta').$type(),
|
|
589
|
+
// Timestamps
|
|
590
|
+
messageTs: timestamp('message_ts').notNull(), // Original message timestamp from daemon
|
|
591
|
+
createdAt: timestamp('created_at').defaultNow().notNull(), // When synced to cloud
|
|
592
|
+
expiresAt: timestamp('expires_at'), // Retention policy - null = never expires
|
|
593
|
+
// Search/indexing tracking
|
|
594
|
+
indexedAt: timestamp('indexed_at'), // When sent to Algolia (null = not indexed)
|
|
595
|
+
}, (table) => ({
|
|
596
|
+
// Primary lookups
|
|
597
|
+
workspaceIdIdx: index('idx_agent_messages_workspace_id').on(table.workspaceId),
|
|
598
|
+
daemonIdIdx: index('idx_agent_messages_daemon_id').on(table.daemonId),
|
|
599
|
+
// Deduplication - prevent duplicate sync
|
|
600
|
+
workspaceOriginalIdx: unique('agent_messages_workspace_original_unique').on(table.workspaceId, table.originalId),
|
|
601
|
+
// Query patterns
|
|
602
|
+
fromAgentIdx: index('idx_agent_messages_from_agent').on(table.fromAgent),
|
|
603
|
+
toAgentIdx: index('idx_agent_messages_to_agent').on(table.toAgent),
|
|
604
|
+
threadIdx: index('idx_agent_messages_thread').on(table.thread),
|
|
605
|
+
channelIdx: index('idx_agent_messages_channel').on(table.channel),
|
|
606
|
+
messageTsIdx: index('idx_agent_messages_message_ts').on(table.messageTs),
|
|
607
|
+
// Retention cleanup
|
|
608
|
+
expiresAtIdx: index('idx_agent_messages_expires_at').on(table.expiresAt),
|
|
609
|
+
// Search indexing queue
|
|
610
|
+
indexedAtIdx: index('idx_agent_messages_indexed_at').on(table.indexedAt),
|
|
611
|
+
}));
|
|
612
|
+
export const agentMessagesRelations = relations(agentMessages, ({ one }) => ({
|
|
613
|
+
workspace: one(workspaces, {
|
|
614
|
+
fields: [agentMessages.workspaceId],
|
|
615
|
+
references: [workspaces.id],
|
|
616
|
+
}),
|
|
617
|
+
daemon: one(linkedDaemons, {
|
|
618
|
+
fields: [agentMessages.daemonId],
|
|
619
|
+
references: [linkedDaemons.id],
|
|
620
|
+
}),
|
|
621
|
+
}));
|
|
548
622
|
//# sourceMappingURL=schema.js.map
|
|
@@ -70,6 +70,10 @@ export declare class WorkspaceProvisioner {
|
|
|
70
70
|
* Restart a workspace
|
|
71
71
|
*/
|
|
72
72
|
restart(workspaceId: string): Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* Update environment variables for a workspace instance.
|
|
75
|
+
*/
|
|
76
|
+
setWorkspaceEnvVars(workspace: Workspace, envVars: Record<string, string>): Promise<void>;
|
|
73
77
|
/**
|
|
74
78
|
* Stop a workspace
|
|
75
79
|
*/
|
|
@@ -130,6 +134,7 @@ export declare class WorkspaceProvisioner {
|
|
|
130
134
|
readonly UPDATED: "updated";
|
|
131
135
|
readonly UPDATED_PENDING_RESTART: "updated_pending_restart";
|
|
132
136
|
readonly SKIPPED_ACTIVE_AGENTS: "skipped_active_agents";
|
|
137
|
+
readonly SKIPPED_VERIFICATION_FAILED: "skipped_verification_failed";
|
|
133
138
|
readonly SKIPPED_NOT_RUNNING: "skipped_not_running";
|
|
134
139
|
readonly NOT_SUPPORTED: "not_supported";
|
|
135
140
|
readonly ERROR: "error";
|
|
@@ -160,6 +165,7 @@ export declare class WorkspaceProvisioner {
|
|
|
160
165
|
status: string;
|
|
161
166
|
}>;
|
|
162
167
|
error?: string;
|
|
168
|
+
reason?: string;
|
|
163
169
|
}>;
|
|
164
170
|
/**
|
|
165
171
|
* Gracefully update all workspaces to a new image
|
|
@@ -183,6 +189,7 @@ export declare class WorkspaceProvisioner {
|
|
|
183
189
|
updated: number;
|
|
184
190
|
pendingRestart: number;
|
|
185
191
|
skippedActiveAgents: number;
|
|
192
|
+
skippedVerificationFailed: number;
|
|
186
193
|
skippedNotRunning: number;
|
|
187
194
|
errors: number;
|
|
188
195
|
};
|
|
@@ -192,6 +199,7 @@ export declare class WorkspaceProvisioner {
|
|
|
192
199
|
machineState?: string;
|
|
193
200
|
agentCount?: number;
|
|
194
201
|
error?: string;
|
|
202
|
+
reason?: string;
|
|
195
203
|
}>;
|
|
196
204
|
}>;
|
|
197
205
|
}
|