@suwujs/king-ai 0.2.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 +96 -0
- package/dist/src/agent-config-validation.d.ts +9 -0
- package/dist/src/agent-config-validation.js +30 -0
- package/dist/src/api.d.ts +4 -0
- package/dist/src/api.js +48 -0
- package/dist/src/attachments.d.ts +45 -0
- package/dist/src/attachments.js +322 -0
- package/dist/src/cli.d.ts +20 -0
- package/dist/src/cli.js +1697 -0
- package/dist/src/config.d.ts +3 -0
- package/dist/src/config.js +20 -0
- package/dist/src/cron.d.ts +11 -0
- package/dist/src/cron.js +65 -0
- package/dist/src/daemon.d.ts +36 -0
- package/dist/src/daemon.js +373 -0
- package/dist/src/engine.d.ts +32 -0
- package/dist/src/engine.js +1014 -0
- package/dist/src/heartbeat.d.ts +18 -0
- package/dist/src/heartbeat.js +28 -0
- package/dist/src/host-api.d.ts +40 -0
- package/dist/src/host-api.js +59 -0
- package/dist/src/host-control.d.ts +48 -0
- package/dist/src/host-control.js +1279 -0
- package/dist/src/host-export.d.ts +50 -0
- package/dist/src/host-export.js +187 -0
- package/dist/src/host-feedback.d.ts +78 -0
- package/dist/src/host-feedback.js +178 -0
- package/dist/src/host-home.d.ts +13 -0
- package/dist/src/host-home.js +54 -0
- package/dist/src/host-ledger.d.ts +261 -0
- package/dist/src/host-ledger.js +554 -0
- package/dist/src/host-loop-events.d.ts +69 -0
- package/dist/src/host-loop-events.js +288 -0
- package/dist/src/host-permission.d.ts +36 -0
- package/dist/src/host-permission.js +180 -0
- package/dist/src/host-policy.d.ts +15 -0
- package/dist/src/host-policy.js +36 -0
- package/dist/src/host-run-executor.d.ts +13 -0
- package/dist/src/host-run-executor.js +221 -0
- package/dist/src/host-run-heartbeat.d.ts +40 -0
- package/dist/src/host-run-heartbeat.js +103 -0
- package/dist/src/host-run-layout.d.ts +17 -0
- package/dist/src/host-run-layout.js +387 -0
- package/dist/src/host-run-meta.d.ts +41 -0
- package/dist/src/host-run-meta.js +115 -0
- package/dist/src/host-run-spec.d.ts +149 -0
- package/dist/src/host-run-spec.js +465 -0
- package/dist/src/host-runs.d.ts +77 -0
- package/dist/src/host-runs.js +195 -0
- package/dist/src/host-sdk.d.ts +412 -0
- package/dist/src/host-sdk.js +628 -0
- package/dist/src/host-server.d.ts +26 -0
- package/dist/src/host-server.js +921 -0
- package/dist/src/host-timeline.d.ts +24 -0
- package/dist/src/host-timeline.js +161 -0
- package/dist/src/jsonl.d.ts +13 -0
- package/dist/src/jsonl.js +47 -0
- package/dist/src/lifecycle.d.ts +5 -0
- package/dist/src/lifecycle.js +18 -0
- package/dist/src/message-routing.d.ts +32 -0
- package/dist/src/message-routing.js +119 -0
- package/dist/src/paths.d.ts +19 -0
- package/dist/src/paths.js +26 -0
- package/dist/src/project-profile.d.ts +49 -0
- package/dist/src/project-profile.js +356 -0
- package/dist/src/remediation.d.ts +14 -0
- package/dist/src/remediation.js +114 -0
- package/dist/src/remote-devices.d.ts +41 -0
- package/dist/src/remote-devices.js +156 -0
- package/dist/src/remote-diagnostics.d.ts +39 -0
- package/dist/src/remote-diagnostics.js +199 -0
- package/dist/src/remote-ssh.d.ts +39 -0
- package/dist/src/remote-ssh.js +129 -0
- package/dist/src/run-stream.d.ts +57 -0
- package/dist/src/run-stream.js +119 -0
- package/dist/src/runner.d.ts +131 -0
- package/dist/src/runner.js +1161 -0
- package/dist/src/runtime-data.d.ts +68 -0
- package/dist/src/runtime-data.js +172 -0
- package/dist/src/service.d.ts +114 -0
- package/dist/src/service.js +631 -0
- package/dist/src/shared-skills.d.ts +26 -0
- package/dist/src/shared-skills.js +85 -0
- package/dist/src/shim.d.ts +1 -0
- package/dist/src/shim.js +64 -0
- package/dist/src/skill-check.d.ts +17 -0
- package/dist/src/skill-check.js +158 -0
- package/dist/src/sse.d.ts +9 -0
- package/dist/src/sse.js +36 -0
- package/dist/src/team-routing.d.ts +55 -0
- package/dist/src/team-routing.js +131 -0
- package/dist/src/team-workflow.d.ts +78 -0
- package/dist/src/team-workflow.js +253 -0
- package/dist/src/text.d.ts +7 -0
- package/dist/src/text.js +27 -0
- package/dist/src/types.d.ts +98 -0
- package/dist/src/types.js +1 -0
- package/dist/src/usage.d.ts +116 -0
- package/dist/src/usage.js +350 -0
- package/dist/src/workspace.d.ts +9 -0
- package/dist/src/workspace.js +56 -0
- package/dist/src/worktree.d.ts +47 -0
- package/dist/src/worktree.js +201 -0
- package/package.json +63 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { RunningEvent, RunningState } from "./service.js";
|
|
2
|
+
import type { UsagePricingRule, UsageSummary } from "./usage.js";
|
|
3
|
+
export type RuntimeClassification = "productive" | "idle" | "blocked" | "backlog_stuck" | "error";
|
|
4
|
+
export interface ProviderCapability {
|
|
5
|
+
provider: string;
|
|
6
|
+
engines: string[];
|
|
7
|
+
usage: "local_tokens" | "api_usage" | "unavailable";
|
|
8
|
+
pricing: "env_pricing" | "provider_api" | "unavailable";
|
|
9
|
+
notes: string[];
|
|
10
|
+
}
|
|
11
|
+
export interface RuntimeResultsRow {
|
|
12
|
+
agent: string;
|
|
13
|
+
engine: string;
|
|
14
|
+
runId: string;
|
|
15
|
+
source: string;
|
|
16
|
+
status: string;
|
|
17
|
+
durationMs: number;
|
|
18
|
+
tokens: number;
|
|
19
|
+
classification: RuntimeClassification;
|
|
20
|
+
reason: string;
|
|
21
|
+
}
|
|
22
|
+
export interface UsageRuntimeDataFile {
|
|
23
|
+
schemaVersion: 1;
|
|
24
|
+
dataSource: {
|
|
25
|
+
mode: "daemon-state";
|
|
26
|
+
generatedAt: string;
|
|
27
|
+
secretValuesIncluded: false;
|
|
28
|
+
warnings: string[];
|
|
29
|
+
};
|
|
30
|
+
usage: UsageSummary;
|
|
31
|
+
providerCapabilities: ProviderCapability[];
|
|
32
|
+
runtimeResults: RuntimeResultsRow[];
|
|
33
|
+
state: {
|
|
34
|
+
version?: string;
|
|
35
|
+
pid?: number;
|
|
36
|
+
startedAt?: string;
|
|
37
|
+
serverUrl?: string;
|
|
38
|
+
computerId?: string;
|
|
39
|
+
workspaces: string[];
|
|
40
|
+
agents: Array<{
|
|
41
|
+
id: string;
|
|
42
|
+
name: string;
|
|
43
|
+
engine: string;
|
|
44
|
+
lifecycle?: string;
|
|
45
|
+
status?: string;
|
|
46
|
+
model?: string;
|
|
47
|
+
workspaceRoot?: string;
|
|
48
|
+
updatedAt: string;
|
|
49
|
+
}>;
|
|
50
|
+
events: RunningEvent[];
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export declare const PROVIDER_CAPABILITIES: ProviderCapability[];
|
|
54
|
+
export declare const RUNTIME_RESULTS_HEADER: string;
|
|
55
|
+
export declare function formatProviderCapabilities(capabilities?: ProviderCapability[]): string;
|
|
56
|
+
export declare function classifyRuntimeEvent(event: RunningEvent): {
|
|
57
|
+
classification: RuntimeClassification;
|
|
58
|
+
reason: string;
|
|
59
|
+
};
|
|
60
|
+
export declare function buildRuntimeResultsRows(state: RunningState | null): RuntimeResultsRow[];
|
|
61
|
+
export declare function formatRuntimeResultsTable(rows: RuntimeResultsRow[]): string;
|
|
62
|
+
export declare function buildUsageRuntimeData(state: RunningState | null, options?: {
|
|
63
|
+
budget?: number | null;
|
|
64
|
+
pricingRules?: UsagePricingRule[];
|
|
65
|
+
generatedAt?: string;
|
|
66
|
+
}): UsageRuntimeDataFile;
|
|
67
|
+
export declare function writeUsageRuntimeData(file: string, data: UsageRuntimeDataFile): Promise<string>;
|
|
68
|
+
export declare function sanitizeRuntimeData<T>(value: T, home?: string): T;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
2
|
+
import { dirname, resolve } from "node:path";
|
|
3
|
+
import { homedir } from "node:os";
|
|
4
|
+
import { summarizeAgentUsage } from "./usage.js";
|
|
5
|
+
export const PROVIDER_CAPABILITIES = [
|
|
6
|
+
{
|
|
7
|
+
provider: "OpenAI",
|
|
8
|
+
engines: ["codex"],
|
|
9
|
+
usage: "local_tokens",
|
|
10
|
+
pricing: "env_pricing",
|
|
11
|
+
notes: ["King AI records CLI-reported token usage when available.", "Set KING_AI_USAGE_PRICING for estimated local cost."]
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
provider: "Anthropic",
|
|
15
|
+
engines: ["claude"],
|
|
16
|
+
usage: "local_tokens",
|
|
17
|
+
pricing: "env_pricing",
|
|
18
|
+
notes: ["King AI records Claude CLI usage fields when the engine returns them.", "Set KING_AI_USAGE_PRICING for estimated local cost."]
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
provider: "OpenRouter",
|
|
22
|
+
engines: ["openrouter"],
|
|
23
|
+
usage: "unavailable",
|
|
24
|
+
pricing: "env_pricing",
|
|
25
|
+
notes: ["No first-class King AI engine adapter is wired yet.", "Pricing can still be represented with KING_AI_USAGE_PRICING once an adapter records usage."]
|
|
26
|
+
}
|
|
27
|
+
];
|
|
28
|
+
export const RUNTIME_RESULTS_HEADER = [
|
|
29
|
+
"agent",
|
|
30
|
+
"engine",
|
|
31
|
+
"run_id",
|
|
32
|
+
"source",
|
|
33
|
+
"status",
|
|
34
|
+
"duration_ms",
|
|
35
|
+
"tokens",
|
|
36
|
+
"classification",
|
|
37
|
+
"reason"
|
|
38
|
+
].join("\t") + "\n";
|
|
39
|
+
export function formatProviderCapabilities(capabilities = PROVIDER_CAPABILITIES) {
|
|
40
|
+
return [
|
|
41
|
+
"provider capabilities:",
|
|
42
|
+
...capabilities.map((capability) => ` - ${capability.provider}: engines=${capability.engines.join(",") || "none"} usage=${capability.usage} pricing=${capability.pricing}`)
|
|
43
|
+
].join("\n");
|
|
44
|
+
}
|
|
45
|
+
export function classifyRuntimeEvent(event) {
|
|
46
|
+
const kind = event.kind.toLowerCase();
|
|
47
|
+
const detail = event.detail ?? "";
|
|
48
|
+
if (/error|failed|failure/.test(kind) || /error|failed|usage limit|quota/i.test(detail)) {
|
|
49
|
+
return { classification: "error", reason: detail || event.kind };
|
|
50
|
+
}
|
|
51
|
+
if (/blocked|budget\.exceeded/.test(kind) || /blocked|waiting for dependency/i.test(detail)) {
|
|
52
|
+
return { classification: "blocked", reason: detail || event.kind };
|
|
53
|
+
}
|
|
54
|
+
if (/wake\.received|queue\.backlog|agenda/.test(kind) && /pending|unread|backlog/i.test(detail)) {
|
|
55
|
+
return { classification: "backlog_stuck", reason: detail || event.kind };
|
|
56
|
+
}
|
|
57
|
+
if (/turn\.completed|task\.transition|artifact\.created|engine\.session\.started/.test(kind)) {
|
|
58
|
+
return { classification: "productive", reason: detail || event.kind };
|
|
59
|
+
}
|
|
60
|
+
return { classification: "idle", reason: detail || event.kind };
|
|
61
|
+
}
|
|
62
|
+
export function buildRuntimeResultsRows(state) {
|
|
63
|
+
const events = state?.events ?? [];
|
|
64
|
+
const rows = [];
|
|
65
|
+
for (const agent of state?.agents ?? []) {
|
|
66
|
+
if (!agent.runStats || agent.runStats.turns === 0)
|
|
67
|
+
continue;
|
|
68
|
+
const latestEvent = [...events].reverse().find((event) => event.detail?.includes(agent.id)) ?? events.at(-1);
|
|
69
|
+
const classified = latestEvent ? classifyRuntimeEvent(latestEvent) : { classification: agent.runStats.failed > 0 ? "error" : "idle", reason: "run stats only" };
|
|
70
|
+
rows.push({
|
|
71
|
+
agent: agent.id,
|
|
72
|
+
engine: agent.engine,
|
|
73
|
+
runId: agent.runStats.lastRunAt ?? "",
|
|
74
|
+
source: "daemon-state",
|
|
75
|
+
status: agent.runStats.lastStatus ?? agent.status ?? "unknown",
|
|
76
|
+
durationMs: agent.runStats.lastDurationMs ?? 0,
|
|
77
|
+
tokens: agent.runStats.totalTokens,
|
|
78
|
+
classification: classified.classification,
|
|
79
|
+
reason: classified.reason
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
return rows.sort((left, right) => left.agent.localeCompare(right.agent));
|
|
83
|
+
}
|
|
84
|
+
export function formatRuntimeResultsTable(rows) {
|
|
85
|
+
return RUNTIME_RESULTS_HEADER + rows.map((row) => [
|
|
86
|
+
row.agent,
|
|
87
|
+
row.engine,
|
|
88
|
+
row.runId,
|
|
89
|
+
row.source,
|
|
90
|
+
row.status,
|
|
91
|
+
String(row.durationMs),
|
|
92
|
+
String(row.tokens),
|
|
93
|
+
row.classification,
|
|
94
|
+
row.reason
|
|
95
|
+
].map(tsvCell).join("\t")).join("\n") + (rows.length ? "\n" : "");
|
|
96
|
+
}
|
|
97
|
+
export function buildUsageRuntimeData(state, options = {}) {
|
|
98
|
+
const usage = summarizeAgentUsage(state?.agents ?? [], options.budget, options.pricingRules ?? []);
|
|
99
|
+
const warnings = [];
|
|
100
|
+
if (!state)
|
|
101
|
+
warnings.push("No running daemon state was found.");
|
|
102
|
+
if (!usage.turns)
|
|
103
|
+
warnings.push("No completed agent run usage has been recorded yet.");
|
|
104
|
+
const workspaces = state?.capabilities?.workspaces ?? [];
|
|
105
|
+
return sanitizeRuntimeData({
|
|
106
|
+
schemaVersion: 1,
|
|
107
|
+
dataSource: {
|
|
108
|
+
mode: "daemon-state",
|
|
109
|
+
generatedAt: options.generatedAt ?? new Date().toISOString(),
|
|
110
|
+
secretValuesIncluded: false,
|
|
111
|
+
warnings
|
|
112
|
+
},
|
|
113
|
+
usage,
|
|
114
|
+
providerCapabilities: PROVIDER_CAPABILITIES,
|
|
115
|
+
runtimeResults: buildRuntimeResultsRows(state),
|
|
116
|
+
state: {
|
|
117
|
+
version: state?.version,
|
|
118
|
+
pid: state?.pid,
|
|
119
|
+
startedAt: state?.startedAt,
|
|
120
|
+
serverUrl: state?.serverUrl,
|
|
121
|
+
computerId: state?.computerId,
|
|
122
|
+
workspaces,
|
|
123
|
+
agents: (state?.agents ?? []).map((agent) => ({
|
|
124
|
+
id: agent.id,
|
|
125
|
+
name: agent.name,
|
|
126
|
+
engine: agent.engine,
|
|
127
|
+
lifecycle: agent.lifecycle,
|
|
128
|
+
status: agent.status,
|
|
129
|
+
model: agent.model,
|
|
130
|
+
workspaceRoot: agent.workspaceRoot,
|
|
131
|
+
updatedAt: agent.updatedAt
|
|
132
|
+
})),
|
|
133
|
+
events: state?.events ?? []
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
export async function writeUsageRuntimeData(file, data) {
|
|
138
|
+
const out = resolve(file);
|
|
139
|
+
await mkdir(dirname(out), { recursive: true });
|
|
140
|
+
await writeFile(out, JSON.stringify(data, null, 2), "utf8");
|
|
141
|
+
return out;
|
|
142
|
+
}
|
|
143
|
+
export function sanitizeRuntimeData(value, home = homedir()) {
|
|
144
|
+
return sanitizeValue(value, normalizePath(home));
|
|
145
|
+
}
|
|
146
|
+
function sanitizeValue(value, home) {
|
|
147
|
+
if (typeof value === "string")
|
|
148
|
+
return sanitizeString(value, home);
|
|
149
|
+
if (Array.isArray(value))
|
|
150
|
+
return value.map((entry) => sanitizeValue(entry, home));
|
|
151
|
+
if (!value || typeof value !== "object")
|
|
152
|
+
return value;
|
|
153
|
+
return Object.fromEntries(Object.entries(value).map(([key, entry]) => [key, sanitizeValue(entry, home)]));
|
|
154
|
+
}
|
|
155
|
+
function sanitizeString(value, home) {
|
|
156
|
+
const normalized = normalizePath(value);
|
|
157
|
+
if (home && normalized === home)
|
|
158
|
+
return "<home>";
|
|
159
|
+
if (home && normalized.startsWith(`${home}/`))
|
|
160
|
+
return `<home>/${normalized.slice(home.length + 1)}`;
|
|
161
|
+
const homeRedacted = home ? value.replace(new RegExp(escapeRegExp(home), "g"), "<home>") : value;
|
|
162
|
+
return homeRedacted.replace(/\/Users\/[^/\s"]+/g, "private://user");
|
|
163
|
+
}
|
|
164
|
+
function normalizePath(value) {
|
|
165
|
+
return value.replace(/\\/g, "/").replace(/\/+$/, "");
|
|
166
|
+
}
|
|
167
|
+
function escapeRegExp(value) {
|
|
168
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
169
|
+
}
|
|
170
|
+
function tsvCell(value) {
|
|
171
|
+
return value.replace(/\t/g, " ").replace(/\r?\n/g, " ").trim();
|
|
172
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { CommandName } from "./paths.js";
|
|
2
|
+
import type { LocalCapabilities } from "./workspace.js";
|
|
3
|
+
import type { WorktreePlan } from "./worktree.js";
|
|
4
|
+
import type { AgentRunStats } from "./usage.js";
|
|
5
|
+
import type { TokenBudgetCheck } from "./usage.js";
|
|
6
|
+
import type { RemediationAdvice } from "./remediation.js";
|
|
7
|
+
import type { AgentConfigWarning } from "./agent-config-validation.js";
|
|
8
|
+
export type DarwinServiceStatus = {
|
|
9
|
+
pid: number | null;
|
|
10
|
+
lastExitStatus: number | null;
|
|
11
|
+
};
|
|
12
|
+
export type RunningEvent = {
|
|
13
|
+
at: string;
|
|
14
|
+
kind: string;
|
|
15
|
+
detail?: string;
|
|
16
|
+
};
|
|
17
|
+
export type RunningEventCategory = "agent" | "turn" | "budget" | "daemon" | "other";
|
|
18
|
+
export type RunningAgentState = {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
engine: string;
|
|
22
|
+
lifecycle?: string;
|
|
23
|
+
status?: "idle" | "running" | "disabled";
|
|
24
|
+
model?: string;
|
|
25
|
+
sharedSkillSnapshot?: {
|
|
26
|
+
id: string;
|
|
27
|
+
root: string;
|
|
28
|
+
manifestPath: string;
|
|
29
|
+
skills: string[];
|
|
30
|
+
} | null;
|
|
31
|
+
hostHomeEntries?: Array<{
|
|
32
|
+
name: string;
|
|
33
|
+
source: string;
|
|
34
|
+
target: string;
|
|
35
|
+
linked: boolean;
|
|
36
|
+
reason?: string;
|
|
37
|
+
}>;
|
|
38
|
+
workspaceRoot?: string;
|
|
39
|
+
worktreePlans?: WorktreePlan[];
|
|
40
|
+
worktreeMaterializationEnabled?: boolean;
|
|
41
|
+
runStats?: AgentRunStats;
|
|
42
|
+
tokenBudget?: TokenBudgetCheck;
|
|
43
|
+
remediation?: RemediationAdvice | null;
|
|
44
|
+
configWarnings?: AgentConfigWarning[];
|
|
45
|
+
updatedAt: string;
|
|
46
|
+
};
|
|
47
|
+
export type RunningState = {
|
|
48
|
+
version: string;
|
|
49
|
+
pid: number;
|
|
50
|
+
startedAt: string;
|
|
51
|
+
serverUrl?: string;
|
|
52
|
+
computerId?: string;
|
|
53
|
+
capabilities?: LocalCapabilities;
|
|
54
|
+
lastHeartbeatAt?: string;
|
|
55
|
+
lastSyncAt?: string;
|
|
56
|
+
agents?: RunningAgentState[];
|
|
57
|
+
events?: RunningEvent[];
|
|
58
|
+
};
|
|
59
|
+
export declare function daemonLogPath(): string;
|
|
60
|
+
export declare function serviceNames(commandName?: CommandName): {
|
|
61
|
+
packageName: string;
|
|
62
|
+
serviceUnit: string;
|
|
63
|
+
displayName: string;
|
|
64
|
+
serviceLabel: string;
|
|
65
|
+
};
|
|
66
|
+
export declare function updateRegistryUrl(commandName?: CommandName): string;
|
|
67
|
+
export declare function versionGt(a: string, b: string): boolean;
|
|
68
|
+
export declare function windowsTaskName(commandName?: CommandName): string;
|
|
69
|
+
export declare function windowsWrapperPath(commandName?: CommandName): string;
|
|
70
|
+
export declare function buildWindowsServiceWrapper(args: string[], logPath?: string): string;
|
|
71
|
+
export declare function parseWindowsTaskStatus(stdout: string): {
|
|
72
|
+
status?: string;
|
|
73
|
+
lastResult?: string;
|
|
74
|
+
taskName?: string;
|
|
75
|
+
};
|
|
76
|
+
export declare function shouldKillDaemonCommand(command: string): boolean;
|
|
77
|
+
export declare function parseDarwinLaunchctlStatus(stdout: string): DarwinServiceStatus;
|
|
78
|
+
export declare function parseLinuxMainPid(stdout: string): number | null;
|
|
79
|
+
export declare function reloadService(commandName?: CommandName): Promise<void>;
|
|
80
|
+
export declare function installService(serverUrl?: string, commandName?: CommandName): Promise<void>;
|
|
81
|
+
export declare function uninstallService(commandName?: CommandName): Promise<void>;
|
|
82
|
+
export declare function isServiceInstalled(commandName?: CommandName): boolean;
|
|
83
|
+
export declare function restartService(commandName?: CommandName): Promise<void>;
|
|
84
|
+
export declare function killRunningDaemons(): Promise<number>;
|
|
85
|
+
export declare function stopService(commandName?: CommandName): Promise<void>;
|
|
86
|
+
export declare function printStatus(commandName?: CommandName): Promise<void>;
|
|
87
|
+
export declare function resolveRunningVersion(livePid?: number | null, commandName?: CommandName): Promise<string>;
|
|
88
|
+
export declare function readRunningState(path?: string): Promise<RunningState | null>;
|
|
89
|
+
export declare function updateRunningStateData(previous: RunningState | null, patch: Partial<Omit<RunningState, "events">> & {
|
|
90
|
+
event?: RunningEvent;
|
|
91
|
+
}): RunningState;
|
|
92
|
+
export declare function writeRunningState(patch?: Partial<Omit<RunningState, "events">> & {
|
|
93
|
+
event?: RunningEvent;
|
|
94
|
+
}): Promise<void>;
|
|
95
|
+
export declare function recordRunningState(patch: Partial<Omit<RunningState, "events">> & {
|
|
96
|
+
event?: RunningEvent;
|
|
97
|
+
}): void;
|
|
98
|
+
export declare function formatRecentRunningEvents(state: RunningState | null, max?: number): string;
|
|
99
|
+
export declare function runningEventCategory(kind: string): RunningEventCategory;
|
|
100
|
+
export declare function groupRunningEvents(events?: RunningEvent[], maxPerCategory?: number): Record<RunningEventCategory, RunningEvent[]>;
|
|
101
|
+
export declare function formatRunningEventSummary(state: RunningState | null, maxPerCategory?: number): string;
|
|
102
|
+
export declare function formatRunningStateSnapshot(state: RunningState | null, eventMax?: number): string;
|
|
103
|
+
export declare function formatWatchSnapshot(state: RunningState | null, now?: Date): string;
|
|
104
|
+
export declare function watchStatus(intervalMs?: number): Promise<void>;
|
|
105
|
+
export declare function worktreePlansFromRunningState(state: RunningState | null): WorktreePlan[];
|
|
106
|
+
export declare function prepareWorktrees(options?: {
|
|
107
|
+
execute?: boolean;
|
|
108
|
+
}): Promise<void>;
|
|
109
|
+
export declare function cleanupWorktrees(options?: {
|
|
110
|
+
execute?: boolean;
|
|
111
|
+
}): Promise<void>;
|
|
112
|
+
export declare function rotateLogsIfNeeded(logPath?: string, maxBytes?: number): Promise<void>;
|
|
113
|
+
export declare function checkForUpdate(fetchImpl?: typeof fetch, commandName?: CommandName): Promise<string | null>;
|
|
114
|
+
export declare function tailLogs(commandName?: CommandName): Promise<void>;
|