@capybara-hq/plugin-sdk 0.1.0-rc.7 → 0.1.0-rc.71

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.
Files changed (146) hide show
  1. package/README.md +1 -1
  2. package/agent-docs/agent-templates.md +14 -2
  3. package/agent-docs/concepts.md +14 -5
  4. package/agent-docs/connector-templates.md +11 -3
  5. package/agent-docs/extension-points/channel.md +1 -1
  6. package/agent-docs/extension-points/context.md +15 -0
  7. package/agent-docs/extension-points/device-provider.md +15 -0
  8. package/agent-docs/extension-points/file-preview.md +3 -1
  9. package/agent-docs/extension-points/model-provider.md +3 -1
  10. package/agent-docs/extension-points/object-store.md +2 -0
  11. package/agent-docs/extension-points/push-provider.md +17 -0
  12. package/agent-docs/extensions.md +77 -4
  13. package/agent-docs/plugin-format.md +51 -12
  14. package/agent-docs/setup.md +54 -0
  15. package/dist/agent-template.d.ts +15 -6
  16. package/dist/agent-template.js +32 -13
  17. package/dist/avatar-presets.d.ts +8 -0
  18. package/dist/avatar-presets.js +17 -0
  19. package/dist/bootstrap.d.ts +109 -1
  20. package/dist/bootstrap.js +185 -2
  21. package/dist/cards.d.ts +60 -13
  22. package/dist/cards.js +88 -18
  23. package/dist/channel.d.ts +128 -47
  24. package/dist/channel.js +10 -5
  25. package/dist/client-css.d.ts +36 -0
  26. package/dist/client-css.js +326 -0
  27. package/dist/client-section.d.ts +35 -0
  28. package/dist/client-section.js +133 -0
  29. package/dist/config-ui.d.ts +28 -6
  30. package/dist/config-ui.js +88 -25
  31. package/dist/config-url-fetch.d.ts +19 -0
  32. package/dist/config-url-fetch.js +43 -0
  33. package/dist/connector-auth.d.ts +13 -2
  34. package/dist/connector-auth.js +82 -8
  35. package/dist/connector.d.ts +74 -32
  36. package/dist/context.d.ts +40 -0
  37. package/dist/context.js +2 -0
  38. package/dist/ctx.d.ts +210 -30
  39. package/dist/ctx.js +9 -1
  40. package/dist/define-extension.d.ts +23 -13
  41. package/dist/define-extension.js +19 -5
  42. package/dist/device-denied-paths.d.ts +20 -0
  43. package/dist/device-denied-paths.js +118 -0
  44. package/dist/device-operation.d.ts +339 -0
  45. package/dist/device-operation.js +312 -0
  46. package/dist/device-protocol.d.ts +285 -50
  47. package/dist/device-protocol.js +755 -90
  48. package/dist/device-provider.d.ts +708 -0
  49. package/dist/device-provider.js +325 -0
  50. package/dist/device-service.d.ts +52 -0
  51. package/dist/device-service.js +105 -0
  52. package/dist/dial-in.d.ts +239 -0
  53. package/dist/dial-in.js +155 -0
  54. package/dist/directory.d.ts +15 -12
  55. package/dist/extension-point.d.ts +2 -0
  56. package/dist/extension-point.js +7 -3
  57. package/dist/field-meta.d.ts +19 -0
  58. package/dist/field-meta.js +54 -0
  59. package/dist/file-preview.d.ts +43 -10
  60. package/dist/git-hosts.d.ts +53 -0
  61. package/dist/git-hosts.js +98 -0
  62. package/dist/hooks.d.ts +125 -20
  63. package/dist/hooks.js +5 -0
  64. package/dist/http-access.d.ts +71 -0
  65. package/dist/http-access.js +12 -0
  66. package/dist/identity.d.ts +38 -9
  67. package/dist/identity.js +21 -1
  68. package/dist/index.d.ts +31 -4
  69. package/dist/index.js +31 -4
  70. package/dist/model-params.d.ts +41 -22
  71. package/dist/model-params.js +28 -15
  72. package/dist/model.d.ts +210 -75
  73. package/dist/model.js +152 -19
  74. package/dist/net.d.ts +52 -0
  75. package/dist/net.js +34 -0
  76. package/dist/network-classes.d.ts +98 -0
  77. package/dist/network-classes.js +291 -0
  78. package/dist/permissions.d.ts +65 -22
  79. package/dist/permissions.js +139 -43
  80. package/dist/platform-only.d.ts +27 -0
  81. package/dist/platform-only.js +35 -0
  82. package/dist/plugin-manifest.d.ts +40 -9
  83. package/dist/plugin-manifest.js +171 -60
  84. package/dist/plugin-package.d.ts +82 -39
  85. package/dist/plugin-package.js +68 -41
  86. package/dist/push.d.ts +75 -0
  87. package/dist/push.js +87 -0
  88. package/dist/sandbox-linux-runtime-source.d.ts +1 -0
  89. package/dist/sandbox-linux-runtime-source.js +2343 -0
  90. package/dist/sandbox-native-runtime-source.d.ts +10 -0
  91. package/dist/sandbox-native-runtime-source.js +476 -0
  92. package/dist/sandbox-runtime-source.d.ts +47 -0
  93. package/dist/sandbox-runtime-source.js +73 -0
  94. package/dist/sandbox-write-denies.d.ts +139 -0
  95. package/dist/sandbox-write-denies.js +869 -0
  96. package/dist/secret.d.ts +8 -2
  97. package/dist/secret.js +11 -4
  98. package/dist/setup-check.d.ts +128 -0
  99. package/dist/setup-check.js +142 -0
  100. package/dist/setup-guide-parse.d.ts +121 -0
  101. package/dist/setup-guide-parse.js +356 -0
  102. package/dist/setup-guide-render.d.ts +45 -0
  103. package/dist/setup-guide-render.js +351 -0
  104. package/dist/setup-guide.d.ts +86 -72
  105. package/dist/setup-guide.js +340 -108
  106. package/dist/shell-capabilities.d.ts +211 -0
  107. package/dist/shell-capabilities.js +44 -0
  108. package/dist/shell-environment.d.ts +57 -0
  109. package/dist/shell-environment.js +21 -0
  110. package/dist/skill.d.ts +27 -17
  111. package/dist/skill.js +40 -26
  112. package/dist/storage.d.ts +52 -25
  113. package/dist/svg-viewbox.d.ts +10 -0
  114. package/dist/svg-viewbox.js +24 -0
  115. package/dist/theme-assets.d.ts +55 -0
  116. package/dist/theme-assets.js +489 -0
  117. package/dist/theme-readability.d.ts +37 -0
  118. package/dist/theme-readability.js +145 -0
  119. package/dist/theme-tokens.generated.d.ts +299 -0
  120. package/dist/theme-tokens.generated.js +184 -0
  121. package/dist/theme.d.ts +190 -0
  122. package/dist/theme.js +471 -0
  123. package/dist/tool.d.ts +104 -30
  124. package/dist/tool.js +29 -9
  125. package/dist/ui-parts.d.ts +23 -0
  126. package/dist/ui-parts.js +385 -0
  127. package/dist/ui-resolve.d.ts +35 -0
  128. package/dist/ui-resolve.js +42 -0
  129. package/dist/ui-slots.d.ts +65 -0
  130. package/dist/ui-slots.js +261 -0
  131. package/dist/ui.d.ts +232 -77
  132. package/dist/ui.js +104 -27
  133. package/dist/url.d.ts +4 -1
  134. package/dist/url.js +4 -1
  135. package/dist/web.d.ts +26 -20
  136. package/package.json +13 -1
  137. package/schemas/bootstrap-extra.v1.schema.json +186 -0
  138. package/schemas/bootstrap.v1.schema.json +20 -0
  139. package/schemas/connector-template.v1.schema.json +62 -4
  140. package/schemas/plugin.v1.schema.json +93 -143
  141. package/schemas/theme.v1.schema.json +302 -0
  142. package/agent-docs/extension-points/sandbox.md +0 -15
  143. package/dist/org-access.d.ts +0 -27
  144. package/dist/org-access.js +0 -35
  145. package/dist/sandbox.d.ts +0 -254
  146. package/dist/sandbox.js +0 -153
