feat(core): add native skill activation

This commit is contained in:
Dax Raad 2026-06-30 01:14:44 -04:00
commit 23adaaaeab
26 changed files with 814 additions and 76 deletions

View file

@ -21,6 +21,8 @@ import type {
SessionRenameOutput,
SessionPromptInput,
SessionPromptOutput,
SessionSkillInput,
SessionSkillOutput,
SessionCompactInput,
SessionCompactOutput,
SessionWaitInput,
@ -427,6 +429,18 @@ export function make(options: ClientOptions) {
},
requestOptions,
).then((value) => value.data),
skill: (input: SessionSkillInput, requestOptions?: RequestOptions) =>
request<SessionSkillOutput>(
{
method: "POST",
path: `/api/session/${encodeURIComponent(input.sessionID)}/skill`,
body: { id: input["id"], skill: input["skill"], resume: input["resume"] },
successStatus: 204,
declaredStatuses: [404, 400, 401],
empty: true,
},
requestOptions,
),
compact: (input: SessionCompactInput, requestOptions?: RequestOptions) =>
request<SessionCompactOutput>(
{

View file

@ -50,6 +50,14 @@ export type ConflictError = {
export const isConflictError = (value: unknown): value is ConflictError =>
typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "ConflictError"
export type SkillNotFoundError = {
readonly _tag: "SkillNotFoundError"
readonly skill: string
readonly message: string
}
export const isSkillNotFoundError = (value: unknown): value is SkillNotFoundError =>
typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "SkillNotFoundError"
export type SessionBusyError = {
readonly _tag: "SessionBusyError"
readonly sessionID: string
@ -540,6 +548,27 @@ export type SessionPromptOutput = {
}
}["data"]
export type SessionSkillInput = {
readonly sessionID: { readonly sessionID: string }["sessionID"]
readonly id?: {
readonly id?: string | undefined
readonly skill: string
readonly resume?: boolean | undefined
}["id"]
readonly skill: {
readonly id?: string | undefined
readonly skill: string
readonly resume?: boolean | undefined
}["skill"]
readonly resume?: {
readonly id?: string | undefined
readonly skill: string
readonly resume?: boolean | undefined
}["resume"]
}
export type SessionSkillOutput = void
export type SessionCompactInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] }
export type SessionCompactOutput = void
@ -629,6 +658,14 @@ export type SessionContextOutput = {
readonly type: "system"
readonly text: string
}
| {
readonly id: string
readonly metadata?: { readonly [x: string]: JsonValue }
readonly time: { readonly created: number }
readonly type: "skill"
readonly name: string
readonly text: string
}
| {
readonly id: string
readonly metadata?: { readonly [x: string]: JsonValue }
@ -882,6 +919,20 @@ export type SessionHistoryOutput = {
readonly text: string
}
}
| {
readonly id: string
readonly metadata?: { readonly [x: string]: JsonValue }
readonly type: "session.next.skill.activated"
readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number }
readonly location?: { readonly directory: string; readonly workspaceID?: string }
readonly data: {
readonly timestamp: number
readonly sessionID: string
readonly messageID: string
readonly name: string
readonly text: string
}
}
| {
readonly id: string
readonly metadata?: { readonly [x: string]: JsonValue }
@ -1361,6 +1412,20 @@ export type SessionEventsOutput =
readonly text: string
}
}
| {
readonly id: string
readonly metadata?: { readonly [x: string]: unknown }
readonly type: "session.next.skill.activated"
readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number }
readonly location?: { readonly directory: string; readonly workspaceID?: string }
readonly data: {
readonly timestamp: number
readonly sessionID: string
readonly messageID: string
readonly name: string
readonly text: string
}
}
| {
readonly id: string
readonly metadata?: { readonly [x: string]: unknown }
@ -1749,6 +1814,14 @@ export type SessionMessageOutput = {
readonly type: "system"
readonly text: string
}
| {
readonly id: string
readonly metadata?: { readonly [x: string]: JsonValue }
readonly time: { readonly created: number }
readonly type: "skill"
readonly name: string
readonly text: string
}
| {
readonly id: string
readonly metadata?: { readonly [x: string]: JsonValue }
@ -1921,6 +1994,14 @@ export type MessageListOutput = {
readonly type: "system"
readonly text: string
}
| {
readonly id: string
readonly metadata?: { readonly [x: string]: JsonValue }
readonly time: { readonly created: number }
readonly type: "skill"
readonly name: string
readonly text: string
}
| {
readonly id: string
readonly metadata?: { readonly [x: string]: JsonValue }
@ -2711,6 +2792,14 @@ export type EventSubscribeOutput =
readonly location?: { readonly directory: string; readonly workspaceID?: string }
readonly data: {}
}
| {
readonly id: string
readonly metadata?: { readonly [x: string]: unknown }
readonly type: "agent.updated"
readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number }
readonly location?: { readonly directory: string; readonly workspaceID?: string }
readonly data: {}
}
| {
readonly id: string
readonly metadata?: { readonly [x: string]: unknown }
@ -3392,6 +3481,20 @@ export type EventSubscribeOutput =
readonly text: string
}
}
| {
readonly id: string
readonly metadata?: { readonly [x: string]: unknown }
readonly type: "session.next.skill.activated"
readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number }
readonly location?: { readonly directory: string; readonly workspaceID?: string }
readonly data: {
readonly timestamp: number
readonly sessionID: string
readonly messageID: string
readonly name: string
readonly text: string
}
}
| {
readonly id: string
readonly metadata?: { readonly [x: string]: unknown }