@standardagents/code 0.0.2-dev.b3cdaaf → 0.1.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/README.md +11 -3
- package/dist/index.js +3463 -0
- package/dist/index.js.map +1 -0
- package/package.json +5 -4
- package/bin/standardcode.mjs +0 -25
- package/src/api.ts +0 -169
- package/src/approvals.ts +0 -42
- package/src/bridge.ts +0 -303
- package/src/credentials.ts +0 -49
- package/src/events-stream.ts +0 -99
- package/src/host-tools.ts +0 -570
- package/src/index.ts +0 -1152
- package/src/markdown.ts +0 -226
- package/src/mcp-config.ts +0 -137
- package/src/mcp.ts +0 -563
- package/src/permissions.ts +0 -53
- package/src/process-registry.ts +0 -122
- package/src/stream.ts +0 -134
- package/src/tui.ts +0 -911
- package/src/types.ts +0 -78
package/src/types.ts
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/** Bridge protocol + shared CLI types. */
|
|
2
|
-
|
|
3
|
-
/** A forwarded tool request the instance sends down the bridge. */
|
|
4
|
-
export interface ToolRequest {
|
|
5
|
-
type: "tool_request";
|
|
6
|
-
/** In-memory await id (non-durable calls reply over the WebSocket with this). */
|
|
7
|
-
id?: string;
|
|
8
|
-
/**
|
|
9
|
-
* Durable calls: the agent parked this call and is awaiting the result over
|
|
10
|
-
* HTTP. Reply by POSTing to /tool-result with `toolCallId` instead of the WS.
|
|
11
|
-
*/
|
|
12
|
-
durable?: boolean;
|
|
13
|
-
toolCallId?: string;
|
|
14
|
-
tool: string;
|
|
15
|
-
args: Record<string, unknown>;
|
|
16
|
-
requestPermission: string | null;
|
|
17
|
-
risk: number | null;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/** The CLI's reply to a tool request. */
|
|
21
|
-
export interface ToolResponse {
|
|
22
|
-
type: "tool_response";
|
|
23
|
-
id: string;
|
|
24
|
-
ok: boolean;
|
|
25
|
-
result?: string;
|
|
26
|
-
error?: string;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/** Result of executing a tool on the host. */
|
|
30
|
-
export interface HostResult {
|
|
31
|
-
ok: boolean;
|
|
32
|
-
result?: string;
|
|
33
|
-
error?: string;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Permission is a single auto-accept LEVEL 1–5: every tool call at risk ≤ level
|
|
38
|
-
* runs automatically; anything riskier asks. (The catastrophic-command guard
|
|
39
|
-
* still blocks dangerous commands at every level.) shift-tab cycles the level.
|
|
40
|
-
*/
|
|
41
|
-
export type Level = 1 | 2 | 3 | 4 | 5;
|
|
42
|
-
|
|
43
|
-
export const LEVELS: Level[] = [1, 2, 3, 4, 5];
|
|
44
|
-
|
|
45
|
-
/** What each level lets run without asking (risk meanings: 1 read · 2 safe writes/builds · 3 installs/project edits · 4 outside-project/git-history · 5 destructive). */
|
|
46
|
-
const LEVEL_DETAIL: Record<Level, string> = {
|
|
47
|
-
1: "only safe reads run automatically",
|
|
48
|
-
2: "+ safe writes & builds",
|
|
49
|
-
3: "+ installs & project edits",
|
|
50
|
-
4: "+ outside-project & git-history",
|
|
51
|
-
5: "everything — never ask",
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export function levelLabel(level: Level): string {
|
|
55
|
-
return `auto-accept level ${level} (${LEVEL_DETAIL[level]})`;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/** Stored credential for one instance. */
|
|
59
|
-
export interface InstanceCredential {
|
|
60
|
-
endpoint: string;
|
|
61
|
-
access_token: string;
|
|
62
|
-
token_type: string;
|
|
63
|
-
user?: { id: string; username: string; role: string };
|
|
64
|
-
saved_at: number;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export interface CredentialsFile {
|
|
68
|
-
default_endpoint?: string;
|
|
69
|
-
instances: Record<string, InstanceCredential>;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export interface ThreadSummary {
|
|
73
|
-
id: string;
|
|
74
|
-
tags: string[];
|
|
75
|
-
created_at?: number;
|
|
76
|
-
title?: string;
|
|
77
|
-
preview?: string;
|
|
78
|
-
}
|