@dna113p/machines 0.1.0 → 0.3.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 +120 -4
- package/claude/statusline.mjs +244 -0
- package/dist/examples/agy.d.ts +1 -0
- package/dist/examples/agy.js +30 -0
- package/dist/examples/chatgpt-web.d.ts +1 -0
- package/dist/examples/chatgpt-web.js +36 -0
- package/dist/examples/claude.d.ts +1 -0
- package/dist/examples/claude.js +30 -0
- package/dist/examples/codex.d.ts +1 -0
- package/dist/examples/codex.js +30 -0
- package/dist/examples/decision.d.ts +1 -0
- package/dist/examples/decision.js +66 -0
- package/dist/examples/deepseek.d.ts +1 -0
- package/dist/examples/deepseek.js +27 -0
- package/dist/mcp/server.d.ts +1 -0
- package/dist/mcp/server.js +72 -10
- package/dist/pi-extension/index.js +16 -9
- package/dist/src/acp.js +4 -41
- package/dist/src/agent-bindings.d.ts +6 -0
- package/dist/src/agent-bindings.js +35 -5
- package/dist/src/agent-limit.d.ts +25 -0
- package/dist/src/agent-limit.js +34 -0
- package/dist/src/agent-limits.d.ts +37 -0
- package/dist/src/agent-limits.js +212 -0
- package/dist/src/agent-protocol.d.ts +6 -0
- package/dist/src/agent-protocol.js +40 -0
- package/dist/src/agy.d.ts +11 -0
- package/dist/src/agy.js +168 -0
- package/dist/src/catalog.d.ts +3 -0
- package/dist/src/catalog.js +94 -12
- package/dist/src/chatgpt-web.d.ts +143 -0
- package/dist/src/chatgpt-web.js +946 -0
- package/dist/src/claude.d.ts +35 -0
- package/dist/src/claude.js +294 -0
- package/dist/src/cli.js +194 -16
- package/dist/src/codex.d.ts +16 -0
- package/dist/src/codex.js +176 -0
- package/dist/src/conversation.d.ts +74 -0
- package/dist/src/conversation.js +46 -0
- package/dist/src/coordinator-guidance.d.ts +3 -0
- package/dist/src/coordinator-guidance.js +17 -0
- package/dist/src/decision.d.ts +29 -0
- package/dist/src/decision.js +67 -0
- package/dist/src/deepseek.d.ts +12 -0
- package/dist/src/deepseek.js +16 -0
- package/dist/src/host.d.ts +3 -0
- package/dist/src/host.js +68 -7
- package/dist/src/index.d.ts +39 -2
- package/dist/src/index.js +62 -5
- package/dist/src/jev.d.ts +15 -0
- package/dist/src/jev.js +90 -0
- package/dist/src/json.d.ts +6 -0
- package/dist/src/json.js +28 -0
- package/dist/src/launcher.d.ts +11 -1
- package/dist/src/launcher.js +72 -3
- package/dist/src/laya.d.ts +15 -0
- package/dist/src/laya.js +13 -0
- package/dist/src/openrouter.d.ts +16 -0
- package/dist/src/openrouter.js +97 -0
- package/dist/src/run-inbox.d.ts +49 -0
- package/dist/src/run-inbox.js +229 -0
- package/dist/src/run-status.d.ts +97 -0
- package/dist/src/run-status.js +285 -0
- package/dist/src/session.d.ts +13 -0
- package/dist/src/session.js +41 -3
- package/dist/src/system-one-http.d.ts +25 -0
- package/dist/src/system-one-http.js +146 -0
- package/dist/src/terminal-human.d.ts +8 -1
- package/dist/src/terminal-human.js +36 -8
- package/dist/src/von.d.ts +15 -0
- package/dist/src/von.js +13 -0
- package/docs/architecture.md +69 -2
- package/docs/authoring.md +849 -2
- package/docs/integrations.md +243 -3
- package/docs/local-decisions.md +212 -0
- package/package.json +23 -4
- package/services/laya/server.py +230 -0
- package/skills/machine-builder/SKILL.md +56 -6
- package/skills/machine-delegation/SKILL.md +123 -0
- package/skills/machine-delegation/references/delegation-machine.md +90 -0
- package/skills/machine-project-setup/SKILL.md +181 -0
- package/skills/machine-project-setup/references/project-workflows.md +50 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import type { AgentReporter, AgentRequest, Event } from "./index.ts";
|
|
2
|
+
/** CSS selectors for the ChatGPT page. Override them when the web UI changes. */
|
|
3
|
+
export interface ChatGptWebSelectors {
|
|
4
|
+
readonly composer: string;
|
|
5
|
+
readonly send: string;
|
|
6
|
+
readonly stop: string;
|
|
7
|
+
readonly assistant: string;
|
|
8
|
+
readonly plus: string;
|
|
9
|
+
readonly menuItem: string;
|
|
10
|
+
/** A control only a signed-out page shows. Links and buttons labelled "Log in" or "Sign in" also count. */
|
|
11
|
+
readonly signIn: string;
|
|
12
|
+
}
|
|
13
|
+
/** Each list names the page as it is today and as it was before, for accounts a rollout has not reached. */
|
|
14
|
+
export declare const defaultChatGptWebSelectors: ChatGptWebSelectors;
|
|
15
|
+
export interface ChatGptWebBrowserLaunch {
|
|
16
|
+
/** Chromium-family executable. Defaults to `CHATGPT_WEB_BROWSER`, then a PATH search. */
|
|
17
|
+
readonly executable?: string;
|
|
18
|
+
/** Dedicated browser profile holding the ChatGPT login. */
|
|
19
|
+
readonly userDataDir?: string;
|
|
20
|
+
readonly headless?: boolean;
|
|
21
|
+
readonly args?: readonly string[];
|
|
22
|
+
}
|
|
23
|
+
/** Explicit handoff notification recorded by rig-bridge when an assistant finishes a stretch of work. */
|
|
24
|
+
export interface RigBridgeHandoff {
|
|
25
|
+
readonly id: string;
|
|
26
|
+
readonly projectId: string;
|
|
27
|
+
readonly threadId: string;
|
|
28
|
+
readonly runId?: string;
|
|
29
|
+
readonly reason: "completed" | "needs_input" | "blocked" | "failed" | "cancelled" | string;
|
|
30
|
+
readonly summary: string;
|
|
31
|
+
readonly createdAt: number;
|
|
32
|
+
}
|
|
33
|
+
/** Event returned by the ChatGPT Web runner, enriched with handoff and conversation metadata. */
|
|
34
|
+
export interface ChatGptWebEvent extends Event {
|
|
35
|
+
readonly type: string;
|
|
36
|
+
readonly summary?: string;
|
|
37
|
+
readonly message?: string;
|
|
38
|
+
readonly handoff?: RigBridgeHandoff;
|
|
39
|
+
/** The chat's lasting address. Absent when ChatGPT did not show one before the run ended. */
|
|
40
|
+
readonly conversation?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface RigBridgeStatusView {
|
|
43
|
+
readonly version?: string;
|
|
44
|
+
readonly startedAt?: number;
|
|
45
|
+
readonly uptimeSeconds?: number;
|
|
46
|
+
readonly workspacesCount?: number;
|
|
47
|
+
readonly activeCommandsCount?: number;
|
|
48
|
+
readonly workspaces: readonly {
|
|
49
|
+
readonly id: string;
|
|
50
|
+
readonly projectId?: string;
|
|
51
|
+
readonly threadId?: string;
|
|
52
|
+
readonly cwd: string;
|
|
53
|
+
readonly createdAt?: number;
|
|
54
|
+
}[];
|
|
55
|
+
readonly notifications?: readonly RigBridgeHandoff[];
|
|
56
|
+
readonly unreadCount?: number;
|
|
57
|
+
}
|
|
58
|
+
export interface ChatGptWebAgentOptions {
|
|
59
|
+
readonly env?: Readonly<Record<string, string>>;
|
|
60
|
+
readonly harness?: string;
|
|
61
|
+
/** Start page: ChatGPT, a Project, or a GPT. Defaults to `CHATGPT_WEB_URL` or https://chatgpt.com/. */
|
|
62
|
+
readonly url?: string;
|
|
63
|
+
/** Model slug appended as `?model=`. Defaults to `CHATGPT_WEB_MODEL`. */
|
|
64
|
+
readonly model?: string;
|
|
65
|
+
/** DevTools endpoint. Defaults to `CHATGPT_WEB_CDP_URL` or http://127.0.0.1:9222. */
|
|
66
|
+
readonly cdpUrl?: string;
|
|
67
|
+
/** Launch a persistent, detached browser when the endpoint is unreachable. Defaults to true. */
|
|
68
|
+
readonly launch?: boolean | ChatGptWebBrowserLaunch;
|
|
69
|
+
/**
|
|
70
|
+
* Name the rig-bridge app has in this person's ChatGPT, matched against the text of the composer's add menu.
|
|
71
|
+
* Defaults to `CHATGPT_WEB_CONNECTOR` or "rig-bridge".
|
|
72
|
+
*/
|
|
73
|
+
readonly connector?: string;
|
|
74
|
+
/** Try to enable the connector from the composer's + menu. Defaults to true. */
|
|
75
|
+
readonly selectConnector?: boolean;
|
|
76
|
+
/** Click visible tool confirmation buttons. Defaults to false. */
|
|
77
|
+
readonly approveToolCalls?: boolean;
|
|
78
|
+
readonly approveLabels?: readonly string[];
|
|
79
|
+
/** rig-bridge status endpoint used for activity, or false. Defaults to `RIG_BRIDGE_STATUS_URL` or :8767. */
|
|
80
|
+
readonly bridgeStatusUrl?: string | false;
|
|
81
|
+
/** Automatically mark handoff notifications read on rig-bridge when completed. Defaults to true. */
|
|
82
|
+
readonly acknowledgeHandoff?: boolean;
|
|
83
|
+
readonly timeoutMs?: number;
|
|
84
|
+
/** How long the composer may take to appear after the tab opens. Defaults to 45 seconds. */
|
|
85
|
+
readonly composerTimeoutMs?: number;
|
|
86
|
+
/** Quiet period after generation stops before the reply is treated as final. */
|
|
87
|
+
readonly settleMs?: number;
|
|
88
|
+
readonly pollMs?: number;
|
|
89
|
+
/** Keep the tab after success. Failed runs always keep their tab for inspection. */
|
|
90
|
+
readonly keepTab?: boolean;
|
|
91
|
+
readonly selectors?: Partial<ChatGptWebSelectors>;
|
|
92
|
+
readonly output?: "capture" | "stream";
|
|
93
|
+
}
|
|
94
|
+
/** Finds a Chromium-family browser able to expose the DevTools protocol. */
|
|
95
|
+
export declare function findChromeExecutable(env?: Readonly<Record<string, string | undefined>>): Promise<string | undefined>;
|
|
96
|
+
export declare function defaultChatGptWebProfile(env?: Readonly<Record<string, string | undefined>>): string;
|
|
97
|
+
/** Builds the conversation opener that points ChatGPT at the local workspace through rig-bridge. */
|
|
98
|
+
export declare function chatGptWebPrompt(request: AgentRequest & {
|
|
99
|
+
readonly cwd: string;
|
|
100
|
+
}, connector: string): string;
|
|
101
|
+
export type ChatGptWebAgentRunner = (request: AgentRequest, report?: AgentReporter) => Promise<ChatGptWebEvent>;
|
|
102
|
+
/** One message for an existing ChatGPT web conversation that works in `cwd` through rig-bridge. */
|
|
103
|
+
export interface ChatGptWebContinueInput {
|
|
104
|
+
/** Conversation URL, such as the `conversation` of an earlier ChatGPT Web event. */
|
|
105
|
+
readonly conversation: string;
|
|
106
|
+
/** Message to send. It is submitted exactly as given. */
|
|
107
|
+
readonly text: string;
|
|
108
|
+
readonly cwd: string;
|
|
109
|
+
/** Only count a handoff from this rig-bridge thread. */
|
|
110
|
+
readonly bridgeThreadId?: string;
|
|
111
|
+
}
|
|
112
|
+
export type ChatGptWebContinueRunner = (input: ChatGptWebContinueInput, report?: AgentReporter) => Promise<ChatGptWebEvent>;
|
|
113
|
+
/** Runs one fresh ChatGPT web conversation that works in the request's directory via rig-bridge. */
|
|
114
|
+
export declare function chatGptWebAgent(options?: ChatGptWebAgentOptions): ChatGptWebAgentRunner;
|
|
115
|
+
/**
|
|
116
|
+
* Sends one message to an existing ChatGPT web conversation and returns the next rig-bridge handoff.
|
|
117
|
+
* The handoff is the whole result: assistant messages are never read from the page.
|
|
118
|
+
*/
|
|
119
|
+
export declare function chatGptWebContinue(options?: ChatGptWebAgentOptions): ChatGptWebContinueRunner;
|
|
120
|
+
/** Fetches the latest bridge status from rig-bridge. */
|
|
121
|
+
export declare function fetchRigBridgeStatus(statusUrl?: string): Promise<RigBridgeStatusView | undefined>;
|
|
122
|
+
/** Finds the most recent handoff notification from rig-bridge matching the given directory or thread. */
|
|
123
|
+
export declare function fetchLatestRigBridgeHandoff(options?: {
|
|
124
|
+
readonly cwd?: string;
|
|
125
|
+
readonly threadId?: string;
|
|
126
|
+
readonly statusUrl?: string;
|
|
127
|
+
readonly since?: number;
|
|
128
|
+
}): Promise<RigBridgeHandoff | undefined>;
|
|
129
|
+
/** Acknowledges / marks read a handoff on rig-bridge. */
|
|
130
|
+
export declare function acknowledgeRigBridgeHandoff(handoffId: string, options?: {
|
|
131
|
+
readonly statusUrl?: string;
|
|
132
|
+
}): Promise<boolean>;
|
|
133
|
+
/**
|
|
134
|
+
* Creates an Operation for a Machine that inspects rig-bridge for the latest handoff notification,
|
|
135
|
+
* returning an Event with `type = handoff.reason` and attaching `summary` and `handoff`.
|
|
136
|
+
*/
|
|
137
|
+
export declare function rigBridgeHandoffOperation(options?: {
|
|
138
|
+
readonly cwd?: string;
|
|
139
|
+
readonly threadId?: string;
|
|
140
|
+
readonly statusUrl?: string;
|
|
141
|
+
readonly since?: number;
|
|
142
|
+
readonly acknowledge?: boolean;
|
|
143
|
+
}): () => Promise<ChatGptWebEvent>;
|