@wordinweb/agent 0.1.0 → 0.2.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/README.md +59 -16
- package/dist/{chunk-E7AFDS2O.js → chunk-3HREJUDW.js} +20242 -8897
- package/dist/chunk-3HREJUDW.js.map +1 -0
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +330 -36
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1578 -100
- package/dist/index.js +43 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-E7AFDS2O.js.map +0 -1
package/README.md
CHANGED
|
@@ -27,29 +27,50 @@ An AI invitation link can bootstrap a live shell session without an MCP
|
|
|
27
27
|
installation:
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
|
-
npx -y --package='https://collab.word-in-web.com/wordinweb-agent.tgz?v=short-invite-
|
|
30
|
+
npx -y --package='https://collab.word-in-web.com/wordinweb-agent.tgz?v=short-invite-6' wordinweb-agent connect '<short invitation URL>'
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
The command starts a detached local bridge
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
The command starts a detached local bridge and returns a `sessionId`. For Codex,
|
|
34
|
+
the bridge starts one dedicated resident document thread. Each private message
|
|
35
|
+
starts a turn on that thread, so its document context stays warm. The bridge
|
|
36
|
+
waits without model turns. Claude uses its captured session for each private
|
|
37
|
+
message. Each started turn supplies a `wakeId`. Include it in every document
|
|
38
|
+
command for that turn:
|
|
37
39
|
|
|
38
40
|
```bash
|
|
39
|
-
npx -y --package='https://collab.word-in-web.com/wordinweb-agent.tgz?v=short-invite-
|
|
41
|
+
npx -y --package='https://collab.word-in-web.com/wordinweb-agent.tgz?v=short-invite-6' wordinweb-agent session '<sessionId>' '{"command":"sync","wakeId":"<wakeId>"}'
|
|
40
42
|
```
|
|
41
43
|
|
|
42
|
-
The bridge supports `sync`, `capabilities`, `inspect`, `edit`, `
|
|
43
|
-
`close`. `wait` remains available for manual clients. Every
|
|
44
|
-
inspected revision. When the room advances, the package
|
|
45
|
-
inspected targets with their current state. Unchanged
|
|
46
|
-
the newer revision. Changed targets return `needs_sync`.
|
|
47
|
-
|
|
44
|
+
The bridge supports `sync`, `capabilities`, `inspect`, `edit`, `project`,
|
|
45
|
+
`patch`, `chat`, and `close`. `wait` remains available for manual clients. Every
|
|
46
|
+
edit includes the inspected revision. When the room advances, the package
|
|
47
|
+
compares the edit's inspected targets with their current state. Unchanged
|
|
48
|
+
targets proceed across the newer revision. Changed targets return `needs_sync`.
|
|
49
|
+
A `patch` against a stale window returns `needs_sync` the same way. In
|
|
50
|
+
suggestion mode the bridge applies every patch as tracked changes. The bridge
|
|
51
|
+
places the agent's visible collaboration cursor after its latest edit. A
|
|
52
|
+
successful turn ends with a `chat` command for the current `wakeId`. The bridge
|
|
53
|
+
interrupts a turn after 60 seconds and reports the failure in the private
|
|
54
|
+
document chat.
|
|
55
|
+
|
|
56
|
+
For a bulk prose rewrite, project the story once and send the changed lines
|
|
57
|
+
back:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npx -y --package='https://collab.word-in-web.com/wordinweb-agent.tgz?v=short-invite-6' wordinweb-agent session '<sessionId>' '{"command":"project","wakeId":"<wakeId>","request":{"mode":"md"}}'
|
|
61
|
+
npx -y --package='https://collab.word-in-web.com/wordinweb-agent.tgz?v=short-invite-6' wordinweb-agent session '<sessionId>' '{"command":"patch","wakeId":"<wakeId>","request":{"revision":"<projection revision>","mode":"md","edits":[{"startLine":4,"endLine":4,"newText":"Adopt the managed platform."}]}}'
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Inspect the current wake state with a short status command:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npx -y --package='https://collab.word-in-web.com/wordinweb-agent.tgz?v=short-invite-6' wordinweb-agent session '<sessionId>' '{"daemon":"status"}'
|
|
68
|
+
```
|
|
48
69
|
|
|
49
70
|
For a broad text task, read all non-empty stories in one bounded compact call:
|
|
50
71
|
|
|
51
72
|
```bash
|
|
52
|
-
npx -y --package='https://collab.word-in-web.com/wordinweb-agent.tgz?v=short-invite-
|
|
73
|
+
npx -y --package='https://collab.word-in-web.com/wordinweb-agent.tgz?v=short-invite-6' wordinweb-agent session '<sessionId>' '{"command":"inspect","wakeId":"<wakeId>","request":{"kind":"context"}}'
|
|
53
74
|
```
|
|
54
75
|
|
|
55
76
|
## Headless use
|
|
@@ -129,9 +150,31 @@ const result = await document.compose({
|
|
|
129
150
|
console.log(result.overview.outline, result.createdObjects);
|
|
130
151
|
```
|
|
131
152
|
|
|
132
|
-
`AgentDocument.create()` starts a blank DOCX. `tools()` returns
|
|
133
|
-
tool objects for composition, capabilities, inspection, edits,
|
|
134
|
-
and DOCX saves.
|
|
153
|
+
`AgentDocument.create()` starts a blank DOCX. `tools()` returns eight portable
|
|
154
|
+
tool objects for composition, capabilities, inspection, edits, text projection,
|
|
155
|
+
projection patches, asset reads, and DOCX saves.
|
|
156
|
+
|
|
157
|
+
## Text projection
|
|
158
|
+
|
|
159
|
+
`project` renders a story as deterministic text — plain paragraphs, structural
|
|
160
|
+
markdown, or the outline — with an anchor map that carries every line back to
|
|
161
|
+
its block, its runs, and their wire offsets. `patch` takes line-range hunks or
|
|
162
|
+
a unified diff written against that projection and compiles them into the same
|
|
163
|
+
intents an editor emits, so a bulk rewrite costs one window and one call.
|
|
164
|
+
|
|
165
|
+
```ts
|
|
166
|
+
const projection = agentDoc.project({ mode: "md" });
|
|
167
|
+
await agentDoc.patch({
|
|
168
|
+
revision: projection.revision,
|
|
169
|
+
mode: "md",
|
|
170
|
+
edits: [{ startLine: 4, endLine: 4, newText: "Adopt the managed platform." }],
|
|
171
|
+
});
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Agents read the text and never see a wire offset: the anchor map is built in
|
|
175
|
+
the same pass as the text and owns that translation. Projecting never changes
|
|
176
|
+
the document. The projection contract, the atom placeholders, and the patch
|
|
177
|
+
rules live in the skill's `references/interface.md`.
|
|
135
178
|
|
|
136
179
|
## Progressive inspection
|
|
137
180
|
|