@alisio/sdk 0.1.0-alpha.15 → 0.1.0-alpha.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.d.ts +214 -3
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1063,7 +1063,7 @@ export interface CommandDescriptor {
1063
1063
  description: string;
1064
1064
  aliases?: string[];
1065
1065
  argumentHint?: string;
1066
- source: "builtin" | "plugin" | "prompt" | "skill";
1066
+ source: "builtin" | "plugin" | "prompt" | "skill" | "agent";
1067
1067
  /** Plugin id or resource owner, when not built in. */
1068
1068
  owner?: string;
1069
1069
  surfaces: Array<"tui" | "web" | "api">;
@@ -1154,9 +1154,21 @@ export type ServerFrame = {
1154
1154
  sessionId?: string;
1155
1155
  reason: "overflow" | "gap" | "server_restart";
1156
1156
  };
1157
- export type ApiErrorCode = "unauthorized" | "forbidden_origin" | "forbidden_host" | "validation_failed" | "not_found" | "unknown_command" | "session_busy" | "session_locked" | "workspace_limit" | "payload_too_large" | "unsupported_media_type" | "path_outside_workspace" | "not_a_git_repo" | "approval_resolved" | "capability_ceiling" | "not_manageable" | "mcp_not_permitted" | "runs_active" | "provider_unavailable" | "protocol_mismatch" | "shutting_down"
1157
+ export type ApiErrorCode = "unauthorized" | "forbidden_origin" | "forbidden_host" | "validation_failed" | "not_found" | "unknown_command" | "session_busy" | "session_locked" | "workspace_limit"
1158
+ /** A known workspace whose folder was deleted, moved or is no longer accessible (404). */
1159
+ | "workspace_missing" | "payload_too_large" | "unsupported_media_type" | "path_outside_workspace" | "not_a_git_repo" | "approval_resolved" | "capability_ceiling" | "not_manageable" | "mcp_not_permitted" | "runs_active" | "provider_unavailable" | "protocol_mismatch" | "shutting_down"
1158
1160
  /** Too many concurrent event streams (SSE) for this server. */
1159
- | "stream_limit" | "internal";
1161
+ | "stream_limit"
1162
+ /** The workspace is archived: unarchive it before starting new sessions (409). */
1163
+ | "workspace_archived"
1164
+ /** A native folder dialog is already open on the server machine (409). */
1165
+ | "picker_busy"
1166
+ /** No native folder dialog / folder browser on this server (remote bind, no desktop) (503). */
1167
+ | "picker_unavailable"
1168
+ /** The server user may not read that directory (403). */
1169
+ | "permission_denied"
1170
+ /** The request was cancelled before it finished, e.g. a `/btw` side question (409). */
1171
+ | "cancelled" | "internal";
1160
1172
  /** `GET /api/health` (the only unauthenticated API route). */
1161
1173
  export interface HealthInfo {
1162
1174
  name: "alisio";
@@ -1172,8 +1184,45 @@ export interface HealthInfo {
1172
1184
  automation: boolean;
1173
1185
  /** The server listens on a non-loopback address (`--allow-remote`). */
1174
1186
  remote: boolean;
1187
+ /**
1188
+ * `POST /api/workspaces/pick` can open a native folder dialog on this machine (loopback only,
1189
+ * with a desktop session and a dialog tool). Absent on older servers.
1190
+ */
1191
+ nativePicker?: boolean;
1192
+ /** `GET /api/fs/dirs` lists directory names for the in-app folder browser (loopback only). */
1193
+ folderBrowser?: boolean;
1175
1194
  };
1176
1195
  }
1196
+ /** `POST /api/workspaces/pick`: the folder chosen in the native dialog, or a cancellation. */
1197
+ export type FolderPickResult = {
1198
+ path: string;
1199
+ } | {
1200
+ cancelled: true;
1201
+ };
1202
+ /** One page of the in-app folder browser (`GET /api/fs/dirs`): subdirectory names only. */
1203
+ export interface DirectoryListing {
1204
+ /** Absolute path listed (the server's own separators; `""` for the drive list on Windows). */
1205
+ path: string;
1206
+ /** Parent directory, absent at a filesystem root (and at the drive list). */
1207
+ parent?: string;
1208
+ /** Breadcrumbs from the root to `path`, built by the server (no separator assumptions). */
1209
+ segments: Array<{
1210
+ name: string;
1211
+ path: string;
1212
+ }>;
1213
+ /** Subdirectories (names and absolute paths; never files, never contents). */
1214
+ entries: Array<{
1215
+ name: string;
1216
+ path: string;
1217
+ hidden: boolean;
1218
+ }>;
1219
+ /** The server user's home directory (where browsing starts). */
1220
+ home: string;
1221
+ /** Path separator of the server platform. */
1222
+ separator: "/" | "\\";
1223
+ /** More than the listing cap: the rest is not shown. */
1224
+ truncated?: boolean;
1225
+ }
1177
1226
  /** A workspace known to the server (`GET /api/workspaces`). */
1178
1227
  export interface WorkspaceInfo {
1179
1228
  /** Opaque, stable id: a short sha256 of the canonical path. */
@@ -1184,10 +1233,17 @@ export interface WorkspaceInfo {
1184
1233
  pinned: boolean;
1185
1234
  /** An `Application` is open for it in the server right now. */
1186
1235
  open: boolean;
1236
+ /**
1237
+ * The folder is still an accessible directory. A workspace known from old sessions may have been
1238
+ * deleted or moved: its sessions stay readable, but it cannot be opened (`workspace_missing`).
1239
+ */
1240
+ exists: boolean;
1187
1241
  /** Project resources load (trusted from the terminal or by a launch flag). */
1188
1242
  trusted: boolean;
1189
1243
  /** The directory has project resources that are not trusted (shown as "untrusted"). */
1190
1244
  untrustedResources: boolean;
1245
+ /** Archived: hidden from the default list; its sessions stay readable, new ones are refused. */
1246
+ archived: boolean;
1191
1247
  lastOpenedAt?: number;
1192
1248
  }
1193
1249
  /** Permission presets of the web composer (RF-08). */
@@ -1252,6 +1308,27 @@ export interface CommandOutcome {
1252
1308
  effects?: string[];
1253
1309
  duplicate?: boolean;
1254
1310
  }
1311
+ /**
1312
+ * One `/btw` side question: a tool-less question about a session answered outside its
1313
+ * conversation (never persisted as messages, events, runs or session usage). Answer of
1314
+ * `POST /api/sessions/:sid/btw`; `GET /api/sessions/:sid/btw` lists them, oldest first.
1315
+ */
1316
+ export interface SideQuestionEntry {
1317
+ id: string;
1318
+ question: string;
1319
+ /** Markdown answer. */
1320
+ answer: string;
1321
+ /** Model that answered (the session's model at the time). */
1322
+ model: string;
1323
+ usage: {
1324
+ input: number;
1325
+ output: number;
1326
+ };
1327
+ /** Epoch milliseconds. */
1328
+ createdAt: number;
1329
+ /** The provider cut the answer at the output-token budget. */
1330
+ truncated?: boolean;
1331
+ }
1255
1332
  /** `GET /api/sessions/:sid/models`: models of the session's provider (credential-free). */
1256
1333
  export interface SessionModels {
1257
1334
  provider: string;
@@ -1412,6 +1489,140 @@ export interface ProviderModelsInfo {
1412
1489
  models: ModelInfo[];
1413
1490
  unavailable: boolean;
1414
1491
  }
1492
+ /** Output format of an agent's answers (`text.format.type`). */
1493
+ export type AgentTextFormatType = "text" | "json_object" | "json_schema";
1494
+ /** Reasoning summary preference of an agent (`reasoning.summary`). */
1495
+ export type AgentReasoningSummary = "auto" | "none" | "concise" | "detailed";
1496
+ /** Answer verbosity preference of an agent (`text.verbosity`). */
1497
+ export type AgentVerbosity = "low" | "medium" | "high";
1498
+ /**
1499
+ * Where a user agent file lives: `project` is `<workspace>/.agents/agents/<id>.md`, `global` is
1500
+ * `~/.agents/agents/<id>.md`. A project agent overrides a global one with the same id.
1501
+ */
1502
+ export type AgentScope = "project" | "global";
1503
+ /** Body of `POST /api/agents` and `PUT /api/agents/:id`: a user agent definition. */
1504
+ export interface AgentDefinitionInput {
1505
+ /** Display name; the stable id is derived from it once, on creation. */
1506
+ name: string;
1507
+ description?: string;
1508
+ /** System prompt appended to the session instructions when the agent is active. */
1509
+ instructions?: string;
1510
+ /** Model selector (`provider/model` or an unambiguous model id). */
1511
+ model: string;
1512
+ reasoning?: {
1513
+ effort?: string;
1514
+ summary?: AgentReasoningSummary;
1515
+ };
1516
+ text?: {
1517
+ format?: {
1518
+ type: AgentTextFormatType;
1519
+ };
1520
+ verbosity?: AgentVerbosity;
1521
+ };
1522
+ }
1523
+ /** A stored user agent definition (`GET /api/agents/definitions`). Times are epoch ms. */
1524
+ export interface AgentDefinitionInfo extends AgentDefinitionInput {
1525
+ /** File slug: the frontmatter `name` other harnesses use as the agent identifier. */
1526
+ id: string;
1527
+ scope: AgentScope;
1528
+ description: string;
1529
+ instructions: string;
1530
+ /** Absolute path of the Markdown file. */
1531
+ path: string;
1532
+ createdAt: number;
1533
+ updatedAt: number;
1534
+ /** A project agent that takes precedence over the global agent with the same id. */
1535
+ overridesGlobal?: boolean;
1536
+ /** A global agent hidden by the project agent with the same id. */
1537
+ overriddenByProject?: boolean;
1538
+ }
1539
+ /**
1540
+ * Answer of agent writes. `live`: the running Alisio already uses the change (its agent registry
1541
+ * reloaded and loaded the file); false means it is saved but needs a restart (or a trusted
1542
+ * workspace / the subagents plugin) before sessions can use it.
1543
+ */
1544
+ export interface AgentSaveResult {
1545
+ agent: AgentDefinitionInfo;
1546
+ live: boolean;
1547
+ }
1548
+ /** `GET /api/agents/definitions`: both scopes merged, plus where new agents go by default. */
1549
+ export interface AgentDefinitionsOverview {
1550
+ agents: AgentDefinitionInfo[];
1551
+ scopes: AgentScope[];
1552
+ defaultScope: AgentScope;
1553
+ /** Directory of each available scope. */
1554
+ dirs: Partial<Record<AgentScope, string>>;
1555
+ /** Project agents load only in trusted workspaces. */
1556
+ trusted: boolean;
1557
+ }
1558
+ /** A predefined starting point for a new agent (`GET /api/agents/templates`). */
1559
+ export interface AgentTemplateInfo {
1560
+ id: string;
1561
+ name: string;
1562
+ description: string;
1563
+ instructions: string;
1564
+ reasoning?: {
1565
+ effort?: string;
1566
+ summary?: AgentReasoningSummary;
1567
+ };
1568
+ text?: {
1569
+ format?: {
1570
+ type: AgentTextFormatType;
1571
+ };
1572
+ verbosity?: AgentVerbosity;
1573
+ };
1574
+ }
1575
+ /** What a model supports for the agent editor, derived from its catalog metadata. */
1576
+ export interface AgentModelCapabilities {
1577
+ /** The catalog declared any capability metadata; otherwise every option is offered. */
1578
+ known: boolean;
1579
+ reasoning: boolean;
1580
+ /** Reasoning effort levels to offer (empty when reasoning is unsupported). */
1581
+ effortLevels: string[];
1582
+ defaultEffort?: string;
1583
+ summary: boolean;
1584
+ verbosity: boolean;
1585
+ textFormats: AgentTextFormatType[];
1586
+ /** Declared tool calling support; absent when unknown. */
1587
+ tools?: boolean;
1588
+ /** Declared image input support; absent when unknown. */
1589
+ vision?: boolean;
1590
+ }
1591
+ /** A configured model the agent editor can select (`GET /api/agents/models`). */
1592
+ export interface AgentModelOption {
1593
+ /** Canonical selector `<provider>/<model>`. */
1594
+ reference: string;
1595
+ provider: string;
1596
+ profile: string;
1597
+ providerName: string;
1598
+ id: string;
1599
+ name?: string;
1600
+ /** The workspace application runs this model right now. */
1601
+ active: boolean;
1602
+ capabilities: AgentModelCapabilities;
1603
+ /** Short capability labels such as "Reasoning", "Tools", "Vision". */
1604
+ labels: string[];
1605
+ }
1606
+ /** Answer of `POST /api/agents/draft`: a definition drafted by the active model. */
1607
+ export interface AgentDraft {
1608
+ name: string;
1609
+ description: string;
1610
+ instructions: string;
1611
+ reasoning?: {
1612
+ effort?: string;
1613
+ summary?: AgentReasoningSummary;
1614
+ };
1615
+ text?: {
1616
+ format?: {
1617
+ type: AgentTextFormatType;
1618
+ };
1619
+ verbosity?: AgentVerbosity;
1620
+ };
1621
+ /** The model that wrote the draft. */
1622
+ generatedBy: string;
1623
+ /** Authoring guidance used: `skill:<name>` (a discovered skill) or `bundled:create-agent`. */
1624
+ guidance: string;
1625
+ }
1415
1626
  /** Body of every non-2xx web API response. */
1416
1627
  export interface ApiError {
1417
1628
  error: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alisio/sdk",
3
- "version": "0.1.0-alpha.15",
3
+ "version": "0.1.0-alpha.17",
4
4
  "description": "Typed plugin SDK for Alisio: the stable contract for tools, commands, context, compaction and session hooks, model completions and storage. Types only plus tiny helpers; zero runtime dependencies.",
5
5
  "author": "Gustavo Gutiérrez",
6
6
  "license": "MIT",