@agimon-ai/po-author 0.0.0-alpha.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/LICENSE +21 -0
- package/README.md +38 -0
- package/dist/apiContracts.cjs +348 -0
- package/dist/apiContracts.cjs.map +1 -0
- package/dist/apiContracts.d.mts +53 -0
- package/dist/apiContracts.d.mts.map +1 -0
- package/dist/apiContracts.mjs +343 -0
- package/dist/apiContracts.mjs.map +1 -0
- package/dist/authorFacade--Lc599Ft.mjs +84 -0
- package/dist/authorFacade--Lc599Ft.mjs.map +1 -0
- package/dist/authorFacade-89Eb2-sW.d.mts +132 -0
- package/dist/authorFacade-89Eb2-sW.d.mts.map +1 -0
- package/dist/authorFacade-BYvlm8Ff.cjs +119 -0
- package/dist/authorFacade-BYvlm8Ff.cjs.map +1 -0
- package/dist/authorFacade.cjs +27 -0
- package/dist/authorFacade.d.mts +3 -0
- package/dist/authorFacade.mjs +3 -0
- package/dist/extensions/server.cjs +845 -0
- package/dist/extensions/server.cjs.map +1 -0
- package/dist/extensions/server.d.mts +5 -0
- package/dist/extensions/server.d.mts.map +1 -0
- package/dist/extensions/server.mjs +838 -0
- package/dist/extensions/server.mjs.map +1 -0
- package/dist/extensions/web.mjs +4758 -0
- package/dist/extensions/web.mjs.map +1 -0
- package/dist/index.cjs +101 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.mts +435 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +70 -0
- package/dist/index.mjs.map +1 -0
- package/dist/structuredDocuments-B914GLxx.mjs +1064 -0
- package/dist/structuredDocuments-B914GLxx.mjs.map +1 -0
- package/dist/structuredDocuments-CNac1JmJ.cjs +1316 -0
- package/dist/structuredDocuments-CNac1JmJ.cjs.map +1 -0
- package/llms.txt +11 -0
- package/package.json +140 -0
- package/src/prompts/po-use-author/SKILL.md +20 -0
- package/src/types/author.ts +61 -0
- package/src/types/authorPreview.ts +98 -0
- package/src/types/structuredDocuments.ts +63 -0
- package/src/types/webAuthor.ts +94 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Vuong Ngo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# @agimon-ai/po-author
|
|
2
|
+
|
|
3
|
+
Private, optional Po minor mode for focused document review and bounded visual authoring.
|
|
4
|
+
|
|
5
|
+
## Behavior
|
|
6
|
+
|
|
7
|
+
Author is a session-scoped minor mode. Its three tools remain registered for the life of the extension but are active only while Author mode is active:
|
|
8
|
+
|
|
9
|
+
- `open_authoring_file({"path":"relative/file.png","alias":"review"})` validates a repository file and opens or reuses its temporary canvas without writing the file. Alias is optional. Opening the same file under another name returns the original alias; an alias cannot be reassigned to another file.
|
|
10
|
+
- `describe_author_tools({})` lists canvas aliases and readiness. `describe_author_tools({"alias":"review"})` returns that canvas's current capability catalog and server-issued token when ready. Opening does not wait for the tab to become ready; describe again after it opens.
|
|
11
|
+
- `use_author_tools({"alias":"review","catalogToken":"...","name":"...","arguments":{}})` invokes one capability with exactly the advertised arguments. Alias is optional only if one open canvas is unambiguous.
|
|
12
|
+
|
|
13
|
+
Catalog tokens rotate whenever capabilities change. Document-backed tools remain targetable from the main conversation while the canvas is open; live viewport grid operations require a visible tab. Closed canvases can be reopened by path and alias. Viewport document content is untrusted data, never agent instructions.
|
|
14
|
+
|
|
15
|
+
Unsent annotations belong to their document and leave the canvas once a send is accepted; the dock's request log keeps the request for the open document. Messages typed in an Author file tab carry `Author document: <path> (canvas <alias>)` as referenced context. Slash commands are sent unchanged.
|
|
16
|
+
The package declares session API, cockpit client, and web hub entries. Each canvas has an isolated ownership lease and catalog token; stale bindings and cross-canvas tokens are rejected. Without the host session API socket and token, catalog operations fail as unavailable.
|
|
17
|
+
|
|
18
|
+
## Public API
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { activateAuthorExtension } from '@agimon-ai/po-author/extensions/pi';
|
|
22
|
+
import { createAuthorCatalog, DescribeAuthorToolsInputSchema, UseAuthorToolInputSchema } from '@agimon-ai/po-author';
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The Pi host entry is available at `@agimon-ai/po-author/extensions/pi`.
|
|
26
|
+
|
|
27
|
+
## Development
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pnpm fixcode
|
|
31
|
+
pnpm typecheck
|
|
32
|
+
pnpm test
|
|
33
|
+
pnpm build
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Plugin lifecycle
|
|
37
|
+
|
|
38
|
+
Author uses the shared [plugin lifecycle contract](../../core/po-core/docs/plugins.md). Pi and server entries compose shared tool and command declarations; controllers own Author behavior, and the helpers own registration and disposal. Minor-mode entry and exit are independent of plugin mounting.
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
5
|
+
let _agimon_ai_po_core_apiContracts = require("@agimon-ai/po-core/apiContracts");
|
|
6
|
+
let typebox = require("typebox");
|
|
7
|
+
require("@agimon-ai/po-core/pluginProtocol");
|
|
8
|
+
//#region src/schemas/authorFacade.ts
|
|
9
|
+
const AuthorCapabilityNameSchema = typebox.Type.String({
|
|
10
|
+
minLength: 1,
|
|
11
|
+
maxLength: 30,
|
|
12
|
+
pattern: "^[a-z][a-z0-9_]*$"
|
|
13
|
+
});
|
|
14
|
+
const AuthorAliasSchema = typebox.Type.String({
|
|
15
|
+
minLength: 1,
|
|
16
|
+
maxLength: 64,
|
|
17
|
+
pattern: "^[a-z][a-z0-9_-]{0,63}$"
|
|
18
|
+
});
|
|
19
|
+
typebox.Type.Object({ alias: typebox.Type.Optional(AuthorAliasSchema) }, { additionalProperties: false });
|
|
20
|
+
/** Invokes one capability exposed by the current Author viewport. */
|
|
21
|
+
const AuthorUseToolsInputSchema = typebox.Type.Object({
|
|
22
|
+
alias: typebox.Type.Optional(AuthorAliasSchema),
|
|
23
|
+
catalogToken: typebox.Type.String({
|
|
24
|
+
minLength: 1,
|
|
25
|
+
maxLength: 256
|
|
26
|
+
}),
|
|
27
|
+
name: AuthorCapabilityNameSchema,
|
|
28
|
+
arguments: typebox.Type.Record(typebox.Type.String(), typebox.Type.Unknown())
|
|
29
|
+
}, { additionalProperties: false });
|
|
30
|
+
const AuthorBridgeBase = {
|
|
31
|
+
alias: AuthorAliasSchema,
|
|
32
|
+
generation: typebox.Type.Number({ minimum: 0 })
|
|
33
|
+
};
|
|
34
|
+
/** Browser-to-server lease messages, validated before Author sees the payload. */
|
|
35
|
+
const AuthorBridgeMessageSchema = typebox.Type.Union([
|
|
36
|
+
typebox.Type.Object({
|
|
37
|
+
...AuthorBridgeBase,
|
|
38
|
+
kind: typebox.Type.Literal("register")
|
|
39
|
+
}, { additionalProperties: false }),
|
|
40
|
+
typebox.Type.Object({
|
|
41
|
+
...AuthorBridgeBase,
|
|
42
|
+
kind: typebox.Type.Literal("release")
|
|
43
|
+
}, { additionalProperties: false }),
|
|
44
|
+
typebox.Type.Object({
|
|
45
|
+
...AuthorBridgeBase,
|
|
46
|
+
kind: typebox.Type.Literal("catalog"),
|
|
47
|
+
ownerToken: typebox.Type.String({ minLength: 1 }),
|
|
48
|
+
tools: typebox.Type.Array(typebox.Type.Object({
|
|
49
|
+
name: typebox.Type.String({ minLength: 1 }),
|
|
50
|
+
label: typebox.Type.String(),
|
|
51
|
+
description: typebox.Type.String(),
|
|
52
|
+
inputSchema: typebox.Type.Record(typebox.Type.String(), typebox.Type.Unknown())
|
|
53
|
+
}, { additionalProperties: false }))
|
|
54
|
+
}, { additionalProperties: false }),
|
|
55
|
+
typebox.Type.Object({
|
|
56
|
+
...AuthorBridgeBase,
|
|
57
|
+
kind: typebox.Type.Literal("result"),
|
|
58
|
+
ownerToken: typebox.Type.String({ minLength: 1 }),
|
|
59
|
+
catalogToken: typebox.Type.String({ minLength: 1 }),
|
|
60
|
+
requestId: typebox.Type.String({ minLength: 1 }),
|
|
61
|
+
result: typebox.Type.Unknown()
|
|
62
|
+
}, { additionalProperties: false }),
|
|
63
|
+
typebox.Type.Object({
|
|
64
|
+
...AuthorBridgeBase,
|
|
65
|
+
kind: typebox.Type.Literal("cancelled"),
|
|
66
|
+
ownerToken: typebox.Type.String({ minLength: 1 }),
|
|
67
|
+
catalogToken: typebox.Type.String({ minLength: 1 }),
|
|
68
|
+
requestId: typebox.Type.String({ minLength: 1 })
|
|
69
|
+
}, { additionalProperties: false })
|
|
70
|
+
]);
|
|
71
|
+
const AuthorBridgeInputSchema = typebox.Type.Object({
|
|
72
|
+
sessionId: typebox.Type.String({ minLength: 1 }),
|
|
73
|
+
message: AuthorBridgeMessageSchema
|
|
74
|
+
}, { additionalProperties: false });
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region src/schemas/apiContracts.ts
|
|
77
|
+
const S = typebox.Type.String();
|
|
78
|
+
const N = typebox.Type.Number();
|
|
79
|
+
const B = typebox.Type.Boolean();
|
|
80
|
+
const O = typebox.Type.Optional;
|
|
81
|
+
const Json = typebox.Type.Unknown({ description: "Runtime author capability value, validated against the capability catalog inputSchema." });
|
|
82
|
+
const values = (items) => typebox.Type.Union(items.map((item) => typebox.Type.Literal(item)));
|
|
83
|
+
const Capability = typebox.Type.Object({
|
|
84
|
+
name: S,
|
|
85
|
+
label: S,
|
|
86
|
+
description: S,
|
|
87
|
+
inputSchema: typebox.Type.Record(S, Json)
|
|
88
|
+
});
|
|
89
|
+
const Accepted = typebox.Type.Object({
|
|
90
|
+
alias: AuthorAliasSchema,
|
|
91
|
+
kind: typebox.Type.Literal("accepted"),
|
|
92
|
+
generation: N,
|
|
93
|
+
ownerToken: S,
|
|
94
|
+
catalogToken: O(S),
|
|
95
|
+
leaseMs: N
|
|
96
|
+
});
|
|
97
|
+
const Identity = {
|
|
98
|
+
alias: AuthorAliasSchema,
|
|
99
|
+
generation: N,
|
|
100
|
+
ownerToken: S,
|
|
101
|
+
catalogToken: S,
|
|
102
|
+
requestId: S
|
|
103
|
+
};
|
|
104
|
+
const Request = typebox.Type.Object({
|
|
105
|
+
kind: typebox.Type.Literal("request"),
|
|
106
|
+
...Identity,
|
|
107
|
+
name: S,
|
|
108
|
+
arguments: typebox.Type.Record(S, Json)
|
|
109
|
+
});
|
|
110
|
+
const Cancel = typebox.Type.Object({
|
|
111
|
+
kind: typebox.Type.Literal("cancel"),
|
|
112
|
+
...Identity
|
|
113
|
+
});
|
|
114
|
+
const AuthorHubMessageSchema = typebox.Type.Union([
|
|
115
|
+
Accepted,
|
|
116
|
+
Request,
|
|
117
|
+
Cancel,
|
|
118
|
+
typebox.Type.Object({
|
|
119
|
+
alias: AuthorAliasSchema,
|
|
120
|
+
kind: typebox.Type.Literal("rejected"),
|
|
121
|
+
reason: S
|
|
122
|
+
})
|
|
123
|
+
]);
|
|
124
|
+
const Binding = {
|
|
125
|
+
alias: AuthorAliasSchema,
|
|
126
|
+
bindingId: S,
|
|
127
|
+
generation: typebox.Type.Integer({ minimum: 0 })
|
|
128
|
+
};
|
|
129
|
+
const Owner = {
|
|
130
|
+
...Binding,
|
|
131
|
+
ownerToken: S
|
|
132
|
+
};
|
|
133
|
+
const ResultIdentity = {
|
|
134
|
+
...Owner,
|
|
135
|
+
catalogToken: S,
|
|
136
|
+
requestId: S
|
|
137
|
+
};
|
|
138
|
+
const Format = values([
|
|
139
|
+
"markdown-slides",
|
|
140
|
+
"csv",
|
|
141
|
+
"pptx",
|
|
142
|
+
"xlsx"
|
|
143
|
+
]);
|
|
144
|
+
const Manifest = typebox.Type.Object({
|
|
145
|
+
format: Format,
|
|
146
|
+
sourceDigest: S,
|
|
147
|
+
byteLength: N,
|
|
148
|
+
fragmentCount: N,
|
|
149
|
+
metadata: typebox.Type.Record(S, typebox.Type.Union([
|
|
150
|
+
S,
|
|
151
|
+
N,
|
|
152
|
+
B
|
|
153
|
+
]))
|
|
154
|
+
});
|
|
155
|
+
const Operation = {
|
|
156
|
+
fragmentId: S,
|
|
157
|
+
replacement: S
|
|
158
|
+
};
|
|
159
|
+
const Log = typebox.Type.Array(typebox.Type.Object({
|
|
160
|
+
...Operation,
|
|
161
|
+
previous: S
|
|
162
|
+
}));
|
|
163
|
+
const Document = {
|
|
164
|
+
path: S,
|
|
165
|
+
format: Format,
|
|
166
|
+
operations: O(typebox.Type.Array(typebox.Type.Object(Operation), { maxItems: 1e5 })),
|
|
167
|
+
csvDialect: O(typebox.Type.Object({
|
|
168
|
+
delimiter: O(values([
|
|
169
|
+
",",
|
|
170
|
+
";",
|
|
171
|
+
" ",
|
|
172
|
+
"|"
|
|
173
|
+
])),
|
|
174
|
+
quote: O(values(["\"", "'"])),
|
|
175
|
+
recordDelimiter: O(values(["\n", "\r\n"]))
|
|
176
|
+
}))
|
|
177
|
+
};
|
|
178
|
+
const ParsedDocument = typebox.Type.Object({
|
|
179
|
+
manifest: Manifest,
|
|
180
|
+
fragments: typebox.Type.Array(typebox.Type.Object({
|
|
181
|
+
id: S,
|
|
182
|
+
kind: values([
|
|
183
|
+
"slide",
|
|
184
|
+
"cell",
|
|
185
|
+
"text-run"
|
|
186
|
+
]),
|
|
187
|
+
text: S,
|
|
188
|
+
readOnly: O(B),
|
|
189
|
+
location: S
|
|
190
|
+
})),
|
|
191
|
+
renderModel: typebox.Type.Object({
|
|
192
|
+
format: Format,
|
|
193
|
+
blocks: typebox.Type.Array(typebox.Type.Object({
|
|
194
|
+
id: S,
|
|
195
|
+
text: S,
|
|
196
|
+
readOnly: B
|
|
197
|
+
}))
|
|
198
|
+
})
|
|
199
|
+
});
|
|
200
|
+
const post = (id, path, schema, output) => ({
|
|
201
|
+
id,
|
|
202
|
+
scope: "session",
|
|
203
|
+
basePath: "author",
|
|
204
|
+
path,
|
|
205
|
+
method: "POST",
|
|
206
|
+
authentication: "owner",
|
|
207
|
+
description: `Author ${id}.`,
|
|
208
|
+
body: {
|
|
209
|
+
required: true,
|
|
210
|
+
contentType: "application/json",
|
|
211
|
+
schema
|
|
212
|
+
},
|
|
213
|
+
responses: (0, _agimon_ai_po_core_apiContracts.jsonApiResponses)(output)
|
|
214
|
+
});
|
|
215
|
+
const apiContracts = (0, _agimon_ai_po_core_apiContracts.defineApiContract)({
|
|
216
|
+
version: 1,
|
|
217
|
+
dynamic: ["Author capability catalogs supply input JSON Schemas and arbitrary JSON results at runtime."],
|
|
218
|
+
http: [
|
|
219
|
+
{
|
|
220
|
+
id: "author.state",
|
|
221
|
+
scope: "session",
|
|
222
|
+
basePath: "author",
|
|
223
|
+
path: "/state",
|
|
224
|
+
method: "GET",
|
|
225
|
+
authentication: "owner",
|
|
226
|
+
description: "Read author activation.",
|
|
227
|
+
responses: (0, _agimon_ai_po_core_apiContracts.jsonApiResponses)(typebox.Type.Object({
|
|
228
|
+
sessionId: typebox.Type.Union([S, typebox.Type.Null()]),
|
|
229
|
+
activation: values(["inactive", "active"]),
|
|
230
|
+
capabilityCount: N
|
|
231
|
+
}))
|
|
232
|
+
},
|
|
233
|
+
post("bridge.register", "/bridge/register", typebox.Type.Object(Binding), Accepted),
|
|
234
|
+
post("bridge.catalog", "/bridge/catalog", typebox.Type.Object({
|
|
235
|
+
...Owner,
|
|
236
|
+
tools: typebox.Type.Array(Capability)
|
|
237
|
+
}), Accepted),
|
|
238
|
+
post("bridge.next", "/bridge/next", typebox.Type.Object(Owner), typebox.Type.Union([Request, Cancel])),
|
|
239
|
+
post("bridge.result", "/bridge/result", typebox.Type.Object({
|
|
240
|
+
...ResultIdentity,
|
|
241
|
+
result: Json
|
|
242
|
+
}), typebox.Type.Object({ accepted: typebox.Type.Literal(true) })),
|
|
243
|
+
post("bridge.cancelled", "/bridge/cancelled", typebox.Type.Object(ResultIdentity), typebox.Type.Object({ accepted: typebox.Type.Literal(true) })),
|
|
244
|
+
post("bridge.disconnect", "/bridge/disconnect", typebox.Type.Object(Binding), typebox.Type.Object({ accepted: typebox.Type.Literal(true) })),
|
|
245
|
+
post("bridge.close", "/bridge/close", typebox.Type.Object({ alias: AuthorAliasSchema }), typebox.Type.Object({ accepted: typebox.Type.Literal(true) })),
|
|
246
|
+
{
|
|
247
|
+
id: "bridge.describe",
|
|
248
|
+
scope: "session",
|
|
249
|
+
basePath: "author",
|
|
250
|
+
path: "/bridge/describe",
|
|
251
|
+
method: "GET",
|
|
252
|
+
authentication: "owner",
|
|
253
|
+
description: "Read runtime author capabilities.",
|
|
254
|
+
responses: (0, _agimon_ai_po_core_apiContracts.jsonApiResponses)(typebox.Type.Object({
|
|
255
|
+
catalogToken: S,
|
|
256
|
+
tools: typebox.Type.Array(Capability),
|
|
257
|
+
canvases: typebox.Type.Array(typebox.Type.Object({
|
|
258
|
+
alias: S,
|
|
259
|
+
path: S,
|
|
260
|
+
status: values([
|
|
261
|
+
"opening",
|
|
262
|
+
"ready",
|
|
263
|
+
"unavailable"
|
|
264
|
+
])
|
|
265
|
+
}))
|
|
266
|
+
}))
|
|
267
|
+
},
|
|
268
|
+
post("bridge.invoke", "/bridge/invoke", AuthorUseToolsInputSchema, typebox.Type.Object({
|
|
269
|
+
alias: AuthorAliasSchema,
|
|
270
|
+
catalogToken: S,
|
|
271
|
+
name: S,
|
|
272
|
+
result: Json
|
|
273
|
+
})),
|
|
274
|
+
post("documents.open", "/documents/open", typebox.Type.Object({
|
|
275
|
+
...Document,
|
|
276
|
+
format: O(Format),
|
|
277
|
+
alias: O(AuthorAliasSchema)
|
|
278
|
+
}), typebox.Type.Union([typebox.Type.Object({
|
|
279
|
+
path: S,
|
|
280
|
+
byteLength: N,
|
|
281
|
+
alias: AuthorAliasSchema,
|
|
282
|
+
status: values([
|
|
283
|
+
"opening",
|
|
284
|
+
"ready",
|
|
285
|
+
"unavailable"
|
|
286
|
+
]),
|
|
287
|
+
reused: B
|
|
288
|
+
}), ParsedDocument])),
|
|
289
|
+
post("documents.preflight", "/documents/preflight", typebox.Type.Object(Document), typebox.Type.Object({
|
|
290
|
+
accepted: B,
|
|
291
|
+
digest: S,
|
|
292
|
+
sourceDigest: S,
|
|
293
|
+
operations: Log,
|
|
294
|
+
issues: typebox.Type.Array(typebox.Type.Object({
|
|
295
|
+
code: S,
|
|
296
|
+
message: S,
|
|
297
|
+
fragmentId: O(S)
|
|
298
|
+
}))
|
|
299
|
+
})),
|
|
300
|
+
post("documents.serialize", "/documents/serialize", typebox.Type.Object({
|
|
301
|
+
...Document,
|
|
302
|
+
preflightDigest: S
|
|
303
|
+
}), typebox.Type.Object({
|
|
304
|
+
bytes: S,
|
|
305
|
+
encoding: typebox.Type.Literal("base64"),
|
|
306
|
+
manifest: Manifest,
|
|
307
|
+
operationLog: Log
|
|
308
|
+
}))
|
|
309
|
+
],
|
|
310
|
+
sockets: ["global", "workspace"].flatMap((scope) => [
|
|
311
|
+
{
|
|
312
|
+
id: "author.send",
|
|
313
|
+
scope,
|
|
314
|
+
service: "author.bridge",
|
|
315
|
+
member: "send",
|
|
316
|
+
kind: "method",
|
|
317
|
+
direction: "client-to-server",
|
|
318
|
+
description: "Scoped author bridge method invoked through po.plugin.v1.",
|
|
319
|
+
input: AuthorBridgeInputSchema,
|
|
320
|
+
output: typebox.Type.Object({}, { additionalProperties: false })
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
id: "author.browser",
|
|
324
|
+
scope,
|
|
325
|
+
service: "po.hub.v1",
|
|
326
|
+
member: "author_webmcp",
|
|
327
|
+
kind: "channel",
|
|
328
|
+
direction: "client-to-server",
|
|
329
|
+
description: "Browser author channel payload.",
|
|
330
|
+
input: AuthorBridgeMessageSchema
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
id: "author.hub",
|
|
334
|
+
scope,
|
|
335
|
+
service: "po.hub.v1",
|
|
336
|
+
member: "author_webmcp",
|
|
337
|
+
kind: "channel",
|
|
338
|
+
direction: "server-to-client",
|
|
339
|
+
description: "Hub author channel payload.",
|
|
340
|
+
input: AuthorHubMessageSchema
|
|
341
|
+
}
|
|
342
|
+
])
|
|
343
|
+
});
|
|
344
|
+
//#endregion
|
|
345
|
+
exports.apiContracts = apiContracts;
|
|
346
|
+
exports.default = apiContracts;
|
|
347
|
+
|
|
348
|
+
//# sourceMappingURL=apiContracts.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiContracts.cjs","names":["Type","Type","jsonApiResponses","defineApiContract"],"sources":["../src/schemas/authorFacade.ts","../src/schemas/apiContracts.ts"],"sourcesContent":["import type { DoomApiScope } from '@agimon-ai/po-core/packageApi';\nimport { defineDoomPluginMethod } from '@agimon-ai/po-core/pluginProtocol';\nimport { type Static, Type } from 'typebox';\n\nconst AuthorCapabilityNameSchema = Type.String({\n minLength: 1,\n maxLength: 30,\n pattern: '^[a-z][a-z0-9_]*$',\n});\n\nexport const AuthorAliasSchema = Type.String({ minLength: 1, maxLength: 64, pattern: '^[a-z][a-z0-9_-]{0,63}$' });\n\n/** Lists canvases or the capabilities of one named canvas. */\nexport const AuthorDescribeToolsInputSchema = Type.Object(\n { alias: Type.Optional(AuthorAliasSchema) },\n { additionalProperties: false },\n);\nexport type AuthorDescribeToolsInput = Static<typeof AuthorDescribeToolsInputSchema>;\n\n/** Invokes one capability exposed by the current Author viewport. */\nexport const AuthorUseToolsInputSchema = Type.Object(\n {\n alias: Type.Optional(AuthorAliasSchema),\n catalogToken: Type.String({ minLength: 1, maxLength: 256 }),\n name: AuthorCapabilityNameSchema,\n arguments: Type.Record(Type.String(), Type.Unknown()),\n },\n { additionalProperties: false },\n);\nexport type AuthorUseToolsInput = Static<typeof AuthorUseToolsInputSchema>;\n\nconst AuthorBridgeBase = {\n alias: AuthorAliasSchema,\n generation: Type.Number({ minimum: 0 }),\n};\n\n/** Browser-to-server lease messages, validated before Author sees the payload. */\nexport const AuthorBridgeMessageSchema = Type.Union([\n Type.Object({ ...AuthorBridgeBase, kind: Type.Literal('register') }, { additionalProperties: false }),\n Type.Object({ ...AuthorBridgeBase, kind: Type.Literal('release') }, { additionalProperties: false }),\n Type.Object(\n {\n ...AuthorBridgeBase,\n kind: Type.Literal('catalog'),\n ownerToken: Type.String({ minLength: 1 }),\n tools: Type.Array(\n Type.Object(\n {\n name: Type.String({ minLength: 1 }),\n label: Type.String(),\n description: Type.String(),\n inputSchema: Type.Record(Type.String(), Type.Unknown()),\n },\n { additionalProperties: false },\n ),\n ),\n },\n { additionalProperties: false },\n ),\n Type.Object(\n {\n ...AuthorBridgeBase,\n kind: Type.Literal('result'),\n ownerToken: Type.String({ minLength: 1 }),\n catalogToken: Type.String({ minLength: 1 }),\n requestId: Type.String({ minLength: 1 }),\n result: Type.Unknown(),\n },\n { additionalProperties: false },\n ),\n Type.Object(\n {\n ...AuthorBridgeBase,\n kind: Type.Literal('cancelled'),\n ownerToken: Type.String({ minLength: 1 }),\n catalogToken: Type.String({ minLength: 1 }),\n requestId: Type.String({ minLength: 1 }),\n },\n { additionalProperties: false },\n ),\n]);\n\nexport const AuthorBridgeInputSchema = Type.Object(\n { sessionId: Type.String({ minLength: 1 }), message: AuthorBridgeMessageSchema },\n { additionalProperties: false },\n);\n\nexport function authorBridgeMethod(scope: Extract<DoomApiScope, 'global' | 'workspace'>) {\n return defineDoomPluginMethod({\n service: 'author.bridge',\n method: 'send',\n scope,\n direction: 'client-to-server',\n input: AuthorBridgeInputSchema,\n output: Type.Object({}, { additionalProperties: false }),\n });\n}\n","import { defineApiContract, jsonApiResponses, type DoomHttpContract } from '@agimon-ai/po-core/apiContracts';\nimport { Type } from 'typebox';\n\nimport {\n AuthorAliasSchema,\n AuthorBridgeMessageSchema,\n AuthorBridgeInputSchema,\n AuthorUseToolsInputSchema,\n} from './authorFacade';\n\nconst S = Type.String();\nconst N = Type.Number();\nconst B = Type.Boolean();\nconst O = Type.Optional;\nconst Json = Type.Unknown({\n description: 'Runtime author capability value, validated against the capability catalog inputSchema.',\n});\nconst values = <T extends string>(items: T[]) => Type.Union(items.map((item) => Type.Literal(item)));\nconst Capability = Type.Object({ name: S, label: S, description: S, inputSchema: Type.Record(S, Json) });\nconst Accepted = Type.Object({\n alias: AuthorAliasSchema,\n kind: Type.Literal('accepted'),\n generation: N,\n ownerToken: S,\n catalogToken: O(S),\n leaseMs: N,\n});\nconst Identity = { alias: AuthorAliasSchema, generation: N, ownerToken: S, catalogToken: S, requestId: S };\nconst Request = Type.Object({ kind: Type.Literal('request'), ...Identity, name: S, arguments: Type.Record(S, Json) });\nconst Cancel = Type.Object({ kind: Type.Literal('cancel'), ...Identity });\nexport const AuthorHubMessageSchema = Type.Union([\n Accepted,\n Request,\n Cancel,\n Type.Object({ alias: AuthorAliasSchema, kind: Type.Literal('rejected'), reason: S }),\n]);\nconst Binding = { alias: AuthorAliasSchema, bindingId: S, generation: Type.Integer({ minimum: 0 }) };\nconst Owner = { ...Binding, ownerToken: S };\nconst ResultIdentity = { ...Owner, catalogToken: S, requestId: S };\nconst Format = values(['markdown-slides', 'csv', 'pptx', 'xlsx']);\nconst Manifest = Type.Object({\n format: Format,\n sourceDigest: S,\n byteLength: N,\n fragmentCount: N,\n metadata: Type.Record(S, Type.Union([S, N, B])),\n});\nconst Operation = { fragmentId: S, replacement: S };\nconst Log = Type.Array(Type.Object({ ...Operation, previous: S }));\nconst Document = {\n path: S,\n format: Format,\n operations: O(Type.Array(Type.Object(Operation), { maxItems: 100000 })),\n csvDialect: O(\n Type.Object({\n delimiter: O(values([',', ';', '\\t', '|'])),\n quote: O(values(['\"', \"'\"])),\n recordDelimiter: O(values(['\\n', '\\r\\n'])),\n }),\n ),\n};\nconst ParsedDocument = Type.Object({\n manifest: Manifest,\n fragments: Type.Array(\n Type.Object({ id: S, kind: values(['slide', 'cell', 'text-run']), text: S, readOnly: O(B), location: S }),\n ),\n renderModel: Type.Object({ format: Format, blocks: Type.Array(Type.Object({ id: S, text: S, readOnly: B })) }),\n});\nconst post = (id: string, path: string, schema: object, output: object): DoomHttpContract => ({\n id,\n scope: 'session',\n basePath: 'author',\n path,\n method: 'POST',\n authentication: 'owner',\n description: `Author ${id}.`,\n body: { required: true, contentType: 'application/json', schema },\n responses: jsonApiResponses(output),\n});\nexport const apiContracts = defineApiContract({\n version: 1,\n dynamic: ['Author capability catalogs supply input JSON Schemas and arbitrary JSON results at runtime.'],\n http: [\n {\n id: 'author.state',\n scope: 'session',\n basePath: 'author',\n path: '/state',\n method: 'GET',\n authentication: 'owner',\n description: 'Read author activation.',\n responses: jsonApiResponses(\n Type.Object({\n sessionId: Type.Union([S, Type.Null()]),\n activation: values(['inactive', 'active']),\n capabilityCount: N,\n }),\n ),\n },\n post('bridge.register', '/bridge/register', Type.Object(Binding), Accepted),\n post('bridge.catalog', '/bridge/catalog', Type.Object({ ...Owner, tools: Type.Array(Capability) }), Accepted),\n post('bridge.next', '/bridge/next', Type.Object(Owner), Type.Union([Request, Cancel])),\n post(\n 'bridge.result',\n '/bridge/result',\n Type.Object({ ...ResultIdentity, result: Json }),\n Type.Object({ accepted: Type.Literal(true) }),\n ),\n post(\n 'bridge.cancelled',\n '/bridge/cancelled',\n Type.Object(ResultIdentity),\n Type.Object({ accepted: Type.Literal(true) }),\n ),\n post(\n 'bridge.disconnect',\n '/bridge/disconnect',\n Type.Object(Binding),\n Type.Object({ accepted: Type.Literal(true) }),\n ),\n post(\n 'bridge.close',\n '/bridge/close',\n Type.Object({ alias: AuthorAliasSchema }),\n Type.Object({ accepted: Type.Literal(true) }),\n ),\n {\n id: 'bridge.describe',\n scope: 'session',\n basePath: 'author',\n path: '/bridge/describe',\n method: 'GET',\n authentication: 'owner',\n description: 'Read runtime author capabilities.',\n responses: jsonApiResponses(\n Type.Object({\n catalogToken: S,\n tools: Type.Array(Capability),\n canvases: Type.Array(Type.Object({ alias: S, path: S, status: values(['opening', 'ready', 'unavailable']) })),\n }),\n ),\n },\n post(\n 'bridge.invoke',\n '/bridge/invoke',\n AuthorUseToolsInputSchema,\n Type.Object({ alias: AuthorAliasSchema, catalogToken: S, name: S, result: Json }),\n ),\n post(\n 'documents.open',\n '/documents/open',\n Type.Object({ ...Document, format: O(Format), alias: O(AuthorAliasSchema) }),\n Type.Union([\n Type.Object({\n path: S,\n byteLength: N,\n alias: AuthorAliasSchema,\n status: values(['opening', 'ready', 'unavailable']),\n reused: B,\n }),\n ParsedDocument,\n ]),\n ),\n post(\n 'documents.preflight',\n '/documents/preflight',\n Type.Object(Document),\n Type.Object({\n accepted: B,\n digest: S,\n sourceDigest: S,\n operations: Log,\n issues: Type.Array(Type.Object({ code: S, message: S, fragmentId: O(S) })),\n }),\n ),\n post(\n 'documents.serialize',\n '/documents/serialize',\n Type.Object({ ...Document, preflightDigest: S }),\n Type.Object({ bytes: S, encoding: Type.Literal('base64'), manifest: Manifest, operationLog: Log }),\n ),\n ],\n sockets: (['global', 'workspace'] as const).flatMap((scope) => [\n {\n id: 'author.send',\n scope,\n service: 'author.bridge',\n member: 'send',\n kind: 'method',\n direction: 'client-to-server',\n description: 'Scoped author bridge method invoked through po.plugin.v1.',\n input: AuthorBridgeInputSchema,\n output: Type.Object({}, { additionalProperties: false }),\n },\n {\n id: 'author.browser',\n scope,\n service: 'po.hub.v1',\n member: 'author_webmcp',\n kind: 'channel',\n direction: 'client-to-server',\n description: 'Browser author channel payload.',\n input: AuthorBridgeMessageSchema,\n },\n {\n id: 'author.hub',\n scope,\n service: 'po.hub.v1',\n member: 'author_webmcp',\n kind: 'channel',\n direction: 'server-to-client',\n description: 'Hub author channel payload.',\n input: AuthorHubMessageSchema,\n },\n ]),\n});\nexport default apiContracts;\n"],"mappings":";;;;;;;;AAIA,MAAM,6BAA6BA,QAAAA,KAAK,OAAO;CAC7C,WAAW;CACX,WAAW;CACX,SAAS;AACX,CAAC;AAED,MAAa,oBAAoBA,QAAAA,KAAK,OAAO;CAAE,WAAW;CAAG,WAAW;CAAI,SAAS;AAA0B,CAAC;AAGlEA,QAAAA,KAAK,OACjD,EAAE,OAAOA,QAAAA,KAAK,SAAS,iBAAiB,EAAE,GAC1C,EAAE,sBAAsB,MAAM,CAChC;;AAIA,MAAa,4BAA4BA,QAAAA,KAAK,OAC5C;CACE,OAAOA,QAAAA,KAAK,SAAS,iBAAiB;CACtC,cAAcA,QAAAA,KAAK,OAAO;EAAE,WAAW;EAAG,WAAW;CAAI,CAAC;CAC1D,MAAM;CACN,WAAWA,QAAAA,KAAK,OAAOA,QAAAA,KAAK,OAAO,GAAGA,QAAAA,KAAK,QAAQ,CAAC;AACtD,GACA,EAAE,sBAAsB,MAAM,CAChC;AAGA,MAAM,mBAAmB;CACvB,OAAO;CACP,YAAYA,QAAAA,KAAK,OAAO,EAAE,SAAS,EAAE,CAAC;AACxC;;AAGA,MAAa,4BAA4BA,QAAAA,KAAK,MAAM;CAClDA,QAAAA,KAAK,OAAO;EAAE,GAAG;E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N,YAAY;GACZ,OAAO;GACP,QAAQ,OAAO;IAAC;IAAW;IAAS;GAAa,CAAC;GAClD,QAAQ;EACV,CAAC,GACD,cACF,CAAC,CACH;EACA,KACE,uBACA,wBACAA,QAAAA,KAAK,OAAO,QAAQ,GACpBA,QAAAA,KAAK,OAAO;GACV,UAAU;GACV,QAAQ;GACR,cAAc;GACd,YAAY;GACZ,QAAQA,QAAAA,KAAK,MAAMA,QAAAA,KAAK,OAAO;IAAE,MAAM;IAAG,SAAS;IAAG,YAAY,EAAE,CAAC;GAAE,CAAC,CAAC;EAC3E,CAAC,CACH;EACA,KACE,uBACA,wBACAA,QAAAA,KAAK,OAAO;GAAE,GAAG;GAAU,iBAAiB;EAAE,CAAC,GAC/CA,QAAAA,KAAK,OAAO;GAAE,OAAO;GAAG,UAAUA,QAAAA,KAAK,QAAQ,QAAQ;GAAG,UAAU;GAAU,cAAc;EAAI,CAAC,CACnG;CACF;CACA,SAAU,CAAC,UAAU,WAAW,CAAC,CAAW,SAAS,UAAU;EAC7D;GACE,IAAI;GACJ;GACA,SAAS;GACT,QAAQ;GACR,MAAM;GACN,WAAW;GACX,aAAa;GACb,OAAO;GACP,QAAQA,QAAAA,KAAK,OAAO,CAAC,GAAG,EAAE,sBAAsB,MAAM,CAAC;EACzD;EACA;GACE,IAAI;GACJ;GACA,SAAS;GACT,QAAQ;GACR,MAAM;GACN,WAAW;GACX,aAAa;GACb,OAAO;EACT;EACA;GACE,IAAI;GACJ;GACA,SAAS;GACT,QAAQ;GACR,MAAM;GACN,WAAW;GACX,aAAa;GACb,OAAO;EACT;CACF,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Type } from "typebox";
|
|
2
|
+
//#region src/schemas/apiContracts.d.ts
|
|
3
|
+
export declare const apiContracts: {
|
|
4
|
+
version: 1;
|
|
5
|
+
protocols?: Record<string, string> | undefined;
|
|
6
|
+
schemas?: Record<string, boolean | object> | undefined;
|
|
7
|
+
http: {
|
|
8
|
+
id: string;
|
|
9
|
+
scope: "global" | "session" | "workspace";
|
|
10
|
+
basePath?: string | undefined;
|
|
11
|
+
path: string;
|
|
12
|
+
method: "DELETE" | "GET" | "HEAD" | "OPTIONS" | "PATCH" | "POST" | "PUT";
|
|
13
|
+
description: string;
|
|
14
|
+
availability?: string | undefined;
|
|
15
|
+
authentication: "device" | "none" | "owner";
|
|
16
|
+
parameters?: {
|
|
17
|
+
name: string;
|
|
18
|
+
in: "header" | "path" | "query";
|
|
19
|
+
required: boolean;
|
|
20
|
+
schema: boolean | object;
|
|
21
|
+
}[] | undefined;
|
|
22
|
+
body?: {
|
|
23
|
+
contentType: string;
|
|
24
|
+
contentTypes?: string[] | undefined;
|
|
25
|
+
required: boolean;
|
|
26
|
+
schema: boolean | object;
|
|
27
|
+
} | undefined;
|
|
28
|
+
responses: Record<string, {
|
|
29
|
+
description: string;
|
|
30
|
+
contentType?: string | undefined;
|
|
31
|
+
schema?: boolean | object | undefined;
|
|
32
|
+
events?: Record<string, boolean | object> | undefined;
|
|
33
|
+
}>;
|
|
34
|
+
}[];
|
|
35
|
+
sockets: {
|
|
36
|
+
id: string;
|
|
37
|
+
scope: "global" | "session" | "workspace";
|
|
38
|
+
description: string;
|
|
39
|
+
availability?: string | undefined;
|
|
40
|
+
service: string;
|
|
41
|
+
member: string;
|
|
42
|
+
direction: "client-to-server" | "server-to-client";
|
|
43
|
+
kind: "channel" | "method" | "state";
|
|
44
|
+
input: boolean | object;
|
|
45
|
+
output?: boolean | object | undefined;
|
|
46
|
+
errors?: boolean | object | undefined;
|
|
47
|
+
}[];
|
|
48
|
+
dynamic: string[];
|
|
49
|
+
gaps?: string[] | undefined;
|
|
50
|
+
};
|
|
51
|
+
//#endregion
|
|
52
|
+
export { apiContracts as default };
|
|
53
|
+
//# sourceMappingURL=apiContracts.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiContracts.d.mts","names":[],"sources":["../src/schemas/apiContracts.ts"],"mappings":";;qBA+Ea"}
|