@prismshadow/penguin-server 0.0.1 → 0.1.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.
package/README.md CHANGED
@@ -37,7 +37,7 @@ pnpm --filter @prismshadow/penguin-server start # node dist/index.js
37
37
 
38
38
  - **CSRF**: session cookie is `SameSite=Lax` and writes accept only `Content-Type: application/json`; no CSRF token yet.
39
39
  - **No login rate limiting**: add throttling at a reverse proxy for public deployments.
40
- - **Built-in admin starts as `admin` / `admin123`**: change it immediately (a banner keeps reminding until you do).
40
+ - **Built-in admin starts as `admin` / `penguin-2026`**: change it immediately (a banner keeps reminding until you do).
41
41
  - Passwords use `node:crypto` scrypt (`scrypt$N$r$p$salt$hash`, timingSafeEqual); login sessions renew on a 7-day sliding window; the DB stores only the token's sha256.
42
42
  - Model credentials live in the Project's hidden 0600 config file; the API always masks them.
43
43
  - Behind a reverse proxy, disable response buffering for SSE paths (the server already sends `X-Accel-Buffering: no`) and forward `x-forwarded-proto` to enable Secure cookies.
@@ -222,6 +222,8 @@ interface ModelTestRequest {
222
222
  apiKey?: string;
223
223
  /** "Clear saved API key" is checked: the test does **not** fall back to the stored key (tests against the current draft). */
224
224
  clearApiKey?: boolean;
225
+ /** Speed-test mode: raises the probe's output cap (16 -> 64 tokens) so TTFT/TPS are measurable; costs a little more quota. */
226
+ speed?: boolean;
225
227
  /**
226
228
  * base URL (not secret; the frontend always sends the form's current value): a string
227
229
  * means use it, `null` means explicitly clear it (no fallback to the stored value),
@@ -231,10 +233,23 @@ interface ModelTestRequest {
231
233
  /** AgentHub client protocol; required for unsaved custom models (otherwise the id can't be auto-routed). */
232
234
  clientType?: string;
233
235
  }
234
- /** Connectivity test result: carries round-trip latency when ok, and a reason on failure (truncated raw provider error). */
236
+ /**
237
+ * Connectivity test result: carries round-trip latency when ok, and a reason on failure
238
+ * (truncated raw provider error). When streamed content was observed, also carries the
239
+ * time-to-first-token and, when usage was reported (completed streams), the output rate.
240
+ */
235
241
  interface ModelTestResponse {
236
242
  ok: boolean;
237
243
  latencyMs?: number;
244
+ /** Time from request start to the first streamed content (thinking or text), ms. */
245
+ ttftMs?: number;
246
+ /**
247
+ * Output tokens per second over the streaming window (first content -> stream end), 1dp.
248
+ * Omitted unless the sample is large enough to mean anything: a reply of a few tokens is
249
+ * dominated by the final chunk's round trip, so the rate it yields tracks network jitter
250
+ * rather than the model. Callers render TTFT alone in that case.
251
+ */
252
+ tps?: number;
238
253
  message?: string;
239
254
  }
240
255
  /** Read-only vault entry display: key name + masked value; plaintext is never sent. */
@@ -277,6 +292,8 @@ interface AgentSummary {
277
292
  vaultKeyCount: number;
278
293
  /** Schedule count (number of .toml files under agent_state/schedule/, including invalid ones). */
279
294
  scheduleCount: number;
295
+ /** Installed Skill count (number of agent_state/skills/<name>/ directories with a SKILL.md). */
296
+ skillCount: number;
280
297
  }
281
298
  interface AgentsResponse {
282
299
  agents: AgentSummary[];
@@ -379,12 +396,12 @@ interface DirListResponse {
379
396
  entries: DirEntryInfo[];
380
397
  }
381
398
  interface SessionCreateRequest {
382
- /** Upstream id of the session's model (paired with provider); defaults to the Project's default Model. */
399
+ /** Upstream id of the session's model; always sent together with provider. Omit both for the Project's default Model. */
383
400
  modelId?: string;
384
401
  /**
385
- * Provider group for `modelId`; when omitted, resolved via resolveModelRef semantics —
386
- * modelId can only be resolved if it's globally unique by exact match in the config;
387
- * 0 or multiple matches return 400.
402
+ * Provider group for `modelId`. A model reference is always a complete
403
+ * (provider, modelId) pair — the provider is never inferred, so sending one field
404
+ * without the other returns 400 instead of being resolved.
388
405
  */
389
406
  provider?: string;
390
407
  /** Any existing directory on the server; defaults to auto-creating a temporary Workspace. */
@@ -822,9 +839,9 @@ interface ScheduleItem {
822
839
  /** Bound target Session; defaults to creating a new Session each time. */
823
840
  sessionId?: string;
824
841
  workspace?: string;
825
- /** Model for new-Session mode (upstream id, paired with provider); defaults to the Project's default reference. */
842
+ /** Model for new-Session mode (upstream id, always paired with provider); absent means the Project's default reference. */
826
843
  modelId?: string;
827
- /** Provider group for `modelId`; when omitted, resolved via resolveModelRef semantics (resolvable only on a unique match). */
844
+ /** Provider group for `modelId`; present exactly when `modelId` is — a model reference is always a pair. */
828
845
  provider?: string;
829
846
  status: ScheduleStatus;
830
847
  invalidReason?: string;
@@ -852,9 +869,12 @@ interface ScheduleUpsertRequest {
852
869
  endAt?: string;
853
870
  sessionId?: string;
854
871
  workspace?: string;
855
- /** Model for new-Session mode (upstream id); defaults to the Project's default reference. */
872
+ /** Model for new-Session mode (upstream id); always sent together with provider, omit both for the Project's default reference. */
856
873
  modelId?: string;
857
- /** Provider group for `modelId`; when omitted, validated as uniquely resolvable via resolveModelRef semantics at save/reconciliation time. */
874
+ /**
875
+ * Provider group for `modelId`. Both fields are sent as a pair (400 otherwise); the
876
+ * pair is checked against the Project config at save/reconciliation time.
877
+ */
858
878
  provider?: string;
859
879
  }
860
880
  interface AgentImportRequest {