@serviceme/devtools-core 0.1.6 → 0.1.8
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/dist/index.d.mts +127 -75
- package/dist/index.d.ts +127 -75
- package/dist/index.js +214 -137
- package/dist/index.mjs +209 -139
- package/package.json +4 -2
package/dist/index.d.mts
CHANGED
|
@@ -2,6 +2,36 @@ import * as _serviceme_devtools_protocol from '@serviceme/devtools-protocol';
|
|
|
2
2
|
import { AgentMarketplaceEntry, AgentMutationRequest, AgentPermissionSummary, CopilotDoctorResult, CopilotPromptOptions, CopilotPromptResult, EnvironmentCheckResult, KnownEnvironmentTool, ToolCheckResult, ServiceMeImageValidationResult, ServiceMeImageInfo, ServiceMeImageCompressOptions, ServiceMeImageCompressResult, JsonSortOptions, JsonValidationResult, AgentToolRiskLevel, AgentToolPermission, ServiceMeProjectExtractTemplateInput, ServiceMeProjectExtractTemplateResult, ServiceMeProjectInstallDepsResult, ServiceMeProjectMakeScriptsExecutableResult, ServiceMeProjectGitInitResult, ServiceMeProjectScaffoldPruneResult, TaskExecutionStatus, ScheduledTaskType, TaskPayload, ScheduledTasksConfig, ScheduledTask, TaskStartedEventParams, TaskOutputEventParams, TaskCompletedEventParams, TaskFailedEventParams, TaskCancelledEventParams, TaskExecutionSnapshot, RunningTaskInfo, TaskExecutionLog, SkillMarketplaceEntry, SkillMutationRequest } from '@serviceme/devtools-protocol';
|
|
3
3
|
import * as fs from 'node:fs/promises';
|
|
4
4
|
|
|
5
|
+
type AgentInstallScope = "workspace" | "user";
|
|
6
|
+
interface InstalledAgent {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
scope: AgentInstallScope;
|
|
10
|
+
installedAt: string;
|
|
11
|
+
}
|
|
12
|
+
interface AgentsStateFile {
|
|
13
|
+
schemaVersion: number;
|
|
14
|
+
installedAgents: InstalledAgent[];
|
|
15
|
+
}
|
|
16
|
+
interface AgentDownloadFile {
|
|
17
|
+
path: string;
|
|
18
|
+
content: string;
|
|
19
|
+
executable?: boolean;
|
|
20
|
+
}
|
|
21
|
+
interface AgentStoreFileSystem {
|
|
22
|
+
readdir: typeof fs.readdir;
|
|
23
|
+
readFile: typeof fs.readFile;
|
|
24
|
+
writeFile: typeof fs.writeFile;
|
|
25
|
+
mkdir: typeof fs.mkdir;
|
|
26
|
+
chmod: typeof fs.chmod;
|
|
27
|
+
}
|
|
28
|
+
interface AgentStoreOptions {
|
|
29
|
+
workspacePath: string;
|
|
30
|
+
userAgentsRoot: string;
|
|
31
|
+
fileSystem?: AgentStoreFileSystem;
|
|
32
|
+
schemaVersion?: number;
|
|
33
|
+
}
|
|
34
|
+
|
|
5
35
|
interface AgentCatalog {
|
|
6
36
|
agents: AgentMarketplaceEntry[];
|
|
7
37
|
fetchedAt: string;
|
|
@@ -15,6 +45,7 @@ declare class AgentCatalogClient {
|
|
|
15
45
|
private readonly baseUrl?;
|
|
16
46
|
constructor(options?: AgentCatalogClientOptions);
|
|
17
47
|
getCatalog(): Promise<AgentCatalog>;
|
|
48
|
+
downloadAgent(remoteId: string): Promise<AgentDownloadFile[]>;
|
|
18
49
|
}
|
|
19
50
|
|
|
20
51
|
interface AgentStoreLike {
|
|
@@ -47,36 +78,6 @@ declare class AgentReconciler {
|
|
|
47
78
|
private hasHighRiskTool;
|
|
48
79
|
}
|
|
49
80
|
|
|
50
|
-
type AgentInstallScope = "workspace" | "user";
|
|
51
|
-
interface InstalledAgent {
|
|
52
|
-
id: string;
|
|
53
|
-
name: string;
|
|
54
|
-
scope: AgentInstallScope;
|
|
55
|
-
installedAt: string;
|
|
56
|
-
}
|
|
57
|
-
interface AgentsStateFile {
|
|
58
|
-
schemaVersion: number;
|
|
59
|
-
installedAgents: InstalledAgent[];
|
|
60
|
-
}
|
|
61
|
-
interface AgentDownloadFile {
|
|
62
|
-
path: string;
|
|
63
|
-
content: string;
|
|
64
|
-
executable?: boolean;
|
|
65
|
-
}
|
|
66
|
-
interface AgentStoreFileSystem {
|
|
67
|
-
readdir: typeof fs.readdir;
|
|
68
|
-
readFile: typeof fs.readFile;
|
|
69
|
-
writeFile: typeof fs.writeFile;
|
|
70
|
-
mkdir: typeof fs.mkdir;
|
|
71
|
-
chmod: typeof fs.chmod;
|
|
72
|
-
}
|
|
73
|
-
interface AgentStoreOptions {
|
|
74
|
-
workspacePath: string;
|
|
75
|
-
userAgentsRoot: string;
|
|
76
|
-
fileSystem?: AgentStoreFileSystem;
|
|
77
|
-
schemaVersion?: number;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
81
|
declare class AgentStore {
|
|
81
82
|
private readonly workspacePath;
|
|
82
83
|
private readonly userAgentsRoot;
|
|
@@ -108,7 +109,39 @@ declare function createCopilotAuthRequiredError(): _serviceme_devtools_protocol.
|
|
|
108
109
|
|
|
109
110
|
declare function copilotPrompt(options: CopilotPromptOptions): Promise<CopilotPromptResult>;
|
|
110
111
|
|
|
112
|
+
interface RunCommandOptions {
|
|
113
|
+
args?: string[];
|
|
114
|
+
cwd?: string;
|
|
115
|
+
env?: NodeJS.ProcessEnv;
|
|
116
|
+
timeoutMs?: number;
|
|
117
|
+
stdin?: string;
|
|
118
|
+
shell?: boolean;
|
|
119
|
+
}
|
|
120
|
+
interface RunCommandResult {
|
|
121
|
+
stdout: string;
|
|
122
|
+
stderr: string;
|
|
123
|
+
code: number;
|
|
124
|
+
}
|
|
125
|
+
declare function runCommand(command: string, options?: RunCommandOptions): Promise<RunCommandResult>;
|
|
126
|
+
|
|
127
|
+
interface EnvironmentInspectorOptions {
|
|
128
|
+
/**
|
|
129
|
+
* Override the command runner. Production callers should leave this
|
|
130
|
+
* undefined and rely on the default `runCommand` from `../process/runCommand`;
|
|
131
|
+
* tests inject a fake to drive error/edge branches without spawning
|
|
132
|
+
* real subprocesses.
|
|
133
|
+
*/
|
|
134
|
+
runCommand?: typeof runCommand;
|
|
135
|
+
/**
|
|
136
|
+
* Override the detected platform. Defaults to `process.platform`. Tests
|
|
137
|
+
* use this to exercise the Windows-specific branches of the inspector.
|
|
138
|
+
*/
|
|
139
|
+
platform?: NodeJS.Platform;
|
|
140
|
+
}
|
|
111
141
|
declare class EnvironmentInspector {
|
|
142
|
+
private readonly runCommandFn;
|
|
143
|
+
private readonly platform;
|
|
144
|
+
constructor(options?: EnvironmentInspectorOptions);
|
|
112
145
|
checkEnvironment(): Promise<EnvironmentCheckResult>;
|
|
113
146
|
checkTool(toolName: KnownEnvironmentTool): Promise<ToolCheckResult>;
|
|
114
147
|
private getToolPath;
|
|
@@ -166,6 +199,7 @@ declare class ProjectTools {
|
|
|
166
199
|
makeScriptsExecutable(workspacePath: string): Promise<ServiceMeProjectMakeScriptsExecutableResult>;
|
|
167
200
|
initializeGit(workspacePath: string): Promise<ServiceMeProjectGitInitResult>;
|
|
168
201
|
runScaffoldPrune(workspacePath: string, preset?: string): Promise<ServiceMeProjectScaffoldPruneResult>;
|
|
202
|
+
private ensurePresetManifest;
|
|
169
203
|
private findScripts;
|
|
170
204
|
private pathExists;
|
|
171
205
|
private selectExtractedDirectory;
|
|
@@ -192,38 +226,6 @@ declare class PidManager {
|
|
|
192
226
|
getRunningPid(): number | null;
|
|
193
227
|
}
|
|
194
228
|
|
|
195
|
-
declare class SchedulerDaemon {
|
|
196
|
-
private readonly workspacePath;
|
|
197
|
-
private readonly configManager;
|
|
198
|
-
private readonly logManager;
|
|
199
|
-
private readonly pidManager;
|
|
200
|
-
private readonly logger;
|
|
201
|
-
private tickTimer;
|
|
202
|
-
private watcher;
|
|
203
|
-
private running;
|
|
204
|
-
private startTime;
|
|
205
|
-
private lastRun;
|
|
206
|
-
private taskRunning;
|
|
207
|
-
constructor(workspacePath: string);
|
|
208
|
-
start(): void;
|
|
209
|
-
stop(): void;
|
|
210
|
-
private setupConfigWatch;
|
|
211
|
-
private tick;
|
|
212
|
-
private shouldRun;
|
|
213
|
-
private executeTask;
|
|
214
|
-
getStatus(): {
|
|
215
|
-
running: boolean;
|
|
216
|
-
pid: number;
|
|
217
|
-
uptimeSeconds: number | null;
|
|
218
|
-
tasksRegistered: number;
|
|
219
|
-
tasksEnabled: number;
|
|
220
|
-
workspacePath: string;
|
|
221
|
-
pidFile: string;
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
declare function parseIntervalMs(schedule: string): number;
|
|
225
|
-
declare function matchesCron(expression: string, date: Date): boolean;
|
|
226
|
-
|
|
227
229
|
interface ExecutorResult {
|
|
228
230
|
status: TaskExecutionStatus;
|
|
229
231
|
output?: string;
|
|
@@ -258,6 +260,48 @@ declare class ShellExecutor implements StreamingTaskExecutor {
|
|
|
258
260
|
|
|
259
261
|
declare function getExecutor(taskType: ScheduledTaskType): TaskExecutor;
|
|
260
262
|
|
|
263
|
+
interface SchedulerDaemonOptions {
|
|
264
|
+
/**
|
|
265
|
+
* Override the executor factory. Production callers should leave this
|
|
266
|
+
* undefined and rely on the default `getExecutor` from `../executors`;
|
|
267
|
+
* tests inject a fake to drive the execution branch without spawning
|
|
268
|
+
* real subprocesses.
|
|
269
|
+
*/
|
|
270
|
+
getExecutor?: typeof getExecutor;
|
|
271
|
+
}
|
|
272
|
+
declare class SchedulerDaemon {
|
|
273
|
+
private readonly workspacePath;
|
|
274
|
+
private readonly configManager;
|
|
275
|
+
private readonly logManager;
|
|
276
|
+
private readonly pidManager;
|
|
277
|
+
private readonly logger;
|
|
278
|
+
private readonly getExecutor;
|
|
279
|
+
private tickTimer;
|
|
280
|
+
private watcher;
|
|
281
|
+
private running;
|
|
282
|
+
private startTime;
|
|
283
|
+
private lastRun;
|
|
284
|
+
private taskRunning;
|
|
285
|
+
constructor(workspacePath: string, options?: SchedulerDaemonOptions);
|
|
286
|
+
start(): void;
|
|
287
|
+
stop(): void;
|
|
288
|
+
private setupConfigWatch;
|
|
289
|
+
private tick;
|
|
290
|
+
private shouldRun;
|
|
291
|
+
private executeTask;
|
|
292
|
+
getStatus(): {
|
|
293
|
+
running: boolean;
|
|
294
|
+
pid: number;
|
|
295
|
+
uptimeSeconds: number | null;
|
|
296
|
+
tasksRegistered: number;
|
|
297
|
+
tasksEnabled: number;
|
|
298
|
+
workspacePath: string;
|
|
299
|
+
pidFile: string;
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
declare function parseIntervalMs(schedule: string): number;
|
|
303
|
+
declare function matchesCron(expression: string, date: Date): boolean;
|
|
304
|
+
|
|
261
305
|
declare function validateTaskPayload(taskType: ScheduledTaskType, payload: TaskPayload): void;
|
|
262
306
|
interface CreateTaskInput {
|
|
263
307
|
name: string;
|
|
@@ -340,6 +384,24 @@ declare class TaskLogManager {
|
|
|
340
384
|
clearLogs(taskId?: string): number;
|
|
341
385
|
}
|
|
342
386
|
|
|
387
|
+
interface SkillDownloadFile {
|
|
388
|
+
path: string;
|
|
389
|
+
content: string;
|
|
390
|
+
executable: boolean;
|
|
391
|
+
}
|
|
392
|
+
interface SkillStoreFileSystem {
|
|
393
|
+
readdir: typeof fs.readdir;
|
|
394
|
+
readFile: typeof fs.readFile;
|
|
395
|
+
writeFile: typeof fs.writeFile;
|
|
396
|
+
mkdir: typeof fs.mkdir;
|
|
397
|
+
chmod: typeof fs.chmod;
|
|
398
|
+
}
|
|
399
|
+
interface SkillStoreOptions {
|
|
400
|
+
workspacePath: string;
|
|
401
|
+
userSkillsRoot: string;
|
|
402
|
+
fileSystem?: SkillStoreFileSystem;
|
|
403
|
+
}
|
|
404
|
+
|
|
343
405
|
interface SkillCatalog {
|
|
344
406
|
skills: SkillMarketplaceEntry[];
|
|
345
407
|
fetchedAt: string;
|
|
@@ -353,6 +415,7 @@ declare class SkillCatalogClient {
|
|
|
353
415
|
private readonly baseUrl?;
|
|
354
416
|
constructor(options?: SkillCatalogClientOptions);
|
|
355
417
|
getCatalog(): Promise<SkillCatalog>;
|
|
418
|
+
downloadSkill(remoteId: string): Promise<SkillDownloadFile[]>;
|
|
356
419
|
}
|
|
357
420
|
|
|
358
421
|
interface CatalogSkillLike {
|
|
@@ -389,18 +452,6 @@ declare class SkillReconciler {
|
|
|
389
452
|
mutate(request: SkillMutationRequest): Promise<SkillMutateResult>;
|
|
390
453
|
}
|
|
391
454
|
|
|
392
|
-
interface SkillStoreFileSystem {
|
|
393
|
-
readdir: typeof fs.readdir;
|
|
394
|
-
readFile: typeof fs.readFile;
|
|
395
|
-
writeFile: typeof fs.writeFile;
|
|
396
|
-
mkdir: typeof fs.mkdir;
|
|
397
|
-
}
|
|
398
|
-
interface SkillStoreOptions {
|
|
399
|
-
workspacePath: string;
|
|
400
|
-
userSkillsRoot: string;
|
|
401
|
-
fileSystem?: SkillStoreFileSystem;
|
|
402
|
-
}
|
|
403
|
-
|
|
404
455
|
declare class SkillStore {
|
|
405
456
|
private readonly workspacePath;
|
|
406
457
|
private readonly userSkillsRoot;
|
|
@@ -414,9 +465,10 @@ declare class SkillStore {
|
|
|
414
465
|
listUserSkillIds(): Promise<string[]>;
|
|
415
466
|
writeManagedUserSkillMarker(skillId: string): Promise<void>;
|
|
416
467
|
isManagedUserSkill(skillId: string): Promise<boolean>;
|
|
468
|
+
writeSkillFiles(skillId: string, scope: "workspace" | "user", files: SkillDownloadFile[]): Promise<void>;
|
|
417
469
|
}
|
|
418
470
|
|
|
419
471
|
declare const unzipFile: (zipPath: string, dest: string) => Promise<void>;
|
|
420
472
|
declare const moveFiles: (sourceDir: string, destDir: string, overwrite?: boolean) => Promise<void>;
|
|
421
473
|
|
|
422
|
-
export { type AgentCatalog, AgentCatalogClient, type AgentCatalogClientOptions, type AgentDownloadFile, type AgentInstallScope, type AgentMutateResult, AgentReconciler, type AgentReconcilerDependencies, AgentStore, type AgentStoreFileSystem, type AgentStoreOptions, type AgentsStateFile, type AppendLogInput, type CreateTaskInput, DaemonLogger, type EditTaskInput, EnvironmentInspector, type ExecutorResult, GithubCopilotCliExecutor, HttpRequestExecutor, ImageTools, type InstalledAgent, type JsonTools, type OutputEventCallback, PidManager, ProjectTools, SchedulerDaemon, type ServiceMeLogger, ShellExecutor, type SkillCatalog, SkillCatalogClient, type SkillCatalogClientOptions, type SkillMutateResult, SkillReconciler, type SkillReconcilerDependencies, SkillStore, type SkillStoreFileSystem, type SkillStoreOptions, type StreamingExecutorHandle, type StreamingTaskExecutor, TOOL_RISK_MAP, TaskConfigManager, type TaskEventListener, TaskExecutionEngine, type TaskExecutor, TaskLogManager, copilotDoctor, copilotPrompt, createConsoleLogger, createCopilotAuthRequiredError, createCopilotNotInstalledError, createImageTools, createJsonTools, createProjectTools, getExecutor, isCopilotAuthenticated, isStreamingTaskExecutor, matchesCron, moveFiles, noopLogger, parseAgentToolPermissions, parseIntervalMs, resolveTaskExecutionPayload, unzipFile, validateTaskPayload };
|
|
474
|
+
export { type AgentCatalog, AgentCatalogClient, type AgentCatalogClientOptions, type AgentDownloadFile, type AgentInstallScope, type AgentMutateResult, AgentReconciler, type AgentReconcilerDependencies, AgentStore, type AgentStoreFileSystem, type AgentStoreOptions, type AgentsStateFile, type AppendLogInput, type CreateTaskInput, DaemonLogger, type EditTaskInput, EnvironmentInspector, type EnvironmentInspectorOptions, type ExecutorResult, GithubCopilotCliExecutor, HttpRequestExecutor, ImageTools, type InstalledAgent, type JsonTools, type OutputEventCallback, PidManager, ProjectTools, SchedulerDaemon, type ServiceMeLogger, ShellExecutor, type SkillCatalog, SkillCatalogClient, type SkillCatalogClientOptions, type SkillDownloadFile, type SkillMutateResult, SkillReconciler, type SkillReconcilerDependencies, SkillStore, type SkillStoreFileSystem, type SkillStoreOptions, type StreamingExecutorHandle, type StreamingTaskExecutor, TOOL_RISK_MAP, TaskConfigManager, type TaskEventListener, TaskExecutionEngine, type TaskExecutor, TaskLogManager, copilotDoctor, copilotPrompt, createConsoleLogger, createCopilotAuthRequiredError, createCopilotNotInstalledError, createImageTools, createJsonTools, createProjectTools, getExecutor, isCopilotAuthenticated, isStreamingTaskExecutor, matchesCron, moveFiles, noopLogger, parseAgentToolPermissions, parseIntervalMs, resolveTaskExecutionPayload, unzipFile, validateTaskPayload };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,36 @@ import * as _serviceme_devtools_protocol from '@serviceme/devtools-protocol';
|
|
|
2
2
|
import { AgentMarketplaceEntry, AgentMutationRequest, AgentPermissionSummary, CopilotDoctorResult, CopilotPromptOptions, CopilotPromptResult, EnvironmentCheckResult, KnownEnvironmentTool, ToolCheckResult, ServiceMeImageValidationResult, ServiceMeImageInfo, ServiceMeImageCompressOptions, ServiceMeImageCompressResult, JsonSortOptions, JsonValidationResult, AgentToolRiskLevel, AgentToolPermission, ServiceMeProjectExtractTemplateInput, ServiceMeProjectExtractTemplateResult, ServiceMeProjectInstallDepsResult, ServiceMeProjectMakeScriptsExecutableResult, ServiceMeProjectGitInitResult, ServiceMeProjectScaffoldPruneResult, TaskExecutionStatus, ScheduledTaskType, TaskPayload, ScheduledTasksConfig, ScheduledTask, TaskStartedEventParams, TaskOutputEventParams, TaskCompletedEventParams, TaskFailedEventParams, TaskCancelledEventParams, TaskExecutionSnapshot, RunningTaskInfo, TaskExecutionLog, SkillMarketplaceEntry, SkillMutationRequest } from '@serviceme/devtools-protocol';
|
|
3
3
|
import * as fs from 'node:fs/promises';
|
|
4
4
|
|
|
5
|
+
type AgentInstallScope = "workspace" | "user";
|
|
6
|
+
interface InstalledAgent {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
scope: AgentInstallScope;
|
|
10
|
+
installedAt: string;
|
|
11
|
+
}
|
|
12
|
+
interface AgentsStateFile {
|
|
13
|
+
schemaVersion: number;
|
|
14
|
+
installedAgents: InstalledAgent[];
|
|
15
|
+
}
|
|
16
|
+
interface AgentDownloadFile {
|
|
17
|
+
path: string;
|
|
18
|
+
content: string;
|
|
19
|
+
executable?: boolean;
|
|
20
|
+
}
|
|
21
|
+
interface AgentStoreFileSystem {
|
|
22
|
+
readdir: typeof fs.readdir;
|
|
23
|
+
readFile: typeof fs.readFile;
|
|
24
|
+
writeFile: typeof fs.writeFile;
|
|
25
|
+
mkdir: typeof fs.mkdir;
|
|
26
|
+
chmod: typeof fs.chmod;
|
|
27
|
+
}
|
|
28
|
+
interface AgentStoreOptions {
|
|
29
|
+
workspacePath: string;
|
|
30
|
+
userAgentsRoot: string;
|
|
31
|
+
fileSystem?: AgentStoreFileSystem;
|
|
32
|
+
schemaVersion?: number;
|
|
33
|
+
}
|
|
34
|
+
|
|
5
35
|
interface AgentCatalog {
|
|
6
36
|
agents: AgentMarketplaceEntry[];
|
|
7
37
|
fetchedAt: string;
|
|
@@ -15,6 +45,7 @@ declare class AgentCatalogClient {
|
|
|
15
45
|
private readonly baseUrl?;
|
|
16
46
|
constructor(options?: AgentCatalogClientOptions);
|
|
17
47
|
getCatalog(): Promise<AgentCatalog>;
|
|
48
|
+
downloadAgent(remoteId: string): Promise<AgentDownloadFile[]>;
|
|
18
49
|
}
|
|
19
50
|
|
|
20
51
|
interface AgentStoreLike {
|
|
@@ -47,36 +78,6 @@ declare class AgentReconciler {
|
|
|
47
78
|
private hasHighRiskTool;
|
|
48
79
|
}
|
|
49
80
|
|
|
50
|
-
type AgentInstallScope = "workspace" | "user";
|
|
51
|
-
interface InstalledAgent {
|
|
52
|
-
id: string;
|
|
53
|
-
name: string;
|
|
54
|
-
scope: AgentInstallScope;
|
|
55
|
-
installedAt: string;
|
|
56
|
-
}
|
|
57
|
-
interface AgentsStateFile {
|
|
58
|
-
schemaVersion: number;
|
|
59
|
-
installedAgents: InstalledAgent[];
|
|
60
|
-
}
|
|
61
|
-
interface AgentDownloadFile {
|
|
62
|
-
path: string;
|
|
63
|
-
content: string;
|
|
64
|
-
executable?: boolean;
|
|
65
|
-
}
|
|
66
|
-
interface AgentStoreFileSystem {
|
|
67
|
-
readdir: typeof fs.readdir;
|
|
68
|
-
readFile: typeof fs.readFile;
|
|
69
|
-
writeFile: typeof fs.writeFile;
|
|
70
|
-
mkdir: typeof fs.mkdir;
|
|
71
|
-
chmod: typeof fs.chmod;
|
|
72
|
-
}
|
|
73
|
-
interface AgentStoreOptions {
|
|
74
|
-
workspacePath: string;
|
|
75
|
-
userAgentsRoot: string;
|
|
76
|
-
fileSystem?: AgentStoreFileSystem;
|
|
77
|
-
schemaVersion?: number;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
81
|
declare class AgentStore {
|
|
81
82
|
private readonly workspacePath;
|
|
82
83
|
private readonly userAgentsRoot;
|
|
@@ -108,7 +109,39 @@ declare function createCopilotAuthRequiredError(): _serviceme_devtools_protocol.
|
|
|
108
109
|
|
|
109
110
|
declare function copilotPrompt(options: CopilotPromptOptions): Promise<CopilotPromptResult>;
|
|
110
111
|
|
|
112
|
+
interface RunCommandOptions {
|
|
113
|
+
args?: string[];
|
|
114
|
+
cwd?: string;
|
|
115
|
+
env?: NodeJS.ProcessEnv;
|
|
116
|
+
timeoutMs?: number;
|
|
117
|
+
stdin?: string;
|
|
118
|
+
shell?: boolean;
|
|
119
|
+
}
|
|
120
|
+
interface RunCommandResult {
|
|
121
|
+
stdout: string;
|
|
122
|
+
stderr: string;
|
|
123
|
+
code: number;
|
|
124
|
+
}
|
|
125
|
+
declare function runCommand(command: string, options?: RunCommandOptions): Promise<RunCommandResult>;
|
|
126
|
+
|
|
127
|
+
interface EnvironmentInspectorOptions {
|
|
128
|
+
/**
|
|
129
|
+
* Override the command runner. Production callers should leave this
|
|
130
|
+
* undefined and rely on the default `runCommand` from `../process/runCommand`;
|
|
131
|
+
* tests inject a fake to drive error/edge branches without spawning
|
|
132
|
+
* real subprocesses.
|
|
133
|
+
*/
|
|
134
|
+
runCommand?: typeof runCommand;
|
|
135
|
+
/**
|
|
136
|
+
* Override the detected platform. Defaults to `process.platform`. Tests
|
|
137
|
+
* use this to exercise the Windows-specific branches of the inspector.
|
|
138
|
+
*/
|
|
139
|
+
platform?: NodeJS.Platform;
|
|
140
|
+
}
|
|
111
141
|
declare class EnvironmentInspector {
|
|
142
|
+
private readonly runCommandFn;
|
|
143
|
+
private readonly platform;
|
|
144
|
+
constructor(options?: EnvironmentInspectorOptions);
|
|
112
145
|
checkEnvironment(): Promise<EnvironmentCheckResult>;
|
|
113
146
|
checkTool(toolName: KnownEnvironmentTool): Promise<ToolCheckResult>;
|
|
114
147
|
private getToolPath;
|
|
@@ -166,6 +199,7 @@ declare class ProjectTools {
|
|
|
166
199
|
makeScriptsExecutable(workspacePath: string): Promise<ServiceMeProjectMakeScriptsExecutableResult>;
|
|
167
200
|
initializeGit(workspacePath: string): Promise<ServiceMeProjectGitInitResult>;
|
|
168
201
|
runScaffoldPrune(workspacePath: string, preset?: string): Promise<ServiceMeProjectScaffoldPruneResult>;
|
|
202
|
+
private ensurePresetManifest;
|
|
169
203
|
private findScripts;
|
|
170
204
|
private pathExists;
|
|
171
205
|
private selectExtractedDirectory;
|
|
@@ -192,38 +226,6 @@ declare class PidManager {
|
|
|
192
226
|
getRunningPid(): number | null;
|
|
193
227
|
}
|
|
194
228
|
|
|
195
|
-
declare class SchedulerDaemon {
|
|
196
|
-
private readonly workspacePath;
|
|
197
|
-
private readonly configManager;
|
|
198
|
-
private readonly logManager;
|
|
199
|
-
private readonly pidManager;
|
|
200
|
-
private readonly logger;
|
|
201
|
-
private tickTimer;
|
|
202
|
-
private watcher;
|
|
203
|
-
private running;
|
|
204
|
-
private startTime;
|
|
205
|
-
private lastRun;
|
|
206
|
-
private taskRunning;
|
|
207
|
-
constructor(workspacePath: string);
|
|
208
|
-
start(): void;
|
|
209
|
-
stop(): void;
|
|
210
|
-
private setupConfigWatch;
|
|
211
|
-
private tick;
|
|
212
|
-
private shouldRun;
|
|
213
|
-
private executeTask;
|
|
214
|
-
getStatus(): {
|
|
215
|
-
running: boolean;
|
|
216
|
-
pid: number;
|
|
217
|
-
uptimeSeconds: number | null;
|
|
218
|
-
tasksRegistered: number;
|
|
219
|
-
tasksEnabled: number;
|
|
220
|
-
workspacePath: string;
|
|
221
|
-
pidFile: string;
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
declare function parseIntervalMs(schedule: string): number;
|
|
225
|
-
declare function matchesCron(expression: string, date: Date): boolean;
|
|
226
|
-
|
|
227
229
|
interface ExecutorResult {
|
|
228
230
|
status: TaskExecutionStatus;
|
|
229
231
|
output?: string;
|
|
@@ -258,6 +260,48 @@ declare class ShellExecutor implements StreamingTaskExecutor {
|
|
|
258
260
|
|
|
259
261
|
declare function getExecutor(taskType: ScheduledTaskType): TaskExecutor;
|
|
260
262
|
|
|
263
|
+
interface SchedulerDaemonOptions {
|
|
264
|
+
/**
|
|
265
|
+
* Override the executor factory. Production callers should leave this
|
|
266
|
+
* undefined and rely on the default `getExecutor` from `../executors`;
|
|
267
|
+
* tests inject a fake to drive the execution branch without spawning
|
|
268
|
+
* real subprocesses.
|
|
269
|
+
*/
|
|
270
|
+
getExecutor?: typeof getExecutor;
|
|
271
|
+
}
|
|
272
|
+
declare class SchedulerDaemon {
|
|
273
|
+
private readonly workspacePath;
|
|
274
|
+
private readonly configManager;
|
|
275
|
+
private readonly logManager;
|
|
276
|
+
private readonly pidManager;
|
|
277
|
+
private readonly logger;
|
|
278
|
+
private readonly getExecutor;
|
|
279
|
+
private tickTimer;
|
|
280
|
+
private watcher;
|
|
281
|
+
private running;
|
|
282
|
+
private startTime;
|
|
283
|
+
private lastRun;
|
|
284
|
+
private taskRunning;
|
|
285
|
+
constructor(workspacePath: string, options?: SchedulerDaemonOptions);
|
|
286
|
+
start(): void;
|
|
287
|
+
stop(): void;
|
|
288
|
+
private setupConfigWatch;
|
|
289
|
+
private tick;
|
|
290
|
+
private shouldRun;
|
|
291
|
+
private executeTask;
|
|
292
|
+
getStatus(): {
|
|
293
|
+
running: boolean;
|
|
294
|
+
pid: number;
|
|
295
|
+
uptimeSeconds: number | null;
|
|
296
|
+
tasksRegistered: number;
|
|
297
|
+
tasksEnabled: number;
|
|
298
|
+
workspacePath: string;
|
|
299
|
+
pidFile: string;
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
declare function parseIntervalMs(schedule: string): number;
|
|
303
|
+
declare function matchesCron(expression: string, date: Date): boolean;
|
|
304
|
+
|
|
261
305
|
declare function validateTaskPayload(taskType: ScheduledTaskType, payload: TaskPayload): void;
|
|
262
306
|
interface CreateTaskInput {
|
|
263
307
|
name: string;
|
|
@@ -340,6 +384,24 @@ declare class TaskLogManager {
|
|
|
340
384
|
clearLogs(taskId?: string): number;
|
|
341
385
|
}
|
|
342
386
|
|
|
387
|
+
interface SkillDownloadFile {
|
|
388
|
+
path: string;
|
|
389
|
+
content: string;
|
|
390
|
+
executable: boolean;
|
|
391
|
+
}
|
|
392
|
+
interface SkillStoreFileSystem {
|
|
393
|
+
readdir: typeof fs.readdir;
|
|
394
|
+
readFile: typeof fs.readFile;
|
|
395
|
+
writeFile: typeof fs.writeFile;
|
|
396
|
+
mkdir: typeof fs.mkdir;
|
|
397
|
+
chmod: typeof fs.chmod;
|
|
398
|
+
}
|
|
399
|
+
interface SkillStoreOptions {
|
|
400
|
+
workspacePath: string;
|
|
401
|
+
userSkillsRoot: string;
|
|
402
|
+
fileSystem?: SkillStoreFileSystem;
|
|
403
|
+
}
|
|
404
|
+
|
|
343
405
|
interface SkillCatalog {
|
|
344
406
|
skills: SkillMarketplaceEntry[];
|
|
345
407
|
fetchedAt: string;
|
|
@@ -353,6 +415,7 @@ declare class SkillCatalogClient {
|
|
|
353
415
|
private readonly baseUrl?;
|
|
354
416
|
constructor(options?: SkillCatalogClientOptions);
|
|
355
417
|
getCatalog(): Promise<SkillCatalog>;
|
|
418
|
+
downloadSkill(remoteId: string): Promise<SkillDownloadFile[]>;
|
|
356
419
|
}
|
|
357
420
|
|
|
358
421
|
interface CatalogSkillLike {
|
|
@@ -389,18 +452,6 @@ declare class SkillReconciler {
|
|
|
389
452
|
mutate(request: SkillMutationRequest): Promise<SkillMutateResult>;
|
|
390
453
|
}
|
|
391
454
|
|
|
392
|
-
interface SkillStoreFileSystem {
|
|
393
|
-
readdir: typeof fs.readdir;
|
|
394
|
-
readFile: typeof fs.readFile;
|
|
395
|
-
writeFile: typeof fs.writeFile;
|
|
396
|
-
mkdir: typeof fs.mkdir;
|
|
397
|
-
}
|
|
398
|
-
interface SkillStoreOptions {
|
|
399
|
-
workspacePath: string;
|
|
400
|
-
userSkillsRoot: string;
|
|
401
|
-
fileSystem?: SkillStoreFileSystem;
|
|
402
|
-
}
|
|
403
|
-
|
|
404
455
|
declare class SkillStore {
|
|
405
456
|
private readonly workspacePath;
|
|
406
457
|
private readonly userSkillsRoot;
|
|
@@ -414,9 +465,10 @@ declare class SkillStore {
|
|
|
414
465
|
listUserSkillIds(): Promise<string[]>;
|
|
415
466
|
writeManagedUserSkillMarker(skillId: string): Promise<void>;
|
|
416
467
|
isManagedUserSkill(skillId: string): Promise<boolean>;
|
|
468
|
+
writeSkillFiles(skillId: string, scope: "workspace" | "user", files: SkillDownloadFile[]): Promise<void>;
|
|
417
469
|
}
|
|
418
470
|
|
|
419
471
|
declare const unzipFile: (zipPath: string, dest: string) => Promise<void>;
|
|
420
472
|
declare const moveFiles: (sourceDir: string, destDir: string, overwrite?: boolean) => Promise<void>;
|
|
421
473
|
|
|
422
|
-
export { type AgentCatalog, AgentCatalogClient, type AgentCatalogClientOptions, type AgentDownloadFile, type AgentInstallScope, type AgentMutateResult, AgentReconciler, type AgentReconcilerDependencies, AgentStore, type AgentStoreFileSystem, type AgentStoreOptions, type AgentsStateFile, type AppendLogInput, type CreateTaskInput, DaemonLogger, type EditTaskInput, EnvironmentInspector, type ExecutorResult, GithubCopilotCliExecutor, HttpRequestExecutor, ImageTools, type InstalledAgent, type JsonTools, type OutputEventCallback, PidManager, ProjectTools, SchedulerDaemon, type ServiceMeLogger, ShellExecutor, type SkillCatalog, SkillCatalogClient, type SkillCatalogClientOptions, type SkillMutateResult, SkillReconciler, type SkillReconcilerDependencies, SkillStore, type SkillStoreFileSystem, type SkillStoreOptions, type StreamingExecutorHandle, type StreamingTaskExecutor, TOOL_RISK_MAP, TaskConfigManager, type TaskEventListener, TaskExecutionEngine, type TaskExecutor, TaskLogManager, copilotDoctor, copilotPrompt, createConsoleLogger, createCopilotAuthRequiredError, createCopilotNotInstalledError, createImageTools, createJsonTools, createProjectTools, getExecutor, isCopilotAuthenticated, isStreamingTaskExecutor, matchesCron, moveFiles, noopLogger, parseAgentToolPermissions, parseIntervalMs, resolveTaskExecutionPayload, unzipFile, validateTaskPayload };
|
|
474
|
+
export { type AgentCatalog, AgentCatalogClient, type AgentCatalogClientOptions, type AgentDownloadFile, type AgentInstallScope, type AgentMutateResult, AgentReconciler, type AgentReconcilerDependencies, AgentStore, type AgentStoreFileSystem, type AgentStoreOptions, type AgentsStateFile, type AppendLogInput, type CreateTaskInput, DaemonLogger, type EditTaskInput, EnvironmentInspector, type EnvironmentInspectorOptions, type ExecutorResult, GithubCopilotCliExecutor, HttpRequestExecutor, ImageTools, type InstalledAgent, type JsonTools, type OutputEventCallback, PidManager, ProjectTools, SchedulerDaemon, type ServiceMeLogger, ShellExecutor, type SkillCatalog, SkillCatalogClient, type SkillCatalogClientOptions, type SkillDownloadFile, type SkillMutateResult, SkillReconciler, type SkillReconcilerDependencies, SkillStore, type SkillStoreFileSystem, type SkillStoreOptions, type StreamingExecutorHandle, type StreamingTaskExecutor, TOOL_RISK_MAP, TaskConfigManager, type TaskEventListener, TaskExecutionEngine, type TaskExecutor, TaskLogManager, copilotDoctor, copilotPrompt, createConsoleLogger, createCopilotAuthRequiredError, createCopilotNotInstalledError, createImageTools, createJsonTools, createProjectTools, getExecutor, isCopilotAuthenticated, isStreamingTaskExecutor, matchesCron, moveFiles, noopLogger, parseAgentToolPermissions, parseIntervalMs, resolveTaskExecutionPayload, unzipFile, validateTaskPayload };
|