@opencode-ai/schema 0.0.0-dev-17471
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 +164 -0
- package/dist/agent.js +46 -0
- package/dist/ai.d.ts +4 -0
- package/dist/ai.js +5 -0
- package/dist/catalog.d.ts +69 -0
- package/dist/catalog.js +4 -0
- package/dist/command.d.ts +124 -0
- package/dist/command.js +19 -0
- package/dist/config/agent.d.ts +42 -0
- package/dist/config/agent.js +20 -0
- package/dist/config/command.d.ts +27 -0
- package/dist/config/command.js +12 -0
- package/dist/config/compaction.d.ts +14 -0
- package/dist/config/compaction.js +13 -0
- package/dist/config/experimental.d.ts +17 -0
- package/dist/config/experimental.js +16 -0
- package/dist/config/formatter.d.ts +11 -0
- package/dist/config/formatter.js +11 -0
- package/dist/config/lsp.d.ts +20 -0
- package/dist/config/lsp.js +16 -0
- package/dist/config/mcp.d.ts +18 -0
- package/dist/config/mcp.js +14 -0
- package/dist/config/media.d.ts +15 -0
- package/dist/config/media.js +14 -0
- package/dist/config/model.d.ts +18 -0
- package/dist/config/model.js +28 -0
- package/dist/config/plugin.d.ts +11 -0
- package/dist/config/plugin.js +10 -0
- package/dist/config/policy.d.ts +10 -0
- package/dist/config/policy.js +8 -0
- package/dist/config/provider.d.ts +106 -0
- package/dist/config/provider.js +62 -0
- package/dist/config/reference.d.ts +21 -0
- package/dist/config/reference.js +18 -0
- package/dist/config/tool-output.d.ts +8 -0
- package/dist/config/tool-output.js +8 -0
- package/dist/config/warming.d.ts +10 -0
- package/dist/config/warming.js +16 -0
- package/dist/config/watcher.d.ts +7 -0
- package/dist/config/watcher.js +7 -0
- package/dist/config/websearch.d.ts +9 -0
- package/dist/config/websearch.js +8 -0
- package/dist/config.d.ts +175 -0
- package/dist/config.js +136 -0
- package/dist/connection.d.ts +28 -0
- package/dist/connection.js +15 -0
- package/dist/credential.d.ts +38 -0
- package/dist/credential.js +25 -0
- package/dist/durable-event-manifest.d.ts +3 -0
- package/dist/durable-event-manifest.js +5 -0
- package/dist/event-log.d.ts +14 -0
- package/dist/event-log.js +17 -0
- package/dist/event-manifest.d.ts +11372 -0
- package/dist/event-manifest.js +45 -0
- package/dist/event.d.ts +142 -0
- package/dist/event.js +110 -0
- package/dist/file-diff.d.ts +21 -0
- package/dist/file-diff.js +18 -0
- package/dist/filesystem-v1.d.ts +1 -0
- package/dist/filesystem-v1.js +1 -0
- package/dist/filesystem.d.ts +118 -0
- package/dist/filesystem.js +35 -0
- package/dist/form.d.ts +1259 -0
- package/dist/form.js +120 -0
- package/dist/ide-event.d.ts +76 -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 +39 -0
- package/dist/index.js +39 -0
- package/dist/installation-event.d.ts +149 -0
- package/dist/installation-event.js +16 -0
- package/dist/instruction-entry.d.ts +23 -0
- package/dist/instruction-entry.js +22 -0
- package/dist/instruction.d.ts +13 -0
- package/dist/instruction.js +8 -0
- package/dist/integration-id.d.ts +5 -0
- package/dist/integration-id.js +3 -0
- package/dist/integration.d.ts +1675 -0
- package/dist/integration.js +87 -0
- package/dist/legacy-event.d.ts +1 -0
- package/dist/legacy-event.js +1 -0
- package/dist/llm.d.ts +4 -0
- package/dist/llm.js +3 -0
- package/dist/location.d.ts +37 -0
- package/dist/location.js +22 -0
- package/dist/lsp-event.d.ts +67 -0
- package/dist/lsp-event.js +4 -0
- package/dist/mcp-event.d.ts +222 -0
- package/dist/mcp-event.js +24 -0
- package/dist/mcp.d.ts +138 -0
- package/dist/mcp.js +111 -0
- package/dist/model.d.ts +186 -0
- package/dist/model.js +104 -0
- package/dist/models-dev.d.ts +69 -0
- package/dist/models-dev.js +7 -0
- package/dist/money.d.ts +10 -0
- package/dist/money.js +5 -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 +306 -0
- package/dist/permission.js +45 -0
- package/dist/plugin.d.ts +150 -0
- package/dist/plugin.js +16 -0
- package/dist/project-id.d.ts +5 -0
- package/dist/project-id.js +3 -0
- package/dist/project.d.ts +241 -0
- package/dist/project.js +37 -0
- package/dist/prompt-input.d.ts +143 -0
- package/dist/prompt-input.js +25 -0
- package/dist/prompt.d.ts +297 -0
- package/dist/prompt.js +61 -0
- package/dist/provider.d.ts +60 -0
- package/dist/provider.js +42 -0
- package/dist/pty-ticket.d.ts +8 -0
- package/dist/pty-ticket.js +7 -0
- package/dist/pty.d.ts +462 -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 +15 -0
- package/dist/question.js +15 -0
- package/dist/reference.d.ts +120 -0
- package/dist/reference.js +30 -0
- package/dist/schema.d.ts +10 -0
- package/dist/schema.js +14 -0
- package/dist/server-event.d.ts +132 -0
- package/dist/server-event.js +5 -0
- package/dist/session-compaction-event.d.ts +87 -0
- package/dist/session-compaction-event.js +10 -0
- package/dist/session-error.d.ts +9 -0
- package/dist/session-error.js +8 -0
- package/dist/session-event.d.ts +17994 -0
- package/dist/session-event.js +499 -0
- package/dist/session-fork.d.ts +26 -0
- package/dist/session-fork.js +11 -0
- package/dist/session-id.d.ts +6 -0
- package/dist/session-id.js +10 -0
- package/dist/session-inbox.d.ts +748 -0
- package/dist/session-inbox.js +47 -0
- package/dist/session-message.d.ts +1512 -0
- package/dist/session-message.js +209 -0
- package/dist/session-revert.d.ts +480 -0
- package/dist/session-revert.js +63 -0
- package/dist/session-status-event.d.ts +299 -0
- package/dist/session-status-event.js +43 -0
- package/dist/session-transfer.d.ts +744 -0
- package/dist/session-transfer.js +8 -0
- package/dist/session-v1.d.ts +1 -0
- package/dist/session-v1.js +1 -0
- package/dist/session.d.ts +218 -0
- package/dist/session.js +45 -0
- package/dist/shell.d.ts +381 -0
- package/dist/shell.js +58 -0
- package/dist/skill.d.ts +133 -0
- package/dist/skill.js +48 -0
- package/dist/snapshot.d.ts +4 -0
- package/dist/snapshot.js +3 -0
- package/dist/token-usage.d.ts +13 -0
- package/dist/token-usage.js +11 -0
- package/dist/tool.d.ts +74 -0
- package/dist/tool.js +22 -0
- package/dist/tui-event.d.ts +307 -0
- package/dist/tui-event.js +53 -0
- package/dist/v1/filesystem.d.ts +78 -0
- package/dist/v1/filesystem.js +8 -0
- package/dist/v1/legacy-event.d.ts +108 -0
- package/dist/v1/legacy-event.js +15 -0
- package/dist/v1/permission.d.ts +316 -0
- package/dist/v1/permission.js +41 -0
- package/dist/v1/question.d.ts +444 -0
- package/dist/v1/question.js +57 -0
- package/dist/v1/session.d.ts +7657 -0
- package/dist/v1/session.js +535 -0
- package/dist/vcs-event.d.ts +76 -0
- package/dist/vcs-event.js +11 -0
- package/dist/vcs.d.ts +26 -0
- package/dist/vcs.js +17 -0
- package/dist/websearch.d.ts +108 -0
- package/dist/websearch.js +31 -0
- package/dist/workspace-event.d.ts +247 -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 +153 -0
- package/dist/worktree-event.js +18 -0
- package/dist/worktree.d.ts +255 -0
- package/dist/worktree.js +61 -0
- package/package.json +42 -0
package/dist/form.js
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
export * as Form from "./form.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { ephemeral, inventory } from "./event.js";
|
|
4
|
+
import { ascending } from "./identifier.js";
|
|
5
|
+
import { NonNegativeInt, optional, statics } from "./schema.js";
|
|
6
|
+
const IDSchema = Schema.String.check(Schema.isStartsWith("frm_")).pipe(Schema.brand("Form.ID"));
|
|
7
|
+
export const ID = IDSchema.pipe(statics((schema) => ({ create: (id) => schema.make(id ?? "frm_" + ascending()) })));
|
|
8
|
+
export const Metadata = Schema.Record(Schema.String, Schema.Unknown).annotate({ identifier: "Form.Metadata" });
|
|
9
|
+
export const Option = Schema.Struct({
|
|
10
|
+
value: Schema.String,
|
|
11
|
+
label: Schema.String,
|
|
12
|
+
description: Schema.String.pipe(optional),
|
|
13
|
+
}).annotate({ identifier: "Form.Option" });
|
|
14
|
+
// One visibility condition on a field. A field's `when` is a list of conditions that must all
|
|
15
|
+
// hold (AND) against the current answers for the field to be active. Semantics:
|
|
16
|
+
// - `value` must match the referenced field's type; against a multiselect answer, `eq` means
|
|
17
|
+
// "selection includes value" and `neq` means "selection does not include value".
|
|
18
|
+
// - An unanswered referenced field makes the condition false for both ops.
|
|
19
|
+
// - `key` must reference a field defined earlier in the form's field list.
|
|
20
|
+
// Inactive fields are neither required nor answerable.
|
|
21
|
+
export const When = Schema.Struct({
|
|
22
|
+
key: Schema.String,
|
|
23
|
+
op: Schema.Literals(["eq", "neq"]),
|
|
24
|
+
value: Schema.Union([Schema.String, Schema.Number, Schema.Boolean]),
|
|
25
|
+
}).annotate({ identifier: "Form.When" });
|
|
26
|
+
const FieldBase = {
|
|
27
|
+
key: Schema.String,
|
|
28
|
+
title: Schema.String.pipe(optional),
|
|
29
|
+
description: Schema.String.pipe(optional),
|
|
30
|
+
required: Schema.Boolean.pipe(optional),
|
|
31
|
+
when: Schema.Array(When).pipe(optional),
|
|
32
|
+
};
|
|
33
|
+
export const StringField = Schema.Struct({
|
|
34
|
+
...FieldBase,
|
|
35
|
+
type: Schema.Literal("string"),
|
|
36
|
+
format: Schema.Literals(["email", "uri", "date", "date-time"]).pipe(optional),
|
|
37
|
+
minLength: NonNegativeInt.pipe(optional),
|
|
38
|
+
maxLength: NonNegativeInt.pipe(optional),
|
|
39
|
+
pattern: Schema.String.pipe(optional),
|
|
40
|
+
placeholder: Schema.String.pipe(optional),
|
|
41
|
+
default: Schema.String.pipe(optional),
|
|
42
|
+
options: Schema.Array(Option).pipe(optional),
|
|
43
|
+
custom: Schema.Boolean.pipe(optional),
|
|
44
|
+
}).annotate({ identifier: "Form.StringField" });
|
|
45
|
+
export const NumberField = Schema.Struct({
|
|
46
|
+
...FieldBase,
|
|
47
|
+
type: Schema.Literal("number"),
|
|
48
|
+
minimum: Schema.Number.pipe(optional),
|
|
49
|
+
maximum: Schema.Number.pipe(optional),
|
|
50
|
+
default: Schema.Number.pipe(optional),
|
|
51
|
+
}).annotate({ identifier: "Form.NumberField" });
|
|
52
|
+
export const IntegerField = Schema.Struct({
|
|
53
|
+
...FieldBase,
|
|
54
|
+
type: Schema.Literal("integer"),
|
|
55
|
+
minimum: Schema.Number.pipe(optional),
|
|
56
|
+
maximum: Schema.Number.pipe(optional),
|
|
57
|
+
default: Schema.Number.pipe(optional),
|
|
58
|
+
}).annotate({ identifier: "Form.IntegerField" });
|
|
59
|
+
export const BooleanField = Schema.Struct({
|
|
60
|
+
...FieldBase,
|
|
61
|
+
type: Schema.Literal("boolean"),
|
|
62
|
+
default: Schema.Boolean.pipe(optional),
|
|
63
|
+
}).annotate({ identifier: "Form.BooleanField" });
|
|
64
|
+
export const MultiselectField = Schema.Struct({
|
|
65
|
+
...FieldBase,
|
|
66
|
+
type: Schema.Literal("multiselect"),
|
|
67
|
+
options: Schema.Array(Option),
|
|
68
|
+
minItems: NonNegativeInt.pipe(optional),
|
|
69
|
+
maxItems: NonNegativeInt.pipe(optional),
|
|
70
|
+
custom: Schema.Boolean.pipe(optional),
|
|
71
|
+
default: Schema.Array(Schema.String).pipe(optional),
|
|
72
|
+
}).annotate({ identifier: "Form.MultiselectField" });
|
|
73
|
+
export const ExternalField = Schema.Struct({
|
|
74
|
+
key: Schema.String,
|
|
75
|
+
type: Schema.Literal("external"),
|
|
76
|
+
url: Schema.String,
|
|
77
|
+
title: Schema.String.pipe(optional),
|
|
78
|
+
description: Schema.String.pipe(optional),
|
|
79
|
+
}).annotate({ identifier: "Form.ExternalField" });
|
|
80
|
+
export const Field = Schema.Union([
|
|
81
|
+
StringField,
|
|
82
|
+
NumberField,
|
|
83
|
+
IntegerField,
|
|
84
|
+
BooleanField,
|
|
85
|
+
MultiselectField,
|
|
86
|
+
ExternalField,
|
|
87
|
+
]).pipe(Schema.toTaggedUnion("type"), Schema.annotate({ identifier: "Form.Field" }));
|
|
88
|
+
export const Fields = Schema.NonEmptyArray(Field).annotate({ identifier: "Form.Fields" });
|
|
89
|
+
const InfoBase = {
|
|
90
|
+
id: ID,
|
|
91
|
+
// This should be typed as SessionID. It is a plain string only because MCP elicitation
|
|
92
|
+
// temporarily needs the `"global"` sentinel owner, which is not a real session. Once
|
|
93
|
+
// elicitations can be attributed to real sessions, revert this to SessionID. Do not rely
|
|
94
|
+
// on non-session owners anywhere else.
|
|
95
|
+
sessionID: Schema.String,
|
|
96
|
+
title: Schema.String,
|
|
97
|
+
metadata: Metadata.pipe(optional),
|
|
98
|
+
};
|
|
99
|
+
export const Info = Schema.Struct({
|
|
100
|
+
...InfoBase,
|
|
101
|
+
fields: Fields,
|
|
102
|
+
}).annotate({ identifier: "Form.Info" });
|
|
103
|
+
export const Value = Schema.Union([Schema.String, Schema.Number, Schema.Boolean, Schema.Array(Schema.String)]).annotate({
|
|
104
|
+
identifier: "Form.Value",
|
|
105
|
+
});
|
|
106
|
+
export const Answer = Schema.Record(Schema.String, Value).annotate({ identifier: "Form.Answer" });
|
|
107
|
+
export const State = Schema.Union([
|
|
108
|
+
Schema.Struct({ status: Schema.Literal("pending") }),
|
|
109
|
+
Schema.Struct({ status: Schema.Literal("answered"), answer: Answer }),
|
|
110
|
+
Schema.Struct({ status: Schema.Literal("cancelled") }),
|
|
111
|
+
])
|
|
112
|
+
.pipe(Schema.toTaggedUnion("status"))
|
|
113
|
+
.annotate({ identifier: "Form.State" });
|
|
114
|
+
export const Reply = Schema.Struct({
|
|
115
|
+
answer: Answer,
|
|
116
|
+
}).annotate({ identifier: "Form.Reply" });
|
|
117
|
+
const Created = ephemeral({ type: "form.created", schema: { form: Info } });
|
|
118
|
+
const Replied = ephemeral({ type: "form.replied", schema: { id: ID, sessionID: Schema.String, answer: Answer } });
|
|
119
|
+
const Cancelled = ephemeral({ type: "form.cancelled", schema: { id: ID, sessionID: Schema.String } });
|
|
120
|
+
export const Event = { Created, Replied, Cancelled, Definitions: inventory(Created, Replied, Cancelled) };
|
|
@@ -0,0 +1,76 @@
|
|
|
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 created: Schema.Finite;
|
|
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<"ide.installed">;
|
|
10
|
+
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
11
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
12
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
13
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
14
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
15
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
16
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
17
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
18
|
+
}>, never, never>;
|
|
19
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
20
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
21
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
22
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
23
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
24
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
25
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
26
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
27
|
+
}>, never, never>;
|
|
28
|
+
}>>, never, never>;
|
|
29
|
+
readonly data: Schema.Struct<{
|
|
30
|
+
readonly ide: Schema.String;
|
|
31
|
+
}>;
|
|
32
|
+
}> & {
|
|
33
|
+
type: "ide.installed";
|
|
34
|
+
durability: "ephemeral";
|
|
35
|
+
durable: undefined;
|
|
36
|
+
data: Schema.Struct<{
|
|
37
|
+
readonly ide: Schema.String;
|
|
38
|
+
}>;
|
|
39
|
+
};
|
|
40
|
+
export declare const Definitions: readonly [Schema.Struct<{
|
|
41
|
+
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
42
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
43
|
+
};
|
|
44
|
+
readonly created: Schema.Finite;
|
|
45
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
46
|
+
readonly type: Schema.Literal<"ide.installed">;
|
|
47
|
+
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
48
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
49
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
50
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
51
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
52
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
53
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
54
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
55
|
+
}>, never, never>;
|
|
56
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
57
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
58
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
59
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
60
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
61
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
62
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
63
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
64
|
+
}>, never, never>;
|
|
65
|
+
}>>, never, never>;
|
|
66
|
+
readonly data: Schema.Struct<{
|
|
67
|
+
readonly ide: Schema.String;
|
|
68
|
+
}>;
|
|
69
|
+
}> & {
|
|
70
|
+
type: "ide.installed";
|
|
71
|
+
durability: "ephemeral";
|
|
72
|
+
durable: undefined;
|
|
73
|
+
data: Schema.Struct<{
|
|
74
|
+
readonly ide: Schema.String;
|
|
75
|
+
}>;
|
|
76
|
+
}];
|
|
@@ -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.ephemeral({
|
|
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
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export { Agent } from "./agent.js";
|
|
2
|
+
export { Command } from "./command.js";
|
|
3
|
+
export { Config } from "./config.js";
|
|
4
|
+
export { Connection } from "./connection.js";
|
|
5
|
+
export { Credential } from "./credential.js";
|
|
6
|
+
export { Event } from "./event.js";
|
|
7
|
+
export { FileSystem } from "./filesystem.js";
|
|
8
|
+
export { Form } from "./form.js";
|
|
9
|
+
export { Integration } from "./integration.js";
|
|
10
|
+
export { LLM } from "./llm.js";
|
|
11
|
+
export { AI } from "./ai.js";
|
|
12
|
+
export { Location } from "./location.js";
|
|
13
|
+
export { Mcp } from "./mcp.js";
|
|
14
|
+
export { Model } from "./model.js";
|
|
15
|
+
export { Money } from "./money.js";
|
|
16
|
+
export { Permission } from "./permission.js";
|
|
17
|
+
export { PermissionSaved } from "./permission-saved.js";
|
|
18
|
+
export { Project } from "./project.js";
|
|
19
|
+
export { Worktree } from "./worktree.js";
|
|
20
|
+
export { Provider } from "./provider.js";
|
|
21
|
+
export { Reference } from "./reference.js";
|
|
22
|
+
export { WebSearch } from "./websearch.js";
|
|
23
|
+
export { Session } from "./session.js";
|
|
24
|
+
export { Vcs } from "./vcs.js";
|
|
25
|
+
export { SessionInbox } from "./session-inbox.js";
|
|
26
|
+
export { SessionError } from "./session-error.js";
|
|
27
|
+
export { SessionMessage } from "./session-message.js";
|
|
28
|
+
export { SessionTransfer } from "./session-transfer.js";
|
|
29
|
+
export { Snapshot } from "./snapshot.js";
|
|
30
|
+
export { Shell } from "./shell.js";
|
|
31
|
+
export { Skill } from "./skill.js";
|
|
32
|
+
export { TokenUsage } from "./token-usage.js";
|
|
33
|
+
export { Pty } from "./pty.js";
|
|
34
|
+
export { PtyTicket } from "./pty-ticket.js";
|
|
35
|
+
export { Question } from "./question.js";
|
|
36
|
+
export { Workspace } from "./workspace.js";
|
|
37
|
+
export { Prompt, PromptMention, FileSource, FileAttachment, AgentAttachment } from "./prompt.js";
|
|
38
|
+
export { PromptInput } from "./prompt-input.js";
|
|
39
|
+
export * from "./schema.js";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export { Agent } from "./agent.js";
|
|
2
|
+
export { Command } from "./command.js";
|
|
3
|
+
export { Config } from "./config.js";
|
|
4
|
+
export { Connection } from "./connection.js";
|
|
5
|
+
export { Credential } from "./credential.js";
|
|
6
|
+
export { Event } from "./event.js";
|
|
7
|
+
export { FileSystem } from "./filesystem.js";
|
|
8
|
+
export { Form } from "./form.js";
|
|
9
|
+
export { Integration } from "./integration.js";
|
|
10
|
+
export { LLM } from "./llm.js";
|
|
11
|
+
export { AI } from "./ai.js";
|
|
12
|
+
export { Location } from "./location.js";
|
|
13
|
+
export { Mcp } from "./mcp.js";
|
|
14
|
+
export { Model } from "./model.js";
|
|
15
|
+
export { Money } from "./money.js";
|
|
16
|
+
export { Permission } from "./permission.js";
|
|
17
|
+
export { PermissionSaved } from "./permission-saved.js";
|
|
18
|
+
export { Project } from "./project.js";
|
|
19
|
+
export { Worktree } from "./worktree.js";
|
|
20
|
+
export { Provider } from "./provider.js";
|
|
21
|
+
export { Reference } from "./reference.js";
|
|
22
|
+
export { WebSearch } from "./websearch.js";
|
|
23
|
+
export { Session } from "./session.js";
|
|
24
|
+
export { Vcs } from "./vcs.js";
|
|
25
|
+
export { SessionInbox } from "./session-inbox.js";
|
|
26
|
+
export { SessionError } from "./session-error.js";
|
|
27
|
+
export { SessionMessage } from "./session-message.js";
|
|
28
|
+
export { SessionTransfer } from "./session-transfer.js";
|
|
29
|
+
export { Snapshot } from "./snapshot.js";
|
|
30
|
+
export { Shell } from "./shell.js";
|
|
31
|
+
export { Skill } from "./skill.js";
|
|
32
|
+
export { TokenUsage } from "./token-usage.js";
|
|
33
|
+
export { Pty } from "./pty.js";
|
|
34
|
+
export { PtyTicket } from "./pty-ticket.js";
|
|
35
|
+
export { Question } from "./question.js";
|
|
36
|
+
export { Workspace } from "./workspace.js";
|
|
37
|
+
export { Prompt, PromptMention, FileSource, FileAttachment, AgentAttachment } from "./prompt.js";
|
|
38
|
+
export { PromptInput } from "./prompt-input.js";
|
|
39
|
+
export * from "./schema.js";
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
export * as InstallationEvent from "./installation-event.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
export declare const Updated: Schema.Struct<{
|
|
4
|
+
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
5
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
6
|
+
};
|
|
7
|
+
readonly created: Schema.Finite;
|
|
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<"installation.updated">;
|
|
10
|
+
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
11
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
12
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
13
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
14
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
15
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
16
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
17
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
18
|
+
}>, never, never>;
|
|
19
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
20
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
21
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
22
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
23
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
24
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
25
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
26
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
27
|
+
}>, never, never>;
|
|
28
|
+
}>>, never, never>;
|
|
29
|
+
readonly data: Schema.Struct<{
|
|
30
|
+
readonly version: Schema.String;
|
|
31
|
+
}>;
|
|
32
|
+
}> & {
|
|
33
|
+
type: "installation.updated";
|
|
34
|
+
durability: "ephemeral";
|
|
35
|
+
durable: undefined;
|
|
36
|
+
data: Schema.Struct<{
|
|
37
|
+
readonly version: Schema.String;
|
|
38
|
+
}>;
|
|
39
|
+
};
|
|
40
|
+
export declare const UpdateAvailable: Schema.Struct<{
|
|
41
|
+
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
42
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
43
|
+
};
|
|
44
|
+
readonly created: Schema.Finite;
|
|
45
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
46
|
+
readonly type: Schema.Literal<"installation.update-available">;
|
|
47
|
+
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
48
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
49
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
50
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
51
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
52
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
53
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
54
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
55
|
+
}>, never, never>;
|
|
56
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
57
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
58
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
59
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
60
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
61
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
62
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
63
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
64
|
+
}>, never, never>;
|
|
65
|
+
}>>, never, never>;
|
|
66
|
+
readonly data: Schema.Struct<{
|
|
67
|
+
readonly version: Schema.String;
|
|
68
|
+
}>;
|
|
69
|
+
}> & {
|
|
70
|
+
type: "installation.update-available";
|
|
71
|
+
durability: "ephemeral";
|
|
72
|
+
durable: undefined;
|
|
73
|
+
data: Schema.Struct<{
|
|
74
|
+
readonly version: Schema.String;
|
|
75
|
+
}>;
|
|
76
|
+
};
|
|
77
|
+
export declare const Definitions: readonly [Schema.Struct<{
|
|
78
|
+
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
79
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
80
|
+
};
|
|
81
|
+
readonly created: Schema.Finite;
|
|
82
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
83
|
+
readonly type: Schema.Literal<"installation.updated">;
|
|
84
|
+
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
85
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
86
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
87
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
88
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
89
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
90
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
91
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
92
|
+
}>, never, never>;
|
|
93
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
94
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
95
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
96
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
97
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
98
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
99
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
100
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
101
|
+
}>, never, never>;
|
|
102
|
+
}>>, never, never>;
|
|
103
|
+
readonly data: Schema.Struct<{
|
|
104
|
+
readonly version: Schema.String;
|
|
105
|
+
}>;
|
|
106
|
+
}> & {
|
|
107
|
+
type: "installation.updated";
|
|
108
|
+
durability: "ephemeral";
|
|
109
|
+
durable: undefined;
|
|
110
|
+
data: Schema.Struct<{
|
|
111
|
+
readonly version: Schema.String;
|
|
112
|
+
}>;
|
|
113
|
+
}, Schema.Struct<{
|
|
114
|
+
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
115
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
116
|
+
};
|
|
117
|
+
readonly created: Schema.Finite;
|
|
118
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
119
|
+
readonly type: Schema.Literal<"installation.update-available">;
|
|
120
|
+
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
121
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
122
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
123
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
124
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
125
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
126
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
127
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
128
|
+
}>, never, never>;
|
|
129
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
130
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
131
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
132
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
133
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
134
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
135
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
136
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
137
|
+
}>, never, never>;
|
|
138
|
+
}>>, never, never>;
|
|
139
|
+
readonly data: Schema.Struct<{
|
|
140
|
+
readonly version: Schema.String;
|
|
141
|
+
}>;
|
|
142
|
+
}> & {
|
|
143
|
+
type: "installation.update-available";
|
|
144
|
+
durability: "ephemeral";
|
|
145
|
+
durable: undefined;
|
|
146
|
+
data: Schema.Struct<{
|
|
147
|
+
readonly version: Schema.String;
|
|
148
|
+
}>;
|
|
149
|
+
}];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * as InstallationEvent from "./installation-event.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { Event } from "./event.js";
|
|
4
|
+
export const Updated = Event.ephemeral({
|
|
5
|
+
type: "installation.updated",
|
|
6
|
+
schema: {
|
|
7
|
+
version: Schema.String,
|
|
8
|
+
},
|
|
9
|
+
});
|
|
10
|
+
export const UpdateAvailable = Event.ephemeral({
|
|
11
|
+
type: "installation.update-available",
|
|
12
|
+
schema: {
|
|
13
|
+
version: Schema.String,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
export const Definitions = Event.inventory(Updated, UpdateAvailable);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export * as InstructionEntry from "./instruction-entry.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
/**
|
|
4
|
+
* Slash-free client-facing key for one API-managed instruction entry. The server
|
|
5
|
+
* derives the namespaced Instructions key as `api/<key>`, keeping the
|
|
6
|
+
* `api/*` namespace enforced by construction.
|
|
7
|
+
*/
|
|
8
|
+
export declare const Key: Schema.String;
|
|
9
|
+
export type Key = typeof Key.Type;
|
|
10
|
+
export declare const Info: Schema.Struct<{
|
|
11
|
+
readonly key: Schema.String;
|
|
12
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
13
|
+
}>;
|
|
14
|
+
export interface Info extends Schema.Schema.Type<typeof Info> {
|
|
15
|
+
}
|
|
16
|
+
export declare const MaxValueBytes: number;
|
|
17
|
+
declare const ValueTooLargeError_base: Schema.Class<ValueTooLargeError, Schema.TaggedStruct<"InstructionEntryValueTooLargeError", {
|
|
18
|
+
readonly actualBytes: Schema.Int;
|
|
19
|
+
readonly maxBytes: Schema.Int;
|
|
20
|
+
readonly message: Schema.String;
|
|
21
|
+
}>, import("effect/Cause").YieldableError>;
|
|
22
|
+
export declare class ValueTooLargeError extends ValueTooLargeError_base {
|
|
23
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export * as InstructionEntry from "./instruction-entry.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
/**
|
|
4
|
+
* Slash-free client-facing key for one API-managed instruction entry. The server
|
|
5
|
+
* derives the namespaced Instructions key as `api/<key>`, keeping the
|
|
6
|
+
* `api/*` namespace enforced by construction.
|
|
7
|
+
*/
|
|
8
|
+
export const Key = Schema.String.check(Schema.isPattern(/^[a-z0-9][a-z0-9._-]*$/)).annotate({
|
|
9
|
+
identifier: "InstructionEntry.Key",
|
|
10
|
+
description: "Instruction entry key (lowercase alphanumerics plus . _ -)",
|
|
11
|
+
});
|
|
12
|
+
export const Info = Schema.Struct({
|
|
13
|
+
key: Key,
|
|
14
|
+
value: Schema.Json.annotate({ description: "JSON value attached to the session's instructions" }),
|
|
15
|
+
}).annotate({ identifier: "InstructionEntry.Info" });
|
|
16
|
+
export const MaxValueBytes = 8 * 1024;
|
|
17
|
+
export class ValueTooLargeError extends Schema.TaggedErrorClass()("InstructionEntryValueTooLargeError", {
|
|
18
|
+
actualBytes: Schema.Int,
|
|
19
|
+
maxBytes: Schema.Int,
|
|
20
|
+
message: Schema.String,
|
|
21
|
+
}, { httpApiStatus: 413 }) {
|
|
22
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * as Instruction from "./instruction.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
export declare const Key: Schema.brand<Schema.String, "Instruction.Key">;
|
|
4
|
+
export type Key = typeof Key.Type;
|
|
5
|
+
export declare const Hash: Schema.brand<Schema.String, "Instruction.Hash">;
|
|
6
|
+
export type Hash = typeof Hash.Type;
|
|
7
|
+
export declare const Values: Schema.$Record<Schema.brand<Schema.String, "Instruction.Key">, Schema.brand<Schema.String, "Instruction.Hash">>;
|
|
8
|
+
export type Values = Readonly<Record<string, Hash>>;
|
|
9
|
+
export declare const Removed: Schema.Literal<"removed">;
|
|
10
|
+
export type Removed = typeof Removed.Type;
|
|
11
|
+
export declare const removed: "removed";
|
|
12
|
+
export declare const Delta: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.brand<Schema.String, "Instruction.Hash">, Schema.Literal<"removed">]>>;
|
|
13
|
+
export type Delta = typeof Delta.Type;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * as Instruction from "./instruction.js";
|
|
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._/-]*$/)).pipe(Schema.brand("Instruction.Key"));
|
|
4
|
+
export const Hash = Schema.String.check(Schema.isPattern(/^[a-f0-9]{64}$/)).pipe(Schema.brand("Instruction.Hash"));
|
|
5
|
+
export const Values = Schema.Record(Key, Hash);
|
|
6
|
+
export const Removed = Schema.Literal("removed");
|
|
7
|
+
export const removed = Removed.make("removed");
|
|
8
|
+
export const Delta = Schema.Record(Schema.String, Schema.Union([Hash, Removed]));
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const IntegrationID: Schema.brand<Schema.String, "Integration.ID">;
|
|
3
|
+
export type IntegrationID = typeof IntegrationID.Type;
|
|
4
|
+
export declare const IntegrationMethodID: Schema.brand<Schema.String, "Integration.MethodID">;
|
|
5
|
+
export type IntegrationMethodID = typeof IntegrationMethodID.Type;
|