@vetta-org/plugin-sdk 0.3.10 → 0.3.12

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/quickjs.d.ts DELETED
@@ -1,147 +0,0 @@
1
- import type { ConversationScenario } from "./scenario.js";
2
- import type { PluginNetworkRequest, PluginNetworkResponse } from "./network.js";
3
- import type { PluginPutBlobInput, PluginStoredBlob, PluginStoredBlobRef } from "./storage.js";
4
- import type { PluginActivityTabRetention } from "./ui.js";
5
- export type PluginDeclarativeTextTone = "default" | "muted" | "success" | "warning" | "danger";
6
- export interface PluginDeclarativeStack {
7
- type: "stack";
8
- direction?: "vertical" | "horizontal";
9
- gap?: "small" | "medium" | "large";
10
- children: PluginDeclarativeNode[];
11
- }
12
- export interface PluginDeclarativeSection {
13
- type: "section";
14
- title?: string;
15
- description?: string;
16
- children: PluginDeclarativeNode[];
17
- }
18
- export interface PluginDeclarativeText {
19
- type: "text";
20
- text: string;
21
- style?: "body" | "heading" | "caption" | "code";
22
- tone?: PluginDeclarativeTextTone;
23
- }
24
- export interface PluginDeclarativeButton {
25
- type: "button";
26
- label: string;
27
- action: string;
28
- variant?: "primary" | "secondary" | "outline" | "destructive";
29
- disabled?: boolean;
30
- }
31
- export interface PluginDeclarativeInput {
32
- type: "input";
33
- action: string;
34
- label?: string;
35
- value?: string;
36
- placeholder?: string;
37
- inputType?: "text" | "password" | "number";
38
- disabled?: boolean;
39
- }
40
- export interface PluginDeclarativeTextarea {
41
- type: "textarea";
42
- action: string;
43
- label?: string;
44
- value?: string;
45
- placeholder?: string;
46
- disabled?: boolean;
47
- }
48
- export interface PluginDeclarativeSelectOption {
49
- value: string;
50
- label: string;
51
- }
52
- export interface PluginDeclarativeSelect {
53
- type: "select";
54
- action: string;
55
- label?: string;
56
- value?: string;
57
- placeholder?: string;
58
- options: PluginDeclarativeSelectOption[];
59
- disabled?: boolean;
60
- }
61
- export interface PluginDeclarativeSwitch {
62
- type: "switch";
63
- action: string;
64
- label: string;
65
- checked?: boolean;
66
- disabled?: boolean;
67
- }
68
- export interface PluginDeclarativeDivider {
69
- type: "divider";
70
- }
71
- /** Serializable UI rendered exclusively with host-owned components. */
72
- export type PluginDeclarativeNode = PluginDeclarativeStack | PluginDeclarativeSection | PluginDeclarativeText | PluginDeclarativeButton | PluginDeclarativeInput | PluginDeclarativeTextarea | PluginDeclarativeSelect | PluginDeclarativeSwitch | PluginDeclarativeDivider;
73
- export interface PluginQuickJsActivityTab {
74
- id: string;
75
- label: string;
76
- view: PluginDeclarativeNode;
77
- scope_use?: readonly ConversationScenario[];
78
- initiallyVisible?: boolean;
79
- /** Defaults to `"warm"`; see PluginActivityTabContribution. */
80
- retention?: PluginActivityTabRetention;
81
- }
82
- export interface PluginDeclarativeActionEvent {
83
- tabId: string;
84
- action: string;
85
- kind: "press" | "change";
86
- value?: string | number | boolean;
87
- }
88
- /**
89
- * Public contract exposed as the frozen `vetta` global inside a QuickJS plugin.
90
- * QuickJS entry scripts are classic scripts and must not import host modules.
91
- */
92
- export interface PluginQuickJsApi {
93
- activate(handler: (context: PluginQuickJsContext) => void): void;
94
- deactivate(handler: () => void): void;
95
- }
96
- export interface PluginQuickJsContext {
97
- plugin: {
98
- id: string;
99
- version: string;
100
- iconUrl?: string;
101
- };
102
- permissions: {
103
- has(permission: string): boolean;
104
- };
105
- ui: {
106
- registerActivityTab(contribution: PluginQuickJsActivityTab): void;
107
- updateActivityTab(tabId: string, view: PluginDeclarativeNode): void;
108
- onAction(action: string, handler: (event: PluginDeclarativeActionEvent) => void | Promise<void>): void;
109
- openActivityTab(tabId: string, options?: {
110
- width?: number | "max";
111
- cwd?: string;
112
- }): void;
113
- setActivityTabVisible(tabId: string, visible: boolean, options?: {
114
- cwd?: string;
115
- }): void;
116
- notify(options: {
117
- message: string;
118
- title?: string;
119
- variant?: "info" | "success" | "warning" | "error";
120
- durationMs?: number;
121
- }): void;
122
- };
123
- network: {
124
- request<T = unknown>(request: PluginNetworkRequest): Promise<PluginNetworkResponse<T>>;
125
- };
126
- storage: {
127
- readJson<T = unknown>(key: string): Promise<T | null>;
128
- writeJson(key: string, value: unknown): Promise<void>;
129
- list(prefix?: string): Promise<string[]>;
130
- readFile(path: string): Promise<string | null>;
131
- writeFile(path: string, data: string): Promise<void>;
132
- putBlob(input: PluginPutBlobInput): Promise<PluginStoredBlobRef>;
133
- readBlob(id: string): Promise<PluginStoredBlob | null>;
134
- getBlobRef(id: string): Promise<PluginStoredBlobRef | null>;
135
- };
136
- settings: {
137
- get<T = unknown>(key: string): T | undefined;
138
- getAll(): Record<string, unknown>;
139
- onChange(handler: (values: Record<string, unknown>) => void): void;
140
- };
141
- i18n: {
142
- locale: string;
143
- t(key: string, params?: Record<string, string | number>): Promise<string>;
144
- onChange(handler: (locale: string) => void): void;
145
- };
146
- }
147
- //# sourceMappingURL=quickjs.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"quickjs.d.ts","sourceRoot":"","sources":["../src/quickjs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAC9F,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAE1D,MAAM,MAAM,yBAAyB,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE/F,MAAM,WAAW,sBAAsB;IACtC,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IACtC,GAAG,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACnC,QAAQ,EAAE,qBAAqB,EAAE,CAAC;CAClC;AAED,MAAM,WAAW,w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EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;QAC1E,QAAQ,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAAC;KAClD,CAAC;CACF","sourcesContent":["import type { ConversationScenario } from \"./scenario.js\";\nimport type { PluginNetworkRequest, PluginNetworkResponse } from \"./network.js\";\nimport type { PluginPutBlobInput, PluginStoredBlob, PluginStoredBlobRef } from \"./storage.js\";\nimport type { PluginActivityTabRetention } from \"./ui.js\";\n\nexport type PluginDeclarativeTextTone = \"default\" | \"muted\" | \"success\" | \"warning\" | \"danger\";\n\nexport interface PluginDeclarativeStack {\n\ttype: \"stack\";\n\tdirection?: \"vertical\" | \"horizontal\";\n\tgap?: \"small\" | \"medium\" | \"large\";\n\tchildren: PluginDeclarativeNode[];\n}\n\nexport interface PluginDeclarativeSection {\n\ttype: \"section\";\n\ttitle?: string;\n\tdescription?: string;\n\tchildren: PluginDeclarativeNode[];\n}\n\nexport interface PluginDeclarativeText {\n\ttype: \"text\";\n\ttext: string;\n\tstyle?: \"body\" | \"heading\" | \"caption\" | \"code\";\n\ttone?: PluginDeclarativeTextTone;\n}\n\nexport interface PluginDeclarativeButton {\n\ttype: \"button\";\n\tlabel: string;\n\taction: string;\n\tvariant?: \"primary\" | \"secondary\" | \"outline\" | \"destructive\";\n\tdisabled?: boolean;\n}\n\nexport interface PluginDeclarativeInput {\n\ttype: \"input\";\n\taction: string;\n\tlabel?: string;\n\tvalue?: string;\n\tplaceholder?: string;\n\tinputType?: \"text\" | \"password\" | \"number\";\n\tdisabled?: boolean;\n}\n\nexport interface PluginDeclarativeTextarea {\n\ttype: \"textarea\";\n\taction: string;\n\tlabel?: string;\n\tvalue?: string;\n\tplaceholder?: string;\n\tdisabled?: boolean;\n}\n\nexport interface PluginDeclarativeSelectOption {\n\tvalue: string;\n\tlabel: string;\n}\n\nexport interface PluginDeclarativeSelect {\n\ttype: \"select\";\n\taction: string;\n\tlabel?: string;\n\tvalue?: string;\n\tplaceholder?: string;\n\toptions: PluginDeclarativeSelectOption[];\n\tdisabled?: boolean;\n}\n\nexport interface PluginDeclarativeSwitch {\n\ttype: \"switch\";\n\taction: string;\n\tlabel: string;\n\tchecked?: boolean;\n\tdisabled?: boolean;\n}\n\nexport interface PluginDeclarativeDivider {\n\ttype: \"divider\";\n}\n\n/** Serializable UI rendered exclusively with host-owned components. */\nexport type PluginDeclarativeNode =\n\t| PluginDeclarativeStack\n\t| PluginDeclarativeSection\n\t| PluginDeclarativeText\n\t| PluginDeclarativeButton\n\t| PluginDeclarativeInput\n\t| PluginDeclarativeTextarea\n\t| PluginDeclarativeSelect\n\t| PluginDeclarativeSwitch\n\t| PluginDeclarativeDivider;\n\nexport interface PluginQuickJsActivityTab {\n\tid: string;\n\tlabel: string;\n\tview: PluginDeclarativeNode;\n\tscope_use?: readonly ConversationScenario[];\n\tinitiallyVisible?: boolean;\n\t/** Defaults to `\"warm\"`; see PluginActivityTabContribution. */\n\tretention?: PluginActivityTabRetention;\n}\n\nexport interface PluginDeclarativeActionEvent {\n\ttabId: string;\n\taction: string;\n\tkind: \"press\" | \"change\";\n\tvalue?: string | number | boolean;\n}\n\n/**\n * Public contract exposed as the frozen `vetta` global inside a QuickJS plugin.\n * QuickJS entry scripts are classic scripts and must not import host modules.\n */\nexport interface PluginQuickJsApi {\n\tactivate(handler: (context: PluginQuickJsContext) => void): void;\n\tdeactivate(handler: () => void): void;\n}\n\nexport interface PluginQuickJsContext {\n\tplugin: { id: string; version: string; iconUrl?: string };\n\tpermissions: { has(permission: string): boolean };\n\tui: {\n\t\tregisterActivityTab(contribution: PluginQuickJsActivityTab): void;\n\t\tupdateActivityTab(tabId: string, view: PluginDeclarativeNode): void;\n\t\tonAction(action: string, handler: (event: PluginDeclarativeActionEvent) => void | Promise<void>): void;\n\t\topenActivityTab(tabId: string, options?: { width?: number | \"max\"; cwd?: string }): void;\n\t\tsetActivityTabVisible(tabId: string, visible: boolean, options?: { cwd?: string }): void;\n\t\tnotify(options: {\n\t\t\tmessage: string;\n\t\t\ttitle?: string;\n\t\t\tvariant?: \"info\" | \"success\" | \"warning\" | \"error\";\n\t\t\tdurationMs?: number;\n\t\t}): void;\n\t};\n\tnetwork: {\n\t\trequest<T = unknown>(request: PluginNetworkRequest): Promise<PluginNetworkResponse<T>>;\n\t};\n\tstorage: {\n\t\treadJson<T = unknown>(key: string): Promise<T | null>;\n\t\twriteJson(key: string, value: unknown): Promise<void>;\n\t\tlist(prefix?: string): Promise<string[]>;\n\t\treadFile(path: string): Promise<string | null>;\n\t\twriteFile(path: string, data: string): Promise<void>;\n\t\tputBlob(input: PluginPutBlobInput): Promise<PluginStoredBlobRef>;\n\t\treadBlob(id: string): Promise<PluginStoredBlob | null>;\n\t\tgetBlobRef(id: string): Promise<PluginStoredBlobRef | null>;\n\t};\n\tsettings: {\n\t\tget<T = unknown>(key: string): T | undefined;\n\t\tgetAll(): Record<string, unknown>;\n\t\tonChange(handler: (values: Record<string, unknown>) => void): void;\n\t};\n\ti18n: {\n\t\tlocale: string;\n\t\tt(key: string, params?: Record<string, string | number>): Promise<string>;\n\t\tonChange(handler: (locale: string) => void): void;\n\t};\n}\n"]}
package/dist/quickjs.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=quickjs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"quickjs.js","sourceRoot":"","sources":["../src/quickjs.ts"],"names":[],"mappings":"","sourcesContent":["import type { ConversationScenario } from \"./scenario.js\";\nimport type { PluginNetworkRequest, PluginNetworkResponse } from \"./network.js\";\nimport type { PluginPutBlobInput, PluginStoredBlob, PluginStoredBlobRef } from \"./storage.js\";\nimport type { PluginActivityTabRetention } from \"./ui.js\";\n\nexport type PluginDeclarativeTextTone = \"default\" | \"muted\" | \"success\" | \"warning\" | \"danger\";\n\nexport interface PluginDeclarativeStack {\n\ttype: \"stack\";\n\tdirection?: \"vertical\" | \"horizontal\";\n\tgap?: \"small\" | \"medium\" | \"large\";\n\tchildren: PluginDeclarativeNode[];\n}\n\nexport interface PluginDeclarativeSection {\n\ttype: \"section\";\n\ttitle?: string;\n\tdescription?: string;\n\tchildren: PluginDeclarativeNode[];\n}\n\nexport interface PluginDeclarativeText {\n\ttype: \"text\";\n\ttext: string;\n\tstyle?: \"body\" | \"heading\" | \"caption\" | \"code\";\n\ttone?: PluginDeclarativeTextTone;\n}\n\nexport interface PluginDeclarativeButton {\n\ttype: \"button\";\n\tlabel: string;\n\taction: string;\n\tvariant?: \"primary\" | \"secondary\" | \"outline\" | \"destructive\";\n\tdisabled?: boolean;\n}\n\nexport interface PluginDeclarativeInput {\n\ttype: \"input\";\n\taction: string;\n\tlabel?: string;\n\tvalue?: string;\n\tplaceholder?: string;\n\tinputType?: \"text\" | \"password\" | \"number\";\n\tdisabled?: boolean;\n}\n\nexport interface PluginDeclarativeTextarea {\n\ttype: \"textarea\";\n\taction: string;\n\tlabel?: string;\n\tvalue?: string;\n\tplaceholder?: string;\n\tdisabled?: boolean;\n}\n\nexport interface PluginDeclarativeSelectOption {\n\tvalue: string;\n\tlabel: string;\n}\n\nexport interface PluginDeclarativeSelect {\n\ttype: \"select\";\n\taction: string;\n\tlabel?: string;\n\tvalue?: string;\n\tplaceholder?: string;\n\toptions: PluginDeclarativeSelectOption[];\n\tdisabled?: boolean;\n}\n\nexport interface PluginDeclarativeSwitch {\n\ttype: \"switch\";\n\taction: string;\n\tlabel: string;\n\tchecked?: boolean;\n\tdisabled?: boolean;\n}\n\nexport interface PluginDeclarativeDivider {\n\ttype: \"divider\";\n}\n\n/** Serializable UI rendered exclusively with host-owned components. */\nexport type PluginDeclarativeNode =\n\t| PluginDeclarativeStack\n\t| PluginDeclarativeSection\n\t| PluginDeclarativeText\n\t| PluginDeclarativeButton\n\t| PluginDeclarativeInput\n\t| PluginDeclarativeTextarea\n\t| PluginDeclarativeSelect\n\t| PluginDeclarativeSwitch\n\t| PluginDeclarativeDivider;\n\nexport interface PluginQuickJsActivityTab {\n\tid: string;\n\tlabel: string;\n\tview: PluginDeclarativeNode;\n\tscope_use?: readonly ConversationScenario[];\n\tinitiallyVisible?: boolean;\n\t/** Defaults to `\"warm\"`; see PluginActivityTabContribution. */\n\tretention?: PluginActivityTabRetention;\n}\n\nexport interface PluginDeclarativeActionEvent {\n\ttabId: string;\n\taction: string;\n\tkind: \"press\" | \"change\";\n\tvalue?: string | number | boolean;\n}\n\n/**\n * Public contract exposed as the frozen `vetta` global inside a QuickJS plugin.\n * QuickJS entry scripts are classic scripts and must not import host modules.\n */\nexport interface PluginQuickJsApi {\n\tactivate(handler: (context: PluginQuickJsContext) => void): void;\n\tdeactivate(handler: () => void): void;\n}\n\nexport interface PluginQuickJsContext {\n\tplugin: { id: string; version: string; iconUrl?: string };\n\tpermissions: { has(permission: string): boolean };\n\tui: {\n\t\tregisterActivityTab(contribution: PluginQuickJsActivityTab): void;\n\t\tupdateActivityTab(tabId: string, view: PluginDeclarativeNode): void;\n\t\tonAction(action: string, handler: (event: PluginDeclarativeActionEvent) => void | Promise<void>): void;\n\t\topenActivityTab(tabId: string, options?: { width?: number | \"max\"; cwd?: string }): void;\n\t\tsetActivityTabVisible(tabId: string, visible: boolean, options?: { cwd?: string }): void;\n\t\tnotify(options: {\n\t\t\tmessage: string;\n\t\t\ttitle?: string;\n\t\t\tvariant?: \"info\" | \"success\" | \"warning\" | \"error\";\n\t\t\tdurationMs?: number;\n\t\t}): void;\n\t};\n\tnetwork: {\n\t\trequest<T = unknown>(request: PluginNetworkRequest): Promise<PluginNetworkResponse<T>>;\n\t};\n\tstorage: {\n\t\treadJson<T = unknown>(key: string): Promise<T | null>;\n\t\twriteJson(key: string, value: unknown): Promise<void>;\n\t\tlist(prefix?: string): Promise<string[]>;\n\t\treadFile(path: string): Promise<string | null>;\n\t\twriteFile(path: string, data: string): Promise<void>;\n\t\tputBlob(input: PluginPutBlobInput): Promise<PluginStoredBlobRef>;\n\t\treadBlob(id: string): Promise<PluginStoredBlob | null>;\n\t\tgetBlobRef(id: string): Promise<PluginStoredBlobRef | null>;\n\t};\n\tsettings: {\n\t\tget<T = unknown>(key: string): T | undefined;\n\t\tgetAll(): Record<string, unknown>;\n\t\tonChange(handler: (values: Record<string, unknown>) => void): void;\n\t};\n\ti18n: {\n\t\tlocale: string;\n\t\tt(key: string, params?: Record<string, string | number>): Promise<string>;\n\t\tonChange(handler: (locale: string) => void): void;\n\t};\n}\n"]}