@lapxo/head 0.1.7 → 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 (70) hide show
  1. package/README.md +39 -14
  2. package/TARGET.bound +237 -31
  3. package/dist/src/adopt/adopt.d.ts +2 -2
  4. package/dist/src/adopt/adopt.js +20 -6
  5. package/dist/src/ahead/read.d.ts +2 -2
  6. package/dist/src/ahead/read.js +2 -4
  7. package/dist/src/answers/answered.js +1 -1
  8. package/dist/src/compile/pin.d.ts +1 -1
  9. package/dist/src/compile/pin.js +5 -3
  10. package/dist/src/core/answer.d.ts +12 -0
  11. package/dist/src/core/answer.js +1 -1
  12. package/dist/src/core/association.d.ts +16 -0
  13. package/dist/src/core/association.js +34 -0
  14. package/dist/src/core/composition.d.ts +32 -0
  15. package/dist/src/core/composition.js +28 -0
  16. package/dist/src/core/package.d.ts +1 -0
  17. package/dist/src/core/package.js +17 -4
  18. package/dist/src/core/read.d.ts +2 -1
  19. package/dist/src/core/read.js +2 -1
  20. package/dist/src/core/receiver.d.ts +11 -0
  21. package/dist/src/core/receiver.js +122 -0
  22. package/dist/src/core/share-bundle.d.ts +9 -0
  23. package/dist/src/core/share-bundle.js +56 -0
  24. package/dist/src/doors/head.d.ts +1 -0
  25. package/dist/src/doors/head.js +11 -3
  26. package/dist/src/flows/answer.js +7 -3
  27. package/dist/src/flows/call.d.ts +1 -1
  28. package/dist/src/flows/call.js +28 -4
  29. package/dist/src/flows/device.d.ts +14 -5
  30. package/dist/src/flows/device.js +15 -7
  31. package/dist/src/flows/plan.d.ts +2 -0
  32. package/dist/src/flows/plan.js +16 -2
  33. package/dist/src/index.js +3 -31
  34. package/dist/src/links/birth.d.ts +6 -0
  35. package/dist/src/links/birth.js +48 -0
  36. package/dist/src/links/inspect.d.ts +1 -1
  37. package/dist/src/links/inspect.js +23 -12
  38. package/dist/src/links/link.d.ts +2 -2
  39. package/dist/src/links/link.js +7 -10
  40. package/dist/src/onboard/first.js +1 -1
  41. package/dist/src/onboard/owed.js +1 -1
  42. package/dist/src/places/admit.js +1 -1
  43. package/dist/src/places/found.js +3 -1
  44. package/dist/src/ports/adapters/bundle.d.ts +44 -0
  45. package/dist/src/ports/adapters/bundle.js +173 -0
  46. package/dist/src/ports/adapters/configured.d.ts +35 -0
  47. package/dist/src/ports/adapters/configured.js +67 -0
  48. package/dist/src/ports/adapters/mcp.d.ts +59 -0
  49. package/dist/src/ports/adapters/mcp.js +122 -0
  50. package/dist/src/ports/adapters/network.d.ts +12 -0
  51. package/dist/src/ports/adapters/network.js +67 -0
  52. package/dist/src/ports/adapters/protocol.d.ts +6 -0
  53. package/dist/src/ports/adapters/protocol.js +51 -0
  54. package/dist/src/ports/adapters/remote.d.ts +13 -0
  55. package/dist/src/ports/adapters/remote.js +33 -0
  56. package/dist/src/ports/bound.d.ts +0 -1
  57. package/dist/src/ports/bound.js +14 -15
  58. package/dist/src/ports/host.d.ts +18 -0
  59. package/dist/src/ports/host.js +58 -9
  60. package/dist/src/sources/connect.d.ts +1 -0
  61. package/dist/src/sources/connect.js +15 -11
  62. package/dist/src/tools/card.js +3 -2
  63. package/dist/src/use/named.js +3 -3
  64. package/dist/src/verbs/ask.js +7 -1
  65. package/dist/src/verbs/card.js +2 -2
  66. package/dist/src/verbs/do.js +2 -1
  67. package/package.json +6 -5
  68. package/runtime.bundle.json +24026 -0
  69. package/dist/src/ports/reading.d.ts +0 -8
  70. package/dist/src/ports/reading.js +0 -14
package/README.md CHANGED
@@ -1,26 +1,51 @@
1
1
  # head
2
2
 
