Repository navigation
Conversation
Contributor
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
can someone merge this |
Author
|
rebased |
Adds packages/api-v2 (wire, events, projections, OpenAPI) and the api-v2 server routes in cyberstrike, migrates plugins to @cyberstrike-io/sdk/v2, regenerates v2 SDK types, and adds the contract check script with a CI workflow. Also documents the v1-to-v2 mapping decisions and removes the applescript skill file.
Replace most 503 stubs in the v2 API with real handlers backed by the v1 domain: session, message, permission, fs, vcs, mcp, worktree, pty, persistent pty, shell, credential, saved permissions, debug, catalog reads, config, and plugin and rpc registries. Still answering 503 (no backing or pending a decision): server.pair, server.connect, integration.wellknown.add, integration.connect.external, mcp.client, mcp.clientToken, session.background, voice.models, voice.session, voice.instructions. Behaviour change outside v2: "always" permission replies are now persisted and read back as allow rules by PermissionNext.ask.
Replace the 503 stubs with real handlers: - integration.wellknown.add: https only (http for localhost), with the discovered auth command run only when it exactly matches the integration.wellknown_commands config allowlist. - integration.connect.external: stores an env-var reference, never the secret; resolved when the provider is used. - server.pair / server.connect: single-use 5-minute pairing codes, hashed storage, 30-day bearer tokens, per-peer failure rate limit. - mcp.clientToken / mcp.client: single-use directory-bound token; the socket attaches its tools to v1 MCP only while connected. - session.background: moves the session's running bash command into the shell registry. Voice endpoints (voice.models, voice.session, voice.instructions) still answer 503 pending a provider choice. Also documents the 503 status of the v2 surface in docs/v2-api.md.
Author
|
@badchars ping |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #171
Implements the v2 API over CyberStrike's existing v1 domain. Most endpoints now return real data, including session, message, permission, fs, vcs, mcp, worktree, pty, persistent pty, shell, credentials, saved permissions, debug, catalog reads, config, plugin and rpc registries, reference, websearch, generate, integration auth, pairing, client-hosted MCP, and session background.
Three voice endpoints (
voice.models,voice.session,voice.instructions) still answer503 not implemented. CyberStrike has no realtime or audio provider, so they're waiting on a provider choice.Behaviour changes outside v2 (review these)
permission_savedtable and read back as allow rules byPermissionNext.ask.patchJsoncnow removes keys set toundefined, which changes v1 config writes.session.createdis logged.prompt.tsinjects session instructions into the system prompt. The bash tool and session shell take a per-session env overlay.bash.ts/shell/registry.ts:session.backgrounddetaches a running bash command into the shell registry. Only one foreground command per session can be backgrounded.integration.wellknown_commandsallowlist. Only argv entries listed there are ever run from a discovered well-known document.Security-sensitive additions
integration.wellknown.add: https only (http for localhost only), no redirects, size and time limits, and it executes only allowlisted argv.server.pair/server.connect: 16-byte codes, 5-minute TTL, single use, hashed storage, 30-day bearer tokens, 5 failures per minute per peer. Bearer tokens are not accepted on terminal WebSocket upgrades, which still need Basic auth or a ticket.mcp.clientToken/mcp.client: single-use token bound to a directory and client name, 5-minute TTL. Client tools exist only while the socket is attached.Known issues
server.stopafter a server-initiated WebSocket close. Shutdown can hang in the connect-failure teardown path.integration.connect.externalis not advertised inintegration.list, so clients can't discover it yet.Testing
bun run typecheck: clean.bun test --timeout 30000 test/api-v2: 92 pass, 0 fail, 33 files.