@capybara-hq/plugin-sdk 0.1.0-rc.2 → 0.1.0-rc.4

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 (54) hide show
  1. package/README.md +1 -1
  2. package/agent-docs/agent-templates.md +47 -0
  3. package/agent-docs/concepts.md +58 -0
  4. package/agent-docs/connector-templates.md +47 -0
  5. package/agent-docs/extension-points/channel.md +15 -0
  6. package/agent-docs/extension-points/config-source.md +15 -0
  7. package/agent-docs/extension-points/connector.md +15 -0
  8. package/agent-docs/extension-points/counter.md +15 -0
  9. package/agent-docs/extension-points/directory.md +15 -0
  10. package/agent-docs/extension-points/file-preview.md +15 -0
  11. package/agent-docs/extension-points/identity-source.md +15 -0
  12. package/agent-docs/extension-points/model-provider.md +15 -0
  13. package/agent-docs/extension-points/object-store.md +15 -0
  14. package/agent-docs/extension-points/sandbox.md +15 -0
  15. package/agent-docs/extension-points/secret-store.md +15 -0
  16. package/agent-docs/extension-points/web-fetch.md +15 -0
  17. package/agent-docs/extension-points/web-search.md +15 -0
  18. package/agent-docs/extensions.md +63 -0
  19. package/agent-docs/plugin-format.md +60 -0
  20. package/agent-docs/skills.md +44 -0
  21. package/agent-docs/tool-naming.md +21 -0
  22. package/dist/agent-template.d.ts +85 -0
  23. package/dist/agent-template.js +361 -2
  24. package/dist/config-ui.d.ts +2 -1
  25. package/dist/config-ui.js +25 -7
  26. package/dist/ctx.d.ts +65 -1
  27. package/dist/directory.d.ts +11 -2
  28. package/dist/extension-point.d.ts +4 -0
  29. package/dist/extension-point.js +16 -14
  30. package/dist/file-preview.d.ts +8 -0
  31. package/dist/hooks.d.ts +73 -14
  32. package/dist/index.d.ts +2 -1
  33. package/dist/index.js +2 -1
  34. package/dist/marketplace.d.ts +29 -2
  35. package/dist/marketplace.js +30 -2
  36. package/dist/model.d.ts +60 -2
  37. package/dist/model.js +22 -0
  38. package/dist/org-access.d.ts +27 -0
  39. package/dist/org-access.js +35 -0
  40. package/dist/permissions.d.ts +4 -1
  41. package/dist/plugin-manifest.d.ts +15 -2
  42. package/dist/plugin-manifest.js +11 -1
  43. package/dist/sandbox.d.ts +140 -60
  44. package/dist/sandbox.js +30 -6
  45. package/dist/skill-invocation.d.ts +8 -5
  46. package/dist/skill-invocation.js +17 -8
  47. package/dist/skill.d.ts +20 -3
  48. package/dist/skill.js +28 -6
  49. package/dist/tool.d.ts +8 -0
  50. package/dist/ui.d.ts +8 -0
  51. package/dist/web.d.ts +30 -5
  52. package/package.json +4 -2
  53. package/schemas/marketplace.v1.schema.json +36 -0
  54. package/schemas/plugin.v1.schema.json +29 -4
package/dist/web.d.ts CHANGED
@@ -12,10 +12,16 @@ export interface WebSearchResult {
12
12
  /** ISO 8601 date or datetime, when known. */
13
13
  publishedAt?: string;
14
14
  }
