@growthub/cli 0.3.11 → 0.3.13
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/dist/index.js +186 -183
- package/dist/index.js.map +3 -3
- package/package.json +1 -7
- package/dist/runtime/server/dist/adapters/codex-models.d.ts +0 -4
- package/dist/runtime/server/dist/adapters/codex-models.d.ts.map +0 -1
- package/dist/runtime/server/dist/adapters/codex-models.js +0 -98
- package/dist/runtime/server/dist/adapters/codex-models.js.map +0 -1
- package/dist/runtime/server/dist/adapters/cursor-models.d.ts +0 -13
- package/dist/runtime/server/dist/adapters/cursor-models.d.ts.map +0 -1
- package/dist/runtime/server/dist/adapters/cursor-models.js +0 -148
- package/dist/runtime/server/dist/adapters/cursor-models.js.map +0 -1
- package/dist/runtime/server/dist/adapters/http/execute.d.ts +0 -3
- package/dist/runtime/server/dist/adapters/http/execute.d.ts.map +0 -1
- package/dist/runtime/server/dist/adapters/http/execute.js +0 -39
- package/dist/runtime/server/dist/adapters/http/execute.js.map +0 -1
- package/dist/runtime/server/dist/adapters/http/index.d.ts +0 -3
- package/dist/runtime/server/dist/adapters/http/index.d.ts.map +0 -1
- package/dist/runtime/server/dist/adapters/http/index.js +0 -20
- package/dist/runtime/server/dist/adapters/http/index.js.map +0 -1
- package/dist/runtime/server/dist/adapters/http/test.d.ts +0 -3
- package/dist/runtime/server/dist/adapters/http/test.d.ts.map +0 -1
- package/dist/runtime/server/dist/adapters/http/test.js +0 -106
- package/dist/runtime/server/dist/adapters/http/test.js.map +0 -1
- package/dist/runtime/server/dist/adapters/index.d.ts +0 -4
- package/dist/runtime/server/dist/adapters/index.d.ts.map +0 -1
- package/dist/runtime/server/dist/adapters/index.js +0 -3
- package/dist/runtime/server/dist/adapters/index.js.map +0 -1
- package/dist/runtime/server/dist/adapters/process/execute.d.ts +0 -3
- package/dist/runtime/server/dist/adapters/process/execute.d.ts.map +0 -1
- package/dist/runtime/server/dist/adapters/process/execute.js +0 -63
- package/dist/runtime/server/dist/adapters/process/execute.js.map +0 -1
- package/dist/runtime/server/dist/adapters/process/index.d.ts +0 -3
- package/dist/runtime/server/dist/adapters/process/index.d.ts.map +0 -1
- package/dist/runtime/server/dist/adapters/process/index.js +0 -23
- package/dist/runtime/server/dist/adapters/process/index.js.map +0 -1
- package/dist/runtime/server/dist/adapters/process/test.d.ts +0 -3
- package/dist/runtime/server/dist/adapters/process/test.d.ts.map +0 -1
- package/dist/runtime/server/dist/adapters/process/test.js +0 -77
- package/dist/runtime/server/dist/adapters/process/test.js.map +0 -1
- package/dist/runtime/server/dist/adapters/registry.d.ts +0 -9
- package/dist/runtime/server/dist/adapters/registry.d.ts.map +0 -1
- package/dist/runtime/server/dist/adapters/registry.js +0 -142
- package/dist/runtime/server/dist/adapters/registry.js.map +0 -1
- package/dist/runtime/server/dist/adapters/types.d.ts +0 -2
- package/dist/runtime/server/dist/adapters/types.d.ts.map +0 -1
- package/dist/runtime/server/dist/adapters/types.js +0 -2
- package/dist/runtime/server/dist/adapters/types.js.map +0 -1
- package/dist/runtime/server/dist/adapters/utils.d.ts +0 -10
- package/dist/runtime/server/dist/adapters/utils.d.ts.map +0 -1
- package/dist/runtime/server/dist/adapters/utils.js +0 -14
- package/dist/runtime/server/dist/adapters/utils.js.map +0 -1
- package/dist/runtime/server/dist/agent-auth-jwt.d.ts +0 -14
- package/dist/runtime/server/dist/agent-auth-jwt.d.ts.map +0 -1
- package/dist/runtime/server/dist/agent-auth-jwt.js +0 -117
- package/dist/runtime/server/dist/agent-auth-jwt.js.map +0 -1
- package/dist/runtime/server/dist/app.d.ts +0 -26
- package/dist/runtime/server/dist/app.d.ts.map +0 -1
- package/dist/runtime/server/dist/app.js +0 -310
- package/dist/runtime/server/dist/app.js.map +0 -1
- package/dist/runtime/server/dist/attachment-types.d.ts +0 -33
- package/dist/runtime/server/dist/attachment-types.d.ts.map +0 -1
- package/dist/runtime/server/dist/attachment-types.js +0 -67
- package/dist/runtime/server/dist/attachment-types.js.map +0 -1
- package/dist/runtime/server/dist/auth/better-auth.d.ts +0 -24
- package/dist/runtime/server/dist/auth/better-auth.d.ts.map +0 -1
- package/dist/runtime/server/dist/auth/better-auth.js +0 -108
- package/dist/runtime/server/dist/auth/better-auth.js.map +0 -1
- package/dist/runtime/server/dist/board-claim.d.ts +0 -23
- package/dist/runtime/server/dist/board-claim.d.ts.map +0 -1
- package/dist/runtime/server/dist/board-claim.js +0 -115
- package/dist/runtime/server/dist/board-claim.js.map +0 -1
- package/dist/runtime/server/dist/config-file.d.ts +0 -4
- package/dist/runtime/server/dist/config-file.d.ts.map +0 -1
- package/dist/runtime/server/dist/config-file.js +0 -25
- package/dist/runtime/server/dist/config-file.js.map +0 -1
- package/dist/runtime/server/dist/config.d.ts +0 -39
- package/dist/runtime/server/dist/config.d.ts.map +0 -1
- package/dist/runtime/server/dist/config.js +0 -164
- package/dist/runtime/server/dist/config.js.map +0 -1
- package/dist/runtime/server/dist/errors.d.ts +0 -12
- package/dist/runtime/server/dist/errors.d.ts.map +0 -1
- package/dist/runtime/server/dist/errors.js +0 -28
- package/dist/runtime/server/dist/errors.js.map +0 -1
- package/dist/runtime/server/dist/home-paths.d.ts +0 -17
- package/dist/runtime/server/dist/home-paths.d.ts.map +0 -1
- package/dist/runtime/server/dist/home-paths.js +0 -75
- package/dist/runtime/server/dist/home-paths.js.map +0 -1
- package/dist/runtime/server/dist/index.d.ts +0 -10
- package/dist/runtime/server/dist/index.d.ts.map +0 -1
- package/dist/runtime/server/dist/index.js +0 -567
- package/dist/runtime/server/dist/index.js.map +0 -1
- package/dist/runtime/server/dist/log-redaction.d.ts +0 -10
- package/dist/runtime/server/dist/log-redaction.d.ts.map +0 -1
- package/dist/runtime/server/dist/log-redaction.js +0 -110
- package/dist/runtime/server/dist/log-redaction.js.map +0 -1
- package/dist/runtime/server/dist/middleware/auth.d.ts +0 -12
- package/dist/runtime/server/dist/middleware/auth.d.ts.map +0 -1
- package/dist/runtime/server/dist/middleware/auth.js +0 -124
- package/dist/runtime/server/dist/middleware/auth.js.map +0 -1
- package/dist/runtime/server/dist/middleware/board-mutation-guard.d.ts +0 -3
- package/dist/runtime/server/dist/middleware/board-mutation-guard.d.ts.map +0 -1
- package/dist/runtime/server/dist/middleware/board-mutation-guard.js +0 -60
- package/dist/runtime/server/dist/middleware/board-mutation-guard.js.map +0 -1
- package/dist/runtime/server/dist/middleware/error-handler.d.ts +0 -17
- package/dist/runtime/server/dist/middleware/error-handler.d.ts.map +0 -1
- package/dist/runtime/server/dist/middleware/error-handler.js +0 -37
- package/dist/runtime/server/dist/middleware/error-handler.js.map +0 -1
- package/dist/runtime/server/dist/middleware/index.d.ts +0 -4
- package/dist/runtime/server/dist/middleware/index.d.ts.map +0 -1
- package/dist/runtime/server/dist/middleware/index.js +0 -4
- package/dist/runtime/server/dist/middleware/index.js.map +0 -1
- package/dist/runtime/server/dist/middleware/logger.d.ts +0 -4
- package/dist/runtime/server/dist/middleware/logger.d.ts.map +0 -1
- package/dist/runtime/server/dist/middleware/logger.js +0 -87
- package/dist/runtime/server/dist/middleware/logger.js.map +0 -1
- package/dist/runtime/server/dist/middleware/private-hostname-guard.d.ts +0 -11
- package/dist/runtime/server/dist/middleware/private-hostname-guard.d.ts.map +0 -1
- package/dist/runtime/server/dist/middleware/private-hostname-guard.js +0 -78
- package/dist/runtime/server/dist/middleware/private-hostname-guard.js.map +0 -1
- package/dist/runtime/server/dist/middleware/validate.d.ts +0 -4
- package/dist/runtime/server/dist/middleware/validate.d.ts.map +0 -1
- package/dist/runtime/server/dist/middleware/validate.js +0 -7
- package/dist/runtime/server/dist/middleware/validate.js.map +0 -1
- package/dist/runtime/server/dist/paths.d.ts +0 -3
- package/dist/runtime/server/dist/paths.d.ts.map +0 -1
- package/dist/runtime/server/dist/paths.js +0 -31
- package/dist/runtime/server/dist/paths.js.map +0 -1
- package/dist/runtime/server/dist/realtime/live-events-ws.d.ts +0 -28
- package/dist/runtime/server/dist/realtime/live-events-ws.d.ts.map +0 -1
- package/dist/runtime/server/dist/realtime/live-events-ws.js +0 -187
- package/dist/runtime/server/dist/realtime/live-events-ws.js.map +0 -1
- package/dist/runtime/server/dist/redaction.d.ts +0 -4
- package/dist/runtime/server/dist/redaction.d.ts.map +0 -1
- package/dist/runtime/server/dist/redaction.js +0 -63
- package/dist/runtime/server/dist/redaction.js.map +0 -1
- package/dist/runtime/server/dist/routes/access.d.ts +0 -56
- package/dist/runtime/server/dist/routes/access.d.ts.map +0 -1
- package/dist/runtime/server/dist/routes/access.js +0 -2125
- package/dist/runtime/server/dist/routes/access.js.map +0 -1
- package/dist/runtime/server/dist/routes/activity.d.ts +0 -3
- package/dist/runtime/server/dist/routes/activity.d.ts.map +0 -1
- package/dist/runtime/server/dist/routes/activity.js +0 -78
- package/dist/runtime/server/dist/routes/activity.js.map +0 -1
- package/dist/runtime/server/dist/routes/agents.d.ts +0 -3
- package/dist/runtime/server/dist/routes/agents.d.ts.map +0 -1
- package/dist/runtime/server/dist/routes/agents.js +0 -1485
- package/dist/runtime/server/dist/routes/agents.js.map +0 -1
- package/dist/runtime/server/dist/routes/approvals.d.ts +0 -3
- package/dist/runtime/server/dist/routes/approvals.d.ts.map +0 -1
- package/dist/runtime/server/dist/routes/approvals.js +0 -275
- package/dist/runtime/server/dist/routes/approvals.js.map +0 -1
- package/dist/runtime/server/dist/routes/assets.d.ts +0 -4
- package/dist/runtime/server/dist/routes/assets.d.ts.map +0 -1
- package/dist/runtime/server/dist/routes/assets.js +0 -309
- package/dist/runtime/server/dist/routes/assets.js.map +0 -1
- package/dist/runtime/server/dist/routes/authz.d.ts +0 -15
- package/dist/runtime/server/dist/routes/authz.d.ts.map +0 -1
- package/dist/runtime/server/dist/routes/authz.js +0 -40
- package/dist/runtime/server/dist/routes/authz.js.map +0 -1
- package/dist/runtime/server/dist/routes/companies.d.ts +0 -3
- package/dist/runtime/server/dist/routes/companies.d.ts.map +0 -1
- package/dist/runtime/server/dist/routes/companies.js +0 -196
- package/dist/runtime/server/dist/routes/companies.js.map +0 -1
- package/dist/runtime/server/dist/routes/costs.d.ts +0 -3
- package/dist/runtime/server/dist/routes/costs.d.ts.map +0 -1
- package/dist/runtime/server/dist/routes/costs.js +0 -268
- package/dist/runtime/server/dist/routes/costs.js.map +0 -1
- package/dist/runtime/server/dist/routes/dashboard.d.ts +0 -3
- package/dist/runtime/server/dist/routes/dashboard.d.ts.map +0 -1
- package/dist/runtime/server/dist/routes/dashboard.js +0 -15
- package/dist/runtime/server/dist/routes/dashboard.js.map +0 -1
- package/dist/runtime/server/dist/routes/execution-workspaces.d.ts +0 -3
- package/dist/runtime/server/dist/routes/execution-workspaces.d.ts.map +0 -1
- package/dist/runtime/server/dist/routes/execution-workspaces.js +0 -165
- package/dist/runtime/server/dist/routes/execution-workspaces.js.map +0 -1
- package/dist/runtime/server/dist/routes/goals.d.ts +0 -3
- package/dist/runtime/server/dist/routes/goals.d.ts.map +0 -1
- package/dist/runtime/server/dist/routes/goals.js +0 -95
- package/dist/runtime/server/dist/routes/goals.js.map +0 -1
- package/dist/runtime/server/dist/routes/gtm.d.ts +0 -3
- package/dist/runtime/server/dist/routes/gtm.d.ts.map +0 -1
- package/dist/runtime/server/dist/routes/gtm.js +0 -478
- package/dist/runtime/server/dist/routes/gtm.js.map +0 -1
- package/dist/runtime/server/dist/routes/health.d.ts +0 -10
- package/dist/runtime/server/dist/routes/health.d.ts.map +0 -1
- package/dist/runtime/server/dist/routes/health.js +0 -53
- package/dist/runtime/server/dist/routes/health.js.map +0 -1
- package/dist/runtime/server/dist/routes/index.d.ts +0 -16
- package/dist/runtime/server/dist/routes/index.d.ts.map +0 -1
- package/dist/runtime/server/dist/routes/index.js +0 -16
- package/dist/runtime/server/dist/routes/index.js.map +0 -1
- package/dist/runtime/server/dist/routes/instance-settings.d.ts +0 -3
- package/dist/runtime/server/dist/routes/instance-settings.d.ts.map +0 -1
- package/dist/runtime/server/dist/routes/instance-settings.js +0 -46
- package/dist/runtime/server/dist/routes/instance-settings.js.map +0 -1
- package/dist/runtime/server/dist/routes/issues-checkout-wakeup.d.ts +0 -9
- package/dist/runtime/server/dist/routes/issues-checkout-wakeup.d.ts.map +0 -1
- package/dist/runtime/server/dist/routes/issues-checkout-wakeup.js +0 -12
- package/dist/runtime/server/dist/routes/issues-checkout-wakeup.js.map +0 -1
- package/dist/runtime/server/dist/routes/issues.d.ts +0 -4
- package/dist/runtime/server/dist/routes/issues.d.ts.map +0 -1
- package/dist/runtime/server/dist/routes/issues.js +0 -1454
- package/dist/runtime/server/dist/routes/issues.js.map +0 -1
- package/dist/runtime/server/dist/routes/llms.d.ts +0 -3
- package/dist/runtime/server/dist/routes/llms.d.ts.map +0 -1
- package/dist/runtime/server/dist/routes/llms.js +0 -78
- package/dist/runtime/server/dist/routes/llms.js.map +0 -1
- package/dist/runtime/server/dist/routes/plugin-ui-static.d.ts +0 -69
- package/dist/runtime/server/dist/routes/plugin-ui-static.d.ts.map +0 -1
- package/dist/runtime/server/dist/routes/plugin-ui-static.js +0 -411
- package/dist/runtime/server/dist/routes/plugin-ui-static.js.map +0 -1
- package/dist/runtime/server/dist/routes/plugins.d.ts +0 -120
- package/dist/runtime/server/dist/routes/plugins.d.ts.map +0 -1
- package/dist/runtime/server/dist/routes/plugins.js +0 -1784
- package/dist/runtime/server/dist/routes/plugins.js.map +0 -1
- package/dist/runtime/server/dist/routes/projects.d.ts +0 -3
- package/dist/runtime/server/dist/routes/projects.d.ts.map +0 -1
- package/dist/runtime/server/dist/routes/projects.js +0 -257
- package/dist/runtime/server/dist/routes/projects.js.map +0 -1
- package/dist/runtime/server/dist/routes/secrets.d.ts +0 -3
- package/dist/runtime/server/dist/routes/secrets.d.ts.map +0 -1
- package/dist/runtime/server/dist/routes/secrets.js +0 -128
- package/dist/runtime/server/dist/routes/secrets.js.map +0 -1
- package/dist/runtime/server/dist/routes/sidebar-badges.d.ts +0 -3
- package/dist/runtime/server/dist/routes/sidebar-badges.d.ts.map +0 -1
- package/dist/runtime/server/dist/routes/sidebar-badges.js +0 -45
- package/dist/runtime/server/dist/routes/sidebar-badges.js.map +0 -1
- package/dist/runtime/server/dist/routes/tickets.d.ts +0 -3
- package/dist/runtime/server/dist/routes/tickets.d.ts.map +0 -1
- package/dist/runtime/server/dist/routes/tickets.js +0 -112
- package/dist/runtime/server/dist/routes/tickets.js.map +0 -1
- package/dist/runtime/server/dist/secrets/external-stub-providers.d.ts +0 -5
- package/dist/runtime/server/dist/secrets/external-stub-providers.d.ts.map +0 -1
- package/dist/runtime/server/dist/secrets/external-stub-providers.js +0 -21
- package/dist/runtime/server/dist/secrets/external-stub-providers.js.map +0 -1
- package/dist/runtime/server/dist/secrets/local-encrypted-provider.d.ts +0 -3
- package/dist/runtime/server/dist/secrets/local-encrypted-provider.d.ts.map +0 -1
- package/dist/runtime/server/dist/secrets/local-encrypted-provider.js +0 -116
- package/dist/runtime/server/dist/secrets/local-encrypted-provider.js.map +0 -1
- package/dist/runtime/server/dist/secrets/provider-registry.d.ts +0 -5
- package/dist/runtime/server/dist/secrets/provider-registry.d.ts.map +0 -1
- package/dist/runtime/server/dist/secrets/provider-registry.js +0 -20
- package/dist/runtime/server/dist/secrets/provider-registry.js.map +0 -1
- package/dist/runtime/server/dist/secrets/types.d.ts +0 -21
- package/dist/runtime/server/dist/secrets/types.d.ts.map +0 -1
- package/dist/runtime/server/dist/secrets/types.js +0 -2
- package/dist/runtime/server/dist/secrets/types.js.map +0 -1
- package/dist/runtime/server/dist/services/access.d.ts +0 -93
- package/dist/runtime/server/dist/services/access.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/access.js +0 -231
- package/dist/runtime/server/dist/services/access.js.map +0 -1
- package/dist/runtime/server/dist/services/activity-log.d.ts +0 -17
- package/dist/runtime/server/dist/services/activity-log.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/activity-log.js +0 -68
- package/dist/runtime/server/dist/services/activity-log.js.map +0 -1
- package/dist/runtime/server/dist/services/activity.d.ts +0 -764
- package/dist/runtime/server/dist/services/activity.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/activity.js +0 -105
- package/dist/runtime/server/dist/services/activity.js.map +0 -1
- package/dist/runtime/server/dist/services/agent-permissions.d.ts +0 -6
- package/dist/runtime/server/dist/services/agent-permissions.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/agent-permissions.js +0 -18
- package/dist/runtime/server/dist/services/agent-permissions.js.map +0 -1
- package/dist/runtime/server/dist/services/agents.d.ts +0 -1670
- package/dist/runtime/server/dist/services/agents.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/agents.js +0 -572
- package/dist/runtime/server/dist/services/agents.js.map +0 -1
- package/dist/runtime/server/dist/services/approvals.d.ts +0 -546
- package/dist/runtime/server/dist/services/approvals.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/approvals.js +0 -206
- package/dist/runtime/server/dist/services/approvals.js.map +0 -1
- package/dist/runtime/server/dist/services/assets.d.ts +0 -33
- package/dist/runtime/server/dist/services/assets.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/assets.js +0 -17
- package/dist/runtime/server/dist/services/assets.js.map +0 -1
- package/dist/runtime/server/dist/services/budgets.d.ts +0 -38
- package/dist/runtime/server/dist/services/budgets.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/budgets.js +0 -784
- package/dist/runtime/server/dist/services/budgets.js.map +0 -1
- package/dist/runtime/server/dist/services/companies.d.ts +0 -124
- package/dist/runtime/server/dist/services/companies.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/companies.js +0 -256
- package/dist/runtime/server/dist/services/companies.js.map +0 -1
- package/dist/runtime/server/dist/services/company-portability.d.ts +0 -8
- package/dist/runtime/server/dist/services/company-portability.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/company-portability.js +0 -869
- package/dist/runtime/server/dist/services/company-portability.js.map +0 -1
- package/dist/runtime/server/dist/services/costs.d.ts +0 -114
- package/dist/runtime/server/dist/services/costs.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/costs.js +0 -294
- package/dist/runtime/server/dist/services/costs.js.map +0 -1
- package/dist/runtime/server/dist/services/cron.d.ts +0 -80
- package/dist/runtime/server/dist/services/cron.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/cron.js +0 -300
- package/dist/runtime/server/dist/services/cron.js.map +0 -1
- package/dist/runtime/server/dist/services/dashboard.d.ts +0 -26
- package/dist/runtime/server/dist/services/dashboard.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/dashboard.js +0 -98
- package/dist/runtime/server/dist/services/dashboard.js.map +0 -1
- package/dist/runtime/server/dist/services/documents.d.ts +0 -164
- package/dist/runtime/server/dist/services/documents.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/documents.js +0 -382
- package/dist/runtime/server/dist/services/documents.js.map +0 -1
- package/dist/runtime/server/dist/services/execution-workspace-policy.d.ts +0 -20
- package/dist/runtime/server/dist/services/execution-workspace-policy.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/execution-workspace-policy.js +0 -165
- package/dist/runtime/server/dist/services/execution-workspace-policy.js.map +0 -1
- package/dist/runtime/server/dist/services/execution-workspaces.d.ts +0 -19
- package/dist/runtime/server/dist/services/execution-workspaces.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/execution-workspaces.js +0 -87
- package/dist/runtime/server/dist/services/execution-workspaces.js.map +0 -1
- package/dist/runtime/server/dist/services/finance.d.ts +0 -93
- package/dist/runtime/server/dist/services/finance.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/finance.js +0 -120
- package/dist/runtime/server/dist/services/finance.js.map +0 -1
- package/dist/runtime/server/dist/services/goals.d.ts +0 -433
- package/dist/runtime/server/dist/services/goals.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/goals.js +0 -54
- package/dist/runtime/server/dist/services/goals.js.map +0 -1
- package/dist/runtime/server/dist/services/gtm-state.d.ts +0 -6
- package/dist/runtime/server/dist/services/gtm-state.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/gtm-state.js +0 -88
- package/dist/runtime/server/dist/services/gtm-state.js.map +0 -1
- package/dist/runtime/server/dist/services/heartbeat-run-summary.d.ts +0 -2
- package/dist/runtime/server/dist/services/heartbeat-run-summary.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/heartbeat-run-summary.js +0 -30
- package/dist/runtime/server/dist/services/heartbeat-run-summary.js.map +0 -1
- package/dist/runtime/server/dist/services/heartbeat.d.ts +0 -796
- package/dist/runtime/server/dist/services/heartbeat.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/heartbeat.js +0 -3046
- package/dist/runtime/server/dist/services/heartbeat.js.map +0 -1
- package/dist/runtime/server/dist/services/hire-hook.d.ts +0 -14
- package/dist/runtime/server/dist/services/hire-hook.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/hire-hook.js +0 -85
- package/dist/runtime/server/dist/services/hire-hook.js.map +0 -1
- package/dist/runtime/server/dist/services/index.d.ts +0 -30
- package/dist/runtime/server/dist/services/index.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/index.js +0 -30
- package/dist/runtime/server/dist/services/index.js.map +0 -1
- package/dist/runtime/server/dist/services/instance-settings.d.ts +0 -9
- package/dist/runtime/server/dist/services/instance-settings.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/instance-settings.js +0 -80
- package/dist/runtime/server/dist/services/instance-settings.js.map +0 -1
- package/dist/runtime/server/dist/services/issue-approvals.d.ts +0 -56
- package/dist/runtime/server/dist/services/issue-approvals.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/issue-approvals.js +0 -153
- package/dist/runtime/server/dist/services/issue-approvals.js.map +0 -1
- package/dist/runtime/server/dist/services/issue-goal-fallback.d.ts +0 -15
- package/dist/runtime/server/dist/services/issue-goal-fallback.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/issue-goal-fallback.js +0 -15
- package/dist/runtime/server/dist/services/issue-goal-fallback.js.map +0 -1
- package/dist/runtime/server/dist/services/issues.d.ts +0 -536
- package/dist/runtime/server/dist/services/issues.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/issues.js +0 -1321
- package/dist/runtime/server/dist/services/issues.js.map +0 -1
- package/dist/runtime/server/dist/services/live-events.d.ts +0 -17
- package/dist/runtime/server/dist/services/live-events.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/live-events.js +0 -33
- package/dist/runtime/server/dist/services/live-events.js.map +0 -1
- package/dist/runtime/server/dist/services/plugin-capability-validator.d.ts +0 -108
- package/dist/runtime/server/dist/services/plugin-capability-validator.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/plugin-capability-validator.js +0 -268
- package/dist/runtime/server/dist/services/plugin-capability-validator.js.map +0 -1
- package/dist/runtime/server/dist/services/plugin-config-validator.d.ts +0 -26
- package/dist/runtime/server/dist/services/plugin-config-validator.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/plugin-config-validator.js +0 -41
- package/dist/runtime/server/dist/services/plugin-config-validator.js.map +0 -1
- package/dist/runtime/server/dist/services/plugin-dev-watcher.d.ts +0 -30
- package/dist/runtime/server/dist/services/plugin-dev-watcher.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/plugin-dev-watcher.js +0 -241
- package/dist/runtime/server/dist/services/plugin-dev-watcher.js.map +0 -1
- package/dist/runtime/server/dist/services/plugin-event-bus.d.ts +0 -149
- package/dist/runtime/server/dist/services/plugin-event-bus.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/plugin-event-bus.js +0 -258
- package/dist/runtime/server/dist/services/plugin-event-bus.js.map +0 -1
- package/dist/runtime/server/dist/services/plugin-host-service-cleanup.d.ts +0 -14
- package/dist/runtime/server/dist/services/plugin-host-service-cleanup.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/plugin-host-service-cleanup.js +0 -37
- package/dist/runtime/server/dist/services/plugin-host-service-cleanup.js.map +0 -1
- package/dist/runtime/server/dist/services/plugin-host-services.d.ts +0 -13
- package/dist/runtime/server/dist/services/plugin-host-services.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/plugin-host-services.js +0 -969
- package/dist/runtime/server/dist/services/plugin-host-services.js.map +0 -1
- package/dist/runtime/server/dist/services/plugin-job-coordinator.d.ts +0 -81
- package/dist/runtime/server/dist/services/plugin-job-coordinator.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/plugin-job-coordinator.js +0 -172
- package/dist/runtime/server/dist/services/plugin-job-coordinator.js.map +0 -1
- package/dist/runtime/server/dist/services/plugin-job-scheduler.d.ts +0 -163
- package/dist/runtime/server/dist/services/plugin-job-scheduler.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/plugin-job-scheduler.js +0 -454
- package/dist/runtime/server/dist/services/plugin-job-scheduler.js.map +0 -1
- package/dist/runtime/server/dist/services/plugin-job-store.d.ts +0 -208
- package/dist/runtime/server/dist/services/plugin-job-store.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/plugin-job-store.js +0 -350
- package/dist/runtime/server/dist/services/plugin-job-store.js.map +0 -1
- package/dist/runtime/server/dist/services/plugin-lifecycle.d.ts +0 -203
- package/dist/runtime/server/dist/services/plugin-lifecycle.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/plugin-lifecycle.js +0 -476
- package/dist/runtime/server/dist/services/plugin-lifecycle.js.map +0 -1
- package/dist/runtime/server/dist/services/plugin-loader.d.ts +0 -441
- package/dist/runtime/server/dist/services/plugin-loader.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/plugin-loader.js +0 -1192
- package/dist/runtime/server/dist/services/plugin-loader.js.map +0 -1
- package/dist/runtime/server/dist/services/plugin-log-retention.d.ts +0 -20
- package/dist/runtime/server/dist/services/plugin-log-retention.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/plugin-log-retention.js +0 -63
- package/dist/runtime/server/dist/services/plugin-log-retention.js.map +0 -1
- package/dist/runtime/server/dist/services/plugin-manifest-validator.d.ts +0 -79
- package/dist/runtime/server/dist/services/plugin-manifest-validator.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/plugin-manifest-validator.js +0 -84
- package/dist/runtime/server/dist/services/plugin-manifest-validator.js.map +0 -1
- package/dist/runtime/server/dist/services/plugin-registry.d.ts +0 -2542
- package/dist/runtime/server/dist/services/plugin-registry.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/plugin-registry.js +0 -539
- package/dist/runtime/server/dist/services/plugin-registry.js.map +0 -1
- package/dist/runtime/server/dist/services/plugin-runtime-sandbox.d.ts +0 -40
- package/dist/runtime/server/dist/services/plugin-runtime-sandbox.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/plugin-runtime-sandbox.js +0 -154
- package/dist/runtime/server/dist/services/plugin-runtime-sandbox.js.map +0 -1
- package/dist/runtime/server/dist/services/plugin-secrets-handler.d.ts +0 -81
- package/dist/runtime/server/dist/services/plugin-secrets-handler.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/plugin-secrets-handler.js +0 -275
- package/dist/runtime/server/dist/services/plugin-secrets-handler.js.map +0 -1
- package/dist/runtime/server/dist/services/plugin-state-store.d.ts +0 -92
- package/dist/runtime/server/dist/services/plugin-state-store.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/plugin-state-store.js +0 -190
- package/dist/runtime/server/dist/services/plugin-state-store.js.map +0 -1
- package/dist/runtime/server/dist/services/plugin-stream-bus.d.ts +0 -29
- package/dist/runtime/server/dist/services/plugin-stream-bus.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/plugin-stream-bus.js +0 -48
- package/dist/runtime/server/dist/services/plugin-stream-bus.js.map +0 -1
- package/dist/runtime/server/dist/services/plugin-tool-dispatcher.d.ts +0 -180
- package/dist/runtime/server/dist/services/plugin-tool-dispatcher.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/plugin-tool-dispatcher.js +0 -224
- package/dist/runtime/server/dist/services/plugin-tool-dispatcher.js.map +0 -1
- package/dist/runtime/server/dist/services/plugin-tool-registry.d.ts +0 -192
- package/dist/runtime/server/dist/services/plugin-tool-registry.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/plugin-tool-registry.js +0 -224
- package/dist/runtime/server/dist/services/plugin-tool-registry.js.map +0 -1
- package/dist/runtime/server/dist/services/plugin-worker-manager.d.ts +0 -260
- package/dist/runtime/server/dist/services/plugin-worker-manager.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/plugin-worker-manager.js +0 -835
- package/dist/runtime/server/dist/services/plugin-worker-manager.js.map +0 -1
- package/dist/runtime/server/dist/services/projects.d.ts +0 -87
- package/dist/runtime/server/dist/services/projects.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/projects.js +0 -656
- package/dist/runtime/server/dist/services/projects.js.map +0 -1
- package/dist/runtime/server/dist/services/quota-windows.d.ts +0 -9
- package/dist/runtime/server/dist/services/quota-windows.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/quota-windows.js +0 -56
- package/dist/runtime/server/dist/services/quota-windows.js.map +0 -1
- package/dist/runtime/server/dist/services/run-log-store.d.ts +0 -34
- package/dist/runtime/server/dist/services/run-log-store.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/run-log-store.js +0 -109
- package/dist/runtime/server/dist/services/run-log-store.js.map +0 -1
- package/dist/runtime/server/dist/services/secrets.d.ts +0 -510
- package/dist/runtime/server/dist/services/secrets.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/secrets.js +0 -288
- package/dist/runtime/server/dist/services/secrets.js.map +0 -1
- package/dist/runtime/server/dist/services/sidebar-badges.d.ts +0 -9
- package/dist/runtime/server/dist/services/sidebar-badges.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/sidebar-badges.js +0 -33
- package/dist/runtime/server/dist/services/sidebar-badges.js.map +0 -1
- package/dist/runtime/server/dist/services/tickets.d.ts +0 -1869
- package/dist/runtime/server/dist/services/tickets.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/tickets.js +0 -78
- package/dist/runtime/server/dist/services/tickets.js.map +0 -1
- package/dist/runtime/server/dist/services/work-products.d.ts +0 -14
- package/dist/runtime/server/dist/services/work-products.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/work-products.js +0 -100
- package/dist/runtime/server/dist/services/work-products.js.map +0 -1
- package/dist/runtime/server/dist/services/workspace-operation-log-store.d.ts +0 -33
- package/dist/runtime/server/dist/services/workspace-operation-log-store.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/workspace-operation-log-store.js +0 -110
- package/dist/runtime/server/dist/services/workspace-operation-log-store.js.map +0 -1
- package/dist/runtime/server/dist/services/workspace-operations.d.ts +0 -44
- package/dist/runtime/server/dist/services/workspace-operations.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/workspace-operations.js +0 -204
- package/dist/runtime/server/dist/services/workspace-operations.js.map +0 -1
- package/dist/runtime/server/dist/services/workspace-runtime.d.ts +0 -164
- package/dist/runtime/server/dist/services/workspace-runtime.d.ts.map +0 -1
- package/dist/runtime/server/dist/services/workspace-runtime.js +0 -1235
- package/dist/runtime/server/dist/services/workspace-runtime.js.map +0 -1
- package/dist/runtime/server/dist/startup-banner.d.ts +0 -31
- package/dist/runtime/server/dist/startup-banner.d.ts.map +0 -1
- package/dist/runtime/server/dist/startup-banner.js +0 -117
- package/dist/runtime/server/dist/startup-banner.js.map +0 -1
- package/dist/runtime/server/dist/storage/index.d.ts +0 -6
- package/dist/runtime/server/dist/storage/index.d.ts.map +0 -1
- package/dist/runtime/server/dist/storage/index.js +0 -29
- package/dist/runtime/server/dist/storage/index.js.map +0 -1
- package/dist/runtime/server/dist/storage/local-disk-provider.d.ts +0 -3
- package/dist/runtime/server/dist/storage/local-disk-provider.d.ts.map +0 -1
- package/dist/runtime/server/dist/storage/local-disk-provider.js +0 -79
- package/dist/runtime/server/dist/storage/local-disk-provider.js.map +0 -1
- package/dist/runtime/server/dist/storage/provider-registry.d.ts +0 -4
- package/dist/runtime/server/dist/storage/provider-registry.d.ts.map +0 -1
- package/dist/runtime/server/dist/storage/provider-registry.js +0 -15
- package/dist/runtime/server/dist/storage/provider-registry.js.map +0 -1
- package/dist/runtime/server/dist/storage/s3-provider.d.ts +0 -11
- package/dist/runtime/server/dist/storage/s3-provider.d.ts.map +0 -1
- package/dist/runtime/server/dist/storage/s3-provider.js +0 -123
- package/dist/runtime/server/dist/storage/s3-provider.js.map +0 -1
- package/dist/runtime/server/dist/storage/service.d.ts +0 -3
- package/dist/runtime/server/dist/storage/service.d.ts.map +0 -1
- package/dist/runtime/server/dist/storage/service.js +0 -120
- package/dist/runtime/server/dist/storage/service.js.map +0 -1
- package/dist/runtime/server/dist/storage/types.d.ts +0 -55
- package/dist/runtime/server/dist/storage/types.d.ts.map +0 -1
- package/dist/runtime/server/dist/storage/types.js +0 -2
- package/dist/runtime/server/dist/storage/types.js.map +0 -1
- package/dist/runtime/server/dist/ui-branding.d.ts +0 -14
- package/dist/runtime/server/dist/ui-branding.d.ts.map +0 -1
- package/dist/runtime/server/dist/ui-branding.js +0 -189
- package/dist/runtime/server/dist/ui-branding.js.map +0 -1
- package/dist/runtime/server/dist/version.d.ts +0 -2
- package/dist/runtime/server/dist/version.d.ts.map +0 -1
- package/dist/runtime/server/dist/version.js +0 -5
- package/dist/runtime/server/dist/version.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/cli/format-event.d.ts +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/cli/format-event.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/cli/format-event.js +0 -94
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/cli/format-event.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/cli/index.d.ts +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/cli/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/cli/index.js +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/cli/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/cli/quota-probe.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/cli/quota-probe.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/cli/quota-probe.js +0 -106
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/cli/quota-probe.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/index.d.ts +0 -8
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/index.js +0 -36
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/execute.d.ts +0 -18
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/execute.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/execute.js +0 -453
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/execute.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/index.d.ts +0 -7
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/index.js +0 -56
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/parse.d.ts +0 -22
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/parse.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/parse.js +0 -158
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/parse.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/quota.d.ts +0 -20
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/quota.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/quota.js +0 -477
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/quota.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/test.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/test.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/test.js +0 -201
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/test.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/ui/build-config.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/ui/build-config.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/ui/build-config.js +0 -115
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/ui/build-config.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/ui/index.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/ui/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/ui/index.js +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/ui/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/ui/parse-stdout.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/ui/parse-stdout.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/ui/parse-stdout.js +0 -149
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/ui/parse-stdout.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/package.json +0 -42
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/cli/format-event.d.ts +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/cli/format-event.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/cli/format-event.js +0 -213
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/cli/format-event.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/cli/index.d.ts +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/cli/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/cli/index.js +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/cli/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/cli/quota-probe.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/cli/quota-probe.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/cli/quota-probe.js +0 -97
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/cli/quota-probe.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/index.d.ts +0 -10
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/index.js +0 -45
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/codex-home.d.ts +0 -5
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/codex-home.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/codex-home.js +0 -86
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/codex-home.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/execute.d.ts +0 -11
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/execute.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/execute.js +0 -451
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/execute.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/index.d.ts +0 -7
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/index.js +0 -56
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/parse.d.ts +0 -12
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/parse.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/parse.js +0 -67
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/parse.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/quota.d.ts +0 -64
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/quota.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/quota.js +0 -425
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/quota.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/test.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/test.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/test.js +0 -194
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/test.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/ui/build-config.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/ui/build-config.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/ui/build-config.js +0 -116
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/ui/build-config.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/ui/index.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/ui/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/ui/index.js +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/ui/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/ui/parse-stdout.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/ui/parse-stdout.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/ui/parse-stdout.js +0 -233
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/ui/parse-stdout.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/package.json +0 -42
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/cli/format-event.d.ts +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/cli/format-event.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/cli/format-event.js +0 -296
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/cli/format-event.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/cli/index.d.ts +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/cli/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/cli/index.js +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/cli/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/index.d.ts +0 -9
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/index.js +0 -81
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/server/execute.d.ts +0 -14
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/server/execute.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/server/execute.js +0 -416
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/server/execute.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/server/index.d.ts +0 -6
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/server/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/server/index.js +0 -61
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/server/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/server/parse.d.ts +0 -13
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/server/parse.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/server/parse.js +0 -139
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/server/parse.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/server/test.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/server/test.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/server/test.js +0 -188
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/server/test.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/shared/stream.d.ts +0 -5
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/shared/stream.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/shared/stream.js +0 -13
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/shared/stream.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/shared/trust.d.ts +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/shared/trust.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/shared/trust.js +0 -7
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/shared/trust.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/ui/build-config.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/ui/build-config.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/ui/build-config.js +0 -92
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/ui/build-config.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/ui/index.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/ui/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/ui/index.js +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/ui/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/ui/parse-stdout.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/ui/parse-stdout.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/ui/parse-stdout.js +0 -373
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/ui/parse-stdout.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/package.json +0 -42
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/cli/format-event.d.ts +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/cli/format-event.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/cli/format-event.js +0 -198
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/cli/format-event.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/cli/index.d.ts +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/cli/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/cli/index.js +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/cli/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/index.d.ts +0 -9
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/index.js +0 -46
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/execute.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/execute.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/execute.js +0 -364
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/execute.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/index.d.ts +0 -6
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/index.js +0 -61
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/parse.d.ts +0 -31
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/parse.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/parse.js +0 -227
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/parse.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/test.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/test.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/test.js +0 -203
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/test.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/utils.d.ts +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/utils.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/utils.js +0 -7
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/utils.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/ui/build-config.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/ui/build-config.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/ui/build-config.js +0 -84
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/ui/build-config.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/ui/index.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/ui/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/ui/index.js +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/ui/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/ui/parse-stdout.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/ui/parse-stdout.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/ui/parse-stdout.js +0 -247
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/ui/parse-stdout.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/package.json +0 -42
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/cli/format-event.d.ts +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/cli/format-event.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/cli/format-event.js +0 -20
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/cli/format-event.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/cli/index.d.ts +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/cli/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/cli/index.js +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/cli/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/index.d.ts +0 -8
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/index.js +0 -53
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/server/execute.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/server/execute.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/server/execute.js +0 -1146
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/server/execute.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/server/index.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/server/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/server/index.js +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/server/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/server/test.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/server/test.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/server/test.js +0 -290
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/server/test.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/shared/stream.d.ts +0 -5
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/shared/stream.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/shared/stream.js +0 -13
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/shared/stream.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/ui/build-config.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/ui/build-config.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/ui/build-config.js +0 -33
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/ui/build-config.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/ui/index.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/ui/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/ui/index.js +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/ui/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/ui/parse-stdout.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/ui/parse-stdout.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/ui/parse-stdout.js +0 -64
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/ui/parse-stdout.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/package.json +0 -43
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/cli/format-event.d.ts +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/cli/format-event.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/cli/format-event.js +0 -115
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/cli/format-event.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/cli/index.d.ts +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/cli/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/cli/index.js +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/cli/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/index.d.ts +0 -8
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/index.js +0 -39
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/execute.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/execute.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/execute.js +0 -337
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/execute.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/index.d.ts +0 -7
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/index.js +0 -62
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/models.d.ts +0 -20
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/models.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/models.js +0 -165
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/models.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/models.test.d.ts +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/models.test.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/models.test.js +0 -22
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/models.test.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/parse.d.ts +0 -13
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/parse.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/parse.js +0 -97
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/parse.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/parse.test.d.ts +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/parse.test.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/parse.test.js +0 -48
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/parse.test.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/test.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/test.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/test.js +0 -300
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/test.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/ui/build-config.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/ui/build-config.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/ui/build-config.js +0 -87
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/ui/build-config.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/ui/index.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/ui/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/ui/index.js +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/ui/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/ui/parse-stdout.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/ui/parse-stdout.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/ui/parse-stdout.js +0 -141
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/ui/parse-stdout.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/package.json +0 -42
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/cli/format-event.d.ts +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/cli/format-event.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/cli/format-event.js +0 -99
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/cli/format-event.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/cli/index.d.ts +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/cli/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/cli/index.js +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/cli/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/index.d.ts +0 -8
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/index.js +0 -39
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/execute.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/execute.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/execute.js +0 -405
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/execute.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/index.d.ts +0 -7
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/index.js +0 -50
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/models.d.ts +0 -20
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/models.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/models.js +0 -161
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/models.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/models.test.d.ts +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/models.test.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/models.test.js +0 -22
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/models.test.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/parse.d.ts +0 -23
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/parse.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/parse.js +0 -180
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/parse.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/parse.test.d.ts +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/parse.test.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/parse.test.js +0 -206
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/parse.test.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/test.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/test.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/test.js +0 -257
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/test.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/ui/build-config.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/ui/build-config.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/ui/build-config.js +0 -82
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/ui/build-config.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/ui/index.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/ui/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/ui/index.js +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/ui/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/ui/parse-stdout.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/ui/parse-stdout.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/ui/parse-stdout.js +0 -163
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/ui/parse-stdout.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/package.json +0 -42
- package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/billing.d.ts +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/billing.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/billing.js +0 -16
- package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/billing.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/billing.test.d.ts +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/billing.test.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/billing.test.js +0 -14
- package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/billing.test.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/index.d.ts +0 -6
- package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/index.js +0 -4
- package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/log-redaction.d.ts +0 -6
- package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/log-redaction.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/log-redaction.js +0 -75
- package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/log-redaction.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/server-utils.d.ts +0 -62
- package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/server-utils.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/server-utils.js +0 -419
- package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/server-utils.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/session-compaction.d.ts +0 -25
- package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/session-compaction.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/session-compaction.js +0 -142
- package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/session-compaction.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/types.d.ts +0 -290
- package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/types.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/types.js +0 -5
- package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/types.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/package.json +0 -30
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/backup-lib.d.ts +0 -24
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/backup-lib.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/backup-lib.js +0 -448
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/backup-lib.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/backup.d.ts +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/backup.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/backup.js +0 -103
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/backup.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/client.d.ts +0 -43
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/client.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/client.js +0 -574
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/client.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/client.test.d.ts +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/client.test.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/client.test.js +0 -117
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/client.test.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/index.d.ts +0 -4
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/index.js +0 -4
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrate.d.ts +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrate.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrate.js +0 -25
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrate.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migration-runtime.d.ts +0 -7
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migration-runtime.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migration-runtime.js +0 -163
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migration-runtime.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migration-status.d.ts +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migration-status.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migration-status.js +0 -55
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migration-status.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0000_mature_masked_marvel.sql +0 -208
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0001_fast_northstar.sql +0 -87
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0002_big_zaladane.sql +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0003_shallow_quentin_quire.sql +0 -5
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0004_issue_identifiers.sql +0 -28
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0005_chief_luke_cage.sql +0 -19
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0006_overjoyed_mister_sinister.sql +0 -36
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0007_new_quentin_quire.sql +0 -20
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0008_amused_zzzax.sql +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0009_fast_jackal.sql +0 -36
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0010_stale_justin_hammer.sql +0 -37
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0011_windy_corsair.sql +0 -18
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0012_perpetual_ser_duncan.sql +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0013_dashing_wasp.sql +0 -4
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0014_many_mikhail_rasputin.sql +0 -135
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0015_project_color_archived.sql +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0016_agent_icon.sql +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0017_tiresome_gabe_jones.sql +0 -51
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0018_flat_sleepwalker.sql +0 -26
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0019_public_victor_mancha.sql +0 -18
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0020_white_anita_blake.sql +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0021_chief_vindicator.sql +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0022_company_brand_color.sql +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0023_fair_lethal_legion.sql +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0024_far_beast.sql +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0025_nasty_salo.sql +0 -15
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0026_lying_pete_wisdom.sql +0 -39
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0027_tranquil_tenebrous.sql +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0028_harsh_goliath.sql +0 -54
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0029_plugin_tables.sql +0 -177
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0030_rich_magneto.sql +0 -12
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0031_zippy_magma.sql +0 -51
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0032_pretty_doctor_octopus.sql +0 -102
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0033_shiny_black_tarantula.sql +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0034_fat_dormammu.sql +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0035_marvelous_satana.sql +0 -91
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0036_cheerful_nitro.sql +0 -9
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0037_friendly_eddie_brock.sql +0 -29
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0038_careless_iron_monger.sql +0 -5
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0039_tickets.sql +0 -25
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0000_snapshot.json +0 -1743
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0001_snapshot.json +0 -2441
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0002_snapshot.json +0 -2454
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0003_snapshot.json +0 -2502
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0005_snapshot.json +0 -2719
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0006_snapshot.json +0 -3048
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0007_snapshot.json +0 -3258
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0008_snapshot.json +0 -3264
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0009_snapshot.json +0 -3587
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0010_snapshot.json +0 -3929
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0011_snapshot.json +0 -4068
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0012_snapshot.json +0 -4087
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0013_snapshot.json +0 -4118
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0014_snapshot.json +0 -5187
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0017_snapshot.json +0 -5215
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0018_snapshot.json +0 -5450
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0019_snapshot.json +0 -5603
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0020_snapshot.json +0 -5603
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0021_snapshot.json +0 -5609
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0023_snapshot.json +0 -5633
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0024_snapshot.json +0 -5693
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0025_snapshot.json +0 -5849
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0027_snapshot.json +0 -6205
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0028_snapshot.json +0 -6710
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0029_snapshot.json +0 -7899
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0030_snapshot.json +0 -8003
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0031_snapshot.json +0 -7242
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0032_snapshot.json +0 -7733
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0033_snapshot.json +0 -9038
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0034_snapshot.json +0 -9039
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0035_snapshot.json +0 -9959
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0036_snapshot.json +0 -10023
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0037_snapshot.json +0 -10263
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0038_snapshot.json +0 -10301
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/_journal.json +0 -286
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0000_mature_masked_marvel.sql +0 -208
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0001_fast_northstar.sql +0 -87
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0002_big_zaladane.sql +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0003_shallow_quentin_quire.sql +0 -5
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0004_issue_identifiers.sql +0 -28
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0005_chief_luke_cage.sql +0 -19
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0006_overjoyed_mister_sinister.sql +0 -36
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0007_new_quentin_quire.sql +0 -20
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0008_amused_zzzax.sql +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0009_fast_jackal.sql +0 -36
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0010_stale_justin_hammer.sql +0 -37
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0011_windy_corsair.sql +0 -18
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0012_perpetual_ser_duncan.sql +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0013_dashing_wasp.sql +0 -4
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0014_many_mikhail_rasputin.sql +0 -135
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0015_project_color_archived.sql +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0016_agent_icon.sql +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0017_tiresome_gabe_jones.sql +0 -51
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0018_flat_sleepwalker.sql +0 -26
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0019_public_victor_mancha.sql +0 -18
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0020_white_anita_blake.sql +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0021_chief_vindicator.sql +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0022_company_brand_color.sql +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0023_fair_lethal_legion.sql +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0024_far_beast.sql +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0025_nasty_salo.sql +0 -15
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0026_lying_pete_wisdom.sql +0 -39
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0027_tranquil_tenebrous.sql +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0028_harsh_goliath.sql +0 -54
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0029_plugin_tables.sql +0 -177
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0030_rich_magneto.sql +0 -12
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0031_zippy_magma.sql +0 -51
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0032_pretty_doctor_octopus.sql +0 -102
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0033_shiny_black_tarantula.sql +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0034_fat_dormammu.sql +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0035_marvelous_satana.sql +0 -91
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0036_cheerful_nitro.sql +0 -9
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0037_friendly_eddie_brock.sql +0 -29
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0038_careless_iron_monger.sql +0 -5
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0039_tickets.sql +0 -25
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0040_ticket_meta.sql +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0000_snapshot.json +0 -1743
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0001_snapshot.json +0 -2441
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0002_snapshot.json +0 -2454
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0003_snapshot.json +0 -2502
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0005_snapshot.json +0 -2719
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0006_snapshot.json +0 -3048
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0007_snapshot.json +0 -3258
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0008_snapshot.json +0 -3264
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0009_snapshot.json +0 -3587
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0010_snapshot.json +0 -3929
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0011_snapshot.json +0 -4068
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0012_snapshot.json +0 -4087
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0013_snapshot.json +0 -4118
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0014_snapshot.json +0 -5187
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0017_snapshot.json +0 -5215
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0018_snapshot.json +0 -5450
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0019_snapshot.json +0 -5603
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0020_snapshot.json +0 -5603
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0021_snapshot.json +0 -5609
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0023_snapshot.json +0 -5633
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0024_snapshot.json +0 -5693
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0025_snapshot.json +0 -5849
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0027_snapshot.json +0 -6205
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0028_snapshot.json +0 -6710
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0029_snapshot.json +0 -7899
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0030_snapshot.json +0 -8003
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0031_snapshot.json +0 -7242
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0032_snapshot.json +0 -7733
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0033_snapshot.json +0 -9038
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0034_snapshot.json +0 -9039
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0035_snapshot.json +0 -9959
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0036_snapshot.json +0 -10023
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0037_snapshot.json +0 -10263
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0038_snapshot.json +0 -10301
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/_journal.json +0 -293
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/runtime-config.d.ts +0 -16
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/runtime-config.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/runtime-config.js +0 -197
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/runtime-config.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/runtime-config.test.d.ts +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/runtime-config.test.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/runtime-config.test.js +0 -93
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/runtime-config.test.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/activity_log.d.ts +0 -197
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/activity_log.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/activity_log.js +0 -22
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/activity_log.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_api_keys.d.ts +0 -144
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_api_keys.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_api_keys.js +0 -17
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_api_keys.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_config_revisions.d.ts +0 -201
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_config_revisions.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_config_revisions.js +0 -20
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_config_revisions.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_runtime_state.d.ts +0 -248
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_runtime_state.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_runtime_state.js +0 -23
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_runtime_state.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_task_sessions.d.ts +0 -197
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_task_sessions.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_task_sessions.js +0 -22
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_task_sessions.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_wakeup_requests.d.ts +0 -333
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_wakeup_requests.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_wakeup_requests.js +0 -29
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_wakeup_requests.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agents.d.ts +0 -373
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agents.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agents.js +0 -29
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agents.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/approval_comments.d.ts +0 -144
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/approval_comments.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/approval_comments.js +0 -19
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/approval_comments.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/approvals.d.ts +0 -214
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/approvals.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/approvals.js +0 -20
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/approvals.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/assets.d.ts +0 -212
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/assets.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/assets.js +0 -22
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/assets.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/auth.d.ts +0 -607
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/auth.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/auth.js +0 -44
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/auth.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/budget_incidents.d.ts +0 -297
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/budget_incidents.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/budget_incidents.js +0 -29
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/budget_incidents.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/budget_policies.d.ts +0 -263
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/budget_policies.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/budget_policies.js +0 -24
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/budget_policies.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/companies.d.ts +0 -246
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/companies.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/companies.js +0 -22
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/companies.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/company_logos.d.ts +0 -93
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/company_logos.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/company_logos.js +0 -14
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/company_logos.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/company_memberships.d.ts +0 -144
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/company_memberships.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/company_memberships.js +0 -17
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/company_memberships.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/company_secret_versions.d.ts +0 -163
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/company_secret_versions.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/company_secret_versions.js +0 -19
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/company_secret_versions.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/company_secrets.d.ts +0 -195
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/company_secrets.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/company_secrets.js +0 -21
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/company_secrets.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/cost_events.d.ts +0 -314
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/cost_events.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/cost_events.js +0 -34
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/cost_events.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/document_revisions.d.ts +0 -161
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/document_revisions.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/document_revisions.js +0 -19
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/document_revisions.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/documents.d.ts +0 -229
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/documents.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/documents.js +0 -22
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/documents.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/execution_workspaces.d.ts +0 -418
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/execution_workspaces.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/execution_workspaces.js +0 -39
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/execution_workspaces.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/finance_events.d.ts +0 -469
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/finance_events.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/finance_events.js +0 -45
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/finance_events.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/goals.d.ts +0 -178
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/goals.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/goals.js +0 -18
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/goals.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/heartbeat_run_events.d.ts +0 -214
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/heartbeat_run_events.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/heartbeat_run_events.js +0 -23
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/heartbeat_run_events.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/heartbeat_runs.d.ts +0 -558
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/heartbeat_runs.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/heartbeat_runs.js +0 -43
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/heartbeat_runs.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/index.d.ts +0 -55
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/index.js +0 -55
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/instance_settings.d.ts +0 -95
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/instance_settings.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/instance_settings.js +0 -11
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/instance_settings.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/instance_user_roles.d.ts +0 -93
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/instance_user_roles.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/instance_user_roles.js +0 -12
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/instance_user_roles.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/invites.d.ts +0 -214
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/invites.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/invites.js +0 -20
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/invites.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_approvals.d.ts +0 -110
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_approvals.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_approvals.js +0 -19
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_approvals.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_attachments.d.ts +0 -127
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_attachments.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_attachments.js +0 -19
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_attachments.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_comments.d.ts +0 -144
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_comments.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_comments.js +0 -20
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_comments.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_documents.d.ts +0 -127
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_documents.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_documents.js +0 -18
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_documents.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_labels.d.ts +0 -76
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_labels.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_labels.js +0 -16
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_labels.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_read_states.d.ts +0 -127
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_read_states.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_read_states.js +0 -17
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_read_states.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_work_products.d.ts +0 -350
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_work_products.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_work_products.js +0 -37
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_work_products.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issues.d.ts +0 -590
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issues.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issues.js +0 -58
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issues.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/join_requests.d.ts +0 -384
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/join_requests.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/join_requests.js +0 -32
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/join_requests.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/labels.d.ts +0 -110
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/labels.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/labels.js +0 -14
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/labels.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_company_settings.d.ts +0 -158
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_company_settings.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_company_settings.js +0 -34
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_company_settings.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_config.d.ts +0 -123
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_config.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_config.js +0 -26
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_config.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_entities.d.ts +0 -213
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_entities.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_entities.js +0 -37
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_entities.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_jobs.d.ts +0 -392
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_jobs.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_jobs.js +0 -83
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_jobs.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_logs.d.ts +0 -125
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_logs.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_logs.js +0 -29
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_logs.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_state.d.ts +0 -169
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_state.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_state.js +0 -68
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_state.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_webhooks.d.ts +0 -239
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_webhooks.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_webhooks.js +0 -52
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_webhooks.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugins.d.ts +0 -246
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugins.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugins.js +0 -31
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugins.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/principal_permission_grants.d.ts +0 -163
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/principal_permission_grants.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/principal_permission_grants.js +0 -17
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/principal_permission_grants.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/project_goals.d.ts +0 -93
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/project_goals.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/project_goals.js +0 -17
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/project_goals.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/project_workspaces.d.ts +0 -333
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/project_workspaces.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/project_workspaces.js +0 -32
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/project_workspaces.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/projects.d.ts +0 -265
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/projects.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/projects.js +0 -24
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/projects.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/tickets.d.ts +0 -284
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/tickets.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/tickets.js +0 -24
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/tickets.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/workspace_operations.d.ts +0 -367
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/workspace_operations.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/workspace_operations.js +0 -35
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/workspace_operations.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/workspace_runtime_services.d.ts +0 -469
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/workspace_runtime_services.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/workspace_runtime_services.js +0 -44
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/workspace_runtime_services.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/seed.d.ts +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/seed.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/seed.js +0 -91
- package/dist/runtime/server/node_modules/@paperclipai/db/dist/seed.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/db/package.json +0 -36
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/bundlers.d.ts +0 -57
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/bundlers.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/bundlers.js +0 -105
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/bundlers.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/define-plugin.d.ts +0 -218
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/define-plugin.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/define-plugin.js +0 -85
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/define-plugin.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/dev-cli.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/dev-cli.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/dev-cli.js +0 -49
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/dev-cli.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/dev-server.d.ts +0 -34
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/dev-server.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/dev-server.js +0 -194
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/dev-server.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/host-client-factory.d.ts +0 -229
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/host-client-factory.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/host-client-factory.js +0 -353
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/host-client-factory.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/index.d.ts +0 -84
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/index.js +0 -84
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/protocol.d.ts +0 -881
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/protocol.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/protocol.js +0 -297
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/protocol.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/testing.d.ts +0 -63
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/testing.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/testing.js +0 -702
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/testing.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/types.d.ts +0 -982
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/types.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/types.js +0 -12
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/types.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/components.d.ts +0 -257
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/components.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/components.js +0 -97
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/components.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/hooks.d.ts +0 -120
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/hooks.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/hooks.js +0 -148
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/hooks.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/index.d.ts +0 -50
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/index.js +0 -48
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/runtime.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/runtime.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/runtime.js +0 -30
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/runtime.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/types.d.ts +0 -308
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/types.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/types.js +0 -17
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/types.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/worker-rpc-host.d.ts +0 -127
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/worker-rpc-host.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/worker-rpc-host.js +0 -941
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/worker-rpc-host.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/package.json +0 -74
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/agent-url-key.d.ts +0 -4
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/agent-url-key.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/agent-url-key.js +0 -22
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/agent-url-key.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/api.d.ts +0 -20
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/api.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/api.js +0 -20
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/api.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/config-schema.d.ts +0 -725
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/config-schema.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/config-schema.js +0 -151
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/config-schema.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/constants.d.ts +0 -214
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/constants.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/constants.js +0 -553
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/constants.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/gtm.d.ts +0 -116
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/gtm.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/gtm.js +0 -181
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/gtm.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/index.d.ts +0 -12
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/index.js +0 -11
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/project-mentions.d.ts +0 -9
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/project-mentions.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/project-mentions.js +0 -71
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/project-mentions.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/project-url-key.d.ts +0 -3
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/project-url-key.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/project-url-key.js +0 -16
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/project-url-key.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/surface-runtime.d.ts +0 -15
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/surface-runtime.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/surface-runtime.js +0 -40
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/surface-runtime.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/access.d.ts +0 -67
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/access.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/access.js +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/access.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/activity.d.ts +0 -14
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/activity.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/activity.js +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/activity.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/agent.d.ts +0 -80
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/agent.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/agent.js +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/agent.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/approval.d.ts +0 -26
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/approval.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/approval.js +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/approval.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/asset.d.ts +0 -16
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/asset.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/asset.js +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/asset.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/budget.d.ts +0 -86
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/budget.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/budget.js +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/budget.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/company-portability.d.ts +0 -120
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/company-portability.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/company-portability.js +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/company-portability.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/company.d.ts +0 -20
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/company.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/company.js +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/company.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/cost.d.ts +0 -106
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/cost.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/cost.js +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/cost.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/dashboard.d.ts +0 -28
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/dashboard.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/dashboard.js +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/dashboard.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/finance.d.ts +0 -57
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/finance.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/finance.js +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/finance.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/goal.d.ts +0 -14
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/goal.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/goal.js +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/goal.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/heartbeat.d.ts +0 -118
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/heartbeat.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/heartbeat.js +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/heartbeat.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/index.d.ts +0 -26
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/index.js +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/instance.d.ts +0 -10
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/instance.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/instance.js +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/instance.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/issue.d.ts +0 -164
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/issue.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/issue.js +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/issue.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/live.d.ts +0 -9
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/live.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/live.js +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/live.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/plugin.d.ts +0 -419
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/plugin.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/plugin.js +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/plugin.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/project.d.ts +0 -67
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/project.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/project.js +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/project.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/quota.d.ts +0 -26
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/quota.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/quota.js +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/quota.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/secrets.d.ts +0 -32
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/secrets.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/secrets.js +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/secrets.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/sidebar-badges.d.ts +0 -7
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/sidebar-badges.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/sidebar-badges.js +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/sidebar-badges.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/ticket.d.ts +0 -26
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/ticket.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/ticket.js +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/ticket.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/work-product.d.ts +0 -27
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/work-product.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/work-product.js +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/work-product.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/workspace-operation.d.ts +0 -26
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/workspace-operation.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/workspace-operation.js +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/workspace-operation.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/workspace-runtime.d.ts +0 -86
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/workspace-runtime.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/workspace-runtime.js +0 -2
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/workspace-runtime.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/access.d.ts +0 -109
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/access.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/access.js +0 -40
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/access.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/agent.d.ts +0 -235
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/agent.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/agent.js +0 -71
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/agent.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/approval.d.ts +0 -57
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/approval.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/approval.js +0 -23
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/approval.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/asset.d.ts +0 -10
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/asset.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/asset.js +0 -11
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/asset.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/budget.d.ts +0 -56
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/budget.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/budget.js +0 -27
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/budget.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/company-portability.d.ts +0 -1535
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/company-portability.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/company-portability.js +0 -95
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/company-portability.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/company.d.ts +0 -64
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/company.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/company.js +0 -25
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/company.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/cost.d.ts +0 -92
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/cost.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/cost.js +0 -26
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/cost.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/execution-workspace.d.ts +0 -20
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/execution-workspace.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/execution-workspace.js +0 -15
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/execution-workspace.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/finance.d.ts +0 -129
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/finance.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/finance.js +0 -32
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/finance.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/goal.d.ts +0 -48
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/goal.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/goal.js +0 -12
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/goal.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/index.d.ts +0 -19
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/index.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/index.js +0 -19
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/index.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/instance.d.ts +0 -18
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/instance.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/instance.js +0 -6
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/instance.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/issue.d.ts +0 -656
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/issue.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/issue.js +0 -95
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/issue.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/plugin.d.ts +0 -1173
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/plugin.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/plugin.js +0 -547
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/plugin.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/project.d.ts +0 -583
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/project.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/project.js +0 -93
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/project.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/secret.d.ts +0 -114
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/secret.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/secret.js +0 -35
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/secret.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/ticket.d.ts +0 -56
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/ticket.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/ticket.js +0 -22
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/ticket.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/work-product.d.ts +0 -105
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/work-product.d.ts.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/work-product.js +0 -46
- package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/work-product.js.map +0 -1
- package/dist/runtime/server/node_modules/@paperclipai/shared/package.json +0 -33
- package/dist/runtime/server/package.json +0 -5
- package/dist/runtime/server/ui-dist/android-chrome-192x192.png +0 -0
- package/dist/runtime/server/ui-dist/android-chrome-512x512.png +0 -0
- package/dist/runtime/server/ui-dist/apple-touch-icon.png +0 -0
- package/dist/runtime/server/ui-dist/assets/OnboardingWizard-BiZHH3vY.js +0 -834
- package/dist/runtime/server/ui-dist/assets/_basePickBy-DOJDGGWo.js +0 -1
- package/dist/runtime/server/ui-dist/assets/_baseUniq-DjoWC9VG.js +0 -1
- package/dist/runtime/server/ui-dist/assets/apl-B4CMkyY2.js +0 -1
- package/dist/runtime/server/ui-dist/assets/arc-DzAhgPuQ.js +0 -1
- package/dist/runtime/server/ui-dist/assets/architectureDiagram-VXUJARFQ-CFxoZ9U1.js +0 -36
- package/dist/runtime/server/ui-dist/assets/asciiarmor-Df11BRmG.js +0 -1
- package/dist/runtime/server/ui-dist/assets/asn1-EdZsLKOL.js +0 -1
- package/dist/runtime/server/ui-dist/assets/asterisk-B-8jnY81.js +0 -1
- package/dist/runtime/server/ui-dist/assets/blockDiagram-VD42YOAC-CmcNReYb.js +0 -122
- package/dist/runtime/server/ui-dist/assets/brainfuck-C4LP7Hcl.js +0 -1
- package/dist/runtime/server/ui-dist/assets/c4Diagram-YG6GDRKO-62g03z24.js +0 -10
- package/dist/runtime/server/ui-dist/assets/channel-CyMiLt_6.js +0 -1
- package/dist/runtime/server/ui-dist/assets/chunk-4BX2VUAB-DdKgkZWf.js +0 -1
- package/dist/runtime/server/ui-dist/assets/chunk-55IACEB6-BG61sDBH.js +0 -1
- package/dist/runtime/server/ui-dist/assets/chunk-B4BG7PRW-jHjDOzs3.js +0 -165
- package/dist/runtime/server/ui-dist/assets/chunk-DI55MBZ5-QWOEgAft.js +0 -220
- package/dist/runtime/server/ui-dist/assets/chunk-FMBD7UC4-BTtsDCBm.js +0 -15
- package/dist/runtime/server/ui-dist/assets/chunk-QN33PNHL-DQ0G5mTp.js +0 -1
- package/dist/runtime/server/ui-dist/assets/chunk-QZHKN3VN-CwD654Gq.js +0 -1
- package/dist/runtime/server/ui-dist/assets/chunk-TZMSLE5B-BW4AfItk.js +0 -1
- package/dist/runtime/server/ui-dist/assets/classDiagram-2ON5EDUG-Bpt4jbt_.js +0 -1
- package/dist/runtime/server/ui-dist/assets/classDiagram-v2-WZHVMYZB-Bpt4jbt_.js +0 -1
- package/dist/runtime/server/ui-dist/assets/clike-B9uivgTg.js +0 -1
- package/dist/runtime/server/ui-dist/assets/clojure-BMjYHr_A.js +0 -1
- package/dist/runtime/server/ui-dist/assets/clone-C1pAl4cM.js +0 -1
- package/dist/runtime/server/ui-dist/assets/cmake-BQqOBYOt.js +0 -1
- package/dist/runtime/server/ui-dist/assets/cobol-CWcv1MsR.js +0 -1
- package/dist/runtime/server/ui-dist/assets/coffeescript-S37ZYGWr.js +0 -1
- package/dist/runtime/server/ui-dist/assets/commonlisp-DBKNyK5s.js +0 -1
- package/dist/runtime/server/ui-dist/assets/cose-bilkent-S5V4N54A-Cl5X2jL8.js +0 -1
- package/dist/runtime/server/ui-dist/assets/crystal-SjHAIU92.js +0 -1
- package/dist/runtime/server/ui-dist/assets/css-BnMrqG3P.js +0 -1
- package/dist/runtime/server/ui-dist/assets/cypher-C_CwsFkJ.js +0 -1
- package/dist/runtime/server/ui-dist/assets/cytoscape.esm-BQaXIfA_.js +0 -331
- package/dist/runtime/server/ui-dist/assets/d-pRatUO7H.js +0 -1
- package/dist/runtime/server/ui-dist/assets/dagre-6UL2VRFP-B2u9a5zG.js +0 -4
- package/dist/runtime/server/ui-dist/assets/defaultLocale-DX6XiGOO.js +0 -1
- package/dist/runtime/server/ui-dist/assets/diagram-PSM6KHXK-DsSVNioI.js +0 -24
- package/dist/runtime/server/ui-dist/assets/diagram-QEK2KX5R-C2oaCik_.js +0 -43
- package/dist/runtime/server/ui-dist/assets/diagram-S2PKOQOG-CuEvUbkw.js +0 -24
- package/dist/runtime/server/ui-dist/assets/diff-DbItnlRl.js +0 -1
- package/dist/runtime/server/ui-dist/assets/dockerfile-BKs6k2Af.js +0 -1
- package/dist/runtime/server/ui-dist/assets/dtd-DF_7sFjM.js +0 -1
- package/dist/runtime/server/ui-dist/assets/dx-root-B5r5o3mh.js +0 -280
- package/dist/runtime/server/ui-dist/assets/dylan-DwRh75JA.js +0 -1
- package/dist/runtime/server/ui-dist/assets/ebnf-CDyGwa7X.js +0 -1
- package/dist/runtime/server/ui-dist/assets/ecl-Cabwm37j.js +0 -1
- package/dist/runtime/server/ui-dist/assets/eiffel-CnydiIhH.js +0 -1
- package/dist/runtime/server/ui-dist/assets/elm-vLlmbW-K.js +0 -1
- package/dist/runtime/server/ui-dist/assets/erDiagram-Q2GNP2WA-_1lFdkqV.js +0 -60
- package/dist/runtime/server/ui-dist/assets/erlang-BNw1qcRV.js +0 -1
- package/dist/runtime/server/ui-dist/assets/factor-kuTfRLto.js +0 -1
- package/dist/runtime/server/ui-dist/assets/fcl-Kvtd6kyn.js +0 -1
- package/dist/runtime/server/ui-dist/assets/flowDiagram-NV44I4VS-DUoF0DLT.js +0 -162
- package/dist/runtime/server/ui-dist/assets/forth-Ffai-XNe.js +0 -1
- package/dist/runtime/server/ui-dist/assets/fortran-DYz_wnZ1.js +0 -1
- package/dist/runtime/server/ui-dist/assets/ganttDiagram-JELNMOA3-CruQ7D3m.js +0 -267
- package/dist/runtime/server/ui-dist/assets/gas-Bneqetm1.js +0 -1
- package/dist/runtime/server/ui-dist/assets/gherkin-heZmZLOM.js +0 -1
- package/dist/runtime/server/ui-dist/assets/gitGraphDiagram-V2S2FVAM-BDuS9ljz.js +0 -65
- package/dist/runtime/server/ui-dist/assets/graph-BFy59M3M.js +0 -1
- package/dist/runtime/server/ui-dist/assets/groovy-D9Dt4D0W.js +0 -1
- package/dist/runtime/server/ui-dist/assets/gtm-root-bgiNL285.js +0 -11
- package/dist/runtime/server/ui-dist/assets/haskell-Cw1EW3IL.js +0 -1
- package/dist/runtime/server/ui-dist/assets/haxe-H-WmDvRZ.js +0 -1
- package/dist/runtime/server/ui-dist/assets/http-DBlCnlav.js +0 -1
- package/dist/runtime/server/ui-dist/assets/idl-BEugSyMb.js +0 -1
- package/dist/runtime/server/ui-dist/assets/index--dv-yDMD.js +0 -1
- package/dist/runtime/server/ui-dist/assets/index-A_Utfb1G.js +0 -1
- package/dist/runtime/server/ui-dist/assets/index-AaLnuKvn.js +0 -1
- package/dist/runtime/server/ui-dist/assets/index-B9Xd_vMV.js +0 -3
- package/dist/runtime/server/ui-dist/assets/index-BCphYMJ8.js +0 -1
- package/dist/runtime/server/ui-dist/assets/index-BKO_Nk8c.js +0 -7
- package/dist/runtime/server/ui-dist/assets/index-BMwN19Gi.js +0 -2
- package/dist/runtime/server/ui-dist/assets/index-Bz0rSFov.js +0 -1
- package/dist/runtime/server/ui-dist/assets/index-BzNjBEzf.js +0 -1
- package/dist/runtime/server/ui-dist/assets/index-CLWYCHoS.js +0 -1
- package/dist/runtime/server/ui-dist/assets/index-CZVyxyFA.js +0 -1
- package/dist/runtime/server/ui-dist/assets/index-ClbnJMz6.css +0 -1
- package/dist/runtime/server/ui-dist/assets/index-Cpqm25YS.js +0 -1
- package/dist/runtime/server/ui-dist/assets/index-Cv5ClxEP.js +0 -1
- package/dist/runtime/server/ui-dist/assets/index-D2MHxpCH.js +0 -50
- package/dist/runtime/server/ui-dist/assets/index-D3MPbMGr.js +0 -1
- package/dist/runtime/server/ui-dist/assets/index-DFUgoz9_.js +0 -1
- package/dist/runtime/server/ui-dist/assets/index-DL95rih-.js +0 -1
- package/dist/runtime/server/ui-dist/assets/index-DY60bSWi.js +0 -1
- package/dist/runtime/server/ui-dist/assets/index-DcoQC6ia.js +0 -13
- package/dist/runtime/server/ui-dist/assets/index-DfnTp5y6.js +0 -6
- package/dist/runtime/server/ui-dist/assets/index-Fb7iEaRG.js +0 -1
- package/dist/runtime/server/ui-dist/assets/index-TPJ_0VD8.js +0 -1
- package/dist/runtime/server/ui-dist/assets/index-WuexBBBr.js +0 -1
- package/dist/runtime/server/ui-dist/assets/infoDiagram-HS3SLOUP-CiI6r25R.js +0 -2
- package/dist/runtime/server/ui-dist/assets/init-Gi6I4Gst.js +0 -1
- package/dist/runtime/server/ui-dist/assets/javascript-iXu5QeM3.js +0 -1
- package/dist/runtime/server/ui-dist/assets/journeyDiagram-XKPGCS4Q-BMmOHrov.js +0 -139
- package/dist/runtime/server/ui-dist/assets/julia-DuME0IfC.js +0 -1
- package/dist/runtime/server/ui-dist/assets/kanban-definition-3W4ZIXB7-BxeYeVi1.js +0 -89
- package/dist/runtime/server/ui-dist/assets/katex-O9d3_IXG.js +0 -261
- package/dist/runtime/server/ui-dist/assets/layout-anG6DZ8y.js +0 -1
- package/dist/runtime/server/ui-dist/assets/linear-CDTAlHE-.js +0 -1
- package/dist/runtime/server/ui-dist/assets/livescript-BwQOo05w.js +0 -1
- package/dist/runtime/server/ui-dist/assets/lua-BgMRiT3U.js +0 -1
- package/dist/runtime/server/ui-dist/assets/mathematica-DTrFuWx2.js +0 -1
- package/dist/runtime/server/ui-dist/assets/mbox-CNhZ1qSd.js +0 -1
- package/dist/runtime/server/ui-dist/assets/mermaid.core-DNt7uRm5.js +0 -256
- package/dist/runtime/server/ui-dist/assets/mindmap-definition-VGOIOE7T-DTO5b9so.js +0 -68
- package/dist/runtime/server/ui-dist/assets/mirc-CjQqDB4T.js +0 -1
- package/dist/runtime/server/ui-dist/assets/mllike-CXdrOF99.js +0 -1
- package/dist/runtime/server/ui-dist/assets/modelica-Dc1JOy9r.js +0 -1
- package/dist/runtime/server/ui-dist/assets/mscgen-BA5vi2Kp.js +0 -1
- package/dist/runtime/server/ui-dist/assets/mumps-BT43cFF4.js +0 -1
- package/dist/runtime/server/ui-dist/assets/nginx-DdIZxoE0.js +0 -1
- package/dist/runtime/server/ui-dist/assets/nsis-LdVXkNf5.js +0 -1
- package/dist/runtime/server/ui-dist/assets/ntriples-BfvgReVJ.js +0 -1
- package/dist/runtime/server/ui-dist/assets/octave-Ck1zUtKM.js +0 -1
- package/dist/runtime/server/ui-dist/assets/ordinal-Cboi1Yqb.js +0 -1
- package/dist/runtime/server/ui-dist/assets/oz-BzwKVEFT.js +0 -1
- package/dist/runtime/server/ui-dist/assets/pascal--L3eBynH.js +0 -1
- package/dist/runtime/server/ui-dist/assets/perl-CdXCOZ3F.js +0 -1
- package/dist/runtime/server/ui-dist/assets/pieDiagram-ADFJNKIX-BteTAzPn.js +0 -30
- package/dist/runtime/server/ui-dist/assets/pig-CevX1Tat.js +0 -1
- package/dist/runtime/server/ui-dist/assets/powershell-CFHJl5sT.js +0 -1
- package/dist/runtime/server/ui-dist/assets/properties-C78fOPTZ.js +0 -1
- package/dist/runtime/server/ui-dist/assets/protobuf-ChK-085T.js +0 -1
- package/dist/runtime/server/ui-dist/assets/pug-DeIclll2.js +0 -1
- package/dist/runtime/server/ui-dist/assets/puppet-DMA9R1ak.js +0 -1
- package/dist/runtime/server/ui-dist/assets/python-BuPzkPfP.js +0 -1
- package/dist/runtime/server/ui-dist/assets/q-pXgVlZs6.js +0 -1
- package/dist/runtime/server/ui-dist/assets/quadrantDiagram-AYHSOK5B-_gG2aKm4.js +0 -7
- package/dist/runtime/server/ui-dist/assets/r-B6wPVr8A.js +0 -1
- package/dist/runtime/server/ui-dist/assets/requirementDiagram-UZGBJVZJ-CcOvI4e8.js +0 -64
- package/dist/runtime/server/ui-dist/assets/rpm-CTu-6PCP.js +0 -1
- package/dist/runtime/server/ui-dist/assets/ruby-B2Rjki9n.js +0 -1
- package/dist/runtime/server/ui-dist/assets/sankeyDiagram-TZEHDZUN-C1Rbdzvp.js +0 -10
- package/dist/runtime/server/ui-dist/assets/sas-B4kiWyti.js +0 -1
- package/dist/runtime/server/ui-dist/assets/scheme-C41bIUwD.js +0 -1
- package/dist/runtime/server/ui-dist/assets/sequenceDiagram-WL72ISMW-DPx4fWtG.js +0 -145
- package/dist/runtime/server/ui-dist/assets/shell-CjFT_Tl9.js +0 -1
- package/dist/runtime/server/ui-dist/assets/sieve-C3Gn_uJK.js +0 -1
- package/dist/runtime/server/ui-dist/assets/simple-mode-GW_nhZxv.js +0 -1
- package/dist/runtime/server/ui-dist/assets/smalltalk-CnHTOXQT.js +0 -1
- package/dist/runtime/server/ui-dist/assets/solr-DehyRSwq.js +0 -1
- package/dist/runtime/server/ui-dist/assets/sparql-DkYu6x3z.js +0 -1
- package/dist/runtime/server/ui-dist/assets/spreadsheet-BCZA_wO0.js +0 -1
- package/dist/runtime/server/ui-dist/assets/sql-D0XecflT.js +0 -1
- package/dist/runtime/server/ui-dist/assets/stateDiagram-FKZM4ZOC-CID-77J9.js +0 -1
- package/dist/runtime/server/ui-dist/assets/stateDiagram-v2-4FDKWEC3-DF70krIP.js +0 -1
- package/dist/runtime/server/ui-dist/assets/stex-C3f8Ysf7.js +0 -1
- package/dist/runtime/server/ui-dist/assets/stylus-B533Al4x.js +0 -1
- package/dist/runtime/server/ui-dist/assets/swift-BzpIVaGY.js +0 -1
- package/dist/runtime/server/ui-dist/assets/tcl-DVfN8rqt.js +0 -1
- package/dist/runtime/server/ui-dist/assets/textile-CnDTJFAw.js +0 -1
- package/dist/runtime/server/ui-dist/assets/tiddlywiki-DO-Gjzrf.js +0 -1
- package/dist/runtime/server/ui-dist/assets/tiki-DGYXhP31.js +0 -1
- package/dist/runtime/server/ui-dist/assets/timeline-definition-IT6M3QCI-CyA1h3jY.js +0 -61
- package/dist/runtime/server/ui-dist/assets/toml-Bm5Em-hy.js +0 -1
- package/dist/runtime/server/ui-dist/assets/treemap-GDKQZRPO-nqrXf2kh.js +0 -162
- package/dist/runtime/server/ui-dist/assets/troff-wAsdV37c.js +0 -1
- package/dist/runtime/server/ui-dist/assets/ttcn-CfJYG6tj.js +0 -1
- package/dist/runtime/server/ui-dist/assets/ttcn-cfg-B9xdYoR4.js +0 -1
- package/dist/runtime/server/ui-dist/assets/turtle-B1tBg_DP.js +0 -1
- package/dist/runtime/server/ui-dist/assets/vb-CmGdzxic.js +0 -1
- package/dist/runtime/server/ui-dist/assets/vbscript-BuJXcnF6.js +0 -1
- package/dist/runtime/server/ui-dist/assets/velocity-D8B20fx6.js +0 -1
- package/dist/runtime/server/ui-dist/assets/verilog-C6RDOZhf.js +0 -1
- package/dist/runtime/server/ui-dist/assets/vhdl-lSbBsy5d.js +0 -1
- package/dist/runtime/server/ui-dist/assets/webidl-ZXfAyPTL.js +0 -1
- package/dist/runtime/server/ui-dist/assets/xquery-DzFWVndE.js +0 -1
- package/dist/runtime/server/ui-dist/assets/xychartDiagram-PRI3JC2R-CS0bUj41.js +0 -7
- package/dist/runtime/server/ui-dist/assets/yacas-BJ4BC0dw.js +0 -1
- package/dist/runtime/server/ui-dist/assets/z80-Hz9HOZM7.js +0 -1
- package/dist/runtime/server/ui-dist/brands/opencode-logo-dark-square.svg +0 -18
- package/dist/runtime/server/ui-dist/brands/opencode-logo-light-square.svg +0 -18
- package/dist/runtime/server/ui-dist/favicon-16x16.png +0 -0
- package/dist/runtime/server/ui-dist/favicon-32x32.png +0 -0
- package/dist/runtime/server/ui-dist/favicon.ico +0 -0
- package/dist/runtime/server/ui-dist/favicon.svg +0 -9
- package/dist/runtime/server/ui-dist/index.html +0 -48
- package/dist/runtime/server/ui-dist/site.webmanifest +0 -30
- package/dist/runtime/server/ui-dist/sw.js +0 -42
- package/dist/runtime/server/ui-dist/worktree-favicon-16x16.png +0 -0
- package/dist/runtime/server/ui-dist/worktree-favicon-32x32.png +0 -0
- package/dist/runtime/server/ui-dist/worktree-favicon.ico +0 -0
- package/dist/runtime/server/ui-dist/worktree-favicon.svg +0 -9
|
@@ -1,3046 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs/promises";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { execFile as execFileCallback } from "node:child_process";
|
|
4
|
-
import { promisify } from "node:util";
|
|
5
|
-
import { and, asc, desc, eq, gt, inArray, sql } from "drizzle-orm";
|
|
6
|
-
import { agents, agentRuntimeState, agentTaskSessions, agentWakeupRequests, heartbeatRunEvents, heartbeatRuns, issues, projects, projectWorkspaces, } from "@paperclipai/db";
|
|
7
|
-
import { conflict, notFound } from "../errors.js";
|
|
8
|
-
import { logger } from "../middleware/logger.js";
|
|
9
|
-
import { publishLiveEvent } from "./live-events.js";
|
|
10
|
-
import { getRunLogStore } from "./run-log-store.js";
|
|
11
|
-
import { getServerAdapter, runningProcesses } from "../adapters/index.js";
|
|
12
|
-
import { createLocalAgentJwt } from "../agent-auth-jwt.js";
|
|
13
|
-
import { parseObject, asBoolean, asNumber, appendWithCap, MAX_EXCERPT_BYTES } from "../adapters/utils.js";
|
|
14
|
-
import { costService } from "./costs.js";
|
|
15
|
-
import { budgetService } from "./budgets.js";
|
|
16
|
-
import { secretService } from "./secrets.js";
|
|
17
|
-
import { resolveDefaultAgentWorkspaceDir, resolveManagedProjectWorkspaceDir } from "../home-paths.js";
|
|
18
|
-
import { summarizeHeartbeatRunResultJson } from "./heartbeat-run-summary.js";
|
|
19
|
-
import { buildWorkspaceReadyComment, cleanupExecutionWorkspaceArtifacts, ensureRuntimeServicesForRun, persistAdapterManagedRuntimeServices, realizeExecutionWorkspace, releaseRuntimeServicesForRun, sanitizeRuntimeServiceBaseEnv, } from "./workspace-runtime.js";
|
|
20
|
-
import { issueService } from "./issues.js";
|
|
21
|
-
import { executionWorkspaceService } from "./execution-workspaces.js";
|
|
22
|
-
import { workspaceOperationService } from "./workspace-operations.js";
|
|
23
|
-
import { buildExecutionWorkspaceAdapterConfig, gateProjectExecutionWorkspacePolicy, parseIssueExecutionWorkspaceSettings, parseProjectExecutionWorkspacePolicy, resolveExecutionWorkspaceMode, } from "./execution-workspace-policy.js";
|
|
24
|
-
import { instanceSettingsService } from "./instance-settings.js";
|
|
25
|
-
import { redactCurrentUserText, redactCurrentUserValue } from "../log-redaction.js";
|
|
26
|
-
import { hasSessionCompactionThresholds, resolveSessionCompactionPolicy, } from "@paperclipai/adapter-utils";
|
|
27
|
-
const MAX_LIVE_LOG_CHUNK_BYTES = 8 * 1024;
|
|
28
|
-
const HEARTBEAT_MAX_CONCURRENT_RUNS_DEFAULT = 1;
|
|
29
|
-
const HEARTBEAT_MAX_CONCURRENT_RUNS_MAX = 10;
|
|
30
|
-
const DEFERRED_WAKE_CONTEXT_KEY = "_paperclipWakeContext";
|
|
31
|
-
const DETACHED_PROCESS_ERROR_CODE = "process_detached";
|
|
32
|
-
const startLocksByAgent = new Map();
|
|
33
|
-
const REPO_ONLY_CWD_SENTINEL = "/__paperclip_repo_only__";
|
|
34
|
-
const MANAGED_WORKSPACE_GIT_CLONE_TIMEOUT_MS = 10 * 60 * 1000;
|
|
35
|
-
const execFile = promisify(execFileCallback);
|
|
36
|
-
const SESSIONED_LOCAL_ADAPTERS = new Set([
|
|
37
|
-
"claude_local",
|
|
38
|
-
"codex_local",
|
|
39
|
-
"cursor",
|
|
40
|
-
"gemini_local",
|
|
41
|
-
"opencode_local",
|
|
42
|
-
"pi_local",
|
|
43
|
-
]);
|
|
44
|
-
function deriveRepoNameFromRepoUrl(repoUrl) {
|
|
45
|
-
const trimmed = repoUrl?.trim() ?? "";
|
|
46
|
-
if (!trimmed)
|
|
47
|
-
return null;
|
|
48
|
-
try {
|
|
49
|
-
const parsed = new URL(trimmed);
|
|
50
|
-
const cleanedPath = parsed.pathname.replace(/\/+$/, "");
|
|
51
|
-
const repoName = cleanedPath.split("/").filter(Boolean).pop()?.replace(/\.git$/i, "") ?? "";
|
|
52
|
-
return repoName || null;
|
|
53
|
-
}
|
|
54
|
-
catch {
|
|
55
|
-
return null;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
async function ensureManagedProjectWorkspace(input) {
|
|
59
|
-
const cwd = resolveManagedProjectWorkspaceDir({
|
|
60
|
-
companyId: input.companyId,
|
|
61
|
-
projectId: input.projectId,
|
|
62
|
-
repoName: deriveRepoNameFromRepoUrl(input.repoUrl),
|
|
63
|
-
});
|
|
64
|
-
await fs.mkdir(path.dirname(cwd), { recursive: true });
|
|
65
|
-
const stats = await fs.stat(cwd).catch(() => null);
|
|
66
|
-
if (!input.repoUrl) {
|
|
67
|
-
if (!stats) {
|
|
68
|
-
await fs.mkdir(cwd, { recursive: true });
|
|
69
|
-
}
|
|
70
|
-
return { cwd, warning: null };
|
|
71
|
-
}
|
|
72
|
-
const gitDirExists = await fs
|
|
73
|
-
.stat(path.resolve(cwd, ".git"))
|
|
74
|
-
.then((entry) => entry.isDirectory())
|
|
75
|
-
.catch(() => false);
|
|
76
|
-
if (gitDirExists) {
|
|
77
|
-
return { cwd, warning: null };
|
|
78
|
-
}
|
|
79
|
-
if (stats) {
|
|
80
|
-
const entries = await fs.readdir(cwd).catch(() => []);
|
|
81
|
-
if (entries.length > 0) {
|
|
82
|
-
return {
|
|
83
|
-
cwd,
|
|
84
|
-
warning: `Managed workspace path "${cwd}" already exists but is not a git checkout. Using it as-is.`,
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
await fs.rm(cwd, { recursive: true, force: true });
|
|
88
|
-
}
|
|
89
|
-
try {
|
|
90
|
-
await execFile("git", ["clone", input.repoUrl, cwd], {
|
|
91
|
-
env: sanitizeRuntimeServiceBaseEnv(process.env),
|
|
92
|
-
timeout: MANAGED_WORKSPACE_GIT_CLONE_TIMEOUT_MS,
|
|
93
|
-
});
|
|
94
|
-
return { cwd, warning: null };
|
|
95
|
-
}
|
|
96
|
-
catch (error) {
|
|
97
|
-
const reason = error instanceof Error ? error.message : String(error);
|
|
98
|
-
throw new Error(`Failed to prepare managed checkout for "${input.repoUrl}" at "${cwd}": ${reason}`);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
const heartbeatRunListColumns = {
|
|
102
|
-
id: heartbeatRuns.id,
|
|
103
|
-
companyId: heartbeatRuns.companyId,
|
|
104
|
-
agentId: heartbeatRuns.agentId,
|
|
105
|
-
invocationSource: heartbeatRuns.invocationSource,
|
|
106
|
-
triggerDetail: heartbeatRuns.triggerDetail,
|
|
107
|
-
status: heartbeatRuns.status,
|
|
108
|
-
startedAt: heartbeatRuns.startedAt,
|
|
109
|
-
finishedAt: heartbeatRuns.finishedAt,
|
|
110
|
-
error: heartbeatRuns.error,
|
|
111
|
-
wakeupRequestId: heartbeatRuns.wakeupRequestId,
|
|
112
|
-
exitCode: heartbeatRuns.exitCode,
|
|
113
|
-
signal: heartbeatRuns.signal,
|
|
114
|
-
usageJson: heartbeatRuns.usageJson,
|
|
115
|
-
resultJson: heartbeatRuns.resultJson,
|
|
116
|
-
sessionIdBefore: heartbeatRuns.sessionIdBefore,
|
|
117
|
-
sessionIdAfter: heartbeatRuns.sessionIdAfter,
|
|
118
|
-
logStore: heartbeatRuns.logStore,
|
|
119
|
-
logRef: heartbeatRuns.logRef,
|
|
120
|
-
logBytes: heartbeatRuns.logBytes,
|
|
121
|
-
logSha256: heartbeatRuns.logSha256,
|
|
122
|
-
logCompressed: heartbeatRuns.logCompressed,
|
|
123
|
-
stdoutExcerpt: sql `NULL`.as("stdoutExcerpt"),
|
|
124
|
-
stderrExcerpt: sql `NULL`.as("stderrExcerpt"),
|
|
125
|
-
errorCode: heartbeatRuns.errorCode,
|
|
126
|
-
externalRunId: heartbeatRuns.externalRunId,
|
|
127
|
-
processPid: heartbeatRuns.processPid,
|
|
128
|
-
processStartedAt: heartbeatRuns.processStartedAt,
|
|
129
|
-
retryOfRunId: heartbeatRuns.retryOfRunId,
|
|
130
|
-
processLossRetryCount: heartbeatRuns.processLossRetryCount,
|
|
131
|
-
contextSnapshot: heartbeatRuns.contextSnapshot,
|
|
132
|
-
createdAt: heartbeatRuns.createdAt,
|
|
133
|
-
updatedAt: heartbeatRuns.updatedAt,
|
|
134
|
-
};
|
|
135
|
-
function appendExcerpt(prev, chunk) {
|
|
136
|
-
return appendWithCap(prev, chunk, MAX_EXCERPT_BYTES);
|
|
137
|
-
}
|
|
138
|
-
function normalizeMaxConcurrentRuns(value) {
|
|
139
|
-
const parsed = Math.floor(asNumber(value, HEARTBEAT_MAX_CONCURRENT_RUNS_DEFAULT));
|
|
140
|
-
if (!Number.isFinite(parsed))
|
|
141
|
-
return HEARTBEAT_MAX_CONCURRENT_RUNS_DEFAULT;
|
|
142
|
-
return Math.max(HEARTBEAT_MAX_CONCURRENT_RUNS_DEFAULT, Math.min(HEARTBEAT_MAX_CONCURRENT_RUNS_MAX, parsed));
|
|
143
|
-
}
|
|
144
|
-
async function withAgentStartLock(agentId, fn) {
|
|
145
|
-
const previous = startLocksByAgent.get(agentId) ?? Promise.resolve();
|
|
146
|
-
const run = previous.then(fn);
|
|
147
|
-
const marker = run.then(() => undefined, () => undefined);
|
|
148
|
-
startLocksByAgent.set(agentId, marker);
|
|
149
|
-
try {
|
|
150
|
-
return await run;
|
|
151
|
-
}
|
|
152
|
-
finally {
|
|
153
|
-
if (startLocksByAgent.get(agentId) === marker) {
|
|
154
|
-
startLocksByAgent.delete(agentId);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
export function prioritizeProjectWorkspaceCandidatesForRun(rows, preferredWorkspaceId) {
|
|
159
|
-
if (!preferredWorkspaceId)
|
|
160
|
-
return rows;
|
|
161
|
-
const preferredIndex = rows.findIndex((row) => row.id === preferredWorkspaceId);
|
|
162
|
-
if (preferredIndex <= 0)
|
|
163
|
-
return rows;
|
|
164
|
-
return [rows[preferredIndex], ...rows.slice(0, preferredIndex), ...rows.slice(preferredIndex + 1)];
|
|
165
|
-
}
|
|
166
|
-
function readNonEmptyString(value) {
|
|
167
|
-
return typeof value === "string" && value.trim().length > 0 ? value : null;
|
|
168
|
-
}
|
|
169
|
-
function normalizeLedgerBillingType(value) {
|
|
170
|
-
const raw = readNonEmptyString(value);
|
|
171
|
-
switch (raw) {
|
|
172
|
-
case "api":
|
|
173
|
-
case "metered_api":
|
|
174
|
-
return "metered_api";
|
|
175
|
-
case "subscription":
|
|
176
|
-
case "subscription_included":
|
|
177
|
-
return "subscription_included";
|
|
178
|
-
case "subscription_overage":
|
|
179
|
-
return "subscription_overage";
|
|
180
|
-
case "credits":
|
|
181
|
-
return "credits";
|
|
182
|
-
case "fixed":
|
|
183
|
-
return "fixed";
|
|
184
|
-
default:
|
|
185
|
-
return "unknown";
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
function resolveLedgerBiller(result) {
|
|
189
|
-
return readNonEmptyString(result.biller) ?? readNonEmptyString(result.provider) ?? "unknown";
|
|
190
|
-
}
|
|
191
|
-
function normalizeBilledCostCents(costUsd, billingType) {
|
|
192
|
-
if (billingType === "subscription_included")
|
|
193
|
-
return 0;
|
|
194
|
-
if (typeof costUsd !== "number" || !Number.isFinite(costUsd))
|
|
195
|
-
return 0;
|
|
196
|
-
return Math.max(0, Math.round(costUsd * 100));
|
|
197
|
-
}
|
|
198
|
-
async function resolveLedgerScopeForRun(db, companyId, run) {
|
|
199
|
-
const context = parseObject(run.contextSnapshot);
|
|
200
|
-
const contextIssueId = readNonEmptyString(context.issueId);
|
|
201
|
-
const contextProjectId = readNonEmptyString(context.projectId);
|
|
202
|
-
if (!contextIssueId) {
|
|
203
|
-
return {
|
|
204
|
-
issueId: null,
|
|
205
|
-
projectId: contextProjectId,
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
const issue = await db
|
|
209
|
-
.select({
|
|
210
|
-
id: issues.id,
|
|
211
|
-
projectId: issues.projectId,
|
|
212
|
-
})
|
|
213
|
-
.from(issues)
|
|
214
|
-
.where(and(eq(issues.id, contextIssueId), eq(issues.companyId, companyId)))
|
|
215
|
-
.then((rows) => rows[0] ?? null);
|
|
216
|
-
return {
|
|
217
|
-
issueId: issue?.id ?? null,
|
|
218
|
-
projectId: issue?.projectId ?? contextProjectId,
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
function normalizeUsageTotals(usage) {
|
|
222
|
-
if (!usage)
|
|
223
|
-
return null;
|
|
224
|
-
return {
|
|
225
|
-
inputTokens: Math.max(0, Math.floor(asNumber(usage.inputTokens, 0))),
|
|
226
|
-
cachedInputTokens: Math.max(0, Math.floor(asNumber(usage.cachedInputTokens, 0))),
|
|
227
|
-
outputTokens: Math.max(0, Math.floor(asNumber(usage.outputTokens, 0))),
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
function readRawUsageTotals(usageJson) {
|
|
231
|
-
const parsed = parseObject(usageJson);
|
|
232
|
-
if (Object.keys(parsed).length === 0)
|
|
233
|
-
return null;
|
|
234
|
-
const inputTokens = Math.max(0, Math.floor(asNumber(parsed.rawInputTokens, asNumber(parsed.inputTokens, 0))));
|
|
235
|
-
const cachedInputTokens = Math.max(0, Math.floor(asNumber(parsed.rawCachedInputTokens, asNumber(parsed.cachedInputTokens, 0))));
|
|
236
|
-
const outputTokens = Math.max(0, Math.floor(asNumber(parsed.rawOutputTokens, asNumber(parsed.outputTokens, 0))));
|
|
237
|
-
if (inputTokens <= 0 && cachedInputTokens <= 0 && outputTokens <= 0) {
|
|
238
|
-
return null;
|
|
239
|
-
}
|
|
240
|
-
return {
|
|
241
|
-
inputTokens,
|
|
242
|
-
cachedInputTokens,
|
|
243
|
-
outputTokens,
|
|
244
|
-
};
|
|
245
|
-
}
|
|
246
|
-
function deriveNormalizedUsageDelta(current, previous) {
|
|
247
|
-
if (!current)
|
|
248
|
-
return null;
|
|
249
|
-
if (!previous)
|
|
250
|
-
return { ...current };
|
|
251
|
-
const inputTokens = current.inputTokens >= previous.inputTokens
|
|
252
|
-
? current.inputTokens - previous.inputTokens
|
|
253
|
-
: current.inputTokens;
|
|
254
|
-
const cachedInputTokens = current.cachedInputTokens >= previous.cachedInputTokens
|
|
255
|
-
? current.cachedInputTokens - previous.cachedInputTokens
|
|
256
|
-
: current.cachedInputTokens;
|
|
257
|
-
const outputTokens = current.outputTokens >= previous.outputTokens
|
|
258
|
-
? current.outputTokens - previous.outputTokens
|
|
259
|
-
: current.outputTokens;
|
|
260
|
-
return {
|
|
261
|
-
inputTokens: Math.max(0, inputTokens),
|
|
262
|
-
cachedInputTokens: Math.max(0, cachedInputTokens),
|
|
263
|
-
outputTokens: Math.max(0, outputTokens),
|
|
264
|
-
};
|
|
265
|
-
}
|
|
266
|
-
function formatCount(value) {
|
|
267
|
-
if (typeof value !== "number" || !Number.isFinite(value))
|
|
268
|
-
return "0";
|
|
269
|
-
return value.toLocaleString("en-US");
|
|
270
|
-
}
|
|
271
|
-
export function parseSessionCompactionPolicy(agent) {
|
|
272
|
-
return resolveSessionCompactionPolicy(agent.adapterType, agent.runtimeConfig).policy;
|
|
273
|
-
}
|
|
274
|
-
export function resolveRuntimeSessionParamsForWorkspace(input) {
|
|
275
|
-
const { agentId, previousSessionParams, resolvedWorkspace } = input;
|
|
276
|
-
const previousSessionId = readNonEmptyString(previousSessionParams?.sessionId);
|
|
277
|
-
const previousCwd = readNonEmptyString(previousSessionParams?.cwd);
|
|
278
|
-
if (!previousSessionId || !previousCwd) {
|
|
279
|
-
return {
|
|
280
|
-
sessionParams: previousSessionParams,
|
|
281
|
-
warning: null,
|
|
282
|
-
};
|
|
283
|
-
}
|
|
284
|
-
if (resolvedWorkspace.source !== "project_primary") {
|
|
285
|
-
return {
|
|
286
|
-
sessionParams: previousSessionParams,
|
|
287
|
-
warning: null,
|
|
288
|
-
};
|
|
289
|
-
}
|
|
290
|
-
const projectCwd = readNonEmptyString(resolvedWorkspace.cwd);
|
|
291
|
-
if (!projectCwd) {
|
|
292
|
-
return {
|
|
293
|
-
sessionParams: previousSessionParams,
|
|
294
|
-
warning: null,
|
|
295
|
-
};
|
|
296
|
-
}
|
|
297
|
-
const fallbackAgentHomeCwd = resolveDefaultAgentWorkspaceDir(agentId);
|
|
298
|
-
if (path.resolve(previousCwd) !== path.resolve(fallbackAgentHomeCwd)) {
|
|
299
|
-
return {
|
|
300
|
-
sessionParams: previousSessionParams,
|
|
301
|
-
warning: null,
|
|
302
|
-
};
|
|
303
|
-
}
|
|
304
|
-
if (path.resolve(projectCwd) === path.resolve(previousCwd)) {
|
|
305
|
-
return {
|
|
306
|
-
sessionParams: previousSessionParams,
|
|
307
|
-
warning: null,
|
|
308
|
-
};
|
|
309
|
-
}
|
|
310
|
-
const previousWorkspaceId = readNonEmptyString(previousSessionParams?.workspaceId);
|
|
311
|
-
if (previousWorkspaceId &&
|
|
312
|
-
resolvedWorkspace.workspaceId &&
|
|
313
|
-
previousWorkspaceId !== resolvedWorkspace.workspaceId) {
|
|
314
|
-
return {
|
|
315
|
-
sessionParams: previousSessionParams,
|
|
316
|
-
warning: null,
|
|
317
|
-
};
|
|
318
|
-
}
|
|
319
|
-
const migratedSessionParams = {
|
|
320
|
-
...(previousSessionParams ?? {}),
|
|
321
|
-
cwd: projectCwd,
|
|
322
|
-
};
|
|
323
|
-
if (resolvedWorkspace.workspaceId)
|
|
324
|
-
migratedSessionParams.workspaceId = resolvedWorkspace.workspaceId;
|
|
325
|
-
if (resolvedWorkspace.repoUrl)
|
|
326
|
-
migratedSessionParams.repoUrl = resolvedWorkspace.repoUrl;
|
|
327
|
-
if (resolvedWorkspace.repoRef)
|
|
328
|
-
migratedSessionParams.repoRef = resolvedWorkspace.repoRef;
|
|
329
|
-
return {
|
|
330
|
-
sessionParams: migratedSessionParams,
|
|
331
|
-
warning: `Project workspace "${projectCwd}" is now available. ` +
|
|
332
|
-
`Attempting to resume session "${previousSessionId}" that was previously saved in fallback workspace "${previousCwd}".`,
|
|
333
|
-
};
|
|
334
|
-
}
|
|
335
|
-
function parseIssueAssigneeAdapterOverrides(raw) {
|
|
336
|
-
const parsed = parseObject(raw);
|
|
337
|
-
const parsedAdapterConfig = parseObject(parsed.adapterConfig);
|
|
338
|
-
const adapterConfig = Object.keys(parsedAdapterConfig).length > 0 ? parsedAdapterConfig : null;
|
|
339
|
-
const useProjectWorkspace = typeof parsed.useProjectWorkspace === "boolean"
|
|
340
|
-
? parsed.useProjectWorkspace
|
|
341
|
-
: null;
|
|
342
|
-
if (!adapterConfig && useProjectWorkspace === null)
|
|
343
|
-
return null;
|
|
344
|
-
return {
|
|
345
|
-
adapterConfig,
|
|
346
|
-
useProjectWorkspace,
|
|
347
|
-
};
|
|
348
|
-
}
|
|
349
|
-
function deriveTaskKey(contextSnapshot, payload) {
|
|
350
|
-
return (readNonEmptyString(contextSnapshot?.taskKey) ??
|
|
351
|
-
readNonEmptyString(contextSnapshot?.taskId) ??
|
|
352
|
-
readNonEmptyString(contextSnapshot?.issueId) ??
|
|
353
|
-
readNonEmptyString(payload?.taskKey) ??
|
|
354
|
-
readNonEmptyString(payload?.taskId) ??
|
|
355
|
-
readNonEmptyString(payload?.issueId) ??
|
|
356
|
-
null);
|
|
357
|
-
}
|
|
358
|
-
export function shouldResetTaskSessionForWake(contextSnapshot) {
|
|
359
|
-
if (contextSnapshot?.forceFreshSession === true)
|
|
360
|
-
return true;
|
|
361
|
-
const wakeReason = readNonEmptyString(contextSnapshot?.wakeReason);
|
|
362
|
-
if (wakeReason === "issue_assigned")
|
|
363
|
-
return true;
|
|
364
|
-
return false;
|
|
365
|
-
}
|
|
366
|
-
export function formatRuntimeWorkspaceWarningLog(warning) {
|
|
367
|
-
return {
|
|
368
|
-
stream: "stdout",
|
|
369
|
-
chunk: `[paperclip] ${warning}\n`,
|
|
370
|
-
};
|
|
371
|
-
}
|
|
372
|
-
function describeSessionResetReason(contextSnapshot) {
|
|
373
|
-
if (contextSnapshot?.forceFreshSession === true)
|
|
374
|
-
return "forceFreshSession was requested";
|
|
375
|
-
const wakeReason = readNonEmptyString(contextSnapshot?.wakeReason);
|
|
376
|
-
if (wakeReason === "issue_assigned")
|
|
377
|
-
return "wake reason is issue_assigned";
|
|
378
|
-
return null;
|
|
379
|
-
}
|
|
380
|
-
function deriveCommentId(contextSnapshot, payload) {
|
|
381
|
-
return (readNonEmptyString(contextSnapshot?.wakeCommentId) ??
|
|
382
|
-
readNonEmptyString(contextSnapshot?.commentId) ??
|
|
383
|
-
readNonEmptyString(payload?.commentId) ??
|
|
384
|
-
null);
|
|
385
|
-
}
|
|
386
|
-
function enrichWakeContextSnapshot(input) {
|
|
387
|
-
const { contextSnapshot, reason, source, triggerDetail, payload } = input;
|
|
388
|
-
const issueIdFromPayload = readNonEmptyString(payload?.["issueId"]);
|
|
389
|
-
const commentIdFromPayload = readNonEmptyString(payload?.["commentId"]);
|
|
390
|
-
const taskKey = deriveTaskKey(contextSnapshot, payload);
|
|
391
|
-
const wakeCommentId = deriveCommentId(contextSnapshot, payload);
|
|
392
|
-
if (!readNonEmptyString(contextSnapshot["wakeReason"]) && reason) {
|
|
393
|
-
contextSnapshot.wakeReason = reason;
|
|
394
|
-
}
|
|
395
|
-
if (!readNonEmptyString(contextSnapshot["issueId"]) && issueIdFromPayload) {
|
|
396
|
-
contextSnapshot.issueId = issueIdFromPayload;
|
|
397
|
-
}
|
|
398
|
-
if (!readNonEmptyString(contextSnapshot["taskId"]) && issueIdFromPayload) {
|
|
399
|
-
contextSnapshot.taskId = issueIdFromPayload;
|
|
400
|
-
}
|
|
401
|
-
if (!readNonEmptyString(contextSnapshot["taskKey"]) && taskKey) {
|
|
402
|
-
contextSnapshot.taskKey = taskKey;
|
|
403
|
-
}
|
|
404
|
-
if (!readNonEmptyString(contextSnapshot["commentId"]) && commentIdFromPayload) {
|
|
405
|
-
contextSnapshot.commentId = commentIdFromPayload;
|
|
406
|
-
}
|
|
407
|
-
if (!readNonEmptyString(contextSnapshot["wakeCommentId"]) && wakeCommentId) {
|
|
408
|
-
contextSnapshot.wakeCommentId = wakeCommentId;
|
|
409
|
-
}
|
|
410
|
-
if (!readNonEmptyString(contextSnapshot["wakeSource"]) && source) {
|
|
411
|
-
contextSnapshot.wakeSource = source;
|
|
412
|
-
}
|
|
413
|
-
if (!readNonEmptyString(contextSnapshot["wakeTriggerDetail"]) && triggerDetail) {
|
|
414
|
-
contextSnapshot.wakeTriggerDetail = triggerDetail;
|
|
415
|
-
}
|
|
416
|
-
return {
|
|
417
|
-
contextSnapshot,
|
|
418
|
-
issueIdFromPayload,
|
|
419
|
-
commentIdFromPayload,
|
|
420
|
-
taskKey,
|
|
421
|
-
wakeCommentId,
|
|
422
|
-
};
|
|
423
|
-
}
|
|
424
|
-
function mergeCoalescedContextSnapshot(existingRaw, incoming) {
|
|
425
|
-
const existing = parseObject(existingRaw);
|
|
426
|
-
const merged = {
|
|
427
|
-
...existing,
|
|
428
|
-
...incoming,
|
|
429
|
-
};
|
|
430
|
-
const commentId = deriveCommentId(incoming, null);
|
|
431
|
-
if (commentId) {
|
|
432
|
-
merged.commentId = commentId;
|
|
433
|
-
merged.wakeCommentId = commentId;
|
|
434
|
-
}
|
|
435
|
-
return merged;
|
|
436
|
-
}
|
|
437
|
-
function runTaskKey(run) {
|
|
438
|
-
return deriveTaskKey(run.contextSnapshot, null);
|
|
439
|
-
}
|
|
440
|
-
function isSameTaskScope(left, right) {
|
|
441
|
-
return (left ?? null) === (right ?? null);
|
|
442
|
-
}
|
|
443
|
-
function isTrackedLocalChildProcessAdapter(adapterType) {
|
|
444
|
-
return SESSIONED_LOCAL_ADAPTERS.has(adapterType);
|
|
445
|
-
}
|
|
446
|
-
// A positive liveness check means some process currently owns the PID.
|
|
447
|
-
// On Linux, PIDs can be recycled, so this is a best-effort signal rather
|
|
448
|
-
// than proof that the original child is still alive.
|
|
449
|
-
function isProcessAlive(pid) {
|
|
450
|
-
if (typeof pid !== "number" || !Number.isInteger(pid) || pid <= 0)
|
|
451
|
-
return false;
|
|
452
|
-
try {
|
|
453
|
-
process.kill(pid, 0);
|
|
454
|
-
return true;
|
|
455
|
-
}
|
|
456
|
-
catch (error) {
|
|
457
|
-
const code = error?.code;
|
|
458
|
-
if (code === "EPERM")
|
|
459
|
-
return true;
|
|
460
|
-
if (code === "ESRCH")
|
|
461
|
-
return false;
|
|
462
|
-
return false;
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
function truncateDisplayId(value, max = 128) {
|
|
466
|
-
if (!value)
|
|
467
|
-
return null;
|
|
468
|
-
return value.length > max ? value.slice(0, max) : value;
|
|
469
|
-
}
|
|
470
|
-
function normalizeAgentNameKey(value) {
|
|
471
|
-
if (typeof value !== "string")
|
|
472
|
-
return null;
|
|
473
|
-
const normalized = value.trim().toLowerCase();
|
|
474
|
-
return normalized.length > 0 ? normalized : null;
|
|
475
|
-
}
|
|
476
|
-
const defaultSessionCodec = {
|
|
477
|
-
deserialize(raw) {
|
|
478
|
-
const asObj = parseObject(raw);
|
|
479
|
-
if (Object.keys(asObj).length > 0)
|
|
480
|
-
return asObj;
|
|
481
|
-
const sessionId = readNonEmptyString(raw?.sessionId);
|
|
482
|
-
if (sessionId)
|
|
483
|
-
return { sessionId };
|
|
484
|
-
return null;
|
|
485
|
-
},
|
|
486
|
-
serialize(params) {
|
|
487
|
-
if (!params || Object.keys(params).length === 0)
|
|
488
|
-
return null;
|
|
489
|
-
return params;
|
|
490
|
-
},
|
|
491
|
-
getDisplayId(params) {
|
|
492
|
-
return readNonEmptyString(params?.sessionId);
|
|
493
|
-
},
|
|
494
|
-
};
|
|
495
|
-
function getAdapterSessionCodec(adapterType) {
|
|
496
|
-
const adapter = getServerAdapter(adapterType);
|
|
497
|
-
return adapter.sessionCodec ?? defaultSessionCodec;
|
|
498
|
-
}
|
|
499
|
-
function normalizeSessionParams(params) {
|
|
500
|
-
if (!params)
|
|
501
|
-
return null;
|
|
502
|
-
return Object.keys(params).length > 0 ? params : null;
|
|
503
|
-
}
|
|
504
|
-
function resolveNextSessionState(input) {
|
|
505
|
-
const { codec, adapterResult, previousParams, previousDisplayId, previousLegacySessionId } = input;
|
|
506
|
-
if (adapterResult.clearSession) {
|
|
507
|
-
return {
|
|
508
|
-
params: null,
|
|
509
|
-
displayId: null,
|
|
510
|
-
legacySessionId: null,
|
|
511
|
-
};
|
|
512
|
-
}
|
|
513
|
-
const explicitParams = adapterResult.sessionParams;
|
|
514
|
-
const hasExplicitParams = adapterResult.sessionParams !== undefined;
|
|
515
|
-
const hasExplicitSessionId = adapterResult.sessionId !== undefined;
|
|
516
|
-
const explicitSessionId = readNonEmptyString(adapterResult.sessionId);
|
|
517
|
-
const hasExplicitDisplay = adapterResult.sessionDisplayId !== undefined;
|
|
518
|
-
const explicitDisplayId = readNonEmptyString(adapterResult.sessionDisplayId);
|
|
519
|
-
const shouldUsePrevious = !hasExplicitParams && !hasExplicitSessionId && !hasExplicitDisplay;
|
|
520
|
-
const candidateParams = hasExplicitParams
|
|
521
|
-
? explicitParams
|
|
522
|
-
: hasExplicitSessionId
|
|
523
|
-
? (explicitSessionId ? { sessionId: explicitSessionId } : null)
|
|
524
|
-
: previousParams;
|
|
525
|
-
const serialized = normalizeSessionParams(codec.serialize(normalizeSessionParams(candidateParams) ?? null));
|
|
526
|
-
const deserialized = normalizeSessionParams(codec.deserialize(serialized));
|
|
527
|
-
const displayId = truncateDisplayId(explicitDisplayId ??
|
|
528
|
-
(codec.getDisplayId ? codec.getDisplayId(deserialized) : null) ??
|
|
529
|
-
readNonEmptyString(deserialized?.sessionId) ??
|
|
530
|
-
(shouldUsePrevious ? previousDisplayId : null) ??
|
|
531
|
-
explicitSessionId ??
|
|
532
|
-
(shouldUsePrevious ? previousLegacySessionId : null));
|
|
533
|
-
const legacySessionId = explicitSessionId ??
|
|
534
|
-
readNonEmptyString(deserialized?.sessionId) ??
|
|
535
|
-
displayId ??
|
|
536
|
-
(shouldUsePrevious ? previousLegacySessionId : null);
|
|
537
|
-
return {
|
|
538
|
-
params: serialized,
|
|
539
|
-
displayId,
|
|
540
|
-
legacySessionId,
|
|
541
|
-
};
|
|
542
|
-
}
|
|
543
|
-
export function heartbeatService(db) {
|
|
544
|
-
const instanceSettings = instanceSettingsService(db);
|
|
545
|
-
const runLogStore = getRunLogStore();
|
|
546
|
-
const secretsSvc = secretService(db);
|
|
547
|
-
const issuesSvc = issueService(db);
|
|
548
|
-
const executionWorkspacesSvc = executionWorkspaceService(db);
|
|
549
|
-
const workspaceOperationsSvc = workspaceOperationService(db);
|
|
550
|
-
const activeRunExecutions = new Set();
|
|
551
|
-
const budgetHooks = {
|
|
552
|
-
cancelWorkForScope: cancelBudgetScopeWork,
|
|
553
|
-
};
|
|
554
|
-
const budgets = budgetService(db, budgetHooks);
|
|
555
|
-
async function getAgent(agentId) {
|
|
556
|
-
return db
|
|
557
|
-
.select()
|
|
558
|
-
.from(agents)
|
|
559
|
-
.where(eq(agents.id, agentId))
|
|
560
|
-
.then((rows) => rows[0] ?? null);
|
|
561
|
-
}
|
|
562
|
-
async function getRun(runId) {
|
|
563
|
-
return db
|
|
564
|
-
.select()
|
|
565
|
-
.from(heartbeatRuns)
|
|
566
|
-
.where(eq(heartbeatRuns.id, runId))
|
|
567
|
-
.then((rows) => rows[0] ?? null);
|
|
568
|
-
}
|
|
569
|
-
async function getRuntimeState(agentId) {
|
|
570
|
-
return db
|
|
571
|
-
.select()
|
|
572
|
-
.from(agentRuntimeState)
|
|
573
|
-
.where(eq(agentRuntimeState.agentId, agentId))
|
|
574
|
-
.then((rows) => rows[0] ?? null);
|
|
575
|
-
}
|
|
576
|
-
async function getTaskSession(companyId, agentId, adapterType, taskKey) {
|
|
577
|
-
return db
|
|
578
|
-
.select()
|
|
579
|
-
.from(agentTaskSessions)
|
|
580
|
-
.where(and(eq(agentTaskSessions.companyId, companyId), eq(agentTaskSessions.agentId, agentId), eq(agentTaskSessions.adapterType, adapterType), eq(agentTaskSessions.taskKey, taskKey)))
|
|
581
|
-
.then((rows) => rows[0] ?? null);
|
|
582
|
-
}
|
|
583
|
-
async function getLatestRunForSession(agentId, sessionId, opts) {
|
|
584
|
-
const conditions = [
|
|
585
|
-
eq(heartbeatRuns.agentId, agentId),
|
|
586
|
-
eq(heartbeatRuns.sessionIdAfter, sessionId),
|
|
587
|
-
];
|
|
588
|
-
if (opts?.excludeRunId) {
|
|
589
|
-
conditions.push(sql `${heartbeatRuns.id} <> ${opts.excludeRunId}`);
|
|
590
|
-
}
|
|
591
|
-
return db
|
|
592
|
-
.select()
|
|
593
|
-
.from(heartbeatRuns)
|
|
594
|
-
.where(and(...conditions))
|
|
595
|
-
.orderBy(desc(heartbeatRuns.createdAt))
|
|
596
|
-
.limit(1)
|
|
597
|
-
.then((rows) => rows[0] ?? null);
|
|
598
|
-
}
|
|
599
|
-
async function getOldestRunForSession(agentId, sessionId) {
|
|
600
|
-
return db
|
|
601
|
-
.select({
|
|
602
|
-
id: heartbeatRuns.id,
|
|
603
|
-
createdAt: heartbeatRuns.createdAt,
|
|
604
|
-
})
|
|
605
|
-
.from(heartbeatRuns)
|
|
606
|
-
.where(and(eq(heartbeatRuns.agentId, agentId), eq(heartbeatRuns.sessionIdAfter, sessionId)))
|
|
607
|
-
.orderBy(asc(heartbeatRuns.createdAt), asc(heartbeatRuns.id))
|
|
608
|
-
.limit(1)
|
|
609
|
-
.then((rows) => rows[0] ?? null);
|
|
610
|
-
}
|
|
611
|
-
async function resolveNormalizedUsageForSession(input) {
|
|
612
|
-
const { agentId, runId, sessionId, rawUsage } = input;
|
|
613
|
-
if (!sessionId || !rawUsage) {
|
|
614
|
-
return {
|
|
615
|
-
normalizedUsage: rawUsage,
|
|
616
|
-
previousRawUsage: null,
|
|
617
|
-
derivedFromSessionTotals: false,
|
|
618
|
-
};
|
|
619
|
-
}
|
|
620
|
-
const previousRun = await getLatestRunForSession(agentId, sessionId, { excludeRunId: runId });
|
|
621
|
-
const previousRawUsage = readRawUsageTotals(previousRun?.usageJson);
|
|
622
|
-
return {
|
|
623
|
-
normalizedUsage: deriveNormalizedUsageDelta(rawUsage, previousRawUsage),
|
|
624
|
-
previousRawUsage,
|
|
625
|
-
derivedFromSessionTotals: previousRawUsage !== null,
|
|
626
|
-
};
|
|
627
|
-
}
|
|
628
|
-
async function evaluateSessionCompaction(input) {
|
|
629
|
-
const { agent, sessionId, issueId } = input;
|
|
630
|
-
if (!sessionId) {
|
|
631
|
-
return {
|
|
632
|
-
rotate: false,
|
|
633
|
-
reason: null,
|
|
634
|
-
handoffMarkdown: null,
|
|
635
|
-
previousRunId: null,
|
|
636
|
-
};
|
|
637
|
-
}
|
|
638
|
-
const policy = parseSessionCompactionPolicy(agent);
|
|
639
|
-
if (!policy.enabled || !hasSessionCompactionThresholds(policy)) {
|
|
640
|
-
return {
|
|
641
|
-
rotate: false,
|
|
642
|
-
reason: null,
|
|
643
|
-
handoffMarkdown: null,
|
|
644
|
-
previousRunId: null,
|
|
645
|
-
};
|
|
646
|
-
}
|
|
647
|
-
const fetchLimit = Math.max(policy.maxSessionRuns > 0 ? policy.maxSessionRuns + 1 : 0, 4);
|
|
648
|
-
const runs = await db
|
|
649
|
-
.select({
|
|
650
|
-
id: heartbeatRuns.id,
|
|
651
|
-
createdAt: heartbeatRuns.createdAt,
|
|
652
|
-
usageJson: heartbeatRuns.usageJson,
|
|
653
|
-
resultJson: heartbeatRuns.resultJson,
|
|
654
|
-
error: heartbeatRuns.error,
|
|
655
|
-
})
|
|
656
|
-
.from(heartbeatRuns)
|
|
657
|
-
.where(and(eq(heartbeatRuns.agentId, agent.id), eq(heartbeatRuns.sessionIdAfter, sessionId)))
|
|
658
|
-
.orderBy(desc(heartbeatRuns.createdAt))
|
|
659
|
-
.limit(fetchLimit);
|
|
660
|
-
if (runs.length === 0) {
|
|
661
|
-
return {
|
|
662
|
-
rotate: false,
|
|
663
|
-
reason: null,
|
|
664
|
-
handoffMarkdown: null,
|
|
665
|
-
previousRunId: null,
|
|
666
|
-
};
|
|
667
|
-
}
|
|
668
|
-
const latestRun = runs[0] ?? null;
|
|
669
|
-
const oldestRun = policy.maxSessionAgeHours > 0
|
|
670
|
-
? await getOldestRunForSession(agent.id, sessionId)
|
|
671
|
-
: runs[runs.length - 1] ?? latestRun;
|
|
672
|
-
const latestRawUsage = readRawUsageTotals(latestRun?.usageJson);
|
|
673
|
-
const sessionAgeHours = latestRun && oldestRun
|
|
674
|
-
? Math.max(0, (new Date(latestRun.createdAt).getTime() - new Date(oldestRun.createdAt).getTime()) / (1000 * 60 * 60))
|
|
675
|
-
: 0;
|
|
676
|
-
let reason = null;
|
|
677
|
-
if (policy.maxSessionRuns > 0 && runs.length > policy.maxSessionRuns) {
|
|
678
|
-
reason = `session exceeded ${policy.maxSessionRuns} runs`;
|
|
679
|
-
}
|
|
680
|
-
else if (policy.maxRawInputTokens > 0 &&
|
|
681
|
-
latestRawUsage &&
|
|
682
|
-
latestRawUsage.inputTokens >= policy.maxRawInputTokens) {
|
|
683
|
-
reason =
|
|
684
|
-
`session raw input reached ${formatCount(latestRawUsage.inputTokens)} tokens ` +
|
|
685
|
-
`(threshold ${formatCount(policy.maxRawInputTokens)})`;
|
|
686
|
-
}
|
|
687
|
-
else if (policy.maxSessionAgeHours > 0 && sessionAgeHours >= policy.maxSessionAgeHours) {
|
|
688
|
-
reason = `session age reached ${Math.floor(sessionAgeHours)} hours`;
|
|
689
|
-
}
|
|
690
|
-
if (!reason || !latestRun) {
|
|
691
|
-
return {
|
|
692
|
-
rotate: false,
|
|
693
|
-
reason: null,
|
|
694
|
-
handoffMarkdown: null,
|
|
695
|
-
previousRunId: latestRun?.id ?? null,
|
|
696
|
-
};
|
|
697
|
-
}
|
|
698
|
-
const latestSummary = summarizeHeartbeatRunResultJson(latestRun.resultJson);
|
|
699
|
-
const latestTextSummary = readNonEmptyString(latestSummary?.summary) ??
|
|
700
|
-
readNonEmptyString(latestSummary?.result) ??
|
|
701
|
-
readNonEmptyString(latestSummary?.message) ??
|
|
702
|
-
readNonEmptyString(latestRun.error);
|
|
703
|
-
const handoffMarkdown = [
|
|
704
|
-
"Paperclip session handoff:",
|
|
705
|
-
`- Previous session: ${sessionId}`,
|
|
706
|
-
issueId ? `- Issue: ${issueId}` : "",
|
|
707
|
-
`- Rotation reason: ${reason}`,
|
|
708
|
-
latestTextSummary ? `- Last run summary: ${latestTextSummary}` : "",
|
|
709
|
-
"Continue from the current task state. Rebuild only the minimum context you need.",
|
|
710
|
-
]
|
|
711
|
-
.filter(Boolean)
|
|
712
|
-
.join("\n");
|
|
713
|
-
return {
|
|
714
|
-
rotate: true,
|
|
715
|
-
reason,
|
|
716
|
-
handoffMarkdown,
|
|
717
|
-
previousRunId: latestRun.id,
|
|
718
|
-
};
|
|
719
|
-
}
|
|
720
|
-
async function resolveSessionBeforeForWakeup(agent, taskKey) {
|
|
721
|
-
if (taskKey) {
|
|
722
|
-
const codec = getAdapterSessionCodec(agent.adapterType);
|
|
723
|
-
const existingTaskSession = await getTaskSession(agent.companyId, agent.id, agent.adapterType, taskKey);
|
|
724
|
-
const parsedParams = normalizeSessionParams(codec.deserialize(existingTaskSession?.sessionParamsJson ?? null));
|
|
725
|
-
return truncateDisplayId(existingTaskSession?.sessionDisplayId ??
|
|
726
|
-
(codec.getDisplayId ? codec.getDisplayId(parsedParams) : null) ??
|
|
727
|
-
readNonEmptyString(parsedParams?.sessionId));
|
|
728
|
-
}
|
|
729
|
-
const runtimeForRun = await getRuntimeState(agent.id);
|
|
730
|
-
return runtimeForRun?.sessionId ?? null;
|
|
731
|
-
}
|
|
732
|
-
async function resolveWorkspaceForRun(agent, context, previousSessionParams, opts) {
|
|
733
|
-
const issueId = readNonEmptyString(context.issueId);
|
|
734
|
-
const contextProjectId = readNonEmptyString(context.projectId);
|
|
735
|
-
const contextProjectWorkspaceId = readNonEmptyString(context.projectWorkspaceId);
|
|
736
|
-
const issueProjectRef = issueId
|
|
737
|
-
? await db
|
|
738
|
-
.select({
|
|
739
|
-
projectId: issues.projectId,
|
|
740
|
-
projectWorkspaceId: issues.projectWorkspaceId,
|
|
741
|
-
})
|
|
742
|
-
.from(issues)
|
|
743
|
-
.where(and(eq(issues.id, issueId), eq(issues.companyId, agent.companyId)))
|
|
744
|
-
.then((rows) => rows[0] ?? null)
|
|
745
|
-
: null;
|
|
746
|
-
const issueProjectId = issueProjectRef?.projectId ?? null;
|
|
747
|
-
const preferredProjectWorkspaceId = issueProjectRef?.projectWorkspaceId ?? contextProjectWorkspaceId ?? null;
|
|
748
|
-
const resolvedProjectId = issueProjectId ?? contextProjectId;
|
|
749
|
-
const useProjectWorkspace = opts?.useProjectWorkspace !== false;
|
|
750
|
-
const workspaceProjectId = useProjectWorkspace ? resolvedProjectId : null;
|
|
751
|
-
const unorderedProjectWorkspaceRows = workspaceProjectId
|
|
752
|
-
? await db
|
|
753
|
-
.select()
|
|
754
|
-
.from(projectWorkspaces)
|
|
755
|
-
.where(and(eq(projectWorkspaces.companyId, agent.companyId), eq(projectWorkspaces.projectId, workspaceProjectId)))
|
|
756
|
-
.orderBy(asc(projectWorkspaces.createdAt), asc(projectWorkspaces.id))
|
|
757
|
-
: [];
|
|
758
|
-
const projectWorkspaceRows = prioritizeProjectWorkspaceCandidatesForRun(unorderedProjectWorkspaceRows, preferredProjectWorkspaceId);
|
|
759
|
-
const workspaceHints = projectWorkspaceRows.map((workspace) => ({
|
|
760
|
-
workspaceId: workspace.id,
|
|
761
|
-
cwd: readNonEmptyString(workspace.cwd),
|
|
762
|
-
repoUrl: readNonEmptyString(workspace.repoUrl),
|
|
763
|
-
repoRef: readNonEmptyString(workspace.repoRef),
|
|
764
|
-
}));
|
|
765
|
-
if (projectWorkspaceRows.length > 0) {
|
|
766
|
-
const preferredWorkspace = preferredProjectWorkspaceId
|
|
767
|
-
? projectWorkspaceRows.find((workspace) => workspace.id === preferredProjectWorkspaceId) ?? null
|
|
768
|
-
: null;
|
|
769
|
-
const missingProjectCwds = [];
|
|
770
|
-
let hasConfiguredProjectCwd = false;
|
|
771
|
-
let preferredWorkspaceWarning = null;
|
|
772
|
-
if (preferredProjectWorkspaceId && !preferredWorkspace) {
|
|
773
|
-
preferredWorkspaceWarning =
|
|
774
|
-
`Selected project workspace "${preferredProjectWorkspaceId}" is not available on this project.`;
|
|
775
|
-
}
|
|
776
|
-
for (const workspace of projectWorkspaceRows) {
|
|
777
|
-
let projectCwd = readNonEmptyString(workspace.cwd);
|
|
778
|
-
let managedWorkspaceWarning = null;
|
|
779
|
-
if (!projectCwd || projectCwd === REPO_ONLY_CWD_SENTINEL) {
|
|
780
|
-
try {
|
|
781
|
-
const managedWorkspace = await ensureManagedProjectWorkspace({
|
|
782
|
-
companyId: agent.companyId,
|
|
783
|
-
projectId: workspaceProjectId ?? resolvedProjectId ?? workspace.projectId,
|
|
784
|
-
repoUrl: readNonEmptyString(workspace.repoUrl),
|
|
785
|
-
});
|
|
786
|
-
projectCwd = managedWorkspace.cwd;
|
|
787
|
-
managedWorkspaceWarning = managedWorkspace.warning;
|
|
788
|
-
}
|
|
789
|
-
catch (error) {
|
|
790
|
-
if (preferredWorkspace?.id === workspace.id) {
|
|
791
|
-
preferredWorkspaceWarning = error instanceof Error ? error.message : String(error);
|
|
792
|
-
}
|
|
793
|
-
continue;
|
|
794
|
-
}
|
|
795
|
-
}
|
|
796
|
-
hasConfiguredProjectCwd = true;
|
|
797
|
-
const projectCwdExists = await fs
|
|
798
|
-
.stat(projectCwd)
|
|
799
|
-
.then((stats) => stats.isDirectory())
|
|
800
|
-
.catch(() => false);
|
|
801
|
-
if (projectCwdExists) {
|
|
802
|
-
return {
|
|
803
|
-
cwd: projectCwd,
|
|
804
|
-
source: "project_primary",
|
|
805
|
-
projectId: resolvedProjectId,
|
|
806
|
-
workspaceId: workspace.id,
|
|
807
|
-
repoUrl: workspace.repoUrl,
|
|
808
|
-
repoRef: workspace.repoRef,
|
|
809
|
-
workspaceHints,
|
|
810
|
-
warnings: [preferredWorkspaceWarning, managedWorkspaceWarning].filter((value) => Boolean(value)),
|
|
811
|
-
};
|
|
812
|
-
}
|
|
813
|
-
if (preferredWorkspace?.id === workspace.id) {
|
|
814
|
-
preferredWorkspaceWarning =
|
|
815
|
-
`Selected project workspace path "${projectCwd}" is not available yet.`;
|
|
816
|
-
}
|
|
817
|
-
missingProjectCwds.push(projectCwd);
|
|
818
|
-
}
|
|
819
|
-
const fallbackCwd = resolveDefaultAgentWorkspaceDir(agent.id);
|
|
820
|
-
await fs.mkdir(fallbackCwd, { recursive: true });
|
|
821
|
-
const warnings = [];
|
|
822
|
-
if (preferredWorkspaceWarning) {
|
|
823
|
-
warnings.push(preferredWorkspaceWarning);
|
|
824
|
-
}
|
|
825
|
-
if (missingProjectCwds.length > 0) {
|
|
826
|
-
const firstMissing = missingProjectCwds[0];
|
|
827
|
-
const extraMissingCount = Math.max(0, missingProjectCwds.length - 1);
|
|
828
|
-
warnings.push(extraMissingCount > 0
|
|
829
|
-
? `Project workspace path "${firstMissing}" and ${extraMissingCount} other configured path(s) are not available yet. Using fallback workspace "${fallbackCwd}" for this run.`
|
|
830
|
-
: `Project workspace path "${firstMissing}" is not available yet. Using fallback workspace "${fallbackCwd}" for this run.`);
|
|
831
|
-
}
|
|
832
|
-
else if (!hasConfiguredProjectCwd) {
|
|
833
|
-
warnings.push(`Project workspace has no local cwd configured. Using fallback workspace "${fallbackCwd}" for this run.`);
|
|
834
|
-
}
|
|
835
|
-
return {
|
|
836
|
-
cwd: fallbackCwd,
|
|
837
|
-
source: "project_primary",
|
|
838
|
-
projectId: resolvedProjectId,
|
|
839
|
-
workspaceId: projectWorkspaceRows[0]?.id ?? null,
|
|
840
|
-
repoUrl: projectWorkspaceRows[0]?.repoUrl ?? null,
|
|
841
|
-
repoRef: projectWorkspaceRows[0]?.repoRef ?? null,
|
|
842
|
-
workspaceHints,
|
|
843
|
-
warnings,
|
|
844
|
-
};
|
|
845
|
-
}
|
|
846
|
-
if (workspaceProjectId) {
|
|
847
|
-
const managedWorkspace = await ensureManagedProjectWorkspace({
|
|
848
|
-
companyId: agent.companyId,
|
|
849
|
-
projectId: workspaceProjectId,
|
|
850
|
-
repoUrl: null,
|
|
851
|
-
});
|
|
852
|
-
return {
|
|
853
|
-
cwd: managedWorkspace.cwd,
|
|
854
|
-
source: "project_primary",
|
|
855
|
-
projectId: resolvedProjectId,
|
|
856
|
-
workspaceId: null,
|
|
857
|
-
repoUrl: null,
|
|
858
|
-
repoRef: null,
|
|
859
|
-
workspaceHints,
|
|
860
|
-
warnings: managedWorkspace.warning ? [managedWorkspace.warning] : [],
|
|
861
|
-
};
|
|
862
|
-
}
|
|
863
|
-
const sessionCwd = readNonEmptyString(previousSessionParams?.cwd);
|
|
864
|
-
if (sessionCwd) {
|
|
865
|
-
const sessionCwdExists = await fs
|
|
866
|
-
.stat(sessionCwd)
|
|
867
|
-
.then((stats) => stats.isDirectory())
|
|
868
|
-
.catch(() => false);
|
|
869
|
-
if (sessionCwdExists) {
|
|
870
|
-
return {
|
|
871
|
-
cwd: sessionCwd,
|
|
872
|
-
source: "task_session",
|
|
873
|
-
projectId: resolvedProjectId,
|
|
874
|
-
workspaceId: readNonEmptyString(previousSessionParams?.workspaceId),
|
|
875
|
-
repoUrl: readNonEmptyString(previousSessionParams?.repoUrl),
|
|
876
|
-
repoRef: readNonEmptyString(previousSessionParams?.repoRef),
|
|
877
|
-
workspaceHints,
|
|
878
|
-
warnings: [],
|
|
879
|
-
};
|
|
880
|
-
}
|
|
881
|
-
}
|
|
882
|
-
const cwd = resolveDefaultAgentWorkspaceDir(agent.id);
|
|
883
|
-
await fs.mkdir(cwd, { recursive: true });
|
|
884
|
-
const warnings = [];
|
|
885
|
-
if (sessionCwd) {
|
|
886
|
-
warnings.push(`Saved session workspace "${sessionCwd}" is not available. Using fallback workspace "${cwd}" for this run.`);
|
|
887
|
-
}
|
|
888
|
-
else if (resolvedProjectId) {
|
|
889
|
-
warnings.push(`No project workspace directory is currently available for this issue. Using fallback workspace "${cwd}" for this run.`);
|
|
890
|
-
}
|
|
891
|
-
else {
|
|
892
|
-
warnings.push(`No project or prior session workspace was available. Using fallback workspace "${cwd}" for this run.`);
|
|
893
|
-
}
|
|
894
|
-
return {
|
|
895
|
-
cwd,
|
|
896
|
-
source: "agent_home",
|
|
897
|
-
projectId: resolvedProjectId,
|
|
898
|
-
workspaceId: null,
|
|
899
|
-
repoUrl: null,
|
|
900
|
-
repoRef: null,
|
|
901
|
-
workspaceHints,
|
|
902
|
-
warnings,
|
|
903
|
-
};
|
|
904
|
-
}
|
|
905
|
-
async function upsertTaskSession(input) {
|
|
906
|
-
const existing = await getTaskSession(input.companyId, input.agentId, input.adapterType, input.taskKey);
|
|
907
|
-
if (existing) {
|
|
908
|
-
return db
|
|
909
|
-
.update(agentTaskSessions)
|
|
910
|
-
.set({
|
|
911
|
-
sessionParamsJson: input.sessionParamsJson,
|
|
912
|
-
sessionDisplayId: input.sessionDisplayId,
|
|
913
|
-
lastRunId: input.lastRunId,
|
|
914
|
-
lastError: input.lastError,
|
|
915
|
-
updatedAt: new Date(),
|
|
916
|
-
})
|
|
917
|
-
.where(eq(agentTaskSessions.id, existing.id))
|
|
918
|
-
.returning()
|
|
919
|
-
.then((rows) => rows[0] ?? null);
|
|
920
|
-
}
|
|
921
|
-
return db
|
|
922
|
-
.insert(agentTaskSessions)
|
|
923
|
-
.values({
|
|
924
|
-
companyId: input.companyId,
|
|
925
|
-
agentId: input.agentId,
|
|
926
|
-
adapterType: input.adapterType,
|
|
927
|
-
taskKey: input.taskKey,
|
|
928
|
-
sessionParamsJson: input.sessionParamsJson,
|
|
929
|
-
sessionDisplayId: input.sessionDisplayId,
|
|
930
|
-
lastRunId: input.lastRunId,
|
|
931
|
-
lastError: input.lastError,
|
|
932
|
-
})
|
|
933
|
-
.returning()
|
|
934
|
-
.then((rows) => rows[0] ?? null);
|
|
935
|
-
}
|
|
936
|
-
async function clearTaskSessions(companyId, agentId, opts) {
|
|
937
|
-
const conditions = [
|
|
938
|
-
eq(agentTaskSessions.companyId, companyId),
|
|
939
|
-
eq(agentTaskSessions.agentId, agentId),
|
|
940
|
-
];
|
|
941
|
-
if (opts?.taskKey) {
|
|
942
|
-
conditions.push(eq(agentTaskSessions.taskKey, opts.taskKey));
|
|
943
|
-
}
|
|
944
|
-
if (opts?.adapterType) {
|
|
945
|
-
conditions.push(eq(agentTaskSessions.adapterType, opts.adapterType));
|
|
946
|
-
}
|
|
947
|
-
return db
|
|
948
|
-
.delete(agentTaskSessions)
|
|
949
|
-
.where(and(...conditions))
|
|
950
|
-
.returning()
|
|
951
|
-
.then((rows) => rows.length);
|
|
952
|
-
}
|
|
953
|
-
async function ensureRuntimeState(agent) {
|
|
954
|
-
const existing = await getRuntimeState(agent.id);
|
|
955
|
-
if (existing)
|
|
956
|
-
return existing;
|
|
957
|
-
return db
|
|
958
|
-
.insert(agentRuntimeState)
|
|
959
|
-
.values({
|
|
960
|
-
agentId: agent.id,
|
|
961
|
-
companyId: agent.companyId,
|
|
962
|
-
adapterType: agent.adapterType,
|
|
963
|
-
stateJson: {},
|
|
964
|
-
})
|
|
965
|
-
.returning()
|
|
966
|
-
.then((rows) => rows[0]);
|
|
967
|
-
}
|
|
968
|
-
async function setRunStatus(runId, status, patch) {
|
|
969
|
-
const updated = await db
|
|
970
|
-
.update(heartbeatRuns)
|
|
971
|
-
.set({ status, ...patch, updatedAt: new Date() })
|
|
972
|
-
.where(eq(heartbeatRuns.id, runId))
|
|
973
|
-
.returning()
|
|
974
|
-
.then((rows) => rows[0] ?? null);
|
|
975
|
-
if (updated) {
|
|
976
|
-
publishLiveEvent({
|
|
977
|
-
companyId: updated.companyId,
|
|
978
|
-
type: "heartbeat.run.status",
|
|
979
|
-
payload: {
|
|
980
|
-
runId: updated.id,
|
|
981
|
-
agentId: updated.agentId,
|
|
982
|
-
status: updated.status,
|
|
983
|
-
invocationSource: updated.invocationSource,
|
|
984
|
-
triggerDetail: updated.triggerDetail,
|
|
985
|
-
error: updated.error ?? null,
|
|
986
|
-
errorCode: updated.errorCode ?? null,
|
|
987
|
-
startedAt: updated.startedAt ? new Date(updated.startedAt).toISOString() : null,
|
|
988
|
-
finishedAt: updated.finishedAt ? new Date(updated.finishedAt).toISOString() : null,
|
|
989
|
-
},
|
|
990
|
-
});
|
|
991
|
-
}
|
|
992
|
-
return updated;
|
|
993
|
-
}
|
|
994
|
-
async function setWakeupStatus(wakeupRequestId, status, patch) {
|
|
995
|
-
if (!wakeupRequestId)
|
|
996
|
-
return;
|
|
997
|
-
await db
|
|
998
|
-
.update(agentWakeupRequests)
|
|
999
|
-
.set({ status, ...patch, updatedAt: new Date() })
|
|
1000
|
-
.where(eq(agentWakeupRequests.id, wakeupRequestId));
|
|
1001
|
-
}
|
|
1002
|
-
async function appendRunEvent(run, seq, event) {
|
|
1003
|
-
const sanitizedMessage = event.message ? redactCurrentUserText(event.message) : event.message;
|
|
1004
|
-
const sanitizedPayload = event.payload ? redactCurrentUserValue(event.payload) : event.payload;
|
|
1005
|
-
await db.insert(heartbeatRunEvents).values({
|
|
1006
|
-
companyId: run.companyId,
|
|
1007
|
-
runId: run.id,
|
|
1008
|
-
agentId: run.agentId,
|
|
1009
|
-
seq,
|
|
1010
|
-
eventType: event.eventType,
|
|
1011
|
-
stream: event.stream,
|
|
1012
|
-
level: event.level,
|
|
1013
|
-
color: event.color,
|
|
1014
|
-
message: sanitizedMessage,
|
|
1015
|
-
payload: sanitizedPayload,
|
|
1016
|
-
});
|
|
1017
|
-
publishLiveEvent({
|
|
1018
|
-
companyId: run.companyId,
|
|
1019
|
-
type: "heartbeat.run.event",
|
|
1020
|
-
payload: {
|
|
1021
|
-
runId: run.id,
|
|
1022
|
-
agentId: run.agentId,
|
|
1023
|
-
seq,
|
|
1024
|
-
eventType: event.eventType,
|
|
1025
|
-
stream: event.stream ?? null,
|
|
1026
|
-
level: event.level ?? null,
|
|
1027
|
-
color: event.color ?? null,
|
|
1028
|
-
message: sanitizedMessage ?? null,
|
|
1029
|
-
payload: sanitizedPayload ?? null,
|
|
1030
|
-
},
|
|
1031
|
-
});
|
|
1032
|
-
}
|
|
1033
|
-
async function nextRunEventSeq(runId) {
|
|
1034
|
-
const [row] = await db
|
|
1035
|
-
.select({ maxSeq: sql `max(${heartbeatRunEvents.seq})` })
|
|
1036
|
-
.from(heartbeatRunEvents)
|
|
1037
|
-
.where(eq(heartbeatRunEvents.runId, runId));
|
|
1038
|
-
return Number(row?.maxSeq ?? 0) + 1;
|
|
1039
|
-
}
|
|
1040
|
-
async function persistRunProcessMetadata(runId, meta) {
|
|
1041
|
-
const startedAt = new Date(meta.startedAt);
|
|
1042
|
-
return db
|
|
1043
|
-
.update(heartbeatRuns)
|
|
1044
|
-
.set({
|
|
1045
|
-
processPid: meta.pid,
|
|
1046
|
-
processStartedAt: Number.isNaN(startedAt.getTime()) ? new Date() : startedAt,
|
|
1047
|
-
updatedAt: new Date(),
|
|
1048
|
-
})
|
|
1049
|
-
.where(eq(heartbeatRuns.id, runId))
|
|
1050
|
-
.returning()
|
|
1051
|
-
.then((rows) => rows[0] ?? null);
|
|
1052
|
-
}
|
|
1053
|
-
async function clearDetachedRunWarning(runId) {
|
|
1054
|
-
const updated = await db
|
|
1055
|
-
.update(heartbeatRuns)
|
|
1056
|
-
.set({
|
|
1057
|
-
error: null,
|
|
1058
|
-
errorCode: null,
|
|
1059
|
-
updatedAt: new Date(),
|
|
1060
|
-
})
|
|
1061
|
-
.where(and(eq(heartbeatRuns.id, runId), eq(heartbeatRuns.status, "running"), eq(heartbeatRuns.errorCode, DETACHED_PROCESS_ERROR_CODE)))
|
|
1062
|
-
.returning()
|
|
1063
|
-
.then((rows) => rows[0] ?? null);
|
|
1064
|
-
if (!updated)
|
|
1065
|
-
return null;
|
|
1066
|
-
await appendRunEvent(updated, await nextRunEventSeq(updated.id), {
|
|
1067
|
-
eventType: "lifecycle",
|
|
1068
|
-
stream: "system",
|
|
1069
|
-
level: "info",
|
|
1070
|
-
message: "Detached child process reported activity; cleared detached warning",
|
|
1071
|
-
});
|
|
1072
|
-
return updated;
|
|
1073
|
-
}
|
|
1074
|
-
async function enqueueProcessLossRetry(run, agent, now) {
|
|
1075
|
-
const contextSnapshot = parseObject(run.contextSnapshot);
|
|
1076
|
-
const issueId = readNonEmptyString(contextSnapshot.issueId);
|
|
1077
|
-
const taskKey = deriveTaskKey(contextSnapshot, null);
|
|
1078
|
-
const sessionBefore = await resolveSessionBeforeForWakeup(agent, taskKey);
|
|
1079
|
-
const retryContextSnapshot = {
|
|
1080
|
-
...contextSnapshot,
|
|
1081
|
-
retryOfRunId: run.id,
|
|
1082
|
-
wakeReason: "process_lost_retry",
|
|
1083
|
-
retryReason: "process_lost",
|
|
1084
|
-
};
|
|
1085
|
-
const queued = await db.transaction(async (tx) => {
|
|
1086
|
-
const wakeupRequest = await tx
|
|
1087
|
-
.insert(agentWakeupRequests)
|
|
1088
|
-
.values({
|
|
1089
|
-
companyId: run.companyId,
|
|
1090
|
-
agentId: run.agentId,
|
|
1091
|
-
source: "automation",
|
|
1092
|
-
triggerDetail: "system",
|
|
1093
|
-
reason: "process_lost_retry",
|
|
1094
|
-
payload: {
|
|
1095
|
-
...(issueId ? { issueId } : {}),
|
|
1096
|
-
retryOfRunId: run.id,
|
|
1097
|
-
},
|
|
1098
|
-
status: "queued",
|
|
1099
|
-
requestedByActorType: "system",
|
|
1100
|
-
requestedByActorId: null,
|
|
1101
|
-
updatedAt: now,
|
|
1102
|
-
})
|
|
1103
|
-
.returning()
|
|
1104
|
-
.then((rows) => rows[0]);
|
|
1105
|
-
const retryRun = await tx
|
|
1106
|
-
.insert(heartbeatRuns)
|
|
1107
|
-
.values({
|
|
1108
|
-
companyId: run.companyId,
|
|
1109
|
-
agentId: run.agentId,
|
|
1110
|
-
invocationSource: "automation",
|
|
1111
|
-
triggerDetail: "system",
|
|
1112
|
-
status: "queued",
|
|
1113
|
-
wakeupRequestId: wakeupRequest.id,
|
|
1114
|
-
contextSnapshot: retryContextSnapshot,
|
|
1115
|
-
sessionIdBefore: sessionBefore,
|
|
1116
|
-
retryOfRunId: run.id,
|
|
1117
|
-
processLossRetryCount: (run.processLossRetryCount ?? 0) + 1,
|
|
1118
|
-
updatedAt: now,
|
|
1119
|
-
})
|
|
1120
|
-
.returning()
|
|
1121
|
-
.then((rows) => rows[0]);
|
|
1122
|
-
await tx
|
|
1123
|
-
.update(agentWakeupRequests)
|
|
1124
|
-
.set({
|
|
1125
|
-
runId: retryRun.id,
|
|
1126
|
-
updatedAt: now,
|
|
1127
|
-
})
|
|
1128
|
-
.where(eq(agentWakeupRequests.id, wakeupRequest.id));
|
|
1129
|
-
if (issueId) {
|
|
1130
|
-
await tx
|
|
1131
|
-
.update(issues)
|
|
1132
|
-
.set({
|
|
1133
|
-
executionRunId: retryRun.id,
|
|
1134
|
-
executionAgentNameKey: normalizeAgentNameKey(agent.name),
|
|
1135
|
-
executionLockedAt: now,
|
|
1136
|
-
updatedAt: now,
|
|
1137
|
-
})
|
|
1138
|
-
.where(and(eq(issues.id, issueId), eq(issues.companyId, run.companyId), eq(issues.executionRunId, run.id)));
|
|
1139
|
-
}
|
|
1140
|
-
return retryRun;
|
|
1141
|
-
});
|
|
1142
|
-
publishLiveEvent({
|
|
1143
|
-
companyId: queued.companyId,
|
|
1144
|
-
type: "heartbeat.run.queued",
|
|
1145
|
-
payload: {
|
|
1146
|
-
runId: queued.id,
|
|
1147
|
-
agentId: queued.agentId,
|
|
1148
|
-
invocationSource: queued.invocationSource,
|
|
1149
|
-
triggerDetail: queued.triggerDetail,
|
|
1150
|
-
wakeupRequestId: queued.wakeupRequestId,
|
|
1151
|
-
},
|
|
1152
|
-
});
|
|
1153
|
-
await appendRunEvent(queued, 1, {
|
|
1154
|
-
eventType: "lifecycle",
|
|
1155
|
-
stream: "system",
|
|
1156
|
-
level: "warn",
|
|
1157
|
-
message: "Queued automatic retry after orphaned child process was confirmed dead",
|
|
1158
|
-
payload: {
|
|
1159
|
-
retryOfRunId: run.id,
|
|
1160
|
-
},
|
|
1161
|
-
});
|
|
1162
|
-
return queued;
|
|
1163
|
-
}
|
|
1164
|
-
function parseHeartbeatPolicy(agent) {
|
|
1165
|
-
const runtimeConfig = parseObject(agent.runtimeConfig);
|
|
1166
|
-
const heartbeat = parseObject(runtimeConfig.heartbeat);
|
|
1167
|
-
// globalWakeOnDemand is the legacy single flag — per-source flags take precedence.
|
|
1168
|
-
// Separating these means disabling on_demand wakeups won't accidentally block
|
|
1169
|
-
// assignment-triggered wakeups (the primary pipeline path).
|
|
1170
|
-
const globalWakeOnDemand = heartbeat.wakeOnDemand;
|
|
1171
|
-
return {
|
|
1172
|
-
enabled: asBoolean(heartbeat.enabled, true),
|
|
1173
|
-
intervalSec: Math.max(0, asNumber(heartbeat.intervalSec, 0)),
|
|
1174
|
-
wakeOnAssignment: asBoolean(heartbeat.wakeOnAssignment ?? globalWakeOnDemand, true),
|
|
1175
|
-
wakeOnAutomation: asBoolean(heartbeat.wakeOnAutomation ?? globalWakeOnDemand, true),
|
|
1176
|
-
wakeOnDemand: asBoolean(heartbeat.wakeOnOnDemand ?? globalWakeOnDemand, true),
|
|
1177
|
-
maxConcurrentRuns: normalizeMaxConcurrentRuns(heartbeat.maxConcurrentRuns),
|
|
1178
|
-
};
|
|
1179
|
-
}
|
|
1180
|
-
async function countRunningRunsForAgent(agentId) {
|
|
1181
|
-
const [{ count }] = await db
|
|
1182
|
-
.select({ count: sql `count(*)` })
|
|
1183
|
-
.from(heartbeatRuns)
|
|
1184
|
-
.where(and(eq(heartbeatRuns.agentId, agentId), eq(heartbeatRuns.status, "running")));
|
|
1185
|
-
return Number(count ?? 0);
|
|
1186
|
-
}
|
|
1187
|
-
async function claimQueuedRun(run) {
|
|
1188
|
-
if (run.status !== "queued")
|
|
1189
|
-
return run;
|
|
1190
|
-
const agent = await getAgent(run.agentId);
|
|
1191
|
-
if (!agent) {
|
|
1192
|
-
await cancelRunInternal(run.id, "Cancelled because the agent no longer exists");
|
|
1193
|
-
return null;
|
|
1194
|
-
}
|
|
1195
|
-
if (agent.status === "paused" || agent.status === "terminated" || agent.status === "pending_approval") {
|
|
1196
|
-
await cancelRunInternal(run.id, "Cancelled because the agent is not invokable");
|
|
1197
|
-
return null;
|
|
1198
|
-
}
|
|
1199
|
-
const context = parseObject(run.contextSnapshot);
|
|
1200
|
-
const budgetBlock = await budgets.getInvocationBlock(run.companyId, run.agentId, {
|
|
1201
|
-
issueId: readNonEmptyString(context.issueId),
|
|
1202
|
-
projectId: readNonEmptyString(context.projectId),
|
|
1203
|
-
});
|
|
1204
|
-
if (budgetBlock) {
|
|
1205
|
-
await cancelRunInternal(run.id, budgetBlock.reason);
|
|
1206
|
-
return null;
|
|
1207
|
-
}
|
|
1208
|
-
const claimedAt = new Date();
|
|
1209
|
-
const claimed = await db
|
|
1210
|
-
.update(heartbeatRuns)
|
|
1211
|
-
.set({
|
|
1212
|
-
status: "running",
|
|
1213
|
-
startedAt: run.startedAt ?? claimedAt,
|
|
1214
|
-
updatedAt: claimedAt,
|
|
1215
|
-
})
|
|
1216
|
-
.where(and(eq(heartbeatRuns.id, run.id), eq(heartbeatRuns.status, "queued")))
|
|
1217
|
-
.returning()
|
|
1218
|
-
.then((rows) => rows[0] ?? null);
|
|
1219
|
-
if (!claimed)
|
|
1220
|
-
return null;
|
|
1221
|
-
publishLiveEvent({
|
|
1222
|
-
companyId: claimed.companyId,
|
|
1223
|
-
type: "heartbeat.run.status",
|
|
1224
|
-
payload: {
|
|
1225
|
-
runId: claimed.id,
|
|
1226
|
-
agentId: claimed.agentId,
|
|
1227
|
-
status: claimed.status,
|
|
1228
|
-
invocationSource: claimed.invocationSource,
|
|
1229
|
-
triggerDetail: claimed.triggerDetail,
|
|
1230
|
-
error: claimed.error ?? null,
|
|
1231
|
-
errorCode: claimed.errorCode ?? null,
|
|
1232
|
-
startedAt: claimed.startedAt ? new Date(claimed.startedAt).toISOString() : null,
|
|
1233
|
-
finishedAt: claimed.finishedAt ? new Date(claimed.finishedAt).toISOString() : null,
|
|
1234
|
-
},
|
|
1235
|
-
});
|
|
1236
|
-
await setWakeupStatus(claimed.wakeupRequestId, "claimed", { claimedAt });
|
|
1237
|
-
return claimed;
|
|
1238
|
-
}
|
|
1239
|
-
async function finalizeAgentStatus(agentId, outcome) {
|
|
1240
|
-
const existing = await getAgent(agentId);
|
|
1241
|
-
if (!existing)
|
|
1242
|
-
return;
|
|
1243
|
-
if (existing.status === "paused" || existing.status === "terminated") {
|
|
1244
|
-
return;
|
|
1245
|
-
}
|
|
1246
|
-
const runningCount = await countRunningRunsForAgent(agentId);
|
|
1247
|
-
const nextStatus = runningCount > 0
|
|
1248
|
-
? "running"
|
|
1249
|
-
: outcome === "succeeded" || outcome === "cancelled"
|
|
1250
|
-
? "idle"
|
|
1251
|
-
: "error";
|
|
1252
|
-
const updated = await db
|
|
1253
|
-
.update(agents)
|
|
1254
|
-
.set({
|
|
1255
|
-
status: nextStatus,
|
|
1256
|
-
lastHeartbeatAt: new Date(),
|
|
1257
|
-
updatedAt: new Date(),
|
|
1258
|
-
})
|
|
1259
|
-
.where(eq(agents.id, agentId))
|
|
1260
|
-
.returning()
|
|
1261
|
-
.then((rows) => rows[0] ?? null);
|
|
1262
|
-
if (updated) {
|
|
1263
|
-
publishLiveEvent({
|
|
1264
|
-
companyId: updated.companyId,
|
|
1265
|
-
type: "agent.status",
|
|
1266
|
-
payload: {
|
|
1267
|
-
agentId: updated.id,
|
|
1268
|
-
status: updated.status,
|
|
1269
|
-
lastHeartbeatAt: updated.lastHeartbeatAt
|
|
1270
|
-
? new Date(updated.lastHeartbeatAt).toISOString()
|
|
1271
|
-
: null,
|
|
1272
|
-
outcome,
|
|
1273
|
-
},
|
|
1274
|
-
});
|
|
1275
|
-
}
|
|
1276
|
-
}
|
|
1277
|
-
async function reapOrphanedRuns(opts) {
|
|
1278
|
-
const staleThresholdMs = opts?.staleThresholdMs ?? 0;
|
|
1279
|
-
const now = new Date();
|
|
1280
|
-
// Find all runs stuck in "running" state (queued runs are legitimately waiting; resumeQueuedRuns handles them)
|
|
1281
|
-
const activeRuns = await db
|
|
1282
|
-
.select({
|
|
1283
|
-
run: heartbeatRuns,
|
|
1284
|
-
adapterType: agents.adapterType,
|
|
1285
|
-
})
|
|
1286
|
-
.from(heartbeatRuns)
|
|
1287
|
-
.innerJoin(agents, eq(heartbeatRuns.agentId, agents.id))
|
|
1288
|
-
.where(eq(heartbeatRuns.status, "running"));
|
|
1289
|
-
const reaped = [];
|
|
1290
|
-
for (const { run, adapterType } of activeRuns) {
|
|
1291
|
-
if (runningProcesses.has(run.id) || activeRunExecutions.has(run.id))
|
|
1292
|
-
continue;
|
|
1293
|
-
// Apply staleness threshold to avoid false positives
|
|
1294
|
-
if (staleThresholdMs > 0) {
|
|
1295
|
-
const refTime = run.updatedAt ? new Date(run.updatedAt).getTime() : 0;
|
|
1296
|
-
if (now.getTime() - refTime < staleThresholdMs)
|
|
1297
|
-
continue;
|
|
1298
|
-
}
|
|
1299
|
-
const tracksLocalChild = isTrackedLocalChildProcessAdapter(adapterType);
|
|
1300
|
-
if (tracksLocalChild && run.processPid && isProcessAlive(run.processPid)) {
|
|
1301
|
-
if (run.errorCode !== DETACHED_PROCESS_ERROR_CODE) {
|
|
1302
|
-
const detachedMessage = `Lost in-memory process handle, but child pid ${run.processPid} is still alive`;
|
|
1303
|
-
const detachedRun = await setRunStatus(run.id, "running", {
|
|
1304
|
-
error: detachedMessage,
|
|
1305
|
-
errorCode: DETACHED_PROCESS_ERROR_CODE,
|
|
1306
|
-
});
|
|
1307
|
-
if (detachedRun) {
|
|
1308
|
-
await appendRunEvent(detachedRun, await nextRunEventSeq(detachedRun.id), {
|
|
1309
|
-
eventType: "lifecycle",
|
|
1310
|
-
stream: "system",
|
|
1311
|
-
level: "warn",
|
|
1312
|
-
message: detachedMessage,
|
|
1313
|
-
payload: {
|
|
1314
|
-
processPid: run.processPid,
|
|
1315
|
-
},
|
|
1316
|
-
});
|
|
1317
|
-
}
|
|
1318
|
-
}
|
|
1319
|
-
continue;
|
|
1320
|
-
}
|
|
1321
|
-
const shouldRetry = tracksLocalChild && !!run.processPid && (run.processLossRetryCount ?? 0) < 1;
|
|
1322
|
-
const baseMessage = run.processPid
|
|
1323
|
-
? `Process lost -- child pid ${run.processPid} is no longer running`
|
|
1324
|
-
: "Process lost -- server may have restarted";
|
|
1325
|
-
let finalizedRun = await setRunStatus(run.id, "failed", {
|
|
1326
|
-
error: shouldRetry ? `${baseMessage}; retrying once` : baseMessage,
|
|
1327
|
-
errorCode: "process_lost",
|
|
1328
|
-
finishedAt: now,
|
|
1329
|
-
});
|
|
1330
|
-
await setWakeupStatus(run.wakeupRequestId, "failed", {
|
|
1331
|
-
finishedAt: now,
|
|
1332
|
-
error: shouldRetry ? `${baseMessage}; retrying once` : baseMessage,
|
|
1333
|
-
});
|
|
1334
|
-
if (!finalizedRun)
|
|
1335
|
-
finalizedRun = await getRun(run.id);
|
|
1336
|
-
if (!finalizedRun)
|
|
1337
|
-
continue;
|
|
1338
|
-
let retriedRun = null;
|
|
1339
|
-
if (shouldRetry) {
|
|
1340
|
-
const agent = await getAgent(run.agentId);
|
|
1341
|
-
if (agent) {
|
|
1342
|
-
retriedRun = await enqueueProcessLossRetry(finalizedRun, agent, now);
|
|
1343
|
-
}
|
|
1344
|
-
}
|
|
1345
|
-
else {
|
|
1346
|
-
await releaseIssueExecutionAndPromote(finalizedRun);
|
|
1347
|
-
}
|
|
1348
|
-
await appendRunEvent(finalizedRun, await nextRunEventSeq(finalizedRun.id), {
|
|
1349
|
-
eventType: "lifecycle",
|
|
1350
|
-
stream: "system",
|
|
1351
|
-
level: "error",
|
|
1352
|
-
message: shouldRetry
|
|
1353
|
-
? `${baseMessage}; queued retry ${retriedRun?.id ?? ""}`.trim()
|
|
1354
|
-
: baseMessage,
|
|
1355
|
-
payload: {
|
|
1356
|
-
...(run.processPid ? { processPid: run.processPid } : {}),
|
|
1357
|
-
...(retriedRun ? { retryRunId: retriedRun.id } : {}),
|
|
1358
|
-
},
|
|
1359
|
-
});
|
|
1360
|
-
await finalizeAgentStatus(run.agentId, "failed");
|
|
1361
|
-
await startNextQueuedRunForAgent(run.agentId);
|
|
1362
|
-
runningProcesses.delete(run.id);
|
|
1363
|
-
reaped.push(run.id);
|
|
1364
|
-
}
|
|
1365
|
-
if (reaped.length > 0) {
|
|
1366
|
-
logger.warn({ reapedCount: reaped.length, runIds: reaped }, "reaped orphaned heartbeat runs");
|
|
1367
|
-
}
|
|
1368
|
-
return { reaped: reaped.length, runIds: reaped };
|
|
1369
|
-
}
|
|
1370
|
-
async function resumeQueuedRuns() {
|
|
1371
|
-
const queuedRuns = await db
|
|
1372
|
-
.select({ agentId: heartbeatRuns.agentId })
|
|
1373
|
-
.from(heartbeatRuns)
|
|
1374
|
-
.where(eq(heartbeatRuns.status, "queued"));
|
|
1375
|
-
const agentIds = [...new Set(queuedRuns.map((r) => r.agentId))];
|
|
1376
|
-
for (const agentId of agentIds) {
|
|
1377
|
-
await startNextQueuedRunForAgent(agentId);
|
|
1378
|
-
}
|
|
1379
|
-
}
|
|
1380
|
-
async function updateRuntimeState(agent, run, result, session, normalizedUsage) {
|
|
1381
|
-
await ensureRuntimeState(agent);
|
|
1382
|
-
const usage = normalizedUsage ?? normalizeUsageTotals(result.usage);
|
|
1383
|
-
const inputTokens = usage?.inputTokens ?? 0;
|
|
1384
|
-
const outputTokens = usage?.outputTokens ?? 0;
|
|
1385
|
-
const cachedInputTokens = usage?.cachedInputTokens ?? 0;
|
|
1386
|
-
const billingType = normalizeLedgerBillingType(result.billingType);
|
|
1387
|
-
const additionalCostCents = normalizeBilledCostCents(result.costUsd, billingType);
|
|
1388
|
-
const hasTokenUsage = inputTokens > 0 || outputTokens > 0 || cachedInputTokens > 0;
|
|
1389
|
-
const provider = result.provider ?? "unknown";
|
|
1390
|
-
const biller = resolveLedgerBiller(result);
|
|
1391
|
-
const ledgerScope = await resolveLedgerScopeForRun(db, agent.companyId, run);
|
|
1392
|
-
await db
|
|
1393
|
-
.update(agentRuntimeState)
|
|
1394
|
-
.set({
|
|
1395
|
-
adapterType: agent.adapterType,
|
|
1396
|
-
sessionId: session.legacySessionId,
|
|
1397
|
-
lastRunId: run.id,
|
|
1398
|
-
lastRunStatus: run.status,
|
|
1399
|
-
lastError: result.errorMessage ?? null,
|
|
1400
|
-
totalInputTokens: sql `${agentRuntimeState.totalInputTokens} + ${inputTokens}`,
|
|
1401
|
-
totalOutputTokens: sql `${agentRuntimeState.totalOutputTokens} + ${outputTokens}`,
|
|
1402
|
-
totalCachedInputTokens: sql `${agentRuntimeState.totalCachedInputTokens} + ${cachedInputTokens}`,
|
|
1403
|
-
totalCostCents: sql `${agentRuntimeState.totalCostCents} + ${additionalCostCents}`,
|
|
1404
|
-
updatedAt: new Date(),
|
|
1405
|
-
})
|
|
1406
|
-
.where(eq(agentRuntimeState.agentId, agent.id));
|
|
1407
|
-
if (additionalCostCents > 0 || hasTokenUsage) {
|
|
1408
|
-
const costs = costService(db, budgetHooks);
|
|
1409
|
-
await costs.createEvent(agent.companyId, {
|
|
1410
|
-
heartbeatRunId: run.id,
|
|
1411
|
-
agentId: agent.id,
|
|
1412
|
-
issueId: ledgerScope.issueId,
|
|
1413
|
-
projectId: ledgerScope.projectId,
|
|
1414
|
-
provider,
|
|
1415
|
-
biller,
|
|
1416
|
-
billingType,
|
|
1417
|
-
model: result.model ?? "unknown",
|
|
1418
|
-
inputTokens,
|
|
1419
|
-
cachedInputTokens,
|
|
1420
|
-
outputTokens,
|
|
1421
|
-
costCents: additionalCostCents,
|
|
1422
|
-
occurredAt: new Date(),
|
|
1423
|
-
});
|
|
1424
|
-
}
|
|
1425
|
-
}
|
|
1426
|
-
async function startNextQueuedRunForAgent(agentId) {
|
|
1427
|
-
return withAgentStartLock(agentId, async () => {
|
|
1428
|
-
const agent = await getAgent(agentId);
|
|
1429
|
-
if (!agent)
|
|
1430
|
-
return [];
|
|
1431
|
-
if (agent.status === "paused" || agent.status === "terminated" || agent.status === "pending_approval") {
|
|
1432
|
-
return [];
|
|
1433
|
-
}
|
|
1434
|
-
const policy = parseHeartbeatPolicy(agent);
|
|
1435
|
-
const runningCount = await countRunningRunsForAgent(agentId);
|
|
1436
|
-
const availableSlots = Math.max(0, policy.maxConcurrentRuns - runningCount);
|
|
1437
|
-
if (availableSlots <= 0)
|
|
1438
|
-
return [];
|
|
1439
|
-
const queuedRuns = await db
|
|
1440
|
-
.select()
|
|
1441
|
-
.from(heartbeatRuns)
|
|
1442
|
-
.where(and(eq(heartbeatRuns.agentId, agentId), eq(heartbeatRuns.status, "queued")))
|
|
1443
|
-
.orderBy(asc(heartbeatRuns.createdAt))
|
|
1444
|
-
.limit(availableSlots);
|
|
1445
|
-
if (queuedRuns.length === 0)
|
|
1446
|
-
return [];
|
|
1447
|
-
const claimedRuns = [];
|
|
1448
|
-
for (const queuedRun of queuedRuns) {
|
|
1449
|
-
const claimed = await claimQueuedRun(queuedRun);
|
|
1450
|
-
if (claimed)
|
|
1451
|
-
claimedRuns.push(claimed);
|
|
1452
|
-
}
|
|
1453
|
-
if (claimedRuns.length === 0)
|
|
1454
|
-
return [];
|
|
1455
|
-
for (const claimedRun of claimedRuns) {
|
|
1456
|
-
void executeRun(claimedRun.id).catch((err) => {
|
|
1457
|
-
logger.error({ err, runId: claimedRun.id }, "queued heartbeat execution failed");
|
|
1458
|
-
});
|
|
1459
|
-
}
|
|
1460
|
-
return claimedRuns;
|
|
1461
|
-
});
|
|
1462
|
-
}
|
|
1463
|
-
async function executeRun(runId) {
|
|
1464
|
-
let run = await getRun(runId);
|
|
1465
|
-
if (!run)
|
|
1466
|
-
return;
|
|
1467
|
-
if (run.status !== "queued" && run.status !== "running")
|
|
1468
|
-
return;
|
|
1469
|
-
if (run.status === "queued") {
|
|
1470
|
-
const claimed = await claimQueuedRun(run);
|
|
1471
|
-
if (!claimed) {
|
|
1472
|
-
// Another worker has already claimed or finalized this run.
|
|
1473
|
-
return;
|
|
1474
|
-
}
|
|
1475
|
-
run = claimed;
|
|
1476
|
-
}
|
|
1477
|
-
activeRunExecutions.add(run.id);
|
|
1478
|
-
try {
|
|
1479
|
-
const agent = await getAgent(run.agentId);
|
|
1480
|
-
if (!agent) {
|
|
1481
|
-
await setRunStatus(runId, "failed", {
|
|
1482
|
-
error: "Agent not found",
|
|
1483
|
-
errorCode: "agent_not_found",
|
|
1484
|
-
finishedAt: new Date(),
|
|
1485
|
-
});
|
|
1486
|
-
await setWakeupStatus(run.wakeupRequestId, "failed", {
|
|
1487
|
-
finishedAt: new Date(),
|
|
1488
|
-
error: "Agent not found",
|
|
1489
|
-
});
|
|
1490
|
-
const failedRun = await getRun(runId);
|
|
1491
|
-
if (failedRun)
|
|
1492
|
-
await releaseIssueExecutionAndPromote(failedRun);
|
|
1493
|
-
return;
|
|
1494
|
-
}
|
|
1495
|
-
const runtime = await ensureRuntimeState(agent);
|
|
1496
|
-
const context = parseObject(run.contextSnapshot);
|
|
1497
|
-
const taskKey = deriveTaskKey(context, null);
|
|
1498
|
-
const sessionCodec = getAdapterSessionCodec(agent.adapterType);
|
|
1499
|
-
const issueId = readNonEmptyString(context.issueId);
|
|
1500
|
-
const issueContext = issueId
|
|
1501
|
-
? await db
|
|
1502
|
-
.select({
|
|
1503
|
-
id: issues.id,
|
|
1504
|
-
identifier: issues.identifier,
|
|
1505
|
-
title: issues.title,
|
|
1506
|
-
projectId: issues.projectId,
|
|
1507
|
-
projectWorkspaceId: issues.projectWorkspaceId,
|
|
1508
|
-
executionWorkspaceId: issues.executionWorkspaceId,
|
|
1509
|
-
executionWorkspacePreference: issues.executionWorkspacePreference,
|
|
1510
|
-
assigneeAgentId: issues.assigneeAgentId,
|
|
1511
|
-
assigneeAdapterOverrides: issues.assigneeAdapterOverrides,
|
|
1512
|
-
executionWorkspaceSettings: issues.executionWorkspaceSettings,
|
|
1513
|
-
})
|
|
1514
|
-
.from(issues)
|
|
1515
|
-
.where(and(eq(issues.id, issueId), eq(issues.companyId, agent.companyId)))
|
|
1516
|
-
.then((rows) => rows[0] ?? null)
|
|
1517
|
-
: null;
|
|
1518
|
-
const issueAssigneeOverrides = issueContext && issueContext.assigneeAgentId === agent.id
|
|
1519
|
-
? parseIssueAssigneeAdapterOverrides(issueContext.assigneeAdapterOverrides)
|
|
1520
|
-
: null;
|
|
1521
|
-
const isolatedWorkspacesEnabled = (await instanceSettings.getExperimental()).enableIsolatedWorkspaces;
|
|
1522
|
-
const issueExecutionWorkspaceSettings = isolatedWorkspacesEnabled
|
|
1523
|
-
? parseIssueExecutionWorkspaceSettings(issueContext?.executionWorkspaceSettings)
|
|
1524
|
-
: null;
|
|
1525
|
-
const contextProjectId = readNonEmptyString(context.projectId);
|
|
1526
|
-
const executionProjectId = issueContext?.projectId ?? contextProjectId;
|
|
1527
|
-
const projectExecutionWorkspacePolicy = executionProjectId
|
|
1528
|
-
? await db
|
|
1529
|
-
.select({ executionWorkspacePolicy: projects.executionWorkspacePolicy })
|
|
1530
|
-
.from(projects)
|
|
1531
|
-
.where(and(eq(projects.id, executionProjectId), eq(projects.companyId, agent.companyId)))
|
|
1532
|
-
.then((rows) => gateProjectExecutionWorkspacePolicy(parseProjectExecutionWorkspacePolicy(rows[0]?.executionWorkspacePolicy), isolatedWorkspacesEnabled))
|
|
1533
|
-
: null;
|
|
1534
|
-
const taskSession = taskKey
|
|
1535
|
-
? await getTaskSession(agent.companyId, agent.id, agent.adapterType, taskKey)
|
|
1536
|
-
: null;
|
|
1537
|
-
const resetTaskSession = shouldResetTaskSessionForWake(context);
|
|
1538
|
-
const sessionResetReason = describeSessionResetReason(context);
|
|
1539
|
-
const taskSessionForRun = resetTaskSession ? null : taskSession;
|
|
1540
|
-
const previousSessionParams = normalizeSessionParams(sessionCodec.deserialize(taskSessionForRun?.sessionParamsJson ?? null));
|
|
1541
|
-
const config = parseObject(agent.adapterConfig);
|
|
1542
|
-
const executionWorkspaceMode = resolveExecutionWorkspaceMode({
|
|
1543
|
-
projectPolicy: projectExecutionWorkspacePolicy,
|
|
1544
|
-
issueSettings: issueExecutionWorkspaceSettings,
|
|
1545
|
-
legacyUseProjectWorkspace: issueAssigneeOverrides?.useProjectWorkspace ?? null,
|
|
1546
|
-
});
|
|
1547
|
-
const resolvedWorkspace = await resolveWorkspaceForRun(agent, context, previousSessionParams, { useProjectWorkspace: executionWorkspaceMode !== "agent_default" });
|
|
1548
|
-
const workspaceManagedConfig = buildExecutionWorkspaceAdapterConfig({
|
|
1549
|
-
agentConfig: config,
|
|
1550
|
-
projectPolicy: projectExecutionWorkspacePolicy,
|
|
1551
|
-
issueSettings: issueExecutionWorkspaceSettings,
|
|
1552
|
-
mode: executionWorkspaceMode,
|
|
1553
|
-
legacyUseProjectWorkspace: issueAssigneeOverrides?.useProjectWorkspace ?? null,
|
|
1554
|
-
});
|
|
1555
|
-
const mergedConfig = issueAssigneeOverrides?.adapterConfig
|
|
1556
|
-
? { ...workspaceManagedConfig, ...issueAssigneeOverrides.adapterConfig }
|
|
1557
|
-
: workspaceManagedConfig;
|
|
1558
|
-
const { config: resolvedConfig, secretKeys } = await secretsSvc.resolveAdapterConfigForRuntime(agent.companyId, mergedConfig);
|
|
1559
|
-
const issueRef = issueContext
|
|
1560
|
-
? {
|
|
1561
|
-
id: issueContext.id,
|
|
1562
|
-
identifier: issueContext.identifier,
|
|
1563
|
-
title: issueContext.title,
|
|
1564
|
-
projectId: issueContext.projectId,
|
|
1565
|
-
projectWorkspaceId: issueContext.projectWorkspaceId,
|
|
1566
|
-
executionWorkspaceId: issueContext.executionWorkspaceId,
|
|
1567
|
-
executionWorkspacePreference: issueContext.executionWorkspacePreference,
|
|
1568
|
-
}
|
|
1569
|
-
: null;
|
|
1570
|
-
const existingExecutionWorkspace = issueRef?.executionWorkspaceId ? await executionWorkspacesSvc.getById(issueRef.executionWorkspaceId) : null;
|
|
1571
|
-
const workspaceOperationRecorder = workspaceOperationsSvc.createRecorder({
|
|
1572
|
-
companyId: agent.companyId,
|
|
1573
|
-
heartbeatRunId: run.id,
|
|
1574
|
-
executionWorkspaceId: existingExecutionWorkspace?.id ?? null,
|
|
1575
|
-
});
|
|
1576
|
-
const executionWorkspace = await realizeExecutionWorkspace({
|
|
1577
|
-
base: {
|
|
1578
|
-
baseCwd: resolvedWorkspace.cwd,
|
|
1579
|
-
source: resolvedWorkspace.source,
|
|
1580
|
-
projectId: resolvedWorkspace.projectId,
|
|
1581
|
-
workspaceId: resolvedWorkspace.workspaceId,
|
|
1582
|
-
repoUrl: resolvedWorkspace.repoUrl,
|
|
1583
|
-
repoRef: resolvedWorkspace.repoRef,
|
|
1584
|
-
},
|
|
1585
|
-
config: resolvedConfig,
|
|
1586
|
-
issue: issueRef,
|
|
1587
|
-
agent: {
|
|
1588
|
-
id: agent.id,
|
|
1589
|
-
name: agent.name,
|
|
1590
|
-
companyId: agent.companyId,
|
|
1591
|
-
},
|
|
1592
|
-
recorder: workspaceOperationRecorder,
|
|
1593
|
-
});
|
|
1594
|
-
const resolvedProjectId = executionWorkspace.projectId ?? issueRef?.projectId ?? executionProjectId ?? null;
|
|
1595
|
-
const resolvedProjectWorkspaceId = issueRef?.projectWorkspaceId ?? resolvedWorkspace.workspaceId ?? null;
|
|
1596
|
-
const shouldReuseExisting = issueRef?.executionWorkspacePreference === "reuse_existing" &&
|
|
1597
|
-
existingExecutionWorkspace &&
|
|
1598
|
-
existingExecutionWorkspace.status !== "archived";
|
|
1599
|
-
let persistedExecutionWorkspace = null;
|
|
1600
|
-
try {
|
|
1601
|
-
persistedExecutionWorkspace = shouldReuseExisting && existingExecutionWorkspace
|
|
1602
|
-
? await executionWorkspacesSvc.update(existingExecutionWorkspace.id, {
|
|
1603
|
-
cwd: executionWorkspace.cwd,
|
|
1604
|
-
repoUrl: executionWorkspace.repoUrl,
|
|
1605
|
-
baseRef: executionWorkspace.repoRef,
|
|
1606
|
-
branchName: executionWorkspace.branchName,
|
|
1607
|
-
providerType: executionWorkspace.strategy === "git_worktree" ? "git_worktree" : "local_fs",
|
|
1608
|
-
providerRef: executionWorkspace.worktreePath,
|
|
1609
|
-
status: "active",
|
|
1610
|
-
lastUsedAt: new Date(),
|
|
1611
|
-
metadata: {
|
|
1612
|
-
...(existingExecutionWorkspace.metadata ?? {}),
|
|
1613
|
-
source: executionWorkspace.source,
|
|
1614
|
-
createdByRuntime: executionWorkspace.created,
|
|
1615
|
-
},
|
|
1616
|
-
})
|
|
1617
|
-
: resolvedProjectId
|
|
1618
|
-
? await executionWorkspacesSvc.create({
|
|
1619
|
-
companyId: agent.companyId,
|
|
1620
|
-
projectId: resolvedProjectId,
|
|
1621
|
-
projectWorkspaceId: resolvedProjectWorkspaceId,
|
|
1622
|
-
sourceIssueId: issueRef?.id ?? null,
|
|
1623
|
-
mode: executionWorkspaceMode === "isolated_workspace"
|
|
1624
|
-
? "isolated_workspace"
|
|
1625
|
-
: executionWorkspaceMode === "operator_branch"
|
|
1626
|
-
? "operator_branch"
|
|
1627
|
-
: executionWorkspaceMode === "agent_default"
|
|
1628
|
-
? "adapter_managed"
|
|
1629
|
-
: "shared_workspace",
|
|
1630
|
-
strategyType: executionWorkspace.strategy === "git_worktree" ? "git_worktree" : "project_primary",
|
|
1631
|
-
name: executionWorkspace.branchName ?? issueRef?.identifier ?? `workspace-${agent.id.slice(0, 8)}`,
|
|
1632
|
-
status: "active",
|
|
1633
|
-
cwd: executionWorkspace.cwd,
|
|
1634
|
-
repoUrl: executionWorkspace.repoUrl,
|
|
1635
|
-
baseRef: executionWorkspace.repoRef,
|
|
1636
|
-
branchName: executionWorkspace.branchName,
|
|
1637
|
-
providerType: executionWorkspace.strategy === "git_worktree" ? "git_worktree" : "local_fs",
|
|
1638
|
-
providerRef: executionWorkspace.worktreePath,
|
|
1639
|
-
lastUsedAt: new Date(),
|
|
1640
|
-
openedAt: new Date(),
|
|
1641
|
-
metadata: {
|
|
1642
|
-
source: executionWorkspace.source,
|
|
1643
|
-
createdByRuntime: executionWorkspace.created,
|
|
1644
|
-
},
|
|
1645
|
-
})
|
|
1646
|
-
: null;
|
|
1647
|
-
}
|
|
1648
|
-
catch (error) {
|
|
1649
|
-
if (executionWorkspace.created) {
|
|
1650
|
-
try {
|
|
1651
|
-
await cleanupExecutionWorkspaceArtifacts({
|
|
1652
|
-
workspace: {
|
|
1653
|
-
id: existingExecutionWorkspace?.id ?? `transient-${run.id}`,
|
|
1654
|
-
cwd: executionWorkspace.cwd,
|
|
1655
|
-
providerType: executionWorkspace.strategy === "git_worktree" ? "git_worktree" : "local_fs",
|
|
1656
|
-
providerRef: executionWorkspace.worktreePath,
|
|
1657
|
-
branchName: executionWorkspace.branchName,
|
|
1658
|
-
repoUrl: executionWorkspace.repoUrl,
|
|
1659
|
-
baseRef: executionWorkspace.repoRef,
|
|
1660
|
-
projectId: resolvedProjectId,
|
|
1661
|
-
projectWorkspaceId: resolvedProjectWorkspaceId,
|
|
1662
|
-
sourceIssueId: issueRef?.id ?? null,
|
|
1663
|
-
metadata: {
|
|
1664
|
-
createdByRuntime: true,
|
|
1665
|
-
source: executionWorkspace.source,
|
|
1666
|
-
},
|
|
1667
|
-
},
|
|
1668
|
-
projectWorkspace: {
|
|
1669
|
-
cwd: resolvedWorkspace.cwd,
|
|
1670
|
-
cleanupCommand: null,
|
|
1671
|
-
},
|
|
1672
|
-
teardownCommand: projectExecutionWorkspacePolicy?.workspaceStrategy?.teardownCommand ?? null,
|
|
1673
|
-
recorder: workspaceOperationRecorder,
|
|
1674
|
-
});
|
|
1675
|
-
}
|
|
1676
|
-
catch (cleanupError) {
|
|
1677
|
-
logger.warn({
|
|
1678
|
-
runId: run.id,
|
|
1679
|
-
issueId,
|
|
1680
|
-
executionWorkspaceCwd: executionWorkspace.cwd,
|
|
1681
|
-
cleanupError: cleanupError instanceof Error ? cleanupError.message : String(cleanupError),
|
|
1682
|
-
}, "Failed to cleanup realized execution workspace after persistence failure");
|
|
1683
|
-
}
|
|
1684
|
-
}
|
|
1685
|
-
throw error;
|
|
1686
|
-
}
|
|
1687
|
-
await workspaceOperationRecorder.attachExecutionWorkspaceId(persistedExecutionWorkspace?.id ?? null);
|
|
1688
|
-
if (existingExecutionWorkspace &&
|
|
1689
|
-
persistedExecutionWorkspace &&
|
|
1690
|
-
existingExecutionWorkspace.id !== persistedExecutionWorkspace.id &&
|
|
1691
|
-
existingExecutionWorkspace.status === "active") {
|
|
1692
|
-
await executionWorkspacesSvc.update(existingExecutionWorkspace.id, {
|
|
1693
|
-
status: "idle",
|
|
1694
|
-
cleanupReason: null,
|
|
1695
|
-
});
|
|
1696
|
-
}
|
|
1697
|
-
if (issueId && persistedExecutionWorkspace && issueRef?.executionWorkspaceId !== persistedExecutionWorkspace.id) {
|
|
1698
|
-
await issuesSvc.update(issueId, {
|
|
1699
|
-
executionWorkspaceId: persistedExecutionWorkspace.id,
|
|
1700
|
-
...(resolvedProjectWorkspaceId ? { projectWorkspaceId: resolvedProjectWorkspaceId } : {}),
|
|
1701
|
-
});
|
|
1702
|
-
}
|
|
1703
|
-
if (persistedExecutionWorkspace) {
|
|
1704
|
-
context.executionWorkspaceId = persistedExecutionWorkspace.id;
|
|
1705
|
-
await db
|
|
1706
|
-
.update(heartbeatRuns)
|
|
1707
|
-
.set({
|
|
1708
|
-
contextSnapshot: context,
|
|
1709
|
-
updatedAt: new Date(),
|
|
1710
|
-
})
|
|
1711
|
-
.where(eq(heartbeatRuns.id, run.id));
|
|
1712
|
-
}
|
|
1713
|
-
const runtimeSessionResolution = resolveRuntimeSessionParamsForWorkspace({
|
|
1714
|
-
agentId: agent.id,
|
|
1715
|
-
previousSessionParams,
|
|
1716
|
-
resolvedWorkspace: {
|
|
1717
|
-
...resolvedWorkspace,
|
|
1718
|
-
cwd: executionWorkspace.cwd,
|
|
1719
|
-
},
|
|
1720
|
-
});
|
|
1721
|
-
const runtimeSessionParams = runtimeSessionResolution.sessionParams;
|
|
1722
|
-
const runtimeWorkspaceWarnings = [
|
|
1723
|
-
...resolvedWorkspace.warnings,
|
|
1724
|
-
...executionWorkspace.warnings,
|
|
1725
|
-
...(runtimeSessionResolution.warning ? [runtimeSessionResolution.warning] : []),
|
|
1726
|
-
...(resetTaskSession && sessionResetReason
|
|
1727
|
-
? [
|
|
1728
|
-
taskKey
|
|
1729
|
-
? `Skipping saved session resume for task "${taskKey}" because ${sessionResetReason}.`
|
|
1730
|
-
: `Skipping saved session resume because ${sessionResetReason}.`,
|
|
1731
|
-
]
|
|
1732
|
-
: []),
|
|
1733
|
-
];
|
|
1734
|
-
context.paperclipWorkspace = {
|
|
1735
|
-
cwd: executionWorkspace.cwd,
|
|
1736
|
-
source: executionWorkspace.source,
|
|
1737
|
-
mode: executionWorkspaceMode,
|
|
1738
|
-
strategy: executionWorkspace.strategy,
|
|
1739
|
-
projectId: executionWorkspace.projectId,
|
|
1740
|
-
workspaceId: executionWorkspace.workspaceId,
|
|
1741
|
-
repoUrl: executionWorkspace.repoUrl,
|
|
1742
|
-
repoRef: executionWorkspace.repoRef,
|
|
1743
|
-
branchName: executionWorkspace.branchName,
|
|
1744
|
-
worktreePath: executionWorkspace.worktreePath,
|
|
1745
|
-
agentHome: resolveDefaultAgentWorkspaceDir(agent.id),
|
|
1746
|
-
};
|
|
1747
|
-
context.paperclipWorkspaces = resolvedWorkspace.workspaceHints;
|
|
1748
|
-
const runtimeServiceIntents = (() => {
|
|
1749
|
-
const runtimeConfig = parseObject(resolvedConfig.workspaceRuntime);
|
|
1750
|
-
return Array.isArray(runtimeConfig.services)
|
|
1751
|
-
? runtimeConfig.services.filter((value) => typeof value === "object" && value !== null)
|
|
1752
|
-
: [];
|
|
1753
|
-
})();
|
|
1754
|
-
if (runtimeServiceIntents.length > 0) {
|
|
1755
|
-
context.paperclipRuntimeServiceIntents = runtimeServiceIntents;
|
|
1756
|
-
}
|
|
1757
|
-
else {
|
|
1758
|
-
delete context.paperclipRuntimeServiceIntents;
|
|
1759
|
-
}
|
|
1760
|
-
if (executionWorkspace.projectId && !readNonEmptyString(context.projectId)) {
|
|
1761
|
-
context.projectId = executionWorkspace.projectId;
|
|
1762
|
-
}
|
|
1763
|
-
const runtimeSessionFallback = taskKey || resetTaskSession ? null : runtime.sessionId;
|
|
1764
|
-
let previousSessionDisplayId = truncateDisplayId(taskSessionForRun?.sessionDisplayId ??
|
|
1765
|
-
(sessionCodec.getDisplayId ? sessionCodec.getDisplayId(runtimeSessionParams) : null) ??
|
|
1766
|
-
readNonEmptyString(runtimeSessionParams?.sessionId) ??
|
|
1767
|
-
runtimeSessionFallback);
|
|
1768
|
-
let runtimeSessionIdForAdapter = readNonEmptyString(runtimeSessionParams?.sessionId) ?? runtimeSessionFallback;
|
|
1769
|
-
let runtimeSessionParamsForAdapter = runtimeSessionParams;
|
|
1770
|
-
const sessionCompaction = await evaluateSessionCompaction({
|
|
1771
|
-
agent,
|
|
1772
|
-
sessionId: previousSessionDisplayId ?? runtimeSessionIdForAdapter,
|
|
1773
|
-
issueId,
|
|
1774
|
-
});
|
|
1775
|
-
if (sessionCompaction.rotate) {
|
|
1776
|
-
context.paperclipSessionHandoffMarkdown = sessionCompaction.handoffMarkdown;
|
|
1777
|
-
context.paperclipSessionRotationReason = sessionCompaction.reason;
|
|
1778
|
-
context.paperclipPreviousSessionId = previousSessionDisplayId ?? runtimeSessionIdForAdapter;
|
|
1779
|
-
runtimeSessionIdForAdapter = null;
|
|
1780
|
-
runtimeSessionParamsForAdapter = null;
|
|
1781
|
-
previousSessionDisplayId = null;
|
|
1782
|
-
if (sessionCompaction.reason) {
|
|
1783
|
-
runtimeWorkspaceWarnings.push(`Starting a fresh session because ${sessionCompaction.reason}.`);
|
|
1784
|
-
}
|
|
1785
|
-
}
|
|
1786
|
-
else {
|
|
1787
|
-
delete context.paperclipSessionHandoffMarkdown;
|
|
1788
|
-
delete context.paperclipSessionRotationReason;
|
|
1789
|
-
delete context.paperclipPreviousSessionId;
|
|
1790
|
-
}
|
|
1791
|
-
const runtimeForAdapter = {
|
|
1792
|
-
sessionId: runtimeSessionIdForAdapter,
|
|
1793
|
-
sessionParams: runtimeSessionParamsForAdapter,
|
|
1794
|
-
sessionDisplayId: previousSessionDisplayId,
|
|
1795
|
-
taskKey,
|
|
1796
|
-
};
|
|
1797
|
-
let seq = 1;
|
|
1798
|
-
let handle = null;
|
|
1799
|
-
let stdoutExcerpt = "";
|
|
1800
|
-
let stderrExcerpt = "";
|
|
1801
|
-
try {
|
|
1802
|
-
const startedAt = run.startedAt ?? new Date();
|
|
1803
|
-
const runningWithSession = await db
|
|
1804
|
-
.update(heartbeatRuns)
|
|
1805
|
-
.set({
|
|
1806
|
-
startedAt,
|
|
1807
|
-
sessionIdBefore: runtimeForAdapter.sessionDisplayId ?? runtimeForAdapter.sessionId,
|
|
1808
|
-
contextSnapshot: context,
|
|
1809
|
-
updatedAt: new Date(),
|
|
1810
|
-
})
|
|
1811
|
-
.where(eq(heartbeatRuns.id, run.id))
|
|
1812
|
-
.returning()
|
|
1813
|
-
.then((rows) => rows[0] ?? null);
|
|
1814
|
-
if (runningWithSession)
|
|
1815
|
-
run = runningWithSession;
|
|
1816
|
-
const runningAgent = await db
|
|
1817
|
-
.update(agents)
|
|
1818
|
-
.set({ status: "running", updatedAt: new Date() })
|
|
1819
|
-
.where(eq(agents.id, agent.id))
|
|
1820
|
-
.returning()
|
|
1821
|
-
.then((rows) => rows[0] ?? null);
|
|
1822
|
-
if (runningAgent) {
|
|
1823
|
-
publishLiveEvent({
|
|
1824
|
-
companyId: runningAgent.companyId,
|
|
1825
|
-
type: "agent.status",
|
|
1826
|
-
payload: {
|
|
1827
|
-
agentId: runningAgent.id,
|
|
1828
|
-
status: runningAgent.status,
|
|
1829
|
-
outcome: "running",
|
|
1830
|
-
},
|
|
1831
|
-
});
|
|
1832
|
-
}
|
|
1833
|
-
const currentRun = run;
|
|
1834
|
-
await appendRunEvent(currentRun, seq++, {
|
|
1835
|
-
eventType: "lifecycle",
|
|
1836
|
-
stream: "system",
|
|
1837
|
-
level: "info",
|
|
1838
|
-
message: "run started",
|
|
1839
|
-
});
|
|
1840
|
-
handle = await runLogStore.begin({
|
|
1841
|
-
companyId: run.companyId,
|
|
1842
|
-
agentId: run.agentId,
|
|
1843
|
-
runId,
|
|
1844
|
-
});
|
|
1845
|
-
await db
|
|
1846
|
-
.update(heartbeatRuns)
|
|
1847
|
-
.set({
|
|
1848
|
-
logStore: handle.store,
|
|
1849
|
-
logRef: handle.logRef,
|
|
1850
|
-
updatedAt: new Date(),
|
|
1851
|
-
})
|
|
1852
|
-
.where(eq(heartbeatRuns.id, runId));
|
|
1853
|
-
const onLog = async (stream, chunk) => {
|
|
1854
|
-
const sanitizedChunk = redactCurrentUserText(chunk);
|
|
1855
|
-
if (stream === "stdout")
|
|
1856
|
-
stdoutExcerpt = appendExcerpt(stdoutExcerpt, sanitizedChunk);
|
|
1857
|
-
if (stream === "stderr")
|
|
1858
|
-
stderrExcerpt = appendExcerpt(stderrExcerpt, sanitizedChunk);
|
|
1859
|
-
const ts = new Date().toISOString();
|
|
1860
|
-
if (handle) {
|
|
1861
|
-
await runLogStore.append(handle, {
|
|
1862
|
-
stream,
|
|
1863
|
-
chunk: sanitizedChunk,
|
|
1864
|
-
ts,
|
|
1865
|
-
});
|
|
1866
|
-
}
|
|
1867
|
-
const payloadChunk = sanitizedChunk.length > MAX_LIVE_LOG_CHUNK_BYTES
|
|
1868
|
-
? sanitizedChunk.slice(sanitizedChunk.length - MAX_LIVE_LOG_CHUNK_BYTES)
|
|
1869
|
-
: sanitizedChunk;
|
|
1870
|
-
publishLiveEvent({
|
|
1871
|
-
companyId: run.companyId,
|
|
1872
|
-
type: "heartbeat.run.log",
|
|
1873
|
-
payload: {
|
|
1874
|
-
runId: run.id,
|
|
1875
|
-
agentId: run.agentId,
|
|
1876
|
-
ts,
|
|
1877
|
-
stream,
|
|
1878
|
-
chunk: payloadChunk,
|
|
1879
|
-
truncated: payloadChunk.length !== sanitizedChunk.length,
|
|
1880
|
-
},
|
|
1881
|
-
});
|
|
1882
|
-
};
|
|
1883
|
-
for (const warning of runtimeWorkspaceWarnings) {
|
|
1884
|
-
const logEntry = formatRuntimeWorkspaceWarningLog(warning);
|
|
1885
|
-
await onLog(logEntry.stream, logEntry.chunk);
|
|
1886
|
-
}
|
|
1887
|
-
const adapterEnv = Object.fromEntries(Object.entries(parseObject(resolvedConfig.env)).filter((entry) => typeof entry[0] === "string" && typeof entry[1] === "string"));
|
|
1888
|
-
const runtimeServices = await ensureRuntimeServicesForRun({
|
|
1889
|
-
db,
|
|
1890
|
-
runId: run.id,
|
|
1891
|
-
agent: {
|
|
1892
|
-
id: agent.id,
|
|
1893
|
-
name: agent.name,
|
|
1894
|
-
companyId: agent.companyId,
|
|
1895
|
-
},
|
|
1896
|
-
issue: issueRef,
|
|
1897
|
-
workspace: executionWorkspace,
|
|
1898
|
-
executionWorkspaceId: persistedExecutionWorkspace?.id ?? issueRef?.executionWorkspaceId ?? null,
|
|
1899
|
-
config: resolvedConfig,
|
|
1900
|
-
adapterEnv,
|
|
1901
|
-
onLog,
|
|
1902
|
-
});
|
|
1903
|
-
if (runtimeServices.length > 0) {
|
|
1904
|
-
context.paperclipRuntimeServices = runtimeServices;
|
|
1905
|
-
context.paperclipRuntimePrimaryUrl =
|
|
1906
|
-
runtimeServices.find((service) => readNonEmptyString(service.url))?.url ?? null;
|
|
1907
|
-
await db
|
|
1908
|
-
.update(heartbeatRuns)
|
|
1909
|
-
.set({
|
|
1910
|
-
contextSnapshot: context,
|
|
1911
|
-
updatedAt: new Date(),
|
|
1912
|
-
})
|
|
1913
|
-
.where(eq(heartbeatRuns.id, run.id));
|
|
1914
|
-
}
|
|
1915
|
-
if (issueId && (executionWorkspace.created || runtimeServices.some((service) => !service.reused))) {
|
|
1916
|
-
try {
|
|
1917
|
-
await issuesSvc.addComment(issueId, buildWorkspaceReadyComment({
|
|
1918
|
-
workspace: executionWorkspace,
|
|
1919
|
-
runtimeServices,
|
|
1920
|
-
}), { agentId: agent.id });
|
|
1921
|
-
}
|
|
1922
|
-
catch (err) {
|
|
1923
|
-
await onLog("stderr", `[paperclip] Failed to post workspace-ready comment: ${err instanceof Error ? err.message : String(err)}\n`);
|
|
1924
|
-
}
|
|
1925
|
-
}
|
|
1926
|
-
const onAdapterMeta = async (meta) => {
|
|
1927
|
-
if (meta.env && secretKeys.size > 0) {
|
|
1928
|
-
for (const key of secretKeys) {
|
|
1929
|
-
if (key in meta.env)
|
|
1930
|
-
meta.env[key] = "***REDACTED***";
|
|
1931
|
-
}
|
|
1932
|
-
}
|
|
1933
|
-
await appendRunEvent(currentRun, seq++, {
|
|
1934
|
-
eventType: "adapter.invoke",
|
|
1935
|
-
stream: "system",
|
|
1936
|
-
level: "info",
|
|
1937
|
-
message: "adapter invocation",
|
|
1938
|
-
payload: meta,
|
|
1939
|
-
});
|
|
1940
|
-
};
|
|
1941
|
-
const adapter = getServerAdapter(agent.adapterType);
|
|
1942
|
-
const authToken = adapter.supportsLocalAgentJwt
|
|
1943
|
-
? createLocalAgentJwt(agent.id, agent.companyId, agent.adapterType, run.id)
|
|
1944
|
-
: null;
|
|
1945
|
-
if (adapter.supportsLocalAgentJwt && !authToken) {
|
|
1946
|
-
logger.warn({
|
|
1947
|
-
companyId: agent.companyId,
|
|
1948
|
-
agentId: agent.id,
|
|
1949
|
-
runId: run.id,
|
|
1950
|
-
adapterType: agent.adapterType,
|
|
1951
|
-
}, "local agent jwt secret missing or invalid; running without injected PAPERCLIP_API_KEY");
|
|
1952
|
-
}
|
|
1953
|
-
const adapterResult = await adapter.execute({
|
|
1954
|
-
runId: run.id,
|
|
1955
|
-
agent,
|
|
1956
|
-
runtime: runtimeForAdapter,
|
|
1957
|
-
config: resolvedConfig,
|
|
1958
|
-
context,
|
|
1959
|
-
onLog,
|
|
1960
|
-
onMeta: onAdapterMeta,
|
|
1961
|
-
onSpawn: async (meta) => {
|
|
1962
|
-
await persistRunProcessMetadata(run.id, meta);
|
|
1963
|
-
},
|
|
1964
|
-
authToken: authToken ?? undefined,
|
|
1965
|
-
});
|
|
1966
|
-
const adapterManagedRuntimeServices = adapterResult.runtimeServices
|
|
1967
|
-
? await persistAdapterManagedRuntimeServices({
|
|
1968
|
-
db,
|
|
1969
|
-
adapterType: agent.adapterType,
|
|
1970
|
-
runId: run.id,
|
|
1971
|
-
agent: {
|
|
1972
|
-
id: agent.id,
|
|
1973
|
-
name: agent.name,
|
|
1974
|
-
companyId: agent.companyId,
|
|
1975
|
-
},
|
|
1976
|
-
issue: issueRef,
|
|
1977
|
-
workspace: executionWorkspace,
|
|
1978
|
-
reports: adapterResult.runtimeServices,
|
|
1979
|
-
})
|
|
1980
|
-
: [];
|
|
1981
|
-
if (adapterManagedRuntimeServices.length > 0) {
|
|
1982
|
-
const combinedRuntimeServices = [
|
|
1983
|
-
...runtimeServices,
|
|
1984
|
-
...adapterManagedRuntimeServices,
|
|
1985
|
-
];
|
|
1986
|
-
context.paperclipRuntimeServices = combinedRuntimeServices;
|
|
1987
|
-
context.paperclipRuntimePrimaryUrl =
|
|
1988
|
-
combinedRuntimeServices.find((service) => readNonEmptyString(service.url))?.url ?? null;
|
|
1989
|
-
await db
|
|
1990
|
-
.update(heartbeatRuns)
|
|
1991
|
-
.set({
|
|
1992
|
-
contextSnapshot: context,
|
|
1993
|
-
updatedAt: new Date(),
|
|
1994
|
-
})
|
|
1995
|
-
.where(eq(heartbeatRuns.id, run.id));
|
|
1996
|
-
if (issueId) {
|
|
1997
|
-
try {
|
|
1998
|
-
await issuesSvc.addComment(issueId, buildWorkspaceReadyComment({
|
|
1999
|
-
workspace: executionWorkspace,
|
|
2000
|
-
runtimeServices: adapterManagedRuntimeServices,
|
|
2001
|
-
}), { agentId: agent.id });
|
|
2002
|
-
}
|
|
2003
|
-
catch (err) {
|
|
2004
|
-
await onLog("stderr", `[paperclip] Failed to post adapter-managed runtime comment: ${err instanceof Error ? err.message : String(err)}\n`);
|
|
2005
|
-
}
|
|
2006
|
-
}
|
|
2007
|
-
}
|
|
2008
|
-
const nextSessionState = resolveNextSessionState({
|
|
2009
|
-
codec: sessionCodec,
|
|
2010
|
-
adapterResult,
|
|
2011
|
-
previousParams: previousSessionParams,
|
|
2012
|
-
previousDisplayId: runtimeForAdapter.sessionDisplayId,
|
|
2013
|
-
previousLegacySessionId: runtimeForAdapter.sessionId,
|
|
2014
|
-
});
|
|
2015
|
-
const rawUsage = normalizeUsageTotals(adapterResult.usage);
|
|
2016
|
-
const sessionUsageResolution = await resolveNormalizedUsageForSession({
|
|
2017
|
-
agentId: agent.id,
|
|
2018
|
-
runId: run.id,
|
|
2019
|
-
sessionId: nextSessionState.displayId ?? nextSessionState.legacySessionId,
|
|
2020
|
-
rawUsage,
|
|
2021
|
-
});
|
|
2022
|
-
const normalizedUsage = sessionUsageResolution.normalizedUsage;
|
|
2023
|
-
let outcome;
|
|
2024
|
-
const latestRun = await getRun(run.id);
|
|
2025
|
-
if (latestRun?.status === "cancelled") {
|
|
2026
|
-
outcome = "cancelled";
|
|
2027
|
-
}
|
|
2028
|
-
else if (adapterResult.timedOut) {
|
|
2029
|
-
outcome = "timed_out";
|
|
2030
|
-
}
|
|
2031
|
-
else if ((adapterResult.exitCode ?? 0) === 0 && !adapterResult.errorMessage) {
|
|
2032
|
-
outcome = "succeeded";
|
|
2033
|
-
}
|
|
2034
|
-
else {
|
|
2035
|
-
outcome = "failed";
|
|
2036
|
-
}
|
|
2037
|
-
let logSummary = null;
|
|
2038
|
-
if (handle) {
|
|
2039
|
-
logSummary = await runLogStore.finalize(handle);
|
|
2040
|
-
}
|
|
2041
|
-
const status = outcome === "succeeded"
|
|
2042
|
-
? "succeeded"
|
|
2043
|
-
: outcome === "cancelled"
|
|
2044
|
-
? "cancelled"
|
|
2045
|
-
: outcome === "timed_out"
|
|
2046
|
-
? "timed_out"
|
|
2047
|
-
: "failed";
|
|
2048
|
-
const usageJson = normalizedUsage || adapterResult.costUsd != null
|
|
2049
|
-
? {
|
|
2050
|
-
...(normalizedUsage ?? {}),
|
|
2051
|
-
...(rawUsage ? {
|
|
2052
|
-
rawInputTokens: rawUsage.inputTokens,
|
|
2053
|
-
rawCachedInputTokens: rawUsage.cachedInputTokens,
|
|
2054
|
-
rawOutputTokens: rawUsage.outputTokens,
|
|
2055
|
-
} : {}),
|
|
2056
|
-
...(sessionUsageResolution.derivedFromSessionTotals ? { usageSource: "session_delta" } : {}),
|
|
2057
|
-
...((nextSessionState.displayId ?? nextSessionState.legacySessionId)
|
|
2058
|
-
? { persistedSessionId: nextSessionState.displayId ?? nextSessionState.legacySessionId }
|
|
2059
|
-
: {}),
|
|
2060
|
-
sessionReused: runtimeForAdapter.sessionId != null || runtimeForAdapter.sessionDisplayId != null,
|
|
2061
|
-
taskSessionReused: taskSessionForRun != null,
|
|
2062
|
-
freshSession: runtimeForAdapter.sessionId == null && runtimeForAdapter.sessionDisplayId == null,
|
|
2063
|
-
sessionRotated: sessionCompaction.rotate,
|
|
2064
|
-
sessionRotationReason: sessionCompaction.reason,
|
|
2065
|
-
provider: readNonEmptyString(adapterResult.provider) ?? "unknown",
|
|
2066
|
-
biller: resolveLedgerBiller(adapterResult),
|
|
2067
|
-
model: readNonEmptyString(adapterResult.model) ?? "unknown",
|
|
2068
|
-
...(adapterResult.costUsd != null ? { costUsd: adapterResult.costUsd } : {}),
|
|
2069
|
-
billingType: normalizeLedgerBillingType(adapterResult.billingType),
|
|
2070
|
-
}
|
|
2071
|
-
: null;
|
|
2072
|
-
await setRunStatus(run.id, status, {
|
|
2073
|
-
finishedAt: new Date(),
|
|
2074
|
-
error: outcome === "succeeded"
|
|
2075
|
-
? null
|
|
2076
|
-
: redactCurrentUserText(adapterResult.errorMessage ?? (outcome === "timed_out" ? "Timed out" : "Adapter failed")),
|
|
2077
|
-
errorCode: outcome === "timed_out"
|
|
2078
|
-
? "timeout"
|
|
2079
|
-
: outcome === "cancelled"
|
|
2080
|
-
? "cancelled"
|
|
2081
|
-
: outcome === "failed"
|
|
2082
|
-
? (adapterResult.errorCode ?? "adapter_failed")
|
|
2083
|
-
: null,
|
|
2084
|
-
exitCode: adapterResult.exitCode,
|
|
2085
|
-
signal: adapterResult.signal,
|
|
2086
|
-
usageJson,
|
|
2087
|
-
resultJson: adapterResult.resultJson ?? null,
|
|
2088
|
-
sessionIdAfter: nextSessionState.displayId ?? nextSessionState.legacySessionId,
|
|
2089
|
-
stdoutExcerpt,
|
|
2090
|
-
stderrExcerpt,
|
|
2091
|
-
logBytes: logSummary?.bytes,
|
|
2092
|
-
logSha256: logSummary?.sha256,
|
|
2093
|
-
logCompressed: logSummary?.compressed ?? false,
|
|
2094
|
-
});
|
|
2095
|
-
await setWakeupStatus(run.wakeupRequestId, outcome === "succeeded" ? "completed" : status, {
|
|
2096
|
-
finishedAt: new Date(),
|
|
2097
|
-
error: adapterResult.errorMessage ?? null,
|
|
2098
|
-
});
|
|
2099
|
-
const finalizedRun = await getRun(run.id);
|
|
2100
|
-
if (finalizedRun) {
|
|
2101
|
-
await appendRunEvent(finalizedRun, seq++, {
|
|
2102
|
-
eventType: "lifecycle",
|
|
2103
|
-
stream: "system",
|
|
2104
|
-
level: outcome === "succeeded" ? "info" : "error",
|
|
2105
|
-
message: `run ${outcome}`,
|
|
2106
|
-
payload: {
|
|
2107
|
-
status,
|
|
2108
|
-
exitCode: adapterResult.exitCode,
|
|
2109
|
-
},
|
|
2110
|
-
});
|
|
2111
|
-
await releaseIssueExecutionAndPromote(finalizedRun);
|
|
2112
|
-
}
|
|
2113
|
-
if (finalizedRun) {
|
|
2114
|
-
await updateRuntimeState(agent, finalizedRun, adapterResult, {
|
|
2115
|
-
legacySessionId: nextSessionState.legacySessionId,
|
|
2116
|
-
}, normalizedUsage);
|
|
2117
|
-
if (taskKey) {
|
|
2118
|
-
if (adapterResult.clearSession || (!nextSessionState.params && !nextSessionState.displayId)) {
|
|
2119
|
-
await clearTaskSessions(agent.companyId, agent.id, {
|
|
2120
|
-
taskKey,
|
|
2121
|
-
adapterType: agent.adapterType,
|
|
2122
|
-
});
|
|
2123
|
-
}
|
|
2124
|
-
else {
|
|
2125
|
-
await upsertTaskSession({
|
|
2126
|
-
companyId: agent.companyId,
|
|
2127
|
-
agentId: agent.id,
|
|
2128
|
-
adapterType: agent.adapterType,
|
|
2129
|
-
taskKey,
|
|
2130
|
-
sessionParamsJson: nextSessionState.params,
|
|
2131
|
-
sessionDisplayId: nextSessionState.displayId,
|
|
2132
|
-
lastRunId: finalizedRun.id,
|
|
2133
|
-
lastError: outcome === "succeeded" ? null : (adapterResult.errorMessage ?? "run_failed"),
|
|
2134
|
-
});
|
|
2135
|
-
}
|
|
2136
|
-
}
|
|
2137
|
-
}
|
|
2138
|
-
await finalizeAgentStatus(agent.id, outcome);
|
|
2139
|
-
}
|
|
2140
|
-
catch (err) {
|
|
2141
|
-
const message = redactCurrentUserText(err instanceof Error ? err.message : "Unknown adapter failure");
|
|
2142
|
-
logger.error({ err, runId }, "heartbeat execution failed");
|
|
2143
|
-
let logSummary = null;
|
|
2144
|
-
if (handle) {
|
|
2145
|
-
try {
|
|
2146
|
-
logSummary = await runLogStore.finalize(handle);
|
|
2147
|
-
}
|
|
2148
|
-
catch (finalizeErr) {
|
|
2149
|
-
logger.warn({ err: finalizeErr, runId }, "failed to finalize run log after error");
|
|
2150
|
-
}
|
|
2151
|
-
}
|
|
2152
|
-
const failedRun = await setRunStatus(run.id, "failed", {
|
|
2153
|
-
error: message,
|
|
2154
|
-
errorCode: "adapter_failed",
|
|
2155
|
-
finishedAt: new Date(),
|
|
2156
|
-
stdoutExcerpt,
|
|
2157
|
-
stderrExcerpt,
|
|
2158
|
-
logBytes: logSummary?.bytes,
|
|
2159
|
-
logSha256: logSummary?.sha256,
|
|
2160
|
-
logCompressed: logSummary?.compressed ?? false,
|
|
2161
|
-
});
|
|
2162
|
-
await setWakeupStatus(run.wakeupRequestId, "failed", {
|
|
2163
|
-
finishedAt: new Date(),
|
|
2164
|
-
error: message,
|
|
2165
|
-
});
|
|
2166
|
-
if (failedRun) {
|
|
2167
|
-
await appendRunEvent(failedRun, seq++, {
|
|
2168
|
-
eventType: "error",
|
|
2169
|
-
stream: "system",
|
|
2170
|
-
level: "error",
|
|
2171
|
-
message,
|
|
2172
|
-
});
|
|
2173
|
-
await releaseIssueExecutionAndPromote(failedRun);
|
|
2174
|
-
await updateRuntimeState(agent, failedRun, {
|
|
2175
|
-
exitCode: null,
|
|
2176
|
-
signal: null,
|
|
2177
|
-
timedOut: false,
|
|
2178
|
-
errorMessage: message,
|
|
2179
|
-
}, {
|
|
2180
|
-
legacySessionId: runtimeForAdapter.sessionId,
|
|
2181
|
-
});
|
|
2182
|
-
if (taskKey && (previousSessionParams || previousSessionDisplayId || taskSession)) {
|
|
2183
|
-
await upsertTaskSession({
|
|
2184
|
-
companyId: agent.companyId,
|
|
2185
|
-
agentId: agent.id,
|
|
2186
|
-
adapterType: agent.adapterType,
|
|
2187
|
-
taskKey,
|
|
2188
|
-
sessionParamsJson: previousSessionParams,
|
|
2189
|
-
sessionDisplayId: previousSessionDisplayId,
|
|
2190
|
-
lastRunId: failedRun.id,
|
|
2191
|
-
lastError: message,
|
|
2192
|
-
});
|
|
2193
|
-
}
|
|
2194
|
-
}
|
|
2195
|
-
await finalizeAgentStatus(agent.id, "failed");
|
|
2196
|
-
}
|
|
2197
|
-
}
|
|
2198
|
-
catch (outerErr) {
|
|
2199
|
-
// Setup code before adapter.execute threw (e.g. ensureRuntimeState, resolveWorkspaceForRun).
|
|
2200
|
-
// The inner catch did not fire, so we must record the failure here.
|
|
2201
|
-
const message = outerErr instanceof Error ? outerErr.message : "Unknown setup failure";
|
|
2202
|
-
logger.error({ err: outerErr, runId }, "heartbeat execution setup failed");
|
|
2203
|
-
await setRunStatus(runId, "failed", {
|
|
2204
|
-
error: message,
|
|
2205
|
-
errorCode: "adapter_failed",
|
|
2206
|
-
finishedAt: new Date(),
|
|
2207
|
-
}).catch(() => undefined);
|
|
2208
|
-
await setWakeupStatus(run.wakeupRequestId, "failed", {
|
|
2209
|
-
finishedAt: new Date(),
|
|
2210
|
-
error: message,
|
|
2211
|
-
}).catch(() => undefined);
|
|
2212
|
-
const failedRun = await getRun(runId).catch(() => null);
|
|
2213
|
-
if (failedRun) {
|
|
2214
|
-
// Emit a run-log event so the failure is visible in the run timeline,
|
|
2215
|
-
// consistent with what the inner catch block does for adapter failures.
|
|
2216
|
-
await appendRunEvent(failedRun, 1, {
|
|
2217
|
-
eventType: "error",
|
|
2218
|
-
stream: "system",
|
|
2219
|
-
level: "error",
|
|
2220
|
-
message,
|
|
2221
|
-
}).catch(() => undefined);
|
|
2222
|
-
await releaseIssueExecutionAndPromote(failedRun).catch(() => undefined);
|
|
2223
|
-
}
|
|
2224
|
-
// Ensure the agent is not left stuck in "running" if the inner catch handler's
|
|
2225
|
-
// DB calls threw (e.g. a transient DB error in finalizeAgentStatus).
|
|
2226
|
-
await finalizeAgentStatus(run.agentId, "failed").catch(() => undefined);
|
|
2227
|
-
}
|
|
2228
|
-
finally {
|
|
2229
|
-
await releaseRuntimeServicesForRun(run.id).catch(() => undefined);
|
|
2230
|
-
activeRunExecutions.delete(run.id);
|
|
2231
|
-
await startNextQueuedRunForAgent(run.agentId);
|
|
2232
|
-
}
|
|
2233
|
-
}
|
|
2234
|
-
async function releaseIssueExecutionAndPromote(run) {
|
|
2235
|
-
const promotedRun = await db.transaction(async (tx) => {
|
|
2236
|
-
await tx.execute(sql `select id from issues where company_id = ${run.companyId} and execution_run_id = ${run.id} for update`);
|
|
2237
|
-
const issue = await tx
|
|
2238
|
-
.select({
|
|
2239
|
-
id: issues.id,
|
|
2240
|
-
companyId: issues.companyId,
|
|
2241
|
-
})
|
|
2242
|
-
.from(issues)
|
|
2243
|
-
.where(and(eq(issues.companyId, run.companyId), eq(issues.executionRunId, run.id)))
|
|
2244
|
-
.then((rows) => rows[0] ?? null);
|
|
2245
|
-
if (!issue)
|
|
2246
|
-
return;
|
|
2247
|
-
await tx
|
|
2248
|
-
.update(issues)
|
|
2249
|
-
.set({
|
|
2250
|
-
executionRunId: null,
|
|
2251
|
-
executionAgentNameKey: null,
|
|
2252
|
-
executionLockedAt: null,
|
|
2253
|
-
updatedAt: new Date(),
|
|
2254
|
-
})
|
|
2255
|
-
.where(eq(issues.id, issue.id));
|
|
2256
|
-
while (true) {
|
|
2257
|
-
const deferred = await tx
|
|
2258
|
-
.select()
|
|
2259
|
-
.from(agentWakeupRequests)
|
|
2260
|
-
.where(and(eq(agentWakeupRequests.companyId, issue.companyId), eq(agentWakeupRequests.status, "deferred_issue_execution"), sql `${agentWakeupRequests.payload} ->> 'issueId' = ${issue.id}`))
|
|
2261
|
-
.orderBy(asc(agentWakeupRequests.requestedAt))
|
|
2262
|
-
.limit(1)
|
|
2263
|
-
.then((rows) => rows[0] ?? null);
|
|
2264
|
-
if (!deferred)
|
|
2265
|
-
return null;
|
|
2266
|
-
const deferredAgent = await tx
|
|
2267
|
-
.select()
|
|
2268
|
-
.from(agents)
|
|
2269
|
-
.where(eq(agents.id, deferred.agentId))
|
|
2270
|
-
.then((rows) => rows[0] ?? null);
|
|
2271
|
-
if (!deferredAgent ||
|
|
2272
|
-
deferredAgent.companyId !== issue.companyId ||
|
|
2273
|
-
deferredAgent.status === "paused" ||
|
|
2274
|
-
deferredAgent.status === "terminated" ||
|
|
2275
|
-
deferredAgent.status === "pending_approval") {
|
|
2276
|
-
await tx
|
|
2277
|
-
.update(agentWakeupRequests)
|
|
2278
|
-
.set({
|
|
2279
|
-
status: "failed",
|
|
2280
|
-
finishedAt: new Date(),
|
|
2281
|
-
error: "Deferred wake could not be promoted: agent is not invokable",
|
|
2282
|
-
updatedAt: new Date(),
|
|
2283
|
-
})
|
|
2284
|
-
.where(eq(agentWakeupRequests.id, deferred.id));
|
|
2285
|
-
continue;
|
|
2286
|
-
}
|
|
2287
|
-
const deferredPayload = parseObject(deferred.payload);
|
|
2288
|
-
const deferredContextSeed = parseObject(deferredPayload[DEFERRED_WAKE_CONTEXT_KEY]);
|
|
2289
|
-
const promotedContextSeed = { ...deferredContextSeed };
|
|
2290
|
-
const promotedReason = readNonEmptyString(deferred.reason) ?? "issue_execution_promoted";
|
|
2291
|
-
const promotedSource = readNonEmptyString(deferred.source) ?? "automation";
|
|
2292
|
-
const promotedTriggerDetail = readNonEmptyString(deferred.triggerDetail) ?? null;
|
|
2293
|
-
const promotedPayload = deferredPayload;
|
|
2294
|
-
delete promotedPayload[DEFERRED_WAKE_CONTEXT_KEY];
|
|
2295
|
-
const { contextSnapshot: promotedContextSnapshot, taskKey: promotedTaskKey, } = enrichWakeContextSnapshot({
|
|
2296
|
-
contextSnapshot: promotedContextSeed,
|
|
2297
|
-
reason: promotedReason,
|
|
2298
|
-
source: promotedSource,
|
|
2299
|
-
triggerDetail: promotedTriggerDetail,
|
|
2300
|
-
payload: promotedPayload,
|
|
2301
|
-
});
|
|
2302
|
-
const sessionBefore = await resolveSessionBeforeForWakeup(deferredAgent, promotedTaskKey);
|
|
2303
|
-
const now = new Date();
|
|
2304
|
-
const newRun = await tx
|
|
2305
|
-
.insert(heartbeatRuns)
|
|
2306
|
-
.values({
|
|
2307
|
-
companyId: deferredAgent.companyId,
|
|
2308
|
-
agentId: deferredAgent.id,
|
|
2309
|
-
invocationSource: promotedSource,
|
|
2310
|
-
triggerDetail: promotedTriggerDetail,
|
|
2311
|
-
status: "queued",
|
|
2312
|
-
wakeupRequestId: deferred.id,
|
|
2313
|
-
contextSnapshot: promotedContextSnapshot,
|
|
2314
|
-
sessionIdBefore: sessionBefore,
|
|
2315
|
-
})
|
|
2316
|
-
.returning()
|
|
2317
|
-
.then((rows) => rows[0]);
|
|
2318
|
-
await tx
|
|
2319
|
-
.update(agentWakeupRequests)
|
|
2320
|
-
.set({
|
|
2321
|
-
status: "queued",
|
|
2322
|
-
reason: "issue_execution_promoted",
|
|
2323
|
-
runId: newRun.id,
|
|
2324
|
-
claimedAt: null,
|
|
2325
|
-
finishedAt: null,
|
|
2326
|
-
error: null,
|
|
2327
|
-
updatedAt: now,
|
|
2328
|
-
})
|
|
2329
|
-
.where(eq(agentWakeupRequests.id, deferred.id));
|
|
2330
|
-
await tx
|
|
2331
|
-
.update(issues)
|
|
2332
|
-
.set({
|
|
2333
|
-
executionRunId: newRun.id,
|
|
2334
|
-
executionAgentNameKey: normalizeAgentNameKey(deferredAgent.name),
|
|
2335
|
-
executionLockedAt: now,
|
|
2336
|
-
updatedAt: now,
|
|
2337
|
-
})
|
|
2338
|
-
.where(eq(issues.id, issue.id));
|
|
2339
|
-
return newRun;
|
|
2340
|
-
}
|
|
2341
|
-
});
|
|
2342
|
-
if (!promotedRun)
|
|
2343
|
-
return;
|
|
2344
|
-
publishLiveEvent({
|
|
2345
|
-
companyId: promotedRun.companyId,
|
|
2346
|
-
type: "heartbeat.run.queued",
|
|
2347
|
-
payload: {
|
|
2348
|
-
runId: promotedRun.id,
|
|
2349
|
-
agentId: promotedRun.agentId,
|
|
2350
|
-
invocationSource: promotedRun.invocationSource,
|
|
2351
|
-
triggerDetail: promotedRun.triggerDetail,
|
|
2352
|
-
wakeupRequestId: promotedRun.wakeupRequestId,
|
|
2353
|
-
},
|
|
2354
|
-
});
|
|
2355
|
-
await startNextQueuedRunForAgent(promotedRun.agentId);
|
|
2356
|
-
}
|
|
2357
|
-
async function enqueueWakeup(agentId, opts = {}) {
|
|
2358
|
-
const source = opts.source ?? "on_demand";
|
|
2359
|
-
const triggerDetail = opts.triggerDetail ?? null;
|
|
2360
|
-
const contextSnapshot = { ...(opts.contextSnapshot ?? {}) };
|
|
2361
|
-
const reason = opts.reason ?? null;
|
|
2362
|
-
const payload = opts.payload ?? null;
|
|
2363
|
-
const { contextSnapshot: enrichedContextSnapshot, issueIdFromPayload, taskKey, wakeCommentId, } = enrichWakeContextSnapshot({
|
|
2364
|
-
contextSnapshot,
|
|
2365
|
-
reason,
|
|
2366
|
-
source,
|
|
2367
|
-
triggerDetail,
|
|
2368
|
-
payload,
|
|
2369
|
-
});
|
|
2370
|
-
const issueId = readNonEmptyString(enrichedContextSnapshot.issueId) ?? issueIdFromPayload;
|
|
2371
|
-
const agent = await getAgent(agentId);
|
|
2372
|
-
if (!agent)
|
|
2373
|
-
throw notFound("Agent not found");
|
|
2374
|
-
const writeSkippedRequest = async (skipReason) => {
|
|
2375
|
-
await db.insert(agentWakeupRequests).values({
|
|
2376
|
-
companyId: agent.companyId,
|
|
2377
|
-
agentId,
|
|
2378
|
-
source,
|
|
2379
|
-
triggerDetail,
|
|
2380
|
-
reason: skipReason,
|
|
2381
|
-
payload,
|
|
2382
|
-
status: "skipped",
|
|
2383
|
-
requestedByActorType: opts.requestedByActorType ?? null,
|
|
2384
|
-
requestedByActorId: opts.requestedByActorId ?? null,
|
|
2385
|
-
idempotencyKey: opts.idempotencyKey ?? null,
|
|
2386
|
-
finishedAt: new Date(),
|
|
2387
|
-
});
|
|
2388
|
-
};
|
|
2389
|
-
let projectId = readNonEmptyString(enrichedContextSnapshot.projectId);
|
|
2390
|
-
if (!projectId && issueId) {
|
|
2391
|
-
projectId = await db
|
|
2392
|
-
.select({ projectId: issues.projectId })
|
|
2393
|
-
.from(issues)
|
|
2394
|
-
.where(and(eq(issues.id, issueId), eq(issues.companyId, agent.companyId)))
|
|
2395
|
-
.then((rows) => rows[0]?.projectId ?? null);
|
|
2396
|
-
}
|
|
2397
|
-
const budgetBlock = await budgets.getInvocationBlock(agent.companyId, agentId, {
|
|
2398
|
-
issueId,
|
|
2399
|
-
projectId,
|
|
2400
|
-
});
|
|
2401
|
-
if (budgetBlock) {
|
|
2402
|
-
await writeSkippedRequest("budget.blocked");
|
|
2403
|
-
throw conflict(budgetBlock.reason, {
|
|
2404
|
-
scopeType: budgetBlock.scopeType,
|
|
2405
|
-
scopeId: budgetBlock.scopeId,
|
|
2406
|
-
});
|
|
2407
|
-
}
|
|
2408
|
-
if (agent.status === "paused" ||
|
|
2409
|
-
agent.status === "terminated" ||
|
|
2410
|
-
agent.status === "pending_approval") {
|
|
2411
|
-
throw conflict("Agent is not invokable in its current state", { status: agent.status });
|
|
2412
|
-
}
|
|
2413
|
-
const policy = parseHeartbeatPolicy(agent);
|
|
2414
|
-
if (source === "timer" && !policy.enabled) {
|
|
2415
|
-
await writeSkippedRequest("heartbeat.disabled");
|
|
2416
|
-
return null;
|
|
2417
|
-
}
|
|
2418
|
-
if (source === "assignment" && !policy.wakeOnAssignment) {
|
|
2419
|
-
await writeSkippedRequest("heartbeat.wakeOnAssignment.disabled");
|
|
2420
|
-
return null;
|
|
2421
|
-
}
|
|
2422
|
-
if (source === "automation" && !policy.wakeOnAutomation) {
|
|
2423
|
-
await writeSkippedRequest("heartbeat.wakeOnAutomation.disabled");
|
|
2424
|
-
return null;
|
|
2425
|
-
}
|
|
2426
|
-
if (source === "on_demand" && !policy.wakeOnDemand) {
|
|
2427
|
-
await writeSkippedRequest("heartbeat.wakeOnDemand.disabled");
|
|
2428
|
-
return null;
|
|
2429
|
-
}
|
|
2430
|
-
const bypassIssueExecutionLock = reason === "issue_comment_mentioned" ||
|
|
2431
|
-
readNonEmptyString(enrichedContextSnapshot.wakeReason) === "issue_comment_mentioned";
|
|
2432
|
-
if (issueId && !bypassIssueExecutionLock) {
|
|
2433
|
-
const agentNameKey = normalizeAgentNameKey(agent.name);
|
|
2434
|
-
const sessionBefore = await resolveSessionBeforeForWakeup(agent, taskKey);
|
|
2435
|
-
const outcome = await db.transaction(async (tx) => {
|
|
2436
|
-
await tx.execute(sql `select id from issues where id = ${issueId} and company_id = ${agent.companyId} for update`);
|
|
2437
|
-
const issue = await tx
|
|
2438
|
-
.select({
|
|
2439
|
-
id: issues.id,
|
|
2440
|
-
companyId: issues.companyId,
|
|
2441
|
-
executionRunId: issues.executionRunId,
|
|
2442
|
-
executionAgentNameKey: issues.executionAgentNameKey,
|
|
2443
|
-
})
|
|
2444
|
-
.from(issues)
|
|
2445
|
-
.where(and(eq(issues.id, issueId), eq(issues.companyId, agent.companyId)))
|
|
2446
|
-
.then((rows) => rows[0] ?? null);
|
|
2447
|
-
if (!issue) {
|
|
2448
|
-
await tx.insert(agentWakeupRequests).values({
|
|
2449
|
-
companyId: agent.companyId,
|
|
2450
|
-
agentId,
|
|
2451
|
-
source,
|
|
2452
|
-
triggerDetail,
|
|
2453
|
-
reason: "issue_execution_issue_not_found",
|
|
2454
|
-
payload,
|
|
2455
|
-
status: "skipped",
|
|
2456
|
-
requestedByActorType: opts.requestedByActorType ?? null,
|
|
2457
|
-
requestedByActorId: opts.requestedByActorId ?? null,
|
|
2458
|
-
idempotencyKey: opts.idempotencyKey ?? null,
|
|
2459
|
-
finishedAt: new Date(),
|
|
2460
|
-
});
|
|
2461
|
-
return { kind: "skipped" };
|
|
2462
|
-
}
|
|
2463
|
-
let activeExecutionRun = issue.executionRunId
|
|
2464
|
-
? await tx
|
|
2465
|
-
.select()
|
|
2466
|
-
.from(heartbeatRuns)
|
|
2467
|
-
.where(eq(heartbeatRuns.id, issue.executionRunId))
|
|
2468
|
-
.then((rows) => rows[0] ?? null)
|
|
2469
|
-
: null;
|
|
2470
|
-
if (activeExecutionRun && activeExecutionRun.status !== "queued" && activeExecutionRun.status !== "running") {
|
|
2471
|
-
activeExecutionRun = null;
|
|
2472
|
-
}
|
|
2473
|
-
if (!activeExecutionRun && issue.executionRunId) {
|
|
2474
|
-
await tx
|
|
2475
|
-
.update(issues)
|
|
2476
|
-
.set({
|
|
2477
|
-
executionRunId: null,
|
|
2478
|
-
executionAgentNameKey: null,
|
|
2479
|
-
executionLockedAt: null,
|
|
2480
|
-
updatedAt: new Date(),
|
|
2481
|
-
})
|
|
2482
|
-
.where(eq(issues.id, issue.id));
|
|
2483
|
-
}
|
|
2484
|
-
if (!activeExecutionRun) {
|
|
2485
|
-
const legacyRun = await tx
|
|
2486
|
-
.select()
|
|
2487
|
-
.from(heartbeatRuns)
|
|
2488
|
-
.where(and(eq(heartbeatRuns.companyId, issue.companyId), inArray(heartbeatRuns.status, ["queued", "running"]), sql `${heartbeatRuns.contextSnapshot} ->> 'issueId' = ${issue.id}`))
|
|
2489
|
-
.orderBy(sql `case when ${heartbeatRuns.status} = 'running' then 0 else 1 end`, asc(heartbeatRuns.createdAt))
|
|
2490
|
-
.limit(1)
|
|
2491
|
-
.then((rows) => rows[0] ?? null);
|
|
2492
|
-
if (legacyRun) {
|
|
2493
|
-
activeExecutionRun = legacyRun;
|
|
2494
|
-
const legacyAgent = await tx
|
|
2495
|
-
.select({ name: agents.name })
|
|
2496
|
-
.from(agents)
|
|
2497
|
-
.where(eq(agents.id, legacyRun.agentId))
|
|
2498
|
-
.then((rows) => rows[0] ?? null);
|
|
2499
|
-
await tx
|
|
2500
|
-
.update(issues)
|
|
2501
|
-
.set({
|
|
2502
|
-
executionRunId: legacyRun.id,
|
|
2503
|
-
executionAgentNameKey: normalizeAgentNameKey(legacyAgent?.name),
|
|
2504
|
-
executionLockedAt: new Date(),
|
|
2505
|
-
updatedAt: new Date(),
|
|
2506
|
-
})
|
|
2507
|
-
.where(eq(issues.id, issue.id));
|
|
2508
|
-
}
|
|
2509
|
-
}
|
|
2510
|
-
if (activeExecutionRun) {
|
|
2511
|
-
const executionAgent = await tx
|
|
2512
|
-
.select({ name: agents.name })
|
|
2513
|
-
.from(agents)
|
|
2514
|
-
.where(eq(agents.id, activeExecutionRun.agentId))
|
|
2515
|
-
.then((rows) => rows[0] ?? null);
|
|
2516
|
-
const executionAgentNameKey = normalizeAgentNameKey(issue.executionAgentNameKey) ??
|
|
2517
|
-
normalizeAgentNameKey(executionAgent?.name);
|
|
2518
|
-
const isSameExecutionAgent = Boolean(executionAgentNameKey) && executionAgentNameKey === agentNameKey;
|
|
2519
|
-
const shouldQueueFollowupForCommentWake = Boolean(wakeCommentId) &&
|
|
2520
|
-
activeExecutionRun.status === "running" &&
|
|
2521
|
-
isSameExecutionAgent;
|
|
2522
|
-
if (isSameExecutionAgent && !shouldQueueFollowupForCommentWake) {
|
|
2523
|
-
const mergedContextSnapshot = mergeCoalescedContextSnapshot(activeExecutionRun.contextSnapshot, enrichedContextSnapshot);
|
|
2524
|
-
const mergedRun = await tx
|
|
2525
|
-
.update(heartbeatRuns)
|
|
2526
|
-
.set({
|
|
2527
|
-
contextSnapshot: mergedContextSnapshot,
|
|
2528
|
-
updatedAt: new Date(),
|
|
2529
|
-
})
|
|
2530
|
-
.where(eq(heartbeatRuns.id, activeExecutionRun.id))
|
|
2531
|
-
.returning()
|
|
2532
|
-
.then((rows) => rows[0] ?? activeExecutionRun);
|
|
2533
|
-
await tx.insert(agentWakeupRequests).values({
|
|
2534
|
-
companyId: agent.companyId,
|
|
2535
|
-
agentId,
|
|
2536
|
-
source,
|
|
2537
|
-
triggerDetail,
|
|
2538
|
-
reason: "issue_execution_same_name",
|
|
2539
|
-
payload,
|
|
2540
|
-
status: "coalesced",
|
|
2541
|
-
coalescedCount: 1,
|
|
2542
|
-
requestedByActorType: opts.requestedByActorType ?? null,
|
|
2543
|
-
requestedByActorId: opts.requestedByActorId ?? null,
|
|
2544
|
-
idempotencyKey: opts.idempotencyKey ?? null,
|
|
2545
|
-
runId: mergedRun.id,
|
|
2546
|
-
finishedAt: new Date(),
|
|
2547
|
-
});
|
|
2548
|
-
return { kind: "coalesced", run: mergedRun };
|
|
2549
|
-
}
|
|
2550
|
-
const deferredPayload = {
|
|
2551
|
-
...(payload ?? {}),
|
|
2552
|
-
issueId,
|
|
2553
|
-
[DEFERRED_WAKE_CONTEXT_KEY]: enrichedContextSnapshot,
|
|
2554
|
-
};
|
|
2555
|
-
const existingDeferred = await tx
|
|
2556
|
-
.select()
|
|
2557
|
-
.from(agentWakeupRequests)
|
|
2558
|
-
.where(and(eq(agentWakeupRequests.companyId, agent.companyId), eq(agentWakeupRequests.agentId, agentId), eq(agentWakeupRequests.status, "deferred_issue_execution"), sql `${agentWakeupRequests.payload} ->> 'issueId' = ${issue.id}`))
|
|
2559
|
-
.orderBy(asc(agentWakeupRequests.requestedAt))
|
|
2560
|
-
.limit(1)
|
|
2561
|
-
.then((rows) => rows[0] ?? null);
|
|
2562
|
-
if (existingDeferred) {
|
|
2563
|
-
const existingDeferredPayload = parseObject(existingDeferred.payload);
|
|
2564
|
-
const existingDeferredContext = parseObject(existingDeferredPayload[DEFERRED_WAKE_CONTEXT_KEY]);
|
|
2565
|
-
const mergedDeferredContext = mergeCoalescedContextSnapshot(existingDeferredContext, enrichedContextSnapshot);
|
|
2566
|
-
const mergedDeferredPayload = {
|
|
2567
|
-
...existingDeferredPayload,
|
|
2568
|
-
...(payload ?? {}),
|
|
2569
|
-
issueId,
|
|
2570
|
-
[DEFERRED_WAKE_CONTEXT_KEY]: mergedDeferredContext,
|
|
2571
|
-
};
|
|
2572
|
-
await tx
|
|
2573
|
-
.update(agentWakeupRequests)
|
|
2574
|
-
.set({
|
|
2575
|
-
payload: mergedDeferredPayload,
|
|
2576
|
-
coalescedCount: (existingDeferred.coalescedCount ?? 0) + 1,
|
|
2577
|
-
updatedAt: new Date(),
|
|
2578
|
-
})
|
|
2579
|
-
.where(eq(agentWakeupRequests.id, existingDeferred.id));
|
|
2580
|
-
return { kind: "deferred" };
|
|
2581
|
-
}
|
|
2582
|
-
await tx.insert(agentWakeupRequests).values({
|
|
2583
|
-
companyId: agent.companyId,
|
|
2584
|
-
agentId,
|
|
2585
|
-
source,
|
|
2586
|
-
triggerDetail,
|
|
2587
|
-
reason: "issue_execution_deferred",
|
|
2588
|
-
payload: deferredPayload,
|
|
2589
|
-
status: "deferred_issue_execution",
|
|
2590
|
-
requestedByActorType: opts.requestedByActorType ?? null,
|
|
2591
|
-
requestedByActorId: opts.requestedByActorId ?? null,
|
|
2592
|
-
idempotencyKey: opts.idempotencyKey ?? null,
|
|
2593
|
-
});
|
|
2594
|
-
return { kind: "deferred" };
|
|
2595
|
-
}
|
|
2596
|
-
const wakeupRequest = await tx
|
|
2597
|
-
.insert(agentWakeupRequests)
|
|
2598
|
-
.values({
|
|
2599
|
-
companyId: agent.companyId,
|
|
2600
|
-
agentId,
|
|
2601
|
-
source,
|
|
2602
|
-
triggerDetail,
|
|
2603
|
-
reason,
|
|
2604
|
-
payload,
|
|
2605
|
-
status: "queued",
|
|
2606
|
-
requestedByActorType: opts.requestedByActorType ?? null,
|
|
2607
|
-
requestedByActorId: opts.requestedByActorId ?? null,
|
|
2608
|
-
idempotencyKey: opts.idempotencyKey ?? null,
|
|
2609
|
-
})
|
|
2610
|
-
.returning()
|
|
2611
|
-
.then((rows) => rows[0]);
|
|
2612
|
-
const newRun = await tx
|
|
2613
|
-
.insert(heartbeatRuns)
|
|
2614
|
-
.values({
|
|
2615
|
-
companyId: agent.companyId,
|
|
2616
|
-
agentId,
|
|
2617
|
-
invocationSource: source,
|
|
2618
|
-
triggerDetail,
|
|
2619
|
-
status: "queued",
|
|
2620
|
-
wakeupRequestId: wakeupRequest.id,
|
|
2621
|
-
contextSnapshot: enrichedContextSnapshot,
|
|
2622
|
-
sessionIdBefore: sessionBefore,
|
|
2623
|
-
})
|
|
2624
|
-
.returning()
|
|
2625
|
-
.then((rows) => rows[0]);
|
|
2626
|
-
await tx
|
|
2627
|
-
.update(agentWakeupRequests)
|
|
2628
|
-
.set({
|
|
2629
|
-
runId: newRun.id,
|
|
2630
|
-
updatedAt: new Date(),
|
|
2631
|
-
})
|
|
2632
|
-
.where(eq(agentWakeupRequests.id, wakeupRequest.id));
|
|
2633
|
-
await tx
|
|
2634
|
-
.update(issues)
|
|
2635
|
-
.set({
|
|
2636
|
-
executionRunId: newRun.id,
|
|
2637
|
-
executionAgentNameKey: agentNameKey,
|
|
2638
|
-
executionLockedAt: new Date(),
|
|
2639
|
-
updatedAt: new Date(),
|
|
2640
|
-
})
|
|
2641
|
-
.where(eq(issues.id, issue.id));
|
|
2642
|
-
return { kind: "queued", run: newRun };
|
|
2643
|
-
});
|
|
2644
|
-
if (outcome.kind === "deferred" || outcome.kind === "skipped")
|
|
2645
|
-
return null;
|
|
2646
|
-
if (outcome.kind === "coalesced")
|
|
2647
|
-
return outcome.run;
|
|
2648
|
-
const newRun = outcome.run;
|
|
2649
|
-
publishLiveEvent({
|
|
2650
|
-
companyId: newRun.companyId,
|
|
2651
|
-
type: "heartbeat.run.queued",
|
|
2652
|
-
payload: {
|
|
2653
|
-
runId: newRun.id,
|
|
2654
|
-
agentId: newRun.agentId,
|
|
2655
|
-
invocationSource: newRun.invocationSource,
|
|
2656
|
-
triggerDetail: newRun.triggerDetail,
|
|
2657
|
-
wakeupRequestId: newRun.wakeupRequestId,
|
|
2658
|
-
},
|
|
2659
|
-
});
|
|
2660
|
-
await startNextQueuedRunForAgent(agent.id);
|
|
2661
|
-
return newRun;
|
|
2662
|
-
}
|
|
2663
|
-
const activeRuns = await db
|
|
2664
|
-
.select()
|
|
2665
|
-
.from(heartbeatRuns)
|
|
2666
|
-
.where(and(eq(heartbeatRuns.agentId, agentId), inArray(heartbeatRuns.status, ["queued", "running"])))
|
|
2667
|
-
.orderBy(desc(heartbeatRuns.createdAt));
|
|
2668
|
-
const sameScopeQueuedRun = activeRuns.find((candidate) => candidate.status === "queued" && isSameTaskScope(runTaskKey(candidate), taskKey));
|
|
2669
|
-
const sameScopeRunningRun = activeRuns.find((candidate) => candidate.status === "running" && isSameTaskScope(runTaskKey(candidate), taskKey));
|
|
2670
|
-
const shouldQueueFollowupForCommentWake = Boolean(wakeCommentId) && Boolean(sameScopeRunningRun) && !sameScopeQueuedRun;
|
|
2671
|
-
const coalescedTargetRun = sameScopeQueuedRun ??
|
|
2672
|
-
(shouldQueueFollowupForCommentWake ? null : sameScopeRunningRun ?? null);
|
|
2673
|
-
if (coalescedTargetRun) {
|
|
2674
|
-
const mergedContextSnapshot = mergeCoalescedContextSnapshot(coalescedTargetRun.contextSnapshot, contextSnapshot);
|
|
2675
|
-
const mergedRun = await db
|
|
2676
|
-
.update(heartbeatRuns)
|
|
2677
|
-
.set({
|
|
2678
|
-
contextSnapshot: mergedContextSnapshot,
|
|
2679
|
-
updatedAt: new Date(),
|
|
2680
|
-
})
|
|
2681
|
-
.where(eq(heartbeatRuns.id, coalescedTargetRun.id))
|
|
2682
|
-
.returning()
|
|
2683
|
-
.then((rows) => rows[0] ?? coalescedTargetRun);
|
|
2684
|
-
await db.insert(agentWakeupRequests).values({
|
|
2685
|
-
companyId: agent.companyId,
|
|
2686
|
-
agentId,
|
|
2687
|
-
source,
|
|
2688
|
-
triggerDetail,
|
|
2689
|
-
reason,
|
|
2690
|
-
payload,
|
|
2691
|
-
status: "coalesced",
|
|
2692
|
-
coalescedCount: 1,
|
|
2693
|
-
requestedByActorType: opts.requestedByActorType ?? null,
|
|
2694
|
-
requestedByActorId: opts.requestedByActorId ?? null,
|
|
2695
|
-
idempotencyKey: opts.idempotencyKey ?? null,
|
|
2696
|
-
runId: mergedRun.id,
|
|
2697
|
-
finishedAt: new Date(),
|
|
2698
|
-
});
|
|
2699
|
-
return mergedRun;
|
|
2700
|
-
}
|
|
2701
|
-
const wakeupRequest = await db
|
|
2702
|
-
.insert(agentWakeupRequests)
|
|
2703
|
-
.values({
|
|
2704
|
-
companyId: agent.companyId,
|
|
2705
|
-
agentId,
|
|
2706
|
-
source,
|
|
2707
|
-
triggerDetail,
|
|
2708
|
-
reason,
|
|
2709
|
-
payload,
|
|
2710
|
-
status: "queued",
|
|
2711
|
-
requestedByActorType: opts.requestedByActorType ?? null,
|
|
2712
|
-
requestedByActorId: opts.requestedByActorId ?? null,
|
|
2713
|
-
idempotencyKey: opts.idempotencyKey ?? null,
|
|
2714
|
-
})
|
|
2715
|
-
.returning()
|
|
2716
|
-
.then((rows) => rows[0]);
|
|
2717
|
-
const sessionBefore = await resolveSessionBeforeForWakeup(agent, taskKey);
|
|
2718
|
-
const newRun = await db
|
|
2719
|
-
.insert(heartbeatRuns)
|
|
2720
|
-
.values({
|
|
2721
|
-
companyId: agent.companyId,
|
|
2722
|
-
agentId,
|
|
2723
|
-
invocationSource: source,
|
|
2724
|
-
triggerDetail,
|
|
2725
|
-
status: "queued",
|
|
2726
|
-
wakeupRequestId: wakeupRequest.id,
|
|
2727
|
-
contextSnapshot: enrichedContextSnapshot,
|
|
2728
|
-
sessionIdBefore: sessionBefore,
|
|
2729
|
-
})
|
|
2730
|
-
.returning()
|
|
2731
|
-
.then((rows) => rows[0]);
|
|
2732
|
-
await db
|
|
2733
|
-
.update(agentWakeupRequests)
|
|
2734
|
-
.set({
|
|
2735
|
-
runId: newRun.id,
|
|
2736
|
-
updatedAt: new Date(),
|
|
2737
|
-
})
|
|
2738
|
-
.where(eq(agentWakeupRequests.id, wakeupRequest.id));
|
|
2739
|
-
publishLiveEvent({
|
|
2740
|
-
companyId: newRun.companyId,
|
|
2741
|
-
type: "heartbeat.run.queued",
|
|
2742
|
-
payload: {
|
|
2743
|
-
runId: newRun.id,
|
|
2744
|
-
agentId: newRun.agentId,
|
|
2745
|
-
invocationSource: newRun.invocationSource,
|
|
2746
|
-
triggerDetail: newRun.triggerDetail,
|
|
2747
|
-
wakeupRequestId: newRun.wakeupRequestId,
|
|
2748
|
-
},
|
|
2749
|
-
});
|
|
2750
|
-
await startNextQueuedRunForAgent(agent.id);
|
|
2751
|
-
return newRun;
|
|
2752
|
-
}
|
|
2753
|
-
async function listProjectScopedRunIds(companyId, projectId) {
|
|
2754
|
-
const runIssueId = sql `${heartbeatRuns.contextSnapshot} ->> 'issueId'`;
|
|
2755
|
-
const effectiveProjectId = sql `coalesce(${heartbeatRuns.contextSnapshot} ->> 'projectId', ${issues.projectId}::text)`;
|
|
2756
|
-
const rows = await db
|
|
2757
|
-
.selectDistinctOn([heartbeatRuns.id], { id: heartbeatRuns.id })
|
|
2758
|
-
.from(heartbeatRuns)
|
|
2759
|
-
.leftJoin(issues, and(eq(issues.companyId, companyId), sql `${issues.id}::text = ${runIssueId}`))
|
|
2760
|
-
.where(and(eq(heartbeatRuns.companyId, companyId), inArray(heartbeatRuns.status, ["queued", "running"]), sql `${effectiveProjectId} = ${projectId}`));
|
|
2761
|
-
return rows.map((row) => row.id);
|
|
2762
|
-
}
|
|
2763
|
-
async function listProjectScopedWakeupIds(companyId, projectId) {
|
|
2764
|
-
const wakeIssueId = sql `${agentWakeupRequests.payload} ->> 'issueId'`;
|
|
2765
|
-
const effectiveProjectId = sql `coalesce(${agentWakeupRequests.payload} ->> 'projectId', ${issues.projectId}::text)`;
|
|
2766
|
-
const rows = await db
|
|
2767
|
-
.selectDistinctOn([agentWakeupRequests.id], { id: agentWakeupRequests.id })
|
|
2768
|
-
.from(agentWakeupRequests)
|
|
2769
|
-
.leftJoin(issues, and(eq(issues.companyId, companyId), sql `${issues.id}::text = ${wakeIssueId}`))
|
|
2770
|
-
.where(and(eq(agentWakeupRequests.companyId, companyId), inArray(agentWakeupRequests.status, ["queued", "deferred_issue_execution"]), sql `${agentWakeupRequests.runId} is null`, sql `${effectiveProjectId} = ${projectId}`));
|
|
2771
|
-
return rows.map((row) => row.id);
|
|
2772
|
-
}
|
|
2773
|
-
async function cancelPendingWakeupsForBudgetScope(scope) {
|
|
2774
|
-
const now = new Date();
|
|
2775
|
-
let wakeupIds = [];
|
|
2776
|
-
if (scope.scopeType === "company") {
|
|
2777
|
-
wakeupIds = await db
|
|
2778
|
-
.select({ id: agentWakeupRequests.id })
|
|
2779
|
-
.from(agentWakeupRequests)
|
|
2780
|
-
.where(and(eq(agentWakeupRequests.companyId, scope.companyId), inArray(agentWakeupRequests.status, ["queued", "deferred_issue_execution"]), sql `${agentWakeupRequests.runId} is null`))
|
|
2781
|
-
.then((rows) => rows.map((row) => row.id));
|
|
2782
|
-
}
|
|
2783
|
-
else if (scope.scopeType === "agent") {
|
|
2784
|
-
wakeupIds = await db
|
|
2785
|
-
.select({ id: agentWakeupRequests.id })
|
|
2786
|
-
.from(agentWakeupRequests)
|
|
2787
|
-
.where(and(eq(agentWakeupRequests.companyId, scope.companyId), eq(agentWakeupRequests.agentId, scope.scopeId), inArray(agentWakeupRequests.status, ["queued", "deferred_issue_execution"]), sql `${agentWakeupRequests.runId} is null`))
|
|
2788
|
-
.then((rows) => rows.map((row) => row.id));
|
|
2789
|
-
}
|
|
2790
|
-
else {
|
|
2791
|
-
wakeupIds = await listProjectScopedWakeupIds(scope.companyId, scope.scopeId);
|
|
2792
|
-
}
|
|
2793
|
-
if (wakeupIds.length === 0)
|
|
2794
|
-
return 0;
|
|
2795
|
-
await db
|
|
2796
|
-
.update(agentWakeupRequests)
|
|
2797
|
-
.set({
|
|
2798
|
-
status: "cancelled",
|
|
2799
|
-
finishedAt: now,
|
|
2800
|
-
error: "Cancelled due to budget pause",
|
|
2801
|
-
updatedAt: now,
|
|
2802
|
-
})
|
|
2803
|
-
.where(inArray(agentWakeupRequests.id, wakeupIds));
|
|
2804
|
-
return wakeupIds.length;
|
|
2805
|
-
}
|
|
2806
|
-
async function cancelRunInternal(runId, reason = "Cancelled by control plane") {
|
|
2807
|
-
const run = await getRun(runId);
|
|
2808
|
-
if (!run)
|
|
2809
|
-
throw notFound("Heartbeat run not found");
|
|
2810
|
-
if (run.status !== "running" && run.status !== "queued")
|
|
2811
|
-
return run;
|
|
2812
|
-
const running = runningProcesses.get(run.id);
|
|
2813
|
-
if (running) {
|
|
2814
|
-
running.child.kill("SIGTERM");
|
|
2815
|
-
const graceMs = Math.max(1, running.graceSec) * 1000;
|
|
2816
|
-
setTimeout(() => {
|
|
2817
|
-
if (!running.child.killed) {
|
|
2818
|
-
running.child.kill("SIGKILL");
|
|
2819
|
-
}
|
|
2820
|
-
}, graceMs);
|
|
2821
|
-
}
|
|
2822
|
-
const cancelled = await setRunStatus(run.id, "cancelled", {
|
|
2823
|
-
finishedAt: new Date(),
|
|
2824
|
-
error: reason,
|
|
2825
|
-
errorCode: "cancelled",
|
|
2826
|
-
});
|
|
2827
|
-
await setWakeupStatus(run.wakeupRequestId, "cancelled", {
|
|
2828
|
-
finishedAt: new Date(),
|
|
2829
|
-
error: reason,
|
|
2830
|
-
});
|
|
2831
|
-
if (cancelled) {
|
|
2832
|
-
await appendRunEvent(cancelled, 1, {
|
|
2833
|
-
eventType: "lifecycle",
|
|
2834
|
-
stream: "system",
|
|
2835
|
-
level: "warn",
|
|
2836
|
-
message: "run cancelled",
|
|
2837
|
-
});
|
|
2838
|
-
await releaseIssueExecutionAndPromote(cancelled);
|
|
2839
|
-
}
|
|
2840
|
-
runningProcesses.delete(run.id);
|
|
2841
|
-
await finalizeAgentStatus(run.agentId, "cancelled");
|
|
2842
|
-
await startNextQueuedRunForAgent(run.agentId);
|
|
2843
|
-
return cancelled;
|
|
2844
|
-
}
|
|
2845
|
-
async function cancelActiveForAgentInternal(agentId, reason = "Cancelled due to agent pause") {
|
|
2846
|
-
const runs = await db
|
|
2847
|
-
.select()
|
|
2848
|
-
.from(heartbeatRuns)
|
|
2849
|
-
.where(and(eq(heartbeatRuns.agentId, agentId), inArray(heartbeatRuns.status, ["queued", "running"])));
|
|
2850
|
-
for (const run of runs) {
|
|
2851
|
-
await setRunStatus(run.id, "cancelled", {
|
|
2852
|
-
finishedAt: new Date(),
|
|
2853
|
-
error: reason,
|
|
2854
|
-
errorCode: "cancelled",
|
|
2855
|
-
});
|
|
2856
|
-
await setWakeupStatus(run.wakeupRequestId, "cancelled", {
|
|
2857
|
-
finishedAt: new Date(),
|
|
2858
|
-
error: reason,
|
|
2859
|
-
});
|
|
2860
|
-
const running = runningProcesses.get(run.id);
|
|
2861
|
-
if (running) {
|
|
2862
|
-
running.child.kill("SIGTERM");
|
|
2863
|
-
runningProcesses.delete(run.id);
|
|
2864
|
-
}
|
|
2865
|
-
await releaseIssueExecutionAndPromote(run);
|
|
2866
|
-
}
|
|
2867
|
-
return runs.length;
|
|
2868
|
-
}
|
|
2869
|
-
async function cancelBudgetScopeWork(scope) {
|
|
2870
|
-
if (scope.scopeType === "agent") {
|
|
2871
|
-
await cancelActiveForAgentInternal(scope.scopeId, "Cancelled due to budget pause");
|
|
2872
|
-
await cancelPendingWakeupsForBudgetScope(scope);
|
|
2873
|
-
return;
|
|
2874
|
-
}
|
|
2875
|
-
const runIds = scope.scopeType === "company"
|
|
2876
|
-
? await db
|
|
2877
|
-
.select({ id: heartbeatRuns.id })
|
|
2878
|
-
.from(heartbeatRuns)
|
|
2879
|
-
.where(and(eq(heartbeatRuns.companyId, scope.companyId), inArray(heartbeatRuns.status, ["queued", "running"])))
|
|
2880
|
-
.then((rows) => rows.map((row) => row.id))
|
|
2881
|
-
: await listProjectScopedRunIds(scope.companyId, scope.scopeId);
|
|
2882
|
-
for (const runId of runIds) {
|
|
2883
|
-
await cancelRunInternal(runId, "Cancelled due to budget pause");
|
|
2884
|
-
}
|
|
2885
|
-
await cancelPendingWakeupsForBudgetScope(scope);
|
|
2886
|
-
}
|
|
2887
|
-
return {
|
|
2888
|
-
list: async (companyId, agentId, limit) => {
|
|
2889
|
-
const query = db
|
|
2890
|
-
.select(heartbeatRunListColumns)
|
|
2891
|
-
.from(heartbeatRuns)
|
|
2892
|
-
.where(agentId
|
|
2893
|
-
? and(eq(heartbeatRuns.companyId, companyId), eq(heartbeatRuns.agentId, agentId))
|
|
2894
|
-
: eq(heartbeatRuns.companyId, companyId))
|
|
2895
|
-
.orderBy(desc(heartbeatRuns.createdAt));
|
|
2896
|
-
const rows = limit ? await query.limit(limit) : await query;
|
|
2897
|
-
return rows.map((row) => ({
|
|
2898
|
-
...row,
|
|
2899
|
-
resultJson: summarizeHeartbeatRunResultJson(row.resultJson),
|
|
2900
|
-
}));
|
|
2901
|
-
},
|
|
2902
|
-
getRun,
|
|
2903
|
-
getRuntimeState: async (agentId) => {
|
|
2904
|
-
const state = await getRuntimeState(agentId);
|
|
2905
|
-
const agent = await getAgent(agentId);
|
|
2906
|
-
if (!agent)
|
|
2907
|
-
return null;
|
|
2908
|
-
const ensured = state ?? (await ensureRuntimeState(agent));
|
|
2909
|
-
const latestTaskSession = await db
|
|
2910
|
-
.select()
|
|
2911
|
-
.from(agentTaskSessions)
|
|
2912
|
-
.where(and(eq(agentTaskSessions.companyId, agent.companyId), eq(agentTaskSessions.agentId, agent.id)))
|
|
2913
|
-
.orderBy(desc(agentTaskSessions.updatedAt))
|
|
2914
|
-
.limit(1)
|
|
2915
|
-
.then((rows) => rows[0] ?? null);
|
|
2916
|
-
return {
|
|
2917
|
-
...ensured,
|
|
2918
|
-
sessionDisplayId: latestTaskSession?.sessionDisplayId ?? ensured.sessionId,
|
|
2919
|
-
sessionParamsJson: latestTaskSession?.sessionParamsJson ?? null,
|
|
2920
|
-
};
|
|
2921
|
-
},
|
|
2922
|
-
listTaskSessions: async (agentId) => {
|
|
2923
|
-
const agent = await getAgent(agentId);
|
|
2924
|
-
if (!agent)
|
|
2925
|
-
throw notFound("Agent not found");
|
|
2926
|
-
return db
|
|
2927
|
-
.select()
|
|
2928
|
-
.from(agentTaskSessions)
|
|
2929
|
-
.where(and(eq(agentTaskSessions.companyId, agent.companyId), eq(agentTaskSessions.agentId, agentId)))
|
|
2930
|
-
.orderBy(desc(agentTaskSessions.updatedAt), desc(agentTaskSessions.createdAt));
|
|
2931
|
-
},
|
|
2932
|
-
resetRuntimeSession: async (agentId, opts) => {
|
|
2933
|
-
const agent = await getAgent(agentId);
|
|
2934
|
-
if (!agent)
|
|
2935
|
-
throw notFound("Agent not found");
|
|
2936
|
-
await ensureRuntimeState(agent);
|
|
2937
|
-
const taskKey = readNonEmptyString(opts?.taskKey);
|
|
2938
|
-
const clearedTaskSessions = await clearTaskSessions(agent.companyId, agent.id, taskKey ? { taskKey, adapterType: agent.adapterType } : undefined);
|
|
2939
|
-
const runtimePatch = {
|
|
2940
|
-
sessionId: null,
|
|
2941
|
-
lastError: null,
|
|
2942
|
-
updatedAt: new Date(),
|
|
2943
|
-
};
|
|
2944
|
-
if (!taskKey) {
|
|
2945
|
-
runtimePatch.stateJson = {};
|
|
2946
|
-
}
|
|
2947
|
-
const updated = await db
|
|
2948
|
-
.update(agentRuntimeState)
|
|
2949
|
-
.set(runtimePatch)
|
|
2950
|
-
.where(eq(agentRuntimeState.agentId, agentId))
|
|
2951
|
-
.returning()
|
|
2952
|
-
.then((rows) => rows[0] ?? null);
|
|
2953
|
-
if (!updated)
|
|
2954
|
-
return null;
|
|
2955
|
-
return {
|
|
2956
|
-
...updated,
|
|
2957
|
-
sessionDisplayId: null,
|
|
2958
|
-
sessionParamsJson: null,
|
|
2959
|
-
clearedTaskSessions,
|
|
2960
|
-
};
|
|
2961
|
-
},
|
|
2962
|
-
listEvents: (runId, afterSeq = 0, limit = 200) => db
|
|
2963
|
-
.select()
|
|
2964
|
-
.from(heartbeatRunEvents)
|
|
2965
|
-
.where(and(eq(heartbeatRunEvents.runId, runId), gt(heartbeatRunEvents.seq, afterSeq)))
|
|
2966
|
-
.orderBy(asc(heartbeatRunEvents.seq))
|
|
2967
|
-
.limit(Math.max(1, Math.min(limit, 1000))),
|
|
2968
|
-
readLog: async (runId, opts) => {
|
|
2969
|
-
const run = await getRun(runId);
|
|
2970
|
-
if (!run)
|
|
2971
|
-
throw notFound("Heartbeat run not found");
|
|
2972
|
-
if (!run.logStore || !run.logRef)
|
|
2973
|
-
throw notFound("Run log not found");
|
|
2974
|
-
const result = await runLogStore.read({
|
|
2975
|
-
store: run.logStore,
|
|
2976
|
-
logRef: run.logRef,
|
|
2977
|
-
}, opts);
|
|
2978
|
-
return {
|
|
2979
|
-
runId,
|
|
2980
|
-
store: run.logStore,
|
|
2981
|
-
logRef: run.logRef,
|
|
2982
|
-
...result,
|
|
2983
|
-
content: redactCurrentUserText(result.content),
|
|
2984
|
-
};
|
|
2985
|
-
},
|
|
2986
|
-
invoke: async (agentId, source = "on_demand", contextSnapshot = {}, triggerDetail = "manual", actor) => enqueueWakeup(agentId, {
|
|
2987
|
-
source,
|
|
2988
|
-
triggerDetail,
|
|
2989
|
-
contextSnapshot,
|
|
2990
|
-
requestedByActorType: actor?.actorType,
|
|
2991
|
-
requestedByActorId: actor?.actorId ?? null,
|
|
2992
|
-
}),
|
|
2993
|
-
wakeup: enqueueWakeup,
|
|
2994
|
-
reportRunActivity: clearDetachedRunWarning,
|
|
2995
|
-
reapOrphanedRuns,
|
|
2996
|
-
resumeQueuedRuns,
|
|
2997
|
-
tickTimers: async (now = new Date()) => {
|
|
2998
|
-
const allAgents = await db.select().from(agents);
|
|
2999
|
-
let checked = 0;
|
|
3000
|
-
let enqueued = 0;
|
|
3001
|
-
let skipped = 0;
|
|
3002
|
-
for (const agent of allAgents) {
|
|
3003
|
-
if (agent.status === "paused" || agent.status === "terminated" || agent.status === "pending_approval")
|
|
3004
|
-
continue;
|
|
3005
|
-
const policy = parseHeartbeatPolicy(agent);
|
|
3006
|
-
if (!policy.enabled || policy.intervalSec <= 0)
|
|
3007
|
-
continue;
|
|
3008
|
-
checked += 1;
|
|
3009
|
-
const baseline = new Date(agent.lastHeartbeatAt ?? agent.createdAt).getTime();
|
|
3010
|
-
const elapsedMs = now.getTime() - baseline;
|
|
3011
|
-
if (elapsedMs < policy.intervalSec * 1000)
|
|
3012
|
-
continue;
|
|
3013
|
-
const run = await enqueueWakeup(agent.id, {
|
|
3014
|
-
source: "timer",
|
|
3015
|
-
triggerDetail: "system",
|
|
3016
|
-
reason: "heartbeat_timer",
|
|
3017
|
-
requestedByActorType: "system",
|
|
3018
|
-
requestedByActorId: "heartbeat_scheduler",
|
|
3019
|
-
contextSnapshot: {
|
|
3020
|
-
source: "scheduler",
|
|
3021
|
-
reason: "interval_elapsed",
|
|
3022
|
-
now: now.toISOString(),
|
|
3023
|
-
},
|
|
3024
|
-
});
|
|
3025
|
-
if (run)
|
|
3026
|
-
enqueued += 1;
|
|
3027
|
-
else
|
|
3028
|
-
skipped += 1;
|
|
3029
|
-
}
|
|
3030
|
-
return { checked, enqueued, skipped };
|
|
3031
|
-
},
|
|
3032
|
-
cancelRun: (runId) => cancelRunInternal(runId),
|
|
3033
|
-
cancelActiveForAgent: (agentId) => cancelActiveForAgentInternal(agentId),
|
|
3034
|
-
cancelBudgetScopeWork,
|
|
3035
|
-
getActiveRunForAgent: async (agentId) => {
|
|
3036
|
-
const [run] = await db
|
|
3037
|
-
.select()
|
|
3038
|
-
.from(heartbeatRuns)
|
|
3039
|
-
.where(and(eq(heartbeatRuns.agentId, agentId), eq(heartbeatRuns.status, "running")))
|
|
3040
|
-
.orderBy(desc(heartbeatRuns.startedAt))
|
|
3041
|
-
.limit(1);
|
|
3042
|
-
return run ?? null;
|
|
3043
|
-
},
|
|
3044
|
-
};
|
|
3045
|
-
}
|
|
3046
|
-
//# sourceMappingURL=heartbeat.js.map
|