@capybara-hq/plugin-sdk 0.1.0-rc.64 → 0.1.0-rc.66

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.
@@ -9,7 +9,7 @@ the file's base name.
9
9
  {
10
10
  "$schema": "https://capybarahq.com/schemas/connector-template.v1.schema.json",
11
11
  "displayName": { "zh": "Acme CRM", "en": "Acme CRM" },
12
- "description": "Acme CRM over MCP",
12
+ "description": { "zh": "通过 MCP 访问 Acme CRM", "en": "Acme CRM over MCP" },
13
13
  "template": {
14
14
  "plugin": "connector-mcp",
15
15
  "pluginVersion": "^0.1.0-rc.0",
@@ -28,12 +28,15 @@ The file is strict. Top-level fields:
28
28
  | Field | Type | Required |
29
29
  |---|---|---|
30
30
  | `displayName` | object | yes |
31
- | `description` | string | no |
31
+ | `description` | string or object | no |
32
32
  | `icon` | string | no |
33
33
  | `defaultEnabled` | boolean | no |
34
34
  | `template` | object | yes |
35
35
  <!-- /generated -->
36
36
 
37
+ `description` is a string (shown in every language) or `{ "zh", "en" }`, each text at most 1024
38
+ characters; the UI shows the text for its language.
39
+
37
40
  Fields of `template`:
38
41
 
39
42
  - `plugin`, `connector`: the connector extension and its kind; `pluginVersion` is a semver range.
@@ -224,7 +224,11 @@ export interface SandboxBrowseScope extends SandboxOperationRef {
224
224
  }
225
225
  /** Browsing exposes metadata only: no file contents, writes, preparation or execution. */
226
226
  export type SandboxBrowse = Pick<SandboxOperation, "stat"> & Required<Pick<SandboxOperation, "list" | "scan">>;
227
- /** An opaque locator over authenticated transport; validate generation before status, tail or stop. */
227
+ /**
228
+ * An opaque locator over authenticated transport; validate generation before status, tail or stop.
229
+ * `instanceGeneration` is the provider's own generation of the instance (the kernel's when the
230
+ * provider keeps none); the kernel stores the ref as returned and never compares it with its own.
231
+ */
228
232
  export interface SandboxExecutionRef {
229
233
  readonly executionId: string;
230
234
  readonly operationId: string;
@@ -261,7 +265,9 @@ export interface SandboxBackground {
261
265
  * Validate outputPath inside the scope. retainUntilMs bounds status/output record retention.
262
266
  * instanceGeneration is the kernel's generation of the held instance `h` (the kernel always
263
267
  * passes it, and allocates it only after `create` returns): a provider that keeps no generation
264
- * of its own (a cloud provider) returns it in the reference and keys start idempotency by it.
268
+ * of its own (a cloud provider) returns it in the reference and keys start idempotency by it; one
269
+ * that keeps its own (device-local's bound machine generation) returns that one instead. The
270
+ * kernel pins the task to its own generation and the held handle's id, not the ref's generation.
265
271
  */
266
272
  start(h: SandboxHandle, scope: SandboxOperationScope, args: SandboxExecOptions & {
267
273
  taskId: string;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const SDK_VERSION = "0.1.0-rc.64";
1
+ export declare const SDK_VERSION = "0.1.0-rc.66";
2
2
  export * from "./agent-template.js";
3
3
  export * from "./avatar-presets.js";
4
4
  export * from "./bootstrap.js";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export const SDK_VERSION = "0.1.0-rc.64";
1
+ export const SDK_VERSION = "0.1.0-rc.66";
2
2
  export * from "./agent-template.js";
3
3
  export * from "./avatar-presets.js";
4
4
  export * from "./bootstrap.js";
@@ -156,7 +156,11 @@ export interface PluginManifest {
156
156
  /** A connector template file `connectors/<id>.json`; the template id is the file's base name. */
157
157
  export interface ConnectorTemplateFile {
158
158
  displayName: LocalizedName;
159
- description?: string;
159
+ /**
160
+ * A string (shown in both languages) or `{ zh, en }`; each text ≤
161
+ * {@link CONNECTOR_TEMPLATE_LIMITS}`.descriptionChars` characters.
162
+ */
163
+ description?: string | LocalizedName;
160
164
  /** Safe path relative to the plugin root (an optional leading `./`), .svg / .png. */
161
165
  icon?: string;
162
166
  /**
@@ -453,7 +453,15 @@ const template = z.strictObject({
453
453
  const templateFile = z
454
454
  .strictObject({
455
455
  displayName: localized,
456
- description: text(CONNECTOR_TEMPLATE_LIMITS.descriptionChars, "description").optional(),
456
+ description: z
457
+ .union([
458
+ text(CONNECTOR_TEMPLATE_LIMITS.descriptionChars, "description"),
459
+ z.strictObject({
460
+ zh: text(CONNECTOR_TEMPLATE_LIMITS.descriptionChars, "description.zh"),
461
+ en: text(CONNECTOR_TEMPLATE_LIMITS.descriptionChars, "description.en"),
462
+ }),
463
+ ])
464
+ .optional(),
457
465
  icon: z
458
466
  .string()
459
467
  .max(L.pathChars)
@@ -153,7 +153,7 @@ export declare const CONNECTOR_TEMPLATE_LIMITS: {
153
153
  readonly toolPolicies: 1000;
154
154
  /** Upper bound on the characters of publisher. */
155
155
  readonly publisherChars: 100;
156
- /** Upper bound on the characters of description. */
156
+ /** Upper bound on the characters of description (per language when it is `{ zh, en }`). */
157
157
  readonly descriptionChars: 1024;
158
158
  /** Upper bound on the characters of displayName per language. */
159
159
  readonly displayNameChars: 100;
@@ -280,7 +280,7 @@ export const CONNECTOR_TEMPLATE_LIMITS = {
280
280
  toolPolicies: 1000,
281
281
  /** Upper bound on the characters of publisher. */
282
282
  publisherChars: 100,
283
- /** Upper bound on the characters of description. */
283
+ /** Upper bound on the characters of description (per language when it is `{ zh, en }`). */
284
284
  descriptionChars: 1024,
285
285
  /** Upper bound on the characters of displayName per language. */
286
286
  displayNameChars: 100,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capybara-hq/plugin-sdk",
3
- "version": "0.1.0-rc.64",
3
+ "version": "0.1.0-rc.66",
4
4
  "description": "Capybara plugin SDK: the types and pure functions plugins are written against",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -27,10 +27,36 @@
27
27
  "additionalProperties": false
28
28
  },
29
29
  "description": {
30
- "type": "string",
31
- "minLength": 1,
32
- "maxLength": 1024,
33
- "pattern": "\\S"
30
+ "anyOf": [
31
+ {
32
+ "type": "string",
33
+ "minLength": 1,
34
+ "maxLength": 1024,
35
+ "pattern": "\\S"
36
+ },
37
+ {
38
+ "type": "object",
39
+ "properties": {
40
+ "zh": {
41
+ "type": "string",
42
+ "minLength": 1,
43
+ "maxLength": 1024,
44
+ "pattern": "\\S"
45
+ },
46
+ "en": {
47
+ "type": "string",
48
+ "minLength": 1,
49
+ "maxLength": 1024,
50
+ "pattern": "\\S"
51
+ }
52
+ },
53
+ "required": [
54
+ "zh",
55
+ "en"
56
+ ],
57
+ "additionalProperties": false
58
+ }
59
+ ]
34
60
  },
35
61
  "icon": {
36
62
  "type": "string",