@opencode/schema 0.0.0-dev-20800 → 0.0.0-dev-20802

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/dist/agent.js CHANGED
@@ -7,7 +7,7 @@ import { Permission } from "./permission.js";
7
7
  import { Provider } from "./provider.js";
8
8
  import { PositiveInt, statics } from "./schema.js";
9
9
  const Updated = ephemeral({ type: "agent.updated", schema: {} });
10
- export const ID = Schema.String.pipe(Schema.brand("Agent.ID"));
10
+ export const ID = Schema.String.pipe(Schema.brand("Agent.ID"), Schema.annotate({ identifier: "Agent.ID" }));
11
11
  export const Name = Schema.String.pipe(Schema.brand("Agent.Name"));
12
12
  export const Color = Schema.String.annotate({ identifier: "Agent.Color" });
13
13
  export const Info = Schema.Struct({
@@ -6,7 +6,7 @@ import { IntegrationID, IntegrationMethodID } from "./integration-id.js";
6
6
  import { ascending } from "./identifier.js";
7
7
  import { NonNegativeInt, statics } from "./schema.js";
8
8
  import { Form } from "./form.js";
9
- export const ID = Schema.String.pipe(Schema.brand("Credential.ID"), statics((schema) => ({ create: () => schema.make("cred_" + ascending()) })));
9
+ export const ID = Schema.String.pipe(Schema.brand("Credential.ID"), Schema.annotate({ identifier: "Credential.ID" }), statics((schema) => ({ create: () => schema.make("cred_" + ascending()) })));
10
10
  const Updated = ephemeral({
11
11
  type: "credential.updated",
12
12
  schema: {},
package/dist/event.js CHANGED
@@ -4,15 +4,15 @@ import { optional } from "./schema.js";
4
4
  import { ascending } from "./identifier.js";
5
5
  import { Location } from "./location.js";
6
6
  import { statics } from "./schema.js";
7
- export const ID = Schema.String.check(Schema.isStartingWith("evt_")).pipe(Schema.brand("Event.ID"), statics((schema) => ({ create: () => schema.make("evt_" + ascending()) })));
7
+ export const ID = Schema.String.check(Schema.isStartingWith("evt_")).pipe(Schema.brand("Event.ID"), Schema.annotate({ identifier: "Event.ID" }), statics((schema) => ({ create: () => schema.make("evt_" + ascending()) })));
8
8
  /**
9
9
  * Position in one aggregate's durable log. Values originate from the durable
10
10
  * event envelope and synced markers;
11
11
  * `after` cursors accept only values that came from those sources.
12
12
  */
13
- export const Seq = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)).pipe(Schema.brand("Event.Seq"));
13
+ export const Seq = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)).pipe(Schema.brand("Event.Seq"), Schema.annotate({ identifier: "Event.Seq" }));
14
14
  /** Durable schema version of one event type, from the event definition that committed it. */
15
- export const Version = Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)).pipe(Schema.brand("Event.Version"));
15
+ export const Version = Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)).pipe(Schema.brand("Event.Version"), Schema.annotate({ identifier: "Event.Version" }));
16
16
  const DurableEnvelope = Schema.Struct({ aggregateID: Schema.String, seq: Seq, version: Version });
