@awebai/oats 0.68.1 → 0.69.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 (67) hide show
  1. package/bin/oats.mjs +102 -22
  2. package/docs/capabilities.md +49 -5
  3. package/docs/configuration.md +68 -2
  4. package/docs/desktop-cli-api.md +355 -12
  5. package/docs/desktop-instance-start.md +88 -3
  6. package/docs/desktop.md +108 -10
  7. package/docs/execution-targets.md +514 -62
  8. package/docs/harness-trust.md +3 -1
  9. package/docs/implementation.md +28 -11
  10. package/docs/integrations.md +1 -1
  11. package/docs/oats-local.schema.json +2 -2
  12. package/docs/official-catalog.md +4 -3
  13. package/docs/packages.md +7 -7
  14. package/docs/release-notes/v0.69.0.md +658 -0
  15. package/docs/release-notes/v0.69.1.md +25 -0
  16. package/docs/servers.md +44 -5
  17. package/docs/souls-and-instances.md +11 -7
  18. package/docs/tui.md +77 -12
  19. package/docs/upgrading.md +12 -7
  20. package/docs/workspaces.md +1 -1
  21. package/lib/core.mjs +345 -89
  22. package/lib/file-pieces.mjs +49 -0
  23. package/lib/instance-events.mjs +25 -4
  24. package/lib/launch-prompt-fixtures/README.md +62 -0
  25. package/lib/launch-prompt-fixtures/resume-confirmation.json +32 -0
  26. package/lib/launch-prompt-fixtures.mjs +49 -0
  27. package/lib/launch-prompt-resume.mjs +55 -0
  28. package/lib/login-environment.mjs +27 -9
  29. package/lib/schedule.mjs +3 -3
  30. package/lib/servers.mjs +117 -23
  31. package/lib/session-end.mjs +82 -0
  32. package/lib/session-input.mjs +43 -9
  33. package/lib/session-resume-contract.mjs +32 -0
  34. package/lib/session-resume.mjs +310 -0
  35. package/lib/session-seen.mjs +163 -0
  36. package/lib/session-viewer.mjs +147 -44
  37. package/lib/soul-composition.mjs +2 -1
  38. package/lib/start-env.mjs +110 -0
  39. package/lib/tmux-server-scope.mjs +139 -14
  40. package/lib/workspace.mjs +38 -4
  41. package/package-catalog.json +10 -4
  42. package/package.json +1 -1
  43. package/packages/client/cli-adapter.mjs +9 -0
  44. package/packages/client/cli-locator.mjs +3 -2
  45. package/packages/client/deployment-data.mjs +7 -0
  46. package/packages/client/deployment-panel.mjs +3 -0
  47. package/packages/client/file-output-exec.mjs +98 -0
  48. package/packages/client/launch-prompt-outcome.mjs +25 -13
  49. package/packages/client/own-codes.mjs +2 -0
  50. package/packages/client/session-attach.mjs +35 -5
  51. package/packages/client/session-resume-cli.mjs +64 -0
  52. package/packages/client/session-resume-trigger.mjs +167 -0
  53. package/packages/client/session-resume.mjs +332 -0
  54. package/packages/client/tmux-status.mjs +30 -7
  55. package/packages/client/waiting-on-you.mjs +11 -4
  56. package/packages/client/workspace-step.mjs +17 -5
  57. package/packages/record/lib/last-conversation.mjs +123 -0
  58. package/packages/record/lib/session-roots.mjs +10 -1
  59. package/packages/tui/lib/client.mjs +1 -1
  60. package/packages/tui/lib/main.mjs +5 -3
  61. package/packages/tui/lib/model.mjs +45 -12
  62. package/packages/tui/lib/store.mjs +8 -7
  63. package/packages/tui/lib/term/text.mjs +12 -9
  64. package/packages/tui/lib/views/frame.mjs +72 -7
  65. package/packages/tui/lib/views/help.mjs +8 -3
  66. package/packages/tui/lib/views/instances.mjs +3 -2
  67. package/skills/oats-getting-started/SKILL.md +117 -4
@@ -24,6 +24,17 @@ repositories belong to an organisation and which packages it trusts. A
24
24
  work, in its own home and terminal. Each workspace has a setup expert soul,
