@adecore/agent-contracts 0.54.2 → 0.54.3
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 +4 -2
- package/dist/model.js +6 -6
- package/dist/visual.js +5 -5
- package/package.json +3 -3
- package/src/model.ts +6 -6
- package/src/visual.ts +5 -5
package/README.md
CHANGED
|
@@ -31,8 +31,10 @@ The root exports everything. Each group also has a subpath of its own: `agent`,
|
|
|
31
31
|
| [Overview](https://adecore.dev/agent-contracts/) | Install, a first check and the entry points |
|
|
32
32
|
| [Protocol](https://adecore.dev/agent-contracts/protocol) | Frames, the request and event tables, replay and adding requests |
|
|
33
33
|
| [Conversation](https://adecore.dev/agent-contracts/conversation) | A chat's info and items, attachments, approvals, bookmarks and forks |
|
|
34
|
-
| [Providers and
|
|
35
|
-
| [
|
|
34
|
+
| [Providers and models](https://adecore.dev/agent-contracts/providers) | Agent kinds, model catalogs, capabilities and runtime modes |
|
|
35
|
+
| [Accounts](https://adecore.dev/agent-contracts/accounts) | Provider accounts and sign-ins |
|
|
36
|
+
| [Tasks and worktrees](https://adecore.dev/agent-contracts/tasks) | Tasks and worktrees |
|
|
37
|
+
| [Usage](https://adecore.dev/agent-contracts/usage) | Token totals, summaries and plan limits |
|
|
36
38
|
|
|
37
39
|
## License
|
|
38
40
|
|
package/dist/model.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { AgentKindSchema } from './agent.js';
|
|
3
|
-
// Options a model exposes (effort, context window, thinking). Generic descriptors
|
|
4
|
-
// per-provider enums
|
|
3
|
+
// Options a model exposes (effort, context window, thinking). Generic descriptors rather than
|
|
4
|
+
// per-provider enums, so a new model needs a catalog entry and no code change.
|
|
5
5
|
export const ModelOptionChoiceSchema = z.object({
|
|
6
6
|
id: z.string().min(1),
|
|
7
7
|
label: z.string(),
|
|
@@ -79,7 +79,7 @@ export const ModelCatalogDataSchema = z
|
|
|
79
79
|
// The thread's permission policy, one vocabulary for every provider; each adapter maps it.
|
|
80
80
|
export const RuntimeModeSchema = z.enum(['supervised', 'auto-accept-edits', 'auto', 'full-access']);
|
|
81
81
|
// What a provider's CLI can do, so a client never offers what it would drop and the daemon
|
|
82
|
-
// never asks for what the protocol has no room for.
|
|
82
|
+
// never asks for what the protocol has no room for.
|
|
83
83
|
export const ProviderCapabilitiesSchema = z.object({
|
|
84
84
|
// Where this CLI can be opened: as a chat node, as a terminal node, or both.
|
|
85
85
|
chat: z.boolean(),
|
|
@@ -169,9 +169,9 @@ export const ProviderListResultSchema = z.object({
|
|
|
169
169
|
providers: z.array(ProviderInfoSchema)
|
|
170
170
|
});
|
|
171
171
|
/*
|
|
172
|
-
* Fills a provider's resume template
|
|
173
|
-
* a word of its own
|
|
174
|
-
*
|
|
172
|
+
* Fills a provider's resume template and quotes the id, so a shell takes it as one word. `{flags}`
|
|
173
|
+
* must be a word of its own. It stands for zero or more words, so replacing it as a substring would
|
|
174
|
+
* leave a double space where a launch carries no flags.
|
|
175
175
|
*/
|
|
176
176
|
export function resumeCommandFor(template, agentSessionId, flags = []) {
|
|
177
177
|
const id = `'${agentSessionId.replaceAll("'", `'\\''`)}'`;
|
package/dist/visual.js
CHANGED
|
@@ -612,9 +612,9 @@ function hasViewport(html) {
|
|
|
612
612
|
return false;
|
|
613
613
|
}
|
|
614
614
|
/*
|
|
615
|
-
* The page with the bootstrap at the
|
|
616
|
-
* none, the theme and its base stylesheet, and the script that applies a theme, reports
|
|
617
|
-
* opens links outside the frame.
|
|
615
|
+
* The page with the bootstrap at the start of its head. The bootstrap holds a charset, a viewport when
|
|
616
|
+
* the page has none, the theme and its base stylesheet, and the script that applies a theme, reports
|
|
617
|
+
* the size and opens links outside the frame. The host writes it into the stored page once, at publish.
|
|
618
618
|
*/
|
|
619
619
|
export function injectVisualBootstrap(html) {
|
|
620
620
|
const place = bootstrapPlace(html);
|
|
@@ -647,7 +647,7 @@ window.parent.postMessage({ jsonrpc: '2.0', method: methods.ready }, '*');
|
|
|
647
647
|
* The sandbox host page: the first document of every frame a visual is drawn in, which an app serves
|
|
648
648
|
* as UTF-8 HTML with its policy as a header, on another origin or on its own behind a `sandbox`
|
|
649
649
|
* policy. It says it listens, becomes the first page its parent sends, once, and ignores every other
|
|
650
|
-
* message. The page runs in this
|
|
651
|
-
*
|
|
650
|
+
* message. The page runs in this same document, so it inherits the policy the host page was served
|
|
651
|
+
* with.
|
|
652
652
|
*/
|
|
653
653
|
export const VISUAL_HOST_PAGE = `<!doctype html>\n<html><head><meta charset="utf-8"><script>${hostPageScript()}</script></head><body></body></html>\n`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adecore/agent-contracts",
|
|
3
|
-
"version": "0.54.
|
|
3
|
+
"version": "0.54.3",
|
|
4
4
|
"description": "Schemas and port contracts for agent chats, provider accounts, models and usage.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
"test": "bun --conditions=source test"
|
|
82
82
|
},
|
|
83
83
|
"dependencies": {
|
|
84
|
-
"@adecore/intelligent-ui": "0.54.
|
|
85
|
-
"@adecore/utils": "0.54.
|
|
84
|
+
"@adecore/intelligent-ui": "0.54.3",
|
|
85
|
+
"@adecore/utils": "0.54.3",
|
|
86
86
|
"zod": "^4.6.7"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
package/src/model.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { AgentKindSchema, type AgentKind } from './agent.ts';
|
|
3
3
|
|
|
4
|
-
// Options a model exposes (effort, context window, thinking). Generic descriptors
|
|
5
|
-
// per-provider enums
|
|
4
|
+
// Options a model exposes (effort, context window, thinking). Generic descriptors rather than
|
|
5
|
+
// per-provider enums, so a new model needs a catalog entry and no code change.
|
|
6
6
|
export const ModelOptionChoiceSchema = z.object({
|
|
7
7
|
id: z.string().min(1),
|
|
8
8
|
label: z.string(),
|
|
@@ -97,7 +97,7 @@ export const RuntimeModeSchema = z.enum(['supervised', 'auto-accept-edits', 'aut
|
|
|
97
97
|
export type RuntimeMode = z.infer<typeof RuntimeModeSchema>;
|
|
98
98
|
|
|
99
99
|
// What a provider's CLI can do, so a client never offers what it would drop and the daemon
|
|
100
|
-
// never asks for what the protocol has no room for.
|
|
100
|
+
// never asks for what the protocol has no room for.
|
|
101
101
|
export const ProviderCapabilitiesSchema = z.object({
|
|
102
102
|
// Where this CLI can be opened: as a chat node, as a terminal node, or both.
|
|
103
103
|
chat: z.boolean(),
|
|
@@ -217,9 +217,9 @@ export const ProviderListResultSchema = z.object({
|
|
|
217
217
|
export type ProviderListResult = z.infer<typeof ProviderListResultSchema>;
|
|
218
218
|
|
|
219
219
|
/*
|
|
220
|
-
* Fills a provider's resume template
|
|
221
|
-
* a word of its own
|
|
222
|
-
*
|
|
220
|
+
* Fills a provider's resume template and quotes the id, so a shell takes it as one word. `{flags}`
|
|
221
|
+
* must be a word of its own. It stands for zero or more words, so replacing it as a substring would
|
|
222
|
+
* leave a double space where a launch carries no flags.
|
|
223
223
|
*/
|
|
224
224
|
export function resumeCommandFor(template: string, agentSessionId: string, flags: string[] = []): string {
|
|
225
225
|
const id = `'${agentSessionId.replaceAll("'", `'\\''`)}'`;
|
package/src/visual.ts
CHANGED
|
@@ -757,9 +757,9 @@ function hasViewport(html: string): boolean {
|
|
|
757
757
|
}
|
|
758
758
|
|
|
759
759
|
/*
|
|
760
|
-
* The page with the bootstrap at the
|
|
761
|
-
* none, the theme and its base stylesheet, and the script that applies a theme, reports
|
|
762
|
-
* opens links outside the frame.
|
|
760
|
+
* The page with the bootstrap at the start of its head. The bootstrap holds a charset, a viewport when
|
|
761
|
+
* the page has none, the theme and its base stylesheet, and the script that applies a theme, reports
|
|
762
|
+
* the size and opens links outside the frame. The host writes it into the stored page once, at publish.
|
|
763
763
|
*/
|
|
764
764
|
export function injectVisualBootstrap(html: string): string {
|
|
765
765
|
const place = bootstrapPlace(html);
|
|
@@ -796,7 +796,7 @@ window.parent.postMessage({ jsonrpc: '2.0', method: methods.ready }, '*');
|
|
|
796
796
|
* The sandbox host page: the first document of every frame a visual is drawn in, which an app serves
|
|
797
797
|
* as UTF-8 HTML with its policy as a header, on another origin or on its own behind a `sandbox`
|
|
798
798
|
* policy. It says it listens, becomes the first page its parent sends, once, and ignores every other
|
|
799
|
-
* message. The page runs in this
|
|
800
|
-
*
|
|
799
|
+
* message. The page runs in this same document, so it inherits the policy the host page was served
|
|
800
|
+
* with.
|
|
801
801
|
*/
|
|
802
802
|
export const VISUAL_HOST_PAGE = `<!doctype html>\n<html><head><meta charset="utf-8"><script>${hostPageScript()}</script></head><body></body></html>\n`;
|