@rozenite/controls-plugin 2.2.0 → 2.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/CHANGELOG.md +16 -0
- package/dist/devtools/assets/panel-EMOeI6i6.css +1 -0
- package/dist/devtools/assets/panel-mjW0t-tQ.js +18 -0
- package/dist/devtools/panel.html +2 -2
- package/dist/react-native/cjs/package.json +3 -0
- package/dist/react-native/cjs/react-native.js +14 -0
- package/dist/react-native/cjs/src/react-native/controlsRegistry.js +70 -0
- package/dist/react-native/cjs/src/react-native/useControlsAgentTools.js +175 -0
- package/dist/react-native/cjs/src/react-native/useRozeniteControlsPlugin.js +177 -0
- package/dist/react-native/cjs/src/shared/agent-tools.js +51 -0
- package/dist/react-native/cjs/src/shared/messaging.js +2 -0
- package/dist/react-native/cjs/src/shared/serialization.js +102 -0
- package/dist/react-native/cjs/src/shared/types.js +5 -0
- package/dist/react-native/package.json +3 -0
- package/dist/react-native/react-native.d.ts +2 -0
- package/dist/react-native/react-native.js +11 -0
- package/dist/react-native/src/react-native/controlsRegistry.d.ts +23 -0
- package/dist/react-native/src/react-native/controlsRegistry.js +66 -0
- package/dist/react-native/src/react-native/useControlsAgentTools.d.ts +2 -0
- package/dist/react-native/src/react-native/useControlsAgentTools.js +171 -0
- package/dist/react-native/src/react-native/useRozeniteControlsPlugin.d.ts +3 -0
- package/dist/react-native/src/react-native/useRozeniteControlsPlugin.js +173 -0
- package/dist/react-native/src/shared/agent-tools.d.ts +48 -0
- package/dist/react-native/src/shared/agent-tools.js +48 -0
- package/dist/react-native/src/shared/messaging.d.ts +35 -0
- package/dist/react-native/src/shared/messaging.js +1 -0
- package/dist/react-native/src/shared/serialization.d.ts +22 -0
- package/dist/react-native/src/shared/serialization.js +96 -0
- package/dist/react-native/src/shared/types.d.ts +69 -0
- package/dist/react-native/src/shared/types.js +1 -0
- package/dist/rozenite.json +1 -1
- package/dist/sdk/package.json +3 -0
- package/dist/sdk/sdk.d.ts +10 -0
- package/dist/sdk/sdk.js +8 -0
- package/dist/sdk/src/shared/agent-tools.d.ts +48 -0
- package/dist/sdk/src/shared/agent-tools.js +51 -0
- package/dist/sdk/src/shared/messaging.d.ts +35 -0
- package/dist/sdk/src/shared/messaging.js +2 -0
- package/dist/sdk/src/shared/types.d.ts +69 -0
- package/dist/sdk/src/shared/types.js +5 -0
- package/package.json +17 -18
- package/react-native.ts +8 -1
- package/rozenite.config.ts +1 -0
- package/src/__tests__/release-bundle.test.ts +32 -0
- package/dist/devtools/assets/panel-BGnH7fJp.js +0 -18
- package/dist/devtools/assets/panel-DFvY5duB.css +0 -1
- package/dist/react-native/chunks/useRozeniteControlsPlugin.require.cjs +0 -1
- package/dist/react-native/chunks/useRozeniteControlsPlugin.require.js +0 -466
- package/dist/react-native/index.cjs +0 -1
- package/dist/react-native/index.d.ts +0 -138
- package/dist/react-native/index.js +0 -8
- package/dist/sdk/index.cjs +0 -1
- package/dist/sdk/index.d.ts +0 -150
- package/dist/sdk/index.js +0 -55
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import { RozeniteDevToolsRequestClient } from '@rozenite/plugin-bridge';
|
|
2
|
-
|
|
3
|
-
export declare type ControlsButtonItem = {
|
|
4
|
-
id: string;
|
|
5
|
-
type: 'button';
|
|
6
|
-
title: string;
|
|
7
|
-
actionLabel?: string;
|
|
8
|
-
description?: string;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
onPress: () => void | Promise<void>;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
declare type ControlsButtonItemSnapshot = Omit<ControlsButtonItem, 'onPress'>;
|
|
14
|
-
|
|
15
|
-
declare type ControlsEvent = ControlsSnapshotEvent | ControlsGetSnapshotEvent | ControlsUpdateRequestEvent | ControlsUpdateResultEvent | ControlsInvokeActionEvent;
|
|
16
|
-
|
|
17
|
-
declare type ControlsEventMap = {
|
|
18
|
-
[K in ControlsEvent['type']]: Extract<ControlsEvent, {
|
|
19
|
-
type: K;
|
|
20
|
-
}>;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
declare type ControlsGetSnapshotEvent = {
|
|
24
|
-
type: 'get-snapshot';
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export declare type ControlsInputItem = ControlsMutableItemBase<string> & {
|
|
28
|
-
type: 'input';
|
|
29
|
-
placeholder?: string;
|
|
30
|
-
applyLabel?: string;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
declare type ControlsInputItemSnapshot = Omit<ControlsInputItem, 'validate' | 'onUpdate'>;
|
|
34
|
-
|
|
35
|
-
declare type ControlsInvokeActionEvent = {
|
|
36
|
-
type: 'invoke-action';
|
|
37
|
-
sectionId: string;
|
|
38
|
-
itemId: string;
|
|
39
|
-
action: 'press';
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export declare type ControlsItem = ControlsTextItem | ControlsToggleItem | ControlsButtonItem | ControlsSelectItem | ControlsInputItem;
|
|
43
|
-
|
|
44
|
-
declare type ControlsItemSnapshot = ControlsTextItemSnapshot | ControlsToggleItemSnapshot | ControlsButtonItemSnapshot | ControlsSelectItemSnapshot | ControlsInputItemSnapshot;
|
|
45
|
-
|
|
46
|
-
declare type ControlsMutableItemBase<TValue> = {
|
|
47
|
-
id: string;
|
|
48
|
-
title: string;
|
|
49
|
-
value: TValue;
|
|
50
|
-
description?: string;
|
|
51
|
-
disabled?: boolean;
|
|
52
|
-
validate?: (nextValue: TValue) => ControlsValidationResult;
|
|
53
|
-
onUpdate: (nextValue: TValue) => void | Promise<void>;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export declare type ControlsSection = {
|
|
57
|
-
id: string;
|
|
58
|
-
title: string;
|
|
59
|
-
description?: string;
|
|
60
|
-
items: ControlsItem[];
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
declare type ControlsSectionSnapshot = Omit<ControlsSection, 'items'> & {
|
|
64
|
-
items: ControlsItemSnapshot[];
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export declare type ControlsSelectItem = ControlsMutableItemBase<string> & {
|
|
68
|
-
type: 'select';
|
|
69
|
-
options: ControlsSelectOption[];
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
declare type ControlsSelectItemSnapshot = Omit<ControlsSelectItem, 'validate' | 'onUpdate'>;
|
|
73
|
-
|
|
74
|
-
export declare type ControlsSelectOption = {
|
|
75
|
-
label: string;
|
|
76
|
-
value: string;
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
declare type ControlsSnapshotEvent = {
|
|
80
|
-
type: 'snapshot';
|
|
81
|
-
sections: ControlsSectionSnapshot[];
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
export declare type ControlsTextItem = {
|
|
85
|
-
id: string;
|
|
86
|
-
type: 'text';
|
|
87
|
-
title: string;
|
|
88
|
-
value: string;
|
|
89
|
-
description?: string;
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
declare type ControlsTextItemSnapshot = Omit<ControlsTextItem, never>;
|
|
93
|
-
|
|
94
|
-
export declare type ControlsToggleItem = ControlsMutableItemBase<boolean> & {
|
|
95
|
-
type: 'toggle';
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
declare type ControlsToggleItemSnapshot = Omit<ControlsToggleItem, 'validate' | 'onUpdate'>;
|
|
99
|
-
|
|
100
|
-
declare type ControlsUpdateRequestEvent = {
|
|
101
|
-
type: 'update-request';
|
|
102
|
-
requestId: string;
|
|
103
|
-
sectionId: string;
|
|
104
|
-
itemId: string;
|
|
105
|
-
value: boolean | string;
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
declare type ControlsUpdateResultEvent = {
|
|
109
|
-
type: 'update-result';
|
|
110
|
-
requestId: string;
|
|
111
|
-
sectionId: string;
|
|
112
|
-
itemId: string;
|
|
113
|
-
status: 'ok' | 'error';
|
|
114
|
-
message?: string;
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
export declare type ControlsValidationResult = {
|
|
118
|
-
valid: true;
|
|
119
|
-
} | {
|
|
120
|
-
valid: false;
|
|
121
|
-
message: string;
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
export declare const createSection: <TSection extends ControlsSection>(section: TSection) => TSection;
|
|
125
|
-
|
|
126
|
-
export declare type RozeniteControlsPluginOptions = {
|
|
127
|
-
sections: ControlsSection[];
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
export declare type RozeniteControlsPluginOptionsInput = RozeniteControlsPluginOptions | RozeniteControlsPluginOptionsUpdater;
|
|
131
|
-
|
|
132
|
-
export declare type RozeniteControlsPluginOptionsUpdater = (previousOptions: RozeniteControlsPluginOptions) => RozeniteControlsPluginOptions;
|
|
133
|
-
|
|
134
|
-
export declare let useRozeniteControlsPlugin: typeof useRozeniteControlsPlugin_2;
|
|
135
|
-
|
|
136
|
-
declare const useRozeniteControlsPlugin_2: (optionsInput: RozeniteControlsPluginOptionsInput) => RozeniteDevToolsRequestClient<ControlsEventMap> | null;
|
|
137
|
-
|
|
138
|
-
export { }
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
const i = (n) => n;
|
|
2
|
-
let e;
|
|
3
|
-
const o = process.env.NODE_ENV !== "production", t = typeof window > "u";
|
|
4
|
-
o && !t ? e = require("./chunks/useRozeniteControlsPlugin.require.js").useRozeniteControlsPlugin : e = () => null;
|
|
5
|
-
export {
|
|
6
|
-
i as createSection,
|
|
7
|
-
e as useRozeniteControlsPlugin
|
|
8
|
-
};
|
package/dist/sdk/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@rozenite/agent-shared"),t="@rozenite/controls-plugin",i={listSections:e.defineAgentToolContract({name:"list-sections",description:"List all controls sections with their item IDs, types, and titles. Does not include values — call get-item for that.",inputSchema:{type:"object",properties:{}}}),getItem:e.defineAgentToolContract({name:"get-item",description:"Get full details of a single controls item including its current value. For select items this includes available options.",inputSchema:{type:"object",properties:{sectionId:{type:"string",description:"Section ID."},itemId:{type:"string",description:"Item ID."}},required:["sectionId","itemId"]}}),setValue:e.defineAgentToolContract({name:"set-value",description:"Update the value of a toggle, select, or input item. Runs the validate callback when present. Fails for text (read-only) and button items.",inputSchema:{type:"object",properties:{sectionId:{type:"string",description:"Section ID."},itemId:{type:"string",description:"Item ID."},value:{description:"New value. Boolean for toggle items, string for select/input items."}},required:["sectionId","itemId","value"]}}),pressButton:e.defineAgentToolContract({name:"press-button",description:"Trigger a button item's action. Fails if the item is not a button or is disabled.",inputSchema:{type:"object",properties:{sectionId:{type:"string",description:"Section ID."},itemId:{type:"string",description:"Item ID."}},required:["sectionId","itemId"]}})},o=e.defineAgentToolDescriptors(t,i);exports.CONTROLS_AGENT_PLUGIN_ID=t;exports.controlsToolDefinitions=i;exports.controlsTools=o;
|
package/dist/sdk/index.d.ts
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import { AgentToolContract } from '@rozenite/agent-shared';
|
|
2
|
-
import { AgentToolDescriptor } from '@rozenite/agent-shared';
|
|
3
|
-
|
|
4
|
-
export declare const CONTROLS_AGENT_PLUGIN_ID = "@rozenite/controls-plugin";
|
|
5
|
-
|
|
6
|
-
declare type ControlsButtonItem = {
|
|
7
|
-
id: string;
|
|
8
|
-
type: 'button';
|
|
9
|
-
title: string;
|
|
10
|
-
actionLabel?: string;
|
|
11
|
-
description?: string;
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
onPress: () => void | Promise<void>;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export declare type ControlsButtonItemSnapshot = Omit<ControlsButtonItem, 'onPress'>;
|
|
17
|
-
|
|
18
|
-
export declare type ControlsGetItemArgs = ControlsSectionItemArgs;
|
|
19
|
-
|
|
20
|
-
export declare type ControlsGetItemResult = {
|
|
21
|
-
sectionId: string;
|
|
22
|
-
item: ControlsItemSnapshot;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
declare type ControlsInputItem = ControlsMutableItemBase<string> & {
|
|
26
|
-
type: 'input';
|
|
27
|
-
placeholder?: string;
|
|
28
|
-
applyLabel?: string;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export declare type ControlsInputItemSnapshot = Omit<ControlsInputItem, 'validate' | 'onUpdate'>;
|
|
32
|
-
|
|
33
|
-
declare type ControlsItem = ControlsTextItem | ControlsToggleItem | ControlsButtonItem | ControlsSelectItem | ControlsInputItem;
|
|
34
|
-
|
|
35
|
-
export declare type ControlsItemSnapshot = ControlsTextItemSnapshot | ControlsToggleItemSnapshot | ControlsButtonItemSnapshot | ControlsSelectItemSnapshot | ControlsInputItemSnapshot;
|
|
36
|
-
|
|
37
|
-
export declare type ControlsListSectionItemSummary = {
|
|
38
|
-
id: string;
|
|
39
|
-
type: ControlsItem['type'];
|
|
40
|
-
title: string;
|
|
41
|
-
disabled?: boolean;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export declare type ControlsListSectionsArgs = undefined;
|
|
45
|
-
|
|
46
|
-
export declare type ControlsListSectionsResult = {
|
|
47
|
-
sections: ControlsListSectionSummary[];
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export declare type ControlsListSectionSummary = {
|
|
51
|
-
id: string;
|
|
52
|
-
title: string;
|
|
53
|
-
description?: string;
|
|
54
|
-
items: ControlsListSectionItemSummary[];
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
declare type ControlsMutableItemBase<TValue> = {
|
|
58
|
-
id: string;
|
|
59
|
-
title: string;
|
|
60
|
-
value: TValue;
|
|
61
|
-
description?: string;
|
|
62
|
-
disabled?: boolean;
|
|
63
|
-
validate?: (nextValue: TValue) => ControlsValidationResult;
|
|
64
|
-
onUpdate: (nextValue: TValue) => void | Promise<void>;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export declare type ControlsPressButtonArgs = ControlsSectionItemArgs;
|
|
68
|
-
|
|
69
|
-
export declare type ControlsPressButtonResult = {
|
|
70
|
-
pressed: true;
|
|
71
|
-
sectionId: string;
|
|
72
|
-
itemId: string;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
declare type ControlsSection = {
|
|
76
|
-
id: string;
|
|
77
|
-
title: string;
|
|
78
|
-
description?: string;
|
|
79
|
-
items: ControlsItem[];
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export declare type ControlsSectionItemArgs = {
|
|
83
|
-
sectionId: string;
|
|
84
|
-
itemId: string;
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
export declare type ControlsSectionSnapshot = Omit<ControlsSection, 'items'> & {
|
|
88
|
-
items: ControlsItemSnapshot[];
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
declare type ControlsSelectItem = ControlsMutableItemBase<string> & {
|
|
92
|
-
type: 'select';
|
|
93
|
-
options: ControlsSelectOption[];
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
export declare type ControlsSelectItemSnapshot = Omit<ControlsSelectItem, 'validate' | 'onUpdate'>;
|
|
97
|
-
|
|
98
|
-
export declare type ControlsSelectOption = {
|
|
99
|
-
label: string;
|
|
100
|
-
value: string;
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
export declare type ControlsSetValueArgs = ControlsSectionItemArgs & {
|
|
104
|
-
value: boolean | string;
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
export declare type ControlsSetValueResult = {
|
|
108
|
-
applied: true;
|
|
109
|
-
sectionId: string;
|
|
110
|
-
itemId: string;
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
declare type ControlsTextItem = {
|
|
114
|
-
id: string;
|
|
115
|
-
type: 'text';
|
|
116
|
-
title: string;
|
|
117
|
-
value: string;
|
|
118
|
-
description?: string;
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
export declare type ControlsTextItemSnapshot = Omit<ControlsTextItem, never>;
|
|
122
|
-
|
|
123
|
-
declare type ControlsToggleItem = ControlsMutableItemBase<boolean> & {
|
|
124
|
-
type: 'toggle';
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
export declare type ControlsToggleItemSnapshot = Omit<ControlsToggleItem, 'validate' | 'onUpdate'>;
|
|
128
|
-
|
|
129
|
-
export declare const controlsToolDefinitions: {
|
|
130
|
-
readonly listSections: AgentToolContract<undefined, ControlsListSectionsResult>;
|
|
131
|
-
readonly getItem: AgentToolContract<ControlsSectionItemArgs, ControlsGetItemResult>;
|
|
132
|
-
readonly setValue: AgentToolContract<ControlsSetValueArgs, ControlsSetValueResult>;
|
|
133
|
-
readonly pressButton: AgentToolContract<ControlsSectionItemArgs, ControlsPressButtonResult>;
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
export declare const controlsTools: {
|
|
137
|
-
readonly listSections: AgentToolDescriptor<undefined, ControlsListSectionsResult>;
|
|
138
|
-
readonly getItem: AgentToolDescriptor<ControlsSectionItemArgs, ControlsGetItemResult>;
|
|
139
|
-
readonly setValue: AgentToolDescriptor<ControlsSetValueArgs, ControlsSetValueResult>;
|
|
140
|
-
readonly pressButton: AgentToolDescriptor<ControlsSectionItemArgs, ControlsPressButtonResult>;
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
declare type ControlsValidationResult = {
|
|
144
|
-
valid: true;
|
|
145
|
-
} | {
|
|
146
|
-
valid: false;
|
|
147
|
-
message: string;
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
export { }
|
package/dist/sdk/index.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { defineAgentToolContract as e, defineAgentToolDescriptors as t } from "@rozenite/agent-shared";
|
|
2
|
-
const i = "@rozenite/controls-plugin", o = {
|
|
3
|
-
listSections: e({
|
|
4
|
-
name: "list-sections",
|
|
5
|
-
description: "List all controls sections with their item IDs, types, and titles. Does not include values — call get-item for that.",
|
|
6
|
-
inputSchema: { type: "object", properties: {} }
|
|
7
|
-
}),
|
|
8
|
-
getItem: e({
|
|
9
|
-
name: "get-item",
|
|
10
|
-
description: "Get full details of a single controls item including its current value. For select items this includes available options.",
|
|
11
|
-
inputSchema: {
|
|
12
|
-
type: "object",
|
|
13
|
-
properties: {
|
|
14
|
-
sectionId: { type: "string", description: "Section ID." },
|
|
15
|
-
itemId: { type: "string", description: "Item ID." }
|
|
16
|
-
},
|
|
17
|
-
required: ["sectionId", "itemId"]
|
|
18
|
-
}
|
|
19
|
-
}),
|
|
20
|
-
setValue: e({
|
|
21
|
-
name: "set-value",
|
|
22
|
-
description: "Update the value of a toggle, select, or input item. Runs the validate callback when present. Fails for text (read-only) and button items.",
|
|
23
|
-
inputSchema: {
|
|
24
|
-
type: "object",
|
|
25
|
-
properties: {
|
|
26
|
-
sectionId: { type: "string", description: "Section ID." },
|
|
27
|
-
itemId: { type: "string", description: "Item ID." },
|
|
28
|
-
value: {
|
|
29
|
-
description: "New value. Boolean for toggle items, string for select/input items."
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
required: ["sectionId", "itemId", "value"]
|
|
33
|
-
}
|
|
34
|
-
}),
|
|
35
|
-
pressButton: e({
|
|
36
|
-
name: "press-button",
|
|
37
|
-
description: "Trigger a button item's action. Fails if the item is not a button or is disabled.",
|
|
38
|
-
inputSchema: {
|
|
39
|
-
type: "object",
|
|
40
|
-
properties: {
|
|
41
|
-
sectionId: { type: "string", description: "Section ID." },
|
|
42
|
-
itemId: { type: "string", description: "Item ID." }
|
|
43
|
-
},
|
|
44
|
-
required: ["sectionId", "itemId"]
|
|
45
|
-
}
|
|
46
|
-
})
|
|
47
|
-
}, n = t(
|
|
48
|
-
i,
|
|
49
|
-
o
|
|
50
|
-
);
|
|
51
|
-
export {
|
|
52
|
-
i as CONTROLS_AGENT_PLUGIN_ID,
|
|
53
|
-
o as controlsToolDefinitions,
|
|
54
|
-
n as controlsTools
|
|
55
|
-
};
|