wholestack 0.4.0 → 0.5.1

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/dist/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import * as ai from 'ai';
2
2
  import { ToolSet, LanguageModel, ModelMessage } from 'ai';
3
3
 
4
+ type TaskStatus = "running" | "exited" | "failed";
5
+
4
6
  /**
5
7
  * Two ways to drive the ZETA build pipeline:
6
8
  *
@@ -66,9 +68,21 @@ type Decision = "allow" | "deny";
66
68
  declare class Permissions {
67
69
  mode: PermissionMode;
68
70
  private readonly confirm?;
71
+ /**
72
+ * Persist a chosen mode so it survives across sessions. Wired by the CLI to
73
+ * write `~/.zeta-g/config.json`. Optional — when absent, choices are
74
+ * session-only (e.g. piped / non-TTY runs).
75
+ */
76
+ private readonly persistMode?;
69
77
  private alwaysCommands;
70
78
  private acceptAllEdits;
71
- constructor(mode: PermissionMode, confirm?: ConfirmFn | undefined);
79
+ constructor(mode: PermissionMode, confirm?: ConfirmFn | undefined,
80
+ /**
81
+ * Persist a chosen mode so it survives across sessions. Wired by the CLI to
82
+ * write `~/.zeta-g/config.json`. Optional — when absent, choices are
83
+ * session-only (e.g. piped / non-TTY runs).
84
+ */
85
+ persistMode?: ((mode: PermissionMode) => void) | undefined);
72
86
  isPlan(): boolean;
73
87
  setMode(mode: PermissionMode): void;
74
88
  /** Message a tool returns when an action is blocked by plan mode. */
@@ -431,6 +445,64 @@ declare function buildTools(ctx: ToolContext): {
431
445
  url?: undefined;
432
446
  serving?: undefined;
433
447
  }>;
448
+ run_background: ai.Tool<{
449
+ args: string[];
450
+ command: string;
451
+ }, {
452
+ ok: boolean;
453
+ declined: boolean;
454
+ error: string;
455
+ taskId?: undefined;
456
+ status?: undefined;
457
+ note?: undefined;
458
+ } | {
459
+ ok: boolean;
460
+ taskId: string;
461
+ status: TaskStatus;
462
+ note: string;
463
+ declined?: undefined;
464
+ error?: undefined;
465
+ }>;
466
+ task_output: ai.Tool<{
467
+ tail: number;
468
+ id?: string | undefined;
469
+ }, {
470
+ ok: boolean;
471
+ tasks: {
472
+ id: string;
473
+ status: TaskStatus;
474
+ exitCode: number | null;
475
+ seconds: number;
476
+ command: string;
477
+ }[];
478
+ error?: undefined;
479
+ id?: undefined;
480
+ status?: undefined;
481
+ exitCode?: undefined;
482
+ seconds?: undefined;
483
+ command?: undefined;
484
+ output?: undefined;
485
+ } | {
486
+ ok: boolean;
487
+ error: string;
488
+ tasks?: undefined;
489
+ id?: undefined;
490
+ status?: undefined;
491
+ exitCode?: undefined;
492
+ seconds?: undefined;
493
+ command?: undefined;
494
+ output?: undefined;
495
+ } | {
496
+ ok: boolean;
497
+ id: string;
498
+ status: TaskStatus;
499
+ exitCode: number | null;
500
+ seconds: number;
501
+ command: string;
502
+ output: string;
503
+ tasks?: undefined;
504
+ error?: undefined;
505
+ }>;
434
506
  };
435
507
 
436
508
  /**
@@ -678,7 +750,11 @@ interface AgentOptions {
678
750
  hooks?: HookRunner;
679
751
  /** Project memory + plugin system text, appended to the system prompt. */
680
752
  memoryText?: string;
753
+ /** Optional persona role layered on the base prompt (e.g. "nzt-48"). */
754
+ persona?: string;
681
755
  thinking?: boolean;
756
+ /** Yolo mode unlocks the spicier thinking-word bank. */
757
+ yolo?: boolean;
682
758
  maxSteps?: number;
683
759
  contextWindow?: number;
684
760
  session?: Session | null;
