@openchamber/sdk 2.5.0 → 2.5.2
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/API.md +33 -4
- package/DOCUMENTATION.md +41 -7
- package/GUEST_SERVICES.md +129 -3
- package/dist/index.d.ts +7 -5
- package/dist/index.js +3 -2
- package/dist/manifest.d.ts +188 -5
- package/dist/manifest.js +39 -5
- package/dist/parse.d.ts +230 -2
- package/dist/parse.js +198 -7
- package/dist/protocol.d.ts +30 -0
- package/dist/schemas.d.ts +2 -1
- package/dist/schemas.js +2 -1
- package/dist/service-provider-schemas.d.ts +510 -0
- package/dist/service-provider-schemas.js +221 -1
- package/dist/service-providers.d.ts +377 -2
- package/dist/service-providers.js +216 -0
- package/dist/status-view-schemas.d.ts +166 -0
- package/dist/status-view-schemas.js +113 -0
- package/dist/status-view.d.ts +129 -0
- package/dist/status-view.js +15 -0
- package/dist/ui/style.js +16 -9
- package/dist/workspace-schemas.d.ts +9 -0
- package/dist/workspace-schemas.js +1 -0
- package/dist/workspace.d.ts +13 -0
- package/package.json +2 -2
package/dist/ui/style.js
CHANGED
|
@@ -61,9 +61,14 @@ const focusFill = `background-image: linear-gradient(${hover}, ${hover});`;
|
|
|
61
61
|
* top line and one short shadow, and wash a field halfway toward the page so it
|
|
62
62
|
* sits a tone below the buttons beside it. Without the attribute (a preview
|
|
63
63
|
* outside the host) the light form applies.
|
|
64
|
+
*
|
|
65
|
+
* Buttons, triggers, tabs and popups keep a 1px border in their geometry so a
|
|
66
|
+
* tinted variant, whose border is coloured, has the same size. Their hairline
|
|
67
|
+
* is that border: an inset ring would paint inside it, 1px in from the edge,
|
|
68
|
+
* with a strip of fill around it. Fields have no border and keep the ring.
|
|
64
69
|
*/
|
|
65
70
|
const field = (edge) => `box-shadow: inset 0 0 0 1px ${edge}, var(--oc-sdk-field-lift);`;
|
|
66
|
-
const raised = '
|
|
71
|
+
const raised = 'border-color: var(--oc-sdk-edge); box-shadow: var(--oc-sdk-raised-lift);';
|
|
67
72
|
const litButton = 'box-shadow: var(--oc-sdk-lit);';
|
|
68
73
|
const darkLift = `inset 0 1px 0 0 ${mix(fg, 1.5)}, 0 1px 1px 0 rgb(0 0 0 / 0.28), 0 2px 3px -2px rgb(0 0 0 / 0.2)`;
|
|
69
74
|
const THEME_VARS = `
|
|
@@ -74,7 +79,8 @@ const THEME_VARS = `
|
|
|
74
79
|
--oc-sdk-field-lift: inset 0 1px 2px 0 rgb(0 0 0 / 0.04);
|
|
75
80
|
--oc-sdk-raised-lift: 0 1px 2px 0 rgb(0 0 0 / 0.06);
|
|
76
81
|
--oc-sdk-lit: inset 0 1px 0 0 rgb(255 255 255 / 0.45), 0 1px 2px 0 rgb(0 0 0 / 0.08);
|
|
77
|
-
--oc-sdk-float:
|
|
82
|
+
--oc-sdk-float-edge: rgb(0 0 0 / 0.1);
|
|
83
|
+
--oc-sdk-float: inset 0 1px 0 0 rgb(255 255 255 / 0.8), inset 0 0 0 1px rgb(0 0 0 / 0.04), 0 1px 2px -0.5px rgb(0 0 0 / 0.08), 0 4px 8px -2px rgb(0 0 0 / 0.08), 0 12px 20px -4px rgb(0 0 0 / 0.08);
|
|
78
84
|
}
|
|
79
85
|
:root[data-oc-theme="dark"] {
|
|
80
86
|
--oc-sdk-edge: ${mix(fg, 6)};
|
|
@@ -83,7 +89,8 @@ const THEME_VARS = `
|
|
|
83
89
|
--oc-sdk-field-lift: ${darkLift};
|
|
84
90
|
--oc-sdk-raised-lift: ${darkLift};
|
|
85
91
|
--oc-sdk-lit: inset 0 1px 0 0 ${mix(fg, 1.5)}, 0 1px 1px 0 rgb(0 0 0 / 0.28), 0 2px 3px -2px rgb(0 0 0 / 0.2);
|
|
86
|
-
--oc-sdk-float:
|
|
92
|
+
--oc-sdk-float-edge: rgb(0 0 0 / 0.36);
|
|
93
|
+
--oc-sdk-float: inset 0 1px 0 0 rgb(255 255 255 / 0.06), inset 0 0 0 1px rgb(255 255 255 / 0.08), 0 1px 1px -0.5px rgb(0 0 0 / 0.22), 0 3px 3px -1.5px rgb(0 0 0 / 0.2), 0 6px 6px -3px rgb(0 0 0 / 0.16);
|
|
87
94
|
}`;
|
|
88
95
|
const tone = (name) => {
|
|
89
96
|
const color = v(`status-${name}`, 'currentColor');
|
|
@@ -216,9 +223,9 @@ ${tone('success')}${tone('warning')}${tone('error')}${tone('info')}
|
|
|
216
223
|
.oc-sdk-btn[data-variant="secondary"] { background: ${secondary}; color: var(--oc-fg); }
|
|
217
224
|
.oc-sdk-btn[data-variant="secondary"]:hover { background-image: linear-gradient(${hover}, ${hover}); }
|
|
218
225
|
.oc-sdk-btn[data-variant="secondary"]:active { background-image: linear-gradient(${active}, ${active}); }
|
|
219
|
-
.oc-sdk-btn[data-variant="outline"] { background: var(--oc-sdk-raised-bg); color: ${elevatedFg};
|
|
226
|
+
.oc-sdk-btn[data-variant="outline"] { background: var(--oc-sdk-raised-bg); color: ${elevatedFg}; ${raised} }
|
|
220
227
|
.oc-sdk-btn[data-variant="outline"]:hover { background-image: linear-gradient(${hover}, ${hover}); }
|
|
221
|
-
.oc-sdk-btn[data-variant="outline"]:active { background-image: linear-gradient(${active}, ${active}); box-shadow:
|
|
228
|
+
.oc-sdk-btn[data-variant="outline"]:active { background-image: linear-gradient(${active}, ${active}); box-shadow: none; }
|
|
222
229
|
.oc-sdk-btn[data-variant="ghost"] { background: transparent; }
|
|
223
230
|
.oc-sdk-btn[data-variant="ghost"]:hover { background: ${hover}; }
|
|
224
231
|
.oc-sdk-btn[data-variant="ghost"]:active { background: ${active}; }
|
|
@@ -240,13 +247,13 @@ ${tone('success')}${tone('warning')}${tone('error')}${tone('info')}
|
|
|
240
247
|
.oc-sdk-search-clear { border-radius: ${smallRadius}; color: ${muted}; }
|
|
241
248
|
.oc-sdk-search-clear:hover { background: ${hover}; color: ${fg}; }
|
|
242
249
|
|
|
243
|
-
.oc-sdk-trigger { border-
|
|
250
|
+
.oc-sdk-trigger { border-radius: ${controlRadius}; background: var(--oc-sdk-raised-bg); color: ${elevatedFg}; ${raised} transition: background 150ms ease-out; }
|
|
244
251
|
.oc-sdk-trigger:hover { background-image: linear-gradient(${hover}, ${hover}); }
|
|
245
252
|
.oc-sdk-trigger[aria-expanded="true"] { background-image: linear-gradient(${active}, ${active}); }
|
|
246
253
|
.oc-sdk-trigger-value[data-empty="true"] { color: ${muted}; }
|
|
247
254
|
.oc-sdk-trigger-chevron { color: ${muted}; }
|
|
248
|
-
/* The app's dropdown light: lit top, hairline rings and a layered shadow,
|
|
249
|
-
.oc-sdk-popup { --surface-foreground: ${elevatedFg}; border-color:
|
|
255
|
+
/* The app's dropdown light: lit top, hairline rings and a layered shadow. Its outer ring is the border, over the page like the app's. */
|
|
256
|
+
.oc-sdk-popup { --surface-foreground: ${elevatedFg}; border-color: var(--oc-sdk-float-edge); border-radius: 12px; background: ${elevated}; background-clip: padding-box; color: ${elevatedFg}; box-shadow: var(--oc-sdk-float); }
|
|
250
257
|
.oc-sdk-option { border-radius: 8px; }
|
|
251
258
|
.oc-sdk-option[data-active="true"] { background: ${hover}; }
|
|
252
259
|
/* A selected option shows a check mark in the text colour, like the app's own pickers. Options without the mark come
|
|
@@ -274,7 +281,7 @@ ${tone('success')}${tone('warning')}${tone('error')}${tone('info')}
|
|
|
274
281
|
.oc-sdk-tab { border-radius: 8px; color: ${muted}; transition: color 150ms ease-out, background 150ms ease-out; }
|
|
275
282
|
.oc-sdk-tab:hover { color: ${fg}; }
|
|
276
283
|
.oc-sdk-tab[aria-selected="true"] { color: ${selectionFg}; background: ${selection}; border-color: ${border}; }
|
|
277
|
-
.oc-sdk-tabs[data-track="true"] .oc-sdk-tab[aria-selected="true"] { color: ${elevatedFg}; background: var(--oc-sdk-raised-bg);
|
|
284
|
+
.oc-sdk-tabs[data-track="true"] .oc-sdk-tab[aria-selected="true"] { color: ${elevatedFg}; background: var(--oc-sdk-raised-bg); ${raised} }
|
|
278
285
|
.oc-sdk-tab-count { color: ${muted}; }
|
|
279
286
|
|
|
280
287
|
.oc-sdk-badge { border-radius: 9999px; background: ${hover}; color: ${muted}; }
|
|
@@ -91,6 +91,15 @@ export declare const guestWorkspaceSnapshotSchema: z.ZodDiscriminatedUnion<[z.Zo
|
|
|
91
91
|
id: z.ZodString;
|
|
92
92
|
data: z.ZodOptional<z.ZodJSONSchema>;
|
|
93
93
|
}, z.core.$strip>>;
|
|
94
|
+
links: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
95
|
+
title: z.ZodString;
|
|
96
|
+
url: z.ZodString;
|
|
97
|
+
kind: z.ZodEnum<{
|
|
98
|
+
change: "change";
|
|
99
|
+
issue: "issue";
|
|
100
|
+
}>;
|
|
101
|
+
linkedAt: z.ZodNumber;
|
|
102
|
+
}, z.core.$strip>>>;
|
|
94
103
|
}, z.core.$strip>>;
|
|
95
104
|
}, z.core.$strip>], "kind">;
|
|
96
105
|
export declare const guestSessionWorktreeSchema: z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
@@ -21,6 +21,7 @@ export const guestWorkspaceSnapshotSchema = z.discriminatedUnion('kind', [
|
|
|
21
21
|
createdAt: z.number(), updatedAt: z.number(), archivedAt: z.number().nullable(), worktree: worktree.nullable(),
|
|
22
22
|
activity: z.enum(['unknown', 'idle', 'running', 'retrying', 'waiting-permission', 'waiting-question']),
|
|
23
23
|
outcome: z.enum(['completed', 'failed']).nullable(), items: z.array(z.object({ id: identity, data: z.json().optional() })),
|
|
24
|
+
links: z.array(z.object({ title: z.string(), url: z.string(), kind: z.enum(['issue', 'change']), linkedAt: z.number() })).optional(),
|
|
24
25
|
})),
|
|
25
26
|
}),
|
|
26
27
|
]);
|
package/dist/workspace.d.ts
CHANGED
|
@@ -13,6 +13,17 @@ export type GuestWorktree = {
|
|
|
13
13
|
};
|
|
14
14
|
/** `waiting-question` means the agent is waiting on an answer — a form it put to the user. */
|
|
15
15
|
export type GuestSessionActivity = 'unknown' | 'idle' | 'running' | 'retrying' | 'waiting-permission' | 'waiting-question';
|
|
16
|
+
/**
|
|
17
|
+
* A thread linked to a session, by whoever linked it: the user, the agent
|
|
18
|
+
* (`session.link`), this extension or another. `change` is a code change
|
|
19
|
+
* under review (a pull, merge or change request).
|
|
20
|
+
*/
|
|
21
|
+
export type GuestSessionLink = {
|
|
22
|
+
title: string;
|
|
23
|
+
url: string;
|
|
24
|
+
kind: 'issue' | 'change';
|
|
25
|
+
linkedAt: number;
|
|
26
|
+
};
|
|
16
27
|
export type GuestSessionRecord = {
|
|
17
28
|
id: string;
|
|
18
29
|
title: string;
|
|
@@ -30,6 +41,8 @@ export type GuestSessionRecord = {
|
|
|
30
41
|
id: string;
|
|
31
42
|
data?: JsonValue;
|
|
32
43
|
}[];
|
|
44
|
+
/** Every link on the session, read-only. Absent from hosts older than this field. */
|
|
45
|
+
links?: GuestSessionLink[];
|
|
33
46
|
};
|
|
34
47
|
export type GuestDirectoryCoverage = {
|
|
35
48
|
directory: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openchamber/sdk",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.2",
|
|
4
4
|
"description": "Contract for OpenChamber guests: manifest parse and iframe host bridge.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"build": "tsc -p tsconfig.build.json",
|
|
37
|
-
"type-check": "
|
|
37
|
+
"type-check": "bun check",
|
|
38
38
|
"lint": "oxlint -c ../../oxlint.config.ts --report-unused-disable-directives src examples",
|
|
39
39
|
"bundle": "bun scripts/bundle-guest.ts",
|
|
40
40
|
"test": "node ../../scripts/run-isolated-tests.mjs src scripts",
|