@stringsync/splates 0.0.53 → 0.0.55

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 (63) hide show
  1. package/README.md +7 -24
  2. package/artifact.d.ts +3 -0
  3. package/budget.d.ts +3 -0
  4. package/creds.d.ts +3 -0
  5. package/flags.d.ts +37 -0
  6. package/handoff.d.ts +13 -0
  7. package/hook.d.ts +3 -0
  8. package/index.d.ts +2 -0
  9. package/index.js +1844 -0
  10. package/lane.d.ts +3 -0
  11. package/notes.d.ts +4 -0
  12. package/package.json +12 -14
  13. package/projects.d.ts +3 -0
  14. package/queue.d.ts +3 -0
  15. package/replica.d.ts +3 -0
  16. package/runners.d.ts +3 -0
  17. package/server.d.ts +6 -0
  18. package/setup.d.ts +22 -0
  19. package/slots.d.ts +3 -0
  20. package/splates.d.ts +10 -0
  21. package/task.d.ts +3 -0
  22. package/tunnel.d.ts +3 -0
  23. package/waiting.d.ts +3 -0
  24. package/worker.d.ts +3 -0
  25. package/artifact.ts +0 -120
  26. package/budget.ts +0 -117
  27. package/checkout.ts +0 -8
  28. package/creds.test.ts +0 -336
  29. package/creds.ts +0 -144
  30. package/dev/dev.ts +0 -86
  31. package/dev/eval.ts +0 -21
  32. package/dev/fix.ts +0 -63
  33. package/dev/index.ts +0 -1
  34. package/dev/prove.ts +0 -38
  35. package/dev/root.ts +0 -7
  36. package/dev/ship.ts +0 -46
  37. package/dev/test.ts +0 -154
  38. package/e2e.test.ts +0 -472
  39. package/flags.ts +0 -157
  40. package/hook.ts +0 -328
  41. package/index.ts +0 -18
  42. package/infra.ts +0 -107
  43. package/lane.test.ts +0 -29
  44. package/lane.ts +0 -172
  45. package/notes.ts +0 -19
  46. package/projects.test.ts +0 -191
  47. package/projects.ts +0 -37
  48. package/queue.ts +0 -82
  49. package/screenshots/annotate.png +0 -0
  50. package/screenshots/demo.png +0 -0
  51. package/screenshots/parallel.png +0 -0
  52. package/screenshots/questions.png +0 -0
  53. package/server.ts +0 -287
  54. package/setup.ts +0 -233
  55. package/slots.ts +0 -65
  56. package/splates.test.ts +0 -338
  57. package/splates.ts +0 -567
  58. package/task.ts +0 -354
  59. package/tunnel.ts +0 -106
  60. package/wait-journal.test.ts +0 -96
  61. package/waiting.ts +0 -59
  62. package/worker-relay.test.ts +0 -233
  63. package/worker.ts +0 -300
package/README.md CHANGED
@@ -62,7 +62,7 @@ Keep sensitive information out of them.
62
62
  **Heavy jobs.** Hooks (`postCheckout`, `postRewrite`, `preMerge`) run in one
63
63
  of the machine's heavy-job slots, two by default (`SPLATES_HEAVY_JOBS` sets
64
64
  how many), so several agents testing at once queue rather than run the
65
- machine out of memory. `splates heavy -- <command>` runs anything else as
65
+ machine out of memory. `splates run -- <command>` runs anything else as
66
66
  heavy, such as a test suite an agent runs mid-task, in a slot too.
67
67
 
68
68
  **Pushing.** With `remote: "origin"` in `splates.config.ts`, each task's
@@ -253,26 +253,9 @@ serving on this machine.
253
253
 
254
254
  ### Worker providers
255
255
 
256
- To have splates make workers when agents queue for want of a slot, name the
257
- cloud account to make them in as `splates.config.ts`'s `cloud`, in the repo
258
- `splates server` starts in:
259
-
260
- ```ts
261
- import { AwsCloud } from "@stringsync/splates-server/cloud";
262
- import type { ConfigFile } from "@stringsync/splates-server/config";
263
-
264
- export default { cloud: new AwsCloud() } satisfies ConfigFile;
265
- ```
266
-
267
- `AwsCloud` comes with splates, signed with the AWS CLI's sign-in or the
268
- instance role. Another is a class that implements
269
- `CloudProvider` from `@stringsync/splates-server/cloud`: making, listing and
270
- deleting tagged machines, snapshots, SSH keys and firewalls through the
271
- cloud's API, with its machine types and prices. splates makes both the
272
- workers and the coordinator's box (`splates server deploy`) over it.
273
-
274
- For machines that are not a cloud's, give it a `workerProvider` instead, any
275
- object that implements `WorkerProvider`:
256
+ To have splates make workers when agents queue for want of a slot, give
257
+ `splates.config.ts` a `workerProvider`, in the repo `splates server` starts in,
258
+ any object that implements `WorkerProvider`:
276
259
 
