@hexabot-ai/types 3.0.2 → 3.0.3

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.
package/README.md CHANGED
@@ -19,6 +19,9 @@ Shared zod-first runtime contracts for Hexabot API entity outputs.
19
19
  `AuditLog` includes nullable `actorLabel` and `resourceLabel` display fields in
20
20
  addition to the stable actor/resource identifiers.
21
21
 
22
+ `ChannelMetadata` includes `visibility` (`public` or `system`) so clients can
23
+ separate customer-facing channels from internal tooling channels.
24
+
22
25
  ## Standard Export Pattern
23
26
 
24
27
  Each migrated entity exposes:
@@ -5,11 +5,13 @@
5
5
  * Full terms: see LICENSE.md.
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.channelMetadataSchema = void 0;
8
+ exports.channelMetadataSchema = exports.channelVisibilitySchema = void 0;
9
9
  const zod_1 = require("zod");
10
10
  const jsonObjectSchema = zod_1.z.record(zod_1.z.string(), zod_1.z.unknown());
11
+ exports.channelVisibilitySchema = zod_1.z.enum(["public", "system"]);
11
12
  const channelMetadataObjectSchema = zod_1.z.object({
12
13
  name: zod_1.z.string(),
13
14
  settingsSchema: jsonObjectSchema,
15
+ visibility: exports.channelVisibilitySchema.default("public"),
14
16
  });
15
17
  exports.channelMetadataSchema = channelMetadataObjectSchema;
@@ -5,7 +5,7 @@
5
5
  * Full terms: see LICENSE.md.
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.channelMetadataSchema = exports.sourceFullSchema = exports.sourceStubSchema = exports.sourceSchema = void 0;
8
+ exports.channelVisibilitySchema = exports.channelMetadataSchema = exports.sourceFullSchema = exports.sourceStubSchema = exports.sourceSchema = void 0;
9
9
  var source_1 = require("./source");
10
10
  Object.defineProperty(exports, "sourceSchema", { enumerable: true, get: function () { return source_1.sourceSchema; } });
11
11
  Object.defineProperty(exports, "sourceStubSchema", { enumerable: true, get: function () { return source_1.sourceStubSchema; } });
@@ -13,3 +13,4 @@ var source_full_1 = require("./source-full");
13
13
  Object.defineProperty(exports, "sourceFullSchema", { enumerable: true, get: function () { return source_full_1.sourceFullSchema; } });
14
14
  var channel_metadata_1 = require("./channel-metadata");
15
15
  Object.defineProperty(exports, "channelMetadataSchema", { enumerable: true, get: function () { return channel_metadata_1.channelMetadataSchema; } });
16
+ Object.defineProperty(exports, "channelVisibilitySchema", { enumerable: true, get: function () { return channel_metadata_1.channelVisibilitySchema; } });
@@ -5,8 +5,10 @@
5
5
  */
6
6
  import { z } from "zod";
7
7
  const jsonObjectSchema = z.record(z.string(), z.unknown());
8
+ export const channelVisibilitySchema = z.enum(["public", "system"]);
8
9
  const channelMetadataObjectSchema = z.object({
9
10
  name: z.string(),
10
11
  settingsSchema: jsonObjectSchema,
12
+ visibility: channelVisibilitySchema.default("public"),
11
13
  });
12
14
  export const channelMetadataSchema = channelMetadataObjectSchema;
@@ -5,4 +5,4 @@
5
5
  */
6
6
  export { sourceSchema, sourceStubSchema, } from "./source";
7
7
  export { sourceFullSchema } from "./source-full";
8
- export { channelMetadataSchema, } from "./channel-metadata";
8
+ export { channelMetadataSchema, channelVisibilitySchema, } from "./channel-metadata";
@@ -1,7 +1,16 @@
1
1
  import { z } from "zod";
2
+ export declare const channelVisibilitySchema: z.ZodEnum<{
3
+ public: "public";
4
+ system: "system";
5
+ }>;
2
6
  export declare const channelMetadataSchema: z.ZodObject<{
3
7
  name: z.ZodString;
4
8
  settingsSchema: z.ZodType<Record<string, unknown>, unknown, z.core.$ZodTypeInternals<Record<string, unknown>, unknown>>;
9
+ visibility: z.ZodDefault<z.ZodEnum<{
10
+ public: "public";
11
+ system: "system";
12
+ }>>;
5
13
  }, z.core.$strip>;
