@capybara-hq/plugin-sdk 0.1.0-rc.14 → 0.1.0-rc.15

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,11 +9,19 @@ import { z } from "zod";
9
9
  * the official plugins are published: `path` is packed with `packages/plugin-tools`, which is
10
10
  * byte-reproducible, and `integrity` is that pack's sha512).
11
11
  *
12
+ * `required` and `builtin` are two different promises. A required entry is imported in the first
13
+ * pass, before the extensions load, and the start fails without it (so it can ship no skills or
14
+ * templates: those need object storage, which is not running then). A `builtin` entry is imported
15
+ * once the extensions have loaded (object storage available), so it may ship skills; its failure
16
+ * is logged and retried on the next start. Both give the plugin a builtin catalog item (scope
17
+ * `all`, on in every org, not switchable) and are imported again when missing. An entry is never
18
+ * both.
19
+ *
12
20
  * Objects are strict (unknown keys rejected, `$schema` allowed): the manifest ships with core, so
13
21
  * there is no older reader to stay compatible with and a misspelt key is a mistake. The committed
14
22
  * JSON Schema (`schemas/bootstrap.v1.schema.json`) is generated from {@link BootstrapManifestSchema}
15
23
  * by `pnpm gen:package-schemas`; the cross-field rules (unique names, `marketplace` required with an
16
- * npm entry) are decided only by {@link parseBootstrapManifest}.
24
+ * npm entry, not both `required` and `builtin`) are decided only by {@link parseBootstrapManifest}.
17
25
  */
18
26
  /** Manifest format version. */
19
27
  export declare const BOOTSTRAP_MANIFEST_SCHEMA_VERSION = 1;
@@ -30,6 +38,11 @@ export type BootstrapEntry = {
30
38
  integrity: string;
31
39
  /** Enabled in every org and neither disableable nor uninstallable. */
32
40
  required: boolean;
41
+ /**
42
+ * Builtin but not required: imported after the extensions loaded (it may ship skills), its
43
+ * catalog item builtin; a failure does not stop the start. Never together with `required`.
44
+ */
45
+ builtin?: boolean;
33
46
  } | {
34
47
  name: string;
35
48
  source: "workspace";
@@ -38,6 +51,7 @@ export type BootstrapEntry = {
38
51
  version: string;
39
52
  integrity: string;
40
53
  required: boolean;
54
+ builtin?: boolean;
41
55
  };
42
56
  /** `bootstrap.json`. */
43
57
  export interface BootstrapManifest {
package/dist/bootstrap.js CHANGED
@@ -10,11 +10,19 @@ import { CATALOG_ITEM_NAME_RE, NPM_PACKAGE_NAME_RE, SEMVER_VERSION_RE, SHA512_IN
10
10
  * the official plugins are published: `path` is packed with `packages/plugin-tools`, which is
11
11
  * byte-reproducible, and `integrity` is that pack's sha512).
12
12
  *
13
+ * `required` and `builtin` are two different promises. A required entry is imported in the first
14
+ * pass, before the extensions load, and the start fails without it (so it can ship no skills or
15
+ * templates: those need object storage, which is not running then). A `builtin` entry is imported
16
+ * once the extensions have loaded (object storage available), so it may ship skills; its failure
17
+ * is logged and retried on the next start. Both give the plugin a builtin catalog item (scope
18
+ * `all`, on in every org, not switchable) and are imported again when missing. An entry is never
19
+ * both.
20
+ *
13
21
  * Objects are strict (unknown keys rejected, `$schema` allowed): the manifest ships with core, so
14
22
  * there is no older reader to stay compatible with and a misspelt key is a mistake. The committed
15
23
  * JSON Schema (`schemas/bootstrap.v1.schema.json`) is generated from {@link BootstrapManifestSchema}
16
24
  * by `pnpm gen:package-schemas`; the cross-field rules (unique names, `marketplace` required with an
17
- * npm entry) are decided only by {@link parseBootstrapManifest}.
25
+ * npm entry, not both `required` and `builtin`) are decided only by {@link parseBootstrapManifest}.
18
26
  */
19
27
  /** Manifest format version. */
20
28
  export const BOOTSTRAP_MANIFEST_SCHEMA_VERSION = 1;
@@ -35,6 +43,7 @@ const common = {
35
43
  .string()
36
44
  .regex(SHA512_INTEGRITY_RE, { message: "integrity must be sha512-<86 base64 chars>==" }),
37
45
  required: z.boolean(),
46
+ builtin: z.boolean().optional(),
38
47
  };
39
48
  const entry = z.discriminatedUnion("source", [
40
49
  z.strictObject({
@@ -74,6 +83,13 @@ const schema = z
74
83
  });
75
84
  }
76
85
  seen.add(e.name);
86
+ if (e.required && e.builtin === true) {
87
+ ctx.addIssue({
88
+ code: "custom",
89
+ path: ["plugins", i, "builtin"],
90
+ message: "an entry is either required or builtin, not both",
91
+ });
92
+ }
77
93
  });
78
94
  if (m.marketplace === undefined && m.plugins.some((e) => e.source === "npm")) {
79
95
  ctx.addIssue({
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const SDK_VERSION = "0.1.0-rc.14";
1
+ export declare const SDK_VERSION = "0.1.0-rc.15";
2
2
  export * from "./agent-template.js";
3
3
  export * from "./bootstrap.js";
4
4
  export * from "./cards.js";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export const SDK_VERSION = "0.1.0-rc.14";
1
+ export const SDK_VERSION = "0.1.0-rc.15";
2
2
  export * from "./agent-template.js";
3
3
  export * from "./bootstrap.js";
4
4
  export * from "./cards.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capybara-hq/plugin-sdk",
3
- "version": "0.1.0-rc.14",
3
+ "version": "0.1.0-rc.15",
4
4
  "description": "Capybara plugin SDK: the types and pure functions plugins are written against",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -55,6 +55,9 @@
55
55
  "required": {
56
56
  "type": "boolean"
57
57
  },
58
+ "builtin": {
59
+ "type": "boolean"
60
+ },
58
61
  "source": {
59
62
  "type": "string",
60
63
  "const": "npm"
@@ -94,6 +97,9 @@
94
97
  "required": {
95
98
  "type": "boolean"
96
99
  },
100
+ "builtin": {
101
+ "type": "boolean"
102
+ },
97
103
  "source": {
98
104
  "type": "string",
99
105
  "const": "workspace"