@atcx/contract 0.0.0 → 7.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +45 -30
- package/dist/agent-list.d.ts +215 -0
- package/dist/agent-session-id.d.ts +2 -0
- package/dist/answer-view.d.ts +10 -0
- package/dist/check-daemon.d.ts +15 -0
- package/dist/commit-id-pattern.d.ts +1 -0
- package/dist/config-file-schema.d.ts +15 -0
- package/dist/contract-version.d.ts +1 -0
- package/dist/daemon-contract.d.ts +1646 -0
- package/dist/daemon-error-map.d.ts +9 -0
- package/dist/daemon-event.d.ts +424 -0
- package/dist/daemon-features.d.ts +2 -0
- package/dist/daemon-id.d.ts +2 -0
- package/dist/events-page.d.ts +39 -0
- package/dist/fleet-entry-view.d.ts +32 -0
- package/dist/fleet-event.d.ts +35 -0
- package/dist/git-probe-result.d.ts +18 -0
- package/dist/git-ref.d.ts +10 -0
- package/dist/hello-result.d.ts +16 -0
- package/dist/index.d.ts +45 -0
- package/dist/index.js +1124 -0
- package/dist/light/error-codes.d.ts +2 -0
- package/dist/light/index.d.ts +6 -0
- package/dist/light/index.js +132 -0
- package/dist/light/message-sender.d.ts +17 -0
- package/dist/light/resolve-atc-paths.d.ts +11 -0
- package/dist/light/resolve-home-dir.d.ts +1 -0
- package/dist/light/resolve-state-dir.d.ts +1 -0
- package/dist/light/session-env-names.d.ts +8 -0
- package/dist/menu-view.d.ts +12 -0
- package/dist/message-answer.d.ts +10 -0
- package/dist/message-id.d.ts +2 -0
- package/dist/message-status.d.ts +7 -0
- package/dist/message-view.d.ts +36 -0
- package/dist/note-view.d.ts +10 -0
- package/dist/procedure-meta.d.ts +10 -0
- package/dist/published-record-schema.d.ts +3 -0
- package/dist/published-record.d.ts +41 -0
- package/dist/request-param-schemas.d.ts +252 -0
- package/dist/restart-result.d.ts +28 -0
- package/dist/schema/build-optional-boolean.d.ts +2 -0
- package/dist/schema/build-optional-non-empty-string.d.ts +2 -0
- package/dist/schema/build-optional-string-array.d.ts +2 -0
- package/dist/schema/build-optional-string.d.ts +2 -0
- package/dist/schema/index.d.ts +4 -0
- package/dist/schema/index.js +26 -0
- package/dist/session-descriptor.d.ts +71 -0
- package/dist/session-id.d.ts +2 -0
- package/dist/session-lifecycle.d.ts +26 -0
- package/dist/session-workspace.d.ts +8 -0
- package/dist/source-candidate.d.ts +13 -0
- package/dist/source-entry.d.ts +10 -0
- package/dist/source-interpretation.d.ts +14 -0
- package/dist/source-pick.d.ts +9 -0
- package/dist/spawn-answer.d.ts +73 -0
- package/dist/spawn-option-spec.d.ts +16 -0
- package/dist/to-agent-session-id.d.ts +2 -0
- package/dist/to-daemon-id.d.ts +2 -0
- package/dist/to-message-id.d.ts +2 -0
- package/dist/to-session-id.d.ts +2 -0
- package/dist/transcript-row.d.ts +14 -0
- package/package.json +34 -6
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// packages/contract/src/schema/build-optional-boolean.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
function buildOptionalBoolean() {
|
|
4
|
+
return z.preprocess((value) => typeof value === "boolean" ? value : undefined, z.boolean().optional());
|
|
5
|
+
}
|
|
6
|
+
// packages/contract/src/schema/build-optional-non-empty-string.ts
|
|
7
|
+
import { z as z2 } from "zod";
|
|
8
|
+
function buildOptionalNonEmptyString() {
|
|
9
|
+
return z2.preprocess((value) => typeof value === "string" && value !== "" ? value : undefined, z2.string().optional());
|
|
10
|
+
}
|
|
11
|
+
// packages/contract/src/schema/build-optional-string.ts
|
|
12
|
+
import { z as z3 } from "zod";
|
|
13
|
+
function buildOptionalString() {
|
|
14
|
+
return z3.preprocess((value) => typeof value === "string" ? value : undefined, z3.string().optional());
|
|
15
|
+
}
|
|
16
|
+
// packages/contract/src/schema/build-optional-string-array.ts
|
|
17
|
+
import { z as z4 } from "zod";
|
|
18
|
+
function buildOptionalStringArray() {
|
|
19
|
+
return z4.preprocess((value) => Array.isArray(value) ? value.filter((item) => typeof item === "string") : undefined, z4.array(z4.string()).optional());
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
buildOptionalBoolean,
|
|
23
|
+
buildOptionalNonEmptyString,
|
|
24
|
+
buildOptionalString,
|
|
25
|
+
buildOptionalStringArray
|
|
26
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SESSION_DESCRIPTOR_SCHEMA: z.ZodObject<{
|
|
3
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<import("./session-id.js").SessionID, string>>;
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
cwd: z.ZodString;
|
|
6
|
+
state: z.ZodEnum<{
|
|
7
|
+
done: "done";
|
|
8
|
+
exited: "exited";
|
|
9
|
+
needs_you: "needs_you";
|
|
10
|
+
running: "running";
|
|
11
|
+
}>;
|
|
12
|
+
unread: z.ZodBoolean;
|
|
13
|
+
lastMsg: z.ZodString;
|
|
14
|
+
lastDetail: z.ZodOptional<z.ZodString>;
|
|
15
|
+
restoreRefusal: z.ZodOptional<z.ZodString>;
|
|
16
|
+
agentSessionID: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./agent-session-id.js").AgentSessionID, string>>>;
|
|
17
|
+
agent: z.ZodString;
|
|
18
|
+
pinned: z.ZodBoolean;
|
|
19
|
+
lastAttachedAt: z.ZodNumber;
|
|
20
|
+
repoRoot: z.ZodString;
|
|
21
|
+
namedBy: z.ZodEnum<{
|
|
22
|
+
agent: "agent";
|
|
23
|
+
auto: "auto";
|
|
24
|
+
user: "user";
|
|
25
|
+
}>;
|
|
26
|
+
createdAt: z.ZodNumber;
|
|
27
|
+
kind: z.ZodEnum<{
|
|
28
|
+
headless: "headless";
|
|
29
|
+
pty: "pty";
|
|
30
|
+
}>;
|
|
31
|
+
alive: z.ZodBoolean;
|
|
32
|
+
canEject: z.ZodBoolean;
|
|
33
|
+
parent: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./session-id.js").SessionID, string>>>;
|
|
34
|
+
locator: z.ZodObject<{
|
|
35
|
+
daemonID: z.ZodPipe<z.ZodString, z.ZodTransform<import("./daemon-id.js").DaemonID, string>>;
|
|
36
|
+
targetID: z.ZodString;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
workspace: z.ZodOptional<z.ZodObject<{
|
|
39
|
+
repoURL: z.ZodString;
|
|
40
|
+
sha: z.ZodString;
|
|
41
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
42
|
+
materializedAt: z.ZodNumber;
|
|
43
|
+
}, z.core.$strip>>;
|
|
44
|
+
lifecycle: z.ZodObject<{
|
|
45
|
+
desired: z.ZodEnum<{
|
|
46
|
+
run: "run";
|
|
47
|
+
sleep: "sleep";
|
|
48
|
+
stop: "stop";
|
|
49
|
+
}>;
|
|
50
|
+
vm: z.ZodEnum<{
|
|
51
|
+
asleep: "asleep";
|
|
52
|
+
awake: "awake";
|
|
53
|
+
none: "none";
|
|
54
|
+
unknown: "unknown";
|
|
55
|
+
}>;
|
|
56
|
+
harness: z.ZodEnum<{
|
|
57
|
+
exited: "exited";
|
|
58
|
+
running: "running";
|
|
59
|
+
suspended: "suspended";
|
|
60
|
+
}>;
|
|
61
|
+
attachment: z.ZodEnum<{
|
|
62
|
+
attached: "attached";
|
|
63
|
+
detached: "detached";
|
|
64
|
+
local: "local";
|
|
65
|
+
reattaching: "reattaching";
|
|
66
|
+
}>;
|
|
67
|
+
}, z.core.$strip>;
|
|
68
|
+
model: z.ZodOptional<z.ZodString>;
|
|
69
|
+
pluginDirs: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
70
|
+
}, z.core.$strip>;
|
|
71
|
+
export type SessionDescriptor = Readonly<z.output<typeof SESSION_DESCRIPTOR_SCHEMA>>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SESSION_LIFECYCLE_SCHEMA: z.ZodObject<{
|
|
3
|
+
desired: z.ZodEnum<{
|
|
4
|
+
run: "run";
|
|
5
|
+
sleep: "sleep";
|
|
6
|
+
stop: "stop";
|
|
7
|
+
}>;
|
|
8
|
+
vm: z.ZodEnum<{
|
|
9
|
+
asleep: "asleep";
|
|
10
|
+
awake: "awake";
|
|
11
|
+
none: "none";
|
|
12
|
+
unknown: "unknown";
|
|
13
|
+
}>;
|
|
14
|
+
harness: z.ZodEnum<{
|
|
15
|
+
exited: "exited";
|
|
16
|
+
running: "running";
|
|
17
|
+
suspended: "suspended";
|
|
18
|
+
}>;
|
|
19
|
+
attachment: z.ZodEnum<{
|
|
20
|
+
attached: "attached";
|
|
21
|
+
detached: "detached";
|
|
22
|
+
local: "local";
|
|
23
|
+
reattaching: "reattaching";
|
|
24
|
+
}>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
export type SessionLifecycle = Readonly<z.output<typeof SESSION_LIFECYCLE_SCHEMA>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SESSION_WORKSPACE_SCHEMA: z.ZodObject<{
|
|
3
|
+
repoURL: z.ZodString;
|
|
4
|
+
sha: z.ZodString;
|
|
5
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
6
|
+
materializedAt: z.ZodNumber;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export type SessionWorkspace = Readonly<z.output<typeof SESSION_WORKSPACE_SCHEMA>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SOURCE_CANDIDATE_SCHEMA: z.ZodObject<{
|
|
3
|
+
label: z.ZodString;
|
|
4
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
5
|
+
pick: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
6
|
+
kind: z.ZodLiteral<"path">;
|
|
7
|
+
directory: z.ZodString;
|
|
8
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
9
|
+
kind: z.ZodLiteral<"git">;
|
|
10
|
+
url: z.ZodString;
|
|
11
|
+
}, z.core.$strip>], "kind">;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
export type SourceCandidate = z.output<typeof SOURCE_CANDIDATE_SCHEMA>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SOURCE_ENTRY_SCHEMA: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
label: z.ZodString;
|
|
5
|
+
kind: z.ZodEnum<{
|
|
6
|
+
git: "git";
|
|
7
|
+
path: "path";
|
|
8
|
+
}>;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export type SourceEntry = z.output<typeof SOURCE_ENTRY_SCHEMA>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SOURCE_INTERPRETATION_SCHEMA: z.ZodUnion<readonly [z.ZodObject<{
|
|
3
|
+
kind: z.ZodLiteral<"browse">;
|
|
4
|
+
scope: z.ZodString;
|
|
5
|
+
}, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
6
|
+
kind: z.ZodLiteral<"path">;
|
|
7
|
+
directory: z.ZodString;
|
|
8
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
9
|
+
kind: z.ZodLiteral<"git">;
|
|
10
|
+
url: z.ZodString;
|
|
11
|
+
}, z.core.$strip>], "kind">, z.ZodObject<{
|
|
12
|
+
kind: z.ZodLiteral<"none">;
|
|
13
|
+
}, z.core.$strip>]>;
|
|
14
|
+
export type SourceInterpretation = z.output<typeof SOURCE_INTERPRETATION_SCHEMA>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SOURCE_PICK_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
|
+
kind: z.ZodLiteral<"path">;
|
|
4
|
+
directory: z.ZodString;
|
|
5
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6
|
+
kind: z.ZodLiteral<"git">;
|
|
7
|
+
url: z.ZodString;
|
|
8
|
+
}, z.core.$strip>], "kind">;
|
|
9
|
+
export type SourcePick = z.output<typeof SOURCE_PICK_SCHEMA>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SPAWN_ANSWER_SCHEMA: z.ZodObject<{
|
|
3
|
+
session: z.ZodObject<{
|
|
4
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<import("./session-id.js").SessionID, string>>;
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
cwd: z.ZodString;
|
|
7
|
+
state: z.ZodEnum<{
|
|
8
|
+
done: "done";
|
|
9
|
+
exited: "exited";
|
|
10
|
+
needs_you: "needs_you";
|
|
11
|
+
running: "running";
|
|
12
|
+
}>;
|
|
13
|
+
unread: z.ZodBoolean;
|
|
14
|
+
lastMsg: z.ZodString;
|
|
15
|
+
lastDetail: z.ZodOptional<z.ZodString>;
|
|
16
|
+
restoreRefusal: z.ZodOptional<z.ZodString>;
|
|
17
|
+
agentSessionID: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./agent-session-id.js").AgentSessionID, string>>>;
|
|
18
|
+
agent: z.ZodString;
|
|
19
|
+
pinned: z.ZodBoolean;
|
|
20
|
+
lastAttachedAt: z.ZodNumber;
|
|
21
|
+
repoRoot: z.ZodString;
|
|
22
|
+
namedBy: z.ZodEnum<{
|
|
23
|
+
agent: "agent";
|
|
24
|
+
auto: "auto";
|
|
25
|
+
user: "user";
|
|
26
|
+
}>;
|
|
27
|
+
createdAt: z.ZodNumber;
|
|
28
|
+
kind: z.ZodEnum<{
|
|
29
|
+
headless: "headless";
|
|
30
|
+
pty: "pty";
|
|
31
|
+
}>;
|
|
32
|
+
alive: z.ZodBoolean;
|
|
33
|
+
canEject: z.ZodBoolean;
|
|
34
|
+
parent: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./session-id.js").SessionID, string>>>;
|
|
35
|
+
locator: z.ZodObject<{
|
|
36
|
+
daemonID: z.ZodPipe<z.ZodString, z.ZodTransform<import("./daemon-id.js").DaemonID, string>>;
|
|
37
|
+
targetID: z.ZodString;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
workspace: z.ZodOptional<z.ZodObject<{
|
|
40
|
+
repoURL: z.ZodString;
|
|
41
|
+
sha: z.ZodString;
|
|
42
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
43
|
+
materializedAt: z.ZodNumber;
|
|
44
|
+
}, z.core.$strip>>;
|
|
45
|
+
lifecycle: z.ZodObject<{
|
|
46
|
+
desired: z.ZodEnum<{
|
|
47
|
+
run: "run";
|
|
48
|
+
sleep: "sleep";
|
|
49
|
+
stop: "stop";
|
|
50
|
+
}>;
|
|
51
|
+
vm: z.ZodEnum<{
|
|
52
|
+
asleep: "asleep";
|
|
53
|
+
awake: "awake";
|
|
54
|
+
none: "none";
|
|
55
|
+
unknown: "unknown";
|
|
56
|
+
}>;
|
|
57
|
+
harness: z.ZodEnum<{
|
|
58
|
+
exited: "exited";
|
|
59
|
+
running: "running";
|
|
60
|
+
suspended: "suspended";
|
|
61
|
+
}>;
|
|
62
|
+
attachment: z.ZodEnum<{
|
|
63
|
+
attached: "attached";
|
|
64
|
+
detached: "detached";
|
|
65
|
+
local: "local";
|
|
66
|
+
reattaching: "reattaching";
|
|
67
|
+
}>;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
model: z.ZodOptional<z.ZodString>;
|
|
70
|
+
pluginDirs: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
71
|
+
}, z.core.$strip>;
|
|
72
|
+
warnings: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
73
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SPAWN_OPTION_SPEC_SCHEMA: z.ZodObject<{
|
|
3
|
+
supported: z.ZodBoolean;
|
|
4
|
+
values: z.ZodNullable<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
5
|
+
examples: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
6
|
+
value: z.ZodString;
|
|
7
|
+
resolvesTo: z.ZodNullable<z.ZodString>;
|
|
8
|
+
}, z.core.$strip>>>;
|
|
9
|
+
default: z.ZodNullable<z.ZodString>;
|
|
10
|
+
backendEffect: z.ZodNullable<z.ZodEnum<{
|
|
11
|
+
applied: "applied";
|
|
12
|
+
unverified: "unverified";
|
|
13
|
+
}>>;
|
|
14
|
+
note: z.ZodNullable<z.ZodString>;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
export type SpawnOptionSpec = Readonly<z.output<typeof SPAWN_OPTION_SPEC_SCHEMA>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const TRANSCRIPT_ROW_SCHEMA: z.ZodObject<{
|
|
3
|
+
role: z.ZodEnum<{
|
|
4
|
+
assistant: "assistant";
|
|
5
|
+
user: "user";
|
|
6
|
+
}>;
|
|
7
|
+
text: z.ZodString;
|
|
8
|
+
tools: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
9
|
+
name: z.ZodString;
|
|
10
|
+
input: z.ZodString;
|
|
11
|
+
}, z.core.$strip>>>;
|
|
12
|
+
at: z.ZodNullable<z.ZodNumber>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export type TranscriptRow = Readonly<z.output<typeof TRANSCRIPT_ROW_SCHEMA>>;
|
package/package.json
CHANGED
|
@@ -1,10 +1,38 @@
|
|
|
1
1
|
{
|
|
2
|
+
"exports": {
|
|
3
|
+
".": {
|
|
4
|
+
"types": "./dist/index.d.ts",
|
|
5
|
+
"default": "./dist/index.js"
|
|
6
|
+
},
|
|
7
|
+
"./light": {
|
|
8
|
+
"types": "./dist/light/index.d.ts",
|
|
9
|
+
"default": "./dist/light/index.js"
|
|
10
|
+
},
|
|
11
|
+
"./schema": {
|
|
12
|
+
"types": "./dist/schema/index.d.ts",
|
|
13
|
+
"default": "./dist/schema/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@orpc/contract": "1.16.0",
|
|
18
|
+
"zod": "4.6.6"
|
|
19
|
+
},
|
|
2
20
|
"name": "@atcx/contract",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
21
|
+
"version": "7.5.0",
|
|
22
|
+
"description": "atc's public contract: the daemon's request contract, the event, session record, hello and config schemas, the error codes, the session env names, and the state paths",
|
|
23
|
+
"homepage": "https://github.com/zgeoff/atc/tree/main/packages/contract#readme",
|
|
24
|
+
"bugs": "https://github.com/zgeoff/atc/issues",
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "git+https://github.com/zgeoff/atc.git",
|
|
29
|
+
"directory": "packages/contract"
|
|
30
|
+
},
|
|
31
|
+
"type": "module",
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"dist"
|
|
9
37
|
]
|
|
10
38
|
}
|