feat: associate threads with projects (#8745)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -181,6 +181,15 @@ pub struct RemoveSecretRequest {
|
|||||||
pub key: String,
|
pub key: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Update the project association for a session.
|
||||||
|
#[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)]
|
||||||
|
#[request(method = "_goose/session/update_project", response = EmptyResponse)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
pub struct UpdateSessionProjectRequest {
|
||||||
|
pub session_id: String,
|
||||||
|
pub project_id: Option<String>,
|
||||||
|
}
|
||||||
|
|
||||||
/// Archive a session (soft delete).
|
/// Archive a session (soft delete).
|
||||||
#[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)]
|
#[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)]
|
||||||
#[request(method = "_goose/session/archive", response = EmptyResponse)]
|
#[request(method = "_goose/session/archive", response = EmptyResponse)]
|
||||||
|
|||||||
@@ -90,6 +90,11 @@
|
|||||||
"requestType": "ImportSessionRequest",
|
"requestType": "ImportSessionRequest",
|
||||||
"responseType": "ImportSessionResponse"
|
"responseType": "ImportSessionResponse"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"method": "_goose/session/update_project",
|
||||||
|
"requestType": "UpdateSessionProjectRequest",
|
||||||
|
"responseType": "EmptyResponse"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"method": "_goose/session/archive",
|
"method": "_goose/session/archive",
|
||||||
"requestType": "ArchiveSessionRequest",
|
"requestType": "ArchiveSessionRequest",
|
||||||
|
|||||||
@@ -669,6 +669,26 @@
|
|||||||
"x-side": "agent",
|
"x-side": "agent",
|
||||||
"x-method": "_goose/session/import"
|
"x-method": "_goose/session/import"
|
||||||
},
|
},
|
||||||
|
"UpdateSessionProjectRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"sessionId": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"projectId": {
|
||||||
|
"type": [
|
||||||
|
"string",
|
||||||
|
"null"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"sessionId"
|
||||||
|
],
|
||||||
|
"description": "Update the project association for a session.",
|
||||||
|
"x-side": "agent",
|
||||||
|
"x-method": "_goose/session/update_project"
|
||||||
|
},
|
||||||
"ArchiveSessionRequest": {
|
"ArchiveSessionRequest": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -1487,6 +1507,15 @@
|
|||||||
"description": "Params for _goose/session/import",
|
"description": "Params for _goose/session/import",
|
||||||
"title": "ImportSessionRequest"
|
"title": "ImportSessionRequest"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"allOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/$defs/UpdateSessionProjectRequest"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Params for _goose/session/update_project",
|
||||||
|
"title": "UpdateSessionProjectRequest"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"allOf": [
|
"allOf": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -153,6 +153,24 @@ fn sid_short(id: &str) -> String {
|
|||||||
id.chars().take(8).collect()
|
id.chars().take(8).collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn thread_session_meta(
|
||||||
|
message_count: i64,
|
||||||
|
metadata: &crate::session::ThreadMetadata,
|
||||||
|
) -> serde_json::Map<String, serde_json::Value> {
|
||||||
|
let mut meta = serde_json::Map::new();
|
||||||
|
meta.insert(
|
||||||
|
"messageCount".to_string(),
|
||||||
|
serde_json::Value::Number(message_count.into()),
|
||||||
|
);
|
||||||
|
if let Some(ref pid) = metadata.project_id {
|
||||||
|
meta.insert(
|
||||||
|
"projectId".to_string(),
|
||||||
|
serde_json::Value::String(pid.clone()),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
meta
|
||||||
|
}
|
||||||
|
|
||||||
fn extract_timeout_from_meta(meta: &Option<Meta>) -> Option<u64> {
|
fn extract_timeout_from_meta(meta: &Option<Meta>) -> Option<u64> {
|
||||||
meta.as_ref()
|
meta.as_ref()
|
||||||
.and_then(|m| m.get("timeout"))
|
.and_then(|m| m.get("timeout"))
|
||||||
@@ -1539,9 +1557,17 @@ impl GooseAcpAgent {
|
|||||||
.and_then(|v| v.as_str())
|
.and_then(|v| v.as_str())
|
||||||
.map(|s| s.to_string());
|
.map(|s| s.to_string());
|
||||||
|
|
||||||
|
let project_id = args
|
||||||
|
.meta
|
||||||
|
.as_ref()
|
||||||
|
.and_then(|m| m.get("projectId"))
|
||||||
|
.and_then(|v| v.as_str())
|
||||||
|
.map(|s| s.to_string());
|
||||||
|
|
||||||
// Create the Thread — this IS the ACP session from the client's perspective.
|
// Create the Thread — this IS the ACP session from the client's perspective.
|
||||||
let thread_metadata = crate::session::ThreadMetadata {
|
let thread_metadata = crate::session::ThreadMetadata {
|
||||||
provider_id: requested_provider.clone(),
|
provider_id: requested_provider.clone(),
|
||||||
|
project_id,
|
||||||
mode: Some(self.goose_mode.to_string()),
|
mode: Some(self.goose_mode.to_string()),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
@@ -2544,11 +2570,7 @@ impl GooseAcpAgent {
|
|||||||
.as_deref()
|
.as_deref()
|
||||||
.map(std::path::PathBuf::from)
|
.map(std::path::PathBuf::from)
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
let mut meta = serde_json::Map::new();
|
let meta = thread_session_meta(t.message_count, &t.metadata);
|
||||||
meta.insert(
|
|
||||||
"messageCount".to_string(),
|
|
||||||
serde_json::Value::Number(t.message_count.into()),
|
|
||||||
);
|
|
||||||
SessionInfo::new(SessionId::new(t.id), cwd)
|
SessionInfo::new(SessionId::new(t.id), cwd)
|
||||||
.title(t.name)
|
.title(t.name)
|
||||||
.updated_at(t.updated_at.to_rfc3339())
|
.updated_at(t.updated_at.to_rfc3339())
|
||||||
@@ -2613,11 +2635,7 @@ impl GooseAcpAgent {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
let mut meta = serde_json::Map::new();
|
let meta = thread_session_meta(new_thread.message_count, &new_thread.metadata);
|
||||||
meta.insert(
|
|
||||||
"messageCount".to_string(),
|
|
||||||
serde_json::Value::Number(new_thread.message_count.into()),
|
|
||||||
);
|
|
||||||
|
|
||||||
let mut response = ForkSessionResponse::new(SessionId::new(new_thread_id))
|
let mut response = ForkSessionResponse::new(SessionId::new(new_thread_id))
|
||||||
.modes(mode_state)
|
.modes(mode_state)
|
||||||
@@ -3047,6 +3065,19 @@ impl GooseAcpAgent {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[custom_method(UpdateSessionProjectRequest)]
|
||||||
|
async fn on_update_session_project(
|
||||||
|
&self,
|
||||||
|
req: UpdateSessionProjectRequest,
|
||||||
|
) -> Result<EmptyResponse, sacp::Error> {
|
||||||
|
let project_id = req.project_id;
|
||||||
|
self.update_thread_metadata(&req.session_id, move |meta| {
|
||||||
|
meta.project_id = project_id;
|
||||||
|
})
|
||||||
|
.await?;
|
||||||
|
Ok(EmptyResponse {})
|
||||||
|
}
|
||||||
|
|
||||||
#[custom_method(ArchiveSessionRequest)]
|
#[custom_method(ArchiveSessionRequest)]
|
||||||
async fn on_archive_session(
|
async fn on_archive_session(
|
||||||
&self,
|
&self,
|
||||||
@@ -3189,7 +3220,7 @@ impl GooseAcpAgent {
|
|||||||
other => {
|
other => {
|
||||||
return Err(
|
return Err(
|
||||||
sacp::Error::invalid_params().data(format!("Unsupported format: {other}"))
|
sacp::Error::invalid_params().data(format!("Unsupported format: {other}"))
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ const LEGACY_SESSION_CACHE_STORAGE_KEY = "goose:chat-sessions";
|
|||||||
|
|
||||||
export interface SessionMetadataOverlayRecord {
|
export interface SessionMetadataOverlayRecord {
|
||||||
sessionId: string;
|
sessionId: string;
|
||||||
projectId?: string | null;
|
|
||||||
userSetTitle?: string | null;
|
userSetTitle?: string | null;
|
||||||
|
projectId?: string | null;
|
||||||
providerId?: string | null;
|
providerId?: string | null;
|
||||||
personaId?: string | null;
|
personaId?: string | null;
|
||||||
modelId?: string | null;
|
modelId?: string | null;
|
||||||
@@ -74,8 +74,8 @@ function recordFromLegacySession(
|
|||||||
): SessionMetadataOverlayRecord {
|
): SessionMetadataOverlayRecord {
|
||||||
return {
|
return {
|
||||||
sessionId: session.acpSessionId ?? session.id,
|
sessionId: session.acpSessionId ?? session.id,
|
||||||
projectId: session.projectId,
|
|
||||||
userSetTitle: session.userSetName ? session.title : null,
|
userSetTitle: session.userSetName ? session.title : null,
|
||||||
|
projectId: session.projectId ?? null,
|
||||||
providerId: session.providerId,
|
providerId: session.providerId,
|
||||||
personaId: session.personaId,
|
personaId: session.personaId,
|
||||||
modelId: session.modelId,
|
modelId: session.modelId,
|
||||||
|
|||||||
@@ -142,6 +142,7 @@ describe("chatSessionStore", () => {
|
|||||||
title: null,
|
title: null,
|
||||||
updatedAt: "2026-04-02",
|
updatedAt: "2026-04-02",
|
||||||
messageCount: 7,
|
messageCount: 7,
|
||||||
|
projectId: "project-123",
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import {
|
|||||||
upsertSessionMetadataOverlayRecord,
|
upsertSessionMetadataOverlayRecord,
|
||||||
type SessionMetadataOverlayRecord,
|
type SessionMetadataOverlayRecord,
|
||||||
} from "@/features/chat/lib/sessionMetadataOverlay";
|
} from "@/features/chat/lib/sessionMetadataOverlay";
|
||||||
|
import { updateSessionProject } from "@/shared/api/acpApi";
|
||||||
|
|
||||||
export interface ChatSession {
|
export interface ChatSession {
|
||||||
id: string;
|
id: string;
|
||||||
@@ -114,8 +115,8 @@ function buildOverlayRecord(
|
|||||||
): SessionMetadataOverlayRecord {
|
): SessionMetadataOverlayRecord {
|
||||||
return {
|
return {
|
||||||
sessionId: overlayKeyForSession(session),
|
sessionId: overlayKeyForSession(session),
|
||||||
projectId: session.projectId ?? null,
|
|
||||||
userSetTitle: session.userSetName ? session.title : null,
|
userSetTitle: session.userSetName ? session.title : null,
|
||||||
|
projectId: session.projectId ?? null,
|
||||||
providerId: session.providerId ?? null,
|
providerId: session.providerId ?? null,
|
||||||
personaId: session.personaId ?? null,
|
personaId: session.personaId ?? null,
|
||||||
modelId: session.modelId ?? null,
|
modelId: session.modelId ?? null,
|
||||||
@@ -139,7 +140,7 @@ function overlayToFallbackSession(
|
|||||||
id: overlay.sessionId,
|
id: overlay.sessionId,
|
||||||
acpSessionId: overlay.sessionId,
|
acpSessionId: overlay.sessionId,
|
||||||
title: overlay.userSetTitle ?? overlay.lastKnownTitle ?? "Untitled",
|
title: overlay.userSetTitle ?? overlay.lastKnownTitle ?? "Untitled",
|
||||||
projectId: overlay.projectId,
|
projectId: overlay.projectId ?? undefined,
|
||||||
agentId: overlay.agentId ?? undefined,
|
agentId: overlay.agentId ?? undefined,
|
||||||
providerId: overlay.providerId ?? undefined,
|
providerId: overlay.providerId ?? undefined,
|
||||||
personaId: overlay.personaId ?? undefined,
|
personaId: overlay.personaId ?? undefined,
|
||||||
@@ -166,7 +167,7 @@ function mergeAcpSessionWithOverlay(
|
|||||||
session.title ??
|
session.title ??
|
||||||
overlay?.lastKnownTitle ??
|
overlay?.lastKnownTitle ??
|
||||||
"Untitled",
|
"Untitled",
|
||||||
projectId: overlay?.projectId,
|
projectId: session.projectId ?? undefined,
|
||||||
agentId: overlay?.agentId ?? undefined,
|
agentId: overlay?.agentId ?? undefined,
|
||||||
providerId: overlay?.providerId ?? undefined,
|
providerId: overlay?.providerId ?? undefined,
|
||||||
personaId: overlay?.personaId ?? undefined,
|
personaId: overlay?.personaId ?? undefined,
|
||||||
@@ -239,6 +240,7 @@ export const useChatSessionStore = create<ChatSessionStore>((set, get) => ({
|
|||||||
const { sessionId } = await acpCreateSession(providerId, opts.workingDir, {
|
const { sessionId } = await acpCreateSession(providerId, opts.workingDir, {
|
||||||
personaId: opts.personaId,
|
personaId: opts.personaId,
|
||||||
modelId: opts.modelId,
|
modelId: opts.modelId,
|
||||||
|
projectId: opts.projectId,
|
||||||
});
|
});
|
||||||
const chatSession: ChatSession = {
|
const chatSession: ChatSession = {
|
||||||
id: sessionId,
|
id: sessionId,
|
||||||
@@ -318,7 +320,15 @@ export const useChatSessionStore = create<ChatSessionStore>((set, get) => ({
|
|||||||
buildOverlayRecord(updatedSession, existing),
|
buildOverlayRecord(updatedSession, existing),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// TODO: wire session updates to ACP when supported
|
|
||||||
|
// Persist projectId change to ACP backend
|
||||||
|
const acpSessionId = updatedSession?.acpSessionId;
|
||||||
|
if ("projectId" in patch && acpSessionId) {
|
||||||
|
updateSessionProject(acpSessionId, patch.projectId ?? null).catch(
|
||||||
|
(err: unknown) =>
|
||||||
|
console.error("Failed to update session project in backend:", err),
|
||||||
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
addSession: (session) => {
|
addSession: (session) => {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import type { ContentBlock } from "@agentclientprotocol/sdk";
|
import type { ContentBlock } from "@agentclientprotocol/sdk";
|
||||||
import * as directAcp from "./acpApi";
|
import * as directAcp from "./acpApi";
|
||||||
|
import type { AcpSessionInfo } from "./acpApi";
|
||||||
import * as sessionTracker from "./acpSessionTracker";
|
import * as sessionTracker from "./acpSessionTracker";
|
||||||
import {
|
import {
|
||||||
getCatalogEntry,
|
getCatalogEntry,
|
||||||
@@ -27,6 +28,7 @@ export interface AcpSendMessageOptions {
|
|||||||
|
|
||||||
export interface AcpPrepareSessionOptions {
|
export interface AcpPrepareSessionOptions {
|
||||||
personaId?: string;
|
personaId?: string;
|
||||||
|
projectId?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AcpCreateSessionOptions extends AcpPrepareSessionOptions {
|
export interface AcpCreateSessionOptions extends AcpPrepareSessionOptions {
|
||||||
@@ -116,6 +118,7 @@ export async function acpPrepareSession(
|
|||||||
providerId,
|
providerId,
|
||||||
workingDir,
|
workingDir,
|
||||||
options.personaId,
|
options.personaId,
|
||||||
|
options.projectId,
|
||||||
);
|
);
|
||||||
perfLog(
|
perfLog(
|
||||||
`[perf:prepare] ${sid} acpPrepareSession done in ${(performance.now() - t0).toFixed(1)}ms`,
|
`[perf:prepare] ${sid} acpPrepareSession done in ${(performance.now() - t0).toFixed(1)}ms`,
|
||||||
@@ -155,13 +158,7 @@ export async function acpSetModel(
|
|||||||
return directAcp.setModel(gooseSessionId ?? sessionId, modelId);
|
return directAcp.setModel(gooseSessionId ?? sessionId, modelId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Session info returned by the goose binary's list_sessions. */
|
export type { AcpSessionInfo };
|
||||||
export interface AcpSessionInfo {
|
|
||||||
sessionId: string;
|
|
||||||
title: string | null;
|
|
||||||
updatedAt: string | null;
|
|
||||||
messageCount: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AcpSessionSearchResult {
|
export interface AcpSessionSearchResult {
|
||||||
sessionId: string;
|
sessionId: string;
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ export interface AcpSessionInfo {
|
|||||||
title: string | null;
|
title: string | null;
|
||||||
updatedAt: string | null;
|
updatedAt: string | null;
|
||||||
messageCount: number;
|
messageCount: number;
|
||||||
|
projectId?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const DEPRECATED_PROVIDER_IDS = new Set(["claude-code", "codex", "gemini-cli"]);
|
const DEPRECATED_PROVIDER_IDS = new Set(["claude-code", "codex", "gemini-cli"]);
|
||||||
@@ -50,6 +51,7 @@ export async function listSessions(): Promise<AcpSessionInfo[]> {
|
|||||||
title: info.title ?? null,
|
title: info.title ?? null,
|
||||||
updatedAt: info.updatedAt ?? null,
|
updatedAt: info.updatedAt ?? null,
|
||||||
messageCount: (info._meta?.messageCount as number) ?? 0,
|
messageCount: (info._meta?.messageCount as number) ?? 0,
|
||||||
|
projectId: (info._meta?.projectId as string) ?? null,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,6 +126,17 @@ export async function updateWorkingDir(
|
|||||||
await client.extMethod("goose/working_dir/update", { sessionId, workingDir });
|
await client.extMethod("goose/working_dir/update", { sessionId, workingDir });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function updateSessionProject(
|
||||||
|
sessionId: string,
|
||||||
|
projectId: string | null,
|
||||||
|
): Promise<void> {
|
||||||
|
const client = await getClient();
|
||||||
|
await client.extMethod("_goose/session/update_project", {
|
||||||
|
sessionId,
|
||||||
|
projectId,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
export async function cancelSession(sessionId: string): Promise<void> {
|
export async function cancelSession(sessionId: string): Promise<void> {
|
||||||
const client = await getClient();
|
const client = await getClient();
|
||||||
await client.cancel({ sessionId });
|
await client.cancel({ sessionId });
|
||||||
@@ -132,6 +145,7 @@ export async function cancelSession(sessionId: string): Promise<void> {
|
|||||||
export async function newSession(
|
export async function newSession(
|
||||||
workingDir: string,
|
workingDir: string,
|
||||||
providerId?: string,
|
providerId?: string,
|
||||||
|
projectId?: string,
|
||||||
): Promise<NewSessionResponse> {
|
): Promise<NewSessionResponse> {
|
||||||
const tClient = performance.now();
|
const tClient = performance.now();
|
||||||
const client = await getClient();
|
const client = await getClient();
|
||||||
@@ -142,9 +156,10 @@ export async function newSession(
|
|||||||
mcpServers: [],
|
mcpServers: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
if (providerId) {
|
const meta: Record<string, string> = {};
|
||||||
request.meta = { provider: providerId };
|
if (providerId) meta.provider = providerId;
|
||||||
}
|
if (projectId) meta.projectId = projectId;
|
||||||
|
if (Object.keys(meta).length > 0) request.meta = meta;
|
||||||
|
|
||||||
const tCall = performance.now();
|
const tCall = performance.now();
|
||||||
const response = await client.newSession(request);
|
const response = await client.newSession(request);
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ export async function prepareSession(
|
|||||||
providerId: string,
|
providerId: string,
|
||||||
workingDir: string,
|
workingDir: string,
|
||||||
personaId?: string,
|
personaId?: string,
|
||||||
|
projectId?: string,
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
const sid = sessionId.slice(0, 8);
|
const sid = sessionId.slice(0, 8);
|
||||||
const key = makeKey(sessionId, personaId);
|
const key = makeKey(sessionId, personaId);
|
||||||
@@ -101,7 +102,7 @@ export async function prepareSession(
|
|||||||
|
|
||||||
if (!gooseSessionId) {
|
if (!gooseSessionId) {
|
||||||
const tNew = performance.now();
|
const tNew = performance.now();
|
||||||
const response = await acpApi.newSession(workingDir, providerId);
|
const response = await acpApi.newSession(workingDir, providerId, projectId);
|
||||||
gooseSessionId = response.sessionId;
|
gooseSessionId = response.sessionId;
|
||||||
perfLog(
|
perfLog(
|
||||||
`[perf:prepare] ${sid} tracker newSession done in ${(performance.now() - tNew).toFixed(1)}ms (goose_sid=${gooseSessionId.slice(0, 8)})`,
|
`[perf:prepare] ${sid} tracker newSession done in ${(performance.now() - tNew).toFixed(1)}ms (goose_sid=${gooseSessionId.slice(0, 8)})`,
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ import type {
|
|||||||
RemoveExtensionRequest,
|
RemoveExtensionRequest,
|
||||||
RemoveSecretRequest,
|
RemoveSecretRequest,
|
||||||
UnarchiveSessionRequest,
|
UnarchiveSessionRequest,
|
||||||
|
UpdateSessionProjectRequest,
|
||||||
UpdateSourceRequest,
|
UpdateSourceRequest,
|
||||||
UpdateSourceResponse,
|
UpdateSourceResponse,
|
||||||
UpdateWorkingDirRequest,
|
UpdateWorkingDirRequest,
|
||||||
@@ -194,6 +195,12 @@ export class GooseExtClient {
|
|||||||
return zImportSessionResponse.parse(raw) as ImportSessionResponse;
|
return zImportSessionResponse.parse(raw) as ImportSessionResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async GooseSessionUpdateProject(
|
||||||
|
params: UpdateSessionProjectRequest,
|
||||||
|
): Promise<void> {
|
||||||
|
await this.conn.extMethod("_goose/session/update_project", params);
|
||||||
|
}
|
||||||
|
|
||||||
async GooseSessionArchive(params: ArchiveSessionRequest): Promise<void> {
|
async GooseSessionArchive(params: ArchiveSessionRequest): Promise<void> {
|
||||||
await this.conn.extMethod("_goose/session/archive", params);
|
await this.conn.extMethod("_goose/session/archive", params);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This file is auto-generated by @hey-api/openapi-ts
|
// This file is auto-generated by @hey-api/openapi-ts
|
||||||
|
|
||||||
export type { AddExtensionRequest, ArchiveSessionRequest, CheckSecretRequest, CheckSecretResponse, CreateSourceRequest, CreateSourceResponse, DeleteSessionRequest, DeleteSourceRequest, DictationConfigRequest, DictationConfigResponse, DictationDownloadProgress, DictationLocalModelStatus, DictationModelCancelRequest, DictationModelDeleteRequest, DictationModelDownloadProgressRequest, DictationModelDownloadProgressResponse, DictationModelDownloadRequest, DictationModelOption, DictationModelSelectRequest, DictationModelsListRequest, DictationModelsListResponse, DictationProviderStatusEntry, DictationTranscribeRequest, DictationTranscribeResponse, EmptyResponse, ExportSessionRequest, ExportSessionResponse, ExportSourceRequest, ExportSourceResponse, ExtRequest, ExtResponse, GetExtensionsRequest, GetExtensionsResponse, GetSessionExtensionsRequest, GetSessionExtensionsResponse, GetToolsRequest, GetToolsResponse, ImportSessionRequest, ImportSessionResponse, ImportSourcesRequest, ImportSourcesResponse, ListProvidersRequest, ListProvidersResponse, ListSourcesRequest, ListSourcesResponse, ProviderConfigKey, ProviderInventoryEntryDto, ProviderInventoryModelDto, ReadConfigRequest, ReadConfigResponse, ReadResourceRequest, ReadResourceResponse, RefreshProviderInventoryRequest, RefreshProviderInventoryResponse, RefreshProviderInventorySkipDto, RefreshProviderInventorySkipReasonDto, RemoveConfigRequest, RemoveExtensionRequest, RemoveSecretRequest, SourceEntry, SourceType, UnarchiveSessionRequest, UpdateSourceRequest, UpdateSourceResponse, UpdateWorkingDirRequest, UpsertConfigRequest, UpsertSecretRequest } from './types.gen.js';
|
export type { AddExtensionRequest, ArchiveSessionRequest, CheckSecretRequest, CheckSecretResponse, CreateSourceRequest, CreateSourceResponse, DeleteSessionRequest, DeleteSourceRequest, DictationConfigRequest, DictationConfigResponse, DictationDownloadProgress, DictationLocalModelStatus, DictationModelCancelRequest, DictationModelDeleteRequest, DictationModelDownloadProgressRequest, DictationModelDownloadProgressResponse, DictationModelDownloadRequest, DictationModelOption, DictationModelSelectRequest, DictationModelsListRequest, DictationModelsListResponse, DictationProviderStatusEntry, DictationTranscribeRequest, DictationTranscribeResponse, EmptyResponse, ExportSessionRequest, ExportSessionResponse, ExportSourceRequest, ExportSourceResponse, ExtRequest, ExtResponse, GetExtensionsRequest, GetExtensionsResponse, GetSessionExtensionsRequest, GetSessionExtensionsResponse, GetToolsRequest, GetToolsResponse, ImportSessionRequest, ImportSessionResponse, ImportSourcesRequest, ImportSourcesResponse, ListProvidersRequest, ListProvidersResponse, ListSourcesRequest, ListSourcesResponse, ProviderConfigKey, ProviderInventoryEntryDto, ProviderInventoryModelDto, ReadConfigRequest, ReadConfigResponse, ReadResourceRequest, ReadResourceResponse, RefreshProviderInventoryRequest, RefreshProviderInventoryResponse, RefreshProviderInventorySkipDto, RefreshProviderInventorySkipReasonDto, RemoveConfigRequest, RemoveExtensionRequest, RemoveSecretRequest, SourceEntry, SourceType, UnarchiveSessionRequest, UpdateSessionProjectRequest, UpdateSourceRequest, UpdateSourceResponse, UpdateWorkingDirRequest, UpsertConfigRequest, UpsertSecretRequest } from './types.gen.js';
|
||||||
|
|
||||||
export const GOOSE_EXT_METHODS = [
|
export const GOOSE_EXT_METHODS = [
|
||||||
{
|
{
|
||||||
@@ -93,6 +93,11 @@ export const GOOSE_EXT_METHODS = [
|
|||||||
requestType: "ImportSessionRequest",
|
requestType: "ImportSessionRequest",
|
||||||
responseType: "ImportSessionResponse",
|
responseType: "ImportSessionResponse",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
method: "_goose/session/update_project",
|
||||||
|
requestType: "UpdateSessionProjectRequest",
|
||||||
|
responseType: "EmptyResponse",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
method: "_goose/session/archive",
|
method: "_goose/session/archive",
|
||||||
requestType: "ArchiveSessionRequest",
|
requestType: "ArchiveSessionRequest",
|
||||||
|
|||||||
@@ -351,6 +351,14 @@ export type ImportSessionResponse = {
|
|||||||
messageCount: number;
|
messageCount: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the project association for a session.
|
||||||
|
*/
|
||||||
|
export type UpdateSessionProjectRequest = {
|
||||||
|
sessionId: string;
|
||||||
|
projectId?: string | null;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Archive a session (soft delete).
|
* Archive a session (soft delete).
|
||||||
*/
|
*/
|
||||||
@@ -618,7 +626,7 @@ export type DictationModelSelectRequest = {
|
|||||||
export type ExtRequest = {
|
export type ExtRequest = {
|
||||||
id: string;
|
id: string;
|
||||||
method: string;
|
method: string;
|
||||||
params?: AddExtensionRequest | RemoveExtensionRequest | GetToolsRequest | ReadResourceRequest | UpdateWorkingDirRequest | DeleteSessionRequest | GetExtensionsRequest | GetSessionExtensionsRequest | ListProvidersRequest | RefreshProviderInventoryRequest | ReadConfigRequest | UpsertConfigRequest | RemoveConfigRequest | CheckSecretRequest | UpsertSecretRequest | RemoveSecretRequest | ExportSessionRequest | ImportSessionRequest | ArchiveSessionRequest | UnarchiveSessionRequest | CreateSourceRequest | ListSourcesRequest | UpdateSourceRequest | DeleteSourceRequest | ExportSourceRequest | ImportSourcesRequest | DictationTranscribeRequest | DictationConfigRequest | DictationModelsListRequest | DictationModelDownloadRequest | DictationModelDownloadProgressRequest | DictationModelCancelRequest | DictationModelDeleteRequest | DictationModelSelectRequest | {
|
params?: AddExtensionRequest | RemoveExtensionRequest | GetToolsRequest | ReadResourceRequest | UpdateWorkingDirRequest | DeleteSessionRequest | GetExtensionsRequest | GetSessionExtensionsRequest | ListProvidersRequest | RefreshProviderInventoryRequest | ReadConfigRequest | UpsertConfigRequest | RemoveConfigRequest | CheckSecretRequest | UpsertSecretRequest | RemoveSecretRequest | ExportSessionRequest | ImportSessionRequest | UpdateSessionProjectRequest | ArchiveSessionRequest | UnarchiveSessionRequest | CreateSourceRequest | ListSourcesRequest | UpdateSourceRequest | DeleteSourceRequest | ExportSourceRequest | ImportSourcesRequest | DictationTranscribeRequest | DictationConfigRequest | DictationModelsListRequest | DictationModelDownloadRequest | DictationModelDownloadProgressRequest | DictationModelCancelRequest | DictationModelDeleteRequest | DictationModelSelectRequest | {
|
||||||
[key: string]: unknown;
|
[key: string]: unknown;
|
||||||
} | null;
|
} | null;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -293,6 +293,17 @@ export const zImportSessionResponse = z.object({
|
|||||||
messageCount: z.number().int().gte(0)
|
messageCount: z.number().int().gte(0)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the project association for a session.
|
||||||
|
*/
|
||||||
|
export const zUpdateSessionProjectRequest = z.object({
|
||||||
|
sessionId: z.string(),
|
||||||
|
projectId: z.union([
|
||||||
|
z.string(),
|
||||||
|
z.null()
|
||||||
|
]).optional()
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Archive a session (soft delete).
|
* Archive a session (soft delete).
|
||||||
*/
|
*/
|
||||||
@@ -594,6 +605,7 @@ export const zExtRequest = z.object({
|
|||||||
zRemoveSecretRequest,
|
zRemoveSecretRequest,
|
||||||
zExportSessionRequest,
|
zExportSessionRequest,
|
||||||
zImportSessionRequest,
|
zImportSessionRequest,
|
||||||
|
zUpdateSessionProjectRequest,
|
||||||
zArchiveSessionRequest,
|
zArchiveSessionRequest,
|
||||||
zUnarchiveSessionRequest,
|
zUnarchiveSessionRequest,
|
||||||
zCreateSourceRequest,
|
zCreateSourceRequest,
|
||||||
|
|||||||
Reference in New Issue
Block a user