25
25
  `<workspace>-oats-setup-expert`, which holds the `oats.setup` capability.
26
26
 
27
+ **A machine found-list.** Your prompt may hand you a found-list, a JSON file
28
+ whose `machine.platform` is set (oats-omarchy's installer writes one). Then
29
+ the workspace you make is this machine's own workspace. Its setup soul is
30
+ the machine's steward, `oats.machine/steward`, in place of a setup expert
31
+ soul of its own, and the steward gets a global aweb address. Steps 1, 5, 6
32
+ and 7 say what changes. When the found-list lists a deployment whose
33
+ `steward` is `true`, this machine already has its workspace and steward:
34
+ tell the person so, and stop. Wherever a later step says to ask the
35
+ person, on a machine found-list you tell them what happened, as it is, and
36
+ stop instead: the person answers nothing after step 1.
37
+
27
38
  **How to work.**
28
39
  - **Ask first, then run.** Ask everything in one round (step 1), then run the
29
40
  steps yourself and read back what each did.
@@ -68,6 +79,8 @@ work, in its own home and terminal. Each workspace has a setup expert soul,
68
79
 
69
80
  ## 1. Ask, in one round
70
81
 
82
+ On a machine found-list, ask the machine's round below instead of this list.
83
+
71
84
  - **The use case:** what they want agents to do.
72
85
  - **Their repositories and project:** which repositories agents should work
73
86
  in, where they are cloned on this machine, and which are private.
@@ -103,6 +116,32 @@ work, in its own home and terminal. Each workspace has a setup expert soul,
103
116
  - **OATS Desktop:** installed and started unless they decline. **The TUI**
104
117
  (`oats tui`, a terminal client, preview): opened for them or not.
105
118
 
119
+ **The machine's round.** Read the found-list, then ask only these choices,
120
+ together, each with its default and one line on what it is. Enter, or
121
+ "yes", accepts every default. Nothing is asked after this round, and never
122
+ a key. The use case, repositories and knowledge tools are not asked: the
123
+ steward takes them up with the person later.
124
+ - **The workspace:** a new one, the machine's own. Its name defaults to the
125
+ hostname, lowercased, with every character outside `[a-z0-9-]` turned
126
+ into `-` (`Ada's-Laptop` gives `ada-s-laptop`). Its repository defaults to
127
+ `<github.login>/<workspace>-oats`, private. Or an existing workspace's
128
+ reference.
129
+ - **The namespace `N`:** the part of every agent's address before the `/`,
130
+ which other people's agents use to reach this machine's agents. Default:
131
+ the hostname, normalised as above, so the namespace is the machine's own. Messaging is
132
+ on, and the root's name `A` is `<workspace>-root`.
133
+ - **The steward's name:** lowercase letters and digits, words joined by
134
+ single `-`. Default: `steward`. It gives `R`, the steward's instance name
135
+ here and the name in its address, `N.aweb.ai/R`. `R` is the chosen name,
136
+ or `<hostname>-<chosen name>` (the hostname normalised as above) when the
137
+ person says `N` is a namespace another machine already uses, so that this
138
+ machine never adopts the other machine's resident.
139
+ - **The deployment directory `D`:** default `<home>/Agents/<workspace>`,
140
+ with the home folder spelled out.
141
+ - **OATS Desktop:** installed and started by default; the TUI not opened.
142
+ - **The harness:** the found-list's `harness`. Ask only when it names none,
143
+ with the one you are as the default.
144
+
106
145
  ## 2. Check, and install what is missing
107
146
 
108
147
  ```bash
@@ -311,8 +350,9 @@ name: acme
311
350
  members:
312
351
  - git:github.com/acme/acme-oats # the host is a member too
313
352
  packages:
314
- oats.framework: v1.14.1 # the installed CLI's catalog versions (below)
315
- oats.aweb: v1.31.0 # messaging, and tasks: agent identities, mail, chat and tasks
353
+ oats.framework: v1.15.1 # the installed CLI's catalog versions (below)
354
+ oats.aweb: v1.32.0 # messaging, and tasks: agent identities, mail, chat and tasks
355
+ oats.machine: v0.1.1 # on a machine found-list only: the machine's steward
316
356
  defaults:
317
357
  capabilities:
318
358
  oats.core: { from: package }
@@ -325,11 +365,15 @@ defaultTeam: acme # every soul starts in this team
325
365
 
326
366
  - **The versions** are the installed CLI's catalog's:
327
367
  `"$(oats root)/package-catalog.json"`, `packages."oats.framework".ref`
328
- (for example `oats-framework/v1.14.1`: write the part after the `/`) and
368
+ (for example `oats-framework/v1.15.1`: write the part after the `/`) and
329
369
  `packages."oats.aweb".ref`, but never below `v1.31.0`: that release
330
370
  carries `oats.aweb-tasks`, and a bare version resolves through the
331
371
  catalog's tag convention even when the installed catalog names an older
332
372
  one.
373
+ - **On a machine found-list only,** keep the `oats.machine` line, at the
374
+ catalog's `packages."oats.machine".ref`, and write none of the
375
+ `souls/<workspace>-oats-setup-expert` files below: the steward is the
376
+ workspace's setup soul. Elsewhere, leave the line out.
333
377
  - **The team** is `default:N.aweb.ai`, with `N` the username from step 1;
334
378
  its label (here `acme`) is the workspace name.
335
379
  - **Tasks** use aweb, the same identities as messaging: agents assign,
@@ -454,6 +498,9 @@ oats onboard D --workspace W
454
498
  - **Before 0.61.0,** read `oats souls --dir D --json`: the soul named
455
499
  `<workspace>-oats-setup-expert`, else one whose definition declares
456
500
  `oats.setup`.
501
+ - **On a machine found-list,** `S` is `oats.machine/steward`. An existing
502
+ workspace that doesn't offer it: stop, and say that its owner adds
503
+ `oats.machine` to its `packages:`.
457
504
  - **An existing workspace with no such soul:** stop. Show the person the soul
458
505
  files from step 5 and say that the workspace's owner adds them by pull
459
506
  request to its host repository. Once that is merged, run
@@ -464,6 +511,15 @@ at `D/<repo name>`. A new workspace already has it (step 5). For an existing
464
511
  one, clone the repository that holds `S` with the `git clone` line
465
512
  `oats onboard` printed for it, if that line says it is missing.
466
513
 
514
+ **On a machine found-list, record the steward's harness** on this machine
515
+ first. Its soul names none, and without this every later check (readiness,
516
+ harness trust) and the spawn would use the default, pi:
517
+
518
+ ```bash
519
+ oats soul launch set S --harness <harness> --dir D --plan
520
+ oats soul launch set S --harness <harness> --dir D
521
+ ```
522
+
467
523
  ## 7. Hand over to the setup expert
468
524
 
469
525
  **Messaging on this machine first, when the setup expert takes it.** Read
@@ -497,6 +553,8 @@ can't spawn on this machine until it has messaging too. Set it up now:
497
553
  `D/<repo>` change the team id in `oats-workspace.yaml` to
498
554
  `default:N.aweb.ai`, commit and push it, run `oats sync --dir D`, and run
499
555
  both lines again. Then skip items 3 and 4 and go to the check (item 5).
556
+ On a machine found-list, ask nothing: tell the person that the run
557
+ failed, most likely because `N` is taken, and stop.
500
558
  3. **Existing workspace: the person gets an invite token** from a member of `L`, who runs
501
559
  `oats aweb invite --soul <their soul> --label L --json` in their own
502
560
  deployment and passes the token to the person privately, never by
@@ -521,6 +579,48 @@ can't spawn on this machine until it has messaging too. Set it up now:
521
579
  The setup expert does the rest of this machine's messaging
522
580
  (`/oats-host-delivery`).
523
581
 
582
+ **The steward's global address (machine found-list only).** The steward
583
+ gets a global, contacts-only aweb address, `<namespace>/R`, made by the
584
+ team root you just signed up, with no API key and nothing for the person to
585
+ type. `R` is the steward's name from step 1, for the resident and the
586
+ instance alike.
587
+
588
+ Without messaging there is no address to make: skip this. Otherwise it
589
+ needs every one of these, and when one fails, take the fallback below:
590
+ - a new workspace: a root that joined by invite (items 3 and 4) does not own
591
+ the namespace, so aweb would refuse the create;
592
+ - `oats.aweb` 1.33.0 or later: the `oats.aweb` row of the
593
+ `oats inspect` you read above, `result.capabilities[].version`;
594
+ - aw 1.36.48 or later: `aw.version` in the check (item 5).
595
+
596
+ Plan, then create, both from `D` and with no `AWEB_API_KEY`:
597
+
598
+ ```bash
599
+ cd "D" && env -u AWEB_API_KEY oats aweb resident create R --team-label L --plan --json
600
+ cd "D" && env -u AWEB_API_KEY oats aweb resident create R --team-label L --json
601
+ ```
602
+
603
+ - **The plan** changes nothing. Run the create only when the plan's `ok` is
604
+ true and either `result.init.route` is `root` (a new resident) or
605
+ `result.init` is `null` (`R` already holds it; the create adopts it and
606
+ never makes a second one). Anything else, a refusal included (no team
607
+ root, say), is the fallback.
608
+ - **`--team-label L`** puts the resident in the team that is already the
609
+ default, so the run maps nothing new and prints the spawn line as its one
610
+ step (`result.steps`). If it prints another step first, stop and tell the
611
+ person what it says: that step is theirs.
612
+ - **Success** prints `PASS resident <address> …`, and `result.address` is
613
+ the steward's address. Spawn with the grant-seat options below.
614
+ - **A failure** is reported to the person as it is, and you spawn nothing.
615
+ If the create was interrupted (killed, or timed out with no answer), run
616
+ the same line again, unchanged, and nothing else. Never empty
617
+ `D/.aweb-residents/R`: the identity may already exist.
618
+ - **The fallback:** spawn the steward without the grant-seat options. It gets
619
+ a local team identity, as every instance does. Tell the person in one line,
620
+ without asking anything: the steward has a local team identity and no
621
+ global address because of <the reason>, and the GLOBAL residents and grant
622
+ seats section of `/oats-aweb` moves it to one later. Never ask for a key.
623
+
524
624
  **Write the hand-over** to `D/.oats-handover.md`. It holds no secret.
525
625
 
526
626
  ```markdown
@@ -528,6 +628,8 @@ The setup expert does the rest of this machine's messaging
528
628
 
529
629
  - Workspace: <workspace> (W), new | existing; deployment directory: D
530
630
  - Setup expert: S, harness <harness>
631
+ - Machine found-list only: steward R, address N.aweb.ai/R | local team
632
+ identity (<the fallback's reason>)
531
633
 
532
634
  ## The person's answers
533
635
  <step 1's answers, in their words: use case, repositories and where they
@@ -567,6 +669,16 @@ oats spawn S --dir D --task-file D/.oats-handover.md --preview
567
669
  oats spawn S --dir D --task-file D/.oats-handover.md
568
670
  ```
569
671
 
672
+ **On a machine found-list,** name the steward `R` (its harness was recorded
673
+ in step 6). With its global address:
674
+
675
+ ```bash
676
+ oats spawn S --dir D --task-file D/.oats-handover.md --name R --provider oats.aweb identity.mode=global --provider oats.aweb identity.resident=R --preview
677
+ oats spawn S --dir D --task-file D/.oats-handover.md --name R --provider oats.aweb identity.mode=global --provider oats.aweb identity.resident=R
678
+ ```
679
+
680
+ In the fallback, or without messaging, leave out both `--provider` options.
681
+
570
682
  - **The preview** shows what the spawn would create. If it reports a
571
683
  problem, stop and tell the person what it says.
572
684
  - **The spawn** prints the instance's home `H`. Then delete the hand-over
@@ -600,7 +712,8 @@ oats spawn S --dir D --task-file D/.oats-handover.md
600
712
  their own terminal, as "How to work" says, with the command
601
713
  `oats tui --dir "D"`.
602
714
 
603
- **Tell the person where the setup expert is**, and that it continues from
715
+ **Tell the person where the setup expert is** (on a machine found-list, the
716
+ steward, and its address), and that it continues from
604
717
  here: in the Desktop or the TUI you started. Without either, they reach it
605
718
  with `oats session attach --home H` in a terminal.
606
719