@xemahq/kernel-contracts 0.2.3 → 0.3.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/dist/agent-workspace/awp-spec.json +1 -1
- package/dist/widget/index.d.ts +5 -0
- package/dist/widget/index.d.ts.map +1 -0
- package/dist/widget/index.js +21 -0
- package/dist/widget/index.js.map +1 -0
- package/dist/widget/lib/chat-widget-envelope.d.ts +13 -0
- package/dist/widget/lib/chat-widget-envelope.d.ts.map +1 -0
- package/dist/widget/lib/chat-widget-envelope.js +16 -0
- package/dist/widget/lib/chat-widget-envelope.js.map +1 -0
- package/dist/widget/lib/chat-widget-kind.d.ts +16 -0
- package/dist/widget/lib/chat-widget-kind.d.ts.map +1 -0
- package/dist/widget/lib/chat-widget-kind.js +21 -0
- package/dist/widget/lib/chat-widget-kind.js.map +1 -0
- package/dist/widget/lib/chat-widget-payloads.d.ts +72 -0
- package/dist/widget/lib/chat-widget-payloads.d.ts.map +1 -0
- package/dist/widget/lib/chat-widget-payloads.js +69 -0
- package/dist/widget/lib/chat-widget-payloads.js.map +1 -0
- package/dist/widget/lib/widget-contribution.d.ts +24 -0
- package/dist/widget/lib/widget-contribution.d.ts.map +1 -0
- package/dist/widget/lib/widget-contribution.js +23 -0
- package/dist/widget/lib/widget-contribution.js.map +1 -0
- package/package.json +18 -18
- package/src/widget/index.ts +4 -0
- package/src/widget/lib/chat-widget-envelope.ts +41 -0
- package/src/widget/lib/chat-widget-kind.ts +51 -0
- package/src/widget/lib/chat-widget-payloads.ts +130 -0
- package/src/widget/lib/widget-contribution.ts +94 -0
- package/LICENSE +0 -201
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/widget/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./lib/chat-widget-kind"), exports);
|
|
18
|
+
__exportStar(require("./lib/chat-widget-payloads"), exports);
|
|
19
|
+
__exportStar(require("./lib/chat-widget-envelope"), exports);
|
|
20
|
+
__exportStar(require("./lib/widget-contribution"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/widget/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,6DAA2C;AAC3C,6DAA2C;AAC3C,4DAA0C"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export interface ChatWidgetEnvelope {
|
|
3
|
+
readonly kind: string;
|
|
4
|
+
readonly version: number;
|
|
5
|
+
readonly payload: unknown;
|
|
6
|
+
}
|
|
7
|
+
export declare const ChatWidgetEnvelopeSchema: z.ZodType<ChatWidgetEnvelope>;
|
|
8
|
+
export declare enum ChatWidgetFallbackReason {
|
|
9
|
+
UnknownKind = "unknown-kind",
|
|
10
|
+
InvalidPayload = "invalid-payload",
|
|
11
|
+
UnsupportedVersion = "unsupported-version"
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=chat-widget-envelope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-widget-envelope.d.ts","sourceRoot":"","sources":["../../../src/widget/lib/chat-widget-envelope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkBxB,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAGD,eAAO,MAAM,wBAAwB,EAAE,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAIjE,CAAC;AAOH,oBAAY,wBAAwB;IAClC,WAAW,iBAAiB;IAC5B,cAAc,oBAAoB;IAClC,kBAAkB,wBAAwB;CAC3C"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChatWidgetFallbackReason = exports.ChatWidgetEnvelopeSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.ChatWidgetEnvelopeSchema = zod_1.z.object({
|
|
6
|
+
kind: zod_1.z.string().min(1),
|
|
7
|
+
version: zod_1.z.number().int().positive(),
|
|
8
|
+
payload: zod_1.z.unknown(),
|
|
9
|
+
});
|
|
10
|
+
var ChatWidgetFallbackReason;
|
|
11
|
+
(function (ChatWidgetFallbackReason) {
|
|
12
|
+
ChatWidgetFallbackReason["UnknownKind"] = "unknown-kind";
|
|
13
|
+
ChatWidgetFallbackReason["InvalidPayload"] = "invalid-payload";
|
|
14
|
+
ChatWidgetFallbackReason["UnsupportedVersion"] = "unsupported-version";
|
|
15
|
+
})(ChatWidgetFallbackReason || (exports.ChatWidgetFallbackReason = ChatWidgetFallbackReason = {}));
|
|
16
|
+
//# sourceMappingURL=chat-widget-envelope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-widget-envelope.js","sourceRoot":"","sources":["../../../src/widget/lib/chat-widget-envelope.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAyBX,QAAA,wBAAwB,GAAkC,OAAC,CAAC,MAAM,CAAC;IAC9E,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACpC,OAAO,EAAE,OAAC,CAAC,OAAO,EAAE;CACrB,CAAC,CAAC;AAOH,IAAY,wBAIX;AAJD,WAAY,wBAAwB;IAClC,wDAA4B,CAAA;IAC5B,8DAAkC,CAAA;IAClC,sEAA0C,CAAA;AAC5C,CAAC,EAJW,wBAAwB,wCAAxB,wBAAwB,QAInC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare enum ChatWidgetKind {
|
|
3
|
+
Plan = "plan",
|
|
4
|
+
Diff = "diff",
|
|
5
|
+
Approval = "approval",
|
|
6
|
+
Table = "table",
|
|
7
|
+
Chart = "chart",
|
|
8
|
+
FileEdit = "file-edit"
|
|
9
|
+
}
|
|
10
|
+
export declare const ChatWidgetKindSchema: z.ZodEnum<typeof ChatWidgetKind>;
|
|
11
|
+
export declare enum ChatChartKind {
|
|
12
|
+
Bar = "bar",
|
|
13
|
+
Line = "line"
|
|
14
|
+
}
|
|
15
|
+
export declare const ChatChartKindSchema: z.ZodEnum<typeof ChatChartKind>;
|
|
16
|
+
//# sourceMappingURL=chat-widget-kind.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-widget-kind.d.ts","sourceRoot":"","sources":["../../../src/widget/lib/chat-widget-kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAuBxB,oBAAY,cAAc;IAExB,IAAI,SAAS;IAEb,IAAI,SAAS;IAEb,QAAQ,aAAa;IAErB,KAAK,UAAU;IAEf,KAAK,UAAU;IAEf,QAAQ,cAAc;CACvB;AAGD,eAAO,MAAM,oBAAoB,kCAA+B,CAAC;AAMjE,oBAAY,aAAa;IACvB,GAAG,QAAQ;IACX,IAAI,SAAS;CACd;AAED,eAAO,MAAM,mBAAmB,iCAA8B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChatChartKindSchema = exports.ChatChartKind = exports.ChatWidgetKindSchema = exports.ChatWidgetKind = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var ChatWidgetKind;
|
|
6
|
+
(function (ChatWidgetKind) {
|
|
7
|
+
ChatWidgetKind["Plan"] = "plan";
|
|
8
|
+
ChatWidgetKind["Diff"] = "diff";
|
|
9
|
+
ChatWidgetKind["Approval"] = "approval";
|
|
10
|
+
ChatWidgetKind["Table"] = "table";
|
|
11
|
+
ChatWidgetKind["Chart"] = "chart";
|
|
12
|
+
ChatWidgetKind["FileEdit"] = "file-edit";
|
|
13
|
+
})(ChatWidgetKind || (exports.ChatWidgetKind = ChatWidgetKind = {}));
|
|
14
|
+
exports.ChatWidgetKindSchema = zod_1.z.nativeEnum(ChatWidgetKind);
|
|
15
|
+
var ChatChartKind;
|
|
16
|
+
(function (ChatChartKind) {
|
|
17
|
+
ChatChartKind["Bar"] = "bar";
|
|
18
|
+
ChatChartKind["Line"] = "line";
|
|
19
|
+
})(ChatChartKind || (exports.ChatChartKind = ChatChartKind = {}));
|
|
20
|
+
exports.ChatChartKindSchema = zod_1.z.nativeEnum(ChatChartKind);
|
|
21
|
+
//# sourceMappingURL=chat-widget-kind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-widget-kind.js","sourceRoot":"","sources":["../../../src/widget/lib/chat-widget-kind.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAuBxB,IAAY,cAaX;AAbD,WAAY,cAAc;IAExB,+BAAa,CAAA;IAEb,+BAAa,CAAA;IAEb,uCAAqB,CAAA;IAErB,iCAAe,CAAA;IAEf,iCAAe,CAAA;IAEf,wCAAsB,CAAA;AACxB,CAAC,EAbW,cAAc,8BAAd,cAAc,QAazB;AAGY,QAAA,oBAAoB,GAAG,OAAC,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;AAMjE,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,4BAAW,CAAA;IACX,8BAAa,CAAA;AACf,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB;AAEY,QAAA,mBAAmB,GAAG,OAAC,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ChatWidgetKind } from './chat-widget-kind';
|
|
3
|
+
export declare enum WidgetTodoState {
|
|
4
|
+
Todo = "todo",
|
|
5
|
+
Active = "active",
|
|
6
|
+
Done = "done"
|
|
7
|
+
}
|
|
8
|
+
export declare const WidgetTodoStateSchema: z.ZodEnum<typeof WidgetTodoState>;
|
|
9
|
+
export declare const PlanWidgetItemSchema: z.ZodObject<{
|
|
10
|
+
label: z.ZodString;
|
|
11
|
+
state: z.ZodEnum<typeof WidgetTodoState>;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
export declare const PlanWidgetPayloadSchema: z.ZodObject<{
|
|
14
|
+
title: z.ZodOptional<z.ZodString>;
|
|
15
|
+
items: z.ZodArray<z.ZodObject<{
|
|
16
|
+
label: z.ZodString;
|
|
17
|
+
state: z.ZodEnum<typeof WidgetTodoState>;
|
|
18
|
+
}, z.core.$strip>>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
export type PlanWidgetPayload = z.infer<typeof PlanWidgetPayloadSchema>;
|
|
21
|
+
export declare const DiffWidgetPayloadSchema: z.ZodObject<{
|
|
22
|
+
path: z.ZodString;
|
|
23
|
+
add: z.ZodNumber;
|
|
24
|
+
del: z.ZodNumber;
|
|
25
|
+
hunks: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export type DiffWidgetPayload = z.infer<typeof DiffWidgetPayloadSchema>;
|
|
28
|
+
export declare const FileEditWidgetPayloadSchema: z.ZodObject<{
|
|
29
|
+
path: z.ZodString;
|
|
30
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
31
|
+
add: z.ZodNumber;
|
|
32
|
+
del: z.ZodNumber;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
export type FileEditWidgetPayload = z.infer<typeof FileEditWidgetPayloadSchema>;
|
|
35
|
+
export declare const ApprovalWidgetPayloadSchema: z.ZodObject<{
|
|
36
|
+
sessionId: z.ZodString;
|
|
37
|
+
accent: z.ZodOptional<z.ZodString>;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
export type ApprovalWidgetPayload = z.infer<typeof ApprovalWidgetPayloadSchema>;
|
|
40
|
+
export declare const TableWidgetColumnSchema: z.ZodObject<{
|
|
41
|
+
key: z.ZodString;
|
|
42
|
+
label: z.ZodString;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
export declare const TableWidgetPayloadSchema: z.ZodObject<{
|
|
45
|
+
columns: z.ZodArray<z.ZodObject<{
|
|
46
|
+
key: z.ZodString;
|
|
47
|
+
label: z.ZodString;
|
|
48
|
+
}, z.core.$strip>>;
|
|
49
|
+
rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
export type TableWidgetPayload = z.infer<typeof TableWidgetPayloadSchema>;
|
|
52
|
+
export declare const ChartWidgetSeriesSchema: z.ZodObject<{
|
|
53
|
+
label: z.ZodString;
|
|
54
|
+
points: z.ZodArray<z.ZodObject<{
|
|
55
|
+
x: z.ZodString;
|
|
56
|
+
y: z.ZodNumber;
|
|
57
|
+
}, z.core.$strip>>;
|
|
58
|
+
}, z.core.$strip>;
|
|
59
|
+
export declare const ChartWidgetPayloadSchema: z.ZodObject<{
|
|
60
|
+
kind: z.ZodEnum<typeof import("./chat-widget-kind").ChatChartKind>;
|
|
61
|
+
series: z.ZodArray<z.ZodObject<{
|
|
62
|
+
label: z.ZodString;
|
|
63
|
+
points: z.ZodArray<z.ZodObject<{
|
|
64
|
+
x: z.ZodString;
|
|
65
|
+
y: z.ZodNumber;
|
|
66
|
+
}, z.core.$strip>>;
|
|
67
|
+
}, z.core.$strip>>;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
export type ChartWidgetPayload = z.infer<typeof ChartWidgetPayloadSchema>;
|
|
70
|
+
export declare const FIRST_PARTY_WIDGET_PAYLOAD_SCHEMAS: Readonly<Record<ChatWidgetKind, z.ZodTypeAny>>;
|
|
71
|
+
export declare const FIRST_PARTY_WIDGET_VERSIONS: Readonly<Record<ChatWidgetKind, number>>;
|
|
72
|
+
//# sourceMappingURL=chat-widget-payloads.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-widget-payloads.d.ts","sourceRoot":"","sources":["../../../src/widget/lib/chat-widget-payloads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAuB,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAkBzE,oBAAY,eAAe;IACzB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,IAAI,SAAS;CACd;AACD,eAAO,MAAM,qBAAqB,mCAAgC,CAAC;AAGnE,eAAO,MAAM,oBAAoB;;;iBAG/B,CAAC;AAGH,eAAO,MAAM,uBAAuB;;;;;;iBAGlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAMxE,eAAO,MAAM,uBAAuB;;;;;iBAKlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAGxE,eAAO,MAAM,2BAA2B;;;;;iBAKtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAOhF,eAAO,MAAM,2BAA2B;;;iBAGtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAGhF,eAAO,MAAM,uBAAuB;;;iBAGlC,CAAC;AAGH,eAAO,MAAM,wBAAwB;;;;;;iBAGnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAG1E,eAAO,MAAM,uBAAuB;;;;;;iBAGlC,CAAC;AAGH,eAAO,MAAM,wBAAwB;;;;;;;;;iBAGnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAQ1E,eAAO,MAAM,kCAAkC,EAAE,QAAQ,CACvD,MAAM,CAAC,cAAc,EAAE,CAAC,CAAC,UAAU,CAAC,CAQrC,CAAC;AAOF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAChD,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAQ/B,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FIRST_PARTY_WIDGET_VERSIONS = exports.FIRST_PARTY_WIDGET_PAYLOAD_SCHEMAS = exports.ChartWidgetPayloadSchema = exports.ChartWidgetSeriesSchema = exports.TableWidgetPayloadSchema = exports.TableWidgetColumnSchema = exports.ApprovalWidgetPayloadSchema = exports.FileEditWidgetPayloadSchema = exports.DiffWidgetPayloadSchema = exports.PlanWidgetPayloadSchema = exports.PlanWidgetItemSchema = exports.WidgetTodoStateSchema = exports.WidgetTodoState = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const chat_widget_kind_1 = require("./chat-widget-kind");
|
|
6
|
+
var WidgetTodoState;
|
|
7
|
+
(function (WidgetTodoState) {
|
|
8
|
+
WidgetTodoState["Todo"] = "todo";
|
|
9
|
+
WidgetTodoState["Active"] = "active";
|
|
10
|
+
WidgetTodoState["Done"] = "done";
|
|
11
|
+
})(WidgetTodoState || (exports.WidgetTodoState = WidgetTodoState = {}));
|
|
12
|
+
exports.WidgetTodoStateSchema = zod_1.z.nativeEnum(WidgetTodoState);
|
|
13
|
+
exports.PlanWidgetItemSchema = zod_1.z.object({
|
|
14
|
+
label: zod_1.z.string().min(1),
|
|
15
|
+
state: exports.WidgetTodoStateSchema,
|
|
16
|
+
});
|
|
17
|
+
exports.PlanWidgetPayloadSchema = zod_1.z.object({
|
|
18
|
+
title: zod_1.z.string().optional(),
|
|
19
|
+
items: zod_1.z.array(exports.PlanWidgetItemSchema),
|
|
20
|
+
});
|
|
21
|
+
exports.DiffWidgetPayloadSchema = zod_1.z.object({
|
|
22
|
+
path: zod_1.z.string().min(1),
|
|
23
|
+
add: zod_1.z.number(),
|
|
24
|
+
del: zod_1.z.number(),
|
|
25
|
+
hunks: zod_1.z.array(zod_1.z.string()).optional(),
|
|
26
|
+
});
|
|
27
|
+
exports.FileEditWidgetPayloadSchema = zod_1.z.object({
|
|
28
|
+
path: zod_1.z.string().min(1),
|
|
29
|
+
summary: zod_1.z.string().optional(),
|
|
30
|
+
add: zod_1.z.number(),
|
|
31
|
+
del: zod_1.z.number(),
|
|
32
|
+
});
|
|
33
|
+
exports.ApprovalWidgetPayloadSchema = zod_1.z.object({
|
|
34
|
+
sessionId: zod_1.z.string().min(1),
|
|
35
|
+
accent: zod_1.z.string().optional(),
|
|
36
|
+
});
|
|
37
|
+
exports.TableWidgetColumnSchema = zod_1.z.object({
|
|
38
|
+
key: zod_1.z.string().min(1),
|
|
39
|
+
label: zod_1.z.string().min(1),
|
|
40
|
+
});
|
|
41
|
+
exports.TableWidgetPayloadSchema = zod_1.z.object({
|
|
42
|
+
columns: zod_1.z.array(exports.TableWidgetColumnSchema),
|
|
43
|
+
rows: zod_1.z.array(zod_1.z.record(zod_1.z.string(), zod_1.z.union([zod_1.z.string(), zod_1.z.number()]))),
|
|
44
|
+
});
|
|
45
|
+
exports.ChartWidgetSeriesSchema = zod_1.z.object({
|
|
46
|
+
label: zod_1.z.string().min(1),
|
|
47
|
+
points: zod_1.z.array(zod_1.z.object({ x: zod_1.z.string(), y: zod_1.z.number() })),
|
|
48
|
+
});
|
|
49
|
+
exports.ChartWidgetPayloadSchema = zod_1.z.object({
|
|
50
|
+
kind: chat_widget_kind_1.ChatChartKindSchema,
|
|
51
|
+
series: zod_1.z.array(exports.ChartWidgetSeriesSchema),
|
|
52
|
+
});
|
|
53
|
+
exports.FIRST_PARTY_WIDGET_PAYLOAD_SCHEMAS = {
|
|
54
|
+
[chat_widget_kind_1.ChatWidgetKind.Plan]: exports.PlanWidgetPayloadSchema,
|
|
55
|
+
[chat_widget_kind_1.ChatWidgetKind.Diff]: exports.DiffWidgetPayloadSchema,
|
|
56
|
+
[chat_widget_kind_1.ChatWidgetKind.Approval]: exports.ApprovalWidgetPayloadSchema,
|
|
57
|
+
[chat_widget_kind_1.ChatWidgetKind.Table]: exports.TableWidgetPayloadSchema,
|
|
58
|
+
[chat_widget_kind_1.ChatWidgetKind.Chart]: exports.ChartWidgetPayloadSchema,
|
|
59
|
+
[chat_widget_kind_1.ChatWidgetKind.FileEdit]: exports.FileEditWidgetPayloadSchema,
|
|
60
|
+
};
|
|
61
|
+
exports.FIRST_PARTY_WIDGET_VERSIONS = {
|
|
62
|
+
[chat_widget_kind_1.ChatWidgetKind.Plan]: 1,
|
|
63
|
+
[chat_widget_kind_1.ChatWidgetKind.Diff]: 1,
|
|
64
|
+
[chat_widget_kind_1.ChatWidgetKind.Approval]: 1,
|
|
65
|
+
[chat_widget_kind_1.ChatWidgetKind.Table]: 1,
|
|
66
|
+
[chat_widget_kind_1.ChatWidgetKind.Chart]: 1,
|
|
67
|
+
[chat_widget_kind_1.ChatWidgetKind.FileEdit]: 1,
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=chat-widget-payloads.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-widget-payloads.js","sourceRoot":"","sources":["../../../src/widget/lib/chat-widget-payloads.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export interface WidgetContributionManifest {
|
|
3
|
+
readonly kind: string;
|
|
4
|
+
readonly version: number;
|
|
5
|
+
readonly displayName: string;
|
|
6
|
+
readonly summary: string;
|
|
7
|
+
readonly payloadSchema: Record<string, unknown>;
|
|
8
|
+
}
|
|
9
|
+
export declare const WidgetContributionManifestSchema: z.ZodType<WidgetContributionManifest>;
|
|
10
|
+
export interface WidgetKindCatalogueEntry {
|
|
11
|
+
readonly kind: string;
|
|
12
|
+
readonly version: number;
|
|
13
|
+
readonly displayName: string;
|
|
14
|
+
readonly summary: string;
|
|
15
|
+
readonly payloadSchema: Record<string, unknown>;
|
|
16
|
+
readonly source: WidgetKindSource;
|
|
17
|
+
readonly biomeId?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare enum WidgetKindSource {
|
|
20
|
+
FirstParty = "first-party",
|
|
21
|
+
Biome = "biome"
|
|
22
|
+
}
|
|
23
|
+
export declare const WidgetKindSourceSchema: z.ZodEnum<typeof WidgetKindSource>;
|
|
24
|
+
//# sourceMappingURL=widget-contribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget-contribution.d.ts","sourceRoot":"","sources":["../../../src/widget/lib/widget-contribution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAyBxB,MAAM,WAAW,0BAA0B;IAMzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjD;AAUD,eAAO,MAAM,gCAAgC,EAAE,CAAC,CAAC,OAAO,CAAC,0BAA0B,CActC,CAAC;AAY9C,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChD,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAElC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAGD,oBAAY,gBAAgB;IAC1B,UAAU,gBAAgB;IAC1B,KAAK,UAAU;CAChB;AAED,eAAO,MAAM,sBAAsB,oCAAiC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WidgetKindSourceSchema = exports.WidgetKindSource = exports.WidgetContributionManifestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const WIDGET_KIND_SLUG_REGEX = /^[a-z][a-z0-9-]*$/;
|
|
6
|
+
exports.WidgetContributionManifestSchema = zod_1.z.object({
|
|
7
|
+
kind: zod_1.z
|
|
8
|
+
.string()
|
|
9
|
+
.min(1)
|
|
10
|
+
.max(100)
|
|
11
|
+
.regex(WIDGET_KIND_SLUG_REGEX, 'Widget kind slug must be lowercase letters, digits, and hyphens (start with a letter).'),
|
|
12
|
+
version: zod_1.z.number().int().positive(),
|
|
13
|
+
displayName: zod_1.z.string().min(1).max(200),
|
|
14
|
+
summary: zod_1.z.string().min(1).max(1000),
|
|
15
|
+
payloadSchema: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()),
|
|
16
|
+
});
|
|
17
|
+
var WidgetKindSource;
|
|
18
|
+
(function (WidgetKindSource) {
|
|
19
|
+
WidgetKindSource["FirstParty"] = "first-party";
|
|
20
|
+
WidgetKindSource["Biome"] = "biome";
|
|
21
|
+
})(WidgetKindSource || (exports.WidgetKindSource = WidgetKindSource = {}));
|
|
22
|
+
exports.WidgetKindSourceSchema = zod_1.z.nativeEnum(WidgetKindSource);
|
|
23
|
+
//# sourceMappingURL=widget-contribution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget-contribution.js","sourceRoot":"","sources":["../../../src/widget/lib/widget-contribution.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AA0CxB,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AAQtC,QAAA,gCAAgC,GAC3C,OAAC,CAAC,MAAM,CAAC;IACP,IAAI,EAAE,OAAC;SACJ,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,GAAG,CAAC;SACR,KAAK,CACJ,sBAAsB,EACtB,wFAAwF,CACzF;IACH,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACpC,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IACvC,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC;IACpC,aAAa,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC;CACjD,CAA0C,CAAC;AAwB9C,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,8CAA0B,CAAA;IAC1B,mCAAe,CAAA;AACjB,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B;AAEY,QAAA,sBAAsB,GAAG,OAAC,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xemahq/kernel-contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Consolidated Xema OS kernel wire contracts — pure types + zod schemas for the 32 kernel protocol surfaces. One package, one npm scope, wildcard per-surface subpath exports. No framework/runtime deps.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -10,18 +10,26 @@
|
|
|
10
10
|
"dist",
|
|
11
11
|
"src"
|
|
12
12
|
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"clean": "rm -rf dist",
|
|
15
|
+
"build": "tsc -p tsconfig.json && node scripts/emit-awp-spec.mjs",
|
|
16
|
+
"format": "prettier --write \"src/**/*.ts\"",
|
|
17
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
18
|
+
"lint": "eslint .",
|
|
19
|
+
"check:boundary": "node scripts/check-subpath-dag.mjs"
|
|
20
|
+
},
|
|
13
21
|
"devDependencies": {
|
|
14
|
-
"@eslint/js": "
|
|
15
|
-
"@types/node": "
|
|
16
|
-
"eslint": "
|
|
17
|
-
"eslint-config-prettier": "
|
|
22
|
+
"@eslint/js": "catalog:",
|
|
23
|
+
"@types/node": "catalog:",
|
|
24
|
+
"eslint": "catalog:",
|
|
25
|
+
"eslint-config-prettier": "catalog:",
|
|
18
26
|
"eslint-plugin-import": "^2.31.0",
|
|
19
|
-
"prettier": "
|
|
20
|
-
"typescript": "
|
|
21
|
-
"typescript-eslint": "
|
|
27
|
+
"prettier": "catalog:",
|
|
28
|
+
"typescript": "catalog:",
|
|
29
|
+
"typescript-eslint": "catalog:"
|
|
22
30
|
},
|
|
23
31
|
"dependencies": {
|
|
24
|
-
"zod": "
|
|
32
|
+
"zod": "catalog:"
|
|
25
33
|
},
|
|
26
34
|
"exports": {
|
|
27
35
|
"./*": {
|
|
@@ -30,13 +38,5 @@
|
|
|
30
38
|
"default": "./dist/*/index.js"
|
|
31
39
|
},
|
|
32
40
|
"./package.json": "./package.json"
|
|
33
|
-
},
|
|
34
|
-
"scripts": {
|
|
35
|
-
"clean": "rm -rf dist",
|
|
36
|
-
"build": "tsc -p tsconfig.json && node scripts/emit-awp-spec.mjs",
|
|
37
|
-
"format": "prettier --write \"src/**/*.ts\"",
|
|
38
|
-
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
39
|
-
"lint": "eslint .",
|
|
40
|
-
"check:boundary": "node scripts/check-subpath-dag.mjs"
|
|
41
41
|
}
|
|
42
|
-
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* `ChatWidgetEnvelope` — a single widget instance recorded on an assistant
|
|
5
|
+
* message's `metadata.widgets[]` and rendered by the host-web ChatWidget
|
|
6
|
+
* registry (HANDOFF §3.2).
|
|
7
|
+
*
|
|
8
|
+
* `kind` is a first-party {@link ChatWidgetKind} value OR a namespaced biome
|
|
9
|
+
* string (`<biomeId>:<kind>`). `version` is the monotonic schema version for
|
|
10
|
+
* THIS kind — the FE renders the registered renderer when `version <=
|
|
11
|
+
* supportedVersion`, else a safe fallback card. `payload` is the kind-specific
|
|
12
|
+
* payload (validated by the producer against the kind's schema; the FE
|
|
13
|
+
* re-validates before render so a malformed payload renders the fallback rather
|
|
14
|
+
* than being dropped).
|
|
15
|
+
*
|
|
16
|
+
* This is the kernel-canonical mirror of the FE `ChatWidgetEnvelope` interface
|
|
17
|
+
* — keep the shapes value-identical.
|
|
18
|
+
*/
|
|
19
|
+
export interface ChatWidgetEnvelope {
|
|
20
|
+
readonly kind: string;
|
|
21
|
+
readonly version: number;
|
|
22
|
+
readonly payload: unknown;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Zod validator for {@link ChatWidgetEnvelope}. */
|
|
26
|
+
export const ChatWidgetEnvelopeSchema: z.ZodType<ChatWidgetEnvelope> = z.object({
|
|
27
|
+
kind: z.string().min(1),
|
|
28
|
+
version: z.number().int().positive(),
|
|
29
|
+
payload: z.unknown(),
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Why a widget fell back to the safe card — populated on the FE resolved
|
|
34
|
+
* decision so the Studio debugger can see WHY. Mirror of the FE
|
|
35
|
+
* `ChatWidgetFallbackReason`. Closed set.
|
|
36
|
+
*/
|
|
37
|
+
export enum ChatWidgetFallbackReason {
|
|
38
|
+
UnknownKind = 'unknown-kind',
|
|
39
|
+
InvalidPayload = 'invalid-payload',
|
|
40
|
+
UnsupportedVersion = 'unsupported-version',
|
|
41
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* `ChatWidgetKind` — the closed first-party set of rich in-chat widget kinds an
|
|
5
|
+
* agent may render through the generic `render_widget` tool (see the Xema OS
|
|
6
|
+
* ChatWidget feature). Each kind is a GENERIC, domain-agnostic presentation
|
|
7
|
+
* primitive — chosen to cover the broadest possible range of "structured thing
|
|
8
|
+
* the agent wants to show the user" without baking in any vertical semantics.
|
|
9
|
+
*
|
|
10
|
+
* ── Value-identity invariant ────────────────────────────────────────────────
|
|
11
|
+
* This enum is the kernel-canonical mirror of the host-web FE model
|
|
12
|
+
* (`submodules/xema-host-web/src/views/project/sessions/thin/chat-widget-model.ts`,
|
|
13
|
+
* `ChatWidgetKind`). The two MUST stay value-identical: the FE consumes this
|
|
14
|
+
* contract via the frontend-bridge sync, and the registry resolves a payload to
|
|
15
|
+
* a renderer by matching `kind`. Adding a generic kind = add the enum member in
|
|
16
|
+
* BOTH places (the "2-file rule") plus a payload schema below.
|
|
17
|
+
*
|
|
18
|
+
* ── Closed first-party set vs. open biome set ───────────────────────────────
|
|
19
|
+
* A biome contributes its OWN widget kind as a namespaced string
|
|
20
|
+
* (`<biomeId>:<kind>`) through a `widget-kind` contribution — it never extends
|
|
21
|
+
* this enum. This mirrors the closed-enum + open-namespaced-string pattern used
|
|
22
|
+
* by the FE registry's `registerChatWidget`.
|
|
23
|
+
*/
|
|
24
|
+
export enum ChatWidgetKind {
|
|
25
|
+
/** A checklist / plan (todo items with status). The agent's "here's the plan". */
|
|
26
|
+
Plan = 'plan',
|
|
27
|
+
/** A single-file unified diff (path + hunks). "Here's the change I propose." */
|
|
28
|
+
Diff = 'diff',
|
|
29
|
+
/** A suspended capability call awaiting human approval, keyed by approval id. */
|
|
30
|
+
Approval = 'approval',
|
|
31
|
+
/** A generic columns + rows table. The universal "show me structured records". */
|
|
32
|
+
Table = 'table',
|
|
33
|
+
/** A compact bar/line chart over labelled series. "Visualise these numbers." */
|
|
34
|
+
Chart = 'chart',
|
|
35
|
+
/** A header-only file-change summary (path + add/del counts), no hunks. */
|
|
36
|
+
FileEdit = 'file-edit',
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Zod mirror of {@link ChatWidgetKind} for wire-boundary validation. */
|
|
40
|
+
export const ChatWidgetKindSchema = z.nativeEnum(ChatWidgetKind);
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The chart shapes the first-party `chart` widget can draw. Closed set — kept
|
|
44
|
+
* value-identical with the FE's `ChatChartKind`.
|
|
45
|
+
*/
|
|
46
|
+
export enum ChatChartKind {
|
|
47
|
+
Bar = 'bar',
|
|
48
|
+
Line = 'line',
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export const ChatChartKindSchema = z.nativeEnum(ChatChartKind);
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
import { ChatChartKindSchema, ChatWidgetKind } from './chat-widget-kind';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Per-kind payload contracts for the first-party {@link ChatWidgetKind} set.
|
|
7
|
+
*
|
|
8
|
+
* These schemas are the WIRE contract the `render_widget` tool validates against
|
|
9
|
+
* before a widget envelope is recorded onto an assistant message's
|
|
10
|
+
* `metadata.widgets[]`. They are kept STRUCTURALLY value-identical with the FE
|
|
11
|
+
* narrowing validators in
|
|
12
|
+
* `submodules/xema-host-web/src/views/project/sessions/thin/chat-widget-builtins.tsx`
|
|
13
|
+
* — the FE re-validates client-side (so a future/unknown payload still routes to
|
|
14
|
+
* the safe fallback card), but the runtime fails fast on a bad payload so a
|
|
15
|
+
* malformed widget never reaches the transcript.
|
|
16
|
+
*
|
|
17
|
+
* Zero runtime deps beyond zod (kernel-leaf invariant).
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/** Mirror of the FE `TodoState` (session-kit). Closed set. */
|
|
21
|
+
export enum WidgetTodoState {
|
|
22
|
+
Todo = 'todo',
|
|
23
|
+
Active = 'active',
|
|
24
|
+
Done = 'done',
|
|
25
|
+
}
|
|
26
|
+
export const WidgetTodoStateSchema = z.nativeEnum(WidgetTodoState);
|
|
27
|
+
|
|
28
|
+
/** A single plan/checklist item. Mirrors session-kit `TodoItem`. */
|
|
29
|
+
export const PlanWidgetItemSchema = z.object({
|
|
30
|
+
label: z.string().min(1),
|
|
31
|
+
state: WidgetTodoStateSchema,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
/** `plan` payload — a titled checklist of todo items. */
|
|
35
|
+
export const PlanWidgetPayloadSchema = z.object({
|
|
36
|
+
title: z.string().optional(),
|
|
37
|
+
items: z.array(PlanWidgetItemSchema),
|
|
38
|
+
});
|
|
39
|
+
export type PlanWidgetPayload = z.infer<typeof PlanWidgetPayloadSchema>;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* `diff` payload — a single-file unified diff. `hunks` are raw diff lines whose
|
|
43
|
+
* first character is the marker (`+`/`-`/space). Mirrors session-kit `DiffFile`.
|
|
44
|
+
*/
|
|
45
|
+
export const DiffWidgetPayloadSchema = z.object({
|
|
46
|
+
path: z.string().min(1),
|
|
47
|
+
add: z.number(),
|
|
48
|
+
del: z.number(),
|
|
49
|
+
hunks: z.array(z.string()).optional(),
|
|
50
|
+
});
|
|
51
|
+
export type DiffWidgetPayload = z.infer<typeof DiffWidgetPayloadSchema>;
|
|
52
|
+
|
|
53
|
+
/** `file-edit` payload — a header-only file change summary (no hunks). */
|
|
54
|
+
export const FileEditWidgetPayloadSchema = z.object({
|
|
55
|
+
path: z.string().min(1),
|
|
56
|
+
summary: z.string().optional(),
|
|
57
|
+
add: z.number(),
|
|
58
|
+
del: z.number(),
|
|
59
|
+
});
|
|
60
|
+
export type FileEditWidgetPayload = z.infer<typeof FileEditWidgetPayloadSchema>;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* `approval` payload — the suspended capability call awaiting approval, keyed by
|
|
64
|
+
* the session it belongs to. The FE mounts the same Pillar-3 inline approval
|
|
65
|
+
* card from this id.
|
|
66
|
+
*/
|
|
67
|
+
export const ApprovalWidgetPayloadSchema = z.object({
|
|
68
|
+
sessionId: z.string().min(1),
|
|
69
|
+
accent: z.string().optional(),
|
|
70
|
+
});
|
|
71
|
+
export type ApprovalWidgetPayload = z.infer<typeof ApprovalWidgetPayloadSchema>;
|
|
72
|
+
|
|
73
|
+
/** A `table` column descriptor. */
|
|
74
|
+
export const TableWidgetColumnSchema = z.object({
|
|
75
|
+
key: z.string().min(1),
|
|
76
|
+
label: z.string().min(1),
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
/** `table` payload — generic columns + rows. Cells are strings or numbers. */
|
|
80
|
+
export const TableWidgetPayloadSchema = z.object({
|
|
81
|
+
columns: z.array(TableWidgetColumnSchema),
|
|
82
|
+
rows: z.array(z.record(z.string(), z.union([z.string(), z.number()]))),
|
|
83
|
+
});
|
|
84
|
+
export type TableWidgetPayload = z.infer<typeof TableWidgetPayloadSchema>;
|
|
85
|
+
|
|
86
|
+
/** A single chart series (one bar/line group). */
|
|
87
|
+
export const ChartWidgetSeriesSchema = z.object({
|
|
88
|
+
label: z.string().min(1),
|
|
89
|
+
points: z.array(z.object({ x: z.string(), y: z.number() })),
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
/** `chart` payload — a compact bar/line chart over labelled series. */
|
|
93
|
+
export const ChartWidgetPayloadSchema = z.object({
|
|
94
|
+
kind: ChatChartKindSchema,
|
|
95
|
+
series: z.array(ChartWidgetSeriesSchema),
|
|
96
|
+
});
|
|
97
|
+
export type ChartWidgetPayload = z.infer<typeof ChartWidgetPayloadSchema>;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* The closed registry of first-party kind → payload schema. The single source
|
|
101
|
+
* of truth the `render_widget` tool & runtime use to validate a first-party
|
|
102
|
+
* widget payload by `kind`. Adding a generic kind = one enum member + one schema
|
|
103
|
+
* here + the FE mirror (the "2-file rule").
|
|
104
|
+
*/
|
|
105
|
+
export const FIRST_PARTY_WIDGET_PAYLOAD_SCHEMAS: Readonly<
|
|
106
|
+
Record<ChatWidgetKind, z.ZodTypeAny>
|
|
107
|
+
> = {
|
|
108
|
+
[ChatWidgetKind.Plan]: PlanWidgetPayloadSchema,
|
|
109
|
+
[ChatWidgetKind.Diff]: DiffWidgetPayloadSchema,
|
|
110
|
+
[ChatWidgetKind.Approval]: ApprovalWidgetPayloadSchema,
|
|
111
|
+
[ChatWidgetKind.Table]: TableWidgetPayloadSchema,
|
|
112
|
+
[ChatWidgetKind.Chart]: ChartWidgetPayloadSchema,
|
|
113
|
+
[ChatWidgetKind.FileEdit]: FileEditWidgetPayloadSchema,
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* The current schema version for each first-party kind. Bumped when a kind's
|
|
118
|
+
* payload schema changes shape; the FE renders the registered renderer only
|
|
119
|
+
* when `envelope.version <= supportedVersion`, else the safe fallback.
|
|
120
|
+
*/
|
|
121
|
+
export const FIRST_PARTY_WIDGET_VERSIONS: Readonly<
|
|
122
|
+
Record<ChatWidgetKind, number>
|
|
123
|
+
> = {
|
|
124
|
+
[ChatWidgetKind.Plan]: 1,
|
|
125
|
+
[ChatWidgetKind.Diff]: 1,
|
|
126
|
+
[ChatWidgetKind.Approval]: 1,
|
|
127
|
+
[ChatWidgetKind.Table]: 1,
|
|
128
|
+
[ChatWidgetKind.Chart]: 1,
|
|
129
|
+
[ChatWidgetKind.FileEdit]: 1,
|
|
130
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Manifest shape carried by every `ContributionKind.WidgetKind` envelope.
|
|
5
|
+
*
|
|
6
|
+
* One contribution = one widget kind. The shape mirrors
|
|
7
|
+
* `CapabilityContributionManifest` (see `../capability/lib/capability-contribution.ts`)
|
|
8
|
+
* so the generic `BootstrapContributionsService<TKind, TManifest>` template and
|
|
9
|
+
* the codemod can ingest it the same way every other contribution kind is
|
|
10
|
+
* ingested. Provenance (`biomeId`, `biomeVersion`) is stamped by the bootstrap
|
|
11
|
+
* pipeline from the discovering biome's manifest — authors do NOT declare it
|
|
12
|
+
* inline.
|
|
13
|
+
*
|
|
14
|
+
* A biome contributes a widget kind so its frontend biome can register a
|
|
15
|
+
* renderer for it via `registerChatWidget('<biomeId>:<kind>', …)`. The
|
|
16
|
+
* `kind` here is the BARE, biome-local kind slug; the catalogue namespaces it
|
|
17
|
+
* to `<biomeId>:<kind>` at ingest so it can never shadow a first-party kind.
|
|
18
|
+
*
|
|
19
|
+
* Validation is fail-fast: a contribution that violates any constraint is
|
|
20
|
+
* rejected at boot. `payloadSchema` is an opaque JSON Schema passed through
|
|
21
|
+
* verbatim (the catalogue surfaces it to the FE and to authoring tools; it is
|
|
22
|
+
* NOT a kernel-validated shape — validating it as JSON Schema here would be
|
|
23
|
+
* either partial or pull in a JSON-Schema validator, violating the kernel-leaf
|
|
24
|
+
* invariant).
|
|
25
|
+
*/
|
|
26
|
+
export interface WidgetContributionManifest {
|
|
27
|
+
/**
|
|
28
|
+
* Biome-local kind slug (lowercase, hyphenated). Namespaced to
|
|
29
|
+
* `<biomeId>:<kind>` by the catalogue — a biome can never claim a bare
|
|
30
|
+
* first-party kind.
|
|
31
|
+
*/
|
|
32
|
+
readonly kind: string;
|
|
33
|
+
/** Monotonic schema version for this kind's payload. */
|
|
34
|
+
readonly version: number;
|
|
35
|
+
/** Human-readable display name surfaced in the catalogue (≤ 200 chars). */
|
|
36
|
+
readonly displayName: string;
|
|
37
|
+
/** One-line summary of WHAT the widget shows + WHEN to use it (≤ 1000 chars). */
|
|
38
|
+
readonly summary: string;
|
|
39
|
+
/** JSON Schema for the widget payload — passed through verbatim. */
|
|
40
|
+
readonly payloadSchema: Record<string, unknown>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const WIDGET_KIND_SLUG_REGEX = /^[a-z][a-z0-9-]*$/;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Zod validator for {@link WidgetContributionManifest}. The bootstrap template
|
|
47
|
+
* and the catalogue's `POST /widget-kinds/register` route BOTH route every
|
|
48
|
+
* candidate manifest through this before persisting, so a malformed
|
|
49
|
+
* contribution fails at the boundary instead of at render time.
|
|
50
|
+
*/
|
|
51
|
+
export const WidgetContributionManifestSchema: z.ZodType<WidgetContributionManifest> =
|
|
52
|
+
z.object({
|
|
53
|
+
kind: z
|
|
54
|
+
.string()
|
|
55
|
+
.min(1)
|
|
56
|
+
.max(100)
|
|
57
|
+
.regex(
|
|
58
|
+
WIDGET_KIND_SLUG_REGEX,
|
|
59
|
+
'Widget kind slug must be lowercase letters, digits, and hyphens (start with a letter).',
|
|
60
|
+
),
|
|
61
|
+
version: z.number().int().positive(),
|
|
62
|
+
displayName: z.string().min(1).max(200),
|
|
63
|
+
summary: z.string().min(1).max(1000),
|
|
64
|
+
payloadSchema: z.record(z.string(), z.unknown()),
|
|
65
|
+
}) as z.ZodType<WidgetContributionManifest>;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* A resolved widget-kind catalogue entry — what `GET /widget-kinds` returns. It
|
|
69
|
+
* unifies the closed first-party set and the open biome-contributed set behind
|
|
70
|
+
* ONE shape the FE consumes to know which kinds exist (and to register
|
|
71
|
+
* biome-contributed kinds into the open FE registry).
|
|
72
|
+
*
|
|
73
|
+
* `source` discriminates provenance; `kind` is the FULLY-NAMESPACED slug the FE
|
|
74
|
+
* registry keys by (a first-party kind is its bare enum value; a biome kind is
|
|
75
|
+
* `<biomeId>:<kind>`).
|
|
76
|
+
*/
|
|
77
|
+
export interface WidgetKindCatalogueEntry {
|
|
78
|
+
readonly kind: string;
|
|
79
|
+
readonly version: number;
|
|
80
|
+
readonly displayName: string;
|
|
81
|
+
readonly summary: string;
|
|
82
|
+
readonly payloadSchema: Record<string, unknown>;
|
|
83
|
+
readonly source: WidgetKindSource;
|
|
84
|
+
/** Present only for biome-contributed kinds. */
|
|
85
|
+
readonly biomeId?: string;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** Provenance of a catalogue entry. Closed set. */
|
|
89
|
+
export enum WidgetKindSource {
|
|
90
|
+
FirstParty = 'first-party',
|
|
91
|
+
Biome = 'biome',
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export const WidgetKindSourceSchema = z.nativeEnum(WidgetKindSource);
|
package/LICENSE
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
Apache License
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
4
|
-
|
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
-
|
|
7
|
-
1. Definitions.
|
|
8
|
-
|
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
-
|
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
-
the copyright owner that is granting the License.
|
|
14
|
-
|
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
-
other entities that control, are controlled by, or are under common
|
|
17
|
-
control with that entity. For the purposes of this definition,
|
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
-
direction or management of such entity, whether by contract or
|
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for describing the origin of the Work and
|
|
141
|
-
reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Support. While redistributing the Work or
|
|
166
|
-
Derivative Works thereof, You may choose to offer, and charge a
|
|
167
|
-
fee for, acceptance of support, warranty, indemnity, or other
|
|
168
|
-
liability obligations and/or rights consistent with this License.
|
|
169
|
-
However, in accepting such obligations, You may act only on Your
|
|
170
|
-
own behalf and on Your sole responsibility, not on behalf of any
|
|
171
|
-
other Contributor, and only if You agree to indemnify, defend, and
|
|
172
|
-
hold each Contributor harmless for any liability incurred by, or
|
|
173
|
-
claims asserted against, such Contributor by reason of your
|
|
174
|
-
accepting any such warranty or support.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|
|
177
|
-
|
|
178
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
-
|
|
180
|
-
To apply the Apache License to your work, attach the following
|
|
181
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
-
replaced with your own identifying information. (Don't include
|
|
183
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
-
comment syntax for the file format. We also recommend that a
|
|
185
|
-
file or class name and description of purpose be included on the
|
|
186
|
-
same "printed page" as the copyright notice for easier
|
|
187
|
-
identification within third-party archives.
|
|
188
|
-
|
|
189
|
-
Copyright 2026 Xema
|
|
190
|
-
|
|
191
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
-
you may not use this file except in compliance with the License.
|
|
193
|
-
You may obtain a copy of the License at
|
|
194
|
-
|
|
195
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
-
|
|
197
|
-
Unless required by applicable law or agreed to in writing, software
|
|
198
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
-
See the License for the specific language governing permissions and
|
|
201
|
-
limitations under the License.
|