@kosuke-ai/kosuke 1.0.0 → 1.0.1
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/CHANGELOG.md +62 -0
- package/README.md +198 -1
- package/dist/agent/http.js +18 -0
- package/dist/agent/summary.js +419 -0
- package/dist/commands/agent.js +22 -0
- package/dist/commands/auth.js +117 -0
- package/dist/commands/integrations.js +310 -0
- package/dist/commands/skill-runs.js +230 -0
- package/dist/commands/watch.js +167 -0
- package/dist/generated/commands/activity/list.js +73 -0
- package/dist/generated/commands/crons/artifacts-list.js +57 -0
- package/dist/generated/commands/crons/create.js +65 -0
- package/dist/generated/commands/crons/delete.js +18 -0
- package/dist/generated/commands/crons/get.js +19 -0
- package/dist/generated/commands/crons/list.js +54 -0
- package/dist/generated/commands/crons/projects-resume.js +21 -0
- package/dist/generated/commands/crons/run.js +37 -0
- package/dist/generated/commands/crons/runs-artifacts-get.js +23 -0
- package/dist/generated/commands/crons/runs-artifacts-list.js +22 -0
- package/dist/generated/commands/crons/runs-cancel.js +21 -0
- package/dist/generated/commands/crons/runs-diagnostics.js +20 -0
- package/dist/generated/commands/crons/runs-get.js +21 -0
- package/dist/generated/commands/crons/runs-list.js +58 -0
- package/dist/generated/commands/crons/runs-messages.js +21 -0
- package/dist/generated/commands/crons/update.js +73 -0
- package/dist/generated/commands/deploy/cancel.js +18 -0
- package/dist/generated/commands/deploy/list.js +33 -0
- package/dist/generated/commands/deploy/message.js +32 -0
- package/dist/generated/commands/deploy/messages.js +18 -0
- package/dist/generated/commands/deploy/queue-delete.js +19 -0
- package/dist/generated/commands/deploy/queue-list.js +19 -0
- package/dist/generated/commands/deploy/queue-move.js +31 -0
- package/dist/generated/commands/deploy/queue-resume.js +19 -0
- package/dist/generated/commands/deploy/queue-send.js +20 -0
- package/dist/generated/commands/deploy/queue-steer.js +20 -0
- package/dist/generated/commands/deploy/queue-update.js +56 -0
- package/dist/generated/commands/deploy/run.js +65 -0
- package/dist/generated/commands/deploy/set-model.js +28 -0
- package/dist/generated/commands/devices/list.js +18 -0
- package/dist/generated/commands/devices/request.js +31 -0
- package/dist/generated/commands/files/delete.js +18 -0
- package/dist/generated/commands/files/get.js +19 -0
- package/dist/generated/commands/files/list.js +25 -0
- package/dist/generated/commands/files/mkdir.js +28 -0
- package/dist/generated/commands/files/move.js +35 -0
- package/dist/generated/commands/files/put.js +92 -0
- package/dist/generated/commands/github/repositories.js +16 -0
- package/dist/generated/commands/github/status.js +16 -0
- package/dist/generated/commands/index.js +650 -0
- package/dist/generated/commands/integrations/execute.js +49 -0
- package/dist/generated/commands/integrations/tools.js +70 -0
- package/dist/generated/commands/mac/apps.js +30 -0
- package/dist/generated/commands/mac/ax-tree.js +65 -0
- package/dist/generated/commands/mac/browser-connection-check.js +69 -0
- package/dist/generated/commands/mac/browser-connections.js +30 -0
- package/dist/generated/commands/mac/browser-profiles.js +36 -0
- package/dist/generated/commands/mac/browser-sign-in.js +79 -0
- package/dist/generated/commands/mac/browser.js +44 -0
- package/dist/generated/commands/mac/click.js +72 -0
- package/dist/generated/commands/mac/file-delete.js +37 -0
- package/dist/generated/commands/mac/file-list.js +37 -0
- package/dist/generated/commands/mac/file-move.js +44 -0
- package/dist/generated/commands/mac/file-read.js +37 -0
- package/dist/generated/commands/mac/file-write.js +50 -0
- package/dist/generated/commands/mac/key.js +58 -0
- package/dist/generated/commands/mac/open.js +43 -0
- package/dist/generated/commands/mac/screenshot.js +51 -0
- package/dist/generated/commands/mac/scroll.js +70 -0
- package/dist/generated/commands/mac/shell.js +51 -0
- package/dist/generated/commands/mac/tools.js +18 -0
- package/dist/generated/commands/mac/type.js +64 -0
- package/dist/generated/commands/mac/windows.js +30 -0
- package/dist/generated/commands/members/list.js +24 -0
- package/dist/generated/commands/models/list.js +16 -0
- package/dist/generated/commands/personal-tasks/create.js +72 -0
- package/dist/generated/commands/personal-tasks/delete.js +17 -0
- package/dist/generated/commands/personal-tasks/get.js +20 -0
- package/dist/generated/commands/personal-tasks/list.js +71 -0
- package/dist/generated/commands/personal-tasks/move.js +31 -0
- package/dist/generated/commands/personal-tasks/start.js +69 -0
- package/dist/generated/commands/personal-tasks/update.js +81 -0
- package/dist/generated/commands/preview/get.js +26 -0
- package/dist/generated/commands/preview/health.js +26 -0
- package/dist/generated/commands/preview/reset.js +28 -0
- package/dist/generated/commands/preview/share-create.js +37 -0
- package/dist/generated/commands/preview/share-delete.js +26 -0
- package/dist/generated/commands/preview/share-get.js +27 -0
- package/dist/generated/commands/preview/shared-artifact.js +19 -0
- package/dist/generated/commands/preview/shared.js +17 -0
- package/dist/generated/commands/projects/backlog-items-create.js +35 -0
- package/dist/generated/commands/projects/backlog-items-delete.js +19 -0
- package/dist/generated/commands/projects/backlog-items-list.js +19 -0
- package/dist/generated/commands/projects/backlog-items-send.js +20 -0
- package/dist/generated/commands/projects/backlog-items-update.js +42 -0
- package/dist/generated/commands/projects/batch-merging-eject.js +37 -0
- package/dist/generated/commands/projects/batch-merging-finish.js +30 -0
- package/dist/generated/commands/projects/batch-merging-get.js +19 -0
- package/dist/generated/commands/projects/batch-merging-set.js +32 -0
- package/dist/generated/commands/projects/branches.js +31 -0
- package/dist/generated/commands/projects/create.js +72 -0
- package/dist/generated/commands/projects/delete.js +17 -0
- package/dist/generated/commands/projects/env-vars-add.js +22 -0
- package/dist/generated/commands/projects/env-vars-remove.js +21 -0
- package/dist/generated/commands/projects/get.js +18 -0
- package/dist/generated/commands/projects/labels-color.js +37 -0
- package/dist/generated/commands/projects/labels-delete.js +50 -0
- package/dist/generated/commands/projects/labels-usage.js +27 -0
- package/dist/generated/commands/projects/labels.js +18 -0
- package/dist/generated/commands/projects/list.js +16 -0
- package/dist/generated/commands/projects/live-logs.js +34 -0
- package/dist/generated/commands/projects/live-query.js +30 -0
- package/dist/generated/commands/projects/live-traffic.js +27 -0
- package/dist/generated/commands/projects/live-write-status.js +20 -0
- package/dist/generated/commands/projects/live-write.js +37 -0
- package/dist/generated/commands/projects/qa-guide-get.js +19 -0
- package/dist/generated/commands/projects/qa-guide-set.js +40 -0
- package/dist/generated/commands/projects/releases.js +18 -0
- package/dist/generated/commands/projects/services-add.js +88 -0
- package/dist/generated/commands/projects/services-list.js +19 -0
- package/dist/generated/commands/projects/services-remove.js +19 -0
- package/dist/generated/commands/projects/services-update.js +82 -0
- package/dist/generated/commands/projects/settings-get.js +19 -0
- package/dist/generated/commands/projects/settings-import.js +99 -0
- package/dist/generated/commands/projects/settings-update.js +85 -0
- package/dist/generated/commands/projects/skills.js +39 -0
- package/dist/generated/commands/projects/switch-workflow.js +34 -0
- package/dist/generated/commands/projects/update.js +28 -0
- package/dist/generated/commands/projects/versions.js +18 -0
- package/dist/generated/commands/sensei/cards-close.js +43 -0
- package/dist/generated/commands/sensei/cards-mark-read.js +30 -0
- package/dist/generated/commands/sensei/cards-put.js +152 -0
- package/dist/generated/commands/sensei/cards-send-reply.js +30 -0
- package/dist/generated/commands/sensei/cards.js +38 -0
- package/dist/generated/commands/sensei/chat.js +23 -0
- package/dist/generated/commands/sensei/connect.js +57 -0
- package/dist/generated/commands/sensei/delegates-get.js +21 -0
- package/dist/generated/commands/sensei/delegates-note.js +46 -0
- package/dist/generated/commands/sensei/delegates-start.js +51 -0
- package/dist/generated/commands/sensei/delegates-stop.js +21 -0
- package/dist/generated/commands/sensei/describe.js +36 -0
- package/dist/generated/commands/sensei/device-requests-decide.js +48 -0
- package/dist/generated/commands/sensei/device-requests-list.js +27 -0
- package/dist/generated/commands/sensei/memory-get.js +19 -0
- package/dist/generated/commands/sensei/memory-put.js +55 -0
- package/dist/generated/commands/sensei/merge-rule.js +36 -0
- package/dist/generated/commands/sensei/merge.js +36 -0
- package/dist/generated/commands/sensei/messages-reply.js +44 -0
- package/dist/generated/commands/sensei/messages-reroute.js +37 -0
- package/dist/generated/commands/sensei/messages-send.js +98 -0
- package/dist/generated/commands/sensei/notifications-open.js +19 -0
- package/dist/generated/commands/sensei/reels-activity.js +16 -0
- package/dist/generated/commands/sensei/reels-proposals.js +24 -0
- package/dist/generated/commands/sensei/reels-ranks.js +16 -0
- package/dist/generated/commands/sensei/reels-skips.js +32 -0
- package/dist/generated/commands/sensei/repository.js +36 -0
- package/dist/generated/commands/sensei/review-approve.js +37 -0
- package/dist/generated/commands/sensei/review-ask.js +44 -0
- package/dist/generated/commands/sensei/review-context.js +32 -0
- package/dist/generated/commands/sensei/sessions-assess.js +71 -0
- package/dist/generated/commands/sensei/sessions-facts.js +26 -0
- package/dist/generated/commands/sensei/suggest.js +36 -0
- package/dist/generated/commands/sensei/thread-done.js +21 -0
- package/dist/generated/commands/sensei/thread-move.js +30 -0
- package/dist/generated/commands/sensei/thread-read.js +41 -0
- package/dist/generated/commands/sensei/thread-split.js +30 -0
- package/dist/generated/commands/sensei/threads.js +47 -0
- package/dist/generated/commands/sensei/tickets-merge.js +51 -0
- package/dist/generated/commands/sensei/widgets.js +15 -0
- package/dist/generated/commands/sessions/activate.js +33 -0
- package/dist/generated/commands/sessions/all.js +142 -0
- package/dist/generated/commands/sessions/app-stack-start.js +20 -0
- package/dist/generated/commands/sessions/artifacts-attach.js +31 -0
- package/dist/generated/commands/sessions/artifacts-get.js +21 -0
- package/dist/generated/commands/sessions/artifacts-list.js +20 -0
- package/dist/generated/commands/sessions/create.js +234 -0
- package/dist/generated/commands/sessions/delete.js +21 -0
- package/dist/generated/commands/sessions/desktop-control.js +35 -0
- package/dist/generated/commands/sessions/desktop-start.js +19 -0
- package/dist/generated/commands/sessions/desktop.js +19 -0
- package/dist/generated/commands/sessions/diff-comments-add.js +65 -0
- package/dist/generated/commands/sessions/diff-comments-delete.js +21 -0
- package/dist/generated/commands/sessions/diff-comments-list.js +21 -0
- package/dist/generated/commands/sessions/diff-comments-update.js +25 -0
- package/dist/generated/commands/sessions/diff-commits.js +20 -0
- package/dist/generated/commands/sessions/diff-files.js +20 -0
- package/dist/generated/commands/sessions/diff-patch.js +87 -0
- package/dist/generated/commands/sessions/edit-prompt.js +81 -0
- package/dist/generated/commands/sessions/files-get.js +28 -0
- package/dist/generated/commands/sessions/files-list.js +20 -0
- package/dist/generated/commands/sessions/files-write.js +42 -0
- package/dist/generated/commands/sessions/get.js +19 -0
- package/dist/generated/commands/sessions/git-commit-message.js +20 -0
- package/dist/generated/commands/sessions/git-commit.js +30 -0
- package/dist/generated/commands/sessions/git-push.js +20 -0
- package/dist/generated/commands/sessions/git-state.js +20 -0
- package/dist/generated/commands/sessions/jobs-cancel.js +21 -0
- package/dist/generated/commands/sessions/jobs-get.js +21 -0
- package/dist/generated/commands/sessions/jobs-list.js +35 -0
- package/dist/generated/commands/sessions/labels-edit.js +45 -0
- package/dist/generated/commands/sessions/labels-set.js +45 -0
- package/dist/generated/commands/sessions/list.js +130 -0
- package/dist/generated/commands/sessions/mark-read.js +19 -0
- package/dist/generated/commands/sessions/message.js +33 -0
- package/dist/generated/commands/sessions/messages.js +41 -0
- package/dist/generated/commands/sessions/needs-you.js +16 -0
- package/dist/generated/commands/sessions/qa-clear.js +22 -0
- package/dist/generated/commands/sessions/qa-set.js +33 -0
- package/dist/generated/commands/sessions/queue-delete.js +23 -0
- package/dist/generated/commands/sessions/queue-list.js +20 -0
- package/dist/generated/commands/sessions/queue-move.js +32 -0
- package/dist/generated/commands/sessions/queue-resume.js +20 -0
- package/dist/generated/commands/sessions/queue-send.js +21 -0
- package/dist/generated/commands/sessions/queue-steer.js +21 -0
- package/dist/generated/commands/sessions/queue-update.js +57 -0
- package/dist/generated/commands/sessions/runtime-command.js +39 -0
- package/dist/generated/commands/sessions/search.js +24 -0
- package/dist/generated/commands/sessions/send.js +138 -0
- package/dist/generated/commands/sessions/steer.js +36 -0
- package/dist/generated/commands/sessions/sync.js +37 -0
- package/dist/generated/commands/sessions/title-generate.js +29 -0
- package/dist/generated/commands/sessions/update.js +118 -0
- package/dist/generated/commands/tasks/all.js +112 -0
- package/dist/generated/commands/tasks/create.js +230 -0
- package/dist/generated/commands/tasks/delete.js +18 -0
- package/dist/generated/commands/tasks/get.js +19 -0
- package/dist/generated/commands/tasks/labels.js +18 -0
- package/dist/generated/commands/tasks/list.js +114 -0
- package/dist/generated/commands/tasks/start.js +68 -0
- package/dist/generated/commands/tasks/update.js +136 -0
- package/dist/generated/commands/user/auth-token-revoke.js +16 -0
- package/dist/generated/commands/user/crons-artifacts-list.js +59 -0
- package/dist/generated/commands/user/crons-create.js +65 -0
- package/dist/generated/commands/user/crons-get.js +21 -0
- package/dist/generated/commands/user/crons-list.js +41 -0
- package/dist/generated/commands/user/crons-run.js +21 -0
- package/dist/generated/commands/user/crons-runs-artifacts-get.js +25 -0
- package/dist/generated/commands/user/crons-runs-artifacts-list.js +24 -0
- package/dist/generated/commands/user/crons-runs-get.js +23 -0
- package/dist/generated/commands/user/crons-runs-list.js +52 -0
- package/dist/generated/commands/user/crons-update.js +73 -0
- package/dist/generated/commands/user/files-delete.js +18 -0
- package/dist/generated/commands/user/files-get.js +19 -0
- package/dist/generated/commands/user/files-list.js +24 -0
- package/dist/generated/commands/user/files-mkdir.js +27 -0
- package/dist/generated/commands/user/files-move.js +35 -0
- package/dist/generated/commands/user/files-put.js +91 -0
- package/dist/generated/commands/user/integrations-linkedin-connect.js +35 -0
- package/dist/generated/commands/user/integrations-linkedin-list.js +17 -0
- package/dist/generated/commands/user/integrations-linkedin-reconnect.js +19 -0
- package/dist/generated/commands/user/integrations-list.js +16 -0
- package/dist/generated/commands/user/integrations-remove.js +19 -0
- package/dist/generated/commands/user/integrations-x-connect.js +35 -0
- package/dist/generated/commands/user/integrations-x-list.js +17 -0
- package/dist/generated/commands/user/integrations-x-reconnect.js +19 -0
- package/dist/generated/commands/user/memory-list.js +16 -0
- package/dist/generated/commands/user/memory-put.js +36 -0
- package/dist/generated/commands/user/plugins-list.js +28 -0
- package/dist/generated/commands/user/plugins-update.js +29 -0
- package/dist/generated/commands/user/profile.js +16 -0
- package/dist/generated/commands/user/push-devices-register.js +76 -0
- package/dist/generated/commands/user/push-devices-remove.js +26 -0
- package/dist/generated/commands/user/skills-create.js +33 -0
- package/dist/generated/commands/user/skills-delete.js +18 -0
- package/dist/generated/commands/user/skills-get.js +19 -0
- package/dist/generated/commands/user/skills-list.js +17 -0
- package/dist/generated/commands/user/skills-update.js +35 -0
- package/dist/generated/commands/user/subscriptions-delete.js +18 -0
- package/dist/generated/commands/user/subscriptions-get.js +17 -0
- package/dist/generated/commands/user/subscriptions-grok-change.js +20 -0
- package/dist/generated/commands/user/subscriptions-grok-get.js +18 -0
- package/dist/generated/commands/user/subscriptions-login-antigravity-cancel.js +34 -0
- package/dist/generated/commands/user/subscriptions-login-antigravity-complete.js +40 -0
- package/dist/generated/commands/user/subscriptions-login-antigravity-start.js +28 -0
- package/dist/generated/commands/user/subscriptions-login-claude-complete.js +34 -0
- package/dist/generated/commands/user/subscriptions-login-claude-start.js +29 -0
- package/dist/generated/commands/user/subscriptions-login-codex-complete.js +28 -0
- package/dist/generated/commands/user/subscriptions-login-codex-start.js +29 -0
- package/dist/generated/commands/user/subscriptions-login-muse-complete.js +28 -0
- package/dist/generated/commands/user/subscriptions-login-muse-start.js +29 -0
- package/dist/generated/commands/user/subscriptions-logins-delete.js +20 -0
- package/dist/generated/commands/user/subscriptions-logins-recheck.js +19 -0
- package/dist/generated/commands/user/subscriptions-set-default-model.js +33 -0
- package/dist/generated/commands/user/subscriptions-set-key.js +35 -0
- package/dist/generated/commands/user/subscriptions-token-usage.js +17 -0
- package/dist/generated/commands/user/subscriptions-usage.js +52 -0
- package/dist/generated/commands/workspaces/access-status.js +30 -0
- package/dist/generated/commands/workspaces/ai-provider-get.js +19 -0
- package/dist/generated/commands/workspaces/ai-provider-google-delete-method.js +33 -0
- package/dist/generated/commands/workspaces/ai-provider-google-get.js +20 -0
- package/dist/generated/commands/workspaces/ai-provider-google-remove.js +19 -0
- package/dist/generated/commands/workspaces/ai-provider-google-save.js +38 -0
- package/dist/generated/commands/workspaces/ai-provider-google-select-method.js +39 -0
- package/dist/generated/commands/workspaces/ai-provider-google-usage.js +39 -0
- package/dist/generated/commands/workspaces/ai-provider-login-antigravity-cancel.js +36 -0
- package/dist/generated/commands/workspaces/ai-provider-login-antigravity-complete.js +42 -0
- package/dist/generated/commands/workspaces/ai-provider-login-antigravity-start.js +30 -0
- package/dist/generated/commands/workspaces/ai-provider-logins-recheck.js +41 -0
- package/dist/generated/commands/workspaces/ai-provider-remove.js +57 -0
- package/dist/generated/commands/workspaces/ai-provider-set.js +21 -0
- package/dist/generated/commands/workspaces/ai-provider-token-usage.js +19 -0
- package/dist/generated/commands/workspaces/ai-provider-usage-claude.js +39 -0
- package/dist/generated/commands/workspaces/ai-provider-usage-codex.js +39 -0
- package/dist/generated/commands/workspaces/ai-provider-usage-coding-plan.js +32 -0
- package/dist/generated/commands/workspaces/ai-provider-usage-deepseek.js +32 -0
- package/dist/generated/commands/workspaces/ai-provider-usage-grok.js +39 -0
- package/dist/generated/commands/workspaces/ai-provider-usage-kimi-code.js +32 -0
- package/dist/generated/commands/workspaces/ai-provider-usage-muse.js +39 -0
- package/dist/generated/commands/workspaces/artifacts.js +26 -0
- package/dist/generated/commands/workspaces/credits.js +18 -0
- package/dist/generated/commands/workspaces/get.js +18 -0
- package/dist/generated/commands/workspaces/grok-change.js +21 -0
- package/dist/generated/commands/workspaces/grok-get.js +19 -0
- package/dist/generated/commands/workspaces/integrations-get.js +20 -0
- package/dist/generated/commands/workspaces/integrations-list.js +37 -0
- package/dist/generated/commands/workspaces/integrations-remove.js +19 -0
- package/dist/generated/commands/workspaces/list.js +16 -0
- package/dist/generated/commands/workspaces/members.js +26 -0
- package/dist/generated/commands/workspaces/plugins-list.js +30 -0
- package/dist/generated/commands/workspaces/plugins-update.js +30 -0
- package/dist/generated/commands/workspaces/provider-login-claude-complete.js +35 -0
- package/dist/generated/commands/workspaces/provider-login-claude-start.js +30 -0
- package/dist/generated/commands/workspaces/provider-login-codex-complete.js +29 -0
- package/dist/generated/commands/workspaces/provider-login-codex-start.js +30 -0
- package/dist/generated/commands/workspaces/provider-login-muse-complete.js +29 -0
- package/dist/generated/commands/workspaces/provider-login-muse-start.js +30 -0
- package/dist/generated/commands/workspaces/sandbox-limit.js +18 -0
- package/dist/generated/commands/workspaces/skills-create.js +35 -0
- package/dist/generated/commands/workspaces/skills-delete.js +19 -0
- package/dist/generated/commands/workspaces/skills-get.js +20 -0
- package/dist/generated/commands/workspaces/skills-list.js +19 -0
- package/dist/generated/commands/workspaces/skills-update.js +36 -0
- package/dist/generated/commands/workspaces/stop-sandboxes.js +28 -0
- package/dist/generated/commands/workspaces/timezone-set.js +29 -0
- package/dist/generated/commands/workspaces/usage.js +33 -0
- package/dist/generated/providers.js +31 -0
- package/dist/index.js +7 -0
- package/dist/integrations/api.js +136 -0
- package/dist/integrations/render.js +59 -0
- package/dist/program.js +73 -0
- package/dist/runtime/agent-tokens.js +39 -0
- package/dist/runtime/attach.js +199 -0
- package/dist/runtime/attachments.js +63 -0
- package/dist/runtime/client.js +188 -0
- package/dist/runtime/config.js +49 -0
- package/dist/runtime/credentials.js +32 -0
- package/dist/runtime/descriptor.js +7 -0
- package/dist/runtime/invoke.js +152 -0
- package/dist/runtime/job-watch.js +374 -0
- package/dist/runtime/runtime.js +46 -0
- package/dist/runtime/version.js +5 -0
- package/openapi.json +26091 -0
- package/package.json +103 -4
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { InvalidArgumentError, Option } from 'commander';
|
|
2
|
+
import { groupFor } from '../runtime/attach.js';
|
|
3
|
+
import { JOB_TYPES, WATCH_EXIT, describe, isRecord, watchJob, } from '../runtime/job-watch.js';
|
|
4
|
+
/**
|
|
5
|
+
* `kosuke sessions watch`: a turn's frames as they happen, one JSON object per
|
|
6
|
+
* line. Hand-written because they arrive over the `/ws/jobs` WebSocket, which
|
|
7
|
+
* the OpenAPI document the rest of the tree is generated from cannot describe.
|
|
8
|
+
*/
|
|
9
|
+
/** Node's own WebSocket; `engines` guarantees a Node that has it. */
|
|
10
|
+
const openWebSocket = (url, on) => {
|
|
11
|
+
const socket = new WebSocket(url);
|
|
12
|
+
socket.binaryType = 'arraybuffer';
|
|
13
|
+
socket.addEventListener('open', () => on.open());
|
|
14
|
+
socket.addEventListener('message', (event) => {
|
|
15
|
+
const data = event.data;
|
|
16
|
+
on.message(typeof data === 'string' ? data : Buffer.from(data).toString('utf8'));
|
|
17
|
+
});
|
|
18
|
+
// Every failure, a refused upgrade included, reaches 'close' with a code;
|
|
19
|
+
// 'error' carries nothing more.
|
|
20
|
+
socket.addEventListener('close', (event) => on.close(event.code, event.reason));
|
|
21
|
+
return {
|
|
22
|
+
send: (text) => socket.send(text),
|
|
23
|
+
close: (code, reason) => socket.close(code, reason),
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Reads the watched job's status. The deploy messages report the project's
|
|
28
|
+
* latest Deploy, whose status is the outcome of the turn `lastStreamId` names:
|
|
29
|
+
* the watched turn's only while it names that one. A Deploy row from before the
|
|
30
|
+
* platform named its last turn has none, and then the reader falls back to the
|
|
31
|
+
* Deploy it saw the watched turn running in.
|
|
32
|
+
*/
|
|
33
|
+
function statusReader(client, target) {
|
|
34
|
+
const { projectId, sessionId, jobId } = target;
|
|
35
|
+
// The Deploy the watched turn ran in, once a reading showed it running.
|
|
36
|
+
let deployId = null;
|
|
37
|
+
return async (signal) => {
|
|
38
|
+
try {
|
|
39
|
+
if (target.jobType === 'deploy') {
|
|
40
|
+
const { data, error, response } = await client.GET('/api/projects/{projectId}/deploy-messages', { params: { path: { projectId } }, signal });
|
|
41
|
+
if (!response.ok)
|
|
42
|
+
return refused(response.status, error);
|
|
43
|
+
const body = record(record(data).data);
|
|
44
|
+
const liveTurn = text(body.activeStreamId);
|
|
45
|
+
const readDeploy = text(body.deployJobId);
|
|
46
|
+
if (liveTurn === jobId)
|
|
47
|
+
deployId = readDeploy;
|
|
48
|
+
if (liveTurn !== null && liveTurn !== jobId) {
|
|
49
|
+
return { ok: true, movedOn: `the Deploy moved on to turn ${liveTurn}` };
|
|
50
|
+
}
|
|
51
|
+
const lastTurn = text(body.lastStreamId);
|
|
52
|
+
if (lastTurn !== null && lastTurn !== jobId) {
|
|
53
|
+
return { ok: true, movedOn: `the Deploy moved on to turn ${lastTurn}` };
|
|
54
|
+
}
|
|
55
|
+
if (lastTurn === null && deployId !== null && readDeploy !== deployId) {
|
|
56
|
+
return { ok: true, movedOn: 'a later Deploy replaced this one' };
|
|
57
|
+
}
|
|
58
|
+
return { ok: true, status: String(body.status), error: text(body.error), errorCode: null };
|
|
59
|
+
}
|
|
60
|
+
const { data, error, response } = await client.GET('/api/projects/{projectId}/chat-sessions/{sessionId}/jobs/chat/{jobId}', { params: { path: { projectId, sessionId, jobId } }, signal });
|
|
61
|
+
if (!response.ok)
|
|
62
|
+
return refused(response.status, error);
|
|
63
|
+
const job = record(record(record(data).data).job);
|
|
64
|
+
return {
|
|
65
|
+
ok: true,
|
|
66
|
+
status: String(job.status),
|
|
67
|
+
error: text(job.error),
|
|
68
|
+
errorCode: text(job.errorCode),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
return { ok: false, httpStatus: null, message: describe(error) };
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Where to look at what the job produced. Built from the platform's own routes
|
|
78
|
+
* rather than read from `preview get`, which starts a paused sandbox: a watch
|
|
79
|
+
* on a job that ended an hour ago must not start billing for one.
|
|
80
|
+
*/
|
|
81
|
+
async function readLinks(client, apiUrl, target, stderr, signal) {
|
|
82
|
+
const project = `${apiUrl}/projects/${encodeURIComponent(target.projectId)}`;
|
|
83
|
+
if (target.jobType === 'deploy') {
|
|
84
|
+
// No preview link: members do not see the main sandbox's Preview.
|
|
85
|
+
return { deploy: `${project}?view=settings` };
|
|
86
|
+
}
|
|
87
|
+
const session = `${project}/chat-sessions?session=${encodeURIComponent(target.sessionId)}`;
|
|
88
|
+
let pullRequest = null;
|
|
89
|
+
try {
|
|
90
|
+
const { data, error, response } = await client.GET('/api/projects/{projectId}/chat-sessions/{sessionId}', { params: { path: { projectId: target.projectId, sessionId: target.sessionId } }, signal });
|
|
91
|
+
if (response.ok) {
|
|
92
|
+
pullRequest = text(record(record(data).data).prUrl);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
const { message } = refused(response.status, error);
|
|
96
|
+
stderr(`kosuke: could not read the pull request: ${message}`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
// Aborted: the watch stopped waiting and says so itself.
|
|
101
|
+
if (signal.aborted)
|
|
102
|
+
throw error;
|
|
103
|
+
stderr(`kosuke: could not read the pull request: ${describe(error)}`);
|
|
104
|
+
}
|
|
105
|
+
return { session, preview: `${session}&tab=preview`, pullRequest };
|
|
106
|
+
}
|
|
107
|
+
function refused(status, error) {
|
|
108
|
+
const message = text(record(error).error) ?? `HTTP ${status}`;
|
|
109
|
+
return { ok: false, httpStatus: status, message };
|
|
110
|
+
}
|
|
111
|
+
export function attachWatchCommand(root, runtime, deps = {}) {
|
|
112
|
+
const { connect = openWebSocket, stdout = (line) => process.stdout.write(line + '\n'), stderr = (line) => process.stderr.write(line + '\n'), exit = (code) => {
|
|
113
|
+
process.exitCode = code;
|
|
114
|
+
}, } = deps;
|
|
115
|
+
groupFor(root, ['sessions'])
|
|
116
|
+
.command('watch')
|
|
117
|
+
.description("Stream a turn's frames as NDJSON until its job ends: one frame per line on stdout, " +
|
|
118
|
+
'diagnostics on stderr. A dropped connection resumes after the last frame, and the ' +
|
|
119
|
+
"job's status is read every 5 s, so a stream that goes quiet still ends.")
|
|
120
|
+
.argument('<projectId>', 'Project id')
|
|
121
|
+
.argument('<sessionId>', 'Session id. Not read for --type deploy, which is per project.')
|
|
122
|
+
.argument('<jobId>', "The turn's chat job id. For --type deploy, the activeStreamId `kosuke deploy messages` returns.")
|
|
123
|
+
.addOption(new Option('--type <type>', 'What the job is.').choices(JOB_TYPES).default('chat'))
|
|
124
|
+
.option('--timeout <seconds>', 'Stop waiting after this many seconds and exit 124. Default: until the job ends.', seconds)
|
|
125
|
+
.addHelpText('after', '\nFrames from the platform carry an id. Two more, without one, come from this command:\n' +
|
|
126
|
+
" watch.status the job's status, when that rather than the stream ended the watch;\n" +
|
|
127
|
+
' its complete is false when frames after the last one may be missing\n' +
|
|
128
|
+
' watch.links last, once the job ended: where to see what it produced\n' +
|
|
129
|
+
'\nExit codes:\n' +
|
|
130
|
+
' 0 the job ended well\n' +
|
|
131
|
+
' 1 it failed or was stopped, or how a deploy turn ended could not be read\n' +
|
|
132
|
+
' 3 the API key was refused\n' +
|
|
133
|
+
' 4 the project, session or job was not found\n' +
|
|
134
|
+
' 124 --timeout passed first')
|
|
135
|
+
.action(async (projectId, sessionId, jobId, flags) => {
|
|
136
|
+
// First, so a missing API key fails with the message every command gives.
|
|
137
|
+
const client = runtime.client();
|
|
138
|
+
const { apiKey, apiUrl } = runtime.credentials();
|
|
139
|
+
const target = { projectId, sessionId, jobId, jobType: flags.type };
|
|
140
|
+
const code = await watchJob({
|
|
141
|
+
...target,
|
|
142
|
+
apiUrl,
|
|
143
|
+
apiKey: apiKey,
|
|
144
|
+
...(flags.timeout ? { timeoutMs: flags.timeout * 1000 } : {}),
|
|
145
|
+
}, {
|
|
146
|
+
connect,
|
|
147
|
+
checkStatus: statusReader(client, target),
|
|
148
|
+
readLinks: (signal) => readLinks(client, apiUrl, target, stderr, signal),
|
|
149
|
+
stdout,
|
|
150
|
+
stderr,
|
|
151
|
+
});
|
|
152
|
+
if (code !== WATCH_EXIT.ended)
|
|
153
|
+
exit(code);
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
function seconds(raw) {
|
|
157
|
+
if (!/^\d+$/.test(raw) || Number(raw) === 0) {
|
|
158
|
+
throw new InvalidArgumentError('Expected a whole number of seconds above 0.');
|
|
159
|
+
}
|
|
160
|
+
return Number(raw);
|
|
161
|
+
}
|
|
162
|
+
function record(value) {
|
|
163
|
+
return isRecord(value) ? value : {};
|
|
164
|
+
}
|
|
165
|
+
function text(value) {
|
|
166
|
+
return typeof value === 'string' && value ? value : null;
|
|
167
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export const operation = {
|
|
2
|
+
"method": "get",
|
|
3
|
+
"path": "/api/activity",
|
|
4
|
+
"command": [
|
|
5
|
+
"activity",
|
|
6
|
+
"list"
|
|
7
|
+
],
|
|
8
|
+
"summary": "List Activity across every workspace you belong to, newest first: Changes Kosuke observed and what members did. Each event names its workspace. An agent token reads its own workspace only.",
|
|
9
|
+
"pathParams": [],
|
|
10
|
+
"query": [
|
|
11
|
+
{
|
|
12
|
+
"name": "since",
|
|
13
|
+
"flag": "since",
|
|
14
|
+
"kind": "string",
|
|
15
|
+
"required": false,
|
|
16
|
+
"description": "Only events at or after this time: an ISO date or time, or a span back from now such as 24h or 7d."
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "unseen",
|
|
20
|
+
"flag": "unseen",
|
|
21
|
+
"kind": "boolean",
|
|
22
|
+
"required": false,
|
|
23
|
+
"description": "Only New events: after your Seen Mark and not your own. Returned oldest first, so --limit takes the earliest."
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "markSeen",
|
|
27
|
+
"flag": "mark-seen",
|
|
28
|
+
"kind": "boolean",
|
|
29
|
+
"required": false,
|
|
30
|
+
"description": "Return your New events, oldest first, and mark them seen in the same call, so no event comes back twice. Implies unseen; refused with project, kind or since, which would mark events you were not shown. Needs an API key: refused for a browser session."
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "workspace",
|
|
34
|
+
"flag": "workspace",
|
|
35
|
+
"kind": "string",
|
|
36
|
+
"required": false,
|
|
37
|
+
"description": "Only this workspace. Refused with 403 when you are not a member of it."
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "project",
|
|
41
|
+
"flag": "project",
|
|
42
|
+
"kind": "string",
|
|
43
|
+
"required": false,
|
|
44
|
+
"description": "Only this project, by id."
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "kind",
|
|
48
|
+
"flag": "kind",
|
|
49
|
+
"kind": "string",
|
|
50
|
+
"required": false,
|
|
51
|
+
"description": "Comma-separated kinds (job_awaiting_response, pr_checks_failed, pr_checks_passed, pr_merged, branch_behind, pr_stale, cron_run_succeeded, cron_run_failed, deployed, recovery_deploy_started, session_started, session_message_sent, session_archived, session_deleted, session_assigned, session_status_changed, session_priority_changed, cron_created, cron_updated, cron_deleted, member_invited, member_removed, member_role_changed, integration_custom_tool_saved, integration_custom_tool_enabled, integration_custom_tool_disabled, integration_custom_tool_deleted, integration_custom_tool_restored), or 'change' for every Change and 'action' for every Member Action."
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "limit",
|
|
55
|
+
"flag": "limit",
|
|
56
|
+
"kind": "integer",
|
|
57
|
+
"required": false,
|
|
58
|
+
"description": "Page size, 50 by default. Values above 200 are clamped, not rejected."
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"name": "cursor",
|
|
62
|
+
"flag": "cursor",
|
|
63
|
+
"kind": "string",
|
|
64
|
+
"required": false,
|
|
65
|
+
"description": "Cursor from a previous page (meta.pagination.nextCursor). Not used with markSeen."
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
"body": null,
|
|
69
|
+
"multipart": null,
|
|
70
|
+
"attachments": false,
|
|
71
|
+
"anonymous": false,
|
|
72
|
+
"agents": "all"
|
|
73
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export const operation = {
|
|
2
|
+
"method": "get",
|
|
3
|
+
"path": "/api/organizations/{workspaceId}/crons/{cronId}/artifacts",
|
|
4
|
+
"command": [
|
|
5
|
+
"crons",
|
|
6
|
+
"artifacts",
|
|
7
|
+
"list"
|
|
8
|
+
],
|
|
9
|
+
"summary": "List the Artifacts a cron's runs published, across all of its runs, most recently changed first: each one's title, kind and version, with the run and the project it came from, and the total the filters keep. One row per Artifact: the same slug published by two runs is two rows. Rows only: a body or a file url comes from crons runs artifacts get, with the row's runId. The project and kind filters each take several values and keep an Artifact matching any of them.",
|
|
10
|
+
"pathParams": [
|
|
11
|
+
"workspaceId",
|
|
12
|
+
"cronId"
|
|
13
|
+
],
|
|
14
|
+
"query": [
|
|
15
|
+
{
|
|
16
|
+
"name": "projectId",
|
|
17
|
+
"flag": "project",
|
|
18
|
+
"kind": "string",
|
|
19
|
+
"required": false,
|
|
20
|
+
"description": "Only the Artifacts of runs in these projects.",
|
|
21
|
+
"repeated": true
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "kind",
|
|
25
|
+
"flag": "kind",
|
|
26
|
+
"kind": "string",
|
|
27
|
+
"required": false,
|
|
28
|
+
"description": "Only the Artifacts of these kinds.",
|
|
29
|
+
"choices": [
|
|
30
|
+
"markdown",
|
|
31
|
+
"html",
|
|
32
|
+
"image",
|
|
33
|
+
"video"
|
|
34
|
+
],
|
|
35
|
+
"repeated": true
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "page",
|
|
39
|
+
"flag": "page",
|
|
40
|
+
"kind": "integer",
|
|
41
|
+
"required": false,
|
|
42
|
+
"description": "1-based. Default 1."
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "pageSize",
|
|
46
|
+
"flag": "page-size",
|
|
47
|
+
"kind": "integer",
|
|
48
|
+
"required": false,
|
|
49
|
+
"description": "Default 25. Values above 100 are clamped, not rejected."
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"body": null,
|
|
53
|
+
"multipart": null,
|
|
54
|
+
"attachments": false,
|
|
55
|
+
"anonymous": false,
|
|
56
|
+
"agents": "all"
|
|
57
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export const operation = {
|
|
2
|
+
"method": "post",
|
|
3
|
+
"path": "/api/organizations/{workspaceId}/crons",
|
|
4
|
+
"command": [
|
|
5
|
+
"crons",
|
|
6
|
+
"create"
|
|
7
|
+
],
|
|
8
|
+
"summary": "Create a cron, enabled, with you as its creator, with zero or more of the workspace's projects: each fire is one Cron Run in its own sandbox, cloning only the selected repositories. Every run spends the workspace's Credentials, never a member's Subscription, so a workspace with no usable provider is refused. The model is an encoded id such as anthropic:opus__xhigh; null or left out uses the saved Workspace Default Model when its Provider has usable workspace Credentials, otherwise Kosuke's choice among usable workspace Credentials at run time. The crontab is read in the Workspace Timezone (workspaces timezone-set), and may not fire more often than every 15 minutes. A body that sends timezone is refused. From an agent (Sensei, a sandbox or a Cron Run) it is refused with 409 CRON_ALREADY_EXISTS when the workspace has a Cron by that name.",
|
|
9
|
+
"pathParams": [
|
|
10
|
+
"workspaceId"
|
|
11
|
+
],
|
|
12
|
+
"query": [],
|
|
13
|
+
"body": {
|
|
14
|
+
"fields": [
|
|
15
|
+
{
|
|
16
|
+
"name": "name",
|
|
17
|
+
"flag": "name",
|
|
18
|
+
"kind": "string",
|
|
19
|
+
"required": true
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "projectIds",
|
|
23
|
+
"flag": "project",
|
|
24
|
+
"kind": "string",
|
|
25
|
+
"required": true,
|
|
26
|
+
"description": "The projects covered together by each Cron Run. Fixed when saved: a project created later joins only when the cron is edited to add it. Empty for a cron that needs no repository: its runs clone nothing.",
|
|
27
|
+
"repeated": true
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "prompt",
|
|
31
|
+
"flag": "prompt",
|
|
32
|
+
"kind": "string",
|
|
33
|
+
"required": true,
|
|
34
|
+
"description": "What each run asks the Cron Agent to do, handed to it word for word."
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"name": "cronExpression",
|
|
38
|
+
"flag": "cron-expression",
|
|
39
|
+
"kind": "string",
|
|
40
|
+
"required": true,
|
|
41
|
+
"description": "Five fields: minute, hour, day of month, month, day of week, read in the Workspace Timezone (kosuke workspaces timezone-set). At most one fire every 15 minutes."
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "reportTo",
|
|
45
|
+
"flag": "report-to",
|
|
46
|
+
"kind": "string",
|
|
47
|
+
"required": false,
|
|
48
|
+
"description": "Reports to: the members, by the id `kosuke workspaces members` prints, whose Sensei each message from a run of this cron goes to, at most 10. With one, every message goes to them; with several, the run chooses among them. Empty, or left out on create, lets the run choose any member. Left out on update, it stays as saved; an empty list clears it.",
|
|
49
|
+
"repeated": true
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"name": "model",
|
|
53
|
+
"flag": "model",
|
|
54
|
+
"kind": "string",
|
|
55
|
+
"required": false,
|
|
56
|
+
"description": "An encoded model id such as anthropic:opus__xhigh. Null, or left out on create, uses the Workspace Default Model at run time, then Kosuke's choice among available workspace Credentials."
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"required": true
|
|
60
|
+
},
|
|
61
|
+
"multipart": null,
|
|
62
|
+
"attachments": false,
|
|
63
|
+
"anonymous": false,
|
|
64
|
+
"agents": "all"
|
|
65
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const operation = {
|
|
2
|
+
"method": "delete",
|
|
3
|
+
"path": "/api/organizations/{workspaceId}/crons/{cronId}",
|
|
4
|
+
"command": [
|
|
5
|
+
"crons",
|
|
6
|
+
"delete"
|
|
7
|
+
],
|
|
8
|
+
"summary": "Delete a cron with its runs, their transcripts and their Artifacts. The sessions its runs filed stay. The creator or a workspace admin only.",
|
|
9
|
+
"pathParams": [
|
|
10
|
+
"workspaceId",
|
|
11
|
+
"cronId"
|
|
12
|
+
],
|
|
13
|
+
"query": [],
|
|
14
|
+
"body": null,
|
|
15
|
+
"multipart": null,
|
|
16
|
+
"attachments": false,
|
|
17
|
+
"anonymous": false
|
|
18
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export const operation = {
|
|
2
|
+
"method": "get",
|
|
3
|
+
"path": "/api/organizations/{workspaceId}/crons/{cronId}",
|
|
4
|
+
"command": [
|
|
5
|
+
"crons",
|
|
6
|
+
"get"
|
|
7
|
+
],
|
|
8
|
+
"summary": "Read one cron: its prompt, schedule, model, creator, when it runs next, its projects, its last run status, and how many runs in a row failed: five disable it.",
|
|
9
|
+
"pathParams": [
|
|
10
|
+
"workspaceId",
|
|
11
|
+
"cronId"
|
|
12
|
+
],
|
|
13
|
+
"query": [],
|
|
14
|
+
"body": null,
|
|
15
|
+
"multipart": null,
|
|
16
|
+
"attachments": false,
|
|
17
|
+
"anonymous": false,
|
|
18
|
+
"agents": "all"
|
|
19
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export const operation = {
|
|
2
|
+
"method": "get",
|
|
3
|
+
"path": "/api/organizations/{workspaceId}/crons",
|
|
4
|
+
"command": [
|
|
5
|
+
"crons",
|
|
6
|
+
"list"
|
|
7
|
+
],
|
|
8
|
+
"summary": "List the workspace's crons, newest first, with each one's projects, creator and last run status: the status of its latest run.",
|
|
9
|
+
"pathParams": [
|
|
10
|
+
"workspaceId"
|
|
11
|
+
],
|
|
12
|
+
"query": [
|
|
13
|
+
{
|
|
14
|
+
"name": "projectId",
|
|
15
|
+
"flag": "project",
|
|
16
|
+
"kind": "string",
|
|
17
|
+
"required": false,
|
|
18
|
+
"description": "Only the crons that include this project, alone or among others."
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "mine",
|
|
22
|
+
"flag": "mine",
|
|
23
|
+
"kind": "boolean",
|
|
24
|
+
"required": false,
|
|
25
|
+
"description": "Only the crons you created."
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "search",
|
|
29
|
+
"flag": "search",
|
|
30
|
+
"kind": "string",
|
|
31
|
+
"required": false,
|
|
32
|
+
"description": "Case-insensitive match on the name or the prompt."
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "page",
|
|
36
|
+
"flag": "page",
|
|
37
|
+
"kind": "integer",
|
|
38
|
+
"required": false,
|
|
39
|
+
"description": "1-based. Default 1."
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"name": "pageSize",
|
|
43
|
+
"flag": "page-size",
|
|
44
|
+
"kind": "integer",
|
|
45
|
+
"required": false,
|
|
46
|
+
"description": "Default 25. Values above 100 are clamped, not rejected."
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"body": null,
|
|
50
|
+
"multipart": null,
|
|
51
|
+
"attachments": false,
|
|
52
|
+
"anonymous": false,
|
|
53
|
+
"agents": "all"
|
|
54
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export const operation = {
|
|
2
|
+
"method": "post",
|
|
3
|
+
"path": "/api/organizations/{workspaceId}/crons/{cronId}/projects/{projectId}/resume",
|
|
4
|
+
"command": [
|
|
5
|
+
"crons",
|
|
6
|
+
"projects",
|
|
7
|
+
"resume"
|
|
8
|
+
],
|
|
9
|
+
"summary": "Projects are no longer paused one by one. Resume the cron. Returns 410 Gone.",
|
|
10
|
+
"pathParams": [
|
|
11
|
+
"workspaceId",
|
|
12
|
+
"cronId",
|
|
13
|
+
"projectId"
|
|
14
|
+
],
|
|
15
|
+
"query": [],
|
|
16
|
+
"body": null,
|
|
17
|
+
"multipart": null,
|
|
18
|
+
"attachments": false,
|
|
19
|
+
"anonymous": false,
|
|
20
|
+
"agents": "all"
|
|
21
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export const operation = {
|
|
2
|
+
"method": "post",
|
|
3
|
+
"path": "/api/organizations/{workspaceId}/crons/{cronId}/run",
|
|
4
|
+
"command": [
|
|
5
|
+
"crons",
|
|
6
|
+
"run"
|
|
7
|
+
],
|
|
8
|
+
"summary": "Fire one Cron Run covering all the cron's projects or the selected projectIds, in its own sandbox; a cron with no projects runs with none. Refused for a cron stopped with No projects left until an edit picks a project. Answers with runs: [{ runId, status, projectIds, projectId }]; projectId is deprecated and names the first project by name, or null. The creator or a workspace admin only.",
|
|
9
|
+
"pathParams": [
|
|
10
|
+
"workspaceId",
|
|
11
|
+
"cronId"
|
|
12
|
+
],
|
|
13
|
+
"query": [],
|
|
14
|
+
"body": {
|
|
15
|
+
"fields": [
|
|
16
|
+
{
|
|
17
|
+
"name": "projectIds",
|
|
18
|
+
"flag": "project",
|
|
19
|
+
"kind": "string",
|
|
20
|
+
"required": false,
|
|
21
|
+
"description": "Only these of the cron's projects. Left out, every project of the cron.",
|
|
22
|
+
"repeated": true
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "runId",
|
|
26
|
+
"flag": "run-id",
|
|
27
|
+
"kind": "string",
|
|
28
|
+
"required": false
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"required": false
|
|
32
|
+
},
|
|
33
|
+
"multipart": null,
|
|
34
|
+
"attachments": false,
|
|
35
|
+
"anonymous": false,
|
|
36
|
+
"agents": "all"
|
|
37
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export const operation = {
|
|
2
|
+
"method": "get",
|
|
3
|
+
"path": "/api/organizations/{workspaceId}/crons/{cronId}/runs/{runId}/artifacts/{artifactId}",
|
|
4
|
+
"command": [
|
|
5
|
+
"crons",
|
|
6
|
+
"runs",
|
|
7
|
+
"artifacts",
|
|
8
|
+
"get"
|
|
9
|
+
],
|
|
10
|
+
"summary": "Read one Artifact of a run of a cron, by its id or its slug: a markdown or html one carries its body, an image or a video a presigned url, its media type and its size.",
|
|
11
|
+
"pathParams": [
|
|
12
|
+
"workspaceId",
|
|
13
|
+
"cronId",
|
|
14
|
+
"runId",
|
|
15
|
+
"artifactId"
|
|
16
|
+
],
|
|
17
|
+
"query": [],
|
|
18
|
+
"body": null,
|
|
19
|
+
"multipart": null,
|
|
20
|
+
"attachments": false,
|
|
21
|
+
"anonymous": false,
|
|
22
|
+
"agents": "all"
|
|
23
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const operation = {
|
|
2
|
+
"method": "get",
|
|
3
|
+
"path": "/api/organizations/{workspaceId}/crons/{cronId}/runs/{runId}/artifacts",
|
|
4
|
+
"command": [
|
|
5
|
+
"crons",
|
|
6
|
+
"runs",
|
|
7
|
+
"artifacts",
|
|
8
|
+
"list"
|
|
9
|
+
],
|
|
10
|
+
"summary": "List the Artifacts a run of a cron published, most recently changed first. Rows only: a body or a file url comes from reading one.",
|
|
11
|
+
"pathParams": [
|
|
12
|
+
"workspaceId",
|
|
13
|
+
"cronId",
|
|
14
|
+
"runId"
|
|
15
|
+
],
|
|
16
|
+
"query": [],
|
|
17
|
+
"body": null,
|
|
18
|
+
"multipart": null,
|
|
19
|
+
"attachments": false,
|
|
20
|
+
"anonymous": false,
|
|
21
|
+
"agents": "all"
|
|
22
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export const operation = {
|
|
2
|
+
"method": "post",
|
|
3
|
+
"path": "/api/organizations/{workspaceId}/crons/{cronId}/runs/{runId}/cancel",
|
|
4
|
+
"command": [
|
|
5
|
+
"crons",
|
|
6
|
+
"runs",
|
|
7
|
+
"cancel"
|
|
8
|
+
],
|
|
9
|
+
"summary": "Stop a run of a cron that is still going, the way Stop on its page does. The run ends cancelled; the Artifacts it stored and the sessions it filed stay, and its sandbox is removed. The creator or a workspace admin only.",
|
|
10
|
+
"pathParams": [
|
|
11
|
+
"workspaceId",
|
|
12
|
+
"cronId",
|
|
13
|
+
"runId"
|
|
14
|
+
],
|
|
15
|
+
"query": [],
|
|
16
|
+
"body": null,
|
|
17
|
+
"multipart": null,
|
|
18
|
+
"attachments": false,
|
|
19
|
+
"anonymous": false,
|
|
20
|
+
"agents": "all"
|
|
21
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const operation = {
|
|
2
|
+
"method": "get",
|
|
3
|
+
"path": "/api/organizations/{workspaceId}/crons/{cronId}/runs/{runId}/diagnostics",
|
|
4
|
+
"command": [
|
|
5
|
+
"crons",
|
|
6
|
+
"runs",
|
|
7
|
+
"diagnostics"
|
|
8
|
+
],
|
|
9
|
+
"summary": "Read why a run of a cron ended as it did: its status, error, error code and stop source (member_stop, host_watch, deadline, replaced, sandbox_abort or runtime_error, with who stopped it), the sandbox it ran in and that sandbox's agent version, when each phase happened (queued, sandbox booted, credentials ready, agent requested, first event, done), the sandbox's own done payload, and the Cron Agent's log lines from the sandbox with secrets redacted. The log is capped at 256 KB and cleared after 30 days. The creator or a workspace admin only.",
|
|
10
|
+
"pathParams": [
|
|
11
|
+
"workspaceId",
|
|
12
|
+
"cronId",
|
|
13
|
+
"runId"
|
|
14
|
+
],
|
|
15
|
+
"query": [],
|
|
16
|
+
"body": null,
|
|
17
|
+
"multipart": null,
|
|
18
|
+
"attachments": false,
|
|
19
|
+
"anonymous": false
|
|
20
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export const operation = {
|
|
2
|
+
"method": "get",
|
|
3
|
+
"path": "/api/organizations/{workspaceId}/crons/{cronId}/runs/{runId}",
|
|
4
|
+
"command": [
|
|
5
|
+
"crons",
|
|
6
|
+
"runs",
|
|
7
|
+
"get"
|
|
8
|
+
],
|
|
9
|
+
"summary": "Read one run of a cron: the projects it covered, its status, the model it ran on, the Cron Agent's reply, and the sessions it filed with each one's status and whether it waits for an answer.",
|
|
10
|
+
"pathParams": [
|
|
11
|
+
"workspaceId",
|
|
12
|
+
"cronId",
|
|
13
|
+
"runId"
|
|
14
|
+
],
|
|
15
|
+
"query": [],
|
|
16
|
+
"body": null,
|
|
17
|
+
"multipart": null,
|
|
18
|
+
"attachments": false,
|
|
19
|
+
"anonymous": false,
|
|
20
|
+
"agents": "all"
|
|
21
|
+
};
|