@opencode-ai/schema 0.0.0-next-14723 → 0.0.0-next-14730

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 (46) hide show
  1. package/dist/agent.d.ts +8 -8
  2. package/dist/catalog.d.ts +8 -8
  3. package/dist/command.d.ts +8 -8
  4. package/dist/durable-event-manifest.d.ts +412 -412
  5. package/dist/event-log.d.ts +46 -0
  6. package/dist/event-log.js +44 -0
  7. package/dist/event-manifest.d.ts +1224 -852
  8. package/dist/event-manifest.js +2 -2
  9. package/dist/event.d.ts +16 -6
  10. package/dist/event.js +9 -1
  11. package/dist/filesystem-watcher.d.ts +8 -8
  12. package/dist/filesystem.d.ts +8 -8
  13. package/dist/form.d.ts +1339 -0
  14. package/dist/form.js +105 -0
  15. package/dist/ide-event.d.ts +8 -8
  16. package/dist/index.d.ts +1 -1
  17. package/dist/index.js +1 -1
  18. package/dist/installation-event.d.ts +16 -16
  19. package/dist/integration.d.ts +16 -16
  20. package/dist/lsp-event.d.ts +8 -8
  21. package/dist/mcp-event.d.ts +24 -24
  22. package/dist/models-dev.d.ts +8 -8
  23. package/dist/permission.d.ts +16 -16
  24. package/dist/plugin.d.ts +8 -8
  25. package/dist/project-directories.d.ts +8 -8
  26. package/dist/project.d.ts +8 -8
  27. package/dist/pty.d.ts +32 -32
  28. package/dist/reference.d.ts +8 -8
  29. package/dist/server-event.d.ts +16 -16
  30. package/dist/session-compaction-event.d.ts +8 -8
  31. package/dist/session-event.d.ts +680 -680
  32. package/dist/session-status-event.d.ts +16 -16
  33. package/dist/session-todo.d.ts +8 -8
  34. package/dist/shell.d.ts +24 -24
  35. package/dist/skill.d.ts +8 -8
  36. package/dist/tui-event.d.ts +32 -32
  37. package/dist/v1/legacy-event.d.ts +8 -8
  38. package/dist/v1/permission.d.ts +16 -16
  39. package/dist/v1/question.d.ts +24 -24
  40. package/dist/v1/session.d.ts +92 -92
  41. package/dist/vcs-event.d.ts +8 -8
  42. package/dist/workspace-event.d.ts +24 -24
  43. package/dist/worktree-event.d.ts +16 -16
  44. package/package.json +1 -1
  45. package/dist/question.d.ts +0 -516
  46. package/dist/question.js +0 -64
@@ -6,6 +6,7 @@ import { Durable } from "./durable-event-manifest.js";
6
6
  import { Event } from "./event.js";
7
7
  import { FileSystem } from "./filesystem.js";
8
8
  import { FileSystemWatcher } from "./filesystem-watcher.js";
9
+ import { Form } from "./form.js";
9
10
  import { InstallationEvent } from "./installation-event.js";
10
11
  import { Integration } from "./integration.js";
11
12
  import { LegacyEvent } from "./legacy-event.js";
@@ -18,7 +19,6 @@ import { Plugin } from "./plugin.js";
18
19
  import { Project } from "./project.js";
19
20
  import { ProjectDirectories } from "./project-directories.js";
20
21
  import { Pty } from "./pty.js";
21
- import { Question } from "./question.js";
22
22
  import { QuestionV1 } from "./question-v1.js";
23
23
  import { Reference } from "./reference.js";
24
24
  import { ServerEvent } from "./server-event.js";