15
- /** A web search provider (`web-search@1`). The kernel passes the org's decrypted `orgConfig`. */
15
+ /**
16
+ * A web search provider (`web-search@1`). The kernel passes the org's decrypted `orgConfig` and the
17
+ * extension's effective deployment config for the org (`config`).
18
+ */
16
19
  export interface WebSearchProvider {
17
- /** False when this org's config lacks what the provider needs. */
18
- configured?(orgConfig: unknown): boolean;
20
+ /**
21
+ * False when this org's config lacks what the provider needs. `config` is the effective
22
+ * deployment config for the org (see `search`'s `config`).
23
+ */
24
+ configured?(orgConfig: unknown, config?: unknown): boolean;
19
25
  search(args: {
20
26
  query: string;
21
27
  /** Hints only: the kernel filters the results again. */
@@ -23,6 +29,14 @@ export interface WebSearchProvider {
23
29
  blockedDomains?: string[];
24
30
  maxResults: number;
25
31
  orgConfig: unknown;
32
+ /**
33
+ * The extension's effective deployment config for this org: the platform's deployment config
34
+ * with the org's copy applied to the overridable fields (`orgAccess(…, "override")`), or the
35
+ * platform's config (equal to `ctx.config`) while the org follows it. Use it, not `ctx.config`,
36
+ * for work done for this org. Optional in the type so older extensions compile; the kernel
37
+ * always passes it.
38
+ */
39
+ config?: unknown;
26
40
  signal: AbortSignal;
27
41
  }): Promise<{
28
42
  results: WebSearchResult[];
@@ -48,12 +62,23 @@ export interface WebFetchPage {
48
62
  * to (an IPv6 address in brackets, as in a URL).
49
63
  */
50
64
  export interface WebFetchProvider {
51
- /** False when this org's config lacks what the provider needs. */
52
- configured?(orgConfig: unknown): boolean;
65
+ /**
66
+ * False when this org's config lacks what the provider needs. `config` is the effective
67
+ * deployment config for the org (see `fetch`'s `config`).
68
+ */
69
+ configured?(orgConfig: unknown, config?: unknown): boolean;
53
70
  fetch(args: {
54
71
  /** Already validated and upgraded by the kernel. */
55
72
  url: string;
56
73
  orgConfig: unknown;
74
+ /**
75
+ * The extension's effective deployment config for this org: the platform's deployment config
76
+ * with the org's copy applied to the overridable fields (`orgAccess(…, "override")`), or the
77
+ * platform's config (equal to `ctx.config`) while the org follows it. Use it, not `ctx.config`,
78
+ * for work done for this org. Optional in the type so older extensions compile; the kernel
79
+ * always passes it.
80
+ */
81
+ config?: unknown;
57
82
  signal: AbortSignal;
58
83
  }): Promise<WebFetchPage>;
59
84
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capybara-hq/plugin-sdk",
3
- "version": "0.1.0-rc.2",
3
+ "version": "0.1.0-rc.4",
4
4
  "description": "Capybara plugin SDK: the types and pure functions plugins are written against",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -17,11 +17,13 @@
17
17
  "types": "./dist/index.d.ts",
18
18
  "import": "./dist/index.js",
19
19
  "default": "./dist/index.js"
20
- }
20
+ },
21
+ "./package.json": "./package.json"
21
22
  },
22
23
  "files": [
23
24
  "dist",
24
25
  "schemas",
26
+ "agent-docs",
25
27
  "README.md",
26
28
  "NOTICE"
27
29
  ],
@@ -68,6 +68,25 @@
68
68
  "en"
69
69
  ]
70
70
  },
71
+ "displayName": {
72
+ "type": "object",
73
+ "properties": {
74
+ "zh": {
75
+ "type": "string",
76
+ "minLength": 1,
77
+ "maxLength": 100
78
+ },
79
+ "en": {
80
+ "type": "string",
81
+ "minLength": 1,
82
+ "maxLength": 100
83
+ }
84
+ },
85
+ "required": [
86
+ "zh",
87
+ "en"
88
+ ]
89
+ },
71
90
  "version": {
72
91
  "type": "string",
73
92
  "maxLength": 256,
@@ -110,6 +129,23 @@
110
129
  "maxLength": 2000,
111
130
  "pattern": "^https:\\/\\/\\S+$"
112
131
  },
132
+ "deprecated": {
133
+ "anyOf": [
134
+ {
135
+ "type": "boolean"
136
+ },
137
+ {
138
+ "type": "object",
139
+ "properties": {
140
+ "reason": {
141
+ "type": "string",
142
+ "minLength": 1,
143
+ "maxLength": 280
144
+ }
145
+ }
146
+ }
147
+ ]
148
+ },
113
149
  "source": {
114
150
  "anyOf": [
115
151
  {
@@ -28,10 +28,35 @@
28
28
  "pattern": "\\S"
29
29
  },
30
30
  "description": {
31
- "type": "string",
32
- "minLength": 1,
33
- "maxLength": 1024,
34
- "pattern": "\\S"
31
+ "anyOf": [
32
+ {
33
+ "type": "string",
34
+ "minLength": 1,
35
+ "maxLength": 1024,
36
+ "pattern": "\\S"
37
+ },
38
+ {
39
+ "type": "object",
40
+ "properties": {
41
+ "en": {
42
+ "type": "string",
43
+ "minLength": 1,
44
+ "maxLength": 1024,
45
+ "pattern": "\\S"
46
+ },
47
+ "zh": {
48
+ "type": "string",
49
+ "minLength": 1,
50
+ "maxLength": 1024,
51
+ "pattern": "\\S"
52
+ }
53
+ },
54
+ "required": [
55
+ "en"
56
+ ],
57
+ "additionalProperties": false
58
+ }
59
+ ]
35
60
  },
36
61
  "displayName": {
37
62
  "type": "object",