@pmndre/pine 0.0.0-stage → 0.22.1
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 +226 -2
- package/bin/pine.js +27 -0
- package/docs/SKILL.md +234 -0
- package/docs/references/agents.md +454 -0
- package/docs/references/coding.md +311 -0
- package/docs/references/computer.md +212 -0
- package/docs/references/configuration.md +310 -0
- package/docs/references/events.md +267 -0
- package/docs/references/mcp.md +420 -0
- package/docs/references/operations.md +394 -0
- package/docs/references/overview.md +195 -0
- package/docs/references/security.md +896 -0
- package/docs/references/setup.md +385 -0
- package/docs/references/sources.md +772 -0
- package/docs/references/stack.md +121 -0
- package/docs/references/tui.md +575 -0
- package/examples/home/.env.example +7 -0
- package/examples/home/USER.md +4 -0
- package/examples/home/agents/main/agent.json +4 -0
- package/examples/home/agents/main/workspace/AGENTS.md +14 -0
- package/examples/home/agents/main/workspace/MEMORY.md +4 -0
- package/examples/home/agents/main/workspace/SOUL.md +4 -0
- package/examples/home/models.json +62 -0
- package/examples/home/pine.json +34 -0
- package/examples/home/skills/README.txt +7 -0
- package/examples/launchd/com.pine.daemon.plist +32 -0
- package/examples/systemd/pine.service +22 -0
- package/mcp/browser.d.ts +99 -0
- package/mcp/browser.js +496 -0
- package/mcp/commands.d.ts +20 -0
- package/mcp/commands.js +88 -0
- package/mcp/computer.d.ts +139 -0
- package/mcp/computer.js +698 -0
- package/mcp/computer.swift +989 -0
- package/mcp/lib.d.ts +23 -0
- package/mcp/lib.js +52 -0
- package/mcp/web.d.ts +6 -0
- package/mcp/web.js +140 -0
- package/package.json +32 -4
- package/src/access.d.ts +112 -0
- package/src/access.js +438 -0
- package/src/actions.d.ts +75 -0
- package/src/actions.js +167 -0
- package/src/admin.d.ts +167 -0
- package/src/admin.js +625 -0
- package/src/agent-admin.d.ts +24 -0
- package/src/agent-admin.js +55 -0
- package/src/agents.d.ts +540 -0
- package/src/agents.js +2776 -0
- package/src/background.d.ts +29 -0
- package/src/background.js +100 -0
- package/src/cli.d.ts +2 -0
- package/src/cli.js +777 -0
- package/src/computer.d.ts +30 -0
- package/src/computer.js +32 -0
- package/src/config.d.ts +396 -0
- package/src/config.js +549 -0
- package/src/dev/claude-model.d.ts +37 -0
- package/src/dev/claude-model.js +204 -0
- package/src/env-file.d.ts +4 -0
- package/src/env-file.js +40 -0
- package/src/goals.d.ts +133 -0
- package/src/goals.js +316 -0
- package/src/http.d.ts +46 -0
- package/src/http.js +509 -0
- package/src/limiter.d.ts +32 -0
- package/src/limiter.js +84 -0
- package/src/login.d.ts +23 -0
- package/src/login.js +130 -0
- package/src/manual.d.ts +61 -0
- package/src/manual.js +443 -0
- package/src/mcp-config.d.ts +49 -0
- package/src/mcp-config.js +182 -0
- package/src/models.d.ts +90 -0
- package/src/models.js +274 -0
- package/src/net.d.ts +50 -0
- package/src/net.js +150 -0
- package/src/pine.d.ts +32 -0
- package/src/pine.js +134 -0
- package/src/programs.d.ts +123 -0
- package/src/programs.js +412 -0
- package/src/router.d.ts +56 -0
- package/src/router.js +164 -0
- package/src/sandbox-fs.d.ts +34 -0
- package/src/sandbox-fs.js +186 -0
- package/src/sandbox-linux.d.ts +96 -0
- package/src/sandbox-linux.js +297 -0
- package/src/sandbox-setup.d.ts +70 -0
- package/src/sandbox-setup.js +216 -0
- package/src/security.d.ts +238 -0
- package/src/security.js +660 -0
- package/src/skills.d.ts +67 -0
- package/src/skills.js +163 -0
- package/src/snapshots.d.ts +68 -0
- package/src/snapshots.js +306 -0
- package/src/source-types.d.ts +61 -0
- package/src/source-types.js +1 -0
- package/src/sources/command.d.ts +4 -0
- package/src/sources/command.js +77 -0
- package/src/sources/folder.d.ts +6 -0
- package/src/sources/folder.js +116 -0
- package/src/sources/ftp.d.ts +4 -0
- package/src/sources/ftp.js +307 -0
- package/src/sources/http.d.ts +4 -0
- package/src/sources/http.js +201 -0
- package/src/sources/mqtt.d.ts +18 -0
- package/src/sources/mqtt.js +97 -0
- package/src/sources/telegram.d.ts +22 -0
- package/src/sources/telegram.js +283 -0
- package/src/sources/webhook.d.ts +4 -0
- package/src/sources/webhook.js +52 -0
- package/src/sources.d.ts +344 -0
- package/src/sources.js +966 -0
- package/src/store.d.ts +99 -0
- package/src/store.js +277 -0
- package/src/timers.d.ts +83 -0
- package/src/timers.js +318 -0
- package/src/tools.d.ts +11 -0
- package/src/tools.js +1297 -0
- package/src/tui/app.d.ts +305 -0
- package/src/tui/app.js +3195 -0
- package/src/tui/client.d.ts +236 -0
- package/src/tui/client.js +131 -0
- package/src/tui/code-pane.d.ts +68 -0
- package/src/tui/code-pane.js +535 -0
- package/src/tui/highlight.d.ts +8 -0
- package/src/tui/highlight.js +86 -0
- package/src/tui/picture.d.ts +206 -0
- package/src/tui/picture.js +801 -0
- package/src/tui/run.d.ts +8 -0
- package/src/tui/run.js +97 -0
- package/src/tui/theme.d.ts +32 -0
- package/src/tui/theme.js +128 -0
- package/src/tui/undo.d.ts +5 -0
- package/src/tui/undo.js +50 -0
- package/src/tui/voice.d.ts +49 -0
- package/src/tui/voice.js +155 -0
- package/src/tui/voice.swift +223 -0
- package/src/types.d.ts +139 -0
- package/src/types.js +1 -0
- package/src/undo.d.ts +224 -0
- package/src/undo.js +465 -0
- package/src/update.d.ts +35 -0
- package/src/update.js +130 -0
- package/src/util.d.ts +65 -0
- package/src/util.js +171 -0
- package/src/watching.d.ts +20 -0
- package/src/watching.js +68 -0
- package/src/workspace-view.d.ts +72 -0
- package/src/workspace-view.js +221 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { type ChildProcess } from "node:child_process";
|
|
2
|
+
import { type McpContent } from "./lib.ts";
|
|
3
|
+
export interface ComputerOptions {
|
|
4
|
+
/** false: for a model that cannot see. app_screenshot and the tools that take positions in a picture are not offered. Default true. */
|
|
5
|
+
images?: boolean;
|
|
6
|
+
/** The longer side of a picture, in pixels. Default 1280. */
|
|
7
|
+
imageSize?: number;
|
|
8
|
+
/** Tools to leave out. */
|
|
9
|
+
block?: string[];
|
|
10
|
+
/** Set by pine, not by the owner: where the built helper is kept, in pine's home. */
|
|
11
|
+
helperDir?: string;
|
|
12
|
+
/** A program that speaks the helper's protocol, used instead of building one: a path, or a command with its arguments. For development and tests. */
|
|
13
|
+
helper?: string | string[];
|
|
14
|
+
}
|
|
15
|
+
/** Written for a small local model: short, concrete, one thing each. */
|
|
16
|
+
export declare const TOOLS: {
|
|
17
|
+
name: string;
|
|
18
|
+
description: string;
|
|
19
|
+
inputSchema: {
|
|
20
|
+
type: string;
|
|
21
|
+
properties: Record<string, unknown>;
|
|
22
|
+
required: string[];
|
|
23
|
+
};
|
|
24
|
+
annotations?: {
|
|
25
|
+
readOnlyHint: boolean;
|
|
26
|
+
} | undefined;
|
|
27
|
+
}[];
|
|
28
|
+
/** What needs eyes: left out for a model that cannot see. */
|
|
29
|
+
export declare const PICTURE_TOOLS: string[];
|
|
30
|
+
/** macOS only; with a stand-in for the helper, wherever that runs. */
|
|
31
|
+
export declare const available: (o: Pick<ComputerOptions, "helper">, platform?: string) => boolean;
|
|
32
|
+
export declare function unavailable(platform?: string): string;
|
|
33
|
+
export declare function toolsOffered(o: ComputerOptions, platform?: string): {
|
|
34
|
+
name: string;
|
|
35
|
+
description: string;
|
|
36
|
+
inputSchema: {
|
|
37
|
+
type: string;
|
|
38
|
+
properties: Record<string, unknown>;
|
|
39
|
+
required: string[];
|
|
40
|
+
};
|
|
41
|
+
annotations?: {
|
|
42
|
+
readOnlyHint: boolean;
|
|
43
|
+
} | undefined;
|
|
44
|
+
}[];
|
|
45
|
+
export interface Node {
|
|
46
|
+
role: string;
|
|
47
|
+
subrole?: string;
|
|
48
|
+
ref?: string;
|
|
49
|
+
title?: string;
|
|
50
|
+
desc?: string;
|
|
51
|
+
help?: string;
|
|
52
|
+
placeholder?: string;
|
|
53
|
+
value?: string | number;
|
|
54
|
+
/** How many characters of a long text were left out. */
|
|
55
|
+
more?: number;
|
|
56
|
+
disabled?: boolean;
|
|
57
|
+
focused?: boolean;
|
|
58
|
+
selected?: boolean;
|
|
59
|
+
press?: boolean;
|
|
60
|
+
edit?: boolean;
|
|
61
|
+
children?: Node[];
|
|
62
|
+
}
|
|
63
|
+
/** A role as a word a person would use. */
|
|
64
|
+
export declare function roleName(role?: string, subrole?: string): string;
|
|
65
|
+
/**
|
|
66
|
+
* A window as an indented outline. Controls that can be used carry their reference; containers
|
|
67
|
+
* without a name are left out and their content moves up, so that a small model reads a few
|
|
68
|
+
* dozen lines and not the app's whole view hierarchy.
|
|
69
|
+
*/
|
|
70
|
+
export declare function outline(root: Node, limit?: number): string;
|
|
71
|
+
/** "cmd+shift+s return" as the keys to press, in order. Throws a sentence for the model when something is not a key. */
|
|
72
|
+
export declare function parseKeys(text: unknown): Array<{
|
|
73
|
+
key: string;
|
|
74
|
+
mods: string[];
|
|
75
|
+
}>;
|
|
76
|
+
export interface Win {
|
|
77
|
+
index: number;
|
|
78
|
+
ref: string;
|
|
79
|
+
title: string;
|
|
80
|
+
minimized?: boolean;
|
|
81
|
+
main?: boolean;
|
|
82
|
+
x?: number;
|
|
83
|
+
y?: number;
|
|
84
|
+
w?: number;
|
|
85
|
+
h?: number;
|
|
86
|
+
}
|
|
87
|
+
/** The window somebody means: by number, or by a part of its title. Nothing asked for: none, and the helper takes the front one. */
|
|
88
|
+
export declare function pickWindow(windows: Win[], want: unknown): Win | undefined;
|
|
89
|
+
/** What a picture shows: its size in pixels, and the part of the screen it is a picture of, in screen points. */
|
|
90
|
+
export interface Picture {
|
|
91
|
+
width: number;
|
|
92
|
+
height: number;
|
|
93
|
+
x: number;
|
|
94
|
+
y: number;
|
|
95
|
+
w: number;
|
|
96
|
+
h: number;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* A position in a picture as a point on the screen. The picture may be smaller than what it
|
|
100
|
+
* shows (a Retina window has twice the pixels, and pictures are scaled down for the model), and
|
|
101
|
+
* what it shows may lie anywhere on the plane of the displays, so both are a matter of ratio and offset.
|
|
102
|
+
*/
|
|
103
|
+
export declare function toScreen(p: Picture, px: number, py: number): {
|
|
104
|
+
x: number;
|
|
105
|
+
y: number;
|
|
106
|
+
};
|
|
107
|
+
export interface ComputerIo {
|
|
108
|
+
/** Starts the helper. Rejects with a sentence for the agent when there is none to start. */
|
|
109
|
+
launch(): Promise<ChildProcess>;
|
|
110
|
+
/** A folder for pictures on their way to the model. */
|
|
111
|
+
scratch: string;
|
|
112
|
+
/** How long a call waits for the helper to be built before it says "try again", in milliseconds. */
|
|
113
|
+
patience?: number;
|
|
114
|
+
}
|
|
115
|
+
export declare const BUILDING = "pine is building its helper for app control. That happens once and takes about half a minute. Try again in a moment.";
|
|
116
|
+
/** What the agent is told when macOS has not been told to let pine in. Plain words, and where to click. */
|
|
117
|
+
export declare function grantText(kind: "accessibility" | "screen", host: string | undefined, shown: boolean): string;
|
|
118
|
+
type Result = string | McpContent[];
|
|
119
|
+
/**
|
|
120
|
+
* The tools, on top of a helper that is started when the first one is used. Calls run one after
|
|
121
|
+
* another: there is one mouse and one keyboard.
|
|
122
|
+
*/
|
|
123
|
+
export declare function computer(o: ComputerOptions, io: ComputerIo): {
|
|
124
|
+
call(name: string, args: Record<string, any>): Promise<Result>;
|
|
125
|
+
close(): void;
|
|
126
|
+
};
|
|
127
|
+
export declare const HELPER_SOURCE: string;
|
|
128
|
+
export declare const NO_COMPILER = "App control needs Apple's command line developer tools, once, to build its helper, and they are not installed on this Mac. Your owner installs them by typing this into a terminal: xcode-select --install (macOS then shows a window to confirm; it takes a few minutes). Tell your owner this, and try again when they say it is done.";
|
|
129
|
+
type Run = (file: string, args: string[], ms: number) => Promise<{
|
|
130
|
+
code: number;
|
|
131
|
+
stdout: string;
|
|
132
|
+
stderr: string;
|
|
133
|
+
}>;
|
|
134
|
+
/**
|
|
135
|
+
* The helper as a program: built from its source the first time, then found again by the
|
|
136
|
+
* source's hash, so an update of pine builds a new one. Rejects with a sentence for the agent.
|
|
137
|
+
*/
|
|
138
|
+
export declare function buildHelper(dir: string, source?: string, run?: Run): Promise<string>;
|
|
139
|
+
export {};
|