@easonwumac/computer-linker 0.1.2
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/CHANGELOG.md +230 -0
- package/LICENSE +21 -0
- package/README.md +539 -0
- package/SECURITY.md +48 -0
- package/dist/api.d.ts +2 -0
- package/dist/api.js +360 -0
- package/dist/audit.d.ts +70 -0
- package/dist/audit.js +102 -0
- package/dist/capabilities.d.ts +98 -0
- package/dist/capabilities.js +718 -0
- package/dist/capability-policy.d.ts +22 -0
- package/dist/capability-policy.js +103 -0
- package/dist/chatgpt.d.ts +167 -0
- package/dist/chatgpt.js +561 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +4621 -0
- package/dist/client-smoke.d.ts +44 -0
- package/dist/client-smoke.js +639 -0
- package/dist/client.d.ts +217 -0
- package/dist/client.js +357 -0
- package/dist/codex-runs.d.ts +35 -0
- package/dist/codex-runs.js +66 -0
- package/dist/computer-contract.d.ts +33 -0
- package/dist/computer-contract.js +384 -0
- package/dist/computer-operation-registry.d.ts +45 -0
- package/dist/computer-operation-registry.js +179 -0
- package/dist/config-diagnostics.d.ts +11 -0
- package/dist/config-diagnostics.js +185 -0
- package/dist/config.d.ts +10 -0
- package/dist/config.js +69 -0
- package/dist/history-insights.d.ts +132 -0
- package/dist/history-insights.js +457 -0
- package/dist/http-auth.d.ts +3 -0
- package/dist/http-auth.js +15 -0
- package/dist/mcp-surface.d.ts +5 -0
- package/dist/mcp-surface.js +25 -0
- package/dist/oauth-provider.d.ts +52 -0
- package/dist/oauth-provider.js +325 -0
- package/dist/package-metadata.d.ts +7 -0
- package/dist/package-metadata.js +24 -0
- package/dist/permissions.d.ts +43 -0
- package/dist/permissions.js +150 -0
- package/dist/platform-shell.d.ts +28 -0
- package/dist/platform-shell.js +124 -0
- package/dist/processes.d.ts +50 -0
- package/dist/processes.js +178 -0
- package/dist/profile.d.ts +159 -0
- package/dist/profile.js +416 -0
- package/dist/screenshot.d.ts +47 -0
- package/dist/screenshot.js +302 -0
- package/dist/search.d.ts +34 -0
- package/dist/search.js +340 -0
- package/dist/security.d.ts +10 -0
- package/dist/security.js +108 -0
- package/dist/sensitive-files.d.ts +4 -0
- package/dist/sensitive-files.js +96 -0
- package/dist/server.d.ts +9 -0
- package/dist/server.js +713 -0
- package/dist/service.d.ts +125 -0
- package/dist/service.js +486 -0
- package/dist/sessions.d.ts +26 -0
- package/dist/sessions.js +34 -0
- package/dist/tunnels.d.ts +161 -0
- package/dist/tunnels.js +1243 -0
- package/dist/workspace-operations.d.ts +170 -0
- package/dist/workspace-operations.js +3219 -0
- package/dist/workspaces.d.ts +61 -0
- package/dist/workspaces.js +353 -0
- package/docs/agent-instructions.md +65 -0
- package/docs/alpha-evidence.example.json +54 -0
- package/docs/api-compatibility.md +56 -0
- package/docs/architecture.md +561 -0
- package/docs/chatgpt-setup.md +397 -0
- package/docs/client-recipes.md +98 -0
- package/docs/client-sdk.md +163 -0
- package/docs/computer-operation-v1.schema.json +143 -0
- package/docs/manual-test-plan.md +322 -0
- package/docs/product-spec.md +911 -0
- package/docs/release-checklist.md +285 -0
- package/docs/service-mode.md +99 -0
- package/examples/minimal-mcp-client.mjs +114 -0
- package/package.json +87 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { type AuditEventInput } from "./audit.js";
|
|
2
|
+
import { type CapabilityName, type CapabilityPolicy } from "./capability-policy.js";
|
|
3
|
+
import { type PathPermissions } from "./permissions.js";
|
|
4
|
+
import { WorkspaceRegistry, type Workspace } from "./workspaces.js";
|
|
5
|
+
export declare const workspaceOperationNames: readonly ["stat", "list", "list_details", "explain_operation", "tree", "instructions", "agent_skills", "coding_context", "project_overview", "history", "history_insight", "change_summary", "repo_status", "git_changes", "git_diff", "git_log", "git_show", "git_stage", "git_unstage", "git_commit", "git_worktree_list", "git_worktree_create", "read", "read_many", "write", "create_file", "write_if_unchanged", "edit", "patch", "mkdir", "delete", "move", "find_files", "search_text", "search_symbols", "package_run", "package_start", "command", "process_start", "process_list", "process_read", "process_stop", "codex_start", "codex", "codex_plan", "codex_review", "codex_fix", "codex_test", "codex_continue", "codex_runs", "screen_list", "screen_capture", "screen_capture_window", "screen_capture_process", "batch"];
|
|
6
|
+
export type WorkspaceOperationName = typeof workspaceOperationNames[number];
|
|
7
|
+
export interface WorkspaceOperationCatalogEntry {
|
|
8
|
+
operation: WorkspaceOperationName;
|
|
9
|
+
permission: "read" | "write" | "shell" | "codex" | "screen" | "mixed";
|
|
10
|
+
description: string;
|
|
11
|
+
requiredFields: string[];
|
|
12
|
+
optionalFields: string[];
|
|
13
|
+
example: WorkspaceOperationInput;
|
|
14
|
+
}
|
|
15
|
+
export type WorkspaceOperationBoundary = "workspace-path-enforced" | "workspace-scoped-metadata" | "workspace-cwd-only" | "mixed";
|
|
16
|
+
export interface WorkspaceOperationSafetyEntry {
|
|
17
|
+
operation: WorkspaceOperationName;
|
|
18
|
+
permission: WorkspaceOperationCatalogEntry["permission"];
|
|
19
|
+
boundary: WorkspaceOperationBoundary;
|
|
20
|
+
note: string;
|
|
21
|
+
}
|
|
22
|
+
export interface WorkspaceOperationSchema {
|
|
23
|
+
requiredFields: string[];
|
|
24
|
+
optionalFields: string[];
|
|
25
|
+
example: WorkspaceOperationInput;
|
|
26
|
+
}
|
|
27
|
+
export type WorkspaceOperationRunner = (registry: WorkspaceRegistry, workspace: Workspace, input: WorkspaceOperationInput) => Promise<unknown>;
|
|
28
|
+
export interface WorkspaceOperationRunRegistration {
|
|
29
|
+
type: "workspace-operation-dispatch";
|
|
30
|
+
handler: "runWorkspaceOperation" | "runFileSearchOperation" | "runMetadataOperation" | "runCodexOperation" | "runScreenOperation";
|
|
31
|
+
execute: WorkspaceOperationRunner;
|
|
32
|
+
}
|
|
33
|
+
export interface WorkspaceOperationAuditRegistration {
|
|
34
|
+
eventType: "tool_call";
|
|
35
|
+
fields: "workspaceOperationAuditFields";
|
|
36
|
+
redactions: string[];
|
|
37
|
+
}
|
|
38
|
+
export interface WorkspaceOperationInput {
|
|
39
|
+
operation: WorkspaceOperationName;
|
|
40
|
+
operationName?: string;
|
|
41
|
+
path?: string;
|
|
42
|
+
paths?: string[];
|
|
43
|
+
content?: string;
|
|
44
|
+
patch?: string;
|
|
45
|
+
oldText?: string;
|
|
46
|
+
newText?: string;
|
|
47
|
+
fromPath?: string;
|
|
48
|
+
toPath?: string;
|
|
49
|
+
recursive?: boolean;
|
|
50
|
+
pattern?: string;
|
|
51
|
+
query?: string;
|
|
52
|
+
glob?: string;
|
|
53
|
+
fixedStrings?: boolean;
|
|
54
|
+
caseSensitive?: boolean;
|
|
55
|
+
maxResults?: number;
|
|
56
|
+
view?: string;
|
|
57
|
+
beforeContext?: number;
|
|
58
|
+
afterContext?: number;
|
|
59
|
+
maxDepth?: number;
|
|
60
|
+
maxEntries?: number;
|
|
61
|
+
startLine?: number;
|
|
62
|
+
lineCount?: number;
|
|
63
|
+
includeFiles?: boolean;
|
|
64
|
+
maxBytes?: number;
|
|
65
|
+
includeDiff?: boolean;
|
|
66
|
+
staged?: boolean;
|
|
67
|
+
expectedSha256?: string;
|
|
68
|
+
message?: string;
|
|
69
|
+
ref?: string;
|
|
70
|
+
script?: string;
|
|
71
|
+
scriptArgs?: string[];
|
|
72
|
+
branch?: string;
|
|
73
|
+
startPoint?: string;
|
|
74
|
+
command?: string;
|
|
75
|
+
processId?: string;
|
|
76
|
+
signal?: string;
|
|
77
|
+
prompt?: string;
|
|
78
|
+
workflowId?: string;
|
|
79
|
+
format?: string;
|
|
80
|
+
returnMode?: string;
|
|
81
|
+
maxWidth?: number;
|
|
82
|
+
maxHeight?: number;
|
|
83
|
+
workingDirectory?: string;
|
|
84
|
+
timeoutSeconds?: number;
|
|
85
|
+
maxOutputBytes?: number;
|
|
86
|
+
operations?: WorkspaceOperationInput[];
|
|
87
|
+
continueOnError?: boolean;
|
|
88
|
+
}
|
|
89
|
+
export interface WorkspaceOperationEnvelope {
|
|
90
|
+
operation?: WorkspaceOperationName;
|
|
91
|
+
op?: WorkspaceOperationName;
|
|
92
|
+
target?: string;
|
|
93
|
+
input?: Record<string, unknown>;
|
|
94
|
+
options?: Record<string, unknown>;
|
|
95
|
+
}
|
|
96
|
+
export interface ProcessResult {
|
|
97
|
+
exitCode: number | null;
|
|
98
|
+
signal?: string;
|
|
99
|
+
timedOut: boolean;
|
|
100
|
+
stdout: string;
|
|
101
|
+
stderr: string;
|
|
102
|
+
stdoutTruncated?: boolean;
|
|
103
|
+
stderrTruncated?: boolean;
|
|
104
|
+
}
|
|
105
|
+
export declare const workspaceOperationCatalog: WorkspaceOperationCatalogEntry[];
|
|
106
|
+
export declare const workspaceOperationSafety: WorkspaceOperationSafetyEntry[];
|
|
107
|
+
export type WorkspaceOperationCategory = "metadata" | "files" | "search" | "coding" | "git" | "package" | "process" | "codex" | "screen" | "batch";
|
|
108
|
+
export interface WorkspaceOperationRegistryEntry extends WorkspaceOperationCatalogEntry {
|
|
109
|
+
name: WorkspaceOperationName;
|
|
110
|
+
category: WorkspaceOperationCategory;
|
|
111
|
+
boundary: WorkspaceOperationBoundary;
|
|
112
|
+
schema: WorkspaceOperationSchema;
|
|
113
|
+
run: WorkspaceOperationRunRegistration;
|
|
114
|
+
audit: WorkspaceOperationAuditRegistration;
|
|
115
|
+
safetyNote: string;
|
|
116
|
+
capabilities: CapabilityName[];
|
|
117
|
+
limits?: Partial<CapabilityPolicy["limits"]>;
|
|
118
|
+
}
|
|
119
|
+
export interface PublicWorkspaceOperationRunRegistration {
|
|
120
|
+
type: WorkspaceOperationRunRegistration["type"];
|
|
121
|
+
handler: WorkspaceOperationRunRegistration["handler"];
|
|
122
|
+
}
|
|
123
|
+
export type PublicWorkspaceOperationRegistryEntry = Omit<WorkspaceOperationRegistryEntry, "run"> & {
|
|
124
|
+
run: PublicWorkspaceOperationRunRegistration;
|
|
125
|
+
};
|
|
126
|
+
export interface WorkspaceOperationContract {
|
|
127
|
+
version: 1;
|
|
128
|
+
mcp: {
|
|
129
|
+
tool: "workspace_operation";
|
|
130
|
+
requiredFields: ["workspaceId", "op"];
|
|
131
|
+
};
|
|
132
|
+
jsonApi: {
|
|
133
|
+
endpoint: "POST /api/v1/control";
|
|
134
|
+
action: "operation";
|
|
135
|
+
requiredFields: ["action", "workspace", "op"];
|
|
136
|
+
};
|
|
137
|
+
envelope: {
|
|
138
|
+
workspace: string;
|
|
139
|
+
op: WorkspaceOperationName;
|
|
140
|
+
target?: string;
|
|
141
|
+
input: Record<string, unknown>;
|
|
142
|
+
options: Record<string, unknown>;
|
|
143
|
+
};
|
|
144
|
+
targetMapping: Record<string, string>;
|
|
145
|
+
guidance: string[];
|
|
146
|
+
}
|
|
147
|
+
export interface WorkspaceOperationRegistrationInput {
|
|
148
|
+
name: WorkspaceOperationName;
|
|
149
|
+
category: WorkspaceOperationCategory;
|
|
150
|
+
permission: WorkspaceOperationCatalogEntry["permission"];
|
|
151
|
+
boundary: WorkspaceOperationBoundary;
|
|
152
|
+
schema: WorkspaceOperationSchema;
|
|
153
|
+
run: WorkspaceOperationRunRegistration;
|
|
154
|
+
audit: WorkspaceOperationAuditRegistration;
|
|
155
|
+
description: string;
|
|
156
|
+
safetyNote: string;
|
|
157
|
+
capabilities: CapabilityName[];
|
|
158
|
+
limits?: Partial<CapabilityPolicy["limits"]>;
|
|
159
|
+
}
|
|
160
|
+
export declare function registerOperation(input: WorkspaceOperationRegistrationInput): WorkspaceOperationRegistryEntry;
|
|
161
|
+
export declare function buildWorkspaceOperationRegistry(catalog?: readonly WorkspaceOperationCatalogEntry[]): WorkspaceOperationRegistryEntry[];
|
|
162
|
+
export declare const workspaceOperationRegistry: WorkspaceOperationRegistryEntry[];
|
|
163
|
+
export declare function publicWorkspaceOperationRegistry(registry?: readonly WorkspaceOperationRegistryEntry[]): PublicWorkspaceOperationRegistryEntry[];
|
|
164
|
+
export declare const workspaceOperationContract: WorkspaceOperationContract;
|
|
165
|
+
export declare const workspaceOperationRegistryByName: Map<"read" | "write" | "codex" | "stat" | "list" | "list_details" | "explain_operation" | "tree" | "instructions" | "agent_skills" | "coding_context" | "project_overview" | "history" | "history_insight" | "change_summary" | "repo_status" | "git_changes" | "git_diff" | "git_log" | "git_show" | "git_stage" | "git_unstage" | "git_commit" | "git_worktree_list" | "git_worktree_create" | "read_many" | "create_file" | "write_if_unchanged" | "edit" | "patch" | "mkdir" | "delete" | "move" | "find_files" | "search_text" | "search_symbols" | "package_run" | "package_start" | "command" | "process_start" | "process_list" | "process_read" | "process_stop" | "codex_start" | "codex_plan" | "codex_review" | "codex_fix" | "codex_test" | "codex_continue" | "codex_runs" | "screen_list" | "screen_capture" | "screen_capture_window" | "screen_capture_process" | "batch", WorkspaceOperationRegistryEntry>;
|
|
166
|
+
export declare function workspaceOperationEntry(operation: WorkspaceOperationName): WorkspaceOperationRegistryEntry;
|
|
167
|
+
export declare function allowedWorkspaceOperations(permissions: PathPermissions): WorkspaceOperationName[];
|
|
168
|
+
export declare function normalizeWorkspaceOperationInput(body: Record<string, unknown>): WorkspaceOperationInput;
|
|
169
|
+
export declare function runWorkspaceOperation(registry: WorkspaceRegistry, workspace: Workspace, input: WorkspaceOperationInput): Promise<unknown>;
|
|
170
|
+
export declare function workspaceOperationAuditFields(input: WorkspaceOperationInput): Partial<AuditEventInput>;
|