@bubblelab/shared-schemas 0.1.107 → 0.1.109

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.
@@ -0,0 +1,134 @@
1
+ import { z } from 'zod';
2
+ import { CredentialType } from './types.js';
3
+ /**
4
+ * Schema for a single input parameter that a capability accepts.
5
+ * Inputs are user-configurable values (e.g., a Google Doc ID).
6
+ */
7
+ export declare const CapabilityInputSchema: z.ZodObject<{
8
+ name: z.ZodString;
9
+ type: z.ZodEnum<["string", "number", "boolean"]>;
10
+ description: z.ZodString;
11
+ required: z.ZodDefault<z.ZodBoolean>;
12
+ default: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
13
+ }, "strip", z.ZodTypeAny, {
14
+ name: string;
15
+ type: "string" | "number" | "boolean";
16
+ description: string;
17
+ required: boolean;
18
+ default?: string | number | boolean | undefined;
19
+ }, {
20
+ name: string;
21
+ type: "string" | "number" | "boolean";
22
+ description: string;
23
+ default?: string | number | boolean | undefined;
24
+ required?: boolean | undefined;
25
+ }>;
26
+ export type CapabilityInput = z.infer<typeof CapabilityInputSchema>;
27
+ /**
28
+ * Schema for a tool definition exposed by a capability.
29
+ * Contains only serializable metadata (name, description, parameter JSON schema).
30
+ */
31
+ export declare const CapabilityToolDefSchema: z.ZodObject<{
32
+ name: z.ZodString;
33
+ description: z.ZodString;
34
+ parameterSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
35
+ }, "strip", z.ZodTypeAny, {
36
+ name: string;
37
+ description: string;
38
+ parameterSchema: Record<string, unknown>;
39
+ }, {
40
+ name: string;
41
+ description: string;
42
+ parameterSchema: Record<string, unknown>;
43
+ }>;
44
+ export type CapabilityToolDef = z.infer<typeof CapabilityToolDefSchema>;
45
+ /**
46
+ * Serializable capability metadata — used by frontend, parser, and capabilities.json.
47
+ * Does NOT contain runtime logic (tool functions, factories).
48
+ */
49
+ export declare const CapabilityMetadataSchema: z.ZodObject<{
50
+ id: z.ZodString;
51
+ name: z.ZodString;
52
+ description: z.ZodString;
53
+ icon: z.ZodOptional<z.ZodString>;
54
+ category: z.ZodOptional<z.ZodString>;
55
+ version: z.ZodDefault<z.ZodString>;
56
+ requiredCredentials: z.ZodArray<z.ZodNativeEnum<typeof CredentialType>, "many">;
57
+ inputs: z.ZodArray<z.ZodObject<{
58
+ name: z.ZodString;
59
+ type: z.ZodEnum<["string", "number", "boolean"]>;
60
+ description: z.ZodString;
61
+ required: z.ZodDefault<z.ZodBoolean>;
62
+ default: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
63
+ }, "strip", z.ZodTypeAny, {
64
+ name: string;
65
+ type: "string" | "number" | "boolean";
66
+ description: string;
67
+ required: boolean;
68
+ default?: string | number | boolean | undefined;
69
+ }, {
70
+ name: string;
71
+ type: "string" | "number" | "boolean";
72
+ description: string;
73
+ default?: string | number | boolean | undefined;
74
+ required?: boolean | undefined;
75
+ }>, "many">;
76
+ tools: z.ZodArray<z.ZodObject<{
77
+ name: z.ZodString;
78
+ description: z.ZodString;
79
+ parameterSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
80
+ }, "strip", z.ZodTypeAny, {
81
+ name: string;
82
+ description: string;
83
+ parameterSchema: Record<string, unknown>;
84
+ }, {
85
+ name: string;
86
+ description: string;
87
+ parameterSchema: Record<string, unknown>;
88
+ }>, "many">;
89
+ systemPromptAddition: z.ZodOptional<z.ZodString>;
90
+ }, "strip", z.ZodTypeAny, {
91
+ name: string;
92
+ description: string;
93
+ tools: {
94
+ name: string;
95
+ description: string;
96
+ parameterSchema: Record<string, unknown>;
97
+ }[];
98
+ id: string;
99
+ requiredCredentials: CredentialType[];
100
+ version: string;
101
+ inputs: {
102
+ name: string;
103
+ type: "string" | "number" | "boolean";
104
+ description: string;
105
+ required: boolean;
106
+ default?: string | number | boolean | undefined;
107
+ }[];
108
+ icon?: string | undefined;
109
+ category?: string | undefined;
110
+ systemPromptAddition?: string | undefined;
111
+ }, {
112
+ name: string;
113
+ description: string;
114
+ tools: {
115
+ name: string;
116
+ description: string;
117
+ parameterSchema: Record<string, unknown>;
118
+ }[];
119
+ id: string;
120
+ requiredCredentials: CredentialType[];
121
+ inputs: {
122
+ name: string;
123
+ type: "string" | "number" | "boolean";
124
+ description: string;
125
+ default?: string | number | boolean | undefined;
126
+ required?: boolean | undefined;
127
+ }[];
128
+ icon?: string | undefined;
129
+ category?: string | undefined;
130
+ version?: string | undefined;
131
+ systemPromptAddition?: string | undefined;
132
+ }>;
133
+ export type CapabilityMetadata = z.infer<typeof CapabilityMetadataSchema>;
134
+ //# sourceMappingURL=capability-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capability-schema.d.ts","sourceRoot":"","sources":["../src/capability-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;EAMhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE;;;GAGG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;EAIlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;;GAGG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -29,4 +29,5 @@ export * from './agent-memory.js';
29
29
  export * from './parameter-formatter.js';
