bareloop 0.32.0 → 0.34.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.
@@ -48,6 +48,11 @@ export type Deps = {
48
48
  * even when `env` is injected; production never sets it.
49
49
  */
50
50
  keysHome?: string | undefined;
51
+ /**
52
+ * the command this run was actually reached through (`src/invoke.js`);
53
+ * `src/cli.js` passes `'bareloop run-u'`, `scripts/run-u.mjs` passes none.
54
+ */
55
+ invokedAs?: string | undefined;
51
56
  out?: ((s: string) => void) | undefined;
52
57
  err?: ((s: string) => void) | undefined;
53
58
  /**
@@ -65,6 +70,45 @@ export type Deps = {
65
70
  */
66
71
  runlistHome?: string | undefined;
67
72
  };
73
+ /**
74
+ * The one-runner door's hand-in (`src/bundlerun.js`, the exported bundle's `bareloop run`):
75
+ * where a bundle run's books live and how it prints its own re-invocation. Set ONLY by
76
+ * that caller through `startRun`/`resumeRun` opts, in-process — `main`'s argv never builds
77
+ * it, so a local job cannot reach it. Absent, every use below is today's expression.
78
+ */
79
+ export type BundleRun = {
80
+ /**
81
+ * the run id (also the `runs/<runid>` directory name)
82
+ */
83
+ runid: string;
84
+ /**
85
+ * `<bundle>/runs/<runid>`: spine.jsonl, gate-audit.jsonl and close/ live here
86
+ */
87
+ runDir: string;
88
+ /**
89
+ * the bare re-invocation prefix printed in resume hints (`bareloop run <bundle> --repo <path>`), no ceiling flags
90
+ */
91
+ invoke: string;
92
+ /**
93
+ * the ceilings the person tightened on THIS leg; printed after `invoke` on every resume line except a money halt's (which never prints the exhausted `--budget`)
94
+ */
95
+ tightened: {
96
+ budgetUsd?: number;
97
+ wallMin?: number;
98
+ };
99
+ /**
100
+ * the bundle's SIGNED spec budgetUsd (the tightened leg ceiling is `spec.budgetUsd`); printed only, never enforced from here
101
+ */
102
+ signedBudgetUsd: number;
103
+ /**
104
+ * the hash printed after `--approve` in those hints (the bundle's, not the run spec's)
105
+ */
106
+ printApprove: string;
107
+ /**
108
+ * creates the run's tree (fresh worktree) and its books; the engine calls it once every $0 refusal has passed, so a refusal leaks nothing
109
+ */
110
+ prepareTree: () => void;
111
+ };
68
112
  export type RunOpts = {
69
113
  /**
70
114
  * the parsed, not-yet-validated job spec — read by
@@ -136,6 +180,10 @@ export type RunOpts = {
136
180
  * how a "go edit the spec" hint should read
137
181
  */
138
182
  specDesc?: string | undefined;
183
+ /**
184
+ * set only by the bundle door (see `BundleRun`)
185
+ */
186
+ bundle?: BundleRun | undefined;
139
187
  deps?: Deps | undefined;
140
188
  };
141
189
  export type RunCtx = {
@@ -159,5 +207,6 @@ export type RunCtx = {
159
207
  door: string | null;
160
208
  decide: string | null;
161
209
  text: string | null;
210
+ bundle?: BundleRun | undefined;
162
211
  deps: Deps;
163
212
  };