@radheim/protocol 0.0.0-stage → 2.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/dist/api.d.ts +60 -0
  2. package/dist/api.js +81 -0
  3. package/dist/client.d.ts +69 -0
  4. package/dist/client.js +102 -0
  5. package/dist/errors.d.ts +273 -0
  6. package/dist/errors.js +227 -0
  7. package/dist/groups/agent.d.ts +299 -0
  8. package/dist/groups/agent.js +30 -0
  9. package/dist/groups/artifact.d.ts +173 -0
  10. package/dist/groups/artifact.js +80 -0
  11. package/dist/groups/automation.d.ts +480 -0
  12. package/dist/groups/automation.js +55 -0
  13. package/dist/groups/blob.d.ts +415 -0
  14. package/dist/groups/blob.js +79 -0
  15. package/dist/groups/command.d.ts +15 -0
  16. package/dist/groups/command.js +20 -0
  17. package/dist/groups/config.d.ts +27 -0
  18. package/dist/groups/config.js +32 -0
  19. package/dist/groups/credential.d.ts +93 -0
  20. package/dist/groups/credential.js +50 -0
  21. package/dist/groups/debug.d.ts +22 -0
  22. package/dist/groups/debug.js +49 -0
  23. package/dist/groups/event.d.ts +16442 -0
  24. package/dist/groups/event.js +68 -0
  25. package/dist/groups/experimental/browser-tunnel.d.ts +20 -0
  26. package/dist/groups/experimental/browser-tunnel.js +29 -0
  27. package/dist/groups/experimental.d.ts +1519 -0
  28. package/dist/groups/experimental.js +12 -0
  29. package/dist/groups/flag.d.ts +12 -0
  30. package/dist/groups/flag.js +19 -0
  31. package/dist/groups/form.d.ts +138 -0
  32. package/dist/groups/form.js +18 -0
  33. package/dist/groups/fs.d.ts +60 -0
  34. package/dist/groups/fs.js +101 -0
  35. package/dist/groups/generate.d.ts +397 -0
  36. package/dist/groups/generate.js +77 -0
  37. package/dist/groups/integration.d.ts +1724 -0
  38. package/dist/groups/integration.js +169 -0
  39. package/dist/groups/job.d.ts +95 -0
  40. package/dist/groups/job.js +45 -0
  41. package/dist/groups/location.d.ts +23 -0
  42. package/dist/groups/location.js +47 -0
  43. package/dist/groups/machine.d.ts +91 -0
  44. package/dist/groups/machine.js +61 -0
  45. package/dist/groups/mcp.d.ts +104 -0
  46. package/dist/groups/mcp.js +125 -0
  47. package/dist/groups/media.d.ts +8 -0
  48. package/dist/groups/media.js +18 -0
  49. package/dist/groups/message.d.ts +3696 -0
  50. package/dist/groups/message.js +102 -0
  51. package/dist/groups/migration.d.ts +28 -0
  52. package/dist/groups/migration.js +21 -0
  53. package/dist/groups/model.d.ts +536 -0
  54. package/dist/groups/model.js +39 -0
  55. package/dist/groups/permission.d.ts +175 -0
  56. package/dist/groups/permission.js +115 -0
  57. package/dist/groups/persistent-pty.d.ts +251 -0
  58. package/dist/groups/persistent-pty.js +109 -0
  59. package/dist/groups/plugin.d.ts +102 -0
  60. package/dist/groups/plugin.js +59 -0
  61. package/dist/groups/project.d.ts +83 -0
  62. package/dist/groups/project.js +37 -0
  63. package/dist/groups/provider.d.ts +354 -0
  64. package/dist/groups/provider.js +34 -0
  65. package/dist/groups/pty.d.ts +151 -0
  66. package/dist/groups/pty.js +117 -0
  67. package/dist/groups/push.d.ts +123 -0
  68. package/dist/groups/push.js +60 -0
  69. package/dist/groups/reference.d.ts +25 -0
  70. package/dist/groups/reference.js +33 -0
  71. package/dist/groups/rpc.d.ts +21 -0
  72. package/dist/groups/rpc.js +24 -0
  73. package/dist/groups/server.d.ts +46 -0
  74. package/dist/groups/server.js +55 -0
  75. package/dist/groups/session.d.ts +11874 -0
  76. package/dist/groups/session.js +663 -0
  77. package/dist/groups/shell.d.ts +125 -0
  78. package/dist/groups/shell.js +65 -0
  79. package/dist/groups/skill.d.ts +26 -0
  80. package/dist/groups/skill.js +34 -0
  81. package/dist/groups/space.d.ts +56 -0
  82. package/dist/groups/space.js +59 -0
  83. package/dist/groups/usage.d.ts +96 -0
  84. package/dist/groups/usage.js +22 -0
  85. package/dist/groups/vcs.d.ts +89 -0
  86. package/dist/groups/vcs.js +94 -0
  87. package/dist/groups/voice.d.ts +81 -0
  88. package/dist/groups/voice.js +75 -0
  89. package/dist/groups/websearch.d.ts +29 -0
  90. package/dist/groups/websearch.js +34 -0
  91. package/dist/groups/worktree.d.ts +41 -0
  92. package/dist/groups/worktree.js +52 -0
  93. package/dist/middleware/authorization.d.ts +13 -0
  94. package/dist/middleware/authorization.js +6 -0
  95. package/dist/middleware/schema-error.d.ts +13 -0
  96. package/dist/middleware/schema-error.js +4 -0
  97. package/dist/simulation/image.d.ts +35 -0
  98. package/dist/simulation/image.js +21 -0
  99. package/dist/simulation/terminal.d.ts +81 -0
  100. package/dist/simulation/terminal.js +49 -0
  101. package/dist/simulation.d.ts +1784 -0
  102. package/dist/simulation.js +485 -0
  103. package/package.json +46 -4
  104. package/README.md +0 -3