14
+ export type ChannelVisibility = z.infer<typeof channelVisibilitySchema>;
6
15
  export type ChannelMetadata = z.infer<typeof channelMetadataSchema>;
7
16
  //# sourceMappingURL=channel-metadata.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"channel-metadata.d.ts","sourceRoot":"","sources":["../../../src/channel/channel-metadata.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,qBAAqB;;;iBAA8B,CAAC;AAEjE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
1
+ {"version":3,"file":"channel-metadata.d.ts","sourceRoot":"","sources":["../../../src/channel/channel-metadata.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,uBAAuB;;;EAA+B,CAAC;AAQpE,eAAO,MAAM,qBAAqB;;;;;;;iBAA8B,CAAC;AAEjE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
1
  export { sourceSchema, sourceStubSchema, type Source, type SourceStub, } from "./source";
2
2
  export { sourceFullSchema, type SourceFull } from "./source-full";
3
- export { channelMetadataSchema, type ChannelMetadata, } from "./channel-metadata";
3
+ export { channelMetadataSchema, channelVisibilitySchema, type ChannelMetadata, type ChannelVisibility, } from "./channel-metadata";
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/channel/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,KAAK,MAAM,EACX,KAAK,UAAU,GAChB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,gBAAgB,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAElE,OAAO,EACL,qBAAqB,EACrB,KAAK,eAAe,GACrB,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/channel/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,KAAK,MAAM,EACX,KAAK,UAAU,GAChB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,gBAAgB,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAElE,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,KAAK,eAAe,EACpB,KAAK,iBAAiB,GACvB,MAAM,oBAAoB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hexabot-ai/types",
3
- "version": "3.0.2",
3
+ "version": "3.0.3",
4
4
  "description": "Shared zod schemas and inferred entity types for Hexabot.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -10,11 +10,17 @@ const jsonObjectSchema: z.ZodType<Record<string, unknown>> = z.record(
10
10
  z.string(),
11
11
  z.unknown(),
12
12
  );
13
+
14
+ export const channelVisibilitySchema = z.enum(["public", "system"]);
15
+
13
16
  const channelMetadataObjectSchema = z.object({
14
17
  name: z.string(),
15
18
  settingsSchema: jsonObjectSchema,
19
+ visibility: channelVisibilitySchema.default("public"),
16
20
  });
17
21
 
18
22
  export const channelMetadataSchema = channelMetadataObjectSchema;
19
23
 
24
+ export type ChannelVisibility = z.infer<typeof channelVisibilitySchema>;
25
+
20
26
  export type ChannelMetadata = z.infer<typeof channelMetadataSchema>;
@@ -15,5 +15,7 @@ export { sourceFullSchema, type SourceFull } from "./source-full";
15
15
 
16
16
  export {
17
17
  channelMetadataSchema,
18
+ channelVisibilitySchema,
18
19
  type ChannelMetadata,
20
+ type ChannelVisibility,
19
21
  } from "./channel-metadata";
package/src/index.test.ts CHANGED
@@ -558,10 +558,19 @@ describe("@hexabot-ai/types schemas", () => {
558
558
  type: "object",
559
559
  },
560
560
  });
561
+ const systemMetadata = channelMetadataSchema.parse({
562
+ name: "console",
563
+ visibility: "system",
564
+ settingsSchema: {
565
+ type: "object",
566
+ },
567
+ });
561
568
 
562
569
  expect(source.defaultWorkflow).toBe("wf_1");
563
570
  expect(sourceFull.defaultWorkflow?.id).toBe("wf_1");
564
571
  expect(metadata.name).toBe("web");
572
+ expect(metadata.visibility).toBe("public");
573
+ expect(systemMetadata.visibility).toBe("system");
565
574
  });
566
575
 
567
576
  it("accepts source and auditlog as valid model identities", () => {