@pmndre/pine 0.0.0-stage → 0.22.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.
Files changed (151) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +226 -2
  3. package/bin/pine.js +27 -0
  4. package/docs/SKILL.md +234 -0
  5. package/docs/references/agents.md +454 -0
  6. package/docs/references/coding.md +311 -0
  7. package/docs/references/computer.md +212 -0
  8. package/docs/references/configuration.md +310 -0
  9. package/docs/references/events.md +267 -0
  10. package/docs/references/mcp.md +420 -0
  11. package/docs/references/operations.md +394 -0
  12. package/docs/references/overview.md +195 -0
  13. package/docs/references/security.md +896 -0
  14. package/docs/references/setup.md +385 -0
  15. package/docs/references/sources.md +772 -0
  16. package/docs/references/stack.md +121 -0
  17. package/docs/references/tui.md +575 -0
  18. package/examples/home/.env.example +7 -0
  19. package/examples/home/USER.md +4 -0
  20. package/examples/home/agents/main/agent.json +4 -0
  21. package/examples/home/agents/main/workspace/AGENTS.md +14 -0
  22. package/examples/home/agents/main/workspace/MEMORY.md +4 -0
  23. package/examples/home/agents/main/workspace/SOUL.md +4 -0
  24. package/examples/home/models.json +62 -0
  25. package/examples/home/pine.json +34 -0
  26. package/examples/home/skills/README.txt +7 -0
  27. package/examples/launchd/com.pine.daemon.plist +32 -0
  28. package/examples/systemd/pine.service +22 -0
  29. package/mcp/browser.d.ts +99 -0
  30. package/mcp/browser.js +496 -0
  31. package/mcp/commands.d.ts +20 -0
  32. package/mcp/commands.js +88 -0
  33. package/mcp/computer.d.ts +139 -0
  34. package/mcp/computer.js +698 -0
  35. package/mcp/computer.swift +989 -0
  36. package/mcp/lib.d.ts +23 -0
  37. package/mcp/lib.js +52 -0
  38. package/mcp/web.d.ts +6 -0
  39. package/mcp/web.js +140 -0
  40. package/package.json +32 -4
  41. package/src/access.d.ts +112 -0
  42. package/src/access.js +438 -0
  43. package/src/actions.d.ts +75 -0
  44. package/src/actions.js +167 -0
  45. package/src/admin.d.ts +167 -0
  46. package/src/admin.js +625 -0
  47. package/src/agent-admin.d.ts +24 -0
  48. package/src/agent-admin.js +55 -0
  49. package/src/agents.d.ts +540 -0
  50. package/src/agents.js +2776 -0
  51. package/src/background.d.ts +29 -0
  52. package/src/background.js +100 -0
  53. package/src/cli.d.ts +2 -0
  54. package/src/cli.js +777 -0
  55. package/src/computer.d.ts +30 -0
  56. package/src/computer.js +32 -0
  57. package/src/config.d.ts +396 -0
  58. package/src/config.js +549 -0
  59. package/src/dev/claude-model.d.ts +37 -0
  60. package/src/dev/claude-model.js +204 -0
  61. package/src/env-file.d.ts +4 -0
  62. package/src/env-file.js +40 -0
  63. package/src/goals.d.ts +133 -0
  64. package/src/goals.js +316 -0
  65. package/src/http.d.ts +46 -0
  66. package/src/http.js +509 -0
  67. package/src/limiter.d.ts +32 -0
  68. package/src/limiter.js +84 -0
  69. package/src/login.d.ts +23 -0
  70. package/src/login.js +130 -0
  71. package/src/manual.d.ts +61 -0
  72. package/src/manual.js +443 -0
  73. package/src/mcp-config.d.ts +49 -0
  74. package/src/mcp-config.js +182 -0
  75. package/src/models.d.ts +90 -0
  76. package/src/models.js +274 -0
  77. package/src/net.d.ts +50 -0
  78. package/src/net.js +150 -0
  79. package/src/pine.d.ts +32 -0
  80. package/src/pine.js +134 -0
  81. package/src/programs.d.ts +123 -0
  82. package/src/programs.js +412 -0
  83. package/src/router.d.ts +56 -0
  84. package/src/router.js +164 -0
  85. package/src/sandbox-fs.d.ts +34 -0
  86. package/src/sandbox-fs.js +186 -0
  87. package/src/sandbox-linux.d.ts +96 -0
  88. package/src/sandbox-linux.js +297 -0
  89. package/src/sandbox-setup.d.ts +70 -0
  90. package/src/sandbox-setup.js +216 -0
  91. package/src/security.d.ts +238 -0
  92. package/src/security.js +660 -0
  93. package/src/skills.d.ts +67 -0
  94. package/src/skills.js +163 -0
  95. package/src/snapshots.d.ts +68 -0
  96. package/src/snapshots.js +306 -0
  97. package/src/source-types.d.ts +61 -0
  98. package/src/source-types.js +1 -0
  99. package/src/sources/command.d.ts +4 -0
  100. package/src/sources/command.js +77 -0
  101. package/src/sources/folder.d.ts +6 -0
  102. package/src/sources/folder.js +116 -0
  103. package/src/sources/ftp.d.ts +4 -0
  104. package/src/sources/ftp.js +307 -0
  105. package/src/sources/http.d.ts +4 -0
  106. package/src/sources/http.js +201 -0
  107. package/src/sources/mqtt.d.ts +18 -0
  108. package/src/sources/mqtt.js +97 -0
  109. package/src/sources/telegram.d.ts +22 -0
  110. package/src/sources/telegram.js +283 -0
  111. package/src/sources/webhook.d.ts +4 -0
  112. package/src/sources/webhook.js +52 -0
  113. package/src/sources.d.ts +344 -0
  114. package/src/sources.js +966 -0
  115. package/src/store.d.ts +99 -0
  116. package/src/store.js +277 -0
  117. package/src/timers.d.ts +83 -0
  118. package/src/timers.js +318 -0
  119. package/src/tools.d.ts +11 -0
  120. package/src/tools.js +1297 -0
  121. package/src/tui/app.d.ts +305 -0
  122. package/src/tui/app.js +3195 -0
  123. package/src/tui/client.d.ts +236 -0
  124. package/src/tui/client.js +131 -0
  125. package/src/tui/code-pane.d.ts +68 -0
  126. package/src/tui/code-pane.js +535 -0
  127. package/src/tui/highlight.d.ts +8 -0
  128. package/src/tui/highlight.js +86 -0
  129. package/src/tui/picture.d.ts +206 -0
  130. package/src/tui/picture.js +801 -0
  131. package/src/tui/run.d.ts +8 -0
  132. package/src/tui/run.js +97 -0
  133. package/src/tui/theme.d.ts +32 -0
  134. package/src/tui/theme.js +128 -0
  135. package/src/tui/undo.d.ts +5 -0
  136. package/src/tui/undo.js +50 -0
  137. package/src/tui/voice.d.ts +49 -0
  138. package/src/tui/voice.js +155 -0
  139. package/src/tui/voice.swift +223 -0
  140. package/src/types.d.ts +139 -0
  141. package/src/types.js +1 -0
  142. package/src/undo.d.ts +224 -0
  143. package/src/undo.js +465 -0
  144. package/src/update.d.ts +35 -0
  145. package/src/update.js +130 -0
  146. package/src/util.d.ts +65 -0
  147. package/src/util.js +171 -0
  148. package/src/watching.d.ts +20 -0
  149. package/src/watching.js +68 -0
  150. package/src/workspace-view.d.ts +72 -0
  151. package/src/workspace-view.js +221 -0