277
260
  ```ts
278
261
  import type { ConfigFile } from "@stringsync/splates-server/config";
@@ -306,9 +289,9 @@ rate cap, and `splates worker remove` destroys its machine.
306
289
 
307
290
  The worker budget is in dollars, at each type's list price, so every figure is
308
291
  an estimate: a rate cap on what the made workers running at once cost an hour
309
- ($0.25/h by default), and limits on what they cost in a day ($5) and a month
310
- ($75), from the start of each in local time. Past the rate cap no worker is
311
- made, and the queue says which limit holds it, as `rate cap $0.25/h reached`.
292
+ ($1/h by default), and limits on what they cost in a day ($15) and a month
293
+ ($200), from the start of each in local time. Past the rate cap no worker is
294
+ made, and the queue says which limit holds it, as `rate cap $1.00/h reached`.
312
295
  Once a day's or month's limit is spent, made workers take nothing new, their
313
296
  agents are asked to stop at a checkpoint, and each is destroyed once its last
314
297
  agent ends. Each limit warns at 80%, 90% and 100%, once in its window, by Web
package/artifact.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import type { SplatesDeps } from "@stringsync/splates-server/server";
2
+ /** `splates artifact`, which the root cli mounts after `splates attach`. */
3
+ export declare const splatesArtifact: import("webappwiz/cmd").Cli<SplatesDeps, SplatesDeps>;
package/budget.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import type { SplatesDeps } from "@stringsync/splates-server/server";
2
+ /** `splates budget`, which the root cli mounts beside `splates worker`. */
3
+ export declare const splatesBudget: import("webappwiz/cmd").Cli<SplatesDeps, SplatesDeps>;
package/creds.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import type { SplatesDeps } from "@stringsync/splates-server/server";
2
+ /** `splates creds`, which the root cli mounts after `splates lane`. */
3
+ export declare const splatesCreds: import("webappwiz/cmd").Cli<SplatesDeps, SplatesDeps>;
package/flags.d.ts ADDED
@@ -0,0 +1,37 @@
1
+ import { type AgentPick, Offered, type RosterAgent } from "@stringsync/splates-server/models";
2
+ import type { Repository } from "@stringsync/splates-server/records";
3
+ import type { SplatesDeps } from "@stringsync/splates-server/server";
4
+ import { SavedTunnel } from "@stringsync/splates-server/tunnel";
5
+ import { z } from "zod";
6
+ /** A place in the queue, 1 at the top; absent leaves it to the command. */
7
+ export declare const position: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
8
+ /**
9
+ * The agent `--agent`, `--model` and `--effort` name off the roster:
10
+ * undefined when none is given, null for `--agent none`.
11
+ */
12
+ export declare function assigneeIn(deps: SplatesDeps, agent: string, model: string, effort: string): Promise<AgentPick | null | undefined>;
13
+ /**
14
+ * `agent` on `model` off `agents`, at the thinking level `effort` names
15
+ * among those it offers, each left out when empty.
16
+ */
17
+ export declare function pickIn(deps: SplatesDeps, agents: RosterAgent[], agent: string, model: string, effort: string, data?: Record<string, unknown>): Promise<AgentPick>;
18
+ /**
19
+ * `{ effort }` for the thinking level `effort` names among those `agent`
20
+ * offered when last started, or nothing when it is empty.
21
+ */
22
+ export declare function effortIn(deps: SplatesDeps, agent: string, effort: string, data?: Record<string, unknown>): Promise<{
23
+ effort?: string;
24
+ }>;
25
+ /** The settings each agent offered when last started, from any project. */
26
+ export declare function offeredOf({ ps, fs }: SplatesDeps): Offered;
27
+ /** The tunnel each slot's home may have saved, for every word of the pool. */
28
+ export declare function slotTunnelsOf({ ps, fs, secrets, }: SplatesDeps): SavedTunnel[];
29
+ /** `--lane 3`, `new` or `none` as a lane; absent leaves it to the command. */
30
+ export declare function laneIn(raw: string): number | "new" | null | undefined;
31
+ /** `--task 3,5` as task numbers, refusing anything that is not one. */
32
+ export declare function taskIds(raw: string): number[];
33
+ /**
34
+ * Which task a command that takes no task name is about, so the journal can
35
+ * name it. `merge` reads it off the current branch.
36
+ */
37
+ export declare function here({ service, git, ps, project, }: SplatesDeps & Repository): Promise<string | null>;
package/handoff.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ /** Set by `checkout.ts` once `splates dev` is mounted on this process. */
2
+ export declare const devMounted: {
3
+ value: boolean;
4
+ };
5
+ /** The nearest directory at or above `cwd` that is a splates checkout. */
6
+ export declare function checkoutAbove(cwd: string): string | null;
7
+ /**
8
+ * The release has no `splates dev`, and would print help and exit 0, which
9
+ * reads as a passing `splates dev test`. Standing in a checkout, run the
10
+ * checkout's own `bin/splates` instead; anywhere else, fail saying so.
11
+ * Returns the exit code, or null when `argv` is no `dev` command.
12
+ */
13
+ export declare function handOffDev(argv: string[], cwd: string): Promise<number | null>;
package/hook.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import type { SplatesDeps } from "@stringsync/splates-server/server";
2
+ /** `splates hook`, which the root cli mounts beside `splates queue`. */
3
+ export declare const splatesHook: import("webappwiz/cmd").Cli<SplatesDeps, SplatesDeps>;
package/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env bun
2
+ export {};