@opencode-ai/schema 0.0.0-next-14855 → 0.0.0-reserved.0
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 +3 -0
- package/index.js +1 -0
- package/package.json +3 -26
- package/dist/agent.d.ts +0 -159
- package/dist/agent.js +0 -43
- package/dist/catalog.d.ts +0 -69
- package/dist/catalog.js +0 -4
- package/dist/command.d.ts +0 -112
- package/dist/command.js +0 -18
- package/dist/config.d.ts +0 -69
- package/dist/config.js +0 -7
- package/dist/connection.d.ts +0 -28
- package/dist/connection.js +0 -15
- package/dist/credential.d.ts +0 -36
- package/dist/credential.js +0 -23
- package/dist/durable-event-manifest.d.ts +0 -2370
- package/dist/durable-event-manifest.js +0 -9
- package/dist/event-log.d.ts +0 -45
- package/dist/event-log.js +0 -43
- package/dist/event-manifest.d.ts +0 -15273
- package/dist/event-manifest.js +0 -52
- package/dist/event.d.ts +0 -142
- package/dist/event.js +0 -102
- package/dist/file-diff.d.ts +0 -11
- package/dist/file-diff.js +0 -10
- package/dist/filesystem-v1.d.ts +0 -1
- package/dist/filesystem-v1.js +0 -1
- package/dist/filesystem.d.ts +0 -118
- package/dist/filesystem.js +0 -35
- package/dist/form.d.ts +0 -1279
- package/dist/form.js +0 -112
- package/dist/ide-event.d.ts +0 -76
- package/dist/ide-event.js +0 -10
- package/dist/identifier.d.ts +0 -3
- package/dist/identifier.js +0 -24
- package/dist/index.d.ts +0 -32
- package/dist/index.js +0 -32
- package/dist/installation-event.d.ts +0 -149
- package/dist/installation-event.js +0 -16
- package/dist/integration-id.d.ts +0 -5
- package/dist/integration-id.js +0 -3
- package/dist/integration.d.ts +0 -532
- package/dist/integration.js +0 -93
- package/dist/legacy-event.d.ts +0 -1
- package/dist/legacy-event.js +0 -1
- package/dist/llm.d.ts +0 -28
- package/dist/llm.js +0 -19
- package/dist/location.d.ts +0 -36
- package/dist/location.js +0 -21
- package/dist/lsp-event.d.ts +0 -67
- package/dist/lsp-event.js +0 -4
- package/dist/mcp-event.d.ts +0 -188
- package/dist/mcp-event.js +0 -25
- package/dist/mcp.d.ts +0 -39
- package/dist/mcp.js +0 -38
- package/dist/model.d.ts +0 -213
- package/dist/model.js +0 -86
- package/dist/models-dev.d.ts +0 -69
- package/dist/models-dev.js +0 -7
- package/dist/permission-saved.d.ts +0 -18
- package/dist/permission-saved.js +0 -12
- package/dist/permission-v1.d.ts +0 -1
- package/dist/permission-v1.js +0 -1
- package/dist/permission.d.ts +0 -306
- package/dist/permission.js +0 -45
- package/dist/plugin.d.ts +0 -85
- package/dist/plugin.js +0 -12
- package/dist/project-copy.d.ts +0 -29
- package/dist/project-copy.js +0 -21
- package/dist/project-directories.d.ts +0 -85
- package/dist/project-directories.js +0 -8
- package/dist/project-id.d.ts +0 -5
- package/dist/project-id.js +0 -3
- package/dist/project.d.ts +0 -258
- package/dist/project.js +0 -44
- package/dist/prompt-input.d.ts +0 -106
- package/dist/prompt-input.js +0 -19
- package/dist/prompt.d.ts +0 -177
- package/dist/prompt.js +0 -43
- package/dist/provider.d.ts +0 -118
- package/dist/provider.js +0 -55
- package/dist/pty-ticket.d.ts +0 -8
- package/dist/pty-ticket.js +0 -7
- package/dist/pty.d.ts +0 -462
- package/dist/pty.js +0 -43
- package/dist/question-v1.d.ts +0 -1
- package/dist/question-v1.js +0 -1
- package/dist/question.d.ts +0 -456
- package/dist/question.js +0 -64
- package/dist/reference.d.ts +0 -120
- package/dist/reference.js +0 -31
- package/dist/revert.d.ts +0 -35
- package/dist/revert.js +0 -19
- package/dist/schema.d.ts +0 -10
- package/dist/schema.js +0 -14
- package/dist/server-event.d.ts +0 -132
- package/dist/server-event.js +0 -5
- package/dist/session-compaction-event.d.ts +0 -87
- package/dist/session-compaction-event.js +0 -10
- package/dist/session-context-entry.d.ts +0 -15
- package/dist/session-context-entry.js +0 -15
- package/dist/session-delivery.d.ts +0 -4
- package/dist/session-delivery.js +0 -3
- package/dist/session-event.d.ts +0 -12728
- package/dist/session-event.js +0 -423
- package/dist/session-id.d.ts +0 -6
- package/dist/session-id.js +0 -10
- package/dist/session-input.d.ts +0 -146
- package/dist/session-input.js +0 -18
- package/dist/session-message.d.ts +0 -1390
- package/dist/session-message.js +0 -175
- package/dist/session-status-event.d.ts +0 -299
- package/dist/session-status-event.js +0 -43
- package/dist/session-todo.d.ts +0 -117
- package/dist/session-todo.js +0 -21
- package/dist/session-v1.d.ts +0 -1
- package/dist/session-v1.js +0 -1
- package/dist/session.d.ts +0 -142
- package/dist/session.js +0 -43
- package/dist/shell.d.ts +0 -381
- package/dist/shell.js +0 -58
- package/dist/skill.d.ts +0 -126
- package/dist/skill.js +0 -45
- package/dist/tui-event.d.ts +0 -307
- package/dist/tui-event.js +0 -53
- package/dist/v1/filesystem.d.ts +0 -78
- package/dist/v1/filesystem.js +0 -8
- package/dist/v1/legacy-event.d.ts +0 -108
- package/dist/v1/legacy-event.js +0 -15
- package/dist/v1/permission.d.ts +0 -316
- package/dist/v1/permission.js +0 -41
- package/dist/v1/question.d.ts +0 -444
- package/dist/v1/question.js +0 -57
- package/dist/v1/session.d.ts +0 -7657
- package/dist/v1/session.js +0 -535
- package/dist/vcs-event.d.ts +0 -76
- package/dist/vcs-event.js +0 -11
- package/dist/vcs.d.ts +0 -12
- package/dist/vcs.js +0 -10
- package/dist/workspace-event.d.ts +0 -247
- package/dist/workspace-event.js +0 -25
- package/dist/workspace-id.d.ts +0 -6
- package/dist/workspace-id.js +0 -16
- package/dist/workspace.d.ts +0 -9
- package/dist/workspace.js +0 -5
- package/dist/worktree-event.d.ts +0 -153
- package/dist/worktree-event.js +0 -18
package/dist/event-manifest.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
export * as EventManifest from "./event-manifest.js";
|
|
2
|
-
import { Agent } from "./agent.js";
|
|
3
|
-
import { Catalog } from "./catalog.js";
|
|
4
|
-
import { Command } from "./command.js";
|
|
5
|
-
import { Config } from "./config.js";
|
|
6
|
-
import { Durable } from "./durable-event-manifest.js";
|
|
7
|
-
import { Event } from "./event.js";
|
|
8
|
-
import { FileSystem } from "./filesystem.js";
|
|
9
|
-
import { FileSystemV1 } from "./filesystem-v1.js";
|
|
10
|
-
import { Form } from "./form.js";
|
|
11
|
-
import { InstallationEvent } from "./installation-event.js";
|
|
12
|
-
import { Integration } from "./integration.js";
|
|
13
|
-
import { LegacyEvent } from "./legacy-event.js";
|
|
14
|
-
import { LspEvent } from "./lsp-event.js";
|
|
15
|
-
import { McpEvent } from "./mcp-event.js";
|
|
16
|
-
import { ModelsDev } from "./models-dev.js";
|
|
17
|
-
import { Permission } from "./permission.js";
|
|
18
|
-
import { PermissionV1 } from "./permission-v1.js";
|
|
19
|
-
import { Plugin } from "./plugin.js";
|
|
20
|
-
import { Project } from "./project.js";
|
|
21
|
-
import { ProjectDirectories } from "./project-directories.js";
|
|
22
|
-
import { Pty } from "./pty.js";
|
|
23
|
-
import { Question } from "./question.js";
|
|
24
|
-
import { QuestionV1 } from "./question-v1.js";
|
|
25
|
-
import { Reference } from "./reference.js";
|
|
26
|
-
import { ServerEvent } from "./server-event.js";
|
|
27
|
-
import { Shell } from "./shell.js";
|
|
28
|
-
import { Skill } from "./skill.js";
|
|
29
|
-
import { SessionCompactionEvent } from "./session-compaction-event.js";
|
|
30
|
-
import { SessionEvent } from "./session-event.js";
|
|
31
|
-
import { SessionStatusEvent } from "./session-status-event.js";
|
|
32
|
-
import { SessionTodo } from "./session-todo.js";
|
|
33
|
-
import { SessionV1 } from "./session-v1.js";
|
|
34
|
-
import { TuiEvent } from "./tui-event.js";
|
|
35
|
-
import { VcsEvent } from "./vcs-event.js";
|
|
36
|
-
import { WorkspaceEvent } from "./workspace-event.js";
|
|
37
|
-
import { WorktreeEvent } from "./worktree-event.js";
|
|
38
|
-
const sessionV1DurableDefinitions = SessionV1.Event.Definitions.filter((definition) => definition.durability === "durable");
|
|
39
|
-
const sessionV1LiveDefinitions = SessionV1.Event.Definitions.filter((definition) => definition.durability === "ephemeral");
|
|
40
|
-
const coreDefinitions = Event.inventory(...sessionV1DurableDefinitions, ...SessionEvent.Definitions);
|
|
41
|
-
const foundationDefinitions = Event.inventory(...ModelsDev.Event.Definitions, ...Integration.Event.Definitions, ...Catalog.Event.Definitions, ...Agent.Event.Definitions, ...coreDefinitions);
|
|
42
|
-
const featureDefinitions = Event.inventory(...FileSystem.Event.Definitions, ...Reference.Event.Definitions, ...Permission.Event.Definitions, ...Plugin.Event.Definitions, ...ProjectDirectories.Event.Definitions, ...Command.Event.Definitions, ...Config.Event.Definitions, ...Skill.Event.Definitions, ...Pty.Event.Definitions, ...Shell.Event.Definitions, ...Question.Event.Definitions, ...Form.Event.Definitions);
|
|
43
|
-
export const ServerDefinitions = Event.inventory(...foundationDefinitions, ...featureDefinitions, ...SessionTodo.Event.Definitions,
|
|
44
|
-
// Current events the TUI consumes from the public stream.
|
|
45
|
-
...SessionStatusEvent.Definitions, ...TuiEvent.Definitions, ...InstallationEvent.Definitions, ...VcsEvent.Definitions, McpEvent.StatusChanged,
|
|
46
|
-
// Shared transitional: V1 contracts the current TUI still consumes during
|
|
47
|
-
// the migration (permission.asked/replied, question.asked, session.error).
|
|
48
|
-
// Remove when the TUI moves to the current permission/question surfaces.
|
|
49
|
-
...PermissionV1.Event.Definitions, ...QuestionV1.Event.Definitions, SessionV1.Error);
|
|
50
|
-
export const Definitions = Event.inventory(...foundationDefinitions, ...sessionV1LiveDefinitions, ...InstallationEvent.Definitions, ...featureDefinitions, ...SessionTodo.Event.Definitions, ...LspEvent.Definitions, ...PermissionV1.Event.Definitions, ...TuiEvent.Definitions, ...McpEvent.Definitions, ...LegacyEvent.Definitions, ...FileSystemV1.Event.Definitions, ...Project.Event.Definitions, ...SessionStatusEvent.Definitions, ...QuestionV1.Event.Definitions, ...SessionCompactionEvent.Definitions, ...VcsEvent.Definitions, ...WorkspaceEvent.Definitions, ...WorktreeEvent.Definitions, ...ServerEvent.Definitions);
|
|
51
|
-
export const Latest = Event.latest(Definitions);
|
|
52
|
-
export { Durable };
|
package/dist/event.d.ts
DELETED
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
export * as Event from "./event.js";
|
|
2
|
-
import { Schema } from "effect";
|
|
3
|
-
import { Location } from "./location.js";
|
|
4
|
-
import { DateTimeUtcFromMillis } from "./schema.js";
|
|
5
|
-
export declare const ID: Schema.brand<Schema.String, "Event.ID"> & {
|
|
6
|
-
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
7
|
-
};
|
|
8
|
-
export type ID = typeof ID.Type;
|
|
9
|
-
/**
|
|
10
|
-
* Position in one aggregate's durable log. Values originate from the durable
|
|
11
|
-
* event envelope, synced markers, change hints, and snapshot watermarks;
|
|
12
|
-
* `after` cursors accept only values that came from those sources.
|
|
13
|
-
*/
|
|
14
|
-
export declare const Seq: Schema.brand<Schema.Int, "Event.Seq">;
|
|
15
|
-
export type Seq = typeof Seq.Type;
|
|
16
|
-
/** Durable schema version of one event type, from the event definition that committed it. */
|
|
17
|
-
export declare const Version: Schema.brand<Schema.Int, "Event.Version">;
|
|
18
|
-
export type Version = typeof Version.Type;
|
|
19
|
-
declare const DurableEnvelope: Schema.Struct<{
|
|
20
|
-
readonly aggregateID: Schema.String;
|
|
21
|
-
readonly seq: Schema.brand<Schema.Int, "Event.Seq">;
|
|
22
|
-
readonly version: Schema.brand<Schema.Int, "Event.Version">;
|
|
23
|
-
}>;
|
|
24
|
-
export type DurableEnvelope = typeof DurableEnvelope.Type;
|
|
25
|
-
export type DurableDefinition<Type extends string = string, DataSchema extends Schema.Codec<unknown, unknown> = Schema.Codec<unknown, unknown>> = Schema.Top & {
|
|
26
|
-
readonly type: Type;
|
|
27
|
-
readonly durability: "durable";
|
|
28
|
-
readonly durable: {
|
|
29
|
-
readonly version: number;
|
|
30
|
-
readonly aggregate: string;
|
|
31
|
-
};
|
|
32
|
-
readonly data: DataSchema;
|
|
33
|
-
};
|
|
34
|
-
export type EphemeralDefinition<Type extends string = string, DataSchema extends Schema.Codec<unknown, unknown> = Schema.Codec<unknown, unknown>> = Schema.Top & {
|
|
35
|
-
readonly type: Type;
|
|
36
|
-
readonly durability: "ephemeral";
|
|
37
|
-
readonly durable?: never;
|
|
38
|
-
readonly data: DataSchema;
|
|
39
|
-
};
|
|
40
|
-
export type Definition<Type extends string = string, DataSchema extends Schema.Codec<unknown, unknown> = Schema.Codec<unknown, unknown>> = DurableDefinition<Type, DataSchema> | EphemeralDefinition<Type, DataSchema>;
|
|
41
|
-
export type Data<D extends Definition> = Schema.Schema.Type<D["data"]>;
|
|
42
|
-
type PayloadBase<D extends Definition> = {
|
|
43
|
-
readonly id: ID;
|
|
44
|
-
readonly type: D["type"];
|
|
45
|
-
readonly created: typeof DateTimeUtcFromMillis.Type;
|
|
46
|
-
readonly data: Data<D>;
|
|
47
|
-
readonly location?: Location.Ref;
|
|
48
|
-
readonly metadata?: Record<string, unknown>;
|
|
49
|
-
};
|
|
50
|
-
export type Payload<D extends Definition = Definition> = D extends DurableDefinition ? PayloadBase<D> & {
|
|
51
|
-
readonly durable: DurableEnvelope;
|
|
52
|
-
} : PayloadBase<D> & {
|
|
53
|
-
readonly durable?: never;
|
|
54
|
-
};
|
|
55
|
-
type Input<Type extends string, Fields extends Readonly<Record<PropertyKey, Schema.Codec<unknown, unknown>>>> = {
|
|
56
|
-
readonly type: Type;
|
|
57
|
-
readonly durable?: {
|
|
58
|
-
readonly version: number;
|
|
59
|
-
readonly aggregate: string;
|
|
60
|
-
};
|
|
61
|
-
readonly schema: Fields;
|
|
62
|
-
};
|
|
63
|
-
export declare function durable<const Type extends string, const Fields extends Readonly<Record<PropertyKey, Schema.Codec<unknown, unknown>>>>(input: Input<Type, Fields> & {
|
|
64
|
-
readonly durable: NonNullable<Input<Type, Fields>["durable"]>;
|
|
65
|
-
}): Schema.Struct<{
|
|
66
|
-
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
67
|
-
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
68
|
-
};
|
|
69
|
-
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
70
|
-
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
71
|
-
readonly type: Schema.Literal<Type>;
|
|
72
|
-
readonly durable: Schema.Struct<{
|
|
73
|
-
readonly aggregateID: Schema.String;
|
|
74
|
-
readonly seq: Schema.brand<Schema.Int, "Event.Seq">;
|
|
75
|
-
readonly version: Schema.brand<Schema.Int, "Event.Version">;
|
|
76
|
-
}>;
|
|
77
|
-
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
78
|
-
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
79
|
-
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
80
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
81
|
-
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
82
|
-
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
83
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
84
|
-
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
85
|
-
}>, never, never>;
|
|
86
|
-
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
87
|
-
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
88
|
-
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
89
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
90
|
-
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
91
|
-
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
92
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
93
|
-
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
94
|
-
}>, never, never>;
|
|
95
|
-
}>>, never, never>;
|
|
96
|
-
readonly data: Schema.Struct<Fields>;
|
|
97
|
-
}> & {
|
|
98
|
-
type: Type;
|
|
99
|
-
durability: "durable";
|
|
100
|
-
durable: {
|
|
101
|
-
readonly version: number;
|
|
102
|
-
readonly aggregate: string;
|
|
103
|
-
};
|
|
104
|
-
data: Schema.Struct<Fields>;
|
|
105
|
-
};
|
|
106
|
-
export declare function ephemeral<const Type extends string, const Fields extends Readonly<Record<PropertyKey, Schema.Codec<unknown, unknown>>>>(input: Omit<Input<Type, Fields>, "durable">): Schema.Struct<{
|
|
107
|
-
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
108
|
-
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
109
|
-
};
|
|
110
|
-
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
111
|
-
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
112
|
-
readonly type: Schema.Literal<Type>;
|
|
113
|
-
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
114
|
-
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
115
|
-
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
116
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
117
|
-
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
118
|
-
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
119
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
120
|
-
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
121
|
-
}>, never, never>;
|
|
122
|
-
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
123
|
-
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
124
|
-
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
125
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
126
|
-
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
127
|
-
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
128
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
129
|
-
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
130
|
-
}>, never, never>;
|
|
131
|
-
}>>, never, never>;
|
|
132
|
-
readonly data: Schema.Struct<Fields>;
|
|
133
|
-
}> & {
|
|
134
|
-
type: Type;
|
|
135
|
-
durability: "ephemeral";
|
|
136
|
-
durable: undefined;
|
|
137
|
-
data: Schema.Struct<Fields>;
|
|
138
|
-
};
|
|
139
|
-
export declare function inventory<const Definitions extends ReadonlyArray<Definition>>(...definitions: Definitions): Readonly<Definitions>;
|
|
140
|
-
export declare function latest(definitions: ReadonlyArray<Definition>): ReadonlyMap<string, Definition<string, Schema.Codec<unknown, unknown, never, never>>>;
|
|
141
|
-
export declare function versionedType(type: string, version: number): string;
|
|
142
|
-
export declare function durableMap<const Definitions extends ReadonlyArray<Definition>>(definitions: Definitions): ReadonlyMap<string, DurableDefinition<string, Schema.Codec<unknown, unknown, never, never>>>;
|
package/dist/event.js
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
export * as Event from "./event.js";
|
|
2
|
-
import { Schema } from "effect";
|
|
3
|
-
import { optional } from "./schema.js";
|
|
4
|
-
import { ascending } from "./identifier.js";
|
|
5
|
-
import { Location } from "./location.js";
|
|
6
|
-
import { DateTimeUtcFromMillis, statics } from "./schema.js";
|
|
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, synced 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"));
|
|
16
|
-
const DurableEnvelope = Schema.Struct({ aggregateID: Schema.String, seq: Seq, version: Version });
|
|
17
|
-
export function durable(input) {
|
|
18
|
-
const data = Schema.Struct(input.schema);
|
|
19
|
-
return Schema.Struct({
|
|
20
|
-
id: ID,
|
|
21
|
-
created: DateTimeUtcFromMillis,
|
|
22
|
-
metadata: optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
23
|
-
type: Schema.Literal(input.type),
|
|
24
|
-
durable: DurableEnvelope,
|
|
25
|
-
location: optional(Location.Ref),
|
|
26
|
-
data,
|
|
27
|
-
})
|
|
28
|
-
.annotate({ identifier: input.type })
|
|
29
|
-
.pipe(statics(() => ({
|
|
30
|
-
type: input.type,
|
|
31
|
-
durability: "durable",
|
|
32
|
-
durable: input.durable,
|
|
33
|
-
data,
|
|
34
|
-
})));
|
|
35
|
-
}
|
|
36
|
-
export function ephemeral(input) {
|
|
37
|
-
const data = Schema.Struct(input.schema);
|
|
38
|
-
return Schema.Struct({
|
|
39
|
-
id: ID,
|
|
40
|
-
created: DateTimeUtcFromMillis,
|
|
41
|
-
metadata: optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
42
|
-
type: Schema.Literal(input.type),
|
|
43
|
-
location: optional(Location.Ref),
|
|
44
|
-
data,
|
|
45
|
-
})
|
|
46
|
-
.annotate({ identifier: input.type })
|
|
47
|
-
.pipe(statics(() => ({
|
|
48
|
-
type: input.type,
|
|
49
|
-
durability: "ephemeral",
|
|
50
|
-
durable: undefined,
|
|
51
|
-
data,
|
|
52
|
-
})));
|
|
53
|
-
}
|
|
54
|
-
export function inventory(...definitions) {
|
|
55
|
-
return Object.freeze(definitions);
|
|
56
|
-
}
|
|
57
|
-
export function latest(definitions) {
|
|
58
|
-
return readonlyMap(definitions.reduce((result, definition) => {
|
|
59
|
-
const existing = result.get(definition.type);
|
|
60
|
-
if (!existing) {
|
|
61
|
-
result.set(definition.type, definition);
|
|
62
|
-
return result;
|
|
63
|
-
}
|
|
64
|
-
if (definition.durable && existing.durable && definition.durable.version !== existing.durable.version) {
|
|
65
|
-
if (definition.durable.version > existing.durable.version)
|
|
66
|
-
result.set(definition.type, definition);
|
|
67
|
-
return result;
|
|
68
|
-
}
|
|
69
|
-
if (definition !== existing)
|
|
70
|
-
throw new Error(`Duplicate latest event definition for ${definition.type}`);
|
|
71
|
-
return result;
|
|
72
|
-
}, new Map()));
|
|
73
|
-
}
|
|
74
|
-
export function versionedType(type, version) {
|
|
75
|
-
return `${type}.${version}`;
|
|
76
|
-
}
|
|
77
|
-
export function durableMap(definitions) {
|
|
78
|
-
return readonlyMap(definitions.reduce((result, definition) => {
|
|
79
|
-
if (definition.durability !== "durable")
|
|
80
|
-
return result;
|
|
81
|
-
const key = versionedType(definition.type, definition.durable.version);
|
|
82
|
-
if (result.has(key))
|
|
83
|
-
throw new Error(`Duplicate durable event definition for ${key}`);
|
|
84
|
-
result.set(key, definition);
|
|
85
|
-
return result;
|
|
86
|
-
}, new Map()));
|
|
87
|
-
}
|
|
88
|
-
function readonlyMap(map) {
|
|
89
|
-
const result = Object.freeze({
|
|
90
|
-
get size() {
|
|
91
|
-
return map.size;
|
|
92
|
-
},
|
|
93
|
-
entries: () => map.entries(),
|
|
94
|
-
forEach: (callback, thisArg) => map.forEach((value, key) => callback.call(thisArg, value, key, result)),
|
|
95
|
-
get: (key) => map.get(key),
|
|
96
|
-
has: (key) => map.has(key),
|
|
97
|
-
keys: () => map.keys(),
|
|
98
|
-
values: () => map.values(),
|
|
99
|
-
[Symbol.iterator]: () => map[Symbol.iterator](),
|
|
100
|
-
});
|
|
101
|
-
return result;
|
|
102
|
-
}
|
package/dist/file-diff.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export * as FileDiff from "./file-diff.js";
|
|
2
|
-
import { Schema } from "effect";
|
|
3
|
-
export declare const Info: Schema.Struct<{
|
|
4
|
-
readonly file: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
5
|
-
readonly patch: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
6
|
-
readonly additions: Schema.Finite;
|
|
7
|
-
readonly deletions: Schema.Finite;
|
|
8
|
-
readonly status: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["added", "deleted", "modified"]>>>, Schema.optionalKey<Schema.Literals<readonly ["added", "deleted", "modified"]>>, never, never>;
|
|
9
|
-
}>;
|
|
10
|
-
export interface Info extends Schema.Schema.Type<typeof Info> {
|
|
11
|
-
}
|
package/dist/file-diff.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export * as FileDiff from "./file-diff.js";
|
|
2
|
-
import { Schema } from "effect";
|
|
3
|
-
import { optional } from "./schema.js";
|
|
4
|
-
export const Info = Schema.Struct({
|
|
5
|
-
file: optional(Schema.String),
|
|
6
|
-
patch: optional(Schema.String),
|
|
7
|
-
additions: Schema.Finite,
|
|
8
|
-
deletions: Schema.Finite,
|
|
9
|
-
status: optional(Schema.Literals(["added", "deleted", "modified"])),
|
|
10
|
-
}).annotate({ identifier: "SnapshotFileDiff" });
|
package/dist/filesystem-v1.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./v1/filesystem.js";
|
package/dist/filesystem-v1.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./v1/filesystem.js";
|
package/dist/filesystem.d.ts
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
export * as FileSystem from "./filesystem.js";
|
|
2
|
-
import { Schema } from "effect";
|
|
3
|
-
export declare const Event: {
|
|
4
|
-
Changed: Schema.Struct<{
|
|
5
|
-
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
6
|
-
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
7
|
-
};
|
|
8
|
-
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
9
|
-
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
10
|
-
readonly type: Schema.Literal<"filesystem.changed">;
|
|
11
|
-
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
12
|
-
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
13
|
-
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
14
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
15
|
-
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
16
|
-
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
17
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
18
|
-
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
19
|
-
}>, never, never>;
|
|
20
|
-
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
21
|
-
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
22
|
-
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
23
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
24
|
-
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
25
|
-
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
26
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
27
|
-
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
28
|
-
}>, never, never>;
|
|
29
|
-
}>>, never, never>;
|
|
30
|
-
readonly data: Schema.Struct<{
|
|
31
|
-
readonly file: Schema.String;
|
|
32
|
-
readonly event: Schema.Literals<readonly ["add", "change", "unlink"]>;
|
|
33
|
-
}>;
|
|
34
|
-
}> & {
|
|
35
|
-
type: "filesystem.changed";
|
|
36
|
-
durability: "ephemeral";
|
|
37
|
-
durable: undefined;
|
|
38
|
-
data: Schema.Struct<{
|
|
39
|
-
readonly file: Schema.String;
|
|
40
|
-
readonly event: Schema.Literals<readonly ["add", "change", "unlink"]>;
|
|
41
|
-
}>;
|
|
42
|
-
};
|
|
43
|
-
Definitions: readonly [Schema.Struct<{
|
|
44
|
-
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
45
|
-
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
46
|
-
};
|
|
47
|
-
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
48
|
-
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
49
|
-
readonly type: Schema.Literal<"filesystem.changed">;
|
|
50
|
-
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
51
|
-
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
52
|
-
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
53
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
54
|
-
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
55
|
-
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
56
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
57
|
-
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
58
|
-
}>, never, never>;
|
|
59
|
-
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
60
|
-
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
61
|
-
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
62
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
63
|
-
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
64
|
-
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
65
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
66
|
-
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
67
|
-
}>, never, never>;
|
|
68
|
-
}>>, never, never>;
|
|
69
|
-
readonly data: Schema.Struct<{
|
|
70
|
-
readonly file: Schema.String;
|
|
71
|
-
readonly event: Schema.Literals<readonly ["add", "change", "unlink"]>;
|
|
72
|
-
}>;
|
|
73
|
-
}> & {
|
|
74
|
-
type: "filesystem.changed";
|
|
75
|
-
durability: "ephemeral";
|
|
76
|
-
durable: undefined;
|
|
77
|
-
data: Schema.Struct<{
|
|
78
|
-
readonly file: Schema.String;
|
|
79
|
-
readonly event: Schema.Literals<readonly ["add", "change", "unlink"]>;
|
|
80
|
-
}>;
|
|
81
|
-
}];
|
|
82
|
-
};
|
|
83
|
-
export interface Entry extends Schema.Schema.Type<typeof Entry> {
|
|
84
|
-
}
|
|
85
|
-
export declare const Entry: Schema.Struct<{
|
|
86
|
-
readonly path: Schema.brand<Schema.String, "RelativePath">;
|
|
87
|
-
readonly type: Schema.Literals<readonly ["file", "directory"]>;
|
|
88
|
-
}>;
|
|
89
|
-
export interface Submatch extends Schema.Schema.Type<typeof Submatch> {
|
|
90
|
-
}
|
|
91
|
-
export declare const Submatch: Schema.Struct<{
|
|
92
|
-
readonly text: Schema.String;
|
|
93
|
-
readonly start: Schema.Int;
|
|
94
|
-
readonly end: Schema.Int;
|
|
95
|
-
}>;
|
|
96
|
-
export interface Match extends Schema.Schema.Type<typeof Match> {
|
|
97
|
-
}
|
|
98
|
-
export declare const Match: Schema.Struct<{
|
|
99
|
-
readonly entry: Schema.Struct<{
|
|
100
|
-
readonly path: Schema.brand<Schema.String, "RelativePath">;
|
|
101
|
-
readonly type: Schema.Literals<readonly ["file", "directory"]>;
|
|
102
|
-
}>;
|
|
103
|
-
readonly line: Schema.Int;
|
|
104
|
-
readonly offset: Schema.Int;
|
|
105
|
-
readonly text: Schema.String;
|
|
106
|
-
readonly submatches: Schema.$Array<Schema.Struct<{
|
|
107
|
-
readonly text: Schema.String;
|
|
108
|
-
readonly start: Schema.Int;
|
|
109
|
-
readonly end: Schema.Int;
|
|
110
|
-
}>>;
|
|
111
|
-
}>;
|
|
112
|
-
declare const FindInput_base: Schema.Class<FindInput, Schema.Struct<{
|
|
113
|
-
readonly query: Schema.String;
|
|
114
|
-
readonly type: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["file", "directory"]>>>, Schema.optionalKey<Schema.Literals<readonly ["file", "directory"]>>, never, never>;
|
|
115
|
-
readonly limit: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
116
|
-
}>, {}>;
|
|
117
|
-
export declare class FindInput extends FindInput_base {
|
|
118
|
-
}
|
package/dist/filesystem.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export * as FileSystem from "./filesystem.js";
|
|
2
|
-
import { Schema } from "effect";
|
|
3
|
-
import { optional } from "./schema.js";
|
|
4
|
-
import { ephemeral, inventory } from "./event.js";
|
|
5
|
-
import { NonNegativeInt, PositiveInt, RelativePath } from "./schema.js";
|
|
6
|
-
const Changed = ephemeral({
|
|
7
|
-
type: "filesystem.changed",
|
|
8
|
-
schema: {
|
|
9
|
-
file: Schema.String,
|
|
10
|
-
event: Schema.Literals(["add", "change", "unlink"]),
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
export const Event = { Changed, Definitions: inventory(Changed) };
|
|
14
|
-
export const Entry = Schema.Struct({
|
|
15
|
-
path: RelativePath,
|
|
16
|
-
type: Schema.Literals(["file", "directory"]),
|
|
17
|
-
}).annotate({ identifier: "FileSystem.Entry" });
|
|
18
|
-
export const Submatch = Schema.Struct({
|
|
19
|
-
text: Schema.String,
|
|
20
|
-
start: NonNegativeInt,
|
|
21
|
-
end: NonNegativeInt,
|
|
22
|
-
}).annotate({ identifier: "FileSystem.Submatch" });
|
|
23
|
-
export const Match = Schema.Struct({
|
|
24
|
-
entry: Entry,
|
|
25
|
-
line: PositiveInt,
|
|
26
|
-
offset: NonNegativeInt,
|
|
27
|
-
text: Schema.String,
|
|
28
|
-
submatches: Schema.Array(Submatch),
|
|
29
|
-
}).annotate({ identifier: "FileSystem.Match" });
|
|
30
|
-
export class FindInput extends Schema.Class("FileSystem.FindInput")({
|
|
31
|
-
query: Schema.String,
|
|
32
|
-
type: Schema.Literals(["file", "directory"]).pipe(optional),
|
|
33
|
-
limit: PositiveInt.pipe(optional),
|
|
34
|
-
}) {
|
|
35
|
-
}
|