@usine/server 0.1.0 → 0.2.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.
Files changed (62) hide show
  1. package/README.md +42 -1
  2. package/dist/backend.d.ts +16 -9
  3. package/dist/backend.d.ts.map +1 -1
  4. package/dist/backend.js +13 -2
  5. package/dist/backend.js.map +1 -1
  6. package/dist/backup.d.ts +4 -0
  7. package/dist/backup.d.ts.map +1 -0
  8. package/dist/backup.js +13 -0
  9. package/dist/backup.js.map +1 -0
  10. package/dist/cli.d.ts +36 -7
  11. package/dist/cli.d.ts.map +1 -1
  12. package/dist/cli.js +115 -28
  13. package/dist/cli.js.map +1 -1
  14. package/dist/export-run.d.ts +22 -0
  15. package/dist/export-run.d.ts.map +1 -0
  16. package/dist/export-run.js +85 -0
  17. package/dist/export-run.js.map +1 -0
  18. package/dist/http.d.ts.map +1 -1
  19. package/dist/http.js +99 -138
  20. package/dist/http.js.map +1 -1
  21. package/dist/index.d.ts +1 -7
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +1 -7
  24. package/dist/index.js.map +1 -1
  25. package/dist/main.js +18 -8
  26. package/dist/main.js.map +1 -1
  27. package/dist/shutdown.d.ts +7 -0
  28. package/dist/shutdown.d.ts.map +1 -0
  29. package/dist/shutdown.js +49 -0
  30. package/dist/shutdown.js.map +1 -0
  31. package/dist/up.d.ts +2 -2
  32. package/dist/up.d.ts.map +1 -1
  33. package/dist/up.js +48 -25
  34. package/dist/up.js.map +1 -1
  35. package/dist/web/assets/_name-DdyMEUN6.js +6 -0
  36. package/dist/web/assets/_name-eoobiMh0.js +1 -0
  37. package/dist/web/assets/_name-pUxlKZt5.js +1 -0
  38. package/dist/web/assets/badge-t7m0Vk1K.js +146 -0
  39. package/dist/web/assets/bash-CLZ0U2zV.js +1 -0
  40. package/dist/web/assets/button-BoOukj77.js +1 -0
  41. package/dist/web/assets/core-CLXRiB63.js +12 -0
  42. package/dist/web/assets/diff-woXpYk--.js +1 -0
  43. package/dist/web/assets/empty-DbVYU7bi.js +1 -0
  44. package/dist/web/assets/engine-javascript-h-x4hGa4.js +141 -0
  45. package/dist/web/assets/index-CVBBoW6r.css +2 -0
  46. package/dist/web/assets/index-CsW8KcJW.js +10 -0
  47. package/dist/web/assets/json-qhed-kSA.js +1 -0
  48. package/dist/web/assets/loops-DghpuoiG.js +1 -0
  49. package/dist/web/assets/operator-copy-DIsVXn17.js +1 -0
  50. package/dist/web/assets/overview-DmCIVPwN.js +1 -0
  51. package/dist/web/assets/rolldown-runtime-hePW80VL.js +1 -0
  52. package/dist/web/assets/routes-BDyP7vCr.js +1 -0
  53. package/dist/web/assets/run-drawer-B-xhTXe4.js +157 -0
  54. package/dist/web/assets/status-badge-yblcElE0.js +1 -0
  55. package/dist/web/assets/table-B8cLYNvq.js +1 -0
  56. package/dist/web/assets/typescript-bsJCZSQ-.js +1 -0
  57. package/dist/web/assets/useCompositeItem-HmBmWxUW.js +1 -0
  58. package/dist/web/assets/with-selector-N6m4X0X_.js +1 -0
  59. package/dist/web/index.html +9 -2
  60. package/package.json +7 -7
  61. package/dist/web/assets/index-CjRDHHWF.css +0 -2
  62. package/dist/web/assets/index-DmN0SkGf.js +0 -295
package/README.md CHANGED
@@ -12,4 +12,45 @@ The command prints `http://127.0.0.1:7331` and stays attached to the terminal. P
12
12
 
13
13
  Without GitHub App credentials, it opens the setup screen in the default browser, logs the typed credential error, and leaves both trigger streams idle instead of crashing. The browser command has a two-second timeout; a failed opener produces a warning and does not stop the server. Existing Runs, transcript detail, and database-backed Loop pause state remain observable, while interventions stay unavailable. Credentials may come from `USINE_GITHUB_APP_ID` plus `USINE_GITHUB_PRIVATE_KEY`, or from a mode-0600 `.usine/github-app.json` file with `app_id` and `private_key` fields. The running process reads credentials only at startup, so stop and rerun `usine up` after adding them; the setup screen states that restart requirement explicitly.
14
14
 