@@ -0,0 +1,62 @@
1
+ {
2
+ "providers": {
3
+ "local": {
4
+ "name": "llama-server",
5
+ "baseUrl": "http://127.0.0.1:8080/v1",
6
+ "api": "openai-completions",
7
+ "apiKey": "none",
8
+ "models": [
9
+ {
10
+ "id": "deepseek-v4.1-flash",
11
+ "name": "DeepSeek V4.1 Flash (local)",
12
+ "contextWindow": 65536,
13
+ "maxTokens": 8192,
14
+ "input": [
15
+ "text"
16
+ ],
17
+ "reasoning": true,
18
+ "cost": {
19
+ "input": 0,
20
+ "output": 0,
21
+ "cacheRead": 0,
22
+ "cacheWrite": 0
23
+ },
24
+ "compat": {
25
+ "supportsStore": false,
26
+ "supportsDeveloperRole": false,
27
+ "maxTokensField": "max_tokens",
28
+ "thinkingFormat": "deepseek"
29
+ }
30
+ }
31
+ ]
32
+ },
33
+ "dev": {
34
+ "name": "claude -p (pine dev-model)",
35
+ "baseUrl": "http://127.0.0.1:7464/v1",
36
+ "api": "openai-completions",
37
+ "apiKey": "none",
38
+ "models": [
39
+ {
40
+ "id": "claude-haiku",
41
+ "name": "Claude Haiku via claude -p",
42
+ "contextWindow": 180000,
43
+ "maxTokens": 8192,
44
+ "input": [
45
+ "text"
46
+ ],
47
+ "cost": {
48
+ "input": 0,
49
+ "output": 0,
50
+ "cacheRead": 0,
51
+ "cacheWrite": 0
52
+ },
53
+ "compat": {
54
+ "supportsStore": false,
55
+ "supportsDeveloperRole": false,
56
+ "supportsReasoningEffort": false
57
+ }
58
+ }
59
+ ]
60
+ }
61
+ }
62
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "main": "main",
3
+ "defaults": {
4
+ "model": "dev/claude-haiku",
5
+ "thinking": "off"
6
+ },
7
+ "limits": {
8
+ "maxConcurrentRuns": 2
9
+ },
10
+ "http": {
11
+ "host": "127.0.0.1",
12
+ "port": 7463,
13
+ "hooks": {}
14
+ },
15
+ "mcp": {
16
+ "web": {
17
+ "pine": "web",
18
+ "description": "Search the web and read pages",
19
+ "options": { "braveApiKey": "${BRAVE_API_KEY:-}" }
20
+ },
21
+ "browser": {
22
+ "pine": "browser",
23
+ "description": "A real browser for pages that need JavaScript, clicks or forms",
24
+ "options": { "headed": false }
25
+ },
26
+ "computer": {
27
+ "pine": "computer",
28
+ "description": "Operate the apps on this Mac: read their windows, click, type (macOS only; asks you once per app)"
29
+ }
30
+ },
31
+ "sources": {},
32
+ "routes": [],
33
+ "schedules": []
34
+ }
@@ -0,0 +1,7 @@
1
+ Skills in this folder are available to every agent. Nothing has to be listed anywhere.
2
+
3
+ One folder per skill, each with a SKILL.md that starts with a name and a description.
4
+ The main agent adds skills here when you ask it for one "for all agents" (add_skill).
5
+ Skills for a single agent are in agents/<id>/skills/.
6
+
7
+ pine skills lists every skill and whom it is for
@@ -0,0 +1,32 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <!--
4
+ Starts pine at login and restarts it if it exits.
5
+ 1. Replace /Users/YOU and the node path (run: which node).
6
+ 2. Copy to ~/Library/LaunchAgents/com.pine.daemon.plist
7
+ 3. launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.pine.daemon.plist
8
+ Stop: launchctl bootout gui/$(id -u)/com.pine.daemon
9
+ -->
10
+ <plist version="1.0">
11
+ <dict>
12
+ <key>Label</key><string>com.pine.daemon</string>
13
+ <key>ProgramArguments</key>
14
+ <array>
15
+ <string>/opt/homebrew/bin/node</string>
16
+ <string>/Users/YOU/dev/pine/src/cli.ts</string>
17
+ <string>start</string>
18
+ <string>--home</string>
19
+ <string>/Users/YOU/.pine</string>
20
+ </array>
21
+ <key>EnvironmentVariables</key>
22
+ <dict>
23
+ <key>PATH</key><string>/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
24
+ </dict>
25
+ <key>RunAtLoad</key><true/>
26
+ <key>KeepAlive</key><true/>
27
+ <key>ThrottleInterval</key><integer>10</integer>
28
+ <key>ProcessType</key><string>Background</string>
29
+ <key>StandardOutPath</key><string>/Users/YOU/.pine/data/pine.out.log</string>
30
+ <key>StandardErrorPath</key><string>/Users/YOU/.pine/data/pine.log</string>
31
+ </dict>
32
+ </plist>
@@ -0,0 +1,22 @@
1
+ # Starts pine at login and restarts it if it exits (a systemd user service).
2
+ # 1. Replace the node path (run: which node) and the path to pine.
3
+ # 2. Copy to ~/.config/systemd/user/pine.service
4
+ # 3. systemctl --user daemon-reload && systemctl --user enable --now pine
5
+ # To keep it running while you are logged out: loginctl enable-linger $USER
6
+ # Stop: systemctl --user disable --now pine
7
+ # Logs: journalctl --user -u pine -f
8
+ #
9
+ # Do not add RestrictNamespaces= or PrivateUsers= here: the agent sandbox (bubblewrap)
10
+ # needs user namespaces, and pine would withhold the shell tool without it.
11
+ [Unit]
12
+ Description=pine agent daemon
13
+ After=network-online.target
14
+
15
+ [Service]
16
+ ExecStart=/usr/bin/node %h/dev/pine/src/cli.ts start --home %h/.pine
17
+ Environment=PATH=/usr/local/bin:/usr/bin:/bin
18
+ Restart=always
19
+ RestartSec=10
20
+
21
+ [Install]
22
+ WantedBy=default.target
@@ -0,0 +1,99 @@
1
+ import { type ChildProcess } from "node:child_process";
2
+ interface BrowserOptions {
3
+ headed?: boolean;
4
+ /** Folder for a persistent profile (cookies, logins). Default: a fresh profile every time. */
5
+ profile?: string;
6
+ tools?: "core" | "all" | string[];
7
+ block?: string[];
8
+ /** false: a screenshot comes back without its picture. For a model that cannot see. Default true. */
9
+ images?: boolean;
10
+ allowHosts?: string[];
11
+ denyHosts?: string[];
12
+ allowPrivate?: boolean;
13
+ /**
14
+ * Set by pine, not by the owner: a file in pine's home with the local addresses ("host:port")
15
+ * the owner allowed for this conversation. Agents cannot write there.
16
+ */
17
+ localFile?: string;
18
+ /**
19
+ * Set by pine, not by the owner: this is one of the owner's own conversations, so the agent may
20
+ * put the browser on the owner's screen (browser_show, browser_hide).
21
+ */
22
+ window?: boolean;
23
+ browser?: string;
24
+ executablePath?: string;
25
+ caps?: string;
26
+ viewport?: string;
27
+ extraArgs?: string[];
28
+ }
29
+ /** Never offered: they execute code in this process or hand local files to a page. */
30
+ export declare const ALWAYS_BLOCKED: string[];
31
+ /** pine's own: the browser as a window on the owner's screen. */
32
+ export declare const WINDOW_TOOLS: {
33
+ name: string;
34
+ description: string;
35
+ inputSchema: {
36
+ type: string;
37
+ properties: {};
38
+ };
39
+ }[];
40
+ /** Enough to read and operate a page; keeps the tool list short for small models. */
41
+ export declare const CORE_TOOLS: string[];
42
+ export declare function toolAllowed(name: string, o: Pick<BrowserOptions, "tools" | "block" | "window" | "caps">): boolean;
43
+ type GuardOptions = Pick<BrowserOptions, "allowHosts" | "denyHosts" | "allowPrivate" | "localFile">;
44
+ /** What the agent is told when a local address is refused in a conversation where the owner can be asked. */
45
+ export declare const ASK_HINT = "A local address needs your owner's yes. Open it with browser_navigate (for example http://localhost:3000) and your owner is asked";
46
+ /**
47
+ * Resolve a host and return what the browser may connect to, or throw. For a public name that is
48
+ * the address it resolved to; for a local address the owner allowed (host and port), the host as given.
49
+ */
50
+ export declare function vet(host: string, o: GuardOptions, port?: number): Promise<string>;
51
+ /** A forward proxy that only lets vetted destinations through. */
52
+ export declare function startGuardProxy(o: GuardOptions, log?: (line: string) => void): Promise<{
53
+ port: number;
54
+ refused: string[];
55
+ close: () => Promise<void>;
56
+ }>;
57
+ /**
58
+ * Playwright writes page snapshots and logs to files and returns links to them. An agent cannot
59
+ * follow those links, so put the content of files from the scratch folder into the result itself.
60
+ */
61
+ export declare function inlineFiles(text: string, scratch: string, limit?: number): string;
62
+ export interface Tabs {
63
+ tabs: Array<{
64
+ title: string;
65
+ url: string;
66
+ }>;
67
+ current: number;
68
+ }
69
+ /** Playwright's list of tabs ("- 0: (current) [Title](address)"), read. */
70
+ export declare function readTabs(text: string): Tabs;
71
+ /**
72
+ * Which tab somebody other than the agent changed, if any: a tab that was not there (the last
73
+ * such one), else the agent's own tab if its address is another now, else another tab whose
74
+ * address changed. Undefined when everything is as the agent last saw it.
75
+ */
76
+ export declare function changedTab(before: Tabs, now: Tabs): number | undefined;
77
+ export interface BrowserServer {
78
+ /** Starts Playwright's server, with a window or without. */
79
+ launch(headed: boolean): ChildProcess;
80
+ /** One message for the client. */
81
+ send(msg: unknown): void;
82
+ /** A folder the browser may write into; a login is kept there for the moment of a restart. */
83
+ scratch: string;
84
+ /** What the guard refused, newest last. */
85
+ refused: string[];
86
+ /** Playwright's server ended by itself. */
87
+ ended(): void;
88
+ }
89
+ /**
90
+ * The conversation between pine and Playwright's server: the tool list is filtered, blocked calls
91
+ * are refused, calls run one after another, and the browser is restarted when its window is to
92
+ * appear or to go. Returns what takes the client's lines.
93
+ */
94
+ export declare function relay(o: BrowserOptions, io: BrowserServer): {
95
+ line(line: string): void;
96
+ close(): void;
97
+ child(): ChildProcess;
98
+ };
99
+ export {};