yichus 0.2.0 → 0.3.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 (36) hide show
  1. package/README.md +45 -16
  2. package/dist/cli.js +17 -2123
  3. package/dist/cli.js.map +1 -1
  4. package/dist/main.js +3762 -0
  5. package/dist/main.js.map +1 -0
  6. package/dist/studio-page/dom.js +22 -0
  7. package/dist/studio-page/label-fit.js +7 -0
  8. package/dist/studio-page/layer-diagram.js +458 -0
  9. package/dist/studio-page/layer-groups.js +129 -0
  10. package/dist/studio-page/source-link.js +17 -0
  11. package/dist/studio-page/studio-views.js +256 -0
  12. package/dist/studio-page/system-map-record.js +124 -10
  13. package/dist/studio-page/system-map.js +476 -87
  14. package/dist/studio-page/what-happens-record.js +224 -0
  15. package/dist/studio-page/what-happens.js +771 -0
  16. package/dist/studio-reference/balance-listed-laws.bosatsu +29 -0
  17. package/dist/studio-reference/balance.bosatsu +7 -0
  18. package/dist/studio-reference/calculator.md +20 -0
  19. package/dist/studio-reference/consent-laws.bosatsu +37 -0
  20. package/dist/studio-reference/consent.bosatsu +15 -0
  21. package/dist/studio-reference/deploy-platforms.md +79 -0
  22. package/dist/studio-reference/laws.md +62 -0
  23. package/dist/studio-reference/portable-programs.md +58 -0
  24. package/dist/studio-reference/porting.md +34 -0
  25. package/dist/studio-reference/protocol-cases.md +11 -0
  26. package/dist/studio-reference/{protocol-specification.txt → protocol-specification.md} +16 -18
  27. package/dist/studio-reference/refund-desk-one-round.bosatsu +196 -0
  28. package/dist/studio-reference/refund-desk.bosatsu +194 -0
  29. package/dist/studio-reference/refund-policy.bosatsu +97 -0
  30. package/dist/studio-reference/refund-test.bosatsu +75 -0
  31. package/dist/studio-reference/render.yaml +42 -0
  32. package/dist/studio-reference/server.mjs +33 -0
  33. package/dist/studio-reference/store.mjs +16 -0
  34. package/dist/studio-reference/the-page.md +130 -0
  35. package/dist/studio-reference/worker-authority.md +159 -0
  36. package/package.json +2 -2
package/README.md CHANGED
@@ -5,11 +5,8 @@ API workbench from a terminal or CI. The package uses the Scala.js engine
5
5
  shipped in `@yichus/api-mcp`; installing the release requires Node 20+,
6
6
  without Java, sbt, Nix, or a browser.
7
7
 
