@plurnk/plurnk-agui 3.0.0 → 4.0.0
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.
- package/.env.defaults +17 -8
- package/README.md +37 -13
- package/SPEC.md +627 -268
- package/dist/AguiPlus.d.ts +24 -29
- package/dist/AguiPlus.d.ts.map +1 -1
- package/dist/AguiPlus.js +25 -36
- package/dist/AguiPlus.js.map +1 -1
- package/dist/AguiSurface.d.ts +2 -2
- package/dist/AguiSurface.d.ts.map +1 -1
- package/dist/AguiSurface.js +25 -16
- package/dist/AguiSurface.js.map +1 -1
- package/dist/AuthorizationDocuments.d.ts +33 -0
- package/dist/AuthorizationDocuments.d.ts.map +1 -0
- package/dist/AuthorizationDocuments.js +84 -0
- package/dist/AuthorizationDocuments.js.map +1 -0
- package/dist/BuiltinActions.d.ts +11 -5
- package/dist/BuiltinActions.d.ts.map +1 -1
- package/dist/BuiltinActions.js +84 -119
- package/dist/BuiltinActions.js.map +1 -1
- package/dist/EventRouter.d.ts +11 -3
- package/dist/EventRouter.d.ts.map +1 -1
- package/dist/EventRouter.js +17 -32
- package/dist/EventRouter.js.map +1 -1
- package/dist/MessageAddress.d.ts +7 -5
- package/dist/MessageAddress.d.ts.map +1 -1
- package/dist/MessageAddress.js +14 -12
- package/dist/MessageAddress.js.map +1 -1
- package/dist/Module.d.ts +5 -4
- package/dist/Module.d.ts.map +1 -1
- package/dist/Module.js +222 -83
- package/dist/Module.js.map +1 -1
- package/dist/OAuthServer.d.ts +30 -0
- package/dist/OAuthServer.d.ts.map +1 -0
- package/dist/OAuthServer.js +607 -0
- package/dist/OAuthServer.js.map +1 -0
- package/dist/Portal.d.ts +41 -9
- package/dist/Portal.d.ts.map +1 -1
- package/dist/Portal.js +497 -185
- package/dist/Portal.js.map +1 -1
- package/dist/ProposalHitl.d.ts +18 -4
- package/dist/ProposalHitl.d.ts.map +1 -1
- package/dist/ProposalHitl.js +31 -41
- package/dist/ProposalHitl.js.map +1 -1
- package/dist/RunHandler.d.ts +18 -8
- package/dist/RunHandler.d.ts.map +1 -1
- package/dist/RunHandler.js +256 -137
- package/dist/RunHandler.js.map +1 -1
- package/dist/ThreadAddress.d.ts +8 -0
- package/dist/ThreadAddress.d.ts.map +1 -0
- package/dist/ThreadAddress.js +18 -0
- package/dist/ThreadAddress.js.map +1 -0
- package/dist/Translator.d.ts +52 -2
- package/dist/Translator.d.ts.map +1 -1
- package/dist/Translator.js +391 -121
- package/dist/Translator.js.map +1 -1
- package/dist/client.d.ts +2 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +2 -0
- package/dist/client.js.map +1 -0
- package/dist/config.d.ts +22 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +65 -13
- package/dist/config.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/run-events.d.ts +2 -0
- package/dist/run-events.d.ts.map +1 -1
- package/dist/run-events.js +5 -2
- package/dist/run-events.js.map +1 -1
- package/dist/types.d.ts +4 -22
- package/dist/types.d.ts.map +1 -1
- package/package.json +12 -8
package/.env.defaults
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
# @plurnk/plurnk-agui — client protocol. Listener address: the shared PLURNK_HOST/PLURNK_PORT
|
|
2
|
-
# (@plurnk/plurnk-contracts).
|
|
2
|
+
# (@plurnk/plurnk-contracts). The posture, the operator's secret and the browser sign-in are the
|
|
3
|
+
# shared PLURNK_AUTH, PLURNK_SECRET and PLURNK_PASS there ({§agui-oauth}).
|
|
3
4
|
|
|
4
|
-
#
|
|
5
|
-
#
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
|
|
9
|
-
#
|
|
10
|
-
#
|
|
5
|
+
# The authorization server's issuer, the public origin clients reach this daemon at
|
|
6
|
+
# ({§agui-oauth-endpoints}). Empty = the address each request reached this daemon at, so a daemon on
|
|
7
|
+
# every interface (PLURNK_HOST=0.0.0.0) answers each caller where it called; set it when a front the
|
|
8
|
+
# daemon cannot see, such as a TLS proxy, serves another origin.
|
|
9
|
+
PLURNK_AGUI_ISSUER=
|
|
10
|
+
# Credential lifetimes ({§agui-oauth-tokens}), seconds. An access token is presented as the bearer and
|
|
11
|
+
# renewed through the refresh token or the secret; a refresh token rotates on every use.
|
|
12
|
+
PLURNK_AGUI_ACCESS_TTL_SEC=3600
|
|
13
|
+
PLURNK_AGUI_REFRESH_TTL_SEC=2592000
|
|
14
|
+
# Confidential clients beyond the operator's own, one line each ({§agui-oauth-clients}):
|
|
15
|
+
# PLURNK_AGUI_CLIENT_<id>={"secret":"<its secret>","scopes":["agui"]}. Each holds its own
|
|
16
|
+
# credentials; removing its line and restarting revokes them. "operator" is reserved.
|
|
17
|
+
# The other origin whose pages a browser lets read replies (CORS): * = any page; one origin = that
|
|
18
|
+
# page only; empty = no CORS headers, so no page of another origin reads a reply (a page this
|
|
19
|
+
# daemon serves reads its own). The bearer, not this, is the perimeter.
|
|
11
20
|
PLURNK_AGUI_ALLOW_ORIGIN=*
|
|
12
21
|
# Default run turn cap: empty = no module default; -1 = unlimited; otherwise nonnegative integer.
|
|
13
22
|
# Core's operator ceiling still applies.
|
package/README.md
CHANGED
|
@@ -7,34 +7,50 @@ interface and translates daemon lifecycle events into AG-UI events.
|
|
|
7
7
|
|
|
8
8
|
`POST /agui` accepts `RunAgentInput` and returns an AG-UI event stream.
|
|
9
9
|
|
|
10
|
+
A stock AG-UI client needs only the endpoint and, when enabled, authentication.
|
|
11
|
+
Its first message creates a folderless workspace and worker; the same `threadId`
|
|
12
|
+
reopens that conversation after reconnect or daemon restart. An existing worker
|
|
13
|
+
is directly addressable as `<workspace ID>#<worker name>`, stable across workspace
|
|
14
|
+
renames. Inspection creates nothing ({§agui-thread-binding}, {§agui-thread-address}).
|
|
15
|
+
|
|
10
16
|
PLURNK uses standard AG-UI events for Runs, messages, steps, tool calls, state,
|
|
11
|
-
and approval requests.
|
|
12
|
-
`
|
|
17
|
+
and approval requests. PLURNK's facts about those parts ride their standard
|
|
18
|
+
`metadata` under `plurnk`; facts with no standard subject use namespaced
|
|
19
|
+
`plurnk.*` custom events, so generic AG-UI clients can ignore them safely.
|
|
13
20
|
|
|
14
21
|
Workspace selection and PLURNK-specific management actions use namespaced
|
|
15
22
|
fields under `forwardedProps.plurnk`. `SPEC.md` defines those extensions.
|
|
16
23
|
|
|
17
|
-
##
|
|
24
|
+
## Event projection
|
|
18
25
|
|
|
19
|
-
Each Run observes its bound
|
|
20
|
-
|
|
21
|
-
|
|
26
|
+
Each Run observes its bound worker and, once known, its exact loop. Delegated
|
|
27
|
+
children have standard subagent identities rather than speaking as the parent;
|
|
28
|
+
Core owns delivery of their replies and results into the parent's log
|
|
29
|
+
({§agui-topology-scope}, {§agui-subagents}). Unrelated siblings stay outside the
|
|
30
|
+
conversation.
|
|
22
31
|
|
|
23
32
|
| Daemon evidence | Client projection |
|
|
24
33
|
| --- | --- |
|
|
25
34
|
| NOTE | Ordinary operation row containing literal working memory. |
|
|
26
|
-
| WAIT
|
|
35
|
+
| WAIT | A tool call with its receipt; a WAIT that carries a body speaks it instead. |
|
|
36
|
+
| Loop conclusion | Lifecycle signals; delivered SEND replies are assistant speech. |
|
|
27
37
|
| Live provider reasoning | Standard `REASONING_*` deltas, immediately. Retries have separate identities. |
|
|
28
38
|
| SEND | Assistant text; already-streamed reasoning is not repeated. |
|
|
39
|
+
| A message to the worker | A user message, named by its source unless this client sent it. |
|
|
29
40
|
| Other model operations | Standard tool calls and results. |
|
|
30
|
-
|
|
|
31
|
-
|
|
|
32
|
-
|
|
|
41
|
+
| A row's facts | `metadata.plurnk` on the message, tool call or result the row builds, live and on snapshot. |
|
|
42
|
+
| Delegated child activity | Standard `SUBAGENT_*` lifecycle and attributed messages/tool calls; its conclusion answers the parent's delegation call. |
|
|
43
|
+
| Non-conversation harness activity | `CUSTOM plurnk.ambient`, without invented model speech. |
|
|
44
|
+
| Loop end | `RUN_FINISHED` completed with its result or cancelled, or `RUN_ERROR` for a failure; the end carries its token `usage`. |
|
|
45
|
+
| Packet and terminal usage | State updates, and the loop's terminal record as the end's `metadata.plurnk.terminal`: the complete accounting with cost; daemon quantities pass through unchanged. |
|
|
33
46
|
|
|
34
47
|
READ of `reasoning://<worker>/…` is an operation receipt, not another reasoning stream.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
48
|
+
|
|
49
|
+
A Run's `messages` are the client's copy of the conversation. A Run submits only a
|
|
50
|
+
user message the conversation doesn't hold, and a Run with nothing new reattaches:
|
|
51
|
+
the durable `MESSAGES_SNAPSHOT` restores the whole conversation without a prompt or
|
|
52
|
+
model inference ({§agui-run-input}, {§agui-sync}). A stock `HttpAgent` therefore
|
|
53
|
+
reattaches by running again with its history.
|
|
38
54
|
|
|
39
55
|
Pending proposals and user interactions use standard AG-UI interrupts and
|
|
40
56
|
resume Runs. Core decides their owner and disposition, including delegated
|
|
@@ -43,6 +59,10 @@ event schemas, and settlement rules live in [SPEC.md](./SPEC.md).
|
|
|
43
59
|
|
|
44
60
|
## Integration
|
|
45
61
|
|
|
62
|
+
A browser client imports the state and action-outcome types from
|
|
63
|
+
`@plurnk/plurnk-agui/client`, which needs no Node types ({§agui-client-types}); the
|
|
64
|
+
package root is the server module.
|
|
65
|
+
|
|
46
66
|
The daemon discovers this package as a module: its `package.json` declares
|
|
47
67
|
`plurnk: { kind: "module", module: "./module" }`, and the service composes
|
|
48
68
|
nothing by hand. The module mounts only `/agui` on the daemon's listener
|
|
@@ -61,3 +81,7 @@ terminal/editor behavior.
|
|
|
61
81
|
```sh
|
|
62
82
|
npm run test -w @plurnk/plurnk-agui
|
|
63
83
|
```
|
|
84
|
+
|
|
85
|
+
Deterministic tests use isolated configuration. The service's explicit
|
|
86
|
+
`test:live` tier also includes the real-model AG-UI stories; its
|
|
87
|
+
`test:live:specimen` selector can run either story by exact name.
|