@pmndrs/pine 0.0.0-stage → 0.1.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 +180 -2
- package/bin/pine.js +27 -0
- package/docs/SKILL.md +189 -0
- package/docs/references/agents.md +368 -0
- package/docs/references/coding.md +126 -0
- package/docs/references/configuration.md +229 -0
- package/docs/references/events.md +263 -0
- package/docs/references/mcp.md +257 -0
- package/docs/references/operations.md +280 -0
- package/docs/references/overview.md +186 -0
- package/docs/references/security.md +489 -0
- package/docs/references/setup.md +181 -0
- package/docs/references/sources.md +768 -0
- package/docs/references/stack.md +105 -0
- package/docs/references/tui.md +348 -0
- package/examples/home/.env.example +5 -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 +30 -0
- package/examples/home/skills/README.txt +7 -0
- package/examples/launchd/com.pine.daemon.plist +32 -0
- package/mcp/browser.d.ts +34 -0
- package/mcp/browser.js +228 -0
- package/mcp/commands.d.ts +20 -0
- package/mcp/commands.js +88 -0
- package/mcp/lib.d.ts +13 -0
- package/mcp/lib.js +50 -0
- package/mcp/web.d.ts +6 -0
- package/mcp/web.js +140 -0
- package/package.json +32 -4
- package/src/agent-admin.d.ts +24 -0
- package/src/agent-admin.js +55 -0
- package/src/agents.d.ts +343 -0
- package/src/agents.js +1587 -0
- package/src/cli.d.ts +2 -0
- package/src/cli.js +526 -0
- package/src/config.d.ts +351 -0
- package/src/config.js +514 -0
- package/src/dev/claude-model.d.ts +28 -0
- package/src/dev/claude-model.js +174 -0
- package/src/env-file.d.ts +4 -0
- package/src/env-file.js +40 -0
- package/src/http.d.ts +46 -0
- package/src/http.js +407 -0
- package/src/limiter.d.ts +32 -0
- package/src/limiter.js +84 -0
- package/src/login.d.ts +21 -0
- package/src/login.js +126 -0
- package/src/manual.d.ts +61 -0
- package/src/manual.js +425 -0
- package/src/mcp-config.d.ts +40 -0
- package/src/mcp-config.js +132 -0
- package/src/net.d.ts +36 -0
- package/src/net.js +122 -0
- package/src/pine.d.ts +32 -0
- package/src/pine.js +142 -0
- package/src/router.d.ts +56 -0
- package/src/router.js +164 -0
- package/src/sandbox-fs.d.ts +27 -0
- package/src/sandbox-fs.js +172 -0
- package/src/security.d.ts +121 -0
- package/src/security.js +363 -0
- package/src/skills.d.ts +67 -0
- package/src/skills.js +163 -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 +269 -0
- package/src/sources/webhook.d.ts +4 -0
- package/src/sources/webhook.js +52 -0
- package/src/sources.d.ts +339 -0
- package/src/sources.js +955 -0
- package/src/store.d.ts +89 -0
- package/src/store.js +251 -0
- package/src/timers.d.ts +83 -0
- package/src/timers.js +318 -0
- package/src/tools.d.ts +6 -0
- package/src/tools.js +777 -0
- package/src/tui/app.d.ts +209 -0
- package/src/tui/app.js +2223 -0
- package/src/tui/client.d.ts +178 -0
- package/src/tui/client.js +116 -0
- package/src/tui/code-pane.d.ts +51 -0
- package/src/tui/code-pane.js +398 -0
- package/src/tui/highlight.d.ts +8 -0
- package/src/tui/highlight.js +86 -0
- package/src/tui/picture.d.ts +141 -0
- package/src/tui/picture.js +571 -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/types.d.ts +124 -0
- package/src/types.js +1 -0
- package/src/update.d.ts +25 -0
- package/src/update.js +110 -0
- package/src/util.d.ts +32 -0
- package/src/util.js +116 -0
- package/src/watching.d.ts +20 -0
- package/src/watching.js +68 -0
- package/src/workspace-view.d.ts +38 -0
- package/src/workspace-view.js +160 -0
package/src/config.d.ts
ADDED
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
import type { ReplyTarget } from "./types.ts";
|
|
2
|
+
import { type LogLevel } from "./util.ts";
|
|
3
|
+
/** One MCP server, in the shape of an `mcpServers` entry of pi's mcp.json, plus `agents` for global servers. */
|
|
4
|
+
export interface McpServerConfig {
|
|
5
|
+
command?: string;
|
|
6
|
+
args?: string[];
|
|
7
|
+
env?: Record<string, string>;
|
|
8
|
+
cwd?: string;
|
|
9
|
+
url?: string;
|
|
10
|
+
headers?: Record<string, string>;
|
|
11
|
+
exposure?: "direct" | "codemode" | "deferred" | "hidden";
|
|
12
|
+
toolExposure?: Record<string, string>;
|
|
13
|
+
description?: string;
|
|
14
|
+
enabled?: boolean;
|
|
15
|
+
timeout?: number;
|
|
16
|
+
/** Global servers only: which agents get it. Default ["*"]. */
|
|
17
|
+
agents?: string[];
|
|
18
|
+
/** Use a server that ships with pine ("web", "browser", "commands") instead of command/url. */
|
|
19
|
+
pine?: string;
|
|
20
|
+
options?: Record<string, unknown>;
|
|
21
|
+
/** Its results are outside content: a session that calls it counts as tainted. */
|
|
22
|
+
taints?: boolean;
|
|
23
|
+
/** When calls need the owner's approval. Default "never" ("tainted" for servers flagged sensitive by the docs). */
|
|
24
|
+
approve?: "never" | "tainted" | "always";
|
|
25
|
+
/** An agent's own servers only: the one conversation that gets it. Written by add_mcp_server for a server added for a conversation; it is removed with that conversation. */
|
|
26
|
+
session?: string;
|
|
27
|
+
[key: string]: unknown;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A source of outside events: a watched folder, an MQTT broker, a webhook, an FTP drop, a web
|
|
31
|
+
* address, or your own module. Like an MCP server it only is there; nothing happens until an agent
|
|
32
|
+
* subscribes to it. The remaining keys are the options of its type.
|
|
33
|
+
*/
|
|
34
|
+
export interface SourceConfig {
|
|
35
|
+
/** A built-in type (see SOURCE_TYPES) ... */
|
|
36
|
+
type?: string;
|
|
37
|
+
/** ... or the path of a module whose default export is `(source) => void`. */
|
|
38
|
+
use?: string;
|
|
39
|
+
/** Where relative paths in the entry are resolved from. */
|
|
40
|
+
base: string;
|
|
41
|
+
/** One line for agents and people: what this source reports. */
|
|
42
|
+
description?: string;
|
|
43
|
+
/** Global sources only: the agents that may subscribe. Default: all. */
|
|
44
|
+
agents?: string[];
|
|
45
|
+
/** An agent's own sources only: the one conversation it was set up for. Other conversations do not see it, and it is removed with that conversation. */
|
|
46
|
+
session?: string;
|
|
47
|
+
/** Who its events speak for. "untrusted" (default): outside content, the subscriber wakes with its reduced tool set. "owner": your own device or schedule. */
|
|
48
|
+
trust: "owner" | "untrusted";
|
|
49
|
+
/** "subscribed" (default): runs only while an agent is subscribed. "always": runs from start, for routes that use its events. */
|
|
50
|
+
start: "subscribed" | "always";
|
|
51
|
+
enabled: boolean;
|
|
52
|
+
options: Record<string, any>;
|
|
53
|
+
}
|
|
54
|
+
export declare const SOURCE_TYPES: string[];
|
|
55
|
+
/**
|
|
56
|
+
* A subscription: one conversation of an agent listens to one source, and each event of the source
|
|
57
|
+
* arrives there as a message and wakes the agent into a turn. Several conversations of the same
|
|
58
|
+
* agent can listen to the same source, each with its own note.
|
|
59
|
+
*/
|
|
60
|
+
export interface SubscriptionConfig {
|
|
61
|
+
source: string;
|
|
62
|
+
/** What the agent wants to do when it is woken, in its own or your words. Given to it with every event. */
|
|
63
|
+
note?: string;
|
|
64
|
+
/** Only events that match (same filter as routes; keys such as "event" and "payload.x"). */
|
|
65
|
+
when?: Record<string, unknown>;
|
|
66
|
+
/** Wait for quiet, then handle only the last event. */
|
|
67
|
+
debounceMs?: number;
|
|
68
|
+
/** Handle one event, then ignore the source for this long. Default 10 s, so a chatty device cannot keep a model busy. */
|
|
69
|
+
throttleMs: number;
|
|
70
|
+
/** Whether that is the default, as opposed to something the subscription said. A source somebody writes through is not held back by the default: every message counts. */
|
|
71
|
+
throttleDefault?: boolean;
|
|
72
|
+
/** The conversation that listens: the one the agent subscribed in. "main" unless said otherwise ("on-<source>" with `separate`). */
|
|
73
|
+
session: string;
|
|
74
|
+
/**
|
|
75
|
+
* true: wake it in a conversation of its own ("on-<source>", or `session`) instead, and for a
|
|
76
|
+
* source that is not yours with the reduced tool set. For sources that carry strangers' text.
|
|
77
|
+
*/
|
|
78
|
+
separate: boolean;
|
|
79
|
+
/** Replaces the standard text the agent is woken with. Templates as in routes. */
|
|
80
|
+
prompt?: string;
|
|
81
|
+
}
|
|
82
|
+
export interface RouteConfig {
|
|
83
|
+
name: string;
|
|
84
|
+
on: string[];
|
|
85
|
+
when?: Record<string, unknown>;
|
|
86
|
+
/** Wait for this long without a new matching event, then handle only the last one. */
|
|
87
|
+
debounceMs?: number;
|
|
88
|
+
/** Handle the first event, then ignore matching events for this long. */
|
|
89
|
+
throttleMs?: number;
|
|
90
|
+
/** Template for the debounce/throttle bucket. Default: the event topic. */
|
|
91
|
+
key?: string;
|
|
92
|
+
/** Write world state: key template -> value template. */
|
|
93
|
+
set?: Record<string, unknown>;
|
|
94
|
+
/** Publish another event. With `call`, `{{result}}` holds the model's answer. */
|
|
95
|
+
publish?: {
|
|
96
|
+
topic: string;
|
|
97
|
+
payload?: unknown;
|
|
98
|
+
};
|
|
99
|
+
/** One model call without tools or history. */
|
|
100
|
+
call?: {
|
|
101
|
+
model?: string;
|
|
102
|
+
system?: string;
|
|
103
|
+
prompt: string;
|
|
104
|
+
};
|
|
105
|
+
/** Full agent turn. */
|
|
106
|
+
agent?: string;
|
|
107
|
+
prompt?: string;
|
|
108
|
+
session?: string;
|
|
109
|
+
whenBusy?: "queue" | "steer";
|
|
110
|
+
priority?: number;
|
|
111
|
+
/** Where the agent's final answer goes. Default: the event's own reply target. false: nowhere. */
|
|
112
|
+
reply?: ReplyTarget | false;
|
|
113
|
+
/** Override the event's trust. "owner" gives events on this route the agent's full tool set. */
|
|
114
|
+
trust?: "owner" | "untrusted";
|
|
115
|
+
/** Text put in front of the event for the agent, outside the "this is data" frame. Set by subscriptions, not in pine.json. */
|
|
116
|
+
preface?: string;
|
|
117
|
+
/**
|
|
118
|
+
* Set by subscriptions: the event is delivered into the subscriber's own conversation, with its
|
|
119
|
+
* usual tools, as outside content. The conversation is marked with this reason, as it would be
|
|
120
|
+
* after reading a web page.
|
|
121
|
+
*/
|
|
122
|
+
taint?: string;
|
|
123
|
+
/** Short line for listings and the UI. Template. */
|
|
124
|
+
label?: string;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Something that happens at a time: every so often, at set times, or once. With a `task` it wakes
|
|
128
|
+
* an agent to do that task; without one it only publishes an event for a route to pick up.
|
|
129
|
+
*
|
|
130
|
+
* Like sources, servers and skills, a schedule is for all agents (pine.json), for one agent
|
|
131
|
+
* (agent.json) or for one conversation of an agent (agent.json, with `session`).
|
|
132
|
+
*/
|
|
133
|
+
export interface ScheduleConfig {
|
|
134
|
+
name: string;
|
|
135
|
+
/** Five-field cron expression in local time. */
|
|
136
|
+
cron?: string;
|
|
137
|
+
/** Fixed interval such as "15m", in milliseconds. */
|
|
138
|
+
every?: number;
|
|
139
|
+
/** Once, at this moment (milliseconds since 1970). The schedule is removed when it has fired. */
|
|
140
|
+
at?: number;
|
|
141
|
+
/** What the agent is to do when it fires, written to the agent. */
|
|
142
|
+
task?: string;
|
|
143
|
+
/** The conversation that is woken. Leaving it out is the agent as such: its main conversation. */
|
|
144
|
+
session?: string;
|
|
145
|
+
topic: string;
|
|
146
|
+
payload?: unknown;
|
|
147
|
+
/** Fire once at startup when a cron time passed while the daemon was down. */
|
|
148
|
+
catchUp: boolean;
|
|
149
|
+
}
|
|
150
|
+
export interface HookConfig {
|
|
151
|
+
topic: string;
|
|
152
|
+
/** Shared secret: accepted as `Authorization: Bearer <secret>` or as an HMAC-SHA256 of the body in `X-Hub-Signature-256` / `X-Signature`. */
|
|
153
|
+
secret?: string;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* How much an agent may do without asking.
|
|
157
|
+
* manual: every action that changes or sends something waits for approval.
|
|
158
|
+
* auto: works freely inside its sandbox; asks for what the rules single out, and for access beyond it.
|
|
159
|
+
* bypass: never asks, and its shell and file tools reach the whole user account (pine's own home and code stay closed).
|
|
160
|
+
*/
|
|
161
|
+
export type Mode = "manual" | "auto" | "bypass";
|
|
162
|
+
export declare const MODES: Mode[];
|
|
163
|
+
export interface SandboxConfig {
|
|
164
|
+
enabled: boolean;
|
|
165
|
+
/** Shell commands may open network connections. */
|
|
166
|
+
network: boolean;
|
|
167
|
+
/** Extra paths the agent may read / write, besides its workspace. */
|
|
168
|
+
read: string[];
|
|
169
|
+
write: string[];
|
|
170
|
+
/** Allow the shared temp directories (/tmp and the user's temp dir). */
|
|
171
|
+
sharedTmp: boolean;
|
|
172
|
+
env: Record<string, string>;
|
|
173
|
+
}
|
|
174
|
+
/** What a run triggered by an untrusted event may use. */
|
|
175
|
+
export interface UntrustedProfile {
|
|
176
|
+
tools: string[];
|
|
177
|
+
mcp: string[];
|
|
178
|
+
delegates: string[];
|
|
179
|
+
publish: string[];
|
|
180
|
+
stateWrite: boolean;
|
|
181
|
+
subagents: boolean;
|
|
182
|
+
}
|
|
183
|
+
export interface AgentConfig {
|
|
184
|
+
id: string;
|
|
185
|
+
/** pi agent dir of this agent: AGENTS.md, skills/, extensions/, settings.json, sessions/. */
|
|
186
|
+
dir: string;
|
|
187
|
+
description: string;
|
|
188
|
+
workspace: string;
|
|
189
|
+
model?: string;
|
|
190
|
+
thinking: string;
|
|
191
|
+
/** Allowlist of pi built-in tools. Undefined keeps pi's default set. */
|
|
192
|
+
tools?: string[];
|
|
193
|
+
mcp: Record<string, McpServerConfig>;
|
|
194
|
+
/** Which global MCP servers this agent gets: all that list it (true), none (false), or these names. */
|
|
195
|
+
globalMcp: boolean | string[];
|
|
196
|
+
/** Event sources only this agent can subscribe to. */
|
|
197
|
+
sources: Record<string, SourceConfig>;
|
|
198
|
+
/** What this agent's conversations are subscribed to: its own sources or global ones. */
|
|
199
|
+
subscribe: SubscriptionConfig[];
|
|
200
|
+
/** What this agent does at set times: for the agent as such, or (with `session`) for one conversation. */
|
|
201
|
+
schedules: ScheduleConfig[];
|
|
202
|
+
extensions: string[];
|
|
203
|
+
skills: string[];
|
|
204
|
+
/** Extra instruction files loaded into the system prompt, besides AGENTS.md in the agent dir and the workspace. */
|
|
205
|
+
context: string[];
|
|
206
|
+
/** Agents this one may hand tasks to. "*" means every other agent. */
|
|
207
|
+
delegates: string[];
|
|
208
|
+
subagents: {
|
|
209
|
+
enabled: boolean;
|
|
210
|
+
maxParallel: number;
|
|
211
|
+
tools?: string[];
|
|
212
|
+
mcp: boolean;
|
|
213
|
+
};
|
|
214
|
+
/** Topics the publish_event tool may publish to. */
|
|
215
|
+
publish: string[];
|
|
216
|
+
state: {
|
|
217
|
+
read: string[];
|
|
218
|
+
write: string[];
|
|
219
|
+
inject: string[];
|
|
220
|
+
};
|
|
221
|
+
trustWorkspace: boolean;
|
|
222
|
+
mode: Mode;
|
|
223
|
+
sandbox: SandboxConfig;
|
|
224
|
+
/** Tool calls that always need the owner's approval: "tool" or "tool:argument-glob". */
|
|
225
|
+
approve: string[];
|
|
226
|
+
/** Tool calls that need approval once the session has seen outside content. */
|
|
227
|
+
approveWhenTainted: string[];
|
|
228
|
+
/** Profile for runs triggered by untrusted events; false refuses such runs. */
|
|
229
|
+
untrusted: UntrustedProfile | false;
|
|
230
|
+
bashTimeoutSec: number;
|
|
231
|
+
bashDeny: string[];
|
|
232
|
+
taskTimeoutSec: number;
|
|
233
|
+
idleMs: number;
|
|
234
|
+
settings: Record<string, unknown>;
|
|
235
|
+
}
|
|
236
|
+
export interface PineConfig {
|
|
237
|
+
home: string;
|
|
238
|
+
dataDir: string;
|
|
239
|
+
logLevel: LogLevel;
|
|
240
|
+
main?: string;
|
|
241
|
+
defaults: {
|
|
242
|
+
model?: string;
|
|
243
|
+
thinking: string;
|
|
244
|
+
mode: Mode;
|
|
245
|
+
bashTimeoutSec: number;
|
|
246
|
+
taskTimeoutSec: number;
|
|
247
|
+
idleMs: number;
|
|
248
|
+
settings: Record<string, unknown>;
|
|
249
|
+
};
|
|
250
|
+
limits: {
|
|
251
|
+
maxConcurrentRuns: number;
|
|
252
|
+
maxDelegationDepth: number;
|
|
253
|
+
/** Largest file the download tool fetches. */
|
|
254
|
+
maxDownloadMb: number;
|
|
255
|
+
maxEventHops: number;
|
|
256
|
+
modelHeadersTimeoutMs: number;
|
|
257
|
+
modelStreamIdleMs: number;
|
|
258
|
+
eventRetentionDays: number;
|
|
259
|
+
/** A conversation that is not pinned, not open in a tab, not subscribed to anything and without a schedule of its own is removed after this many days without a message. 0: never. */
|
|
260
|
+
conversationDays: number;
|
|
261
|
+
maxQueuedPerAgent: number;
|
|
262
|
+
maxEventChars: number;
|
|
263
|
+
};
|
|
264
|
+
security: {
|
|
265
|
+
approvalTimeoutMs: number;
|
|
266
|
+
/** How long a session stays tainted after it saw outside content. */
|
|
267
|
+
taint: "session" | "run" | "off";
|
|
268
|
+
/** Tool name globs whose results are outside content, besides MCP servers marked `taints`. */
|
|
269
|
+
taintTools: string[];
|
|
270
|
+
/** Keep bypass mode in force after a session has seen outside content. Off: such a session asks again. */
|
|
271
|
+
bypassWhenTainted: boolean;
|
|
272
|
+
};
|
|
273
|
+
/** Values that must never leave the daemon in events or messages. */
|
|
274
|
+
secrets: string[];
|
|
275
|
+
mcp: Record<string, McpServerConfig>;
|
|
276
|
+
/** Event sources every agent can subscribe to (or the agents an entry lists). */
|
|
277
|
+
sources: Record<string, SourceConfig>;
|
|
278
|
+
/** Source types of your own, besides the built-in ones: type name -> the module that implements it. */
|
|
279
|
+
sourceTypes: Record<string, string>;
|
|
280
|
+
/** Subscriptions for everyone: each agent that can use the source is woken in its main conversation. */
|
|
281
|
+
subscribe: SubscriptionConfig[];
|
|
282
|
+
extensions: string[];
|
|
283
|
+
skills: string[];
|
|
284
|
+
routes: RouteConfig[];
|
|
285
|
+
schedules: ScheduleConfig[];
|
|
286
|
+
http?: {
|
|
287
|
+
host: string;
|
|
288
|
+
port: number;
|
|
289
|
+
token?: string;
|
|
290
|
+
hooks: Record<string, HookConfig>;
|
|
291
|
+
};
|
|
292
|
+
agents: Record<string, AgentConfig>;
|
|
293
|
+
}
|
|
294
|
+
export declare class ConfigError extends Error {
|
|
295
|
+
problems: string[];
|
|
296
|
+
constructor(problems: string[]);
|
|
297
|
+
}
|
|
298
|
+
/** The pine checkout: bundled MCP servers and source types live here. */
|
|
299
|
+
export declare const PINE_ROOT: string;
|
|
300
|
+
/**
|
|
301
|
+
* How pine's own module files end: ".ts" in a checkout, where Node runs the sources as they are,
|
|
302
|
+
* ".js" in the published package, which holds them compiled (Node does not run TypeScript from
|
|
303
|
+
* inside node_modules). Used wherever pine names one of its own files at run time.
|
|
304
|
+
*/
|
|
305
|
+
export declare const EXT: string;
|
|
306
|
+
export declare const defaultHome: () => string;
|
|
307
|
+
/** Read `<home>/pine.json`, `<home>/.env` and every `<home>/agents/<id>/agent.json`. Throws ConfigError. */
|
|
308
|
+
export declare function loadConfig(home?: string): PineConfig;
|
|
309
|
+
/** MCP servers an agent ends up with: its own, plus the global ones that include it. Own entries win. */
|
|
310
|
+
/** The main agent: the one pine.json names; without that entry the one called "main", else the first one. */
|
|
311
|
+
/**
|
|
312
|
+
* The files in an agent's workspace that are part of its prompt, in the order they enter it. They
|
|
313
|
+
* are the agent's own: it reads them as its instructions and keeps them up to date itself.
|
|
314
|
+
* AGENTS.md is how it works, SOUL.md who it is, MEMORY.md what should outlive a conversation.
|
|
315
|
+
*/
|
|
316
|
+
export declare const WORKSPACE_FILES: string[];
|
|
317
|
+
/** What all agents know about the owner: one file in pine's home, in every agent's prompt, kept by the main agent. */
|
|
318
|
+
export declare const userFile: (cfg: PineConfig) => string;
|
|
319
|
+
/**
|
|
320
|
+
* Where skills lie that were set up by tool call. The place says whom a skill is for: all agents,
|
|
321
|
+
* one agent, or one conversation of an agent. All of it is inside pine's home, which agents read
|
|
322
|
+
* but do not write.
|
|
323
|
+
*/
|
|
324
|
+
export declare const globalSkillsDir: (cfg: Pick<PineConfig, "home">) => string;
|
|
325
|
+
export declare const agentSkillsDir: (agent: Pick<AgentConfig, "dir">) => string;
|
|
326
|
+
export declare const conversationsDir: (agent: Pick<AgentConfig, "dir">) => string;
|
|
327
|
+
export declare function mainAgentId(cfg: PineConfig): string;
|
|
328
|
+
/**
|
|
329
|
+
* The MCP servers an agent has. `session`: the conversation asked for, which also gets the servers
|
|
330
|
+
* that were added for it alone; without it, every server the agent has in any conversation.
|
|
331
|
+
*/
|
|
332
|
+
export declare function effectiveMcp(cfg: PineConfig, agent: AgentConfig, session?: string): Record<string, McpServerConfig>;
|
|
333
|
+
/** Turn a pine MCP entry into what pi's registerMcpServer() accepts. */
|
|
334
|
+
export declare function toPiMcp(name: string, server: McpServerConfig, extraOptions?: Record<string, unknown>): Record<string, unknown>;
|
|
335
|
+
/**
|
|
336
|
+
* The forms "subscribe" may have in a file, as a plain list of entries:
|
|
337
|
+
* `["camera", "printer"]`, `{ "camera": { "note": ... } }`, or the form pine itself writes,
|
|
338
|
+
* `[{ "source": "camera", "session": "main", "note": ... }]`, which is the only one that can
|
|
339
|
+
* say that two conversations listen to the same source.
|
|
340
|
+
*/
|
|
341
|
+
export declare function rawSubscriptions(raw: unknown): Array<Record<string, any>>;
|
|
342
|
+
export declare function subscriptionFrom(v: Record<string, any>): SubscriptionConfig;
|
|
343
|
+
/** The source an agent means by a name: its own first, then a global one it is allowed to use. */
|
|
344
|
+
export declare function sourceFor(cfg: PineConfig, agentId: string, name: string): {
|
|
345
|
+
source: SourceConfig;
|
|
346
|
+
key: string;
|
|
347
|
+
scope: string;
|
|
348
|
+
} | undefined;
|
|
349
|
+
export declare const mcpTaints: (server: McpServerConfig) => boolean;
|
|
350
|
+
/** Agents `from` may delegate to. */
|
|
351
|
+
export declare function delegateTargets(cfg: PineConfig, from: AgentConfig): AgentConfig[];
|