@centralu/host-linux-x64 0.1.0-beta.84 → 0.1.0-beta.85

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.
@@ -49,19 +49,22 @@ screen (`ui/index.html`) and agents call the same tools as functions. Same tools
49
49
  then calls `show` again. Keep that handler, and keep `show` read-only.
50
50
  9. **stdout is the MCP channel.** `console.log` is redirected to stderr for you; never write to
51
51
  `process.stdout` yourself. stderr is shown to the person when the app fails.
52
- 10. **Asking the agent**: inside a tool handler, `await centralu.agent('prompt', { schema, tool })`
53
- asks the agent of the person using Centralu. Each call runs in a new session under this app
54
- (the person can read it) and returns the agent's final answer: text, or with `schema` (a JSON
55
- Schema whose top level is an object) JSON of that shape, checked by Centralu. That session runs
56
- under `auto`, but never above the lowest approval setting among the sessions calling into the
57
- app. It runs under `safe` when nothing says who asked: no call is open, the calling session is
58
- gone, or the chain of calls can no longer be followed. Under `safe` the agent reads without
59
- asking, but every file write and command waits for the person to approve it in that session, so
60
- ask the agent for an answer and do the writing in your own tool code. Declare `"uses": { "agent": true }` in the manifest for the person's
61
- default agent, or a list such as `["codex"]` to pick one with `tool`. The prompt reaches the
62
- agent marked as written by this app, not by the person, so say plainly what you need. A run
63
- takes seconds to minutes; the helper keeps the call alive while it waits. An app runs one agent
64
- at a time and at most 5 a minute: put a batch of work into one prompt instead of a loop.
52
+ 10. **Giving the agent work**: inside a tool handler, `const { sessionId, mailId } = await
53
+ centralu.agent('task', { choices, tool })` starts a session of the person's agent under this app
54
+ (the person can read it) and returns at once. Its work is a mail from this app that needs its
55
+ reply; give `choices` (a list of sentences) when the answer is one of them. Read the replies with
56
+ `await centralu.answers(mailId)`, anywhere (a timer included): `state` is "waiting", "answered" or
57
+ "handled" (closed without a reply, with `why`), and `replies` lists every reply, oldest first, each
58
+ with `text` and, when the mail had choices, `choice: { n, text }` (compare by `text`; 0 is "None of
59
+ these"). Nothing is delivered to your app: read again later. The session stays until your code
60
+ archives it with `await centralu.archive(sessionId)` (once its work is done; it stays readable) or
61
+ the person does. It runs under `auto`, but never above the lowest approval setting among
62
+ the sessions calling into the app. It runs under `ask` when nothing says who asked: no call is
63
+ open, the calling session is gone, or the chain of calls can no longer be followed. Under `ask`
64
+ the agent runs with the person's own permission settings for that tool, which may let a file
65
+ write or command run without asking: never count on the person checking its work. Declare `"uses": { "agent": true }` in the manifest for the person's default
66
+ agent, or a list such as `["codex"]` to pick one with `tool`. The task reaches the agent marked as
67
+ mail from this app, not from the person, so say plainly what you need.
65
68
  11. **Calling another app**: inside a tool handler, `await centralu.callApp('other-app', 'tool', args)`
66
69
  calls a tool of another app and returns its answer (JSON if the tool returns structured
67
70
  content, else text). Declare the app in `"uses": { "apps": ["other-app"] }`. Only tools open to
@@ -76,11 +79,10 @@ screen (`ui/index.html`) and agents call the same tools as functions. Same tools
76
79
  files (project apps only).
77
80
 
78
81
  All three throw an error that says what Centralu answered. What the manifest declares in `uses` runs
79
- with no question: the person trusted the app with it. Only while a session under the `safe` preset has a
80
- call open into the app does Centralu ask the person, once per capability (an agent tool, another app, a
81
- host name) — on the session's approval card when an agent's call started it, on this app's screen when
82
- the screen did — and the call waits while the person decides (up to 5 minutes). A refusal, then or
83
- remembered from before, comes back as that error: show it plainly instead of retrying.
82
+ with no question: the person trusted the app with it. A call to another app's tool is decided as the
83
+ session that started the chain decides its own: under `ask` a tool that changes something waits on a card
84
+ in that session (up to 5 minutes). A refusal, then or remembered from before, comes back as that error:
85
+ show it plainly instead of retrying.
84
86
 
85
87
  **Background work.** Centralu stops an app with no open screen and no call for 5 minutes. An app
86
88
  with work on its own clock (a timer that polls, a queue it drives) declares it in the manifest,
@@ -94,8 +96,8 @@ there is work.
94
96
  finished, something needs it), declare `"uses": { "notices": true }`, keep
95
97
  `centralu.noticeAddress()` (inside the tool handler of that session's call) with the work, and when
96
98
  it is done call `await centralu.notify(address, 'what happened')`: anywhere, a timer included. The
97
- session receives it as your app's message. It resolves false (said on stderr) when Centralu did not
98
- take it: the session is gone, Centralu is restarting (try again later), or more than 10 a minute.
99
+ session receives it as mail from your app that needs no reply. It resolves false (said on stderr)
100
+ when Centralu did not take it: the session is gone.
99
101
  The address is null when a view called, or the manifest does not declare it.
100
102
 
101
103
  ## Dragging an item out of the screen