@@ -716,6 +792,8 @@ declare class Agent {
716
792
  setSession(session: Session | null): void;
717
793
  reset(): void;
718
794
  replaceHistory(messages: ModelMessage[]): void;
795
+ /** A shallow copy of the current message history (for /export, inspection). */
796
+ snapshot(): ModelMessage[];
719
797
  /** % of the model's context window the current history occupies. */
720
798
  contextPct(): number;
721
799
  private system;
@@ -729,7 +807,9 @@ declare class Agent {
729
807
  /** Force or auto compaction; prints a one-line note. Returns true if it ran. */
730
808
  runCompaction(announce: boolean): Promise<boolean>;
731
809
  /** Run one user turn end-to-end; streams to stdout, updates history. */
732
- send(userInput: string, signal?: AbortSignal): Promise<TurnResult>;
810
+ send(userInput: string, signal?: AbortSignal, images?: {
811
+ dataUrl: string;
812
+ }[]): Promise<TurnResult>;
733
813
  }
734
814
 
735
815
  interface MemorySource {
@@ -828,6 +908,9 @@ type CommandResult = {
828
908
  } | {
829
909
  type: "resume";
830
910
  sessionId: string;
911
+ } | {
912
+ type: "export";
913
+ file?: string;
831
914
  };
832
915
  interface CommandContext {
833
916
  args: string;
@@ -1035,8 +1118,9 @@ declare class PromptRegistry {
1035
1118
  }
1036
1119
  /**
1037
1120
  * The default registry, seeded with Zeta-G's core identity, the safety and
1038
- * verify overlays, and the coder/planner roles. Importers get a ready-to-use
1039
- * registry; they can register additional versions, roles, or overlays on top.
1121
+ * verify overlays, and the coder/planner/nzt-48 roles. Importers get a
1122
+ * ready-to-use registry; they can register additional versions, roles, or
1123
+ * overlays on top.
1040
1124
  */
1041
1125
  declare const DEFAULT_REGISTRY: PromptRegistry;
1042
1126
 
@@ -1362,6 +1446,8 @@ interface InputOptions {
1362
1446
  commandNames: () => string[];
1363
1447
  /** Called when the user asks to quit (empty line + Ctrl-C, or twice). */
1364
1448
  onExit: () => void;
1449
+ /** Starship-style context line rendered above the input box (model · dir · git · …). */
1450
+ contextBar?: () => string;
1365
1451
  }
1366
1452
  declare class InputController {
1367
1453
  private readonly opts;
@@ -1369,8 +1455,18 @@ declare class InputController {
1369
1455
  constructor(opts: InputOptions);
1370
1456
  /** Tab completion: /commands when the line starts with /, @paths otherwise. */
1371
1457
  private complete;
1372
- /** Read one logical line, joining trailing-backslash continuations. */
1458
+ /** Read one logical line. On a TTY this renders a live bordered input box
1459
+ * (the box appears WHILE you type, not as an after-the-fact echo). On a
1460
+ * non-TTY / piped stdin it falls back to plain readline. */
1373
1461
  readLine(promptStr: string): Promise<string>;
1462
+ /**
1463
+ * Live bordered input editor. Redraws a 4-side box on every keystroke with
1464
+ * the caret tracked inside it. Supports: insert/backspace/delete, ←/→,
1465
+ * Home/End (Ctrl-A/E), ↑/↓ history, Tab completion (/commands + @paths),
1466
+ * Shift/Alt-Enter or a trailing "\\" for a newline, Enter to submit,
1467
+ * Ctrl-C to quit, Ctrl-U to clear, Esc to clear the line.
1468
+ */
1469
+ private readBoxed;
1374
1470
  private saveHistory;
1375
1471
  /**
1376
1472
  * Ask a y/n/a-style question; resolves to the chosen choice key. Safe to call
package/dist/index.js CHANGED
@@ -49,7 +49,7 @@ import {
49
49
  resolveModelKey,
50
50
  severityRank,
51
51
  supportsThinking
52
- } from "./chunk-7DJJXUV4.js";
52
+ } from "./chunk-TDSLCPQL.js";
53
53
 
54
54
  // src/prompts/template.ts
55
55
  var PLACEHOLDER = /\{\{([A-Za-z0-9_.]+)\}\}/g;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wholestack",
3
- "version": "0.4.0",
3
+ "version": "0.5.1",
4
4
  "description": "Wholestack — a pro-grade conversational terminal agent for the Wholestack codegen engine. Talk to it in plain language: it writes ISL, generates full-stack or Solidity apps, and proves them with ShipGate. Browser login, membership-gated builds, slash commands, sessions, plan mode, diffs, MCP, plugins.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -62,6 +62,7 @@
62
62
  "zod": "^3.25.76"
63
63
  },
64
64
  "devDependencies": {
65
+ "@isl-lang/zeta-models": "workspace:*",
65
66
  "@types/diff": "^5.2.0",
66
67
  "@types/node": "^20.10.0",
67
68
  "tsup": "^8.0.1",