15
- The local-only UI opens each project as a Board built from its authored or proposed lanes. Moving an Item between label-backed lanes updates its GitHub labels; normal polling then evaluates label-protocol loops. Board cards show the latest Run and open its existing detail drawer. The UI can also approve, retry, or cancel a Run; pause or unpause a Loop's database runtime state; page backward through older transcript rows; and tail parent and one-level child session activity.
15
+ The local-only UI opens each project as a Board built from its authored or proposed lanes. Proposed lanes are read-only. Configure `repos[].lanes` in `usine.yaml` and restart `usine up` to enable moves; see the [lane configuration example](../../packages/config/README.md). Moving an Item into an authored label-backed lane exchanges only the labels in that map, preserving descriptive labels outside it; normal polling then evaluates label-protocol loops. Board cards show the latest Run and open its existing detail drawer. The UI can also approve, retry, or cancel a Run; pause or unpause a Loop's database runtime state; page backward through older transcript rows; and tail parent and one-level child session activity.
16
+
17
+ Run conversations remember the reader’s filter, inspected disclosures and reading place when the drawer reopens or the page refreshes. Bookmarks are specific to each Run and browser origin; unread activity remains pending while a saved place is restored. See the [conversation reader behavior](../web/README.md#returning-to-a-conversation) for retention and history-recovery limits.
18
+
19
+ Direct browser requests for UI routes serve the application shell, so refreshing or sharing a Project or Configuration URL works. Unknown `/api/*` routes, missing `/assets/*` files, and other file-like paths remain 404 responses.
20
+
21
+ Run conversations summarize adjacent completed tools by their recorded actions, including the files read or changed and recognized test or build invocations. Expand a group to inspect each tool and its result.
22
+
23
+ The operator API includes `POST /api/cycle-budgets/reset` with an Ask identity. It uses the same request-origin guard and typed error contract as other interventions; stale Asks return 409 and needs-setup mode rejects resets until the runtime is available.
24
+
25
+ ## Runtime backup and Run evidence
26
+
27
+ From the instance folder, copy the runtime store while the orchestrator runs:
28
+
29
+ ```sh
30
+ usine backup /path/to/runtime-backup.sqlite
31
+ ```
32
+
33
+ `usine backup` copies all runtime tables, including committed WAL data, while the orchestrator runs. It opens the source read-only and doesn't need GitHub credentials.
34
+
35
+ Use a new filename in an existing writable directory on a filesystem that supports hard links. The command writes a complete backup with owner-only permissions and won't overwrite existing files. Errors identify the affected path and cause.
36
+
37
+ Keep the backup outside the instance folder to protect it against loss of that folder. Back up the authored instance files and credentials separately. To restore, stop the orchestrator, move the existing `.usine/runtime.sqlite` and any `runtime.sqlite-wal` / `runtime.sqlite-shm` files aside, and copy the backup to `.usine/runtime.sqlite`. Restart with the matching instance configuration and engine version. Restoring an older backup also restores its older deduplication ledger, so work performed after that backup can run again.
38
+
39
+ From the instance folder, export one Run into a local JSON file:
40
+
41
+ ```sh
42
+ usine export-run <runId>
43
+ usine export-run <runId> --output /path/to/evidence.json
44
+ ```
45
+
46
+ The default destination is `run-<encoded-runId>.json` in the current directory; characters such as `/` in the Run id are percent-encoded. The output directory must already exist. The command writes a complete file with owner-only permissions, preserves existing destinations, and prints its path after success. A missing Run, unreadable runtime store, encoding failure, or write failure returns a nonzero exit status.
47
+
48
+ The versioned JSON contains `exportedAt`, the full durable Run `snapshot` (Event, effective task and Agent, repository revision, Step result, and all Attempts), and every saved transcript envelope for those Attempts in append order. The snapshot and transcripts come from one database transaction, including history beyond the drawer's current page. Active Runs continue accumulating history, so export a settled Run for its final evidence.
49
+
50
+ Exporting opens the instance's existing `.usine/runtime.sqlite` in read-only mode, without creating tables, running migrations, starting Attempts, or polling triggers. The command keeps the output local. Transcripts can contain repository content and tool output; inspect the file before sharing it. A Run export preserves selected evidence; use `usine backup <path>` for a restorable runtime database, as described in [ADR 0010](../../docs/adr/0010-single-sqlite-runtime-store.md).
51
+
52
+ ## Stopping and updating
53
+
54
+ Send SIGTERM or press Ctrl+C once to stop trigger polling and drain admitted Attempts. The server waits up to `max_attempt_minutes` from the shutdown request before closing the runtime. A second SIGTERM or Ctrl+C stops the wait immediately. Queued Runs and automatic retries remain saved for the next start. An Attempt interrupted by the deadline or force stop uses normal restart recovery.
55
+
56
+ After `pnpm build`, reload the page to use the rebuilt web bundle; no process restart is required. Instance configuration and GitHub credentials are read at startup.
package/dist/backend.d.ts CHANGED
@@ -1,6 +1,9 @@
1
- import type { LoadedInstance } from "@usine/config";
2
- import { Loop, Run } from "@usine/core";
3
- import type { FactoryOverview, BoardMove, Operator, OperatorObservation, OperatorError, RunDetailView, TranscriptRequest } from "@usine/orchestrator";
1
+ import type { LoadedInstance } from "@usine/config/instance";
2
+ import { LoopName } from "@usine/core/loop";
3
+ import { CycleBudgetAskId } from "@usine/core/cycle-budget";
4
+ import { RunId } from "@usine/core/run";
5
+ import { AgentName } from "@usine/core/agent";
6
+ import { type BoardMove, type FactoryOverview, type RunDetailView, type TranscriptRequest, type Operator, type OperatorError, type OperatorObservation, type EditAndRetry, type SessionIntervention } from "@usine/orchestrator/operator";
4
7
  import { Context, Effect, Layer, Schema } from "effect";
5
8
  declare const BackendUnavailableError_base: Schema.Class<BackendUnavailableError, Schema.TaggedStruct<"BackendUnavailableError", {
6
9
  readonly message: Schema.String;
@@ -10,13 +13,17 @@ export declare class BackendUnavailableError extends BackendUnavailableError_bas
10
13
  export type BackendError = OperatorError | BackendUnavailableError;
11
14
  declare const FactoryBackend_base: Context.ServiceClass<FactoryBackend, "@usine/server/FactoryBackend", {
12
15
  readonly overview: Effect.Effect<FactoryOverview, BackendError>;
13
- readonly detail: (runId: Run.RunId, request: TranscriptRequest) => Effect.Effect<RunDetailView, BackendError>;
14
- readonly approve: (runId: Run.RunId) => Effect.Effect<void, BackendError>;
15
- readonly retry: (runId: Run.RunId) => Effect.Effect<void, BackendError>;
16
- readonly cancel: (runId: Run.RunId) => Effect.Effect<void, BackendError>;
16
+ readonly detail: (runId: RunId, request: TranscriptRequest) => Effect.Effect<RunDetailView, BackendError>;
17
+ readonly approve: (runId: RunId) => Effect.Effect<void, BackendError>;
18
+ readonly resetCycleBudget: (askId: CycleBudgetAskId) => Effect.Effect<void, BackendError>;
19
+ readonly retry: (runId: RunId) => Effect.Effect<void, BackendError>;
20
+ readonly agents: Effect.Effect<ReadonlyArray<AgentName>, BackendError>;
21
+ readonly editAndRetry: (runId: RunId, edit: EditAndRetry) => Effect.Effect<void, BackendError>;
22
+ readonly intervene: (runId: RunId, input: SessionIntervention) => Effect.Effect<void, BackendError>;
23
+ readonly cancel: (runId: RunId) => Effect.Effect<void, BackendError>;
17
24
  readonly moveBoardItem: (move: BoardMove) => Effect.Effect<void, BackendError>;
18
- readonly pause: (loop: Loop.LoopName) => Effect.Effect<void, BackendError>;
19
- readonly unpause: (loop: Loop.LoopName) => Effect.Effect<void, BackendError>;
25
+ readonly pause: (loop: LoopName) => Effect.Effect<void, BackendError>;
26
+ readonly unpause: (loop: LoopName) => Effect.Effect<void, BackendError>;
20
27
  }>;
21
28
  export declare class FactoryBackend extends FactoryBackend_base {
22
29
  }
@@ -1 +1 @@
1
- {"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EACV,eAAe,EACf,SAAS,EACT,QAAQ,EACR,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,iBAAiB,EAClB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;;;;AAExD,qBAAa,uBAAwB,SAAQ,4BAI3C;CAAG;AAEL,MAAM,MAAM,YAAY,GAAG,aAAa,GAAG,uBAAuB,CAAC;;uBAK5C,MAAM,CAAC,MAAM,CAAC,eAAe,EAAE,YAAY,CAAC;qBAC9C,CACf,KAAK,EAAE,GAAG,CAAC,KAAK,EAChB,OAAO,EAAE,iBAAiB,KACvB,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,YAAY,CAAC;sBAC7B,CAAC,KAAK,EAAE,GAAG,CAAC,KAAK,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC;oBACzD,CAAC,KAAK,EAAE,GAAG,CAAC,KAAK,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC;qBACtD,CAAC,KAAK,EAAE,GAAG,CAAC,KAAK,KAAK,MAAM,CAA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AG;AAEtC,eAAO,MAAM,gBAAgB,aACjB,cAAc,YACd,QAAQ,CAAC,SAAS,CAAC,KAC5B,KAAK,CAAC,KAAK,CAAC,cAAc,CAczB,CAAC;AAEL,eAAO,MAAM,sBAAsB,aACvB,cAAc,YACd,MAAM,eACH,mBAAmB,CAAC,SAAS,CAAC,KAC1C,KAAK,CAAC,KAAK,CAAC,cAAc,CA2B5B,CAAC"}
package/dist/backend.js CHANGED
@@ -1,5 +1,8 @@
1
- import { Loop, Run } from "@usine/core";
2
- import { NeedsSetupOverview } from "@usine/orchestrator";
1
+ import { LoopName } from "@usine/core/loop";
2
+ import { CycleBudgetAskId } from "@usine/core/cycle-budget";
3
+ import { RunId } from "@usine/core/run";
4
+ import { AgentName } from "@usine/core/agent";
5
+ import { NeedsSetupOverview, } from "@usine/orchestrator/operator";
3
6
  import { Context, Effect, Layer, Schema } from "effect";
4
7
  export class BackendUnavailableError extends Schema.TaggedError("@usine/server/BackendUnavailableError")("BackendUnavailableError", {
5
8
  message: Schema.String,
@@ -11,7 +14,11 @@ export const liveBackendLayer = (instance, operator) => Layer.succeed(FactoryBac
11
14
  overview: operator.overview(instance),
12
15
  detail: operator.detail,
13
16
  approve: operator.approve,
17
+ resetCycleBudget: operator.resetCycleBudget,
14
18
  retry: operator.retry,
19
+ agents: Effect.succeed(instance.agents.map(({ name }) => name)),
20
+ editAndRetry: (runId, edit) => operator.editAndRetry(instance, runId, edit),
21
+ intervene: (runId, input) => operator.intervene(instance, runId, input),
15
22
  cancel: operator.cancel,
16
23
  moveBoardItem: (move) => operator.moveBoardItem(instance, move),
17
24
  pause: (loop) => operator.pause(loop).pipe(Effect.asVoid),
@@ -29,7 +36,11 @@ export const needsSetupBackendLayer = (instance, errorTag, observation) => {
29
36
  overview,
30
37
  detail: observation.detail,
31
38
  approve: fail,
39
+ resetCycleBudget: fail,
32
40
  retry: fail,
41
+ agents: Effect.succeed(instance.agents.map(({ name }) => name)),
42
+ editAndRetry: fail,
43
+ intervene: f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@
1
+ import { Effect, Path } from "effect";
2
+ /** Copies the current instance's runtime database to `output`, resolved from the working directory. */
3
+ export declare const backup: (output: string) => Effect.Effect<void, import("@usine/engine/local-sqlite").RuntimeStoreBackupError, Path.Path>;
4
+ //# sourceMappingURL=backup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backup.d.ts","sourceRoot":"","sources":["../src/backup.ts"],"names":[],"mappings":"AAEA,OAAO,EAAW,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE/C,uGAAuG;AACvG,eAAO,MAAM,MAAM,kHAOjB,CAAC"}
package/dist/backup.js ADDED
@@ -0,0 +1,13 @@
1
+ import { InstanceDirectory } from "@usine/core/instance";
2
+ import { backup as backupDatabase } from "@usine/engine/local-sqlite";
3
+ import { Console, Effect, Path } from "effect";
4
+ /** Copies the current instance's runtime database to `output`, resolved from the working directory. */
5
+ export const backup = Effect.fn("Cli.backup")(function* (output) {
6
+ const directory = InstanceDirectory.make(process.cwd());
7
+ const path = yield* Path.Path;
8
+ const destination = path.resolve(output);
9
+ yield* Effect.annotateCurrentSpan({ instanceDirectory: directory, destination });
10
+ yield* backupDatabase(directory, destination);
11
+ yield* Console.log(`Backed up runtime store to ${destination}`);
12
+ });
13
+ //# sourceMappingURL=backup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backup.js","sourceRoot":"","sources":["../src/backup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE/C,uGAAuG;AACvG,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,EAAE,MAAc;IACrE,MAAM,SAAS,GAAG,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACxD,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;IAC9B,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACzC,KAAK,CAAC,CAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE,iBAAiB,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC,CAAC;IACjF,KAAK,CAAC,CAAC,cAAc,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAC9C,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,8BAA8B,WAAW,EAAE,CAAC,CAAC;AAClE,CAAC,CAAC,CAAC"}
package/dist/cli.d.ts CHANGED
@@ -5,7 +5,7 @@ export declare const DEFAULT_PORT = 7331;
5
5
  export declare const BROWSER_OPEN_TIMEOUT = "2 seconds";
6
6
  export declare const Port: Schema.brand<Schema.Int, "ServerPort">;
7
7
  export type Port = typeof Port.Type;
8
- export declare const CLI_USAGE = "Usage:\n usine up [--port <port>]\n usine --help\n usine --version\n\nOptions:\n -p, --port <port> Listen on this port (default: 7331)\n -h, --help Print this usage\n -v, --version Print the pinned @usine/server version\n\nEnvironment:\n USINE_PORT Listen on this port when --port is absent";
8
+ export declare const CLI_USAGE = "Usage:\n usine up [--port <port>] [--allow-volatile-instance]\n usine backup <path>\n usine export-run <runId> [--output <path>]\n usine --help\n usine --version\n\nOptions:\n -p, --port <port> Listen on this port (default: 7331)\n --allow-volatile-instance Start even when the instance folder sits under a temp path\n -o, --output <path> Write Run evidence here (default: run-<encoded-runId>.json)\n -h, --help Print this usage\n -v, --version Print the pinned @usine/server version\n\nEnvironment:\n USINE_PORT Listen on this port when --port is absent\n USINE_ALLOW_VOLATILE_INSTANCE Same as --allow-volatile-instance when set to 1";
9
9
  declare const CliUsageError_base: Schema.Class<CliUsageError, Schema.TaggedStruct<"CliUsageError", {
10
10
  readonly message: Schema.String;
11
11
  }>, import("effect/Cause").YieldableError>;
@@ -27,6 +27,13 @@ declare const ServerStartError_base: Schema.Class<ServerStartError, Schema.Tagge
27
27
  }>, import("effect/Cause").YieldableError>;
28
28
  export declare class ServerStartError extends ServerStartError_base {
29
29
  }
30
+ declare const VolatileInstanceDirectoryError_base: Schema.Class<VolatileInstanceDirectoryError, Schema.TaggedStruct<"VolatileInstanceDirectoryError", {
31
+ readonly directory: Schema.String;
32
+ readonly root: Schema.String;
33
+ }>, import("effect/Cause").YieldableError>;
34
+ /** Raised when the instance folder sits under a path the OS may clear, since its runtime store is the only copy of run history. */
35
+ export declare class VolatileInstanceDirectoryError extends VolatileInstanceDirectoryError_base {
36
+ }
30
37
  declare const BrowserOpenError_base: Schema.Class<BrowserOpenError, Schema.TaggedStruct<"BrowserOpenError", {
31
38
  readonly command: Schema.String;
32
39
  readonly cause: Schema.Defect;
@@ -41,18 +48,40 @@ export declare class VersionCommand extends VersionCommand_base {
41
48
  }
42
49
  declare const UpCommand_base: Schema.Class<UpCommand, Schema.TaggedStruct<"UpCommand", {
43
50
  readonly port: Schema.brand<Schema.Int, "ServerPort">;
51
+ readonly allowVolatileInstance: Schema.Boolean;
44
52
  }>, {}>;
45
53
  export declare class UpCommand extends UpCommand_base {
46
54
  }
47
- export declare const CliCommand: Schema.Union<readonly [typeof HelpCommand, typeof VersionCommand, typeof UpCommand]>;
55
+ declare const ExportRunCommand_base: Schema.Class<ExportRunCommand, Schema.TaggedStruct<"ExportRunCommand", {
56
+ readonly runId: Schema.brand<Schema.NonEmptyString, "RunId">;
57
+ readonly output: Schema.Option<Schema.NonEmptyString>;
58
+ }>, {}>;
59
+ /** Exports one Run from the current instance into a new local JSON file. */
60
+ export declare class ExportRunCommand extends ExportRunCommand_base {
61
+ }
62
+ declare const BackupCommand_base: Schema.Class<BackupCommand, Schema.TaggedStruct<"BackupCommand", {
63
+ readonly output: Schema.NonEmptyString;
64
+ }>, {}>;
65
+ /** Copies the current instance's runtime store into a new SQLite file. */
66
+ export declare class BackupCommand extends BackupCommand_base {
67
+ }
68
+ export interface CliEnvironment {
69
+ readonly port: Option.Option<string>;
70
+ readonly allowVolatileInstance: Option.Option<string>;
71
+ }
72
+ export declare const CliCommand: Schema.Union<readonly [typeof HelpCommand, typeof VersionCommand, typeof UpCommand, typeof ExportRunCommand, typeof BackupCommand]>;
48
73
  export type CliCommand = typeof CliCommand.Type;
49
- /** Parse process arguments and environment into one validated CLI command. */
50
- export declare const parseCli: (args: readonly string[], environmentPort: Option.Option<string>) => Effect.Effect<HelpCommand | UpCommand | VersionCommand, CliUsageError, never>;
51
- /** Read the package version npm pinned for this installed server. */
74
+ /** Parses process arguments and the environment into one validated CLI command. */
75
+ export declare const parseCli: (args: readonly string[], environment: CliEnvironment) => Effect.Effect<BackupCommand | ExportRunCommand | HelpCommand | UpCommand | VersionCommand, CliUsageError, never>;
76
+ /** Directories the OS may clear: `os.tmpdir()`, `$TMPDIR`, and the usual temp locations. */
77
+ export declare const volatileRoots: (environmentTmpdir: Option.Option<string>) => ReadonlyArray<string>;
78
+ /** Returns the volatile root the directory sits under, if any. Paths are compared as given, with symlinks unresolved. */
79
+ export declare const volatileRoot: (directory: string, roots: ReadonlyArray<string>) => Option.Option<string>;
80
+ /** Reads the version of this installed server from its package.json. */
52
81
  export declare const packageVersion: () => Effect.Effect<string, CliVersionError, FileSystem.FileSystem>;
53
- /** Translate Effect's low-level bind failure into the CLI's startup vocabulary. */
82
+ /** Maps a bind failure to the CLI's startup error, so an address already in use is reported as such. */
54
83
  export declare const serverStartError: (port: Port, error: ServeError) => PortInUseError | ServerStartError;
55
- /** Open the setup page after the HTTP server has bound successfully. */
84
+ /** Opens the setup page in a browser; call it only after the HTTP server has bound. */
56
85
  export declare const openBrowser: (url: string, timeout?: Duration.Input | undefined) => Effect.Effect<undefined, BrowserOpenError, ChildProcessSpawner.ChildProcessSpawner>;
57
86
  export {};
58
87
  //# sourceMappingURL=cli.d.ts.map
package/dist/cli.d.ts.map CHANGED
@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,qIAMrB,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAC;AAyEhD,mFAAmF;AACnF,eAAO,MAAM,QAAQ,4KAmBnB,CAAC;AAEH,4FAA4F;AAC5F,eAAO,MAAM,aAAa,sBAAuB,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAG,aAAa,CAAC,MAAM,CAW5D,CAAC;AAKlC,yHAAyH;AACzH,eAAO,MAAM,YAAY,cACZ,MAAM,SACV,aAAa,CAAC,MAAM,CAAC,KAC3B,MAAM,CAAC,MAAM,CAAC,MAAM,CAGtB,CAAC;AAMF,wEAAwE;AACxE,eAAO,MAAM,cAAc,qEAUzB,CAAC;AAIH,wGAAwG;AACxG,eAAO,MAAM,gBAAgB,SAAU,IAAI,SAAS,UAAU,sCAGN,CAAC;AAUzD,uFAAuF;AACvF,eAAO,MAAM,WAAW,4IAyBtB,CAAC"}
package/dist/cli.js CHANGED
@@ -1,4 +1,7 @@
1
+ import { tmpdir } from "node:os";
2
+ import { resolve, sep } from "node:path";
1
3
  import { fileURLToPath } from "node:url";
4
+ import { RunId } from "@usine/core/run";
2
5
  import { Console, Duration, Effect, FileSystem, Option, Schema } from "effect";
3
6
  import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
4
7
  export const DEFAULT_PORT = 7_331;
@@ -6,17 +9,22 @@ export const BROWSER_OPEN_TIMEOUT = "2 seconds";
6
9
  export const Port = Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 65_535 }, { message: "Expected a TCP port" })).pipe(Schema.brand("ServerPort"));
7
10
  const PortFromString = Schema.NumberFromString.pipe(Schema.decodeTo(Port));
8
11
  export const CLI_USAGE = `Usage:
9
- usine up [--port <port>]
12
+ usine up [--port <port>] [--allow-volatile-instance]
13
+ usine backup <path>
14
+ usine export-run <runId> [--output <path>]
10
15
  usine --help
11
16
  usine --version
12
17
 
13
18
  Options:
14
- -p, --port <port> Listen on this port (default: 7331)
15
- -h, --help Print this usage
16
- -v, --version Print the pinned @usine/server version
19
+ -p, --port <port> Listen on this port (default: 7331)
20
+ --allow-volatile-instance Start even when the instance folder sits under a temp path
21
+ -o, --output <path> Write Run evidence here (default: run-<encoded-runId>.json)
22
+ -h, --help Print this usage
23
+ -v, --version Print the pinned @usine/server version
17
24
 
18
25
  Environment:
19
- USINE_PORT Listen on this port when --port is absent`;
26
+ USINE_PORT Listen on this port when --port is absent
27
+ USINE_ALLOW_VOLATILE_INSTANCE Same as --allow-volatile-instance when set to 1`;
20
28
  export class CliUsageError extends Schema.TaggedError("@usine/server/CliUsageError")("CliUsageError", { message: Schema.String }) {
21
29
  }
22
30
  export class CliVersionError extends Schema.TaggedError("@usine/server/CliVersionError")("CliVersionError", { cause: Schema.Defect() }) {
@@ -25,6 +33,12 @@ export class PortInUseError extends Schema.TaggedError("@usine/server/PortInUseE
25
33
  }
26
34
  export class ServerStartError extends Schema.TaggedError("@usine/server/ServerStartError")("ServerStartError", { port: Port, cause: Schema.Defect() }) {
27
35
  }
36
+ /** Raised when the instance folder sits under a path the OS may clear, since its runtime store is the only copy of run history. */
37
+ export class VolatileInstanceDirectoryError extends Schema.TaggedError("@usine/server/VolatileInstanceDirectoryError")("VolatileInstanceDirectoryError", {
38
+ directory: Schema.String,
39
+ root: Schema.String,
40
+ }) {
41
+ }
28
42
  export class BrowserOpenError extends Schema.TaggedError("@usine/server/BrowserOpenError")("BrowserOpenError", {
29
43
  command: Schema.String,
30
44
  cause: Schema.Defect(),
@@ -34,42 +48,115 @@ export class HelpCommand extends Schema.TaggedClass("@usine/server/HelpCommand")
34
48
  }
35
49
  export class VersionCommand extends Schema.TaggedClass("@usine/server/VersionCommand")("VersionCommand", {}) {
36
50
  }
37
- export class UpCommand extends Schema.TaggedClass("@usine/server/UpCommand")("UpCommand", { port: Port }) {
51
+ export class UpCommand extends Schema.TaggedClass("@usine/server/UpCommand")("UpCommand", { port: Port, allowVolatileInstance: Schema.Boolean }) {
52
+ }
53
+ /** Exports one Run from the current instance into a new local JSON file. */
54
+ export class ExportRunCommand extends Schema.TaggedClass("@usine/server/ExportRunCommand")("ExportRunCommand", {
55
+ runId: RunId,
56
+ output: Schema.Option(Schema.NonEmptyString),
57
+ }) {
58
+ }
59
+ /** Copies the current instance's runtime store into a new SQLite file. */
60
+ export class BackupCommand extends Schema.TaggedClass("@usine/server/BackupCommand")("BackupCommand", { output: Schema.NonEmptyString }) {
38
61
  }
39
- export const CliCommand = Schema.Union([HelpCommand, VersionCommand, UpCommand]);
62
+ export const CliCommand = Schema.Union([
63
+ HelpCommand,
64
+ VersionCommand,
65
+ UpCommand,
66
+ ExportRunCommand,
67
+ BackupCommand,
68
+ ]);
40
69
  const usageError = (message = CLI_USAGE) => new CliUsageError({ message });
41
70
  const decodePort = (source, value) => Schema.decodeUnknownEffect(PortFromString)(value).pipe(Effect.mapError(() => usageError(`${source} must be a whole number between 1 and 65535.\n\n${CLI_USAGE}`)));
42
- const upPort = (args, environmentPort) => {
43
- if (args.length === 0) {
44
- return Option.match(environmentPort, {
71
+ const ALLOW_VOLATILE_FLAG = "--allow-volatile-instance";
72
+ const exportRunCommand = (args) => {
73
+ const [runId, flag, output] = args;
74
+ if (runId === undefined ||
75
+ runId.startsWith("-") ||
76
+ !(args.length === 1 || (args.length === 3 && (flag === "--output" || flag === "-o"))))
77
+ return Effect.fail(usageError());
78
+ return Schema.decodeUnknownEffect(ExportRunCommand)({
79
+ _tag: "ExportRunCommand",
80
+ runId,
81
+ output: Option.fromUndefinedOr(output),
82
+ }).pipe(Effect.mapError(() => usageError()));
83
+ };
84
+ const backupCommand = (args) => {
85
+ const [output] = args;
86
+ if (args.length !== 1 || output === undefined || output.startsWith("-"))
87
+ return Effect.fail(usageError());
88
+ return Schema.decodeUnknownEffect(BackupCommand)({ _tag: "BackupCommand", output }).pipe(Effect.mapError(() => usageError()));
89
+ };
90
+ const upCommand = (args, environment) => Effect.gen(function* () {
91
+ let port = Option.none();
92
+ let allowVolatileInstance = Option.exists(environment.allowVolatileInstance, (v) => v === "1");
93
+ for (let index = 0; index < args.length; index += 1) {
94
+ const arg = args[index];
95
+ if (arg === "--port" || arg === "-p") {
96
+ const value = args[index + 1];
97
+ if (value === undefined)
98
+ return yield* usageError();
99
+ port = Option.some(value);
100
+ index += 1;
101
+ }
102
+ else if (arg?.startsWith("--port=")) {
103
+ port = Option.some(arg.slice("--port=".length));
104
+ }
105
+ else if (arg === ALLOW_VOLATILE_FLAG) {
106
+ allowVolatileInstance = true;
107
+ }
108
+ else {
109
+ return yield* usageError();
110
+ }
111
+ }
112
+ const resolvedPort = yield* Option.match(port, {
113
+ onNone: () => Option.match(environment.port, {
45
114
  onNone: () => Effect.succeed(Port.make(DEFAULT_PORT)),
46
115
  onSome: (value) => decodePort("USINE_PORT", value),
47
- });
48
- }
49
- if (args.length === 2 && (args[0] === "--port" || args[0] === "-p")) {
50
- const value = args[1];
51
- return value === undefined ? Effect.fail(usageError()) : decodePort("--port", value);
52
- }
53
- if (args.length === 1 && args[0]?.startsWith("--port=")) {
54
- return decodePort("--port", args[0].slice("--port=".length));
55
- }
56
- return Effect.fail(usageError());
57
- };
58
- /** Parse process arguments and environment into one validated CLI command. */
59
- export const parseCli = Effect.fn("Cli.parse")((args, environmentPort) => {
116
+ }),
117
+ onSome: (value) => decodePort("--port", value),
118
+ });
119
+ return new UpCommand({ port: resolvedPort, allowVolatileInstance });
120
+ });
121
+ /** Parses process arguments and the environment into one validated CLI command. */
122
+ export const parseCli = Effect.fn("Cli.parse")((args, environment) => {
60
123
  if ((args.length === 1 && (args[0] === "--help" || args[0] === "-h")) ||
61
- (args.length === 2 && args[0] === "up" && (args[1] === "--help" || args[1] === "-h"))) {
124
+ (args.length === 2 &&
125
+ (args[0] === "up" || args[0] === "export-run" || args[0] === "backup") &&
126
+ (args[1] === "--help" || args[1] === "-h"))) {
62
127
  return Effect.succeed(new HelpCommand());
63
128
  }
64
129
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v")) {
65
130
  return Effect.succeed(new VersionCommand());
66
131
  }
132
+ if (args[0] === "backup")
133
+ return backupCommand(args.slice(1));
134
+ if (args[0] === "export-run")
135
+ return exportRunCommand(args.slice(1));
67
136
  if (args[0] !== "up")
68
137
  return Effect.fail(usageError());
69
- return upPort(args.slice(1), environmentPort).pipe(Effect.map((port) => new UpCommand({ port })));
138
+ return upCommand(args.slice(1), environment);
70
139
  });
140
+ /** Directories the OS may clear: `os.tmpdir()`, `$TMPDIR`, and the usual temp locations. */
141
+ export const volatileRoots = (environmentTmpdir) => [
142
+ ...new Set([
143
+ tmpdir(),
144
+ ...Option.toArray(environmentTmpdir),
145
+ "/tmp",
146
+ "/private/tmp",
147
+ "/var/folders",
148
+ ]),
149
+ ]
150
+ .filter((root) => root.length > 0)
151
+ .map((root) => resolve(root));
152
+ const isUnder = (directory, root) => directory === root || directory.startsWith(root.endsWith(sep) ? root : `${root}${sep}`);
153
+ /** Returns the volatile root the directory sits under, if any. Paths are compared as given, with symlinks unresolved. */
154
+ export const volatileRoot = (directory, roots) => {
155
+ const resolved = resolve(directory);
156
+ return Option.fromNullishOr(roots.find((root) => isUnder(resolved, root)));
157
+ };
71
158
  const PackageMetadataFromJson = Schema.fromJsonString(Schema.Struct({ version: Schema.NonEmptyString }));
72
- /** Read the package version npm pinned for this installed server. */
159
+ /** Reads the version of this installed server from its package.json. */
73
160
  export const packageVersion = Effect.fn("Cli.packageVersion")(function* () {
74
161
  const fileSystem = yield* FileSystem.FileSystem;
75
162
  const packagePath = fileURLToPath(new URL("../package.json", import.meta.url));
@@ -80,7 +167,7 @@ export const packageVersion = Effect.fn("Cli.packageVersion")(function* () {
80
167
  return metadata.version;
81
168
  });
82
169
  const AddressInUse = Schema.Struct({ code: Schema.Literal("EADDRINUSE") });
83
- /** Translate Effect's low-level bind failure into the CLI's startup vocabulary. */
170
+ /** Maps a bind failure to the CLI's startup error, so an address already in use is reported as such. */
84
171
  export const serverStartError = (port, error) => Schema.is(AddressInUse)(error.cause)
85
172
  ? new PortInUseError({ port })
86
173
  : new ServerStartError({ port, cause: error.cause });
@@ -92,7 +179,7 @@ const browserCommand = (url) => {
92
179
  }
93
180
  return { command: "xdg-open", args: [url] };
94
181
  };
95
- /** Open the setup page after the HTTP server has bound successfully. */
182
+ /** Opens the setup page in a browser; call it only after the HTTP server has bound. */
96
183
  export const openBrowser = Effect.fn("Cli.openBrowser")(function* (url, timeout = BROWSER_OPEN_TIMEOUT) {
97
184
  const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
98
185
  const { command, args } = browserCommand(url);
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAG5E,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAC;AAClC,MAAM,CAAC,MAAM,oBAAoB,GAAG,WAAW,CAAC;AAEhD,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAClC,MAAM,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,CAAC,CACtF,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;AAGnC,MAAM,cAAc,GAAG,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AAE3E,MAAM,CAAC,MAAM,SAAS,GAAG;;;;;;;;;;;+DAWsC,CAAC;AAEhE,MAAM,OAAO,aAAc,SAAQ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AoB;IAE9C,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,mBAAmB,CAAC,mBAAmB,CAAC;IAC/D,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;IAC9C,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,OAAO;SAC5B,QAAQ,CACP,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE;QAC/B,QAAQ,EAAE,KAAK;QACf,cAAc,EAAE,UAAU;QAC1B,KAAK,EAAE,QAAQ;QACf,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE,QAAQ;KACjB,CAAC,CACH;SACA,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;SAC7B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,gBAAgB,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;IAC9E,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC,CAAC,IAAI,gBAAgB,CAAC;YACjC,OAAO;YACP,KAAK,EAAE,IAAI,KAAK,CAAC,GAAG,OAAO,qBAAqB,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;SACpE,CAAC,CAAC;IACL,CAAC;IACD,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,GAAG,EAAE,CAAC,CAAC;AACtC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { Effect, FileSystem, Option, Path, Schema } from "effect";
2
+ /** JSON encoding preserves timestamps, optional values, and typed Attempt outcomes. */
3
+ export declare const RunEvidenceFromJson: Schema.fromJsonString<Schema.toCodecJson<Schema.Struct<{
4
+ readonly snapshot: typeof import("@usine/engine/run-reader").RunSnapshot;
5
+ readonly transcript: Schema.$Array<typeof import("@usine/engine/transcript").TranscriptEntry>;
6
+ readonly version: Schema.Literal<1>;
7
+ readonly exportedAt: Schema.DateTimeUtc;
8
+ }>>>;
9
+ declare const RunExportError_base: Schema.Class<RunExportError, Schema.TaggedStruct<"RunExportError", {
10
+ readonly runId: Schema.brand<Schema.NonEmptyString, "RunId">;
11
+ readonly operation: Schema.Literals<readonly ["read", "encode", "write"]>;
12
+ readonly path: Schema.String;
13
+ readonly reason: Schema.String;
14
+ readonly cause: Schema.Defect;
15
+ }>, import("effect/Cause").YieldableError>;
16
+ /** Reading, encoding, or writing Run evidence failed; no successful export was reported. */
17
+ export declare class RunExportError extends RunExportError_base {
18
+ }
19
+ /** Exports from the current instance without loading GitHub credentials or starting execution. */
20
+ export declare const exportRun: (runId: string & import("effect/Brand").Brand<"RunId">, output: Option.Option<string>) => Effect.Effect<void, RunExportError | import("@usine/engine/engine").RunNotFoundError, FileSystem.FileSystem | Path.Path>;
21
+ export {};
22
+ //# sourceMappingURL=export-run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export-run.d.ts","sourceRoot":"","sources":["../src/export-run.ts"],"names":[],"mappings":"AAIA,OAAO,EAAqB,MAAM,EAAE,UAAU,EAAS,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE5F,uFAAuF;AACvF,eAAO,MAAM,mBAAmB;;;;;IAS/B,CAAC;;;;;;;;AAEF,4FAA4F;AAC5F,qBAAa,cAAe,SAAQ,mBAQlC;CAAG;AAoDL,kGAAkG;AAClG,eAAO,MAAM,SAAS,oNA2CrB,CAAC"}