@claxedo/agent-runtime-contract 0.8.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 +37 -0
- package/dist/availability.d.ts +42 -0
- package/dist/capabilities.d.ts +31 -0
- package/dist/claims.d.ts +31 -0
- package/dist/connections.d.ts +21 -0
- package/dist/content.d.ts +411 -0
- package/dist/credential-broker-errors.d.ts +80 -0
- package/dist/errors.d.ts +43 -0
- package/dist/events.d.ts +460 -0
- package/dist/files.d.ts +52 -0
- package/dist/harness-effort.d.ts +56 -0
- package/dist/harness-table.d.ts +56 -0
- package/dist/harnesses.d.ts +96 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.mjs +815 -0
- package/dist/question-answers.d.ts +13 -0
- package/dist/session-group.d.ts +37 -0
- package/dist/sessions.d.ts +166 -0
- package/dist/tool-names.d.ts +3 -0
- package/dist/usage-windows.d.ts +23 -0
- package/dist/values.d.ts +10 -0
- package/package.json +53 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
export declare const AGENT_HARNESS_DEFINITIONS: readonly [{
|
|
2
|
+
readonly key: "claude";
|
|
3
|
+
readonly id: "claude";
|
|
4
|
+
readonly access: "native";
|
|
5
|
+
readonly label: "Claude";
|
|
6
|
+
readonly authEnv: "ANTHROPIC_API_KEY";
|
|
7
|
+
readonly authSlot: "anthropic";
|
|
8
|
+
}, {
|
|
9
|
+
readonly key: "codex";
|
|
10
|
+
readonly id: "codex";
|
|
11
|
+
readonly access: "native";
|
|
12
|
+
readonly label: "Codex";
|
|
13
|
+
readonly authEnv: "OPENAI_API_KEY";
|
|
14
|
+
readonly authSlot: "openai";
|
|
15
|
+
}, {
|
|
16
|
+
readonly key: "cursor";
|
|
17
|
+
readonly id: "cursor";
|
|
18
|
+
readonly access: "native";
|
|
19
|
+
readonly label: "Cursor";
|
|
20
|
+
readonly authEnv: "CURSOR_API_KEY";
|
|
21
|
+
readonly authSlot: "cursor";
|
|
22
|
+
}, {
|
|
23
|
+
readonly key: "pi";
|
|
24
|
+
readonly id: "pi";
|
|
25
|
+
readonly access: "native";
|
|
26
|
+
readonly label: "Pi";
|
|
27
|
+
readonly authEnv: null;
|
|
28
|
+
readonly authSlot: null;
|
|
29
|
+
}, {
|
|
30
|
+
readonly key: "opencode";
|
|
31
|
+
readonly id: "opencode";
|
|
32
|
+
readonly access: "native";
|
|
33
|
+
readonly label: "OpenCode";
|
|
34
|
+
readonly authEnv: null;
|
|
35
|
+
readonly authSlot: null;
|
|
36
|
+
}];
|
|
37
|
+
export declare const AGENT_HARNESS_IDS: readonly ["claude", "codex", "cursor", "pi", "opencode"];
|
|
38
|
+
export declare const AGENT_HARNESS_ACCESSES: readonly ["connection", "native"];
|
|
39
|
+
export declare const AGENT_HARNESS_KEYS: ("claude" | "codex" | "cursor" | "opencode" | "pi")[];
|
|
40
|
+
export type AgentHarnessId = (typeof AGENT_HARNESS_IDS)[number];
|
|
41
|
+
export type AgentHarnessAccess = (typeof AGENT_HARNESS_ACCESSES)[number];
|
|
42
|
+
export type AgentHarnessKey = (typeof AGENT_HARNESS_KEYS)[number];
|
|
43
|
+
export type NativeHarnessId = AgentHarnessId;
|
|
44
|
+
/** The native harnesses driven through `SdkRuntimeDriver`; `opencode` is composed by `@claxedo/workspace-runtime/opencode` instead. */
|
|
45
|
+
export type NativeSdkHarnessId = Extract<AgentHarnessId, "claude" | "codex" | "cursor" | "pi">;
|
|
46
|
+
/**
|
|
47
|
+
* A harness identity's id field: one of the finite built-in ids, or a
|
|
48
|
+
* validated configured connection id for `access: "connection"` identities.
|
|
49
|
+
* Native dispatch stays closed — an open id is only ever accepted alongside
|
|
50
|
+
* `access: "connection"` and only through the accepted
|
|
51
|
+
* registry a host applies; it can never select a native adapter factory.
|
|
52
|
+
* The `string & {}` half keeps literal narrowing on the built-in ids intact.
|
|
53
|
+
*/
|
|
54
|
+
export type SessionHarnessId = AgentHarnessId | (string & {});
|
|
55
|
+
export type AgentHarnessDefinition = (typeof AGENT_HARNESS_DEFINITIONS)[number];
|
|
56
|
+
export type AgentHarnessTransport = "stdio" | "streamable-http" | "websocket";
|
|
57
|
+
/**
|
|
58
|
+
* Open ACP connection ids are stable lowercase slugs: they become
|
|
59
|
+
* directory-safe store keys and query values.
|
|
60
|
+
* The finite built-in ids all match this shape too, which keeps one grammar.
|
|
61
|
+
*/
|
|
62
|
+
export declare const ACP_CONNECTION_ID_PATTERN: RegExp;
|
|
63
|
+
export declare function isAcpConnectionId(id: string): boolean;
|
|
64
|
+
export declare function harnessDefinition(input: {
|
|
65
|
+
id: string;
|
|
66
|
+
access: string;
|
|
67
|
+
} | string): AgentHarnessDefinition | undefined;
|
|
68
|
+
export declare function isAgentHarnessId(id: string): id is AgentHarnessId;
|
|
69
|
+
export declare function isAgentHarnessAccess(access: string): access is AgentHarnessAccess;
|
|
70
|
+
export declare function normalizeAgentHarnessTransport(input: unknown): AgentHarnessTransport | undefined;
|
|
71
|
+
export declare function harnessKey(input: {
|
|
72
|
+
id: SessionHarnessId;
|
|
73
|
+
access: AgentHarnessAccess;
|
|
74
|
+
}): string | undefined;
|
|
75
|
+
export declare function normalizeHarnessIdentity(input: unknown): {
|
|
76
|
+
id: SessionHarnessId;
|
|
77
|
+
access: AgentHarnessAccess;
|
|
78
|
+
} | undefined;
|
|
79
|
+
/** A session's harness identity: a built-in id, or a configured connection id. */
|
|
80
|
+
export type SessionHarness = {
|
|
81
|
+
id: SessionHarnessId;
|
|
82
|
+
access: AgentHarnessAccess;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* How a harness takes a session's standing instruction block, and when.
|
|
86
|
+
*
|
|
87
|
+
* `turn-system-prompt` — a real system prompt, composed into every turn.
|
|
88
|
+
* `thread-start` — a real system prompt given once when the harness thread is
|
|
89
|
+
* created; the thread holds it, so repeating it per turn would send it twice.
|
|
90
|
+
* `prompt-prefix` — no separate slot: the block rides at the head of the same
|
|
91
|
+
* prompt the user's own text is in, on every turn.
|
|
92
|
+
* `none` — no channel; a session created with a block is refused rather than
|
|
93
|
+
* running under instructions the harness never received.
|
|
94
|
+
*/
|
|
95
|
+
export declare const HARNESS_INSTRUCTION_CHANNELS: readonly ["turn-system-prompt", "thread-start", "prompt-prefix", "none"];
|
|
96
|
+
export type HarnessInstructionChannel = (typeof HARNESS_INSTRUCTION_CHANNELS)[number];
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const AGENT_RUNTIME_CONTRACT_VERSION = 1;
|
|
2
|
+
export * from "./availability";
|
|
3
|
+
export * from "./capabilities";
|
|
4
|
+
export * from "./claims";
|
|
5
|
+
export * from "./connections";
|
|
6
|
+
export * from "./content";
|
|
7
|
+
export * from "./credential-broker-errors";
|
|
8
|
+
export * from "./errors";
|
|
9
|
+
export * from "./events";
|
|
10
|
+
export * from "./files";
|
|
11
|
+
export * from "./harness-effort";
|
|
12
|
+
export * from "./harness-table";
|
|
13
|
+
export * from "./harnesses";
|
|
14
|
+
export * from "./question-answers";
|
|
15
|
+
export * from "./session-group";
|
|
16
|
+
export * from "./sessions";
|
|
17
|
+
export * from "./tool-names";
|
|
18
|
+
export * from "./usage-windows";
|
|
19
|
+
export * from "./values";
|