3
- An API already says what it offers, where it is reached and how access to it is proven. head reads that document once, compiles it into lines its place pins by digest, and from then on answers by those lines: which operation reads, what it asks, what it answered. It names no kind of source and no client: what it reads is said by the worlds it adopts, and what it asks through is what the client declares. [Connect any API](https://github.com/Lapxo/head/blob/main/docs/connect-any-api.md) shows each level of access.
3
+ Ask your APIs through an assistant. Keep who answered, what was read, and what you allowed.
4
4
 
5
- A person does four things, in the client they talk to. **Connect** an API: hand head its document, and an overlay beside it when it says too little; it is compiled once and pinned, and the first connect with no place founds `~/place` on the same yes, its root key kept in the keychain. **Ask**: name what you want by its name or in your own words; head finds it in its own registry of the source, never listing the rest to the model, obtains access the first time as the document declares it, calls only what reads, types the answer and lands a receipt. An answer of nothing is what the source holds today, said with its hour; no byte at all is no answer, and the read stays owed until one brings them. **Do** what is not a read, once you say yes to that very call. **Share** a place: share makes a package you can send and verify; your lines are a plain text file you can copy. A client starts head with `head run`; typed alone, `head` says this and starts nothing.
5
+ head is an MCP server. Give it an API document, approve the connection, and ask a question. It reads operations the document declares, returns typed fields when a schema is available, and keeps signed receipts of its reads. Without a usable schema, the answer is named as untyped.
6
6
 
7
- **Your lines.** Beside your place's lock, `birth.bound` holds your lines and nothing of head's: your root and your devices, the sources you connected, what you allowed, each offer you used under the words you asked it by. It is a text file with your lines, in your own words: read it with `cat`, copy it, paste it. head's own lines are its profile, which you see when you ask why.
7
+ ```text
8
+ You: Connect this API as forecast.
9
+ [give its OpenAPI document; approve the connection]
10
+ You: What is the forecast in Lima?
8
11
 
9
- Access comes at three levels, and the place says which. **None**: the document states that a read needs nothing, or says nothing about access at all; then head tries the read once with nothing attached, and keeps what it saw as a receipt. **A declared flow**: the document, or its overlay, declares how access is obtained, as an Arazzo profile: a form, a one-time code, a choice, a provider's page. head runs it once per issuer and keeps only the token, in the keychain. **A secret entered by hand**: a key or a password, only where the place's root allows it, entered on head's own one-time page and never through the model.
12
+ forecast: temperature 21, sky clear
13
+ receipt: sha256:…
14
+ ```
10
15
 
11
- What head never does. It never guesses how access is proven: when a document does not state it, only a read is tried, with nothing attached, and nothing else is called. It never calls an operation that is not a read without the person's yes, nor past what the place allows; a place that would stand on another's lock as its parent is refused by name, since composing two places' policies is bound's. It never lets a secret reach the model, a file, an answer or an argument. And it never raises a ceiling to make room: what outgrows one stays open until its responsibilities are reduced or split.
16
+ This is an illustrative fixture, not a live forecast. [Run the local example](docs/first-minute.md) without an account or a real secret.
12
17
 
13
- ## Install
18
+ ## Start
14
19
 
15
- - **As an extension:** download `head-<version>-<digest>.mcpb` from the [latest release](https://github.com/Lapxo/head/releases/latest) and open it. Its digest is in the release notes.
16
- - **By command:** `npx -y @lapxo/head@0.1.7 run`, for an assistant that starts its servers by command.
20
+ For an assistant that starts MCP servers by command:
17
21
 
18
- head runs on macOS for now. Its keys live in your keychain, never in a file.
22
+ ```sh
23
+ npx -y @lapxo/head@0.2.1 run
24
+ ```
19
25
 
20
- ## The first minute
26
+ The pin above names this release; the executable examples in this tree use the checkout. A client can also open a desktop extension from [releases](https://github.com/Lapxo/head/releases); check the artifact digests supplied with the release. Starting head alone prints help; `head run` starts the MCP server.
21
27
 
22
- head connects nothing when it is installed, and names no provider: what it reads is the API you hand it.
28
+ macOS is the supported desktop environment. Node 22.18 or later is required. Linux, Windows and unattended cloud execution are not validated as supported environments here. A successful mock or CI job does not establish working system-keychain and browser integration.
23
29
 
24
- 1. Ask your assistant something. With no place yet, head says so, and asks for the address of the document of an API that answers it.
25
- 2. Give that address and say yes once. head founds your place in `~/place`, connects the API from its document, pinned by the digest of what it read, and lets head read it for the next 90 days.
26
- 3. Your assistant asks again by itself, and the answer comes back typed, with the source it came from and a receipt signed by head's key.
30
+ ## What you do
31
+
32
+ - **Connect** a document, optionally with an overlay. head pins the compiled description by digest. With no place yet, the first approved connection creates `~/place`.
33
+ - **Ask** for one operation or compare the same question across sources. Receipts keep the source and time. A missing answer stays owed; an empty answer is not a missing answer.
34
+ - **Act** within the place's permissions and consent rules. A suggested next step is not authorization. Writes do not become allowed because a model asked for them.
35
+ - **Share and inspect** public material. A reference identifies content; a separate holder location says where to obtain it. Inspection checks the selected contract and grants nothing. [Try sharing and verification](docs/sharing.md).
36
+
37
+ Your place keeps its declarations as text. `birth.bound` separates your local declarations from head's profile. Keep it private unless you have reviewed what you are sharing: it is not the portable public `birth.topos` artifact.
38
+
39
+ ## Two names are not two independent sources
40
+
41
+ If `mirror` shares `forecast`'s declared lineage, agreement is shown as `●○`. Both sources and their receipts remain visible. `●●` does not prove independence; it only reports what the declared lineage and source identity establish. Disagreement keeps each source's value instead of choosing a winner.
42
+
43
+ [Run the lineage example](docs/lineage.md), including withdrawal of the lineage declaration without erasing earlier receipts.
44
+
45
+ ## Boundaries you can check
46
+
47
+ Signing keys stay behind a short-lived signer port in the supported flow. Tokens go to the declared transport, not into model arguments. A compromised process running as your user is outside that code boundary: it can invoke the keychain itself.
48
+
49
+ A digest is not network permission or proof that an answer is true. Received bytes install no authority. Configuration preflight does not replace API permission, access or secret-consent checks. See the [threat model and reporting policy](SECURITY.md), and [connect an API](docs/connect-any-api.md) for access options.
50
+
51
+ The three public MCP tools are `ask`, `connect` and `do`. Examples reuse the existing client and fixtures; they add no provider-specific behavior to head.