@kilocode/schema 0.0.0-stage → 0.0.0-v2-9
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 +179 -0
- package/dist/agent.js +45 -0
- package/dist/command.d.ts +76 -0
- package/dist/command.js +13 -0
- package/dist/config/agent.d.ts +42 -0
- package/dist/config/agent.js +21 -0
- package/dist/config/command.d.ts +28 -0
- package/dist/config/command.js +13 -0
- package/dist/config/compaction.d.ts +14 -0
- package/dist/config/compaction.js +13 -0
- package/dist/config/experimental.d.ts +20 -0
- package/dist/config/experimental.js +27 -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 +20 -0
- package/dist/config/mcp.js +15 -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 +392 -0
- package/dist/config/provider.js +109 -0
- package/dist/config/reference.d.ts +21 -0
- package/dist/config/reference.js +18 -0
- package/dist/config/shell.d.ts +9 -0
- package/dist/config/shell.js +7 -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 +13 -0
- package/dist/config/worktree.d.ts +7 -0
- package/dist/config/worktree.js +7 -0
- package/dist/config.d.ts +182 -0
- package/dist/config.js +135 -0
- package/dist/connection.d.ts +79 -0
- package/dist/connection.js +25 -0
- package/dist/credential-legacy.d.ts +54 -0
- package/dist/credential-legacy.js +19 -0
- package/dist/credential.d.ts +255 -0
- package/dist/credential.js +56 -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 +12865 -0
- package/dist/event-manifest.js +48 -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 +123 -0
- package/dist/filesystem.js +38 -0
- package/dist/form.d.ts +1438 -0
- package/dist/form.js +128 -0
- package/dist/identifier.d.ts +4 -0
- package/dist/identifier.js +25 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.js +41 -0
- package/dist/installation-event.d.ts +149 -0
- package/dist/installation-event.js +16 -0
- package/dist/instruction-entry.d.ts +29 -0
- package/dist/instruction-entry.js +26 -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 +2410 -0
- package/dist/integration.js +91 -0
- package/dist/kilocode/gateway.d.ts +975 -0
- package/dist/kilocode/gateway.js +328 -0
- package/dist/kilocode/handshake.d.ts +36 -0
- package/dist/kilocode/handshake.js +29 -0
- package/dist/kilocode/marketplace.d.ts +593 -0
- package/dist/kilocode/marketplace.js +122 -0
- package/dist/kilocode/provider-usage.d.ts +371 -0
- package/dist/kilocode/provider-usage.js +60 -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-event.d.ts +68 -0
- package/dist/location-event.js +5 -0
- package/dist/location.d.ts +56 -0
- package/dist/location.js +28 -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 +145 -0
- package/dist/mcp.js +120 -0
- package/dist/model-compatibility.d.ts +38 -0
- package/dist/model-compatibility.js +28 -0
- package/dist/model.d.ts +406 -0
- package/dist/model.js +115 -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 +22 -0
- package/dist/permission-saved.js +16 -0
- package/dist/permission-v1.d.ts +1 -0
- package/dist/permission-v1.js +1 -0
- package/dist/permission.d.ts +302 -0
- package/dist/permission.js +46 -0
- package/dist/persistent-pty.d.ts +539 -0
- package/dist/persistent-pty.js +55 -0
- package/dist/plugin.d.ts +132 -0
- package/dist/plugin.js +37 -0
- package/dist/project-id.d.ts +5 -0
- package/dist/project-id.js +3 -0
- package/dist/project.d.ts +270 -0
- package/dist/project.js +47 -0
- package/dist/prompt-input.d.ts +110 -0
- package/dist/prompt-input.js +21 -0
- package/dist/prompt.d.ts +297 -0
- package/dist/prompt.js +61 -0
- package/dist/provider.d.ts +275 -0
- package/dist/provider.js +66 -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.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/rpc.d.ts +111 -0
- package/dist/rpc.js +9 -0
- package/dist/schema.d.ts +11 -0
- package/dist/schema.js +17 -0
- package/dist/server-event.d.ts +132 -0
- package/dist/server-event.js +5 -0
- package/dist/session-error.d.ts +16 -0
- package/dist/session-error.js +11 -0
- package/dist/session-event.d.ts +21417 -0
- package/dist/session-event.js +565 -0
- package/dist/session-fork.d.ts +16 -0
- package/dist/session-fork.js +7 -0
- package/dist/session-id.d.ts +5 -0
- package/dist/session-id.js +6 -0
- package/dist/session-inbox.d.ts +756 -0
- package/dist/session-inbox.js +47 -0
- package/dist/session-legacy.d.ts +7 -0
- package/dist/session-legacy.js +118 -0
- package/dist/session-message.d.ts +2049 -0
- package/dist/session-message.js +234 -0
- package/dist/session-metadata.d.ts +8 -0
- package/dist/session-metadata.js +9 -0
- package/dist/session-revert.d.ts +896 -0
- package/dist/session-revert.js +63 -0
- package/dist/session-stats.d.ts +186 -0
- package/dist/session-stats.js +53 -0
- package/dist/session-status-event.d.ts +291 -0
- package/dist/session-status-event.js +45 -0
- package/dist/session-transfer.d.ts +910 -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 +320 -0
- package/dist/session.js +116 -0
- package/dist/shell.d.ts +386 -0
- package/dist/shell.js +61 -0
- package/dist/skill.d.ts +130 -0
- package/dist/skill.js +47 -0
- package/dist/snapshot.d.ts +4 -0
- package/dist/snapshot.js +3 -0
- package/dist/token-usage.d.ts +14 -0
- package/dist/token-usage.js +14 -0
- package/dist/tool.d.ts +78 -0
- package/dist/tool.js +22 -0
- package/dist/tui-event.d.ts +307 -0
- package/dist/tui-event.js +52 -0
- package/dist/v1/filesystem.d.ts +78 -0
- package/dist/v1/filesystem.js +8 -0
- package/dist/v1/legacy-event.d.ts +104 -0
- package/dist/v1/legacy-event.js +15 -0
- package/dist/v1/permission.d.ts +306 -0
- package/dist/v1/permission.js +41 -0
- package/dist/v1/session.d.ts +6977 -0
- package/dist/v1/session.js +531 -0
- package/dist/vcs-event.d.ts +76 -0
- package/dist/vcs-event.js +11 -0
- package/dist/vcs.d.ts +36 -0
- package/dist/vcs.js +24 -0
- package/dist/websearch.d.ts +108 -0
- package/dist/websearch.js +33 -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 +14 -0
- package/dist/workspace.d.ts +15 -0
- package/dist/workspace.js +14 -0
- package/dist/worktree-event.d.ts +153 -0
- package/dist/worktree-event.js +18 -0
- package/dist/worktree.d.ts +282 -0
- package/dist/worktree.js +83 -0
- package/package.json +42 -4
- package/README.md +0 -3
package/dist/model.js
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
export * as Model from "./model.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { optional, statics } from "./schema.js";
|
|
4
|
+
import { Provider } from "./provider.js";
|
|
5
|
+
import { Compatibility, MaxTokensField, ReasoningField } from "./model-compatibility.js";
|
|
6
|
+
import { Money } from "./money.js";
|
|
7
|
+
import { ephemeral, inventory } from "./event.js";
|
|
8
|
+
export const ID = Schema.String.pipe(Schema.brand("Model.ID"));
|
|
9
|
+
const Updated = ephemeral({ type: "model.updated", schema: {} });
|
|
10
|
+
export const Event = { Updated, Definitions: inventory(Updated) };
|
|
11
|
+
export const VariantID = Schema.String.pipe(Schema.brand("Model.VariantID"));
|
|
12
|
+
export const Ref = Schema.Struct({
|
|
13
|
+
id: ID,
|
|
14
|
+
providerID: Provider.ID,
|
|
15
|
+
variant: VariantID.pipe(optional),
|
|
16
|
+
})
|
|
17
|
+
.annotate({ identifier: "Model.Ref" })
|
|
18
|
+
.pipe(statics((schema) => ({
|
|
19
|
+
parse: (input) => {
|
|
20
|
+
const providerEnd = input.indexOf("/");
|
|
21
|
+
if (providerEnd <= 0)
|
|
22
|
+
throw new Error(`Invalid model reference: ${input}`);
|
|
23
|
+
const providerID = input.slice(0, providerEnd);
|
|
24
|
+
const variantStart = input.indexOf("#", providerEnd + 1);
|
|
25
|
+
const id = input.slice(providerEnd + 1, variantStart === -1 ? undefined : variantStart);
|
|
26
|
+
const variant = variantStart === -1 ? undefined : input.slice(variantStart + 1);
|
|
27
|
+
if (!id || providerID.includes("#") || (variant !== undefined && (!variant || variant.includes("#"))))
|
|
28
|
+
throw new Error(`Invalid model reference: ${input}`);
|
|
29
|
+
return schema.make({
|
|
30
|
+
providerID: Provider.ID.make(providerID),
|
|
31
|
+
id: ID.make(id),
|
|
32
|
+
...(variant ? { variant: VariantID.make(variant) } : {}),
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
})));
|
|
36
|
+
export { Compatibility, MaxTokensField, ReasoningField };
|
|
37
|
+
export const Family = Schema.String.pipe(Schema.brand("Model.Family"));
|
|
38
|
+
export const Settings = Schema.StructWithRest(Schema.Struct({
|
|
39
|
+
compaction: Provider.Compaction.pipe(optional),
|
|
40
|
+
encoding: Provider.Encoding.pipe(optional),
|
|
41
|
+
}),
|
|
42
|
+
// Provider packages may define arbitrary model-level options beyond OpenCode's shared compaction policy.
|
|
43
|
+
[Schema.Record(Schema.String, Schema.Any)]).annotate({ identifier: "Model.Settings" });
|
|
44
|
+
export const Overlays = {
|
|
45
|
+
settings: Settings.pipe(optional),
|
|
46
|
+
headers: Schema.Record(Schema.String, Schema.String).pipe(optional),
|
|
47
|
+
body: Schema.Record(Schema.String, Schema.Any).pipe(optional),
|
|
48
|
+
};
|
|
49
|
+
export const Capabilities = Schema.Struct({
|
|
50
|
+
tools: Schema.Boolean,
|
|
51
|
+
input: Schema.Array(Schema.String),
|
|
52
|
+
output: Schema.Array(Schema.String),
|
|
53
|
+
/** Whether the model accepts a sampling temperature. Unknown when unset. */
|
|
54
|
+
temperature: Schema.Boolean.pipe(optional),
|
|
55
|
+
})
|
|
56
|
+
.annotate({ identifier: "Model.Capabilities" })
|
|
57
|
+
.pipe(statics(() => ({
|
|
58
|
+
default: () => ({ tools: true, input: ["text", "image"], output: ["text"] }),
|
|
59
|
+
})));
|
|
60
|
+
export const Cost = Schema.Struct({
|
|
61
|
+
tier: Schema.Struct({
|
|
62
|
+
type: Schema.tag("context"),
|
|
63
|
+
size: Schema.Int,
|
|
64
|
+
}).pipe(optional),
|
|
65
|
+
input: Money.USDPerMillionTokens,
|
|
66
|
+
output: Money.USDPerMillionTokens,
|
|
67
|
+
cache: Schema.Struct({
|
|
68
|
+
read: Money.USDPerMillionTokens,
|
|
69
|
+
write: Money.USDPerMillionTokens,
|
|
70
|
+
}),
|
|
71
|
+
}).annotate({ identifier: "Model.Cost" });
|
|
72
|
+
export const Variant = Schema.Struct({
|
|
73
|
+
id: VariantID,
|
|
74
|
+
...Overlays,
|
|
75
|
+
}).annotate({ identifier: "Model.Variant" });
|
|
76
|
+
export const Info = Schema.Struct({
|
|
77
|
+
id: ID,
|
|
78
|
+
modelID: ID,
|
|
79
|
+
providerID: Provider.ID,
|
|
80
|
+
canonical: Provider.ID.pipe(optional),
|
|
81
|
+
family: Family.pipe(optional),
|
|
82
|
+
name: Schema.String,
|
|
83
|
+
compatibility: Compatibility.pipe(optional),
|
|
84
|
+
package: Provider.Package.pipe(optional),
|
|
85
|
+
...Overlays,
|
|
86
|
+
capabilities: Capabilities,
|
|
87
|
+
variants: Schema.Array(Variant),
|
|
88
|
+
time: Schema.Struct({
|
|
89
|
+
released: Schema.Finite,
|
|
90
|
+
}),
|
|
91
|
+
cost: Schema.Array(Cost),
|
|
92
|
+
status: Schema.Literals(["alpha", "beta", "deprecated", "active"]),
|
|
93
|
+
enabled: Schema.Boolean,
|
|
94
|
+
limit: Schema.Struct({
|
|
95
|
+
context: Schema.Int,
|
|
96
|
+
input: Schema.Int.pipe(optional),
|
|
97
|
+
output: Schema.Int,
|
|
98
|
+
}),
|
|
99
|
+
})
|
|
100
|
+
.annotate({ identifier: "Model.Info" })
|
|
101
|
+
.pipe(statics(() => ({
|
|
102
|
+
default: (providerID, id) => ({
|
|
103
|
+
id,
|
|
104
|
+
modelID: id,
|
|
105
|
+
providerID,
|
|
106
|
+
name: id,
|
|
107
|
+
capabilities: Capabilities.default(),
|
|
108
|
+
variants: [],
|
|
109
|
+
time: { released: 0 },
|
|
110
|
+
cost: [],
|
|
111
|
+
status: "active",
|
|
112
|
+
enabled: true,
|
|
113
|
+
limit: { context: 200_000, output: 32_000 },
|
|
114
|
+
}),
|
|
115
|
+
})));
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export * as ModelsDev from "./models-dev.js";
|
|
2
|
+
export declare const Event: {
|
|
3
|
+
Refreshed: import("effect/Schema").Struct<{
|
|
4
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "Event.ID"> & {
|
|
5
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
6
|
+
};
|
|
7
|
+
readonly created: import("effect/Schema").Finite;
|
|
8
|
+
readonly metadata: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>>, import("effect/Schema").optionalKey<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>, never, never>;
|
|
9
|
+
readonly type: import("effect/Schema").Literal<"models-dev.refreshed">;
|
|
10
|
+
readonly location: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Struct<{
|
|
11
|
+
readonly directory: import("effect/Schema").brand<import("effect/Schema").String, "AbsolutePath">;
|
|
12
|
+
readonly workspaceID: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").brand<import("effect/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
|
+
}>>, import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/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
|
+
}>>>, import("effect/Schema").optionalKey<import("effect/Schema").Struct<{
|
|
20
|
+
readonly directory: import("effect/Schema").brand<import("effect/Schema").String, "AbsolutePath">;
|
|
21
|
+
readonly workspaceID: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").brand<import("effect/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
|
+
}>>, import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/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: import("effect/Schema").Struct<{}>;
|
|
30
|
+
}> & {
|
|
31
|
+
type: "models-dev.refreshed";
|
|
32
|
+
durability: "ephemeral";
|
|
33
|
+
durable: undefined;
|
|
34
|
+
data: import("effect/Schema").Struct<{}>;
|
|
35
|
+
};
|
|
36
|
+
Definitions: readonly [import("effect/Schema").Struct<{
|
|
37
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "Event.ID"> & {
|
|
38
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
39
|
+
};
|
|
40
|
+
readonly created: import("effect/Schema").Finite;
|
|
41
|
+
readonly metadata: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>>, import("effect/Schema").optionalKey<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>, never, never>;
|
|
42
|
+
readonly type: import("effect/Schema").Literal<"models-dev.refreshed">;
|
|
43
|
+
readonly location: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Struct<{
|
|
44
|
+
readonly directory: import("effect/Schema").brand<import("effect/Schema").String, "AbsolutePath">;
|
|
45
|
+
readonly workspaceID: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
|
|
46
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
47
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
48
|
+
}>>, import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
|
|
49
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
50
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
51
|
+
}>, never, never>;
|
|
52
|
+
}>>>, import("effect/Schema").optionalKey<import("effect/Schema").Struct<{
|
|
53
|
+
readonly directory: import("effect/Schema").brand<import("effect/Schema").String, "AbsolutePath">;
|
|
54
|
+
readonly workspaceID: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
|
|
55
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
56
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
57
|
+
}>>, import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
|
|
58
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
59
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
60
|
+
}>, never, never>;
|
|
61
|
+
}>>, never, never>;
|
|
62
|
+
readonly data: import("effect/Schema").Struct<{}>;
|
|
63
|
+
}> & {
|
|
64
|
+
type: "models-dev.refreshed";
|
|
65
|
+
durability: "ephemeral";
|
|
66
|
+
durable: undefined;
|
|
67
|
+
data: import("effect/Schema").Struct<{}>;
|
|
68
|
+
}];
|
|
69
|
+
};
|
package/dist/money.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * as Money from "./money.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
export declare const USD: Schema.brand<Schema.Finite, "Money.USD"> & {
|
|
4
|
+
zero: number & import("effect/Brand").Brand<"Money.USD">;
|
|
5
|
+
};
|
|
6
|
+
export type USD = typeof USD.Type;
|
|
7
|
+
export declare const USDPerMillionTokens: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
|
|
8
|
+
zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
|
|
9
|
+
};
|
|
10
|
+
export type USDPerMillionTokens = typeof USDPerMillionTokens.Type;
|
package/dist/money.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * as Money from "./money.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { statics } from "./schema.js";
|
|
4
|
+
export const USD = Schema.Finite.pipe(Schema.brand("Money.USD"), Schema.annotate({ identifier: "Money.USD" }), statics((schema) => ({ zero: schema.make(0) })));
|
|
5
|
+
export const USDPerMillionTokens = Schema.Finite.pipe(Schema.brand("Money.USDPerMillionTokens"), Schema.annotate({ identifier: "Money.USDPerMillionTokens" }), statics((schema) => ({ zero: schema.make(0) })));
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export * as PermissionSaved from "./permission-saved.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
export declare const ID: Schema.brand<Schema.String, "PermissionSaved.ID"> & {
|
|
4
|
+
create: () => string & import("effect/Brand").Brand<"PermissionSaved.ID">;
|
|
5
|
+
};
|
|
6
|
+
export type ID = typeof ID.Type;
|
|
7
|
+
export declare const Info: Schema.Struct<{
|
|
8
|
+
readonly id: Schema.brand<Schema.String, "PermissionSaved.ID"> & {
|
|
9
|
+
create: () => string & import("effect/Brand").Brand<"PermissionSaved.ID">;
|
|
10
|
+
};
|
|
11
|
+
readonly projectID: Schema.brand<Schema.String, "Project.ID"> & {
|
|
12
|
+
global: string & import("effect/Brand").Brand<"Project.ID">;
|
|
13
|
+
};
|
|
14
|
+
readonly action: Schema.String;
|
|
15
|
+
readonly resource: Schema.String;
|
|
16
|
+
readonly time: Schema.Struct<{
|
|
17
|
+
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
18
|
+
readonly updated: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
19
|
+
}>;
|
|
20
|
+
}>;
|
|
21
|
+
export interface Info extends Schema.Schema.Type<typeof Info> {
|
|
22
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * as PermissionSaved from "./permission-saved.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { ascending } from "./identifier.js";
|
|
4
|
+
import { ProjectID } from "./project-id.js";
|
|
5
|
+
import { DateTimeUtcFromMillis, statics } from "./schema.js";
|
|
6
|
+
export const ID = Schema.String.pipe(Schema.brand("PermissionSaved.ID"), Schema.annotate({ identifier: "PermissionSaved.ID" }), statics((schema) => ({ create: () => schema.make("psv_" + ascending()) })));
|
|
7
|
+
export const Info = Schema.Struct({
|
|
8
|
+
id: ID,
|
|
9
|
+
projectID: ProjectID,
|
|
10
|
+
action: Schema.String,
|
|
11
|
+
resource: Schema.String,
|
|
12
|
+
time: Schema.Struct({
|
|
13
|
+
created: DateTimeUtcFromMillis,
|
|
14
|
+
updated: DateTimeUtcFromMillis,
|
|
15
|
+
}),
|
|
16
|
+
}).annotate({ identifier: "PermissionSaved.Info" });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./v1/permission.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./v1/permission.js";
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
export * as Permission from "./permission.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
export declare const ID: Schema.brand<Schema.String, "Permission.ID"> & {
|
|
4
|
+
create: (id?: string) => string & import("effect/Brand").Brand<"Permission.ID">;
|
|
5
|
+
};
|
|
6
|
+
export type ID = typeof ID.Type;
|
|
7
|
+
export declare const Source: Schema.Union<readonly [Schema.Struct<{
|
|
8
|
+
readonly type: Schema.Literal<"tool">;
|
|
9
|
+
readonly messageID: Schema.String;
|
|
10
|
+
readonly id: Schema.String;
|
|
11
|
+
}>]>;
|
|
12
|
+
export type Source = typeof Source.Type;
|
|
13
|
+
export declare const Request: Schema.Struct<{
|
|
14
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
15
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
16
|
+
};
|
|
17
|
+
readonly action: Schema.String;
|
|
18
|
+
readonly resources: Schema.$Array<Schema.String>;
|
|
19
|
+
readonly save: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.String>>>, Schema.optionalKey<Schema.$Array<Schema.String>>, never, never>;
|
|
20
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
21
|
+
readonly source: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
22
|
+
readonly type: Schema.Literal<"tool">;
|
|
23
|
+
readonly messageID: Schema.String;
|
|
24
|
+
readonly id: Schema.String;
|
|
25
|
+
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
26
|
+
readonly type: Schema.Literal<"tool">;
|
|
27
|
+
readonly messageID: Schema.String;
|
|
28
|
+
readonly id: Schema.String;
|
|
29
|
+
}>]>>, never, never>;
|
|
30
|
+
readonly message: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
31
|
+
readonly id: Schema.brand<Schema.String, "Permission.ID"> & {
|
|
32
|
+
create: (id?: string) => string & import("effect/Brand").Brand<"Permission.ID">;
|
|
33
|
+
};
|
|
34
|
+
}>;
|
|
35
|
+
export interface Request extends Schema.Schema.Type<typeof Request> {
|
|
36
|
+
}
|
|
37
|
+
export declare const Reply: Schema.Literals<readonly ["once", "always", "reject"]>;
|
|
38
|
+
export type Reply = typeof Reply.Type;
|
|
39
|
+
export declare const Event: {
|
|
40
|
+
Asked: 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<"permission.asked">;
|
|
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 sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
68
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
69
|
+
};
|
|
70
|
+
readonly action: Schema.String;
|
|
71
|
+
readonly resources: Schema.$Array<Schema.String>;
|
|
72
|
+
readonly save: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.String>>>, Schema.optionalKey<Schema.$Array<Schema.String>>, never, never>;
|
|
73
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
74
|
+
readonly source: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
75
|
+
readonly type: Schema.Literal<"tool">;
|
|
76
|
+
readonly messageID: Schema.String;
|
|
77
|
+
readonly id: Schema.String;
|
|
78
|
+
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
79
|
+
readonly type: Schema.Literal<"tool">;
|
|
80
|
+
readonly messageID: Schema.String;
|
|
81
|
+
readonly id: Schema.String;
|
|
82
|
+
}>]>>, never, never>;
|
|
83
|
+
readonly message: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
84
|
+
readonly id: Schema.brand<Schema.String, "Permission.ID"> & {
|
|
85
|
+
create: (id?: string) => string & import("effect/Brand").Brand<"Permission.ID">;
|
|
86
|
+
};
|
|
87
|
+
}>;
|
|
88
|
+
}> & {
|
|
89
|
+
type: "permission.asked";
|
|
90
|
+
durability: "ephemeral";
|
|
91
|
+
durable: undefined;
|
|
92
|
+
data: Schema.Struct<{
|
|
93
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
94
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
95
|
+
};
|
|
96
|
+
readonly action: Schema.String;
|
|
97
|
+
readonly resources: Schema.$Array<Schema.String>;
|
|
98
|
+
readonly save: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.String>>>, Schema.optionalKey<Schema.$Array<Schema.String>>, never, never>;
|
|
99
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
100
|
+
readonly source: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
101
|
+
readonly type: Schema.Literal<"tool">;
|
|
102
|
+
readonly messageID: Schema.String;
|
|
103
|
+
readonly id: Schema.String;
|
|
104
|
+
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
105
|
+
readonly type: Schema.Literal<"tool">;
|
|
106
|
+
readonly messageID: Schema.String;
|
|
107
|
+
readonly id: Schema.String;
|
|
108
|
+
}>]>>, never, never>;
|
|
109
|
+
readonly message: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
110
|
+
readonly id: Schema.brand<Schema.String, "Permission.ID"> & {
|
|
111
|
+
create: (id?: string) => string & import("effect/Brand").Brand<"Permission.ID">;
|
|
112
|
+
};
|
|
113
|
+
}>;
|
|
114
|
+
};
|
|
115
|
+
Replied: Schema.Struct<{
|
|
116
|
+
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
117
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
118
|
+
};
|
|
119
|
+
readonly created: Schema.Finite;
|
|
120
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
121
|
+
readonly type: Schema.Literal<"permission.replied">;
|
|
122
|
+
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
123
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
124
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
125
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
126
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
127
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
128
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
129
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
130
|
+
}>, never, never>;
|
|
131
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
132
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
133
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
134
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
135
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
136
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
137
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
138
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
139
|
+
}>, never, never>;
|
|
140
|
+
}>>, never, never>;
|
|
141
|
+
readonly data: Schema.Struct<{
|
|
142
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
143
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
144
|
+
};
|
|
145
|
+
readonly requestID: Schema.brand<Schema.String, "Permission.ID"> & {
|
|
146
|
+
create: (id?: string) => string & import("effect/Brand").Brand<"Permission.ID">;
|
|
147
|
+
};
|
|
148
|
+
readonly reply: Schema.Literals<readonly ["once", "always", "reject"]>;
|
|
149
|
+
}>;
|
|
150
|
+
}> & {
|
|
151
|
+
type: "permission.replied";
|
|
152
|
+
durability: "ephemeral";
|
|
153
|
+
durable: undefined;
|
|
154
|
+
data: Schema.Struct<{
|
|
155
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
156
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
157
|
+
};
|
|
158
|
+
readonly requestID: Schema.brand<Schema.String, "Permission.ID"> & {
|
|
159
|
+
create: (id?: string) => string & import("effect/Brand").Brand<"Permission.ID">;
|
|
160
|
+
};
|
|
161
|
+
readonly reply: Schema.Literals<readonly ["once", "always", "reject"]>;
|
|
162
|
+
}>;
|
|
163
|
+
};
|
|
164
|
+
Definitions: readonly [Schema.Struct<{
|
|
165
|
+
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
166
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
167
|
+
};
|
|
168
|
+
readonly created: Schema.Finite;
|
|
169
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
170
|
+
readonly type: Schema.Literal<"permission.asked">;
|
|
171
|
+
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
172
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
173
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
174
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
175
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
176
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
177
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
178
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
179
|
+
}>, never, never>;
|
|
180
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
181
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
182
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
183
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
184
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
185
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
186
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
187
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
188
|
+
}>, never, never>;
|
|
189
|
+
}>>, never, never>;
|
|
190
|
+
readonly data: Schema.Struct<{
|
|
191
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
192
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
193
|
+
};
|
|
194
|
+
readonly action: Schema.String;
|
|
195
|
+
readonly resources: Schema.$Array<Schema.String>;
|
|
196
|
+
readonly save: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.String>>>, Schema.optionalKey<Schema.$Array<Schema.String>>, never, never>;
|
|
197
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
198
|
+
readonly source: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
199
|
+
readonly type: Schema.Literal<"tool">;
|
|
200
|
+
readonly messageID: Schema.String;
|
|
201
|
+
readonly id: Schema.String;
|
|
202
|
+
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
203
|
+
readonly type: Schema.Literal<"tool">;
|
|
204
|
+
readonly messageID: Schema.String;
|
|
205
|
+
readonly id: Schema.String;
|
|
206
|
+
}>]>>, never, never>;
|
|
207
|
+
readonly message: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
208
|
+
readonly id: Schema.brand<Schema.String, "Permission.ID"> & {
|
|
209
|
+
create: (id?: string) => string & import("effect/Brand").Brand<"Permission.ID">;
|
|
210
|
+
};
|
|
211
|
+
}>;
|
|
212
|
+
}> & {
|
|
213
|
+
type: "permission.asked";
|
|
214
|
+
durability: "ephemeral";
|
|
215
|
+
durable: undefined;
|
|
216
|
+
data: Schema.Struct<{
|
|
217
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
218
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
219
|
+
};
|
|
220
|
+
readonly action: Schema.String;
|
|
221
|
+
readonly resources: Schema.$Array<Schema.String>;
|
|
222
|
+
readonly save: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.String>>>, Schema.optionalKey<Schema.$Array<Schema.String>>, never, never>;
|
|
223
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
224
|
+
readonly source: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
225
|
+
readonly type: Schema.Literal<"tool">;
|
|
226
|
+
readonly messageID: Schema.String;
|
|
227
|
+
readonly id: Schema.String;
|
|
228
|
+
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
229
|
+
readonly type: Schema.Literal<"tool">;
|
|
230
|
+
readonly messageID: Schema.String;
|
|
231
|
+
readonly id: Schema.String;
|
|
232
|
+
}>]>>, never, never>;
|
|
233
|
+
readonly message: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
234
|
+
readonly id: Schema.brand<Schema.String, "Permission.ID"> & {
|
|
235
|
+
create: (id?: string) => string & import("effect/Brand").Brand<"Permission.ID">;
|
|
236
|
+
};
|
|
237
|
+
}>;
|
|
238
|
+
}, Schema.Struct<{
|
|
239
|
+
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
240
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
241
|
+
};
|
|
242
|
+
readonly created: Schema.Finite;
|
|
243
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
244
|
+
readonly type: Schema.Literal<"permission.replied">;
|
|
245
|
+
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
246
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
247
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
248
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
249
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
250
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
251
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
252
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
253
|
+
}>, never, never>;
|
|
254
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
255
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
256
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
257
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
258
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
259
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
260
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
261
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
262
|
+
}>, never, never>;
|
|
263
|
+
}>>, never, never>;
|
|
264
|
+
readonly data: Schema.Struct<{
|
|
265
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
266
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
267
|
+
};
|
|
268
|
+
readonly requestID: Schema.brand<Schema.String, "Permission.ID"> & {
|
|
269
|
+
create: (id?: string) => string & import("effect/Brand").Brand<"Permission.ID">;
|
|
270
|
+
};
|
|
271
|
+
readonly reply: Schema.Literals<readonly ["once", "always", "reject"]>;
|
|
272
|
+
}>;
|
|
273
|
+
}> & {
|
|
274
|
+
type: "permission.replied";
|
|
275
|
+
durability: "ephemeral";
|
|
276
|
+
durable: undefined;
|
|
277
|
+
data: Schema.Struct<{
|
|
278
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
279
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
280
|
+
};
|
|
281
|
+
readonly requestID: Schema.brand<Schema.String, "Permission.ID"> & {
|
|
282
|
+
create: (id?: string) => string & import("effect/Brand").Brand<"Permission.ID">;
|
|
283
|
+
};
|
|
284
|
+
readonly reply: Schema.Literals<readonly ["once", "always", "reject"]>;
|
|
285
|
+
}>;
|
|
286
|
+
}];
|
|
287
|
+
};
|
|
288
|
+
export declare const Effect: Schema.Literals<readonly ["allow", "deny", "ask"]>;
|
|
289
|
+
export type Effect = typeof Effect.Type;
|
|
290
|
+
export interface Rule extends Schema.Schema.Type<typeof Rule> {
|
|
291
|
+
}
|
|
292
|
+
export declare const Rule: Schema.Struct<{
|
|
293
|
+
readonly action: Schema.String;
|
|
294
|
+
readonly resource: Schema.String;
|
|
295
|
+
readonly effect: Schema.Literals<readonly ["allow", "deny", "ask"]>;
|
|
296
|
+
}>;
|
|
297
|
+
export declare const Ruleset: Schema.$Array<Schema.Struct<{
|
|
298
|
+
readonly action: Schema.String;
|
|
299
|
+
readonly resource: Schema.String;
|
|
300
|
+
readonly effect: Schema.Literals<readonly ["allow", "deny", "ask"]>;
|
|
301
|
+
}>>;
|
|
302
|
+
export type Ruleset = typeof Ruleset.Type;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export * as Permission from "./permission.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { optional } from "./schema.js";
|
|
4
|
+
import { ephemeral, inventory } from "./event.js";
|
|
5
|
+
import { ascending } from "./identifier.js";
|
|
6
|
+
import { SessionID } from "./session-id.js";
|
|
7
|
+
import { statics } from "./schema.js";
|
|
8
|
+
export const ID = Schema.String.check(Schema.isStartingWith("per")).pipe(Schema.brand("Permission.ID"), Schema.annotate({ identifier: "Permission.ID" }), statics((schema) => ({ create: (id) => schema.make(id ?? "per_" + ascending()) })));
|
|
9
|
+
export const Source = Schema.Union([
|
|
10
|
+
Schema.Struct({
|
|
11
|
+
type: Schema.Literal("tool"),
|
|
12
|
+
messageID: Schema.String,
|
|
13
|
+
id: Schema.String,
|
|
14
|
+
}),
|
|
15
|
+
]).annotate({ identifier: "Permission.Source" });
|
|
16
|
+
const RequestFields = {
|
|
17
|
+
sessionID: SessionID,
|
|
18
|
+
action: Schema.String,
|
|
19
|
+
resources: Schema.Array(Schema.String),
|
|
20
|
+
save: Schema.Array(Schema.String).pipe(optional),
|
|
21
|
+
metadata: Schema.Record(Schema.String, Schema.Unknown).pipe(optional),
|
|
22
|
+
source: Source.pipe(optional),
|
|
23
|
+
message: Schema.String.pipe(optional),
|
|
24
|
+
};
|
|
25
|
+
export const Request = Schema.Struct({
|
|
26
|
+
id: ID,
|
|
27
|
+
...RequestFields,
|
|
28
|
+
}).annotate({ identifier: "Permission.Request" });
|
|
29
|
+
export const Reply = Schema.Literals(["once", "always", "reject"]).annotate({ identifier: "Permission.Reply" });
|
|
30
|
+
const Asked = ephemeral({ type: "permission.asked", schema: Request.fields });
|
|
31
|
+
const Replied = ephemeral({
|
|
32
|
+
type: "permission.replied",
|
|
33
|
+
schema: {
|
|
34
|
+
sessionID: SessionID,
|
|
35
|
+
requestID: ID,
|
|
36
|
+
reply: Reply,
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
export const Event = { Asked, Replied, Definitions: inventory(Asked, Replied) };
|
|
40
|
+
export const Effect = Schema.Literals(["allow", "deny", "ask"]).annotate({ identifier: "Permission.Effect" });
|
|
41
|
+
export const Rule = Schema.Struct({
|
|
42
|
+
action: Schema.String,
|
|
43
|
+
resource: Schema.String,
|
|
44
|
+
effect: Effect,
|
|
45
|
+
}).annotate({ identifier: "Permission.Rule" });
|
|
46
|
+
export const Ruleset = Schema.Array(Rule).annotate({ identifier: "Permission.Ruleset" });
|