8
- This npm release is being prepared. Until it is published, use the
9
- [checkout build instructions](https://github.com/snoble/yichus/blob/main/docs/npm-packages.md). After publication:
10
-
11
8
  ```sh
12
- npm install --save-dev yichus@0.2.0
9
+ npm install --save-dev yichus@0.3.1
13
10
  npx yichus tools
14
11
  npx yichus call api_guide
15
12
  ```
@@ -32,7 +29,7 @@ and the studio tells the agent what to do next after every change:
32
29
  ```json
33
30
  {
34
31
  "mcpServers": {
35
- "yichus": { "command": "npx", "args": ["-y", "yichus@0.2.0", "studio"] }
32
+ "yichus": { "command": "npx", "args": ["-y", "yichus@0.3.1", "studio"] }
36
33
  }
37
34
  }
38
35
  ```
@@ -42,17 +39,41 @@ file there itself, so the agent never pastes code into a call.
42
39
 
43
40
  - `yichus_start` records what the person wants built and returns a link to
44
41
  the studio page on `127.0.0.1`.
45
- - `yichus_next` checks the program and returns one step: fix a compile
46
- error, name the parts of the program in the person's words, ask the
47
- person some questions, add a declaration, fix a broken property, write a
48
- failure scenario, or done.
42
+ - `yichus_next` checks the program and returns one step: ask where the
43
+ app will run, write it, fix a compile error, name the parts of the
44
+ program in the person's words, ask the person some questions, describe
45
+ what happens in each action, add a declaration, fix a broken property
46
+ or a failing expectation, write a failure scenario, or done.
49
47
  - `yichus_name` gives the parts of the program `yichus_next` lists (kinds
50
48
  of record, actions, sections and pieces of the program) the plain names
51
49
  the person sees instead of the code names, in questions and in the
52
50
  picture of the program. One call names them all.
53
51
  - `yichus_answer` records the person's answer in their own words.
54
- - `yichus_reference` hands over material a step names, such as the
55
- protocol case specification.
52
+ - `yichus_scenario` records, for each action, the person's words for the
53
+ ways it can go and what they expect at the end (`reads`, `writes`,
54
+ `refused`, `returns`, `reaches model` or `net`, each optionally `not`).
55
+ The engine checks each expectation against the action's decision tree.
56
+ `drop` removes the scenario of an action the app no longer has.
57
+ - `yichus_point` lets the agent point at what it means while it talks:
58
+ each mark names a section, a described action or a step in one, with a short
59
+ note. The page shows the notes as bubbles over the pictures, marked as
60
+ the agent's and not checked. A call replaces the last marks; an empty
61
+ list clears them (`yichus point FILE.json` from a terminal).
62
+ - `yichus_page` shows the agent the page as the person sees it, in words:
63
+ the questions, each property and its status, what happens in each
64
+ action, the sections, its own notes, and the id `yichus_point` takes for
65
+ each part. It also says what the person has on screen, the folds they
66
+ opened and what they last clicked, so when the person says "this one"
67
+ the agent knows which (`yichus page` from a terminal). The page sends
68
+ ids only, kept in `.yichus/viewing.json`, which is not committed.
69
+ - `yichus_reference` hands over material a step names: the protocol case
70
+ specification (`protocol-case`), how to write work that takes several
71
+ steps as a pure step program (`portable-programs`), and what to build
72
+ for each place the app can run (`deploy`: Render, Vercel, Netlify, AWS,
73
+ Google Cloud, Azure), how to guide the person through the steps, the
74
+ questions, the statuses and the pictures (`guiding`), and how to replace
75
+ an app the person already has (`porting`: the agent reads the old app;
76
+ the studio checks only the new one).
56
77
  - Every `api_*` tool is offered too. Leave out `sources` and the studio
57
78
  supplies the project's files; `instances` follows the person's answer
58
79
  about servers.
@@ -62,17 +83,24 @@ names: one server or several, who may see and change each table's
62
83
  records, what happens when two requests change the same record, whether
63
84
  an action that writes twice may stop halfway, and what happens when an
64
85
  outside service fails. Answers are kept in `.yichus/requirements.json`;
65
- commit it, so a new agent session starts from the same decisions.
86
+ commit it, so a new agent session starts from the same decisions. The
87
+ marks the agent points with are kept in `.yichus/marks.json`, which is
88
+ not committed.
66
89
 
67
90
  The page shows what the person asked for, the questions waiting for
68
91
  them (they can answer there too), each property they chose with its
69
- status, and the system map of their own program, drawn with the names
70
- the agent gave its parts (a part without a name keeps its code name).
92
+ status, what happens in each action and the sections of the app in the
93
+ person's words only (a part without a name says so), and the system map
94
+ of their own program, drawn with the names the agent gave its parts (a
95
+ part without a name keeps its code name).
71
96
  Evidence, code names and file names stay with the agent. The page keeps its address
72
97
  (`http://127.0.0.1:4317/` unless that port is taken) when the agent
73
98
  restarts the studio.
74
- Its links open [the studio guide](https://yich.us/start/studio.html) in
75
- another tab, written for the person rather than the agent.
99
+ The page carries no documentation: it tells the person to ask their agent
100
+ what anything means, and `yichus_reference` topic `guiding` gives the agent
101
+ everything to explain, a piece at a time as it becomes relevant.
102
+ [yich.us/start/studio.html](https://yich.us/start/studio.html) is only the
103
+ entry page that says what the studio is and how to connect it.
76
104
 
77
105
  An agent without MCP can use the same director from a terminal:
78
106
 
@@ -81,6 +109,7 @@ npx yichus start "a shared shopping list for my family"
81
109
  npx yichus next
82
110
  npx yichus name lists "shopping lists" /lists/add "adding to a list"
83
111
  npx yichus answer access:lists shared --words "only our family"
112
+ npx yichus page # what the page shows the person
84
113
  npx yichus studio --page # the page on its own
85
114
  ```
86
115