@@ -37,7 +37,7 @@ const sessionV1DurableDefinitions = SessionV1.Event.Definitions.filter((definiti
37
37
  const sessionV1LiveDefinitions = SessionV1.Event.Definitions.filter((definition) => definition.durable === undefined);
38
38
  const coreDefinitions = Event.inventory(...sessionV1DurableDefinitions, ...SessionEvent.Definitions);
39
39
  const foundationDefinitions = Event.inventory(...ModelsDev.Event.Definitions, ...Integration.Event.Definitions, ...Catalog.Event.Definitions, ...Agent.Event.Definitions, ...coreDefinitions);
40
- const featureDefinitions = Event.inventory(...FileSystem.Event.Definitions, ...Reference.Event.Definitions, ...Permission.Event.Definitions, ...Plugin.Event.Definitions, ...ProjectDirectories.Event.Definitions, ...Command.Event.Definitions, ...Skill.Event.Definitions, ...FileSystemWatcher.Event.Definitions, ...Pty.Event.Definitions, ...Shell.Event.Definitions, ...Question.Event.Definitions);
40
+ const featureDefinitions = Event.inventory(...FileSystem.Event.Definitions, ...Reference.Event.Definitions, ...Permission.Event.Definitions, ...Plugin.Event.Definitions, ...ProjectDirectories.Event.Definitions, ...Command.Event.Definitions, ...Skill.Event.Definitions, ...FileSystemWatcher.Event.Definitions, ...Pty.Event.Definitions, ...Shell.Event.Definitions, ...Form.Event.Definitions);
41
41
  export const ServerDefinitions = Event.inventory(...foundationDefinitions, ...featureDefinitions, ...SessionTodo.Event.Definitions);
42
42
  export const Definitions = Event.inventory(...foundationDefinitions, ...sessionV1LiveDefinitions, ...InstallationEvent.Definitions, ...featureDefinitions, ...SessionTodo.Event.Definitions, ...LspEvent.Definitions, ...PermissionV1.Event.Definitions, ...TuiEvent.Definitions, ...McpEvent.Definitions, ...LegacyEvent.Definitions, ...Project.Event.Definitions, ...SessionStatusEvent.Definitions, ...QuestionV1.Event.Definitions, ...SessionCompactionEvent.Definitions, ...VcsEvent.Definitions, ...WorkspaceEvent.Definitions, ...WorktreeEvent.Definitions, ...ServerEvent.Definitions);
43
43
  export const Latest = Event.latest(Definitions);
package/dist/event.d.ts CHANGED
@@ -5,6 +5,16 @@ export declare const ID: Schema.brand<Schema.String, "Event.ID"> & {
5
5
  create: () => string & import("effect/Brand").Brand<"Event.ID">;
6
6
  };
7
7
  export type ID = typeof ID.Type;
8
+ /**
9
+ * Position in one aggregate's durable log. Values originate from the durable
10
+ * event envelope, caught-up markers, change hints, and snapshot watermarks;
11
+ * `after` cursors accept only values that came from those sources.
12
+ */
13
+ export declare const Seq: Schema.brand<Schema.Int, "Event.Seq">;
14
+ export type Seq = typeof Seq.Type;
15
+ /** Durable schema version of one event type, from the event definition that committed it. */
16
+ export declare const Version: Schema.brand<Schema.Int, "Event.Version">;
17
+ export type Version = typeof Version.Type;
8
18
  export type Definition<Type extends string = string, DataSchema extends Schema.Codec<unknown, unknown> = Schema.Codec<unknown, unknown>> = Schema.Top & {
9
19
  readonly type: Type;
10
20
  readonly durable?: {
@@ -20,8 +30,8 @@ export type Payload<D extends Definition = Definition> = {
20
30
  readonly data: Data<D>;
21
31
  readonly durable?: {
22
32
  readonly aggregateID: string;
23
- readonly seq: number;
24
- readonly version: number;
33
+ readonly seq: Seq;
34
+ readonly version: Version;
25
35
  };
26
36
  readonly location?: Location.Ref;
27
37
  readonly metadata?: Record<string, unknown>;
@@ -41,12 +51,12 @@ export declare function define<const Type extends string, const Fields extends R
41
51
  readonly type: Schema.Literal<Type>;
42
52
  readonly durable: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
43
53
  readonly aggregateID: Schema.String;
44
- readonly seq: Schema.Int;
45
- readonly version: Schema.Int;
54
+ readonly seq: Schema.brand<Schema.Int, "Event.Seq">;
55
+ readonly version: Schema.brand<Schema.Int, "Event.Version">;
46
56
  }>>>, Schema.optionalKey<Schema.Struct<{
47
57
  readonly aggregateID: Schema.String;
48
- readonly seq: Schema.Int;
49
- readonly version: Schema.Int;
58
+ readonly seq: Schema.brand<Schema.Int, "Event.Seq">;
59
+ readonly version: Schema.brand<Schema.Int, "Event.Version">;
50
60
  }>>, never, never>;
51
61
  readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
52
62
  readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
package/dist/event.js CHANGED
@@ -5,13 +5,21 @@ import { ascending } from "./identifier.js";
5
5
  import { Location } from "./location.js";
6
6
  import { statics } from "./schema.js";
7
7
  export const ID = Schema.String.check(Schema.isStartsWith("evt_")).pipe(Schema.brand("Event.ID"), statics((schema) => ({ create: () => schema.make("evt_" + ascending()) })));
8
+ /**
9
+ * Position in one aggregate's durable log. Values originate from the durable
10
+ * event envelope, caught-up markers, change hints, and snapshot watermarks;
11
+ * `after` cursors accept only values that came from those sources.
12
+ */
13
+ export const Seq = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)).pipe(Schema.brand("Event.Seq"));
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"));
8
16
  export function define(input) {
9
17
  const data = Schema.Struct(input.schema);
10
18
  return Schema.Struct({
11
19
  id: ID,
12
20
  metadata: optional(Schema.Record(Schema.String, Schema.Unknown)),
13
21
  type: Schema.Literal(input.type),
14
- durable: optional(Schema.Struct({ aggregateID: Schema.String, seq: Schema.Int, version: Schema.Int })),
22
+ durable: optional(Schema.Struct({ aggregateID: Schema.String, seq: Seq, version: Version })),
15
23
  location: optional(Location.Ref),
16
24
  data,
17
25
  })
@@ -9,12 +9,12 @@ export declare const Event: {
9
9
  readonly type: Schema.Literal<"file.watcher.updated">;
10
10
  readonly durable: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
11
11
  readonly aggregateID: Schema.String;
12
- readonly seq: Schema.Int;
13
- readonly version: Schema.Int;
12
+ readonly seq: Schema.brand<Schema.Int, "Event.Seq">;
13
+ readonly version: Schema.brand<Schema.Int, "Event.Version">;
14
14
  }>>>, Schema.optionalKey<Schema.Struct<{
15
15
  readonly aggregateID: Schema.String;
16
- readonly seq: Schema.Int;
17
- readonly version: Schema.Int;
16
+ readonly seq: Schema.brand<Schema.Int, "Event.Seq">;
17
+ readonly version: Schema.brand<Schema.Int, "Event.Version">;
18
18
  }>>, never, never>;
19
19
  readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
20
20
  readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
@@ -58,12 +58,12 @@ export declare const Event: {
58
58
  readonly type: Schema.Literal<"file.watcher.updated">;
59
59
  readonly durable: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
60
60
  readonly aggregateID: Schema.String;
61
- readonly seq: Schema.Int;
62
- readonly version: Schema.Int;
61
+ readonly seq: Schema.brand<Schema.Int, "Event.Seq">;
62
+ readonly version: Schema.brand<Schema.Int, "Event.Version">;
63
63
  }>>>, Schema.optionalKey<Schema.Struct<{
64
64
  readonly aggregateID: Schema.String;
65
- readonly seq: Schema.Int;
66
- readonly version: Schema.Int;
65
+ readonly seq: Schema.brand<Schema.Int, "Event.Seq">;
66
+ readonly version: Schema.brand<Schema.Int, "Event.Version">;
67
67
  }>>, never, never>;
68
68
  readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
69
69
  readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
@@ -9,12 +9,12 @@ export declare const Event: {
9
9
  readonly type: Schema.Literal<"file.edited">;
10
10
  readonly durable: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
11
11
  readonly aggregateID: Schema.String;
12
- readonly seq: Schema.Int;
13
- readonly version: Schema.Int;
12
+ readonly seq: Schema.brand<Schema.Int, "Event.Seq">;
13
+ readonly version: Schema.brand<Schema.Int, "Event.Version">;
14
14
  }>>>, Schema.optionalKey<Schema.Struct<{
15
15
  readonly aggregateID: Schema.String;
16
- readonly seq: Schema.Int;
17
- readonly version: Schema.Int;
16
+ readonly seq: Schema.brand<Schema.Int, "Event.Seq">;
17
+ readonly version: Schema.brand<Schema.Int, "Event.Version">;
18
18
  }>>, never, never>;
19
19
  readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
20
20
  readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
@@ -56,12 +56,12 @@ export declare const Event: {
56
56
  readonly type: Schema.Literal<"file.edited">;
57
57
  readonly durable: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
58
58
  readonly aggregateID: Schema.String;
59
- readonly seq: Schema.Int;
60
- readonly version: Schema.Int;
59
+ readonly seq: Schema.brand<Schema.Int, "Event.Seq">;
60
+ readonly version: Schema.brand<Schema.Int, "Event.Version">;
61
61
  }>>>, Schema.optionalKey<Schema.Struct<{
62
62
  readonly aggregateID: Schema.String;
63
- readonly seq: Schema.Int;
64
- readonly version: Schema.Int;
63
+ readonly seq: Schema.brand<Schema.Int, "Event.Seq">;
64
+ readonly version: Schema.brand<Schema.Int, "Event.Version">;
65
65
  }>>, never, never>;
66
66
  readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
67
67
  readonly directory: Schema.brand<Schema.String, "AbsolutePath">;