Merge branch 'stack/agent-profiles-3-wire' into stack/agent-profiles-5-web-ui
This commit is contained in:
@@ -1816,7 +1816,13 @@ export function createApiProxy(ctx: Context, defaults: ApiProxyDefaults): ApiPro
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ok(request, { sessionId })
|
// Echo the RESOLVED composition so a client can label the session it
|
||||||
|
// just created without waiting for the next list refresh — the create
|
||||||
|
// is the commit point that knows it (a caller that named none gets
|
||||||
|
// the default the header recorded).
|
||||||
|
const created = ctx.agents.get(sessionId)
|
||||||
|
const createdPreset = created?.session.header.agentPreset
|
||||||
|
return ok(request, { sessionId, ...createdPreset === undefined ? {} : { agentPreset: createdPreset } })
|
||||||
},
|
},
|
||||||
|
|
||||||
async history(request) {
|
async history(request) {
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ export const hostFrameSchema = z.discriminatedUnion('type', [
|
|||||||
parentSessionId: sessionIdSchema.optional(),
|
parentSessionId: sessionIdSchema.optional(),
|
||||||
origin: z.literal('subagent').optional(),
|
origin: z.literal('subagent').optional(),
|
||||||
cwd: z.string().optional(),
|
cwd: z.string().optional(),
|
||||||
|
agentPreset: z.string().optional(),
|
||||||
}),
|
}),
|
||||||
z.object({ type: z.literal('host/session-removed'), sessionId: sessionIdSchema }),
|
z.object({ type: z.literal('host/session-removed'), sessionId: sessionIdSchema }),
|
||||||
z.object({ type: z.literal('host/session-status'), sessionId: sessionIdSchema, running: z.boolean() }),
|
z.object({ type: z.literal('host/session-status'), sessionId: sessionIdSchema, running: z.boolean() }),
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ export type HostFrame =
|
|||||||
parentSessionId?: SessionId
|
parentSessionId?: SessionId
|
||||||
origin?: 'subagent'
|
origin?: 'subagent'
|
||||||
cwd?: string
|
cwd?: string
|
||||||
|
agentPreset?: string
|
||||||
}
|
}
|
||||||
| { type: 'host/session-removed'; sessionId: SessionId }
|
| { type: 'host/session-removed'; sessionId: SessionId }
|
||||||
| { type: 'host/session-status'; sessionId: SessionId; running: boolean }
|
| { type: 'host/session-status'; sessionId: SessionId; running: boolean }
|
||||||
|
|||||||
@@ -110,6 +110,7 @@ export const sessionCreateRequestSchema = z.object({
|
|||||||
/** session.create response value. */
|
/** session.create response value. */
|
||||||
export const sessionCreateValueSchema = z.object({
|
export const sessionCreateValueSchema = z.object({
|
||||||
sessionId: sessionIdSchema,
|
sessionId: sessionIdSchema,
|
||||||
|
agentPreset: z.string().optional(),
|
||||||
}) satisfies z.ZodType<Wire<ResponseValue<'session.create'>>>
|
}) satisfies z.ZodType<Wire<ResponseValue<'session.create'>>>
|
||||||
|
|
||||||
/** session.rename request payload (raw title; host-side normalization decides acceptance). */
|
/** session.rename request payload (raw title; host-side normalization decides acceptance). */
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ export interface SessionsApi {
|
|||||||
* cannot be mounted fails with `agent-preset-invalid`.
|
* cannot be mounted fails with `agent-preset-invalid`.
|
||||||
*/
|
*/
|
||||||
create(request: RpcRequest<{ workspaceId?: WorkspaceId; cwd?: string; sessionId?: SessionId; agentPreset?: string }>):
|
create(request: RpcRequest<{ workspaceId?: WorkspaceId; cwd?: string; sessionId?: SessionId; agentPreset?: string }>):
|
||||||
Promise<RpcResponse<{ sessionId: SessionId }>>
|
Promise<RpcResponse<{ sessionId: SessionId; agentPreset?: string }>>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads a window of history events; page boundaries align to append-origin message
|
* Reads a window of history events; page boundaries align to append-origin message
|
||||||
|
|||||||
Reference in New Issue
Block a user