30
30
  export * from './permission-schema.js';
31
31
  export * from './organization-schema.js';
32
+ export * from './capability-schema.js';
32
33
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,iBAAiB,CAAC;AAChC,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,oCAAoC,CAAC;AACnD,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,iBAAiB,CAAC;AAChC,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,oCAAoC,CAAC;AACnD,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC"}
package/dist/index.js CHANGED
@@ -5307,6 +5307,33 @@ function buildParameterObjectLiteral(parameters, options) {
5307
5307
  }
5308
5308
  return paramsString;
5309
5309
  }
5310
+
5311
+ // src/capability-schema.ts
5312
+ import { z as z20 } from "zod";
5313
+ var CapabilityInputSchema = z20.object({
5314
+ name: z20.string().min(1),
5315
+ type: z20.enum(["string", "number", "boolean"]),
5316
+ description: z20.string(),
5317
+ required: z20.boolean().default(true),
5318
+ default: z20.union([z20.string(), z20.number(), z20.boolean()]).optional()
5319
+ });
5320
+ var CapabilityToolDefSchema = z20.object({
5321
+ name: z20.string().min(1),
5322
+ description: z20.string().min(1),
5323
+ parameterSchema: z20.record(z20.string(), z20.unknown())
5324
+ });
5325
+ var CapabilityMetadataSchema = z20.object({
5326
+ id: z20.string().min(1),
5327
+ name: z20.string().min(1),
5328
+ description: z20.string(),
5329
+ icon: z20.string().optional(),
5330
+ category: z20.string().optional(),
5331
+ version: z20.string().default("1.0.0"),
5332
+ requiredCredentials: z20.array(z20.nativeEnum(CredentialType)),
5333
+ inputs: z20.array(CapabilityInputSchema),
5334
+ tools: z20.array(CapabilityToolDefSchema),
5335
+ systemPromptAddition: z20.string().optional()
5336
+ });
5310
5337
  export {
5311
5338
  AIRTABLE_DELAY_LABELS,
5312
5339
  AIRTABLE_DELAY_OPTIONS,
@@ -5329,6 +5356,9 @@ export {
5329
5356
  CREDENTIAL_CONFIGURATION_MAP,
5330
5357
  CREDENTIAL_ENV_MAP,
5331
5358
  CREDENTIAL_TYPE_CONFIG,
5359
+ CapabilityInputSchema,
5360
+ CapabilityMetadataSchema,
5361
+ CapabilityToolDefSchema,
5332
5362
  ClarificationChoiceSchema,
5333
5363
  ClarificationQuestionSchema,
5334
5364
  ClarificationRequestMessageSchema,