@beeuni/sdk 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -92
- package/dist/beeuni.esm.min.js +36 -34
- package/dist/beeuni.global.js +36 -34
- package/dist/browser/cache/idb-sync-cache.js +15 -5
- package/dist/browser/session-sync/server-transcript-mirror.d.ts +7 -1
- package/dist/browser/session-sync/server-transcript-mirror.js +30 -24
- package/dist/browser/session-sync/session-sync-registry.d.ts +3 -1
- package/dist/browser/session-sync/session-sync-registry.js +48 -3
- package/dist/browser/stores/sync-store/keep-unchanged.d.ts +4 -0
- package/dist/browser/stores/sync-store/keep-unchanged.js +34 -0
- package/dist/browser/stores/sync-store.d.ts +7 -0
- package/dist/browser/stores/sync-store.js +122 -35
- package/dist/core/attachments/prompt-attachments.d.ts +4 -0
- package/dist/core/attachments/prompt-attachments.js +34 -0
- package/dist/core/capture/rules.d.ts +17 -0
- package/dist/core/capture/rules.js +27 -0
- package/dist/core/client/beeuni.d.ts +99 -34
- package/dist/core/client/beeuni.js +5 -11
- package/dist/core/client/capture.d.ts +105 -0
- package/dist/core/client/capture.js +48 -0
- package/dist/core/client/facade-catalog.d.ts +0 -4
- package/dist/core/client/facade-catalog.js +1 -5
- package/dist/core/client/facade-identity.d.ts +1 -0
- package/dist/core/client/facade-identity.js +1 -0
- package/dist/core/client/project-access-resources.d.ts +3 -1
- package/dist/core/client/project-access-resources.js +1 -1
- package/dist/core/client/project-connections.d.ts +2 -2
- package/dist/core/client/project-connections.js +2 -2
- package/dist/core/client/project-operations-admin.d.ts +4 -4
- package/dist/core/client/project-operations-review.d.ts +2 -3
- package/dist/core/client/project-operations-review.js +1 -0
- package/dist/core/client/project-operations-workspace.d.ts +4 -4
- package/dist/core/client/project-operations-workspace.js +1 -1
- package/dist/core/client/project-operations.d.ts +9 -19
- package/dist/core/client/project-operations.js +2 -6
- package/dist/core/client/project-platform-security.d.ts +1 -1
- package/dist/core/client/project-platform-settings.d.ts +1 -1
- package/dist/core/client/session-context.d.ts +2 -0
- package/dist/core/client/session-handle.d.ts +13 -0
- package/dist/core/client/session-lifecycle-resources.d.ts +11 -0
- package/dist/core/client/session-lifecycle-resources.js +4 -0
- package/dist/core/client/session-lifecycle-security.d.ts +2 -0
- package/dist/core/client/session-lifecycle-security.js +1 -0
- package/dist/core/client/session-readiness.d.ts +2 -0
- package/dist/core/client/session-readiness.js +20 -1
- package/dist/core/http/api-client.d.ts +1 -7
- package/dist/core/http/api-client.js +2 -37
- package/dist/core/http/auth.d.ts +2 -4
- package/dist/core/http/auth.js +2 -8
- package/dist/core/http/config.d.ts +2 -0
- package/dist/core/http/response-error.js +26 -11
- package/dist/core/http/transport.js +6 -1
- package/dist/core/models/composer-model.d.ts +14 -0
- package/dist/core/models/composer-model.js +21 -1
- package/dist/core/rest/platform-client/capture.d.ts +363 -0
- package/dist/core/rest/platform-client/capture.js +116 -0
- package/dist/core/rest/platform-client/client-policy.d.ts +8 -0
- package/dist/core/rest/platform-client/client-policy.js +30 -0
- package/dist/core/rest/platform-client/index.d.ts +4 -4
- package/dist/core/rest/platform-client/index.js +4 -4
- package/dist/core/rest/platform-client/lifecycle.js +18 -12
- package/dist/core/rest/platform-client/shared.d.ts +5 -0
- package/dist/core/rest/platform-client/shared.js +18 -0
- package/dist/core/rest/platform-client/types.d.ts +1 -1
- package/dist/core/rest/projects-client/account-secret-resources.d.ts +2 -1
- package/dist/core/rest/projects-client/accounts.d.ts +34 -0
- package/dist/core/rest/projects-client/accounts.js +10 -0
- package/dist/core/rest/projects-client/admin-providers.d.ts +0 -61
- package/dist/core/rest/projects-client/admin-providers.js +0 -6
- package/dist/core/rest/projects-client/agent-config.d.ts +3 -0
- package/dist/core/rest/projects-client/apps-fleet.d.ts +5 -1
- package/dist/core/rest/projects-client/apps-fleet.js +2 -2
- package/dist/core/rest/projects-client/apps.d.ts +11 -1
- package/dist/core/rest/projects-client/change-requests.d.ts +2 -0
- package/dist/core/rest/projects-client/change-requests.js +2 -0
- package/dist/core/rest/projects-client/connectors.d.ts +13 -55
- package/dist/core/rest/projects-client/connectors.js +5 -29
- package/dist/core/rest/projects-client/files.d.ts +3 -0
- package/dist/core/rest/projects-client/files.js +4 -0
- package/dist/core/rest/projects-client/gateway.d.ts +5 -0
- package/dist/core/rest/projects-client/git-backend.d.ts +1 -10
- package/dist/core/rest/projects-client/git-backend.js +0 -10
- package/dist/core/rest/projects-client/iam-actions.d.ts +76 -0
- package/dist/core/rest/projects-client/iam-actions.js +101 -0
- package/dist/core/rest/projects-client/iam-sso.d.ts +0 -10
- package/dist/core/rest/projects-client/iam-sso.js +0 -3
- package/dist/core/rest/projects-client/iam.d.ts +1 -0
- package/dist/core/rest/projects-client/iam.js +1 -0
- package/dist/core/rest/projects-client/index.d.ts +1 -4
- package/dist/core/rest/projects-client/index.js +1 -4
- package/dist/core/rest/projects-client/notifications.d.ts +1 -1
- package/dist/core/rest/projects-client/notifications.js +4 -0
- package/dist/core/rest/projects-client/projects.d.ts +4 -2
- package/dist/core/rest/projects-client/projects.js +4 -2
- package/dist/core/rest/projects-client/review-items.d.ts +2 -0
- package/dist/core/rest/projects-client/review-items.js +4 -0
- package/dist/core/rest/projects-client/review.d.ts +17 -3
- package/dist/core/rest/projects-client/review.js +11 -0
- package/dist/core/rest/projects-client/sandbox.d.ts +8 -9
- package/dist/core/rest/projects-client/secrets.d.ts +3 -0
- package/dist/core/rest/projects-client/session-attachments.js +14 -1
- package/dist/core/rest/projects-client/session-sandbox.d.ts +1 -1
- package/dist/core/rest/projects-client/sessions.d.ts +31 -4
- package/dist/core/rest/projects-client/sessions.js +34 -4
- package/dist/core/runtime/runtime-rest-client.js +1 -1
- package/dist/core/runtime/runtime-types.d.ts +1 -0
- package/dist/core/session/control-stream.d.ts +1 -0
- package/dist/core/session/control-stream.js +18 -1
- package/dist/core/session/open-bundle.d.ts +4 -4
- package/dist/core/session/open-bundle.js +29 -46
- package/dist/core/session/turn-end-watch.d.ts +47 -0
- package/dist/core/session/turn-end-watch.js +141 -0
- package/dist/core/session-log/guard.d.ts +6 -0
- package/dist/core/session-log/guard.js +109 -0
- package/dist/core/session-log/index.d.ts +7 -0
- package/dist/core/session-log/index.js +5 -0
- package/dist/core/session-log/saved-log.d.ts +10 -0
- package/dist/core/session-log/saved-log.js +25 -0
- package/dist/core/session-log/source.d.ts +25 -0
- package/dist/core/session-log/source.js +30 -0
- package/dist/core/session-log/store.d.ts +21 -0
- package/dist/core/session-log/store.js +126 -0
- package/dist/core/session-log/tool-call.d.ts +11 -0
- package/dist/core/session-log/tool-call.js +65 -0
- package/dist/core/session-log/turns/blocks.d.ts +60 -0
- package/dist/core/session-log/turns/blocks.js +124 -0
- package/dist/core/session-log/turns/history.d.ts +32 -0
- package/dist/core/session-log/turns/history.js +99 -0
- package/dist/core/session-log/turns/index.d.ts +4 -0
- package/dist/core/session-log/turns/index.js +4 -0
- package/dist/core/session-log/turns/metrics.d.ts +21 -0
- package/dist/core/session-log/turns/metrics.js +29 -0
- package/dist/core/session-log/turns/turn.d.ts +55 -0
- package/dist/core/session-log/turns/turn.js +279 -0
- package/dist/core/session-log/turns/v1-parts.d.ts +8 -0
- package/dist/core/session-log/turns/v1-parts.js +43 -0
- package/dist/core/session-log/types.d.ts +264 -0
- package/dist/core/session-log/types.js +6 -0
- package/dist/core/session-log/v1-view.d.ts +13 -0
- package/dist/core/session-log/v1-view.js +215 -0
- package/dist/core/session-log/v1.d.ts +31 -0
- package/dist/core/session-log/v1.js +473 -0
- package/dist/core/session-sync/copy-store-types.d.ts +19 -0
- package/dist/core/session-sync/copy-store-types.js +1 -0
- package/dist/core/session-sync/saved-copy-store.js +25 -4
- package/dist/core/session-sync/saved-transcript.d.ts +15 -1
- package/dist/core/session-sync/saved-transcript.js +55 -0
- package/dist/core/session-sync/session-sync-controller.js +3 -0
- package/dist/core/stream/event-stream.js +2 -2
- package/dist/core/turns/classify.d.ts +2 -1
- package/dist/core/turns/classify.js +7 -3
- package/dist/core/turns/edit-blocks.d.ts +1 -0
- package/dist/core/turns/edit-blocks.js +15 -0
- package/dist/core/turns/parts.d.ts +3 -2
- package/dist/core/turns/parts.js +4 -2
- package/dist/core/turns/segments/burst-summary.d.ts +1 -0
- package/dist/core/turns/segments/burst-summary.js +24 -0
- package/dist/core/turns/segments/group-steps.d.ts +4 -3
- package/dist/core/turns/segments/group-steps.js +9 -6
- package/dist/core/turns/segments/index.d.ts +1 -0
- package/dist/core/turns/segments/index.js +1 -0
- package/dist/core/turns/segments/narration.d.ts +5 -4
- package/dist/core/turns/segments/narration.js +12 -3
- package/dist/core/turns/segments/session-activity-groups.d.ts +2 -1
- package/dist/core/turns/segments/session-activity-groups.js +3 -1
- package/dist/core/turns/segments/step-label.d.ts +2 -1
- package/dist/core/turns/segments/step-label.js +3 -1
- package/dist/core/turns/segments/work-split.d.ts +10 -0
- package/dist/core/turns/segments/work-split.js +40 -0
- package/dist/core/turns/segments/working-turn.d.ts +4 -2
- package/dist/core/turns/segments/working-turn.js +9 -8
- package/dist/core/turns/state.d.ts +2 -7
- package/dist/core/turns/state.js +28 -134
- package/dist/core/turns/tool-kind.d.ts +1 -1
- package/dist/core/turns/tool-kind.js +3 -2
- package/dist/core/turns/tool-registry.js +1 -0
- package/dist/core/turns/tools/tool-meta.d.ts +3 -2
- package/dist/core/turns/tools/tool-meta.js +5 -2
- package/dist/core/turns/tools/tool-outcome.d.ts +2 -1
- package/dist/core/turns/tools/tool-outcome.js +3 -1
- package/dist/core/turns/types.d.ts +1 -1
- package/dist/core/turns/view-model.js +1 -13
- package/dist/core/warm-session-pool.d.ts +29 -0
- package/dist/core/warm-session-pool.js +127 -0
- package/dist/genui/catalog.d.ts +28 -0
- package/dist/genui/catalog.js +396 -0
- package/dist/genui/expansion.d.ts +3 -0
- package/dist/genui/expansion.js +295 -0
- package/dist/genui/fence-entry.d.ts +2 -0
- package/dist/genui/fence-entry.js +1 -0
- package/dist/genui/fence.d.ts +21 -0
- package/dist/genui/fence.js +138 -0
- package/dist/genui/index.d.ts +6 -0
- package/dist/genui/index.js +6 -0
- package/dist/genui/markdown.d.ts +12 -0
- package/dist/genui/markdown.js +104 -0
- package/dist/genui/parse.d.ts +6 -0
- package/dist/genui/parse.js +75 -0
- package/dist/genui/prompt.d.ts +2 -0
- package/dist/genui/prompt.js +206 -0
- package/dist/genui/react/default-components.d.ts +2 -0
- package/dist/genui/react/default-components.js +72 -0
- package/dist/genui/react/default-components.test.d.ts +1 -0
- package/dist/genui/react/default-components.test.js +94 -0
- package/dist/genui/react/genui-block-disabled.test.d.ts +1 -0
- package/dist/genui/react/genui-block-disabled.test.js +50 -0
- package/dist/genui/react/genui-block.d.ts +28 -0
- package/dist/genui/react/genui-block.js +91 -0
- package/dist/genui/react/genui-block.test.d.ts +1 -0
- package/dist/genui/react/genui-block.test.js +205 -0
- package/dist/genui/react/index.d.ts +2 -0
- package/dist/genui/react/index.js +2 -0
- package/dist/genui/share.d.ts +5 -0
- package/dist/genui/share.js +30 -0
- package/dist/genui/test-fixtures.d.ts +2 -0
- package/dist/genui/test-fixtures.js +16 -0
- package/dist/genui/types.d.ts +29 -0
- package/dist/genui/types.js +1 -0
- package/dist/genui/urls.d.ts +1 -0
- package/dist/genui/urls.js +18 -0
- package/dist/genui/validate.d.ts +9 -0
- package/dist/genui/validate.js +116 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/internal/connector-catalog.d.ts +48 -0
- package/dist/internal/connector-catalog.js +27 -0
- package/dist/internal/host-configuration.d.ts +22 -0
- package/dist/internal/host-configuration.js +28 -0
- package/dist/internal/platform-admin-react.d.ts +12 -0
- package/dist/internal/platform-admin-react.js +13 -0
- package/dist/internal/platform-admin.d.ts +9 -0
- package/dist/internal/platform-admin.js +9 -0
- package/dist/platform/ui.d.ts +8 -2
- package/dist/platform/ui.js +19 -4
- package/dist/react/chat/use-chat-turns.d.ts +1 -1
- package/dist/react/human-presence.d.ts +9 -0
- package/dist/react/human-presence.js +12 -0
- package/dist/react/index.d.ts +4 -13
- package/dist/react/index.js +4 -13
- package/dist/react/opencode.d.ts +1 -0
- package/dist/react/opencode.js +1 -0
- package/dist/react/query-contracts.d.ts +6 -0
- package/dist/react/query-contracts.js +6 -0
- package/dist/react/query-keys.d.ts +17 -2
- package/dist/react/query-keys.js +24 -2
- package/dist/react/reset-identity-state.js +2 -0
- package/dist/react/session-cache-write.d.ts +1 -0
- package/dist/react/session-cache-write.js +20 -0
- package/dist/react/session-transcript-subscription.js +3 -1
- package/dist/react/sign-in-with-beeuni.d.ts +6 -6
- package/dist/react/turn-end-handoff.d.ts +13 -0
- package/dist/react/turn-end-handoff.js +101 -0
- package/dist/react/use-admin-providers.d.ts +3 -6
- package/dist/react/use-admin-providers.js +1 -11
- package/dist/react/use-capture.d.ts +47 -0
- package/dist/react/use-capture.js +173 -0
- package/dist/react/use-feature-flag.js +1 -0
- package/dist/react/use-opencode-events/handle-event.d.ts +1 -0
- package/dist/react/use-opencode-events/handle-event.js +5 -0
- package/dist/react/use-opencode-events/handle-interaction-event.js +8 -3
- package/dist/react/use-opencode-events/handle-session-event.js +13 -8
- package/dist/react/use-opencode-events/handler-context.d.ts +1 -0
- package/dist/react/use-opencode-events/helpers.d.ts +1 -0
- package/dist/react/use-opencode-events/helpers.js +11 -1
- package/dist/react/use-opencode-events/index.js +1 -0
- package/dist/react/use-opencode-local.d.ts +5 -1
- package/dist/react/use-opencode-local.js +15 -2
- package/dist/react/use-opencode-sessions/commands.d.ts +11 -1
- package/dist/react/use-opencode-sessions/commands.js +21 -1
- package/dist/react/use-opencode-sessions/permissions.js +28 -1
- package/dist/react/use-project-sessions.d.ts +1 -1
- package/dist/react/use-project-sessions.js +6 -5
- package/dist/react/use-prompt-attachments.js +1 -0
- package/dist/react/use-review-summary.d.ts +13 -0
- package/dist/react/use-review-summary.js +32 -0
- package/dist/react/use-runtime-reconnect.js +1 -1
- package/dist/react/use-session-list-state.d.ts +6 -0
- package/dist/react/use-session-list-state.js +33 -0
- package/dist/react/use-session-log.d.ts +16 -0
- package/dist/react/use-session-log.js +143 -0
- package/dist/react/use-session-messages.d.ts +2 -1
- package/dist/react/use-session-messages.js +15 -14
- package/dist/react/use-session-stream.js +12 -1
- package/dist/react/use-session-sync.d.ts +2 -2
- package/dist/react/use-session-sync.js +10 -8
- package/dist/react/use-session-transcript-history.js +2 -12
- package/dist/react/use-session-working.d.ts +2 -0
- package/dist/react/use-session-working.js +10 -0
- package/dist/react/use-session.d.ts +6 -0
- package/dist/react/use-session.js +88 -6
- package/package.json +62 -8
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { reviewItemTarget } from './review-items.js';
|
|
2
|
+
export const PROJECT_ACTIONS = {
|
|
3
|
+
PROJECT_READ: 'project.read',
|
|
4
|
+
PROJECT_WRITE: 'project.write',
|
|
5
|
+
PROJECT_DELETE: 'project.delete',
|
|
6
|
+
PROJECT_SESSION_READ: 'project.session.read',
|
|
7
|
+
PROJECT_SESSION_START: 'project.session.start',
|
|
8
|
+
PROJECT_SESSION_STOP: 'project.session.stop',
|
|
9
|
+
PROJECT_SESSION_BINDINGS_WRITE: 'project.session.bindings.write',
|
|
10
|
+
PROJECT_MEMBERS_READ: 'project.members.read',
|
|
11
|
+
PROJECT_MEMBERS_MANAGE: 'project.members.manage',
|
|
12
|
+
PROJECT_TRIGGER_READ: 'project.trigger.read',
|
|
13
|
+
PROJECT_TRIGGER_CREATE: 'project.trigger.create',
|
|
14
|
+
PROJECT_TRIGGER_UPDATE: 'project.trigger.update',
|
|
15
|
+
PROJECT_TRIGGER_DELETE: 'project.trigger.delete',
|
|
16
|
+
PROJECT_TRIGGER_FIRE: 'project.trigger.fire',
|
|
17
|
+
PROJECT_GATEWAY_LOGS_READ: 'project.gateway.logs.read',
|
|
18
|
+
PROJECT_GATEWAY_SPEND_READ: 'project.gateway.spend.read',
|
|
19
|
+
PROJECT_USAGE_READ: 'project.usage.read',
|
|
20
|
+
PROJECT_GATEWAY_BUDGET_SET: 'project.gateway.budget.set',
|
|
21
|
+
PROJECT_GATEWAY_KEYS_MANAGE: 'project.gateway.keys.manage',
|
|
22
|
+
PROJECT_AGENT_READ: 'project.agent.read',
|
|
23
|
+
PROJECT_AGENT_WRITE: 'project.agent.write',
|
|
24
|
+
PROJECT_SKILL_READ: 'project.skill.read',
|
|
25
|
+
PROJECT_SKILL_WRITE: 'project.skill.write',
|
|
26
|
+
PROJECT_COMMAND_READ: 'project.command.read',
|
|
27
|
+
PROJECT_COMMAND_WRITE: 'project.command.write',
|
|
28
|
+
PROJECT_FILE_READ: 'project.file.read',
|
|
29
|
+
PROJECT_FILE_WRITE: 'project.file.write',
|
|
30
|
+
PROJECT_SETTINGS_WRITE: 'project.settings.write',
|
|
31
|
+
PROJECT_SANDBOX_WRITE: 'project.sandbox.write',
|
|
32
|
+
PROJECT_MODEL_READ: 'project.model.read',
|
|
33
|
+
PROJECT_MODEL_WRITE: 'project.model.write',
|
|
34
|
+
PROJECT_GITOPS_READ: 'project.gitops.read',
|
|
35
|
+
PROJECT_GITOPS_PUSH: 'project.gitops.push',
|
|
36
|
+
PROJECT_GITOPS_MERGE: 'project.gitops.merge',
|
|
37
|
+
PROJECT_GITOPS_REF_ANY: 'project.gitops.ref.any',
|
|
38
|
+
PROJECT_GITOPS_REF_DELETE: 'project.gitops.ref.delete',
|
|
39
|
+
PROJECT_SECRET_READ: 'project.secret.read',
|
|
40
|
+
PROJECT_SECRET_WRITE: 'project.secret.write',
|
|
41
|
+
PROJECT_CONNECTOR_READ: 'project.connector.read',
|
|
42
|
+
PROJECT_CONNECTOR_CONNECTIONS_MANAGE: 'project.connector.connections.manage',
|
|
43
|
+
PROJECT_CONNECTOR_WRITE: 'project.connector.write',
|
|
44
|
+
PROJECT_APP_READ: 'project.app.read',
|
|
45
|
+
PROJECT_APP_WRITE: 'project.app.write',
|
|
46
|
+
PROJECT_APP_DEPLOY: 'project.app.deploy',
|
|
47
|
+
PROJECT_APP_ADMIN: 'project.app.admin',
|
|
48
|
+
PROJECT_REVIEW_READ: 'project.review.read',
|
|
49
|
+
PROJECT_REVIEW_SUBMIT: 'project.review.submit',
|
|
50
|
+
PROJECT_REVIEW_ACT: 'project.review.act',
|
|
51
|
+
PROJECT_CREDENTIALS_ISSUE: 'project.credentials.issue',
|
|
52
|
+
};
|
|
53
|
+
export const TRIGGER_CONTROL_ACTIONS = [
|
|
54
|
+
PROJECT_ACTIONS.PROJECT_WRITE,
|
|
55
|
+
PROJECT_ACTIONS.PROJECT_TRIGGER_CREATE,
|
|
56
|
+
PROJECT_ACTIONS.PROJECT_TRIGGER_FIRE,
|
|
57
|
+
PROJECT_ACTIONS.PROJECT_TRIGGER_UPDATE,
|
|
58
|
+
PROJECT_ACTIONS.PROJECT_TRIGGER_DELETE,
|
|
59
|
+
];
|
|
60
|
+
export function triggerControlsFrom(cans) {
|
|
61
|
+
const allowed = (action) => cans[action]?.allowed === true;
|
|
62
|
+
const write = allowed(PROJECT_ACTIONS.PROJECT_WRITE);
|
|
63
|
+
return {
|
|
64
|
+
canCreate: write && allowed(PROJECT_ACTIONS.PROJECT_TRIGGER_CREATE),
|
|
65
|
+
canFire: allowed(PROJECT_ACTIONS.PROJECT_TRIGGER_FIRE),
|
|
66
|
+
canUpdate: write && allowed(PROJECT_ACTIONS.PROJECT_TRIGGER_UPDATE),
|
|
67
|
+
canDelete: write && allowed(PROJECT_ACTIONS.PROJECT_TRIGGER_DELETE),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
export const REVIEW_CONTROL_ACTIONS = [
|
|
71
|
+
PROJECT_ACTIONS.PROJECT_WRITE,
|
|
72
|
+
PROJECT_ACTIONS.PROJECT_GITOPS_PUSH,
|
|
73
|
+
PROJECT_ACTIONS.PROJECT_GITOPS_MERGE,
|
|
74
|
+
PROJECT_ACTIONS.PROJECT_REVIEW_ACT,
|
|
75
|
+
];
|
|
76
|
+
export function changeRequestControlsFrom(cans) {
|
|
77
|
+
const allowed = (action) => cans[action]?.allowed === true;
|
|
78
|
+
const write = allowed(PROJECT_ACTIONS.PROJECT_WRITE);
|
|
79
|
+
return {
|
|
80
|
+
canOpen: write && allowed(PROJECT_ACTIONS.PROJECT_GITOPS_PUSH),
|
|
81
|
+
canMerge: write && allowed(PROJECT_ACTIONS.PROJECT_GITOPS_MERGE),
|
|
82
|
+
canClose: write,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
export function reviewVerdictAllowed(item, verdict, cans) {
|
|
86
|
+
const target = reviewItemTarget(item.id);
|
|
87
|
+
if (target.type === 'connector_call') {
|
|
88
|
+
const call = item.kind === 'approval' ? item.detail.actions?.[0] : undefined;
|
|
89
|
+
return ((verdict === 'approve' || verdict === 'reject') &&
|
|
90
|
+
call?.canResolve !== false &&
|
|
91
|
+
call?.previewAuthorized !== false);
|
|
92
|
+
}
|
|
93
|
+
if (target.type === 'change_request') {
|
|
94
|
+
if (verdict === 'answer')
|
|
95
|
+
return false;
|
|
96
|
+
if (verdict === 'approve')
|
|
97
|
+
return changeRequestControlsFrom(cans).canMerge;
|
|
98
|
+
}
|
|
99
|
+
return (cans[PROJECT_ACTIONS.PROJECT_WRITE]?.allowed === true &&
|
|
100
|
+
cans[PROJECT_ACTIONS.PROJECT_REVIEW_ACT]?.allowed === true);
|
|
101
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export interface SsoProvider {
|
|
2
2
|
sso_provider_id: string;
|
|
3
|
-
supabase_sso_provider_id: string;
|
|
4
3
|
name: string;
|
|
5
4
|
primary_domain: string;
|
|
6
5
|
group_claim_name: string;
|
|
@@ -26,15 +25,6 @@ export interface SsoGroupMapping {
|
|
|
26
25
|
created_at: string;
|
|
27
26
|
}
|
|
28
27
|
export declare function getSsoProvider(accountId: string): Promise<SsoProvider | null>;
|
|
29
|
-
export declare function upsertSsoProvider(accountId: string, input: {
|
|
30
|
-
supabase_sso_provider_id: string;
|
|
31
|
-
name: string;
|
|
32
|
-
primary_domain: string;
|
|
33
|
-
group_claim_name?: string;
|
|
34
|
-
auto_create_members?: boolean;
|
|
35
|
-
auto_provision_groups?: boolean;
|
|
36
|
-
enforce_sso?: boolean;
|
|
37
|
-
}): Promise<SsoProvider>;
|
|
38
28
|
export declare function importSsoProviderFromMetadata(accountId: string, input: {
|
|
39
29
|
name: string;
|
|
40
30
|
primary_domain: string;
|
|
@@ -3,9 +3,6 @@ import { iamGet, iamUnwrap as unwrap } from './iam-shared.js';
|
|
|
3
3
|
export async function getSsoProvider(accountId) {
|
|
4
4
|
return unwrap(await iamGet(`/accounts/${accountId}/iam/sso/provider`)).provider;
|
|
5
5
|
}
|
|
6
|
-
export async function upsertSsoProvider(accountId, input) {
|
|
7
|
-
return unwrap(await backendApi.put(`/accounts/${accountId}/iam/sso/provider`, input, { showErrors: false })).provider;
|
|
8
|
-
}
|
|
9
6
|
export async function importSsoProviderFromMetadata(accountId, input) {
|
|
10
7
|
return unwrap(await backendApi.post(`/accounts/${accountId}/iam/sso/provider/from-metadata`, input, { showErrors: false })).provider;
|
|
11
8
|
}
|
|
@@ -30,8 +30,7 @@ export * from './referrals.js';
|
|
|
30
30
|
export * from './iam.js';
|
|
31
31
|
export * from './oauth-clients.js';
|
|
32
32
|
export * from './assignments.js';
|
|
33
|
-
export
|
|
34
|
-
export * from './admin-providers.js';
|
|
33
|
+
export { getAccountDeletionStatus, requestAccountDeletion, cancelAccountDeletion, deleteAccountImmediately, type AccountDeletionStatus, type AccountDeletionMutationResult, } from './account-lifecycle.js';
|
|
35
34
|
export * from './presentations.js';
|
|
36
35
|
export * from './review.js';
|
|
37
36
|
export * from './review-items.js';
|
|
@@ -49,7 +48,5 @@ export * from './drives.js';
|
|
|
49
48
|
export * from './notifications.js';
|
|
50
49
|
export type { AccountRole, ProjectRole, ConnectorSharing, ProjectGitConnection, ProjectFileEntry, } from './shared.js';
|
|
51
50
|
export * from './model-access.js';
|
|
52
|
-
export * from './provider-connections.js';
|
|
53
|
-
export * from './starter-suggestions.js';
|
|
54
51
|
export * from './session-attachments.js';
|
|
55
52
|
export * from './project-agents.js';
|
|
@@ -30,8 +30,7 @@ export * from './referrals.js';
|
|
|
30
30
|
export * from './iam.js';
|
|
31
31
|
export * from './oauth-clients.js';
|
|
32
32
|
export * from './assignments.js';
|
|
33
|
-
export
|
|
34
|
-
export * from './admin-providers.js';
|
|
33
|
+
export { getAccountDeletionStatus, requestAccountDeletion, cancelAccountDeletion, deleteAccountImmediately, } from './account-lifecycle.js';
|
|
35
34
|
export * from './presentations.js';
|
|
36
35
|
export * from './review.js';
|
|
37
36
|
export * from './review-items.js';
|
|
@@ -48,7 +47,5 @@ export * from './apps-fleet.js';
|
|
|
48
47
|
export * from './drives.js';
|
|
49
48
|
export * from './notifications.js';
|
|
50
49
|
export * from './model-access.js';
|
|
51
|
-
export * from './provider-connections.js';
|
|
52
|
-
export * from './starter-suggestions.js';
|
|
53
50
|
export * from './session-attachments.js';
|
|
54
51
|
export * from './project-agents.js';
|
|
@@ -22,7 +22,7 @@ export declare function unregisterDeviceToken(deviceToken: string, options?: {
|
|
|
22
22
|
success: true;
|
|
23
23
|
deleted: boolean;
|
|
24
24
|
}>;
|
|
25
|
-
export declare const INBOX_NOTIFICATION_KINDS: readonly ["turn_done", "turn_error", "question", "permission", "shared", "automation_failed", "automation_recovered"];
|
|
25
|
+
export declare const INBOX_NOTIFICATION_KINDS: readonly ["turn_done", "turn_error", "question", "permission", "shared", "automation_failed", "automation_recovered", "capture_device_down", "capture_device_recovered"];
|
|
26
26
|
export type InboxNotificationKind = (typeof INBOX_NOTIFICATION_KINDS)[number];
|
|
27
27
|
export interface InboxNotification {
|
|
28
28
|
id: string;
|
|
@@ -14,6 +14,8 @@ export const INBOX_NOTIFICATION_KINDS = [
|
|
|
14
14
|
'shared',
|
|
15
15
|
'automation_failed',
|
|
16
16
|
'automation_recovered',
|
|
17
|
+
'capture_device_down',
|
|
18
|
+
'capture_device_recovered',
|
|
17
19
|
];
|
|
18
20
|
export async function listNotifications(params = {}, options) {
|
|
19
21
|
const query = new URLSearchParams();
|
|
@@ -39,6 +41,8 @@ export const DEFAULT_NOTIFICATION_PREFERENCES = {
|
|
|
39
41
|
shared: { push: true, email: true },
|
|
40
42
|
automation_failed: { push: true, email: true },
|
|
41
43
|
automation_recovered: { push: true, email: false },
|
|
44
|
+
capture_device_down: { push: true, email: true },
|
|
45
|
+
capture_device_recovered: { push: true, email: false },
|
|
42
46
|
};
|
|
43
47
|
export async function getNotificationPreferences() {
|
|
44
48
|
return unwrap(await backendApi.get('/notifications/preferences', { showErrors: false }));
|
|
@@ -2,8 +2,8 @@ import type { CatalogModel } from '@beeuni/llm-catalog';
|
|
|
2
2
|
import { type ApiClientOptions } from '../../http/api-client.js';
|
|
3
3
|
import type { SandboxProviderName } from '../platform-client/types.js';
|
|
4
4
|
import { type ProjectFileEntry, type ProjectGitConnection, type ProjectRole, type ServerTokenOptions } from './shared.js';
|
|
5
|
-
export type FeatureFlagKey = 'agent_tunnel' | 'marketplace' | 'connectors_api_discover' | 'agentmail_email' | 'teams' | 'llm_gateway' | 'review_center' | 'meta_agent' | 'apps' | 'monitors' | 'reminders' | 'warm_sessions' | 'secrets_egress' | 'pi_worker' | 'session_transcript_history' | 'pooled_provider_secrets' | 'pi_harness' | 'config_releases' | 'agent_principal' | 'us_region' | 'event_triggers' | 'notification_center' | 'drives' | 'ephemeral_sandboxes' | 'human_messaging';
|
|
6
|
-
type GraduatedFeatureFlagKey = 'agent_tunnel' | 'teams' | 'review_center' | 'session_transcript_history' | 'agent_principal' | 'human_messaging' | 'pi_worker' | 'config_releases';
|
|
5
|
+
export type FeatureFlagKey = 'agent_tunnel' | 'marketplace' | 'connectors_api_discover' | 'agentmail_email' | 'teams' | 'llm_gateway' | 'review_center' | 'meta_agent' | 'apps' | 'monitors' | 'reminders' | 'warm_sessions' | 'secrets_egress' | 'pi_worker' | 'session_transcript_history' | 'pooled_provider_secrets' | 'pi_harness' | 'genui' | 'config_releases' | 'agent_principal' | 'us_region' | 'event_triggers' | 'notification_center' | 'volumes' | 'stateless_sessions' | 'drives' | 'ephemeral_sandboxes' | 'session_log' | 'session_log_restore' | 'human_messaging';
|
|
6
|
+
type GraduatedFeatureFlagKey = 'agent_tunnel' | 'teams' | 'review_center' | 'session_transcript_history' | 'agent_principal' | 'human_messaging' | 'pi_worker' | 'config_releases' | 'apps' | 'stateless_sessions' | 'ephemeral_sandboxes';
|
|
7
7
|
type ServedFeatureFlagKey = Exclude<FeatureFlagKey, GraduatedFeatureFlagKey>;
|
|
8
8
|
export declare const FEATURE_FLAG_KEYS: readonly FeatureFlagKey[];
|
|
9
9
|
export type FeatureFlagStability = 'experimental' | 'beta' | 'stable';
|
|
@@ -16,6 +16,7 @@ export interface FeatureFlagView {
|
|
|
16
16
|
enabled: boolean;
|
|
17
17
|
overridden: boolean;
|
|
18
18
|
operator_only?: boolean;
|
|
19
|
+
scope?: 'project' | 'organization';
|
|
19
20
|
}
|
|
20
21
|
export type ExperimentalFeatureKey = FeatureFlagKey;
|
|
21
22
|
export type ExperimentalFeatureView = FeatureFlagView;
|
|
@@ -137,6 +138,7 @@ export interface GatewayCatalogModel {
|
|
|
137
138
|
}
|
|
138
139
|
export interface ProjectLlmCatalogResponse {
|
|
139
140
|
models: Record<string, GatewayCatalogModel>;
|
|
141
|
+
platformFeePercent?: number;
|
|
140
142
|
managedPricingRoutes?: Record<string, Array<{
|
|
141
143
|
route: string;
|
|
142
144
|
role: 'preferred' | 'eligible';
|
|
@@ -7,18 +7,20 @@ export const FEATURE_FLAG_KEYS = [
|
|
|
7
7
|
'agentmail_email',
|
|
8
8
|
'llm_gateway',
|
|
9
9
|
'meta_agent',
|
|
10
|
-
'apps',
|
|
11
10
|
'monitors',
|
|
12
11
|
'reminders',
|
|
13
12
|
'warm_sessions',
|
|
14
13
|
'secrets_egress',
|
|
15
14
|
'pooled_provider_secrets',
|
|
16
15
|
'pi_harness',
|
|
16
|
+
'genui',
|
|
17
17
|
'us_region',
|
|
18
18
|
'event_triggers',
|
|
19
19
|
'notification_center',
|
|
20
|
+
'volumes',
|
|
20
21
|
'drives',
|
|
21
|
-
'
|
|
22
|
+
'session_log',
|
|
23
|
+
'session_log_restore',
|
|
22
24
|
];
|
|
23
25
|
export async function listProjects() {
|
|
24
26
|
return unwrap(await backendApi.get('/projects'));
|
|
@@ -49,6 +49,8 @@ export interface ReviewApprovalAction {
|
|
|
49
49
|
rawArgsPreview?: Record<string, unknown>;
|
|
50
50
|
reviewComplete?: boolean;
|
|
51
51
|
previewAuthorized?: boolean;
|
|
52
|
+
canResolve?: boolean;
|
|
53
|
+
resolvers?: 'managers' | 'managers_and_launcher';
|
|
52
54
|
approvalContext?: string;
|
|
53
55
|
connectorRisk?: string | null;
|
|
54
56
|
policySource: string;
|
|
@@ -138,6 +138,10 @@ function approvalDetail(detail, row) {
|
|
|
138
138
|
rawArgsPreview: hasArgsPreview ? rawArgsPreview : undefined,
|
|
139
139
|
reviewComplete: detail.args_preview_complete === true,
|
|
140
140
|
previewAuthorized: detail.args_preview_authorized !== false,
|
|
141
|
+
canResolve: typeof row.can_resolve === 'boolean'
|
|
142
|
+
? row.can_resolve
|
|
143
|
+
: detail.args_preview_authorized !== false,
|
|
144
|
+
...(row.resolvers ? { resolvers: row.resolvers } : {}),
|
|
141
145
|
approvalContext: asString(detail.approval_context),
|
|
142
146
|
connectorRisk: asString(detail.risk) ?? null,
|
|
143
147
|
policySource: 'Requires approval',
|
|
@@ -24,13 +24,27 @@ export interface ApiReviewItem {
|
|
|
24
24
|
metadata: Record<string, unknown>;
|
|
25
25
|
created_at: string;
|
|
26
26
|
updated_at: string;
|
|
27
|
+
can_resolve?: boolean;
|
|
28
|
+
resolvers?: 'managers' | 'managers_and_launcher' | null;
|
|
27
29
|
}
|
|
28
|
-
export
|
|
30
|
+
export interface ReviewItemsQuery {
|
|
29
31
|
segment?: ReviewSegment;
|
|
30
32
|
kind?: ReviewItemKind;
|
|
31
|
-
|
|
33
|
+
sessionId?: string;
|
|
34
|
+
limit?: number;
|
|
35
|
+
}
|
|
36
|
+
export interface ReviewItemsPage {
|
|
32
37
|
review_items: ApiReviewItem[];
|
|
33
|
-
|
|
38
|
+
next_cursor?: string | null;
|
|
39
|
+
}
|
|
40
|
+
export declare function listReviewItems(projectId: string, params?: ReviewItemsQuery & {
|
|
41
|
+
cursor?: string;
|
|
42
|
+
}): Promise<ReviewItemsPage>;
|
|
43
|
+
export interface ReviewSummary {
|
|
44
|
+
needs_you_total: number;
|
|
45
|
+
needs_you_by_session: Record<string, number>;
|
|
46
|
+
}
|
|
47
|
+
export declare function getReviewSummary(projectId: string): Promise<ReviewSummary>;
|
|
34
48
|
export declare function getReviewItem(projectId: string, reviewItemId: string): Promise<{
|
|
35
49
|
review_item: ApiReviewItem;
|
|
36
50
|
}>;
|
|
@@ -6,9 +6,20 @@ export async function listReviewItems(projectId, params) {
|
|
|
6
6
|
q.set('segment', params.segment);
|
|
7
7
|
if (params?.kind)
|
|
8
8
|
q.set('kind', params.kind);
|
|
9
|
+
if (params?.sessionId)
|
|
10
|
+
q.set('session_id', params.sessionId);
|
|
11
|
+
if (params?.limit != null)
|
|
12
|
+
q.set('limit', String(params.limit));
|
|
13
|
+
if (params?.cursor)
|
|
14
|
+
q.set('cursor', params.cursor);
|
|
9
15
|
const qs = q.toString();
|
|
10
16
|
return unwrap(await backendApi.get(`/projects/${projectId}/review/items${qs ? `?${qs}` : ''}`, { showErrors: false }));
|
|
11
17
|
}
|
|
18
|
+
export async function getReviewSummary(projectId) {
|
|
19
|
+
return unwrap(await backendApi.get(`/projects/${projectId}/review/summary`, {
|
|
20
|
+
showErrors: false,
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
12
23
|
export async function getReviewItem(projectId, reviewItemId) {
|
|
13
24
|
return unwrap(await backendApi.get(`/projects/${projectId}/review/items/${reviewItemId}`));
|
|
14
25
|
}
|
|
@@ -18,11 +18,10 @@ export interface SandboxTemplate {
|
|
|
18
18
|
snapshot_name: string;
|
|
19
19
|
content_hash: string;
|
|
20
20
|
built_from_commit: string | null;
|
|
21
|
-
daytona_state: string;
|
|
22
21
|
provider_state: string;
|
|
23
22
|
ready: boolean;
|
|
24
23
|
provider_coverage?: Array<{
|
|
25
|
-
provider:
|
|
24
|
+
provider: string;
|
|
26
25
|
available: boolean;
|
|
27
26
|
snapshot_name: string;
|
|
28
27
|
state: 'active' | 'building' | 'build_failed' | 'removing' | 'unknown' | 'missing' | null;
|
|
@@ -41,7 +40,7 @@ export interface SandboxTemplatesResponse {
|
|
|
41
40
|
items: SandboxTemplate[];
|
|
42
41
|
default_slug: string | null;
|
|
43
42
|
provider_mode?: 'automatic' | 'pinned';
|
|
44
|
-
selected_provider?:
|
|
43
|
+
selected_provider?: string | null;
|
|
45
44
|
warm_pool_available?: boolean;
|
|
46
45
|
}
|
|
47
46
|
export interface ProjectSnapshotBuild {
|
|
@@ -55,7 +54,7 @@ export interface ProjectSnapshotBuild {
|
|
|
55
54
|
error_category: SnapshotErrorCategory | null;
|
|
56
55
|
fixable_by_agent: boolean;
|
|
57
56
|
source: 'session-start' | 'project-create' | 'cr-merge' | 'manual' | 'background' | 'startup' | null;
|
|
58
|
-
provider?:
|
|
57
|
+
provider?: string | null;
|
|
59
58
|
started_at: string;
|
|
60
59
|
finished_at: string | null;
|
|
61
60
|
}
|
|
@@ -78,7 +77,7 @@ export interface ProjectSnapshotsResponse {
|
|
|
78
77
|
builds: ProjectSnapshotBuild[];
|
|
79
78
|
status?: SandboxRuntimeStatus | null;
|
|
80
79
|
provider_mode?: 'automatic' | 'pinned';
|
|
81
|
-
selected_provider?:
|
|
80
|
+
selected_provider?: string | null;
|
|
82
81
|
warm_pool_available?: boolean;
|
|
83
82
|
}
|
|
84
83
|
export interface ProjectSandboxHealth {
|
|
@@ -90,15 +89,15 @@ export interface ProjectSandboxHealth {
|
|
|
90
89
|
latest_failure: ProjectSnapshotBuild | null;
|
|
91
90
|
status?: SandboxRuntimeStatus | null;
|
|
92
91
|
provider_mode?: 'automatic' | 'pinned';
|
|
93
|
-
selected_provider?:
|
|
92
|
+
selected_provider?: string | null;
|
|
94
93
|
}
|
|
95
94
|
export interface RebuildSnapshotResponse {
|
|
96
95
|
status: 'started';
|
|
97
96
|
slug: string;
|
|
98
97
|
deleted_existing: boolean;
|
|
99
98
|
snapshot_name: string;
|
|
100
|
-
providers?: Array<
|
|
101
|
-
failed_providers?: Array<
|
|
99
|
+
providers?: Array<string>;
|
|
100
|
+
failed_providers?: Array<string>;
|
|
102
101
|
}
|
|
103
102
|
export declare function listProjectSandboxTemplates(projectId: string): Promise<SandboxTemplatesResponse>;
|
|
104
103
|
export declare function listProjectSnapshots(projectId: string): Promise<ProjectSnapshotsResponse>;
|
|
@@ -139,6 +138,6 @@ export declare function buildSandboxTemplate(projectId: string, templateId: stri
|
|
|
139
138
|
status: "started";
|
|
140
139
|
template_id: string;
|
|
141
140
|
slug: string;
|
|
142
|
-
providers?: Array<
|
|
141
|
+
providers?: Array<string>;
|
|
143
142
|
}>;
|
|
144
143
|
export declare function listProjectSandboxes(projectId: string): Promise<SandboxTemplatesResponse>;
|
|
@@ -4,6 +4,7 @@ export type SecretDeliveryStrategy = 'runtime' | 'egress' | 'broker' | 'denied';
|
|
|
4
4
|
export type SecretConsumer = 'sandbox' | 'llm_gateway' | 'connector' | 'git_proxy' | 'http_broker' | 'network';
|
|
5
5
|
export type SecretDeliveryStatus = 'available' | 'unavailable' | 'disabled';
|
|
6
6
|
export type SecretDeliveryBlockedReason = 'no_agent_grant';
|
|
7
|
+
export type SecretValueStatus = 'ok' | 'undecryptable';
|
|
7
8
|
export type SecretInjectionSlot = {
|
|
8
9
|
kind: 'header';
|
|
9
10
|
name: string;
|
|
@@ -62,6 +63,7 @@ export interface ProjectSecret {
|
|
|
62
63
|
mine: {
|
|
63
64
|
active: boolean;
|
|
64
65
|
updated_at: string;
|
|
66
|
+
status?: SecretValueStatus;
|
|
65
67
|
} | null;
|
|
66
68
|
effective_source: 'mine' | 'shared' | 'none';
|
|
67
69
|
can_manage_shared: boolean;
|
|
@@ -76,6 +78,7 @@ export interface ProjectSecret {
|
|
|
76
78
|
requires_rotation?: boolean;
|
|
77
79
|
shared_with?: ConnectionShare[];
|
|
78
80
|
usable?: boolean;
|
|
81
|
+
status?: SecretValueStatus;
|
|
79
82
|
}
|
|
80
83
|
export interface SecretSharePrincipal {
|
|
81
84
|
principal_type: 'user' | 'group' | 'agent';
|
|
@@ -107,6 +107,18 @@ function showItems(raw) {
|
|
|
107
107
|
return [];
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
+
function asV1Message(record) {
|
|
111
|
+
const parts = record.blocks.filter(isObject).map((block) => {
|
|
112
|
+
if (block.type === "attachment")
|
|
113
|
+
return { type: "file", url: block.ref ?? block.url, filename: block.name, mime: block.mime };
|
|
114
|
+
if (block.type === "tool_call")
|
|
115
|
+
return { type: "tool", tool: block.name, state: { input: block.input } };
|
|
116
|
+
if (block.type === "harness" && isObject(block.data))
|
|
117
|
+
return block.data;
|
|
118
|
+
return block;
|
|
119
|
+
});
|
|
120
|
+
return { info: { id: record.message_id, role: record.role }, parts };
|
|
121
|
+
}
|
|
110
122
|
function attachmentsFromTextPart(text, add) {
|
|
111
123
|
for (const attrs of fileTagAttributes(text)) {
|
|
112
124
|
add(tagAttribute(attrs, "attachment"), tagAttribute(attrs, "filename") ?? basename(tagAttribute(attrs, "path")), tagAttribute(attrs, "mime"));
|
|
@@ -123,7 +135,8 @@ export function findSessionAttachments(messages) {
|
|
|
123
135
|
return [];
|
|
124
136
|
const found = [];
|
|
125
137
|
const seen = new Set();
|
|
126
|
-
for (const
|
|
138
|
+
for (const entry of messages) {
|
|
139
|
+
const message = isObject(entry) && Array.isArray(entry.blocks) ? asV1Message(entry) : entry;
|
|
127
140
|
if (!isObject(message) || !isObject(message.info) || !Array.isArray(message.parts))
|
|
128
141
|
continue;
|
|
129
142
|
const messageId = stringOrNull(message.info.id);
|
|
@@ -5,7 +5,7 @@ export interface ProjectSessionSandbox {
|
|
|
5
5
|
session_id: string;
|
|
6
6
|
project_id: string;
|
|
7
7
|
account_id: string;
|
|
8
|
-
provider:
|
|
8
|
+
provider: string;
|
|
9
9
|
external_id: string | null;
|
|
10
10
|
base_url: string | null;
|
|
11
11
|
status: ProjectSessionSandboxStatus;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ApiClientOptions } from '../../http/api-client.js';
|
|
2
|
+
import { type SessionLogPage, type SessionLogPageQuery } from '../../session-log/source.js';
|
|
2
3
|
import type { AuditEvent } from './audit.js';
|
|
3
4
|
import { type ConnectorSharing } from './shared.js';
|
|
4
5
|
export type ProjectSessionStatus = 'queued' | 'branching' | 'provisioning' | 'running' | 'stopped' | 'failed' | 'completed';
|
|
@@ -18,7 +19,7 @@ export interface ProjectSession {
|
|
|
18
19
|
project_id: string;
|
|
19
20
|
branch_name: string;
|
|
20
21
|
base_ref: string;
|
|
21
|
-
sandbox_provider:
|
|
22
|
+
sandbox_provider: string | null;
|
|
22
23
|
sandbox_id: string | null;
|
|
23
24
|
sandbox_url: string | null;
|
|
24
25
|
runtime_session_id?: string | null;
|
|
@@ -52,6 +53,8 @@ export interface ProjectSession {
|
|
|
52
53
|
runtime_status?: 'provisioning' | 'active' | 'stopped' | 'error' | 'archived' | null;
|
|
53
54
|
deleted_at?: string | null;
|
|
54
55
|
deleted_by?: string | null;
|
|
56
|
+
pinned_at?: string | null;
|
|
57
|
+
archived_at?: string | null;
|
|
55
58
|
created_at: string;
|
|
56
59
|
updated_at: string;
|
|
57
60
|
}
|
|
@@ -83,13 +86,14 @@ export interface CreateProjectSessionInput {
|
|
|
83
86
|
agent_name?: string;
|
|
84
87
|
sandbox_slug?: string;
|
|
85
88
|
initial_prompt?: string;
|
|
89
|
+
initial_context?: string;
|
|
86
90
|
pending_prompt?: PendingSessionPrompt;
|
|
87
91
|
model?: string;
|
|
88
92
|
opencode_model?: string;
|
|
89
93
|
name?: string;
|
|
90
94
|
labels?: string[];
|
|
91
95
|
session_id?: string;
|
|
92
|
-
provider?:
|
|
96
|
+
provider?: string;
|
|
93
97
|
persistent_machine?: boolean;
|
|
94
98
|
branch_already_created?: boolean;
|
|
95
99
|
metadata?: Record<string, unknown>;
|
|
@@ -137,6 +141,7 @@ export interface ListProjectSessionsOptions {
|
|
|
137
141
|
startedBy?: 'me' | 'others' | 'automated';
|
|
138
142
|
q?: string;
|
|
139
143
|
labels?: string[];
|
|
144
|
+
view?: 'pinned' | 'archived';
|
|
140
145
|
}
|
|
141
146
|
export interface ProjectSessionPage {
|
|
142
147
|
items: ProjectSession[];
|
|
@@ -164,6 +169,12 @@ export declare function getSessionWatch(projectId: string, sessionId: string): P
|
|
|
164
169
|
export declare function setSessionWatch(projectId: string, sessionId: string, watching: boolean): Promise<{
|
|
165
170
|
watching: boolean;
|
|
166
171
|
}>;
|
|
172
|
+
export interface SessionListState {
|
|
173
|
+
pinned_at: string | null;
|
|
174
|
+
archived_at: string | null;
|
|
175
|
+
}
|
|
176
|
+
export declare function setSessionPinned(projectId: string, sessionId: string, pinned: boolean): Promise<SessionListState>;
|
|
177
|
+
export declare function setSessionArchived(projectId: string, sessionId: string, archived: boolean): Promise<SessionListState>;
|
|
167
178
|
export interface SessionPreviewCandidate {
|
|
168
179
|
id: string;
|
|
169
180
|
label: string;
|
|
@@ -247,6 +258,8 @@ export interface SessionAuditAction {
|
|
|
247
258
|
at: string;
|
|
248
259
|
resolved_at: string | null;
|
|
249
260
|
approval_url?: string | null;
|
|
261
|
+
can_resolve?: boolean;
|
|
262
|
+
resolvers?: 'managers' | 'managers_and_launcher' | null;
|
|
250
263
|
}
|
|
251
264
|
export interface SessionAudit {
|
|
252
265
|
session_id: string;
|
|
@@ -322,6 +335,9 @@ export declare function getSessionTranscriptSync(projectId: string, sessionId: s
|
|
|
322
335
|
before?: string | null;
|
|
323
336
|
child?: string | null;
|
|
324
337
|
}): Promise<SessionTranscriptSyncEnvelope>;
|
|
338
|
+
export declare function getSessionLogPage(projectId: string, sessionId: string, query?: SessionLogPageQuery, options?: {
|
|
339
|
+
signal?: AbortSignal;
|
|
340
|
+
}): Promise<SessionLogPage | null>;
|
|
325
341
|
export type SessionTurnState = 'delivering' | 'active';
|
|
326
342
|
export interface SessionTurn {
|
|
327
343
|
turn_token: string;
|
|
@@ -352,8 +368,11 @@ export interface SessionTurnStatus {
|
|
|
352
368
|
turns: SessionTurn[];
|
|
353
369
|
last_ended?: SessionTurnEnded;
|
|
354
370
|
recent_failures?: SessionTurnFailure[];
|
|
371
|
+
can_stop?: boolean;
|
|
355
372
|
}
|
|
356
|
-
export declare function getSessionTurn(projectId: string, sessionId: string
|
|
373
|
+
export declare function getSessionTurn(projectId: string, sessionId: string, options?: {
|
|
374
|
+
showErrors?: boolean;
|
|
375
|
+
}): Promise<SessionTurnStatus>;
|
|
357
376
|
export interface SessionOpenBundleUnknown {
|
|
358
377
|
known: false;
|
|
359
378
|
reason: string;
|
|
@@ -528,8 +547,15 @@ export interface UpdateProjectSessionInput {
|
|
|
528
547
|
export declare function updateProjectSession(projectId: string, sessionId: string, input: UpdateProjectSessionInput): Promise<ProjectSession>;
|
|
529
548
|
export declare function deleteProjectSession(projectId: string, sessionId: string): Promise<{
|
|
530
549
|
ok: boolean;
|
|
550
|
+
restore_until?: string;
|
|
551
|
+
}>;
|
|
552
|
+
export declare function recoverProjectSession(projectId: string, sessionId: string): Promise<{
|
|
553
|
+
ok: true;
|
|
554
|
+
}>;
|
|
555
|
+
export declare function restoreProjectSession(projectId: string, sessionId: string): Promise<{
|
|
556
|
+
ok: boolean;
|
|
531
557
|
}>;
|
|
532
|
-
export declare function restartProjectSession(projectId: string, sessionId: string,
|
|
558
|
+
export declare function restartProjectSession(projectId: string, sessionId: string, _opts?: {
|
|
533
559
|
reset_machine?: boolean;
|
|
534
560
|
discard_state?: boolean;
|
|
535
561
|
}): Promise<{
|
|
@@ -650,6 +676,7 @@ export type SessionMessageAuthor = {
|
|
|
650
676
|
export interface SessionMessageAuthors {
|
|
651
677
|
authors: Record<string, SessionMessageAuthor>;
|
|
652
678
|
initial_author: SessionMessageAuthor | null;
|
|
679
|
+
stops?: Record<string, SessionMessageAuthor>;
|
|
653
680
|
}
|
|
654
681
|
export declare function getSessionMessageAuthors(projectId: string, sessionId: string): Promise<SessionMessageAuthors>;
|
|
655
682
|
export interface SessionServedModel {
|