@opencode-ai/schema 0.0.0-next-14659
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.d.ts +175 -0
- package/dist/agent.js +43 -0
- package/dist/catalog.d.ts +89 -0
- package/dist/catalog.js +4 -0
- package/dist/command.d.ts +44 -0
- package/dist/command.js +12 -0
- package/dist/connection.d.ts +28 -0
- package/dist/connection.js +15 -0
- package/dist/credential.d.ts +36 -0
- package/dist/credential.js +23 -0
- package/dist/durable-event-manifest.d.ts +10626 -0
- package/dist/durable-event-manifest.js +12 -0
- package/dist/event-manifest.d.ts +15309 -0
- package/dist/event-manifest.js +43 -0
- package/dist/event.d.ts +82 -0
- package/dist/event.js +73 -0
- package/dist/file-diff.d.ts +11 -0
- package/dist/file-diff.js +10 -0
- package/dist/filesystem-watcher.d.ts +102 -0
- package/dist/filesystem-watcher.js +11 -0
- package/dist/filesystem.d.ts +134 -0
- package/dist/filesystem.js +32 -0
- package/dist/ide-event.d.ts +96 -0
- package/dist/ide-event.js +10 -0
- package/dist/identifier.d.ts +3 -0
- package/dist/identifier.js +24 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +29 -0
- package/dist/installation-event.d.ts +189 -0
- package/dist/installation-event.js +16 -0
- package/dist/integration-id.d.ts +5 -0
- package/dist/integration-id.js +3 -0
- package/dist/integration.d.ts +572 -0
- package/dist/integration.js +93 -0
- package/dist/legacy-event.d.ts +1 -0
- package/dist/legacy-event.js +1 -0
- package/dist/llm.d.ts +28 -0
- package/dist/llm.js +19 -0
- package/dist/location.d.ts +36 -0
- package/dist/location.js +21 -0
- package/dist/lsp-event.d.ts +87 -0
- package/dist/lsp-event.js +4 -0
- package/dist/mcp-event.d.ts +286 -0
- package/dist/mcp-event.js +25 -0
- package/dist/mcp.d.ts +39 -0
- package/dist/mcp.js +38 -0
- package/dist/model.d.ts +205 -0
- package/dist/model.js +86 -0
- package/dist/models-dev.d.ts +89 -0
- package/dist/models-dev.js +7 -0
- package/dist/permission-saved.d.ts +18 -0
- package/dist/permission-saved.js +12 -0
- package/dist/permission-v1.d.ts +1 -0
- package/dist/permission-v1.js +1 -0
- package/dist/permission.d.ts +346 -0
- package/dist/permission.js +45 -0
- package/dist/plugin.d.ts +105 -0
- package/dist/plugin.js +12 -0
- package/dist/project-copy.d.ts +29 -0
- package/dist/project-copy.js +21 -0
- package/dist/project-directories.d.ts +105 -0
- package/dist/project-directories.js +8 -0
- package/dist/project-id.d.ts +5 -0
- package/dist/project-id.js +3 -0
- package/dist/project.d.ts +278 -0
- package/dist/project.js +44 -0
- package/dist/prompt-input.d.ts +106 -0
- package/dist/prompt-input.js +19 -0
- package/dist/prompt.d.ts +177 -0
- package/dist/prompt.js +43 -0
- package/dist/provider.d.ts +111 -0
- package/dist/provider.js +53 -0
- package/dist/pty-ticket.d.ts +8 -0
- package/dist/pty-ticket.js +7 -0
- package/dist/pty.d.ts +542 -0
- package/dist/pty.js +43 -0
- package/dist/question-v1.d.ts +1 -0
- package/dist/question-v1.js +1 -0
- package/dist/question.d.ts +516 -0
- package/dist/question.js +64 -0
- package/dist/reference.d.ts +140 -0
- package/dist/reference.js +31 -0
- package/dist/revert.d.ts +34 -0
- package/dist/revert.js +19 -0
- package/dist/schema.d.ts +10 -0
- package/dist/schema.js +14 -0
- package/dist/server-event.d.ts +172 -0
- package/dist/server-event.js +5 -0
- package/dist/session-compaction-event.d.ts +107 -0
- package/dist/session-compaction-event.js +10 -0
- package/dist/session-delivery.d.ts +4 -0
- package/dist/session-delivery.js +3 -0
- package/dist/session-event.d.ts +14225 -0
- package/dist/session-event.js +421 -0
- package/dist/session-id.d.ts +6 -0
- package/dist/session-id.js +10 -0
- package/dist/session-input.d.ts +145 -0
- package/dist/session-input.js +18 -0
- package/dist/session-message.d.ts +1318 -0
- package/dist/session-message.js +171 -0
- package/dist/session-status-event.d.ts +339 -0
- package/dist/session-status-event.js +43 -0
- package/dist/session-todo.d.ts +137 -0
- package/dist/session-todo.js +21 -0
- package/dist/session-v1.d.ts +1 -0
- package/dist/session-v1.js +1 -0
- package/dist/session.d.ts +140 -0
- package/dist/session.js +43 -0
- package/dist/shell.d.ts +441 -0
- package/dist/shell.js +58 -0
- package/dist/skill.d.ts +146 -0
- package/dist/skill.js +45 -0
- package/dist/tui-event.d.ts +387 -0
- package/dist/tui-event.js +53 -0
- package/dist/v1/legacy-event.d.ts +128 -0
- package/dist/v1/legacy-event.js +15 -0
- package/dist/v1/permission.d.ts +356 -0
- package/dist/v1/permission.js +41 -0
- package/dist/v1/question.d.ts +504 -0
- package/dist/v1/question.js +57 -0
- package/dist/v1/session.d.ts +7775 -0
- package/dist/v1/session.js +535 -0
- package/dist/vcs-event.d.ts +96 -0
- package/dist/vcs-event.js +11 -0
- package/dist/workspace-event.d.ts +307 -0
- package/dist/workspace-event.js +25 -0
- package/dist/workspace-id.d.ts +6 -0
- package/dist/workspace-id.js +16 -0
- package/dist/workspace.d.ts +9 -0
- package/dist/workspace.js +5 -0
- package/dist/worktree-event.d.ts +193 -0
- package/dist/worktree-event.js +18 -0
- package/package.json +41 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export * as EventManifest from "./event-manifest.js";
|
|
2
|
+
import { Agent } from "./agent.js";
|
|
3
|
+
import { Catalog } from "./catalog.js";
|
|
4
|
+
import { Durable } from "./durable-event-manifest.js";
|
|
5
|
+
import { Event } from "./event.js";
|
|
6
|
+
import { FileSystem } from "./filesystem.js";
|
|
7
|
+
import { FileSystemWatcher } from "./filesystem-watcher.js";
|
|
8
|
+
import { InstallationEvent } from "./installation-event.js";
|
|
9
|
+
import { Integration } from "./integration.js";
|
|
10
|
+
import { LegacyEvent } from "./legacy-event.js";
|
|
11
|
+
import { LspEvent } from "./lsp-event.js";
|
|
12
|
+
import { McpEvent } from "./mcp-event.js";
|
|
13
|
+
import { ModelsDev } from "./models-dev.js";
|
|
14
|
+
import { Permission } from "./permission.js";
|
|
15
|
+
import { PermissionV1 } from "./permission-v1.js";
|
|
16
|
+
import { Plugin } from "./plugin.js";
|
|
17
|
+
import { Project } from "./project.js";
|
|
18
|
+
import { ProjectDirectories } from "./project-directories.js";
|
|
19
|
+
import { Pty } from "./pty.js";
|
|
20
|
+
import { Question } from "./question.js";
|
|
21
|
+
import { QuestionV1 } from "./question-v1.js";
|
|
22
|
+
import { Reference } from "./reference.js";
|
|
23
|
+
import { ServerEvent } from "./server-event.js";
|
|
24
|
+
import { Shell } from "./shell.js";
|
|
25
|
+
import { Skill } from "./skill.js";
|
|
26
|
+
import { SessionCompactionEvent } from "./session-compaction-event.js";
|
|
27
|
+
import { SessionEvent } from "./session-event.js";
|
|
28
|
+
import { SessionStatusEvent } from "./session-status-event.js";
|
|
29
|
+
import { SessionTodo } from "./session-todo.js";
|
|
30
|
+
import { SessionV1 } from "./session-v1.js";
|
|
31
|
+
import { TuiEvent } from "./tui-event.js";
|
|
32
|
+
import { VcsEvent } from "./vcs-event.js";
|
|
33
|
+
import { WorkspaceEvent } from "./workspace-event.js";
|
|
34
|
+
import { WorktreeEvent } from "./worktree-event.js";
|
|
35
|
+
const sessionV1DurableDefinitions = SessionV1.Event.Definitions.filter((definition) => definition.durable !== undefined);
|
|
36
|
+
const sessionV1LiveDefinitions = SessionV1.Event.Definitions.filter((definition) => definition.durable === undefined);
|
|
37
|
+
const coreDefinitions = Event.inventory(...sessionV1DurableDefinitions, ...SessionEvent.Definitions);
|
|
38
|
+
const foundationDefinitions = Event.inventory(...ModelsDev.Event.Definitions, ...Integration.Event.Definitions, ...Catalog.Event.Definitions, ...Agent.Event.Definitions, ...coreDefinitions);
|
|
39
|
+
const featureDefinitions = Event.inventory(...FileSystem.Event.Definitions, ...Reference.Event.Definitions, ...Permission.Event.Definitions, ...Plugin.Event.Definitions, ...ProjectDirectories.Event.Definitions, ...Skill.Event.Definitions, ...FileSystemWatcher.Event.Definitions, ...Pty.Event.Definitions, ...Shell.Event.Definitions, ...Question.Event.Definitions);
|
|
40
|
+
export const ServerDefinitions = Event.inventory(...foundationDefinitions, ...featureDefinitions, ...SessionTodo.Event.Definitions);
|
|
41
|
+
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);
|
|
42
|
+
export const Latest = Event.latest(Definitions);
|
|
43
|
+
export { Durable };
|
package/dist/event.d.ts
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export * as Event from "./event.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { Location } from "./location.js";
|
|
4
|
+
export declare const ID: Schema.brand<Schema.String, "Event.ID"> & {
|
|
5
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
6
|
+
};
|
|
7
|
+
export type ID = typeof ID.Type;
|
|
8
|
+
export type Definition<Type extends string = string, DataSchema extends Schema.Codec<unknown, unknown> = Schema.Codec<unknown, unknown>> = Schema.Top & {
|
|
9
|
+
readonly type: Type;
|
|
10
|
+
readonly durable?: {
|
|
11
|
+
readonly version: number;
|
|
12
|
+
readonly aggregate: string;
|
|
13
|
+
};
|
|
14
|
+
readonly data: DataSchema;
|
|
15
|
+
};
|
|
16
|
+
export type Data<D extends Definition> = Schema.Schema.Type<D["data"]>;
|
|
17
|
+
export type Payload<D extends Definition = Definition> = {
|
|
18
|
+
readonly id: ID;
|
|
19
|
+
readonly type: D["type"];
|
|
20
|
+
readonly data: Data<D>;
|
|
21
|
+
readonly durable?: {
|
|
22
|
+
readonly aggregateID: string;
|
|
23
|
+
readonly seq: number;
|
|
24
|
+
readonly version: number;
|
|
25
|
+
};
|
|
26
|
+
readonly location?: Location.Ref;
|
|
27
|
+
readonly metadata?: Record<string, unknown>;
|
|
28
|
+
};
|
|
29
|
+
export declare function define<const Type extends string, const Fields extends Readonly<Record<PropertyKey, Schema.Codec<unknown, unknown>>>>(input: {
|
|
30
|
+
readonly type: Type;
|
|
31
|
+
readonly durable?: {
|
|
32
|
+
readonly version: number;
|
|
33
|
+
readonly aggregate: string;
|
|
34
|
+
};
|
|
35
|
+
readonly schema: Fields;
|
|
36
|
+
}): Schema.Struct<{
|
|
37
|
+
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
38
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
39
|
+
};
|
|
40
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
41
|
+
readonly type: Schema.Literal<Type>;
|
|
42
|
+
readonly durable: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
43
|
+
readonly aggregateID: Schema.String;
|
|
44
|
+
readonly seq: Schema.Int;
|
|
45
|
+
readonly version: Schema.Int;
|
|
46
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
47
|
+
readonly aggregateID: Schema.String;
|
|
48
|
+
readonly seq: Schema.Int;
|
|
49
|
+
readonly version: Schema.Int;
|
|
50
|
+
}>>, never, never>;
|
|
51
|
+
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
52
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
53
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
54
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
55
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
56
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
57
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
58
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
59
|
+
}>, never, never>;
|
|
60
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
61
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
62
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
63
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
64
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
65
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
66
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
67
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
68
|
+
}>, never, never>;
|
|
69
|
+
}>>, never, never>;
|
|
70
|
+
readonly data: Schema.Struct<Fields>;
|
|
71
|
+
}> & {
|
|
72
|
+
data: Schema.Struct<Fields>;
|
|
73
|
+
durable?: {
|
|
74
|
+
readonly version: number;
|
|
75
|
+
readonly aggregate: string;
|
|
76
|
+
} | undefined;
|
|
77
|
+
type: Type;
|
|
78
|
+
};
|
|
79
|
+
export declare function inventory<const Definitions extends ReadonlyArray<Definition>>(...definitions: Definitions): Readonly<Definitions>;
|
|
80
|
+
export declare function latest(definitions: ReadonlyArray<Definition>): ReadonlyMap<string, Definition<string, Schema.Codec<unknown, unknown, never, never>>>;
|
|
81
|
+
export declare function versionedType(type: string, version: number): string;
|
|
82
|
+
export declare function durable<const Definitions extends ReadonlyArray<Definition>>(definitions: Definitions): ReadonlyMap<string, Definitions[number]>;
|
package/dist/event.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
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 { 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
|
+
export function define(input) {
|
|
9
|
+
const data = Schema.Struct(input.schema);
|
|
10
|
+
return Schema.Struct({
|
|
11
|
+
id: ID,
|
|
12
|
+
metadata: optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
13
|
+
type: Schema.Literal(input.type),
|
|
14
|
+
durable: optional(Schema.Struct({ aggregateID: Schema.String, seq: Schema.Int, version: Schema.Int })),
|
|
15
|
+
location: optional(Location.Ref),
|
|
16
|
+
data,
|
|
17
|
+
})
|
|
18
|
+
.annotate({ identifier: input.type })
|
|
19
|
+
.pipe(statics(() => ({
|
|
20
|
+
type: input.type,
|
|
21
|
+
...(input.durable === undefined ? {} : { durable: input.durable }),
|
|
22
|
+
data,
|
|
23
|
+
})));
|
|
24
|
+
}
|
|
25
|
+
export function inventory(...definitions) {
|
|
26
|
+
return Object.freeze(definitions);
|
|
27
|
+
}
|
|
28
|
+
export function latest(definitions) {
|
|
29
|
+
return readonlyMap(definitions.reduce((result, definition) => {
|
|
30
|
+
const existing = result.get(definition.type);
|
|
31
|
+
if (!existing) {
|
|
32
|
+
result.set(definition.type, definition);
|
|
33
|
+
return result;
|
|
34
|
+
}
|
|
35
|
+
if (definition.durable && existing.durable && definition.durable.version !== existing.durable.version) {
|
|
36
|
+
if (definition.durable.version > existing.durable.version)
|
|
37
|
+
result.set(definition.type, definition);
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
if (definition !== existing)
|
|
41
|
+
throw new Error(`Duplicate latest event definition for ${definition.type}`);
|
|
42
|
+
return result;
|
|
43
|
+
}, new Map()));
|
|
44
|
+
}
|
|
45
|
+
export function versionedType(type, version) {
|
|
46
|
+
return `${type}.${version}`;
|
|
47
|
+
}
|
|
48
|
+
export function durable(definitions) {
|
|
49
|
+
return readonlyMap(definitions.reduce((result, definition) => {
|
|
50
|
+
if (!definition.durable)
|
|
51
|
+
return result;
|
|
52
|
+
const key = versionedType(definition.type, definition.durable.version);
|
|
53
|
+
if (result.has(key))
|
|
54
|
+
throw new Error(`Duplicate durable event definition for ${key}`);
|
|
55
|
+
result.set(key, definition);
|
|
56
|
+
return result;
|
|
57
|
+
}, new Map()));
|
|
58
|
+
}
|
|
59
|
+
function readonlyMap(map) {
|
|
60
|
+
const result = Object.freeze({
|
|
61
|
+
get size() {
|
|
62
|
+
return map.size;
|
|
63
|
+
},
|
|
64
|
+
entries: () => map.entries(),
|
|
65
|
+
forEach: (callback, thisArg) => map.forEach((value, key) => callback.call(thisArg, value, key, result)),
|
|
66
|
+
get: (key) => map.get(key),
|
|
67
|
+
has: (key) => map.has(key),
|
|
68
|
+
keys: () => map.keys(),
|
|
69
|
+
values: () => map.values(),
|
|
70
|
+
[Symbol.iterator]: () => map[Symbol.iterator](),
|
|
71
|
+
});
|
|
72
|
+
return result;
|
|
73
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
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" });
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
export * as FileSystemWatcher from "./filesystem-watcher.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
export declare const Event: {
|
|
4
|
+
Updated: Schema.Struct<{
|
|
5
|
+
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
6
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
7
|
+
};
|
|
8
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
9
|
+
readonly type: Schema.Literal<"file.watcher.updated">;
|
|
10
|
+
readonly durable: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
11
|
+
readonly aggregateID: Schema.String;
|
|
12
|
+
readonly seq: Schema.Int;
|
|
13
|
+
readonly version: Schema.Int;
|
|
14
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
15
|
+
readonly aggregateID: Schema.String;
|
|
16
|
+
readonly seq: Schema.Int;
|
|
17
|
+
readonly version: Schema.Int;
|
|
18
|
+
}>>, never, never>;
|
|
19
|
+
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
20
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
21
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
22
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
23
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
24
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
25
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
26
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
27
|
+
}>, never, never>;
|
|
28
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
29
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
30
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
31
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
32
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
33
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
34
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
35
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
36
|
+
}>, never, never>;
|
|
37
|
+
}>>, never, never>;
|
|
38
|
+
readonly data: Schema.Struct<{
|
|
39
|
+
readonly file: Schema.String;
|
|
40
|
+
readonly event: Schema.Literals<readonly ["add", "change", "unlink"]>;
|
|
41
|
+
}>;
|
|
42
|
+
}> & {
|
|
43
|
+
data: Schema.Struct<{
|
|
44
|
+
readonly file: Schema.String;
|
|
45
|
+
readonly event: Schema.Literals<readonly ["add", "change", "unlink"]>;
|
|
46
|
+
}>;
|
|
47
|
+
durable?: {
|
|
48
|
+
readonly version: number;
|
|
49
|
+
readonly aggregate: string;
|
|
50
|
+
} | undefined;
|
|
51
|
+
type: "file.watcher.updated";
|
|
52
|
+
};
|
|
53
|
+
Definitions: readonly [Schema.Struct<{
|
|
54
|
+
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
55
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
56
|
+
};
|
|
57
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
58
|
+
readonly type: Schema.Literal<"file.watcher.updated">;
|
|
59
|
+
readonly durable: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
60
|
+
readonly aggregateID: Schema.String;
|
|
61
|
+
readonly seq: Schema.Int;
|
|
62
|
+
readonly version: Schema.Int;
|
|
63
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
64
|
+
readonly aggregateID: Schema.String;
|
|
65
|
+
readonly seq: Schema.Int;
|
|
66
|
+
readonly version: Schema.Int;
|
|
67
|
+
}>>, never, never>;
|
|
68
|
+
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
69
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
70
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
71
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
72
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
73
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
74
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
75
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
76
|
+
}>, never, never>;
|
|
77
|
+
}>>>, Schema.optionalKey<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
|
+
}>>, never, never>;
|
|
87
|
+
readonly data: Schema.Struct<{
|
|
88
|
+
readonly file: Schema.String;
|
|
89
|
+
readonly event: Schema.Literals<readonly ["add", "change", "unlink"]>;
|
|
90
|
+
}>;
|
|
91
|
+
}> & {
|
|
92
|
+
data: Schema.Struct<{
|
|
93
|
+
readonly file: Schema.String;
|
|
94
|
+
readonly event: Schema.Literals<readonly ["add", "change", "unlink"]>;
|
|
95
|
+
}>;
|
|
96
|
+
durable?: {
|
|
97
|
+
readonly version: number;
|
|
98
|
+
readonly aggregate: string;
|
|
99
|
+
} | undefined;
|
|
100
|
+
type: "file.watcher.updated";
|
|
101
|
+
}];
|
|
102
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * as FileSystemWatcher from "./filesystem-watcher.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { define, inventory } from "./event.js";
|
|
4
|
+
const Updated = define({
|
|
5
|
+
type: "file.watcher.updated",
|
|
6
|
+
schema: {
|
|
7
|
+
file: Schema.String,
|
|
8
|
+
event: Schema.Literals(["add", "change", "unlink"]),
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
export const Event = { Updated, Definitions: inventory(Updated) };
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
export * as FileSystem from "./filesystem.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
export declare const Event: {
|
|
4
|
+
Edited: Schema.Struct<{
|
|
5
|
+
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
6
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
7
|
+
};
|
|
8
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
9
|
+
readonly type: Schema.Literal<"file.edited">;
|
|
10
|
+
readonly durable: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
11
|
+
readonly aggregateID: Schema.String;
|
|
12
|
+
readonly seq: Schema.Int;
|
|
13
|
+
readonly version: Schema.Int;
|
|
14
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
15
|
+
readonly aggregateID: Schema.String;
|
|
16
|
+
readonly seq: Schema.Int;
|
|
17
|
+
readonly version: Schema.Int;
|
|
18
|
+
}>>, never, never>;
|
|
19
|
+
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
20
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
21
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
22
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
23
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
24
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
25
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
26
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
27
|
+
}>, never, never>;
|
|
28
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
29
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
30
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
31
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
32
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
33
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
34
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
35
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
36
|
+
}>, never, never>;
|
|
37
|
+
}>>, never, never>;
|
|
38
|
+
readonly data: Schema.Struct<{
|
|
39
|
+
readonly file: Schema.String;
|
|
40
|
+
}>;
|
|
41
|
+
}> & {
|
|
42
|
+
data: Schema.Struct<{
|
|
43
|
+
readonly file: Schema.String;
|
|
44
|
+
}>;
|
|
45
|
+
durable?: {
|
|
46
|
+
readonly version: number;
|
|
47
|
+
readonly aggregate: string;
|
|
48
|
+
} | undefined;
|
|
49
|
+
type: "file.edited";
|
|
50
|
+
};
|
|
51
|
+
Definitions: readonly [Schema.Struct<{
|
|
52
|
+
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
53
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
54
|
+
};
|
|
55
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
56
|
+
readonly type: Schema.Literal<"file.edited">;
|
|
57
|
+
readonly durable: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
58
|
+
readonly aggregateID: Schema.String;
|
|
59
|
+
readonly seq: Schema.Int;
|
|
60
|
+
readonly version: Schema.Int;
|
|
61
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
62
|
+
readonly aggregateID: Schema.String;
|
|
63
|
+
readonly seq: Schema.Int;
|
|
64
|
+
readonly version: Schema.Int;
|
|
65
|
+
}>>, never, never>;
|
|
66
|
+
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
67
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
68
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
69
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
70
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
71
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
72
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
73
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
74
|
+
}>, never, never>;
|
|
75
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
76
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
77
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
78
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
79
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
80
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
81
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
82
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
83
|
+
}>, never, never>;
|
|
84
|
+
}>>, never, never>;
|
|
85
|
+
readonly data: Schema.Struct<{
|
|
86
|
+
readonly file: Schema.String;
|
|
87
|
+
}>;
|
|
88
|
+
}> & {
|
|
89
|
+
data: Schema.Struct<{
|
|
90
|
+
readonly file: Schema.String;
|
|
91
|
+
}>;
|
|
92
|
+
durable?: {
|
|
93
|
+
readonly version: number;
|
|
94
|
+
readonly aggregate: string;
|
|
95
|
+
} | undefined;
|
|
96
|
+
type: "file.edited";
|
|
97
|
+
}];
|
|
98
|
+
};
|
|
99
|
+
export interface Entry extends Schema.Schema.Type<typeof Entry> {
|
|
100
|
+
}
|
|
101
|
+
export declare const Entry: Schema.Struct<{
|
|
102
|
+
readonly path: Schema.brand<Schema.String, "RelativePath">;
|
|
103
|
+
readonly type: Schema.Literals<readonly ["file", "directory"]>;
|
|
104
|
+
}>;
|
|
105
|
+
export interface Submatch extends Schema.Schema.Type<typeof Submatch> {
|
|
106
|
+
}
|
|
107
|
+
export declare const Submatch: Schema.Struct<{
|
|
108
|
+
readonly text: Schema.String;
|
|
109
|
+
readonly start: Schema.Int;
|
|
110
|
+
readonly end: Schema.Int;
|
|
111
|
+
}>;
|
|
112
|
+
export interface Match extends Schema.Schema.Type<typeof Match> {
|
|
113
|
+
}
|
|
114
|
+
export declare const Match: Schema.Struct<{
|
|
115
|
+
readonly entry: Schema.Struct<{
|
|
116
|
+
readonly path: Schema.brand<Schema.String, "RelativePath">;
|
|
117
|
+
readonly type: Schema.Literals<readonly ["file", "directory"]>;
|
|
118
|
+
}>;
|
|
119
|
+
readonly line: Schema.Int;
|
|
120
|
+
readonly offset: Schema.Int;
|
|
121
|
+
readonly text: Schema.String;
|
|
122
|
+
readonly submatches: Schema.$Array<Schema.Struct<{
|
|
123
|
+
readonly text: Schema.String;
|
|
124
|
+
readonly start: Schema.Int;
|
|
125
|
+
readonly end: Schema.Int;
|
|
126
|
+
}>>;
|
|
127
|
+
}>;
|
|
128
|
+
declare const FindInput_base: Schema.Class<FindInput, Schema.Struct<{
|
|
129
|
+
readonly query: Schema.String;
|
|
130
|
+
readonly type: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["file", "directory"]>>>, Schema.optionalKey<Schema.Literals<readonly ["file", "directory"]>>, never, never>;
|
|
131
|
+
readonly limit: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
132
|
+
}>, {}>;
|
|
133
|
+
export declare class FindInput extends FindInput_base {
|
|
134
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export * as FileSystem from "./filesystem.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { optional } from "./schema.js";
|
|
4
|
+
import { define, inventory } from "./event.js";
|
|
5
|
+
import { NonNegativeInt, PositiveInt, RelativePath } from "./schema.js";
|
|
6
|
+
const Edited = define({
|
|
7
|
+
type: "file.edited",
|
|
8
|
+
schema: { file: Schema.String },
|
|
9
|
+
});
|
|
10
|
+
export const Event = { Edited, Definitions: inventory(Edited) };
|
|
11
|
+
export const Entry = Schema.Struct({
|
|
12
|
+
path: RelativePath,
|
|
13
|
+
type: Schema.Literals(["file", "directory"]),
|
|
14
|
+
}).annotate({ identifier: "FileSystem.Entry" });
|
|
15
|
+
export const Submatch = Schema.Struct({
|
|
16
|
+
text: Schema.String,
|
|
17
|
+
start: NonNegativeInt,
|
|
18
|
+
end: NonNegativeInt,
|
|
19
|
+
}).annotate({ identifier: "FileSystem.Submatch" });
|
|
20
|
+
export const Match = Schema.Struct({
|
|
21
|
+
entry: Entry,
|
|
22
|
+
line: PositiveInt,
|
|
23
|
+
offset: NonNegativeInt,
|
|
24
|
+
text: Schema.String,
|
|
25
|
+
submatches: Schema.Array(Submatch),
|
|
26
|
+
}).annotate({ identifier: "FileSystem.Match" });
|
|
27
|
+
export class FindInput extends Schema.Class("FileSystem.FindInput")({
|
|
28
|
+
query: Schema.String,
|
|
29
|
+
type: Schema.Literals(["file", "directory"]).pipe(optional),
|
|
30
|
+
limit: PositiveInt.pipe(optional),
|
|
31
|
+
}) {
|
|
32
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
export * as IdeEvent from "./ide-event.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
export declare const Installed: Schema.Struct<{
|
|
4
|
+
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
5
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
6
|
+
};
|
|
7
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
8
|
+
readonly type: Schema.Literal<"ide.installed">;
|
|
9
|
+
readonly durable: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
10
|
+
readonly aggregateID: Schema.String;
|
|
11
|
+
readonly seq: Schema.Int;
|
|
12
|
+
readonly version: Schema.Int;
|
|
13
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
14
|
+
readonly aggregateID: Schema.String;
|
|
15
|
+
readonly seq: Schema.Int;
|
|
16
|
+
readonly version: Schema.Int;
|
|
17
|
+
}>>, never, never>;
|
|
18
|
+
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
19
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
20
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
21
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
22
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
23
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
24
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
25
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
26
|
+
}>, never, never>;
|
|
27
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
28
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
29
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
30
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
31
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
32
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
33
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
34
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
35
|
+
}>, never, never>;
|
|
36
|
+
}>>, never, never>;
|
|
37
|
+
readonly data: Schema.Struct<{
|
|
38
|
+
readonly ide: Schema.String;
|
|
39
|
+
}>;
|
|
40
|
+
}> & {
|
|
41
|
+
data: Schema.Struct<{
|
|
42
|
+
readonly ide: Schema.String;
|
|
43
|
+
}>;
|
|
44
|
+
durable?: {
|
|
45
|
+
readonly version: number;
|
|
46
|
+
readonly aggregate: string;
|
|
47
|
+
} | undefined;
|
|
48
|
+
type: "ide.installed";
|
|
49
|
+
};
|
|
50
|
+
export declare const Definitions: readonly [Schema.Struct<{
|
|
51
|
+
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
52
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
53
|
+
};
|
|
54
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
55
|
+
readonly type: Schema.Literal<"ide.installed">;
|
|
56
|
+
readonly durable: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
57
|
+
readonly aggregateID: Schema.String;
|
|
58
|
+
readonly seq: Schema.Int;
|
|
59
|
+
readonly version: Schema.Int;
|
|
60
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
61
|
+
readonly aggregateID: Schema.String;
|
|
62
|
+
readonly seq: Schema.Int;
|
|
63
|
+
readonly version: Schema.Int;
|
|
64
|
+
}>>, never, never>;
|
|
65
|
+
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
66
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
67
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
68
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
69
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
70
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
71
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
72
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
73
|
+
}>, never, never>;
|
|
74
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
75
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
76
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
77
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
78
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
79
|
+
}>>, Schema.optionalKey<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
|
+
}>, never, never>;
|
|
83
|
+
}>>, never, never>;
|
|
84
|
+
readonly data: Schema.Struct<{
|
|
85
|
+
readonly ide: Schema.String;
|
|
86
|
+
}>;
|
|
87
|
+
}> & {
|
|
88
|
+
data: Schema.Struct<{
|
|
89
|
+
readonly ide: Schema.String;
|
|
90
|
+
}>;
|
|
91
|
+
durable?: {
|
|
92
|
+
readonly version: number;
|
|
93
|
+
readonly aggregate: string;
|
|
94
|
+
} | undefined;
|
|
95
|
+
type: "ide.installed";
|
|
96
|
+
}];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * as IdeEvent from "./ide-event.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { Event } from "./event.js";
|
|
4
|
+
export const Installed = Event.define({
|
|
5
|
+
type: "ide.installed",
|
|
6
|
+
schema: {
|
|
7
|
+
ide: Schema.String,
|
|
8
|
+
},
|
|
9
|
+
});
|
|
10
|
+
export const Definitions = Event.inventory(Installed);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const length = 26;
|
|
2
|
+
const chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
|
3
|
+
let lastTimestamp = 0;
|
|
4
|
+
let counter = 0;
|
|
5
|
+
export function ascending() {
|
|
6
|
+
return create(false);
|
|
7
|
+
}
|
|
8
|
+
export function descending() {
|
|
9
|
+
return create(true);
|
|
10
|
+
}
|
|
11
|
+
export function create(descending, timestamp = Date.now()) {
|
|
12
|
+
if (timestamp !== lastTimestamp) {
|
|
13
|
+
lastTimestamp = timestamp;
|
|
14
|
+
counter = 0;
|
|
15
|
+
}
|
|
16
|
+
counter++;
|
|
17
|
+
const current = BigInt(timestamp) * 0x1000n + BigInt(counter);
|
|
18
|
+
const value = descending ? ~current : current;
|
|
19
|
+
const time = Array.from({ length: 6 }, (_, index) => Number((value >> BigInt(40 - 8 * index)) & 0xffn)
|
|
20
|
+
.toString(16)
|
|
21
|
+
.padStart(2, "0")).join("");
|
|
22
|
+
const bytes = crypto.getRandomValues(new Uint8Array(length - 12));
|
|
23
|
+
return time + Array.from(bytes, (byte) => chars[byte % 62]).join("");
|
|
24
|
+
}
|