Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,26 @@ env:
IMAGE: ghcr.io/${{ github.repository_owner }}/spacebot

jobs:
verify-version:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

- name: Verify Cargo.toml version matches tag
run: |
TAG="${GITHUB_REF#refs/tags/v}"
CARGO_VERSION=$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/')
echo "Git tag version: $TAG"
echo "Cargo.toml version: $CARGO_VERSION"
if [ "$TAG" != "$CARGO_VERSION" ]; then
echo "::error::Version mismatch! Git tag is v${TAG} but Cargo.toml has version ${CARGO_VERSION}. Bump the version in Cargo.toml before tagging."
exit 1
fi

build-binaries:
needs: [verify-version]
if: always() && (needs.verify-version.result == 'success' || needs.verify-version.result == 'skipped')
strategy:
matrix:
include:
Expand Down Expand Up @@ -103,6 +122,8 @@ jobs:
retention-days: 1

build-docker:
needs: [verify-version]
if: always() && (needs.verify-version.result == 'success' || needs.verify-version.result == 'skipped')
strategy:
matrix:
include:
Expand Down
58 changes: 58 additions & 0 deletions interface/src/api/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,45 @@ export interface StatusBlockSnapshot {
/** channel_id -> StatusBlockSnapshot */
export type ChannelStatusResponse = Record<string, StatusBlockSnapshot>;

export interface PromptInspectResponse {
channel_id: string;
system_prompt: string;
total_chars: number;
history_length: number;
history: unknown[];
capture_enabled: boolean;
/** Present when the channel is not active */
error?: string;
message?: string;
}

export interface PromptSnapshotSummary {
timestamp_ms: number;
user_message: string;
system_prompt_chars: number;
history_length: number;
}

export interface PromptSnapshotListResponse {
channel_id: string;
snapshots: PromptSnapshotSummary[];
}

export interface PromptSnapshot {
channel_id: string;
timestamp_ms: number;
user_message: string;
system_prompt: string;
system_prompt_chars: number;
history: unknown;
history_length: number;
}

export interface PromptCaptureResponse {
channel_id: string;
capture_enabled: boolean;
}

// --- Workers API types ---

export type ActionContent =
Expand Down Expand Up @@ -1634,6 +1673,25 @@ export const api = {
return fetchJson<MessagesResponse>(`/channels/messages?${params}`);
},
channelStatus: () => fetchJson<ChannelStatusResponse>("/channels/status"),
inspectPrompt: (channelId: string) =>
fetchJson<PromptInspectResponse>(`/channels/inspect?channel_id=${encodeURIComponent(channelId)}`),
setPromptCapture: async (channelId: string, enabled: boolean) => {
const response = await fetch(`${API_BASE}/channels/inspect/capture`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ channel_id: channelId, enabled }),
});
if (!response.ok) throw new Error(`API error: ${response.status}`);
return response.json() as Promise<PromptCaptureResponse>;
},
listPromptSnapshots: (channelId: string, limit = 50) =>
fetchJson<PromptSnapshotListResponse>(
`/channels/inspect/snapshots?channel_id=${encodeURIComponent(channelId)}&limit=${limit}`,
),
getPromptSnapshot: (channelId: string, timestampMs: number) =>
fetchJson<PromptSnapshot>(
`/channels/inspect/snapshot?channel_id=${encodeURIComponent(channelId)}&timestamp_ms=${timestampMs}`,
),
workersList: (agentId: string, params: { limit?: number; offset?: number; status?: string } = {}) => {
const search = new URLSearchParams({ agent_id: agentId });
if (params.limit) search.set("limit", String(params.limit));
Expand Down
Loading
Loading