cursedops 0.17.0 → 0.18.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/relayStage.ts +25 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cursedops",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "description": "The build-and-ops answers this generation's apps wrote independently and identically: finding a generation's roots — and printing a command that runs when pasted — without knowing a path, the generation's whole-tree laws run over one repo from a checkout or a worktree, macOS launchd agent install/replace/remove and the live port a job serves, the scaffolding and verdicts of a deployed smoke (origin probe, the smoke's own environment, a network that lies about DNS, a settled version), the static-serving helpers eight apps copied — the path-traversal guard among them — the API floor that keeps an unmatched /api/... from ever being answered with the app shell, the commit and dirty flag a checkout-served process reports, the Cloudflare Worker deploy toolkit four apps copied (the deploy sequence, exact-set secrets over a pipe, origin-first rollback, the curl edge fetch, the row-for-row D1 import proof, the billed-CPU tail check around a deploy's walk and smoke, and each app's worker:secrets and worker:smoke main as one function of its data), the relay a Worker fronts a Mac-bound app with (the Durable Object, the frames, the Mac's dialer and key rotation — lifted from station for roms — and the signed-in stage walk's skeleton and the relay app's whole worker:deploy), the Worker import-graph and await-port checks every Worker app's suite runs over its own source, and the public-surface ratchet three published libraries each carried a forked copy of. Mechanism only — no app knows its name from here. Bun, zero runtime dependencies (typescript is an optional peer, for public-surface only), ships source.",
5
5
  "type": "module",
6
6
  "scripts": {
package/src/relayStage.ts CHANGED
@@ -220,13 +220,14 @@ export async function putStageLinkDigest(put: DigestPut): Promise<{ ok: boolean;
220
220
  return { ok: held.converged, stderr: done.stderr, detail: `every answer holds it — ${held.detail}` };
221
221
  }
222
222
 
223
- /**
224
- * Sign the stage owner in through auth-stage's emailed second factor and grant `app`'s stage —
225
- * `apps/auth-stage/scripts/inbox.ts` `grant <app>`, whose last stdout line is the grant.
226
- * Never production's accounts service: nothing under test signs in there (`tools/check-prod-auth.ts`).
227
- */
228
- export function grantStageOwner(spec: { forge: string; app: string; run?: Run; stderr?: (text: string) => void }): { ok: boolean; grant: string } {
229
- const done = (spec.run ?? realRun)(["bun", "run", "scripts/inbox.ts", "grant", spec.app], {
223
+ /** Which stage account a grant signs in as — `inbox.ts`'s `StageAccount`. */
224
+ type StageAccount = "owner" | "member";
225
+
226
+ type GrantSpec = { forge: string; app: string; run?: Run; stderr?: (text: string) => void };
227
+
228
+ /** `apps/auth-stage/scripts/inbox.ts` `grant <app> [--member]`, whose last stdout line is the grant. */
229
+ function grantStage(spec: GrantSpec, account: StageAccount): { ok: boolean; grant: string } {
230
+ const done = (spec.run ?? realRun)(["bun", "run", "scripts/inbox.ts", "grant", spec.app, ...(account === "member" ? ["--member"] : [])], {
230
231
  cwd: join(spec.forge, "apps", "auth-stage"),
231
232
  timeout: 300_000,
232
233
  });
@@ -235,6 +236,23 @@ export function grantStageOwner(spec: { forge: string; app: string; run?: Run; s
235
236
  return { ok: done.status === 0 && grant.length > 100, grant };
236
237
  }
237
238
 
239
+ /**
240
+ * Sign the stage owner in through auth-stage's emailed second factor and grant `app`'s stage.
241
+ * Never production's accounts service: nothing under test signs in there (`tools/check-prod-auth.ts`).
242
+ */
243
+ export function grantStageOwner(spec: GrantSpec): { ok: boolean; grant: string } {
244
+ return grantStage(spec, "owner");
245
+ }
246
+
247
+ /**
248
+ * The same grant for the stage's seeded household MEMBER — an ordinary account, never the owner —
249
+ * so a walk can prove on the real edge what an app keeps from everyone but its owner (roms' closed
250
+ * consoles, forge task 3288). Same door, same rules: never production's accounts service.
251
+ */
252
+ export function grantStageMember(spec: GrantSpec): { ok: boolean; grant: string } {
253
+ return grantStage(spec, "member");
254
+ }
255
+
238
256
  export interface RotationSpec {
239
257
  /** Stop the Mac end, resolving once it has exited. */
240
258
  stop: () => Promise<void>;