@@ -0,0 +1,93 @@
1
+ import { Schema } from "effect";
2
+ import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/http-api";
3
+ import { ConflictError, InvalidRequestError } from "../errors.js";
4
+ export declare const CredentialGroup: HttpApiGroup.HttpApiGroup<"server.credential", HttpApiEndpoint.HttpApiEndpoint<"credential.activate", "POST", "/api/credential/:credentialID/activate", Schema.toCodecStringTree<Schema.Struct<{
5
+ credentialID: Schema.brand<Schema.String, "Credential.ID"> & {
6
+ create: () => string & import("effect/Brand").Brand<"Credential.ID">;
7
+ };
8
+ }>>, never, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"credential.create", "POST", "/api/credential", never, never, Schema.toCodecJson<Schema.Struct<{
9
+ readonly id: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Credential.ID"> & {
10
+ create: () => string & import("effect/Brand").Brand<"Credential.ID">;
11
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "Credential.ID"> & {
12
+ create: () => string & import("effect/Brand").Brand<"Credential.ID">;
13
+ }>, never, never>;
14
+ readonly integrationID: Schema.brand<Schema.String, "Integration.ID">;
15
+ readonly label: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
16
+ readonly value: Schema.Union<readonly [Schema.Struct<{
17
+ readonly type: Schema.Literal<"oauth">;
18
+ readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">;
19
+ readonly refresh: Schema.String;
20
+ readonly access: Schema.String;
21
+ readonly expires: Schema.Int;
22
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
23
+ }>, Schema.Struct<{
24
+ readonly type: Schema.Literal<"key">;
25
+ readonly key: Schema.String;
26
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
27
+ }>, Schema.Struct<{
28
+ readonly type: Schema.Literal<"external">;
29
+ readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">;
30
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
31
+ }>]>;
32
+ readonly activate: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
33
+ }>>, never, Schema.toCodecJson<Schema.Struct<{
34
+ readonly data: Schema.Struct<{
35
+ readonly id: Schema.brand<Schema.String, "Credential.ID"> & {
36
+ create: () => string & import("effect/Brand").Brand<"Credential.ID">;
37
+ };
38
+ readonly integrationID: Schema.brand<Schema.String, "Integration.ID">;
39
+ readonly label: Schema.String;
40
+ readonly active: Schema.Boolean;
41
+ readonly value: Schema.Union<readonly [Schema.Struct<{
42
+ readonly type: Schema.Literal<"oauth">;
43
+ readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">;
44
+ readonly refresh: Schema.String;
45
+ readonly access: Schema.String;
46
+ readonly expires: Schema.Int;
47
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
48
+ }>, Schema.Struct<{
49
+ readonly type: Schema.Literal<"key">;
50
+ readonly key: Schema.String;
51
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
52
+ }>, Schema.Struct<{
53
+ readonly type: Schema.Literal<"external">;
54
+ readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">;
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
+ }>]>;
57
+ }>;
58
+ }>>, Schema.toCodecJson<typeof InvalidRequestError | typeof ConflictError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"credential.list", "GET", "/api/credential", never, never, never, never, Schema.toCodecJson<Schema.Struct<{
59
+ readonly data: Schema.$Array<Schema.Struct<{
60
+ readonly id: Schema.brand<Schema.String, "Credential.ID"> & {
61
+ create: () => string & import("effect/Brand").Brand<"Credential.ID">;
62
+ };
63
+ readonly integrationID: Schema.brand<Schema.String, "Integration.ID">;
64
+ readonly label: Schema.String;
65
+ readonly active: Schema.Boolean;
66
+ readonly value: Schema.Union<readonly [Schema.Struct<{
67
+ readonly type: Schema.Literal<"oauth">;
68
+ readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">;
69
+ readonly refresh: Schema.String;
70
+ readonly access: Schema.String;
71
+ readonly expires: Schema.Int;
72
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
73
+ }>, Schema.Struct<{
74
+ readonly type: Schema.Literal<"key">;
75
+ readonly key: Schema.String;
76
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
77
+ }>, Schema.Struct<{
78
+ readonly type: Schema.Literal<"external">;
79
+ readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">;
80
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
81
+ }>]>;
82
+ }>>;
83
+ }>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"credential.remove", "DELETE", "/api/credential/:credentialID", Schema.toCodecStringTree<Schema.Struct<{
84
+ credentialID: Schema.brand<Schema.String, "Credential.ID"> & {
85
+ create: () => string & import("effect/Brand").Brand<"Credential.ID">;
86
+ };
87
+ }>>, never, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"credential.update", "PATCH", "/api/credential/:credentialID", Schema.toCodecStringTree<Schema.Struct<{
88
+ credentialID: Schema.brand<Schema.String, "Credential.ID"> & {
89
+ create: () => string & import("effect/Brand").Brand<"Credential.ID">;
90
+ };
91
+ }>>, never, Schema.toCodecJson<Schema.Struct<{
92
+ readonly label: Schema.String;
93
+ }>>, never, Schema.toCodecJson<HttpApiSchema.NoContent>, never, never, never>, false>;
@@ -0,0 +1,50 @@
1
+ import { Credential } from "@radheim/schema/credential";
2
+ import { Schema } from "effect";
3
+ import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
4
+ import { ConflictError, InvalidRequestError } from "../errors.js";
5
+ export const CredentialGroup = HttpApiGroup.make("server.credential")
6
+ .add(HttpApiEndpoint.get("credential.list", "/api/credential", {
7
+ success: Schema.Struct({ data: Schema.Array(Credential.Entry) }),
8
+ }).annotateMerge(OpenApi.annotations({
9
+ identifier: "credential.list",
10
+ summary: "List credentials",
11
+ description: "List every stored integration credential, including its secret value.",
12
+ })))
13
+ .add(HttpApiEndpoint.post("credential.create", "/api/credential", {
14
+ payload: Credential.CreateInput,
15
+ success: Schema.Struct({ data: Credential.Entry }),
16
+ error: [ConflictError, InvalidRequestError],
17
+ }).annotateMerge(OpenApi.annotations({
18
+ identifier: "credential.create",
19
+ summary: "Create credential",
20
+ description: "Store an integration credential. It becomes the integration's active credential unless activate is false and the integration already has one. Fails with a conflict when the requested ID already exists, and with an invalid request when an `integration.connect` policy denies the integration.",
21
+ })))
22
+ .add(HttpApiEndpoint.patch("credential.update", "/api/credential/:credentialID", {
23
+ params: { credentialID: Credential.ID },
24
+ payload: Schema.Struct({ label: Schema.String }),
25
+ success: HttpApiSchema.NoContent,
26
+ })
27
+ .annotateMerge(OpenApi.annotations({
28
+ identifier: "credential.update",
29
+ summary: "Update credential",
30
+ description: "Update a stored credential label.",
31
+ })))
32
+ .annotateMerge(OpenApi.annotations({ title: "credential" }))
33
+ .add(HttpApiEndpoint.post("credential.activate", "/api/credential/:credentialID/activate", {
34
+ params: { credentialID: Credential.ID },
35
+ success: HttpApiSchema.NoContent,
36
+ })
37
+ .annotateMerge(OpenApi.annotations({
38
+ identifier: "credential.activate",
39
+ summary: "Activate credential",
40
+ description: "Activate a stored integration credential.",
41
+ })))
42
+ .add(HttpApiEndpoint.delete("credential.remove", "/api/credential/:credentialID", {
43
+ params: { credentialID: Credential.ID },
44
+ success: HttpApiSchema.NoContent,
45
+ })
46
+ .annotateMerge(OpenApi.annotations({
47
+ identifier: "credential.remove",
48
+ summary: "Remove credential",
49
+ description: "Remove a stored integration credential.",
50
+ })));
@@ -0,0 +1,22 @@
1
+ import { Schema } from "effect";
2
+ import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/http-api";
3
+ import { InvalidRequestError, UnknownError } from "../errors.js";
4
+ export declare const DebugGroup: HttpApiGroup.HttpApiGroup<"server.debug", HttpApiEndpoint.HttpApiEndpoint<"debug.heapDump", "POST", "/api/debug/heap-dump", never, Schema.toCodecStringTree<Schema.Struct<{
5
+ readonly directory: Schema.optional<Schema.String>;
6
+ }>>, never, never, Schema.toCodecJson<Schema.Struct<{
7
+ readonly path: Schema.String;
8
+ readonly pid: Schema.Int;
9
+ readonly memory: Schema.Struct<{
10
+ readonly rss: Schema.Number;
11
+ readonly heapTotal: Schema.Number;
12
+ readonly heapUsed: Schema.Number;
13
+ readonly external: Schema.Number;
14
+ readonly arrayBuffers: Schema.Number;
15
+ }>;
16
+ }>>, Schema.toCodecJson<typeof InvalidRequestError | typeof UnknownError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"debug.location", "GET", "/api/debug/location", never, never, never, never, Schema.toCodecJson<Schema.$Array<Schema.Struct<{
17
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
18
+ }>>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"debug.location.evict", "DELETE", "/api/debug/location", never, Schema.toCodecStringTree<Schema.Struct<{
19
+ readonly location: Schema.optional<Schema.Struct<{
20
+ readonly directory: Schema.optional<Schema.String>;
21
+ }>>;
22
+ }>>, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, never, never, never>, false>;
@@ -0,0 +1,49 @@
1
+ import { Location } from "@radheim/schema/location";
2
+ import { Schema } from "effect";
3
+ import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
4
+ import { InvalidRequestError, UnknownError } from "../errors.js";
5
+ import { LocationQuery, locationQueryOpenApi } from "./location.js";
6
+ export const DebugGroup = HttpApiGroup.make("server.debug")
7
+ .add(HttpApiEndpoint.post("debug.heapDump", "/api/debug/heap-dump", {
8
+ query: Schema.Struct({
9
+ directory: Schema.String.pipe(Schema.optional, Schema.annotate({
10
+ description: "Absolute server-local directory to write the snapshot into, created when missing. Defaults to the server's log directory.",
11
+ })),
12
+ }),
13
+ success: Schema.Struct({
14
+ path: Schema.String,
15
+ pid: Schema.Int,
16
+ memory: Schema.Struct({
17
+ rss: Schema.Number,
18
+ heapTotal: Schema.Number,
19
+ heapUsed: Schema.Number,
20
+ external: Schema.Number,
21
+ arrayBuffers: Schema.Number,
22
+ }).annotate({
23
+ description: "The server process's memory in bytes, read just before the snapshot (Node's process.memoryUsage()). rss covers native memory the snapshot cannot show.",
24
+ }),
25
+ }),
26
+ error: [InvalidRequestError, UnknownError],
27
+ }).annotateMerge(OpenApi.annotations({
28
+ identifier: "debug.heapDump",
29
+ summary: "Write a heap snapshot",
30
+ description: "Write a JavaScript heap snapshot of the server process into its log directory, or the requested directory, and return the server-local path once the file is complete. Pauses the server while the heap serializes and can temporarily increase its memory use. The snapshot can contain credentials, prompts, and file contents.",
31
+ })))
32
+ .add(HttpApiEndpoint.get("debug.location", "/api/debug/location", {
33
+ success: Schema.Array(Location.PublicRef),
34
+ }).annotateMerge(OpenApi.annotations({
35
+ identifier: "debug.location.list",
36
+ summary: "List loaded locations",
37
+ description: "List locations currently loaded by the server.",
38
+ })))
39
+ .add(HttpApiEndpoint.delete("debug.location.evict", "/api/debug/location", {
40
+ query: LocationQuery,
41
+ success: HttpApiSchema.NoContent,
42
+ })
43
+ .annotateMerge(locationQueryOpenApi)
44
+ .annotateMerge(OpenApi.annotations({
45
+ identifier: "debug.location.evict",
46
+ summary: "Evict a loaded location",
47
+ description: "Dispose the requested location's cached services so its next use boots them fresh.",
48
+ })))
49
+ .annotateMerge(OpenApi.annotations({ title: "debug" }));