@agentchatme/agent-core 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 +71 -37
- package/dist/{chunk-I4U4A7HO.js → chunk-KUZZ3MW2.js} +796 -161
- package/dist/chunk-KUZZ3MW2.js.map +1 -0
- package/dist/daemon-entry.d.ts +183 -139
- package/dist/daemon-entry.js +548 -442
- package/dist/daemon-entry.js.map +1 -1
- package/dist/index.d.ts +47 -221
- package/dist/index.js +215 -200
- package/dist/index.js.map +1 -1
- package/dist/prompts-BUfpwUT7.d.ts +630 -0
- package/package.json +3 -3
- package/dist/chunk-I4U4A7HO.js.map +0 -1
- package/dist/status-D8qOP4kM.d.ts +0 -260
package/dist/index.d.ts
CHANGED
|
@@ -1,37 +1,13 @@
|
|
|
1
|
+
import { I as IntegrationClient, H as HostProfile } from './prompts-BUfpwUT7.js';
|
|
2
|
+
export { C as CachedTexts, l as CheckManualOptions, m as Credentials, n as DEFAULT_API_BASE, o as DEFAULT_RUN_BUDGET_MS, p as DEFAULT_RUN_PROFILE, q as DoctorCheck, r as DoctorContext, F as FetchIdentityLineOptions, s as FetchServedTextsOptions, t as INTEGRATION_ENV, u as INTEGRATION_ENV_LEGACY, v as INTEGRATION_STATUS_FILE, e as IntegrationLastRun, b as IntegrationStatus, L as LEGACY_STATUS_FILE, w as LoadTextsOptions, x as LoadedTexts, y as MANUAL_FETCH_TIMEOUT_MS, z as MANUAL_MAX_BYTES, A as MANUAL_MAX_REDIRECTS, B as ManualCheck, E as ManualCheckState, M as ManualFetch, G as ManualFollower, J as ManualFollowerOptions, K as ManualSyncResult, N as ManualSyncState, P as PendingRegistration, O as RUN_BUDGET_ENV, Q as RUN_PROFILES, U as RUN_PROFILE_ENV, V as ResolvedIdentity, g as RunKind, f as RunOutcome, h as RunOutcomeState, i as RunPreflight, a as RunProfile, c as RunPrompts, j as RunRequest, R as RunRunner, X as SOCKET_STATES, Y as ServedManual, S as SocketState, Z as StatusContext, _ as SyncManualOptions, $ as TEXTS_CACHE_FILE, a0 as TEXTS_REFRESH_MS, a1 as TEXTS_RETRY_MS, a2 as TextsClient, a3 as TextsSource, a4 as TextsStatus, T as TextsStore, a5 as TextsStoreOptions, a6 as Verdict, a7 as anchorLabelOf, a8 as buildRunPrompts, a9 as checkManual, aa as clearCredentials, ab as clearIntegrationStatus, ac as clearPending, ad as clientHeadersOf, ae as clientIdentityOf, af as credentialsPath, ag as describeManualSync, ah as fetchIdentityLine, ai as fetchServedTexts, aj as formatIntegrationStatus, ak as integrationDisabled, al as integrationDisabledBy, am as integrationStatusAge, an as integrationStatusPath, ao as isRunProfile, ap as loadTexts, aq as pendingPath, ar as readCachedTexts, as as readCredentials, at as readIntegrationStatus, au as readManualVersion, av as readPending, aw as resolveIdentity, ax as resolveRunBudgetMs, ay as resolveRunProfile, az as statePath, aA as syncManual, aB as textsCachePath, aC as writeCachedTexts, aD as writeCredentials, aE as writeIntegrationStatus, aF as writePending } from './prompts-BUfpwUT7.js';
|
|
3
|
+
import { AgentChatClient, Texts } from 'agentchatme';
|
|
1
4
|
import { z } from 'zod';
|
|
2
|
-
export { B as BARE_TOOL_NAMER, i as DEFAULT_RUN_BUDGET_MS, j as DEFAULT_RUN_PROFILE, k as DOORBELL_ENV, l as DOORBELL_STATUS_FILE, c as DoorbellLastRun, D as DoorbellPrompts, b as DoorbellStatus, H as HOSTED_TOOLS, P as PromptOptions, m as RUN_BUDGET_ENV, n as RUN_PROFILES, o as RUN_PROFILE_ENV, e as RunKind, d as RunOutcome, f as RunOutcomeState, g as RunPreflight, a as RunProfile, h as RunRequest, R as RunRunner, p as SOCKET_STATES, S as SocketState, T as ToolNamer, q as buildDoorbellPrompts, r as clearDoorbellStatus, s as doorbellDisabled, t as doorbellStatusAge, u as doorbellStatusPath, v as formatDoorbellStatus, w as invitePrompt, x as isRunProfile, y as knockPrompt, z as mcpToolNamer, A as readDoorbellStatus, C as resolveRunBudgetMs, E as resolveRunProfile, F as wakeInstruction, G as writeDoorbellStatus } from './status-D8qOP4kM.js';
|
|
3
5
|
import { spawn, spawnSync } from 'node:child_process';
|
|
4
6
|
|
|
5
|
-
/** Low-cardinality identity attached to every coding-agent API operation. */
|
|
6
|
-
declare const CODING_AGENTS_CLIENT_IDENTITY: {
|
|
7
|
-
readonly name: "coding_agents";
|
|
8
|
-
readonly version: "0.1.0";
|
|
9
|
-
};
|
|
10
|
-
/** Headers for raw HTTP and WebSocket transports that bypass the SDK. */
|
|
11
|
-
declare const CODING_AGENTS_CLIENT_HEADERS: Readonly<Record<string, string>>;
|
|
12
|
-
|
|
13
7
|
/** Published package version, kept in lockstep with package.json by tests. */
|
|
14
|
-
declare const VERSION = "0.
|
|
8
|
+
declare const VERSION = "0.3.0";
|
|
15
9
|
|
|
16
|
-
|
|
17
|
-
apiKey: string;
|
|
18
|
-
apiBase: string;
|
|
19
|
-
timeoutMs?: number;
|
|
20
|
-
}
|
|
21
|
-
declare class WireError extends Error {
|
|
22
|
-
readonly status: number;
|
|
23
|
-
constructor(status: number, detail: string);
|
|
24
|
-
}
|
|
25
|
-
declare function wireRequest(cfg: WireConfig, method: 'GET' | 'POST', pathname: string, body?: unknown): Promise<unknown>;
|
|
26
|
-
/**
|
|
27
|
-
* Minimal self-lookup for an env-var key with no credentials file (so no
|
|
28
|
-
* cached handle). Only the handle is read.
|
|
29
|
-
*/
|
|
30
|
-
declare function getMeLite(cfg: WireConfig): Promise<{
|
|
31
|
-
handle: string;
|
|
32
|
-
} | null>;
|
|
33
|
-
/** Server caps on the tray: `INBOX_TRAY_MAX_LIMIT`. */
|
|
34
|
-
declare const INBOX_MAX_LIMIT = 50;
|
|
10
|
+
type TrayClient = Pick<AgentChatClient, 'inbox'>;
|
|
35
11
|
interface TraySummary {
|
|
36
12
|
/** Conversations with something waiting (cards on the tray). */
|
|
37
13
|
waiting: number;
|
|
@@ -40,104 +16,15 @@ interface TraySummary {
|
|
|
40
16
|
/** More conversations are waiting than one tray shows. */
|
|
41
17
|
truncated: boolean;
|
|
42
18
|
}
|
|
19
|
+
/** How many conversations are waiting, for `status`. One tray page, counted. */
|
|
20
|
+
declare function traySummary(client: TrayClient): Promise<TraySummary>;
|
|
43
21
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
|
|
48
|
-
declare function traySummary(cfg: WireConfig): Promise<TraySummary>;
|
|
49
|
-
/**
|
|
50
|
-
* Is anything waiting on the tray? `GET /v1/inbox?wait_ms=0&limit=1` — a
|
|
51
|
-
* count, never a card: the one card the server may return is not read, not
|
|
52
|
-
* kept, not logged. Marks nothing delivered. This is the connect-time question
|
|
53
|
-
* "does this (re)connect deserve a run at all?" — the server re-offers stored
|
|
54
|
-
* envelopes as `message.new` frames right after `hello.ok`, so this is a
|
|
55
|
-
* second opinion that coalesces with them, and the reason a reconnect with an
|
|
56
|
-
* empty tray starts no run.
|
|
57
|
-
*/
|
|
58
|
-
declare function trayHasWaiting(cfg: WireConfig): Promise<boolean>;
|
|
59
|
-
/** A pending group invite, as the doorbell knocks for it: the same four fields the live frame carries. */
|
|
60
|
-
interface PendingInvite {
|
|
61
|
-
readonly inviteId: string;
|
|
62
|
-
readonly groupId: string | null;
|
|
63
|
-
readonly groupName: string | null;
|
|
64
|
-
readonly inviterHandle: string | null;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Pending group invites: `GET /v1/groups/invites`. The server pushes an invite
|
|
68
|
-
* live only (`group.service.ts`) and never re-offers it on reconnect, so an
|
|
69
|
-
* invite that arrived while the socket was down is surfaced by this read on
|
|
70
|
-
* connect — the invoker deduplicates by id, so one seen live is not run twice.
|
|
71
|
-
* Four fields read; descriptions, avatars and member counts are ignored.
|
|
72
|
-
*/
|
|
73
|
-
declare function listGroupInvites(cfg: WireConfig): Promise<PendingInvite[]>;
|
|
74
|
-
|
|
75
|
-
declare const DEFAULT_API_BASE = "https://api.agentchat.me";
|
|
76
|
-
declare const CredentialsSchema: z.ZodObject<{
|
|
77
|
-
api_key: z.ZodString;
|
|
78
|
-
handle: z.ZodString;
|
|
79
|
-
api_base: z.ZodOptional<z.ZodString>;
|
|
80
|
-
created_at: z.ZodOptional<z.ZodString>;
|
|
81
|
-
}, "strip", z.ZodTypeAny, {
|
|
82
|
-
api_key: string;
|
|
83
|
-
handle: string;
|
|
84
|
-
api_base?: string | undefined;
|
|
85
|
-
created_at?: string | undefined;
|
|
86
|
-
}, {
|
|
87
|
-
api_key: string;
|
|
88
|
-
handle: string;
|
|
89
|
-
api_base?: string | undefined;
|
|
90
|
-
created_at?: string | undefined;
|
|
91
|
-
}>;
|
|
92
|
-
type Credentials = z.infer<typeof CredentialsSchema>;
|
|
93
|
-
interface ResolvedIdentity {
|
|
94
|
-
apiKey: string;
|
|
95
|
-
apiBase: string;
|
|
96
|
-
/** Handle is only known when it came from the credentials file. */
|
|
97
|
-
handle: string | null;
|
|
98
|
-
source: 'env' | 'file';
|
|
99
|
-
}
|
|
100
|
-
declare function credentialsPath(home: string): string;
|
|
101
|
-
declare function pendingPath(home: string): string;
|
|
102
|
-
declare function statePath(home: string): string;
|
|
103
|
-
/** Read the credential stored in `home`, or null when absent/malformed. */
|
|
104
|
-
declare function readCredentials(home: string): Credentials | null;
|
|
105
|
-
/**
|
|
106
|
-
* The identity an integration should act as, for one specific home.
|
|
107
|
-
* `AGENTCHAT_API_KEY` overrides the file; `AGENTCHAT_API_BASE` overrides the
|
|
108
|
-
* base URL. Neither is host-specific, so both are read from the environment.
|
|
22
|
+
* Is anything waiting on the tray? `GET /v1/inbox?limit=1` — a count, never a
|
|
23
|
+
* card: the one card the server may return is not read. This is the question
|
|
24
|
+
* asked before every wake run: "does this wake deserve a run at all?" — the
|
|
25
|
+
* reason a reconnect with an empty tray starts no run.
|
|
109
26
|
*/
|
|
110
|
-
declare function
|
|
111
|
-
declare function writeCredentials(home: string, creds: Credentials): void;
|
|
112
|
-
/** Delete the credential and any half-finished registration in `home`.
|
|
113
|
-
* Touches nothing outside `home` — that is the caller's whole agent. */
|
|
114
|
-
declare function clearCredentials(home: string): boolean;
|
|
115
|
-
declare const PendingSchema: z.ZodObject<{
|
|
116
|
-
kind: z.ZodDefault<z.ZodEnum<["register", "recover"]>>;
|
|
117
|
-
pending_id: z.ZodString;
|
|
118
|
-
email: z.ZodString;
|
|
119
|
-
handle: z.ZodOptional<z.ZodString>;
|
|
120
|
-
api_base: z.ZodOptional<z.ZodString>;
|
|
121
|
-
created_at: z.ZodString;
|
|
122
|
-
}, "strip", z.ZodTypeAny, {
|
|
123
|
-
created_at: string;
|
|
124
|
-
kind: "register" | "recover";
|
|
125
|
-
pending_id: string;
|
|
126
|
-
email: string;
|
|
127
|
-
handle?: string | undefined;
|
|
128
|
-
api_base?: string | undefined;
|
|
129
|
-
}, {
|
|
130
|
-
created_at: string;
|
|
131
|
-
pending_id: string;
|
|
132
|
-
email: string;
|
|
133
|
-
handle?: string | undefined;
|
|
134
|
-
api_base?: string | undefined;
|
|
135
|
-
kind?: "register" | "recover" | undefined;
|
|
136
|
-
}>;
|
|
137
|
-
type PendingRegistration = z.infer<typeof PendingSchema>;
|
|
138
|
-
declare function readPending(home: string): PendingRegistration | null;
|
|
139
|
-
declare function writePending(home: string, pending: PendingRegistration): void;
|
|
140
|
-
declare function clearPending(home: string): void;
|
|
27
|
+
declare function trayHasWaiting(client: TrayClient): Promise<boolean>;
|
|
141
28
|
|
|
142
29
|
declare const StateSchema: z.ZodObject<{
|
|
143
30
|
offer_declined_at: z.ZodOptional<z.ZodString>;
|
|
@@ -166,25 +53,29 @@ declare const MANUAL_URL = "https://agentchat.me/skill.md";
|
|
|
166
53
|
/** The skill name every runtime sees: `<skills dir>/agentchat/SKILL.md`. */
|
|
167
54
|
declare const MANUAL_SKILL_NAME = "agentchat";
|
|
168
55
|
declare const MANUAL_FILENAME = "SKILL.md";
|
|
169
|
-
/** The
|
|
56
|
+
/** The bundled copy, byte for byte (the fallback; the served manual is the source). */
|
|
170
57
|
declare const MANUAL: string;
|
|
58
|
+
/**
|
|
59
|
+
* The YAML front matter's top-level `key: value` fields, or null when the text
|
|
60
|
+
* does not open with a front matter block. Deliberately not a YAML parser:
|
|
61
|
+
* the manual's front matter is flat, and nothing here interprets more of a
|
|
62
|
+
* downloaded text than its name and version. A leading byte-order mark and
|
|
63
|
+
* CRLF line endings (a file saved by a Windows editor) read the same as LF.
|
|
64
|
+
*/
|
|
65
|
+
declare function manualFrontMatter(raw: string): ReadonlyMap<string, string> | null;
|
|
171
66
|
/** The `version:` field of the manual's YAML front matter, or null. */
|
|
172
67
|
declare function manualVersion(text?: string): string | null;
|
|
173
|
-
/** Lockstep check: the identity line this package writes is the one the manual publishes. */
|
|
174
|
-
declare function manualCarriesIdentityLine(text?: string): boolean;
|
|
175
68
|
/**
|
|
176
69
|
* The one pointer line a run prompt ends with. `location` is how THIS runtime
|
|
177
|
-
* reaches the
|
|
178
|
-
* this package does not.
|
|
70
|
+
* reaches its copy of the manual (a skill name, a path) — the integration knows
|
|
71
|
+
* that, this package does not.
|
|
179
72
|
*/
|
|
180
73
|
declare function manualPointer(location: string): string;
|
|
181
74
|
|
|
182
|
-
|
|
183
|
-
declare
|
|
75
|
+
/** The identity line, ready to place, from a served (or cached) texts response. */
|
|
76
|
+
declare function identityLineOf(texts: Pick<Texts, 'identity_line'>): string;
|
|
184
77
|
/** Handles are canonical lowercase on the wire; a leading `@` is display only. */
|
|
185
78
|
declare function normalizeHandle(handle: string): string;
|
|
186
|
-
/** The published identity line with this agent's handle filled in. */
|
|
187
|
-
declare function renderIdentityLine(handle: string): string;
|
|
188
79
|
|
|
189
80
|
/**
|
|
190
81
|
* How ONE integration names itself in user-facing copy.
|
|
@@ -218,8 +109,8 @@ declare function renderDeclinedBlock(copy: HostCopy): string;
|
|
|
218
109
|
|
|
219
110
|
declare const ANCHOR_START = "<!-- agentchat:start -->";
|
|
220
111
|
declare const ANCHOR_END = "<!-- agentchat:end -->";
|
|
221
|
-
/** The identity block: the
|
|
222
|
-
declare function renderAnchorBlock(
|
|
112
|
+
/** The identity block: the served identity line, as fetched for this agent, between the markers. */
|
|
113
|
+
declare function renderAnchorBlock(identityLine: string): string;
|
|
223
114
|
type AnchorAction = 'written' | 'removed' | 'noop';
|
|
224
115
|
/**
|
|
225
116
|
* Upsert `block` into the file at `filePath`, creating it if needed.
|
|
@@ -231,8 +122,8 @@ type AnchorAction = 'written' | 'removed' | 'noop';
|
|
|
231
122
|
declare function writeAnchor(filePath: string, block: string, expectHandle?: string): AnchorAction;
|
|
232
123
|
declare function removeAnchorAt(filePath: string): AnchorAction;
|
|
233
124
|
declare function hasAnchorAt(filePath: string): boolean;
|
|
234
|
-
/** Whether the file's block is exactly the
|
|
235
|
-
declare function anchorIsCurrentAt(filePath: string,
|
|
125
|
+
/** Whether the file's block is exactly the block for this served identity line. */
|
|
126
|
+
declare function anchorIsCurrentAt(filePath: string, identityLine: string): boolean;
|
|
236
127
|
/**
|
|
237
128
|
* The handle a file's anchor block currently CLAIMS, or null if there is no
|
|
238
129
|
* block. Lets an integration catch an anchor that disagrees with its own
|
|
@@ -258,91 +149,16 @@ interface McpProbeResult {
|
|
|
258
149
|
declare function probeHostedMcp(params: {
|
|
259
150
|
apiKey: string;
|
|
260
151
|
apiBase: string;
|
|
261
|
-
|
|
262
|
-
|
|
152
|
+
/** How this integration identifies to the server (headers on the probe). */
|
|
153
|
+
client: IntegrationClient;
|
|
154
|
+
/** MCP `clientInfo.name`; defaults to the runtime name. */
|
|
155
|
+
clientName?: string;
|
|
156
|
+
/** MCP `clientInfo.version`; defaults to the integration's version. */
|
|
157
|
+
clientVersion?: string;
|
|
263
158
|
timeoutMs?: number;
|
|
264
159
|
fetch?: typeof fetch;
|
|
265
160
|
}): Promise<McpProbeResult>;
|
|
266
161
|
|
|
267
|
-
type Verdict = 'PASS' | 'WARN' | 'FAIL';
|
|
268
|
-
interface DoctorCheck {
|
|
269
|
-
name: string;
|
|
270
|
-
verdict: Verdict;
|
|
271
|
-
detail: string;
|
|
272
|
-
}
|
|
273
|
-
/**
|
|
274
|
-
* Everything the shared identity commands need to know about ONE coding agent.
|
|
275
|
-
*
|
|
276
|
-
* This is the seam. The register / login / recover / status / logout / doctor
|
|
277
|
-
* flows are the same everywhere because they are a contract with the AgentChat
|
|
278
|
-
* server; what differs per host is only what is described here. An integration
|
|
279
|
-
* builds one of these and gets the commands back.
|
|
280
|
-
*
|
|
281
|
-
* Note what is NOT here: any way to name a *different* host. A profile
|
|
282
|
-
* describes the caller and nothing else, so a command built from it cannot
|
|
283
|
-
* reach another agent's files. That is the same property the per-repo split
|
|
284
|
-
* gives, kept intact while the flow itself is shared once.
|
|
285
|
-
*
|
|
286
|
-
* The path-ish fields are functions, not strings: `CODEX_HOME` and friends are
|
|
287
|
-
* read per call, and evaluating them at module load would freeze a value the
|
|
288
|
-
* user can still change.
|
|
289
|
-
*/
|
|
290
|
-
interface HostProfile {
|
|
291
|
-
/** Human name for output, e.g. `Claude Code`. */
|
|
292
|
-
label: string;
|
|
293
|
-
/** Stable machine identifier for `--json`, e.g. `claude-code`. */
|
|
294
|
-
id: string;
|
|
295
|
-
/** THE identity home for this agent. */
|
|
296
|
-
home(): string;
|
|
297
|
-
/** This host's always-loaded instruction file. */
|
|
298
|
-
anchorFile(): string;
|
|
299
|
-
/** Exactly what a user types to reach this integration. */
|
|
300
|
-
invocation(): string;
|
|
301
|
-
/** Render the anchor block body this host wants (normally the identity block). */
|
|
302
|
-
renderAnchor(handle: string): string;
|
|
303
|
-
/**
|
|
304
|
-
* What to call the anchor in output. Defaults to the instruction file's own
|
|
305
|
-
* basename (`CLAUDE.md`, `AGENTS.md`), which is what a user actually looks
|
|
306
|
-
* for on disk.
|
|
307
|
-
*/
|
|
308
|
-
anchorLabel?: string;
|
|
309
|
-
/**
|
|
310
|
-
* Whether this host is wired up enough for an anchor to mean anything.
|
|
311
|
-
* An integration uses this so it never writes an identity block announcing
|
|
312
|
-
* a phone number before its own placement is actually in place.
|
|
313
|
-
*/
|
|
314
|
-
isWired?(): boolean;
|
|
315
|
-
/**
|
|
316
|
-
* Place the doorbell's four texts for a freshly established identity: the
|
|
317
|
-
* identity line, the manual, the hosted tool server with the key, and
|
|
318
|
-
* whatever the key's home is on this runtime. Called after register, login
|
|
319
|
-
* and recover (every time the key changes), and by `doctor --fix`. Returns
|
|
320
|
-
* report lines for the user. When absent, only the anchor is written.
|
|
321
|
-
*/
|
|
322
|
-
place?(handle: string, apiKey: string): string[];
|
|
323
|
-
/**
|
|
324
|
-
* Undo `place` for the identity being signed out: remove the key from the
|
|
325
|
-
* tool server registration and anything else that would still authenticate
|
|
326
|
-
* as the old identity. The anchor is removed by the shared flow. Returns
|
|
327
|
-
* report lines.
|
|
328
|
-
*
|
|
329
|
-
* `identity` is the identity AS IT WAS BEFORE the credential was cleared
|
|
330
|
-
* (its key and API base), or null when there was none: a host recognises
|
|
331
|
-
* its own registration by that key and that server, and guessing either
|
|
332
|
-
* after the fact left a non-default `api_base` entry classified as foreign
|
|
333
|
-
* and the key still registered.
|
|
334
|
-
*/
|
|
335
|
-
unplace?(identity: ResolvedIdentity | null): string[];
|
|
336
|
-
/** Host-specific doctor checks, appended after the shared ones. */
|
|
337
|
-
extraDoctorChecks?(opts: {
|
|
338
|
-
fix?: boolean;
|
|
339
|
-
}): DoctorCheck[];
|
|
340
|
-
/** Extra lines printed after a successful logout. */
|
|
341
|
-
logoutHints?(): string[];
|
|
342
|
-
}
|
|
343
|
-
/** The label to use for this host's anchor in user-facing output. */
|
|
344
|
-
declare function anchorLabelOf(profile: HostProfile): string;
|
|
345
|
-
|
|
346
162
|
interface RegisterOpts {
|
|
347
163
|
email?: string;
|
|
348
164
|
handle?: string;
|
|
@@ -520,6 +336,15 @@ declare function systemdQuote(value: string): string;
|
|
|
520
336
|
declare function systemdUnit(p: Plan): string;
|
|
521
337
|
declare function xmlEscape(value: string): string;
|
|
522
338
|
declare function launchdPlist(p: Plan): string;
|
|
339
|
+
/** The host as service management sees it. `wsl` is Linux under WSL2 (Windows Startup launcher, not systemd). */
|
|
340
|
+
type ServiceHostOs = 'linux' | 'darwin' | 'win32' | 'wsl' | 'other';
|
|
341
|
+
/**
|
|
342
|
+
* Tests only: pretend to be another host so the Linux and Windows command
|
|
343
|
+
* sequences can be pinned on any CI runner. Paths and the real service
|
|
344
|
+
* manager are never reached: pair it with a fake command runner and
|
|
345
|
+
* `AGENTCHATD_SERVICE_NO_START=1`.
|
|
346
|
+
*/
|
|
347
|
+
declare function setServiceHostOsForTests(hostOs: ServiceHostOs | null): void;
|
|
523
348
|
declare function installService(opts: ServiceOpts): void;
|
|
524
349
|
declare function uninstallService(opts: ServiceRef): void;
|
|
525
350
|
declare function serviceStatus(opts: ServiceRef): string;
|
|
@@ -534,7 +359,8 @@ declare const log: {
|
|
|
534
359
|
debug: (msg: string) => void;
|
|
535
360
|
};
|
|
536
361
|
|
|
537
|
-
|
|
362
|
+
/** `mode` is set exactly (whatever the umask); without one the file gets the umask's default, as `writeFileSync` would. */
|
|
363
|
+
declare function atomicWriteFile(filePath: string, data: string | Uint8Array, mode?: number): void;
|
|
538
364
|
/** Crash-safe file replacement for shipped executable bundles. */
|
|
539
365
|
declare function atomicCopyFile(source: string, destination: string, mode?: number): void;
|
|
540
366
|
declare function readJsonFile<T>(filePath: string): T | null;
|
|
@@ -542,4 +368,4 @@ declare function readJsonFile<T>(filePath: string): T | null;
|
|
|
542
368
|
declare const spawnCommand: typeof spawn;
|
|
543
369
|
declare const spawnCommandSync: typeof spawnSync;
|
|
544
370
|
|
|
545
|
-
export { ANCHOR_END, ANCHOR_START, type AlwaysOnState, type AnchorAction,
|
|
371
|
+
export { ANCHOR_END, ANCHOR_START, type AlwaysOnState, type AnchorAction, type DoctorOpts, HEARTBEAT_FILE, HOSTED_MCP_PATH, type HostCopy, HostProfile, type IdentityCommands, type IdentityState, IntegrationClient, type LockHandle, MANUAL, MANUAL_FILENAME, MANUAL_SKILL_NAME, MANUAL_URL, type McpProbeResult, type Plan, type RecoverOpts, type RegisterOpts, type ServiceCommandRunner, type ServiceHostOs, type ServiceOpts, type ServiceRef, type TrayClient, type TraySummary, VERSION, acquireLeaderLock, alwaysOnHealth, alwaysOnOptedOut, alwaysOnState, alwaysOnWanted, anchorIsCurrentAt, atomicCopyFile, atomicWriteFile, beat, clearAlwaysOnInstalledVersion, clearAlwaysOnOptOut, clearAlwaysOnWanted, clearOfferDeclined, createIdentityCommands, hasAnchorAt, hostedMcpUrl, identityLineOf, idle, installService, launchdPlist, log, manualFrontMatter, manualPointer, manualVersion, markAlwaysOnInstalledVersion, markAlwaysOnOptOut, markAlwaysOnWanted, normalizeHandle, offerDeclined, parseServiceHome, planForTest, probeHostedMcp, readAlwaysOnInstalledVersion, readAnchorHandleAt, readAnchorHandleFrom, readJsonFile, readState, recordOfferDeclined, removeAnchorAt, renderAnchorBlock, renderDeclinedBlock, renderUnregisteredBlock, serviceDefinitionCurrent, serviceInstalled, serviceLabelFor, serviceStatus, setServiceCommandRunnerForTests, setServiceHostOsForTests, spawnCommand, spawnCommandSync, stripAnchorBlock, systemdQuote, systemdUnit, trayHasWaiting, traySummary, uninstallService, upsertAnchorBlock, writeAnchor, writeState, xmlEscape };
|