@@ -0,0 +1,261 @@
1
+ /** Every slot id of the catalog, in catalog order (UI slots spec §3). */
2
+ export const UI_SLOT_IDS = [
3
+ "conversation.panel",
4
+ "conversation.properties.section",
5
+ "conversation.tool-result.card",
6
+ "org.page",
7
+ "file.preview",
8
+ "agent.detail.section",
9
+ "org.settings.section",
10
+ "platform.page",
11
+ "shell.brand",
12
+ "shell.overlay",
13
+ "conversation.empty",
14
+ "conversation.composer.frame",
15
+ ];
16
+ const COMPACT_ORDER = ["kept", "drawer", "hidden"];
17
+ /** True when `v` is one of the three compact forms (used to validate manifests). */
18
+ export function isCompactForm(v) {
19
+ return typeof v === "string" && COMPACT_ORDER.includes(v);
20
+ }
21
+ /** A contribution may narrow its slot's compact form, never widen it. */
22
+ export function effectiveCompact(slot, contribution) {
23
+ if (contribution === undefined)
24
+ return slot;
25
+ return COMPACT_ORDER.indexOf(contribution) > COMPACT_ORDER.indexOf(slot) ? contribution : slot;
26
+ }
27
+ const SLOT_DATA = [
28
+ {
29
+ id: "conversation.panel",
30
+ version: 1,
31
+ owner: "components/conversation/RightArea.tsx",
32
+ scope: "conversation",
33
+ accepts: ["view", "embed", "component"],
34
+ cardinality: "list",
35
+ minRole: "guest",
36
+ args: ["conversationId", "item"],
37
+ density: "regular",
38
+ icon: "optional",
39
+ compact: "drawer",
40
+ description: {
41
+ en: "A panel beside the conversation, opened from the right area.",
42
+ zh: "对话旁的面板,从右侧区域打开。",
43
+ },
44
+ },
45
+ {
46
+ id: "conversation.properties.section",
47
+ version: 1,
48
+ owner: "components/conversation/PropertiesSections.tsx",
49
+ scope: "conversation",
50
+ accepts: ["view", "embed", "component"],
51
+ cardinality: "list",
52
+ minRole: "guest",
53
+ args: ["conversationId"],
54
+ density: "dense",
55
+ icon: "optional",
56
+ compact: "kept",
57
+ anchors: ["context", "files", "background"],
58
+ description: {
59
+ en: "A section in the conversation properties list.",
60
+ zh: "对话属性列表中的一个分区。",
61
+ },
62
+ },
63
+ {
64
+ id: "conversation.tool-result.card",
65
+ version: 1,
66
+ owner: "components/conversation/RightArea.tsx",
67
+ scope: "conversation",
68
+ accepts: ["view", "embed", "component"],
69
+ cardinality: "list",
70
+ minRole: "guest",
71
+ args: ["conversationId", "card"],
72
+ density: "regular",
73
+ icon: "optional",
74
+ compact: "kept",
75
+ description: {
76
+ en: "A card a tool result opens in the conversation.",
77
+ zh: "工具结果在对话中打开的卡片。",
78
+ },
79
+ },
80
+ {
81
+ id: "org.page",
82
+ version: 1,
83
+ owner: "app/(app)/p/[plugin]/[id]/view.tsx",
84
+ scope: "org",
85
+ accepts: ["view", "embed", "component"],
86
+ cardinality: "list",
87
+ minRole: "member",
88
+ args: [],
89
+ density: "regular",
90
+ icon: "optional",
91
+ compact: "kept",
92
+ description: {
93
+ en: "A full page in the organization navigation.",
94
+ zh: "组织导航中的完整页面。",
95
+ },
96
+ },
97
+ {
98
+ id: "file.preview",
99
+ version: 1,
100
+ owner: "components/conversation/FilePanel.tsx",
101
+ scope: "file",
102
+ accepts: ["embed"],
103
+ cardinality: "list",
104
+ minRole: "guest",
105
+ args: ["conversationId", "fileId"],
106
+ density: "regular",
107
+ icon: "optional",
108
+ compact: "kept",
109
+ description: {
110
+ en: "A previewer for a file of the conversation.",
111
+ zh: "对话中文件的预览器。",
112
+ },
113
+ },
114
+ {
115
+ id: "agent.detail.section",
116
+ version: 1,
117
+ owner: "components/agent/AgentPage.tsx",
118
+ scope: "agent",
119
+ accepts: ["view", "embed", "component"],
120
+ cardinality: "list",
121
+ minRole: "guest",
122
+ args: ["agentId"],
123
+ density: "regular",
124
+ icon: "optional",
125
+ compact: "kept",
126
+ description: {
127
+ en: "A section on the detail page of an agent.",
128
+ zh: "智能体详情页中的一个分区。",
129
+ },
130
+ },
131
+ {
132
+ id: "org.settings.section",
133
+ version: 1,
134
+ owner: "app/(app)/settings/organization/view.tsx",
135
+ scope: "org",
136
+ accepts: ["view", "embed", "component"],
137
+ cardinality: "list",
138
+ minRole: "admin",
139
+ args: [],
140
+ density: "regular",
141
+ icon: "optional",
142
+ compact: "kept",
143
+ description: {
144
+ en: "A section on the organization settings page.",
145
+ zh: "组织设置页中的一个分区。",
146
+ },
147
+ },
148
+ {
149
+ id: "platform.page",
150
+ version: 1,
151
+ owner: "app/(app)/admin/p/[plugin]/[id]/view.tsx",
152
+ scope: "platform",
153
+ accepts: ["view", "embed", "component"],
154
+ cardinality: "list",
155
+ minRole: "superAdmin",
156
+ args: [],
157
+ density: "regular",
158
+ icon: "optional",
159
+ compact: "kept",
160
+ description: {
161
+ en: "A full page in the platform administration.",
162
+ zh: "平台管理中的完整页面。",
163
+ },
164
+ },
165
+ {
166
+ id: "shell.brand",
167
+ version: 1,
168
+ owner: "components/shell/AppFrame.tsx",
169
+ scope: "org",
170
+ accepts: ["component"],
171
+ cardinality: "single",
172
+ replaceable: true,
173
+ builtin: { en: "The logo and wordmark in the sidebar.", zh: "侧边栏中的标志与字标。" },
174
+ minRole: "guest",
175
+ args: [],
176
+ density: "regular",
177
+ icon: "none",
178
+ compact: "hidden",
179
+ description: {
180
+ en: "The brand row of the sidebar (the mark of the collapsed rail).",
181
+ zh: "侧边栏的品牌行(收起后的窄栏标记)。",
182
+ },
183
+ },
184
+ {
185
+ id: "shell.overlay",
186
+ version: 1,
187
+ owner: "components/shell/AppFrame.tsx",
188
+ scope: "org",
189
+ accepts: ["component"],
190
+ cardinality: "list",
191
+ minRole: "guest",
192
+ args: [],
193
+ density: "regular",
194
+ icon: "none",
195
+ compact: "kept",
196
+ limits: { maxShown: 4 },
197
+ description: {
198
+ en: "A full-viewport layer over the workspace shell.",
199
+ zh: "覆盖工作区外壳的全视口图层。",
200
+ },
201
+ },
202
+ {
203
+ id: "conversation.empty",
204
+ version: 1,
205
+ owner: "components/conversation/NewConversation.tsx",
206
+ scope: "org",
207
+ accepts: ["component"],
208
+ cardinality: "single",
209
+ replaceable: true,
210
+ builtin: { en: "The greeting of the new-conversation page.", zh: "新对话页的问候区。" },
211
+ minRole: "guest",
212
+ args: [],
213
+ density: "regular",
214
+ icon: "none",
215
+ compact: "kept",
216
+ description: {
217
+ en: "The hero of the new-conversation page.",
218
+ zh: "新对话页的主视觉区。",
219
+ },
220
+ },
221
+ {
222
+ id: "conversation.composer.frame",
223
+ version: 1,
224
+ owner: "components/conversation/ComposerBar.tsx",
225
+ scope: "org",
226
+ accepts: ["component"],
227
+ cardinality: "single",
228
+ replaceable: true,
229
+ builtin: { en: "The frame around the message composer.", zh: "消息输入框外的边框。" },
230
+ minRole: "guest",
231
+ args: [],
232
+ density: "regular",
233
+ icon: "none",
234
+ compact: "kept",
235
+ description: {
236
+ en: "The frame around the composer, on the new-conversation and conversation pages.",
237
+ zh: "新对话页与对话页中输入框外的边框。",
238
+ },
239
+ },
240
+ ];
241
+ export const UI_SLOTS = SLOT_DATA;
242
+ export function uiSlot(id) {
243
+ return UI_SLOTS.find((s) => s.id === id);
244
+ }
245
+ const SLOT_REF_RE = /^([a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)+)(?:@([1-9][0-9]{0,2}))?$/;
246
+ /** Reads `<id>` or `<id>@<version>` (version 1 when omitted); does not check the catalog. */
247
+ export function parseSlotRef(ref) {
248
+ const m = SLOT_REF_RE.exec(ref);
249
+ if (!m)
250
+ return null;
251
+ return { id: m[1], version: m[2] === undefined ? 1 : Number(m[2]) };
252
+ }
253
+ export const UI_ARRANGEABLE_SLOTS = UI_SLOT_IDS.filter((id) => id !== "file.preview");
254
+ /** Slots with one winner that replaces a built-in block. */
255
+ export const UI_SINGLE_SLOTS = UI_SLOTS.filter((s) => s.cardinality === "single").map((s) => s.id);
256
+ /** Slots that accept the `component` kind. */
257
+ export const UI_COMPONENT_SLOTS = UI_SLOTS.filter((s) => s.accepts.includes("component")).map((s) => s.id);
258
+ export const UI_CONTRIBUTION_KEY_RE = /^[a-z][a-z0-9-]{1,40}\/[a-z][a-z0-9-]{0,39}$/;
259
+ export function uiContributionKey(plugin, id) {
260
+ return `${plugin}/${id}`;
261
+ }