17
17
  export function durable(input) {
18
18
  const data = Schema.Struct(input.schema);
package/dist/form.js CHANGED
@@ -3,7 +3,7 @@ import { Schema } from "effect";
3
3
  import { ephemeral, inventory } from "./event.js";
4
4
  import { ascending } from "./identifier.js";
5
5
  import { NonNegativeInt, optional, statics } from "./schema.js";
6
- const IDSchema = Schema.String.check(Schema.isStartingWith("frm_")).pipe(Schema.brand("Form.ID"));
6
+ const IDSchema = Schema.String.check(Schema.isStartingWith("frm_")).pipe(Schema.brand("Form.ID"), Schema.annotate({ identifier: "Form.ID" }));
7
7
  export const ID = IDSchema.pipe(statics((schema) => ({ create: (id) => schema.make(id ?? "frm_" + ascending()) })));
8
8
  export const Metadata = Schema.Record(Schema.String, Schema.Unknown).annotate({ identifier: "Form.Metadata" });
9
9
  export const Option = Schema.Struct({
@@ -1,7 +1,7 @@
1
1
  export * as Instruction from "./instruction.js";
2
2
  import { Schema } from "effect";
3
- export const Key = Schema.String.check(Schema.isPattern(/^[a-z0-9][a-z0-9._-]*\/[a-z0-9][a-z0-9._/-]*$/u)).pipe(Schema.brand("Instruction.Key"));
4
- export const Hash = Schema.String.check(Schema.isPattern(/^[a-f0-9]{64}$/u)).pipe(Schema.brand("Instruction.Hash"));
3
+ export const Key = Schema.String.check(Schema.isPattern(/^[a-z0-9][a-z0-9._-]*\/[a-z0-9][a-z0-9._/-]*$/u)).pipe(Schema.brand("Instruction.Key"), Schema.annotate({ identifier: "Instruction.Key" }));
4
+ export const Hash = Schema.String.check(Schema.isPattern(/^[a-f0-9]{64}$/u)).pipe(Schema.brand("Instruction.Hash"), Schema.annotate({ identifier: "Instruction.Hash" }));
5
5
  export const Values = Schema.Record(Key, Hash);
6
6
  export const Removed = Schema.Literal("removed");
7
7
  export const removed = Removed.make("removed");
@@ -1,3 +1,3 @@
1
1
  import { Schema } from "effect";
2
- export const IntegrationID = Schema.String.pipe(Schema.brand("Integration.ID"));
3
- export const IntegrationMethodID = Schema.String.pipe(Schema.brand("Integration.MethodID"));
2
+ export const IntegrationID = Schema.String.pipe(Schema.brand("Integration.ID"), Schema.annotate({ identifier: "Integration.ID" }));
3
+ export const IntegrationMethodID = Schema.String.pipe(Schema.brand("Integration.MethodID"), Schema.annotate({ identifier: "Integration.MethodID" }));
@@ -56,7 +56,7 @@ export const Info = Schema.Struct({
56
56
  methods: Schema.Array(Method),
57
57
  connections: Schema.Array(Connection.Info),
58
58
  }).annotate({ identifier: "Integration.Info" });
59
- export const AttemptID = Schema.String.pipe(Schema.brand("Integration.AttemptID"), statics((schema) => ({ create: () => schema.make("con_" + ascending()) })));
59
+ export const AttemptID = Schema.String.pipe(Schema.brand("Integration.AttemptID"), Schema.annotate({ identifier: "Integration.AttemptID" }), statics((schema) => ({ create: () => schema.make("con_" + ascending()) })));
60
60
  const AttemptTime = Schema.Struct({
61
61
  created: Schema.Number,
62
62
  expires: Schema.Number,
@@ -3,7 +3,7 @@ import { Schema } from "effect";
3
3
  import { ascending } from "./identifier.js";
4
4
  import { ProjectID } from "./project-id.js";
5
5
  import { DateTimeUtcFromMillis, statics } from "./schema.js";
6
- export const ID = Schema.String.pipe(Schema.brand("PermissionSaved.ID"), statics((schema) => ({ create: () => schema.make("psv_" + ascending()) })));
6
+ export const ID = Schema.String.pipe(Schema.brand("PermissionSaved.ID"), Schema.annotate({ identifier: "PermissionSaved.ID" }), statics((schema) => ({ create: () => schema.make("psv_" + ascending()) })));
7
7
  export const Info = Schema.Struct({
8
8
  id: ID,
9
9
  projectID: ProjectID,
@@ -5,7 +5,7 @@ import { ephemeral, inventory } from "./event.js";
5
5
  import { ascending } from "./identifier.js";
6
6
  import { SessionID } from "./session-id.js";
7
7
  import { statics } from "./schema.js";
8
- export const ID = Schema.String.check(Schema.isStartingWith("per")).pipe(Schema.brand("Permission.ID"), statics((schema) => ({ create: (id) => schema.make(id ?? "per_" + ascending()) })));
8
+ export const ID = Schema.String.check(Schema.isStartingWith("per")).pipe(Schema.brand("Permission.ID"), Schema.annotate({ identifier: "Permission.ID" }), statics((schema) => ({ create: (id) => schema.make(id ?? "per_" + ascending()) })));
9
9
  export const Source = Schema.Union([
10
10
  Schema.Struct({
11
11
  type: Schema.Literal("tool"),
@@ -1,3 +1,3 @@
1
1
  import { Schema } from "effect";
2
2
  import { statics } from "./schema.js";
3
- export const ProjectID = Schema.String.pipe(Schema.brand("Project.ID"), statics((schema) => ({ global: schema.make("global") })));
3
+ export const ProjectID = Schema.String.pipe(Schema.brand("Project.ID"), Schema.annotate({ identifier: "Project.ID" }), statics((schema) => ({ global: schema.make("global") })));
package/dist/provider.js CHANGED
@@ -3,7 +3,7 @@ import { Effect, Schema } from "effect";
3
3
  import { Integration } from "./integration.js";
4
4
  import { optional, statics } from "./schema.js";
5
5
  import { ephemeral, inventory } from "./event.js";
6
- export const ID = Schema.String.pipe(Schema.brand("Provider.ID"), statics((schema) => ({
6
+ export const ID = Schema.String.pipe(Schema.brand("Provider.ID"), Schema.annotate({ identifier: "Provider.ID" }), statics((schema) => ({
7
7
  opencode: schema.make("opencode"),
8
8
  anthropic: schema.make("anthropic"),
9
9
  openai: schema.make("openai"),
package/dist/pty.js CHANGED
@@ -4,7 +4,7 @@ import { optional } from "./schema.js";
4
4
  import { ephemeral, inventory } from "./event.js";
5
5
  import { ascending } from "./identifier.js";
6
6
  import { NonNegativeInt, PositiveInt, statics } from "./schema.js";
7
- const IDSchema = Schema.String.check(Schema.isStartingWith("pty")).pipe(Schema.brand("PtyID"));
7
+ const IDSchema = Schema.String.check(Schema.isStartingWith("pty")).pipe(Schema.brand("PtyID"), Schema.annotate({ identifier: "Pty.ID" }));
8
8
  export const ID = IDSchema.pipe(statics((schema) => {
9
9
  const create = () => schema.make("pty_" + ascending());
10
10
  return {
package/dist/schema.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { DateTime, Option, Schema, SchemaGetter } from "effect";
2
2
  export const PositiveInt = Schema.Int.check(Schema.isGreaterThan(0));
3
3
  export const NonNegativeInt = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));
4
- export const RelativePath = Schema.String.pipe(Schema.brand("RelativePath"));
5
- export const AbsolutePath = Schema.String.pipe(Schema.brand("AbsolutePath"));
4
+ export const RelativePath = Schema.String.pipe(Schema.brand("RelativePath"), Schema.annotate({ identifier: "RelativePath" }));
5
+ export const AbsolutePath = Schema.String.pipe(Schema.brand("AbsolutePath"), Schema.annotate({ identifier: "AbsolutePath" }));
6
6
  export const optional = (schema) => Schema.optionalKey(schema).pipe(Schema.decodeTo(Schema.optional(Schema.toType(schema)), {
7
7
  decode: SchemaGetter.passthrough({ strict: false }),
8
8
  encode: SchemaGetter.transformOptional(Option.filter((value) => value !== undefined)),
@@ -1,7 +1,7 @@
1
1
  import { Schema } from "effect";
2
2
  import { descending } from "./identifier.js";
3
3
  import { statics } from "./schema.js";
4
- export const SessionID = Schema.String.check(Schema.isStartingWith("ses")).pipe(Schema.brand("SessionID"), statics((schema) => {
4
+ export const SessionID = Schema.String.check(Schema.isStartingWith("ses")).pipe(Schema.brand("SessionID"), Schema.annotate({ identifier: "Session.ID" }), statics((schema) => {
5
5
  const create = () => schema.make("ses_" + descending());
6
6
  return {
7
7
  create,
@@ -18,7 +18,7 @@ import { Skill as SkillSchema } from "./skill.js";
18
18
  import { Money } from "./money.js";
19
19
  import { Snapshot } from "./snapshot.js";
20
20
  import { TokenUsage } from "./token-usage.js";
21
- export const ID = Schema.String.check(Schema.isStartingWith("msg_")).pipe(Schema.brand("Session.Message.ID"), statics((schema) => ({
21
+ export const ID = Schema.String.check(Schema.isStartingWith("msg_")).pipe(Schema.brand("Session.Message.ID"), Schema.annotate({ identifier: "Session.Message.ID" }), statics((schema) => ({
22
22
  create: () => schema.make("msg_" + ascending()),
23
23
  fromEvent: (eventID) => schema.make(eventID.replace(/^evt_/, "msg_")),
24
24
  })));
package/dist/shell.js CHANGED
@@ -4,7 +4,7 @@ import { optional } from "./schema.js";
4
4
  import { ephemeral, inventory } from "./event.js";
5
5
  import { ascending } from "./identifier.js";
6
6
  import { NonNegativeInt, statics } from "./schema.js";
7
- const IDSchema = Schema.String.check(Schema.isStartingWith("sh_")).pipe(Schema.brand("Shell.ID"));
7
+ const IDSchema = Schema.String.check(Schema.isStartingWith("sh_")).pipe(Schema.brand("Shell.ID"), Schema.annotate({ identifier: "Shell.ID" }));
8
8
  export const ID = IDSchema.pipe(statics((schema) => {
9
9
  const create = () => schema.make("sh_" + ascending());
10
10
  return {
package/dist/skill.js CHANGED
@@ -3,8 +3,8 @@ import { Schema } from "effect";
3
3
  import { optional } from "./schema.js";
4
4
  import { AbsolutePath } from "./schema.js";
5
5
  import { ephemeral, inventory } from "./event.js";
6
- export const ID = Schema.String.pipe(Schema.brand("Skill.ID"));
7
- export const Name = Schema.String.pipe(Schema.brand("Skill.Name"));
6
+ export const ID = Schema.String.pipe(Schema.brand("Skill.ID"), Schema.annotate({ identifier: "Skill.ID" }));
7
+ export const Name = Schema.String.pipe(Schema.brand("Skill.Name"), Schema.annotate({ identifier: "Skill.Name" }));
8
8
  export const DirectorySource = Schema.Struct({
9
9
  type: Schema.tag("directory"),
10
10
  path: AbsolutePath,
package/dist/snapshot.js CHANGED
@@ -1,3 +1,3 @@
1
1
  export * as Snapshot from "./snapshot.js";
2
2
  import { Schema } from "effect";
3
- export const ID = Schema.String.pipe(Schema.brand("Snapshot.ID"));
3
+ export const ID = Schema.String.pipe(Schema.brand("Snapshot.ID"), Schema.annotate({ identifier: "Snapshot.ID" }));
package/dist/websearch.js CHANGED
@@ -2,7 +2,7 @@ export * as WebSearch from "./websearch.js";
2
2
  import { Schema } from "effect";
3
3
  import { ephemeral, inventory } from "./event.js";
4
4
  import { optional } from "./schema.js";
5
- export const ID = Schema.String.pipe(Schema.brand("WebSearch.ID"));
5
+ export const ID = Schema.String.pipe(Schema.brand("WebSearch.ID"), Schema.annotate({ identifier: "WebSearch.ID" }));
6
6
  export const Provider = Schema.Struct({
7
7
  id: ID,
8
8
  name: Schema.String,
@@ -1,7 +1,7 @@
1
1
  import { Schema } from "effect";
2
2
  import { ascending } from "./identifier.js";
3
3
  import { statics } from "./schema.js";
4
- export const WorkspaceID = Schema.String.check(Schema.isStartingWith("wrk")).pipe(Schema.brand("Workspace.ID"), statics((schema) => {
4
+ export const WorkspaceID = Schema.String.check(Schema.isStartingWith("wrk")).pipe(Schema.brand("Workspace.ID"), Schema.annotate({ identifier: "Workspace.ID" }), statics((schema) => {
5
5
  const create = () => schema.make("wrk_" + ascending());
6
6
  return {
7
7
  ascending: (id) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode/schema",
4
- "version": "0.0.0-dev-20800",
4
+ "version": "0.0.0-dev-20802",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@standard-schema/spec": "1.1.0",
34
- "effect": "4.0.0-rc.118"
34
+ "effect": "4.0.1"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@tsconfig/bun": "1.0.9",