@prismshadow/penguin-server 0.1.4 → 0.2.0

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.
@@ -85,6 +85,12 @@ interface UiPrefs {
85
85
  lastProjectId?: string;
86
86
  /** Whether the "no API key configured" guide has already been shown: once ever (on first visit to the chat page). */
87
87
  credentialGuideSeen?: boolean;
88
+ /**
89
+ * Also list CLI-created Sessions in the sidebar (`cli=1` on the sessions list). Default
90
+ * off: the list then serves web rows straight from the DB, with no Trace-directory
91
+ * scanning (#139).
92
+ */
93
+ showCliSessions?: boolean;
88
94
  [key: string]: unknown;
89
95
  }
90
96
  interface PrefsResponse {
@@ -116,6 +122,13 @@ interface ProjectCreateRequest {
116
122
  interface ProjectCreateResponse {
117
123
  project: ProjectSummary;
118
124
  }
125
+ interface ProjectUpdateRequest {
126
+ /** New display name. The projectId itself is immutable — only this label can change. */
127
+ name: string;
128
+ }
129
+ interface ProjectUpdateResponse {
130
+ project: ProjectSummary;
131
+ }
119
132
  interface MemberInfo {
120
133
  userId: string;
121
134
  role: ProjectRole;
@@ -511,7 +524,7 @@ interface MessagesResponse {
511
524
  live?: MessagesLiveTail;
512
525
  }
513
526
  /**
514
- * A single Prompt's input parts: text or image (data: / http(s) URL).
527
+ * A single Prompt's input parts: text, image (data: / http(s) URL), or an uploaded file.
515
528
  * Docs: /docs/server-api § "Session-Level Endpoints".
516
529
  */
517
530
  type TaskInputPart = {
@@ -520,6 +533,19 @@ type TaskInputPart = {
520
533
  } | {
521
534
  type: "image_url";
522
535
  imageUrl: string;
536
+ }
537
+ /**
538
+ * File attachment (the composer's "+" menu): `dataUrl` is a base64 `data:` URL of the
539
+ * file's bytes, capped at 10MB each (413 `file_too_large` beyond that; the request as a
540
+ * whole still has to fit the global 20MB body limit). The server writes it into the
541
+ * Session scratchpad under a sanitized name and appends an `[attached file: <path>]` line
542
+ * to the message text — the bytes never enter the conversation, the model opens the file
543
+ * by path. `fileName` is the original name (no path separators, no `..`).
544
+ */
545
+ | {
546
+ type: "file";
547
+ fileName: string;
548
+ dataUrl: string;
523
549
  };
524
550
  interface TaskCreateRequest {
525
551
  input: TaskInputPart[];
@@ -573,8 +599,41 @@ interface TaskCreateResponse {
573
599
  * task POST).
574
600
  */
575
601
  interface SteerRequest {
576
- /** Non-empty message text (trimmed server-side). */
602
+ /** Message text (trimmed server-side); may be empty when `images` or `files` carries the message. */
577
603
  text: string;
604
+ /**
605
+ * Images sent with the steering message (`data:` or http(s) URLs, same rule as
606
+ * `TaskInputPart.image_url`): delivered as user image messages right behind the
607
+ * `[user_steering]` text. A model without vision receives them as scratchpad path lines
608
+ * instead, exactly as it would a Prompt's images. At least one of `text` / `images` /
609
+ * `files` must be non-empty.
610
+ */
611
+ images?: string[];
612
+ /**
613
+ * File attachments riding the steering message — the same shape, caps and handling as a
614
+ * task input's `{type:"file"}` parts: written into the Session scratchpad and delivered
615
+ * as `[attached file: <path>]` lines on the `[user_steering]` text, so a file-only draft
616
+ * steers exactly like an image-only one instead of falling back to the follow-up queue.
617
+ */
618
+ files?: {
619
+ fileName: string;
620
+ dataUrl: string;
621
+ }[];
622
+ }
623
+ /**
624
+ * One steering message queued on the server but not yet delivered to the model (delivery
625
+ * happens at the next input assembly between turns). Carried on `task_state` events and the
626
+ * SSE subscribe snapshot so the composer's "steering queued" hint — including what was sent —
627
+ * survives reloads; entries leave the list as their `[user_steering]` message appears on the
628
+ * stream, and the whole list drops when the run exits (core discards undelivered steering).
629
+ */
630
+ interface PendingSteeringInfo {
631
+ /** The message text as accepted (trimmed); may be empty when images/files carry the message. */
632
+ text: string;
633
+ /** Number of images that rode along. */
634
+ images: number;
635
+ /** Number of file attachments that rode along. */
636
+ files: number;
578
637
  }
579
638
  interface ApprovalDecisionRequest {
580
639
  decision: "allow" | "deny";
@@ -604,6 +663,8 @@ type ServerEvent =
604
663
  type: "task_state";
605
664
  state: SessionStatus;
606
665
  queued?: number;
666
+ /** Steering messages queued but not yet delivered (absent = none): lets the composer's hint and its content survive reloads. */
667
+ pendingSteering?: PendingSteeringInfo[];
607
668
  }
608
669
  /** The model-generated title after the first turn has been persisted (for in-place list updates). */
609
670
  | {
@@ -989,9 +1050,20 @@ interface UsageErrors {
989
1050
  unexpected: number;
990
1051
  /** The most frequent source · code (null when there are no errors). */
991
1052
  topCode: UsageErrorCount | null;
992
- /** Most recent N items (reverse chronological). */
1053
+ /** Most recent N items (reverse chronological) — the first page; older ones come from `GET /usage/errors`. */
993
1054
  recent: UsageErrorItem[];
994
1055
  }
1056
+ /**
1057
+ * GET /api/projects/:projectId/usage/errors — one page of the error detail table, newest
1058
+ * first. The dashboard response above already carries the first page; this exists so
1059
+ * "show me earlier ones" does not have to refetch the whole aggregate. It takes the same
1060
+ * date/agent filter as the dashboard, so a page never widens what the summary counted.
1061
+ */
1062
+ interface UsageErrorsPage {
1063
+ items: UsageErrorItem[];
1064
+ /** Filtered row count, so the caller knows when it has reached the end. */
1065
+ total: number;
1066
+ }
995
1067
  interface UsageResponse {
996
1068
  summary: {
997
1069
  today: UsageBucket;
@@ -1079,21 +1151,22 @@ interface AgentImportResponse {
1079
1151
  /** Raw result of a single run (a scoreboard per-case runs[] entry). */
1080
1152
  interface BenchmarkRunScore {
1081
1153
  score: number;
1082
- cost?: number;
1083
- durationMs?: number;
1154
+ /** Run cost, or null when unavailable. */
1155
+ cost: number | null;
1156
+ durationMs: number;
1084
1157
  /** Id of the Session under test in this run (links to Trace). */
1085
- sessionId?: string;
1158
+ sessionId: string;
1086
1159
  }
1087
1160
  interface BenchmarkCaseScore {
1088
1161
  case: string;
1089
- /** Per-case score = average of runs (equals that single run's score under the legacy single-run format). */
1162
+ /** Model-written average of this Case's Run scores, on the fixed 0..100 scale. */
1090
1163
  score: number;
1091
- cost?: number;
1092
- durationMs?: number;
1093
- /** For legacy format compatibility: per-case single Session id (new format keeps it inside runs[]). */
1094
- sessionId?: string;
1095
- /** Raw results per run; unset under the legacy format (the server backfills one entry when parsing as a single run). */
1096
- runs?: BenchmarkRunScore[];
1164
+ /** Model-written average of known Run costs; null when every Run cost is unknown. */
1165
+ cost: number | null;
1166
+ /** Model-written average of Run durations, rounded to an integer. */
1167
+ durationMs: number;
1168
+ /** Raw results per Run. */
1169
+ runs: BenchmarkRunScore[];
1097
1170
  }
1098
1171
  interface BenchmarkEvaluation {
1099
1172
  /** Evaluation timestamp (ISO 8601). */
@@ -1103,15 +1176,19 @@ interface BenchmarkEvaluation {
1103
1176
  /** Evaluation summary body: how the score was derived, what optimizations were made to the Agent this round (required when generating, tolerated as unset when displaying). */
1104
1177
  summary?: string;
1105
1178
  /** Model actually used for this evaluation round (upstream id, paired with provider; the chart series is split by model). */
1106
- modelId?: string;
1179
+ modelId: string;
1107
1180
  /** Provider group for `modelId`. */
1108
- provider?: string;
1181
+ provider: string;
1182
+ /** Thinking level read from the unchanged Target Agent configuration. */
1183
+ thinkingLevel: string;
1109
1184
  /** Agent State version number under test. */
1110
- version?: number;
1111
- /** Total score (sum of per-case scores; max score defined by the scoring rubric). */
1185
+ version: number;
1186
+ /** Model-written average of Case scores, on the fixed 0..100 scale. */
1112
1187
  score: number;
1113
- cost?: number;
1114
- durationMs?: number;
1188
+ /** Model-written average of known Case costs; null when every Case cost is unknown. */
1189
+ cost: number | null;
1190
+ /** Model-written average of Case durations, rounded to an integer. */
1191
+ durationMs: number;
1115
1192
  cases: BenchmarkCaseScore[];
1116
1193
  }
1117
1194
  interface BenchmarkSummary {
@@ -1130,6 +1207,16 @@ interface BenchmarkSummary {
1130
1207
  interface BenchmarksResponse {
1131
1208
  benchmarks: BenchmarkSummary[];
1132
1209
  }
1210
+ type CaseMaterial = "statement" | "rubric";
1211
+ /** Public Benchmark Case metadata. Rubric and Gold content are never included. */
1212
+ interface BenchmarkCaseSummary {
1213
+ id: string;
1214
+ /** First Markdown heading with an optional leading "Case N:" removed; falls back to id. */
1215
+ title: string;
1216
+ }
1217
+ interface BenchmarkCasesResponse {
1218
+ cases: BenchmarkCaseSummary[];
1219
+ }
1133
1220
  interface SkillMetadataItem {
1134
1221
  /** Skill directory name (the identity key for install / uninstall / Prompt addressing). */
1135
1222
  name: string;
@@ -1212,4 +1299,4 @@ interface UpdateRunResponse {
1212
1299
  needsRestart: boolean;
1213
1300
  }
1214
1301
 
1215
- export type { AdminPasswordResetRequest, AdminUserCreateRequest, AdminUserCreateResponse, AdminUsersResponse, AgentCompactionConfigDto, AgentConfigDto, AgentConfigResponse, AgentConfigUpdateRequest, AgentCreateRequest, AgentCreateResponse, AgentImportRequest, AgentImportResponse, AgentModelConfigDto, AgentSkillsResponse, AgentSummary, AgentTraceDateGroup, AgentTraceFileRef, AgentTraceSessionGroup, AgentTracesResponse, AgentsResponse, ApprovalDecisionRequest, ApprovalMode, AuthLoginRequest, AuthResponse, BenchmarkCaseScore, BenchmarkEvaluation, BenchmarkRunScore, BenchmarkSummary, BenchmarksResponse, CredentialInfo, DirEntryInfo, DirListResponse, ErrorBody, FilesStatRequest, FilesStatResponse, GoalResponse, GoalServerEvent, GoalStateView, MeResponse, MemberAddRequest, MemberAddResponse, MemberInfo, MembersResponse, MessagesLiveTail, MessagesResponse, ModelInfo, ModelPricingDto, ModelRefDto, ModelTestRequest, ModelTestResponse, ModelUpdateEntry, ModelsResponse, ModelsUpdateRequest, PasswordChangeRequest, PrefsResponse, ProjectCreateRequest, ProjectCreateResponse, ProjectRole, ProjectSummary, ProjectsResponse, RequestSpan, RetryNowResponse, ScheduleItem, ScheduleServerEvent, ScheduleStatus, ScheduleUpsertRequest, SchedulesResponse, ServerEvent, SessionCategory, SessionCategoryCounts, SessionCreateRequest, SessionCreateResponse, SessionInfo, SessionPatchRequest, SessionResponse, SessionSource, SessionStatus, SessionTracesResponse, SessionsResponse, SkillGroupItem, SkillInstallRequest, SkillLibraryResponse, SkillMetadataItem, SteerRequest, TaskCreateRequest, TaskCreateResponse, TaskInputPart, ToolCallSpan, TraceAnalysisResponse, TraceEventsResponse, TraceFileInfo, TraceImportRequest, TraceImportResponse, TraceModelSegment, TraceTaskStats, TraceToolSpan, UiPrefs, UpdateCheckResponse, UpdateRunResponse, UsageAgentCount, UsageBucket, UsageErrorCount, UsageErrorItem, UsageErrors, UsageGroupBy, UsageGroupRow, UsageResponse, UsageSuccessRate, UsageTrendPoint, UsageTrendPointInTrace, UserInfo, VaultEntryInfo, VaultEntryUpdate, VaultResponse, VaultUpdateRequest, VersionResponse, WorkspaceFileEntry, WorkspaceFilesResponse };
1302
+ export type { AdminPasswordResetRequest, AdminUserCreateRequest, AdminUserCreateResponse, AdminUsersResponse, AgentCompactionConfigDto, AgentConfigDto, AgentConfigResponse, AgentConfigUpdateRequest, AgentCreateRequest, AgentCreateResponse, AgentImportRequest, AgentImportResponse, AgentModelConfigDto, AgentSkillsResponse, AgentSummary, AgentTraceDateGroup, AgentTraceFileRef, AgentTraceSessionGroup, AgentTracesResponse, AgentsResponse, ApprovalDecisionRequest, ApprovalMode, AuthLoginRequest, AuthResponse, BenchmarkCaseScore, BenchmarkCaseSummary, BenchmarkCasesResponse, BenchmarkEvaluation, BenchmarkRunScore, BenchmarkSummary, BenchmarksResponse, CaseMaterial, CredentialInfo, DirEntryInfo, DirListResponse, ErrorBody, FilesStatRequest, FilesStatResponse, GoalResponse, GoalServerEvent, GoalStateView, MeResponse, MemberAddRequest, MemberAddResponse, MemberInfo, MembersResponse, MessagesLiveTail, MessagesResponse, ModelInfo, ModelPricingDto, ModelRefDto, ModelTestRequest, ModelTestResponse, ModelUpdateEntry, ModelsResponse, ModelsUpdateRequest, PasswordChangeRequest, PendingSteeringInfo, PrefsResponse, ProjectCreateRequest, ProjectCreateResponse, ProjectRole, ProjectSummary, ProjectUpdateRequest, ProjectUpdateResponse, ProjectsResponse, RequestSpan, RetryNowResponse, ScheduleItem, ScheduleServerEvent, ScheduleStatus, ScheduleUpsertRequest, SchedulesResponse, ServerEvent, SessionCategory, SessionCategoryCounts, SessionCreateRequest, SessionCreateResponse, SessionInfo, SessionPatchRequest, SessionResponse, SessionSource, SessionStatus, SessionTracesResponse, SessionsResponse, SkillGroupItem, SkillInstallRequest, SkillLibraryResponse, SkillMetadataItem, SteerRequest, TaskCreateRequest, TaskCreateResponse, TaskInputPart, ToolCallSpan, TraceAnalysisResponse, TraceEventsResponse, TraceFileInfo, TraceImportRequest, TraceImportResponse, TraceModelSegment, TraceTaskStats, TraceToolSpan, UiPrefs, UpdateCheckResponse, UpdateRunResponse, UsageAgentCount, UsageBucket, UsageErrorCount, UsageErrorItem, UsageErrors, UsageErrorsPage, UsageGroupBy, UsageGroupRow, UsageResponse, UsageSuccessRate, UsageTrendPoint, UsageTrendPointInTrace, UserInfo, VaultEntryInfo, VaultEntryUpdate, VaultResponse, VaultUpdateRequest, VersionResponse, WorkspaceFileEntry, WorkspaceFilesResponse };