@serviceme/devtools-core 0.1.5 → 0.1.7
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 +194 -2
- package/dist/index.d.ts +194 -2
- package/dist/index.js +716 -115
- package/dist/index.mjs +708 -115
- package/package.json +3 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,102 @@
|
|
|
1
1
|
import * as _serviceme_devtools_protocol from '@serviceme/devtools-protocol';
|
|
2
|
-
import { CopilotDoctorResult, CopilotPromptOptions, CopilotPromptResult, EnvironmentCheckResult, KnownEnvironmentTool, ToolCheckResult, ServiceMeImageValidationResult, ServiceMeImageInfo, ServiceMeImageCompressOptions, ServiceMeImageCompressResult, JsonSortOptions, JsonValidationResult, ServiceMeProjectExtractTemplateInput, ServiceMeProjectExtractTemplateResult, ServiceMeProjectInstallDepsResult, ServiceMeProjectMakeScriptsExecutableResult, ServiceMeProjectGitInitResult, ServiceMeProjectScaffoldPruneResult, TaskExecutionStatus, ScheduledTaskType, TaskPayload, ScheduledTasksConfig, ScheduledTask, TaskStartedEventParams, TaskOutputEventParams, TaskCompletedEventParams, TaskFailedEventParams, TaskCancelledEventParams, TaskExecutionSnapshot, RunningTaskInfo, TaskExecutionLog } from '@serviceme/devtools-protocol';
|
|
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
|
+
import * as fs from 'node:fs/promises';
|
|
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
|
+
|
|
35
|
+
interface AgentCatalog {
|
|
36
|
+
agents: AgentMarketplaceEntry[];
|
|
37
|
+
fetchedAt: string;
|
|
38
|
+
}
|
|
39
|
+
interface AgentCatalogClientOptions {
|
|
40
|
+
fetchImpl?: typeof fetch;
|
|
41
|
+
baseUrl?: string;
|
|
42
|
+
}
|
|
43
|
+
declare class AgentCatalogClient {
|
|
44
|
+
private readonly fetchImpl;
|
|
45
|
+
private readonly baseUrl?;
|
|
46
|
+
constructor(options?: AgentCatalogClientOptions);
|
|
47
|
+
getCatalog(): Promise<AgentCatalog>;
|
|
48
|
+
downloadAgent(remoteId: string): Promise<AgentDownloadFile[]>;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
interface AgentStoreLike {
|
|
52
|
+
normalizeRemoteAgentId(remoteId: string): string;
|
|
53
|
+
listWorkspaceAgentIds(): Promise<string[]>;
|
|
54
|
+
listUserAgentIds(): Promise<string[]>;
|
|
55
|
+
}
|
|
56
|
+
interface AgentCatalogLike {
|
|
57
|
+
agents: AgentMarketplaceEntry[];
|
|
58
|
+
fetchedAt: string;
|
|
59
|
+
}
|
|
60
|
+
interface AgentCatalogClientLike {
|
|
61
|
+
getCatalog(): Promise<AgentCatalogLike>;
|
|
62
|
+
}
|
|
63
|
+
interface AgentReconcilerDependencies {
|
|
64
|
+
agentStore: AgentStoreLike;
|
|
65
|
+
catalogClient: AgentCatalogClientLike;
|
|
66
|
+
}
|
|
67
|
+
interface AgentMutateResult {
|
|
68
|
+
status: "success" | "blocked" | "requires_confirmation";
|
|
69
|
+
changed: boolean;
|
|
70
|
+
message?: string;
|
|
71
|
+
tools?: string[];
|
|
72
|
+
}
|
|
73
|
+
declare class AgentReconciler {
|
|
74
|
+
private readonly deps;
|
|
75
|
+
constructor(deps: AgentReconcilerDependencies);
|
|
76
|
+
mutate(request: AgentMutationRequest): Promise<AgentMutateResult>;
|
|
77
|
+
getPermissionSummary(agentId: string, agentName: string, content: string): AgentPermissionSummary;
|
|
78
|
+
private hasHighRiskTool;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
declare class AgentStore {
|
|
82
|
+
private readonly workspacePath;
|
|
83
|
+
private readonly userAgentsRoot;
|
|
84
|
+
private readonly fileSystem;
|
|
85
|
+
private readonly schemaVersion;
|
|
86
|
+
constructor(options: AgentStoreOptions);
|
|
87
|
+
normalizeRemoteAgentId(remoteId: string): string;
|
|
88
|
+
getWorkspaceAgentsRootPath(): string;
|
|
89
|
+
getWorkspaceStateFilePath(): string;
|
|
90
|
+
getUserAgentsRootPath(): string;
|
|
91
|
+
listWorkspaceAgentIds(): Promise<string[]>;
|
|
92
|
+
listUserAgentIds(): Promise<string[]>;
|
|
93
|
+
readState(): Promise<AgentsStateFile | null>;
|
|
94
|
+
writeState(state: AgentsStateFile): Promise<void>;
|
|
95
|
+
addInstalledAgent(entry: InstalledAgent): Promise<void>;
|
|
96
|
+
removeInstalledAgent(agentId: string): Promise<void>;
|
|
97
|
+
writeAgentFiles(agentId: string, scope: "workspace" | "user", files: AgentDownloadFile[]): Promise<void>;
|
|
98
|
+
private listAgentIds;
|
|
99
|
+
}
|
|
3
100
|
|
|
4
101
|
/**
|
|
5
102
|
* Quick auth pre-flight check using `gh auth status`.
|
|
@@ -16,6 +113,13 @@ declare class EnvironmentInspector {
|
|
|
16
113
|
checkEnvironment(): Promise<EnvironmentCheckResult>;
|
|
17
114
|
checkTool(toolName: KnownEnvironmentTool): Promise<ToolCheckResult>;
|
|
18
115
|
private getToolPath;
|
|
116
|
+
/**
|
|
117
|
+
* On Windows, prefer the `.cmd` shim for npm/pnpm/nrm. nvm4w registers
|
|
118
|
+
* BOTH an extensionless entry (pointing to node.exe) and a `<tool>.cmd`
|
|
119
|
+
* wrapper; `where` returns them in that order, and the extensionless one
|
|
120
|
+
* would just print node's own version.
|
|
121
|
+
*/
|
|
122
|
+
private getToolShimPath;
|
|
19
123
|
private getToolVersion;
|
|
20
124
|
private checkNvm;
|
|
21
125
|
private checkNuget;
|
|
@@ -54,12 +158,16 @@ interface ServiceMeLogger {
|
|
|
54
158
|
declare const noopLogger: ServiceMeLogger;
|
|
55
159
|
declare function createConsoleLogger(prefix?: string): ServiceMeLogger;
|
|
56
160
|
|
|
161
|
+
declare const TOOL_RISK_MAP: Record<string, AgentToolRiskLevel>;
|
|
162
|
+
declare function parseAgentToolPermissions(content: string): AgentToolPermission[];
|
|
163
|
+
|
|
57
164
|
declare class ProjectTools {
|
|
58
165
|
extractTemplate(zipPath: string, workspacePath: string, tempExtractDir: string, input: ServiceMeProjectExtractTemplateInput): Promise<ServiceMeProjectExtractTemplateResult>;
|
|
59
166
|
installDependencies(workspacePath: string, command?: string): Promise<ServiceMeProjectInstallDepsResult>;
|
|
60
167
|
makeScriptsExecutable(workspacePath: string): Promise<ServiceMeProjectMakeScriptsExecutableResult>;
|
|
61
168
|
initializeGit(workspacePath: string): Promise<ServiceMeProjectGitInitResult>;
|
|
62
169
|
runScaffoldPrune(workspacePath: string, preset?: string): Promise<ServiceMeProjectScaffoldPruneResult>;
|
|
170
|
+
private ensurePresetManifest;
|
|
63
171
|
private findScripts;
|
|
64
172
|
private pathExists;
|
|
65
173
|
private selectExtractedDirectory;
|
|
@@ -234,7 +342,91 @@ declare class TaskLogManager {
|
|
|
234
342
|
clearLogs(taskId?: string): number;
|
|
235
343
|
}
|
|
236
344
|
|
|
345
|
+
interface SkillDownloadFile {
|
|
346
|
+
path: string;
|
|
347
|
+
content: string;
|
|
348
|
+
executable: boolean;
|
|
349
|
+
}
|
|
350
|
+
interface SkillStoreFileSystem {
|
|
351
|
+
readdir: typeof fs.readdir;
|
|
352
|
+
readFile: typeof fs.readFile;
|
|
353
|
+
writeFile: typeof fs.writeFile;
|
|
354
|
+
mkdir: typeof fs.mkdir;
|
|
355
|
+
chmod: typeof fs.chmod;
|
|
356
|
+
}
|
|
357
|
+
interface SkillStoreOptions {
|
|
358
|
+
workspacePath: string;
|
|
359
|
+
userSkillsRoot: string;
|
|
360
|
+
fileSystem?: SkillStoreFileSystem;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
interface SkillCatalog {
|
|
364
|
+
skills: SkillMarketplaceEntry[];
|
|
365
|
+
fetchedAt: string;
|
|
366
|
+
}
|
|
367
|
+
interface SkillCatalogClientOptions {
|
|
368
|
+
fetchImpl?: typeof fetch;
|
|
369
|
+
baseUrl?: string;
|
|
370
|
+
}
|
|
371
|
+
declare class SkillCatalogClient {
|
|
372
|
+
private readonly fetchImpl;
|
|
373
|
+
private readonly baseUrl?;
|
|
374
|
+
constructor(options?: SkillCatalogClientOptions);
|
|
375
|
+
getCatalog(): Promise<SkillCatalog>;
|
|
376
|
+
downloadSkill(remoteId: string): Promise<SkillDownloadFile[]>;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
interface CatalogSkillLike {
|
|
380
|
+
id: string;
|
|
381
|
+
hasScripts?: boolean;
|
|
382
|
+
hasHooks?: boolean;
|
|
383
|
+
}
|
|
384
|
+
interface CatalogLike {
|
|
385
|
+
skills: CatalogSkillLike[];
|
|
386
|
+
fetchedAt: string;
|
|
387
|
+
}
|
|
388
|
+
interface SkillStoreLike {
|
|
389
|
+
normalizeRemoteSkillId(remoteId: string): string;
|
|
390
|
+
listWorkspaceSkillIds(): Promise<string[]>;
|
|
391
|
+
listUserSkillIds(): Promise<string[]>;
|
|
392
|
+
}
|
|
393
|
+
interface SkillCatalogClientLike {
|
|
394
|
+
getCatalog(): Promise<CatalogLike>;
|
|
395
|
+
}
|
|
396
|
+
interface SkillReconcilerDependencies {
|
|
397
|
+
skillStore: SkillStoreLike;
|
|
398
|
+
catalogClient: SkillCatalogClientLike;
|
|
399
|
+
}
|
|
400
|
+
interface SkillMutateResult {
|
|
401
|
+
status: "success" | "blocked" | "requires_confirmation";
|
|
402
|
+
changed: boolean;
|
|
403
|
+
message?: string;
|
|
404
|
+
hasScripts?: boolean;
|
|
405
|
+
hasHooks?: boolean;
|
|
406
|
+
}
|
|
407
|
+
declare class SkillReconciler {
|
|
408
|
+
private readonly deps;
|
|
409
|
+
constructor(deps: SkillReconcilerDependencies);
|
|
410
|
+
mutate(request: SkillMutationRequest): Promise<SkillMutateResult>;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
declare class SkillStore {
|
|
414
|
+
private readonly workspacePath;
|
|
415
|
+
private readonly userSkillsRoot;
|
|
416
|
+
private readonly fileSystem;
|
|
417
|
+
constructor(options: SkillStoreOptions);
|
|
418
|
+
normalizeRemoteSkillId(remoteId: string): string;
|
|
419
|
+
getWorkspaceSkillPath(skillId: string): string;
|
|
420
|
+
getWorkspaceMarkerPath(): string;
|
|
421
|
+
getUserSkillPath(skillId: string): string;
|
|
422
|
+
listWorkspaceSkillIds(): Promise<string[]>;
|
|
423
|
+
listUserSkillIds(): Promise<string[]>;
|
|
424
|
+
writeManagedUserSkillMarker(skillId: string): Promise<void>;
|
|
425
|
+
isManagedUserSkill(skillId: string): Promise<boolean>;
|
|
426
|
+
writeSkillFiles(skillId: string, scope: "workspace" | "user", files: SkillDownloadFile[]): Promise<void>;
|
|
427
|
+
}
|
|
428
|
+
|
|
237
429
|
declare const unzipFile: (zipPath: string, dest: string) => Promise<void>;
|
|
238
430
|
declare const moveFiles: (sourceDir: string, destDir: string, overwrite?: boolean) => Promise<void>;
|
|
239
431
|
|
|
240
|
-
export { type AppendLogInput, type CreateTaskInput, DaemonLogger, type EditTaskInput, EnvironmentInspector, type ExecutorResult, GithubCopilotCliExecutor, HttpRequestExecutor, ImageTools, type JsonTools, type OutputEventCallback, PidManager, ProjectTools, SchedulerDaemon, type ServiceMeLogger, ShellExecutor, type StreamingExecutorHandle, type StreamingTaskExecutor, TaskConfigManager, type TaskEventListener, TaskExecutionEngine, type TaskExecutor, TaskLogManager, copilotDoctor, copilotPrompt, createConsoleLogger, createCopilotAuthRequiredError, createCopilotNotInstalledError, createImageTools, createJsonTools, createProjectTools, getExecutor, isCopilotAuthenticated, isStreamingTaskExecutor, matchesCron, moveFiles, noopLogger, parseIntervalMs, resolveTaskExecutionPayload, unzipFile, validateTaskPayload };
|
|
432
|
+
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 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
|
@@ -1,5 +1,102 @@
|
|
|
1
1
|
import * as _serviceme_devtools_protocol from '@serviceme/devtools-protocol';
|
|
2
|
-
import { CopilotDoctorResult, CopilotPromptOptions, CopilotPromptResult, EnvironmentCheckResult, KnownEnvironmentTool, ToolCheckResult, ServiceMeImageValidationResult, ServiceMeImageInfo, ServiceMeImageCompressOptions, ServiceMeImageCompressResult, JsonSortOptions, JsonValidationResult, ServiceMeProjectExtractTemplateInput, ServiceMeProjectExtractTemplateResult, ServiceMeProjectInstallDepsResult, ServiceMeProjectMakeScriptsExecutableResult, ServiceMeProjectGitInitResult, ServiceMeProjectScaffoldPruneResult, TaskExecutionStatus, ScheduledTaskType, TaskPayload, ScheduledTasksConfig, ScheduledTask, TaskStartedEventParams, TaskOutputEventParams, TaskCompletedEventParams, TaskFailedEventParams, TaskCancelledEventParams, TaskExecutionSnapshot, RunningTaskInfo, TaskExecutionLog } from '@serviceme/devtools-protocol';
|
|
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
|
+
import * as fs from 'node:fs/promises';
|
|
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
|
+
|
|
35
|
+
interface AgentCatalog {
|
|
36
|
+
agents: AgentMarketplaceEntry[];
|
|
37
|
+
fetchedAt: string;
|
|
38
|
+
}
|
|
39
|
+
interface AgentCatalogClientOptions {
|
|
40
|
+
fetchImpl?: typeof fetch;
|
|
41
|
+
baseUrl?: string;
|
|
42
|
+
}
|
|
43
|
+
declare class AgentCatalogClient {
|
|
44
|
+
private readonly fetchImpl;
|
|
45
|
+
private readonly baseUrl?;
|
|
46
|
+
constructor(options?: AgentCatalogClientOptions);
|
|
47
|
+
getCatalog(): Promise<AgentCatalog>;
|
|
48
|
+
downloadAgent(remoteId: string): Promise<AgentDownloadFile[]>;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
interface AgentStoreLike {
|
|
52
|
+
normalizeRemoteAgentId(remoteId: string): string;
|
|
53
|
+
listWorkspaceAgentIds(): Promise<string[]>;
|
|
54
|
+
listUserAgentIds(): Promise<string[]>;
|
|
55
|
+
}
|
|
56
|
+
interface AgentCatalogLike {
|
|
57
|
+
agents: AgentMarketplaceEntry[];
|
|
58
|
+
fetchedAt: string;
|
|
59
|
+
}
|
|
60
|
+
interface AgentCatalogClientLike {
|
|
61
|
+
getCatalog(): Promise<AgentCatalogLike>;
|
|
62
|
+
}
|
|
63
|
+
interface AgentReconcilerDependencies {
|
|
64
|
+
agentStore: AgentStoreLike;
|
|
65
|
+
catalogClient: AgentCatalogClientLike;
|
|
66
|
+
}
|
|
67
|
+
interface AgentMutateResult {
|
|
68
|
+
status: "success" | "blocked" | "requires_confirmation";
|
|
69
|
+
changed: boolean;
|
|
70
|
+
message?: string;
|
|
71
|
+
tools?: string[];
|
|
72
|
+
}
|
|
73
|
+
declare class AgentReconciler {
|
|
74
|
+
private readonly deps;
|
|
75
|
+
constructor(deps: AgentReconcilerDependencies);
|
|
76
|
+
mutate(request: AgentMutationRequest): Promise<AgentMutateResult>;
|
|
77
|
+
getPermissionSummary(agentId: string, agentName: string, content: string): AgentPermissionSummary;
|
|
78
|
+
private hasHighRiskTool;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
declare class AgentStore {
|
|
82
|
+
private readonly workspacePath;
|
|
83
|
+
private readonly userAgentsRoot;
|
|
84
|
+
private readonly fileSystem;
|
|
85
|
+
private readonly schemaVersion;
|
|
86
|
+
constructor(options: AgentStoreOptions);
|
|
87
|
+
normalizeRemoteAgentId(remoteId: string): string;
|
|
88
|
+
getWorkspaceAgentsRootPath(): string;
|
|
89
|
+
getWorkspaceStateFilePath(): string;
|
|
90
|
+
getUserAgentsRootPath(): string;
|
|
91
|
+
listWorkspaceAgentIds(): Promise<string[]>;
|
|
92
|
+
listUserAgentIds(): Promise<string[]>;
|
|
93
|
+
readState(): Promise<AgentsStateFile | null>;
|
|
94
|
+
writeState(state: AgentsStateFile): Promise<void>;
|
|
95
|
+
addInstalledAgent(entry: InstalledAgent): Promise<void>;
|
|
96
|
+
removeInstalledAgent(agentId: string): Promise<void>;
|
|
97
|
+
writeAgentFiles(agentId: string, scope: "workspace" | "user", files: AgentDownloadFile[]): Promise<void>;
|
|
98
|
+
private listAgentIds;
|
|
99
|
+
}
|
|
3
100
|
|
|
4
101
|
/**
|
|
5
102
|
* Quick auth pre-flight check using `gh auth status`.
|
|
@@ -16,6 +113,13 @@ declare class EnvironmentInspector {
|
|
|
16
113
|
checkEnvironment(): Promise<EnvironmentCheckResult>;
|
|
17
114
|
checkTool(toolName: KnownEnvironmentTool): Promise<ToolCheckResult>;
|
|
18
115
|
private getToolPath;
|
|
116
|
+
/**
|
|
117
|
+
* On Windows, prefer the `.cmd` shim for npm/pnpm/nrm. nvm4w registers
|
|
118
|
+
* BOTH an extensionless entry (pointing to node.exe) and a `<tool>.cmd`
|
|
119
|
+
* wrapper; `where` returns them in that order, and the extensionless one
|
|
120
|
+
* would just print node's own version.
|
|
121
|
+
*/
|
|
122
|
+
private getToolShimPath;
|
|
19
123
|
private getToolVersion;
|
|
20
124
|
private checkNvm;
|
|
21
125
|
private checkNuget;
|
|
@@ -54,12 +158,16 @@ interface ServiceMeLogger {
|
|
|
54
158
|
declare const noopLogger: ServiceMeLogger;
|
|
55
159
|
declare function createConsoleLogger(prefix?: string): ServiceMeLogger;
|
|
56
160
|
|
|
161
|
+
declare const TOOL_RISK_MAP: Record<string, AgentToolRiskLevel>;
|
|
162
|
+
declare function parseAgentToolPermissions(content: string): AgentToolPermission[];
|
|
163
|
+
|
|
57
164
|
declare class ProjectTools {
|
|
58
165
|
extractTemplate(zipPath: string, workspacePath: string, tempExtractDir: string, input: ServiceMeProjectExtractTemplateInput): Promise<ServiceMeProjectExtractTemplateResult>;
|
|
59
166
|
installDependencies(workspacePath: string, command?: string): Promise<ServiceMeProjectInstallDepsResult>;
|
|
60
167
|
makeScriptsExecutable(workspacePath: string): Promise<ServiceMeProjectMakeScriptsExecutableResult>;
|
|
61
168
|
initializeGit(workspacePath: string): Promise<ServiceMeProjectGitInitResult>;
|
|
62
169
|
runScaffoldPrune(workspacePath: string, preset?: string): Promise<ServiceMeProjectScaffoldPruneResult>;
|
|
170
|
+
private ensurePresetManifest;
|
|
63
171
|
private findScripts;
|
|
64
172
|
private pathExists;
|
|
65
173
|
private selectExtractedDirectory;
|
|
@@ -234,7 +342,91 @@ declare class TaskLogManager {
|
|
|
234
342
|
clearLogs(taskId?: string): number;
|
|
235
343
|
}
|
|
236
344
|
|
|
345
|
+
interface SkillDownloadFile {
|
|
346
|
+
path: string;
|
|
347
|
+
content: string;
|
|
348
|
+
executable: boolean;
|
|
349
|
+
}
|
|
350
|
+
interface SkillStoreFileSystem {
|
|
351
|
+
readdir: typeof fs.readdir;
|
|
352
|
+
readFile: typeof fs.readFile;
|
|
353
|
+
writeFile: typeof fs.writeFile;
|
|
354
|
+
mkdir: typeof fs.mkdir;
|
|
355
|
+
chmod: typeof fs.chmod;
|
|
356
|
+
}
|
|
357
|
+
interface SkillStoreOptions {
|
|
358
|
+
workspacePath: string;
|
|
359
|
+
userSkillsRoot: string;
|
|
360
|
+
fileSystem?: SkillStoreFileSystem;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
interface SkillCatalog {
|
|
364
|
+
skills: SkillMarketplaceEntry[];
|
|
365
|
+
fetchedAt: string;
|
|
366
|
+
}
|
|
367
|
+
interface SkillCatalogClientOptions {
|
|
368
|
+
fetchImpl?: typeof fetch;
|
|
369
|
+
baseUrl?: string;
|
|
370
|
+
}
|
|
371
|
+
declare class SkillCatalogClient {
|
|
372
|
+
private readonly fetchImpl;
|
|
373
|
+
private readonly baseUrl?;
|
|
374
|
+
constructor(options?: SkillCatalogClientOptions);
|
|
375
|
+
getCatalog(): Promise<SkillCatalog>;
|
|
376
|
+
downloadSkill(remoteId: string): Promise<SkillDownloadFile[]>;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
interface CatalogSkillLike {
|
|
380
|
+
id: string;
|
|
381
|
+
hasScripts?: boolean;
|
|
382
|
+
hasHooks?: boolean;
|
|
383
|
+
}
|
|
384
|
+
interface CatalogLike {
|
|
385
|
+
skills: CatalogSkillLike[];
|
|
386
|
+
fetchedAt: string;
|
|
387
|
+
}
|
|
388
|
+
interface SkillStoreLike {
|
|
389
|
+
normalizeRemoteSkillId(remoteId: string): string;
|
|
390
|
+
listWorkspaceSkillIds(): Promise<string[]>;
|
|
391
|
+
listUserSkillIds(): Promise<string[]>;
|
|
392
|
+
}
|
|
393
|
+
interface SkillCatalogClientLike {
|
|
394
|
+
getCatalog(): Promise<CatalogLike>;
|
|
395
|
+
}
|
|
396
|
+
interface SkillReconcilerDependencies {
|
|
397
|
+
skillStore: SkillStoreLike;
|
|
398
|
+
catalogClient: SkillCatalogClientLike;
|
|
399
|
+
}
|
|
400
|
+
interface SkillMutateResult {
|
|
401
|
+
status: "success" | "blocked" | "requires_confirmation";
|
|
402
|
+
changed: boolean;
|
|
403
|
+
message?: string;
|
|
404
|
+
hasScripts?: boolean;
|
|
405
|
+
hasHooks?: boolean;
|
|
406
|
+
}
|
|
407
|
+
declare class SkillReconciler {
|
|
408
|
+
private readonly deps;
|
|
409
|
+
constructor(deps: SkillReconcilerDependencies);
|
|
410
|
+
mutate(request: SkillMutationRequest): Promise<SkillMutateResult>;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
declare class SkillStore {
|
|
414
|
+
private readonly workspacePath;
|
|
415
|
+
private readonly userSkillsRoot;
|
|
416
|
+
private readonly fileSystem;
|
|
417
|
+
constructor(options: SkillStoreOptions);
|
|
418
|
+
normalizeRemoteSkillId(remoteId: string): string;
|
|
419
|
+
getWorkspaceSkillPath(skillId: string): string;
|
|
420
|
+
getWorkspaceMarkerPath(): string;
|
|
421
|
+
getUserSkillPath(skillId: string): string;
|
|
422
|
+
listWorkspaceSkillIds(): Promise<string[]>;
|
|
423
|
+
listUserSkillIds(): Promise<string[]>;
|
|
424
|
+
writeManagedUserSkillMarker(skillId: string): Promise<void>;
|
|
425
|
+
isManagedUserSkill(skillId: string): Promise<boolean>;
|
|
426
|
+
writeSkillFiles(skillId: string, scope: "workspace" | "user", files: SkillDownloadFile[]): Promise<void>;
|
|
427
|
+
}
|
|
428
|
+
|
|
237
429
|
declare const unzipFile: (zipPath: string, dest: string) => Promise<void>;
|
|
238
430
|
declare const moveFiles: (sourceDir: string, destDir: string, overwrite?: boolean) => Promise<void>;
|
|
239
431
|
|
|
240
|
-
export { type AppendLogInput, type CreateTaskInput, DaemonLogger, type EditTaskInput, EnvironmentInspector, type ExecutorResult, GithubCopilotCliExecutor, HttpRequestExecutor, ImageTools, type JsonTools, type OutputEventCallback, PidManager, ProjectTools, SchedulerDaemon, type ServiceMeLogger, ShellExecutor, type StreamingExecutorHandle, type StreamingTaskExecutor, TaskConfigManager, type TaskEventListener, TaskExecutionEngine, type TaskExecutor, TaskLogManager, copilotDoctor, copilotPrompt, createConsoleLogger, createCopilotAuthRequiredError, createCopilotNotInstalledError, createImageTools, createJsonTools, createProjectTools, getExecutor, isCopilotAuthenticated, isStreamingTaskExecutor, matchesCron, moveFiles, noopLogger, parseIntervalMs, resolveTaskExecutionPayload, unzipFile, validateTaskPayload };
|
|
432
|
+
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 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 };
|