@vectorplane/ctrl-cli 0.1.10 → 0.1.12
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 +43 -0
- package/dist/commands/context.js +22 -5
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.js +35 -0
- package/dist/commands/registry.d.ts +1 -0
- package/dist/commands/registry.js +116 -0
- package/dist/commands/session.js +2 -0
- package/dist/commands/sync.js +9 -0
- package/dist/commands/task.d.ts +1 -0
- package/dist/commands/task.js +502 -0
- package/dist/commands/workspace.js +154 -1
- package/dist/core/agent-runtime-detection.d.ts +13 -0
- package/dist/core/agent-runtime-detection.js +117 -0
- package/dist/core/agent-setup.d.ts +20 -0
- package/dist/core/agent-setup.js +119 -0
- package/dist/core/api.d.ts +92 -2
- package/dist/core/api.js +195 -0
- package/dist/core/init-workspace.d.ts +29 -0
- package/dist/core/init-workspace.js +73 -0
- package/dist/core/runtime-agent-setup.d.ts +18 -0
- package/dist/core/runtime-agent-setup.js +13 -0
- package/dist/core/task-runner.d.ts +16 -0
- package/dist/core/task-runner.js +62 -0
- package/dist/core/workspace-binding.d.ts +5 -0
- package/dist/core/workspace-binding.js +8 -0
- package/dist/core/workspace-resolution.d.ts +12 -0
- package/dist/core/workspace-resolution.js +24 -0
- package/dist/index.js +12 -0
- package/dist/types/api.d.ts +205 -0
- package/dist/types/config.d.ts +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { ensureSessionAvailable, loadSession, upsertProfile } from "./config.js";
|
|
2
|
+
import { collectGitContext } from "./git.js";
|
|
3
|
+
import { collectMachineContext, collectRuntimeContext } from "./machine.js";
|
|
4
|
+
import { VectorPlaneApiClient } from "./api.js";
|
|
5
|
+
import { ensureFreshSession } from "./session.js";
|
|
6
|
+
import { ensureAgentSetupCurrent } from "./agent-setup.js";
|
|
7
|
+
import { resolveWorkspaceRoot } from "./workspace-binding.js";
|
|
8
|
+
import { resolveAuthorizedWorkspace } from "./workspace-resolution.js";
|
|
9
|
+
export async function buildInitLoginArgs(params) {
|
|
10
|
+
const loginArgs = [];
|
|
11
|
+
if (params.manual) {
|
|
12
|
+
loginArgs.push("--manual");
|
|
13
|
+
}
|
|
14
|
+
if (params.noBrowser) {
|
|
15
|
+
loginArgs.push("--no-browser");
|
|
16
|
+
}
|
|
17
|
+
if (params.profile) {
|
|
18
|
+
loginArgs.push("--profile", params.profile);
|
|
19
|
+
}
|
|
20
|
+
return loginArgs;
|
|
21
|
+
}
|
|
22
|
+
export async function runInitWorkspaceUseCase(params) {
|
|
23
|
+
let session = await loadSession(params.runtime.profile.name);
|
|
24
|
+
if (!session) {
|
|
25
|
+
params.runtime.logger.info("sessão local ausente, iniciando login...");
|
|
26
|
+
await params.ensureLoggedIn();
|
|
27
|
+
session = await ensureSessionAvailable(params.runtime.profile.name);
|
|
28
|
+
}
|
|
29
|
+
const [git, machine, runtimeContext] = await Promise.all([
|
|
30
|
+
collectGitContext(process.cwd()),
|
|
31
|
+
collectMachineContext(params.runtime.device, params.runtime.config),
|
|
32
|
+
collectRuntimeContext(params.cliVersion, "init", params.commandArgs),
|
|
33
|
+
]);
|
|
34
|
+
const apiClient = new VectorPlaneApiClient(params.runtime.profile.apiBaseUrl, params.runtime.config.requestTimeoutMs, params.runtime.logger);
|
|
35
|
+
const freshSession = await ensureFreshSession({
|
|
36
|
+
profileName: params.runtime.profile.name,
|
|
37
|
+
session,
|
|
38
|
+
machine,
|
|
39
|
+
runtime: runtimeContext,
|
|
40
|
+
device: params.runtime.device,
|
|
41
|
+
apiClient,
|
|
42
|
+
logger: params.runtime.logger,
|
|
43
|
+
});
|
|
44
|
+
const rootPath = resolveWorkspaceRoot(process.cwd(), git);
|
|
45
|
+
const workspace = await resolveAuthorizedWorkspace({
|
|
46
|
+
apiClient,
|
|
47
|
+
accessToken: freshSession.accessToken,
|
|
48
|
+
git,
|
|
49
|
+
explicitWorkspace: params.explicitWorkspace,
|
|
50
|
+
profile: params.runtime.profile,
|
|
51
|
+
session: freshSession,
|
|
52
|
+
});
|
|
53
|
+
const result = await ensureAgentSetupCurrent({
|
|
54
|
+
rootPath,
|
|
55
|
+
workspace,
|
|
56
|
+
repoUrl: git.remoteOrigin,
|
|
57
|
+
source: git.remoteOrigin ? "api-resolve" : "manual",
|
|
58
|
+
accessToken: freshSession.accessToken,
|
|
59
|
+
apiClient,
|
|
60
|
+
logger: params.runtime.logger,
|
|
61
|
+
explicitAgent: params.requestedAgent,
|
|
62
|
+
force: params.force,
|
|
63
|
+
});
|
|
64
|
+
await upsertProfile(params.runtime.profile.name, { workspace });
|
|
65
|
+
return {
|
|
66
|
+
workspace,
|
|
67
|
+
agent: result.agent,
|
|
68
|
+
confidence: result.confidence,
|
|
69
|
+
templatePath: result.templatePath,
|
|
70
|
+
fileStatus: result.fileStatus,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=init-workspace.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { VectorPlaneApiClient } from "./api.js";
|
|
2
|
+
import type { Logger } from "./logger.js";
|
|
3
|
+
import type { AuthSession } from "../types/auth.js";
|
|
4
|
+
import type { GitContext } from "../types/workspace.js";
|
|
5
|
+
export declare function ensureRuntimeAgentSetup(params: {
|
|
6
|
+
rootPath: string;
|
|
7
|
+
workspace: string;
|
|
8
|
+
git: GitContext;
|
|
9
|
+
session: AuthSession;
|
|
10
|
+
apiClient: VectorPlaneApiClient;
|
|
11
|
+
logger: Logger;
|
|
12
|
+
}): Promise<{
|
|
13
|
+
agent: import("./agent-runtime-detection.js").SupportedAgent;
|
|
14
|
+
templatePath: string;
|
|
15
|
+
fileStatus: "created" | "updated" | "unchanged";
|
|
16
|
+
changed: boolean;
|
|
17
|
+
confidence: import("./agent-runtime-detection.js").DetectionConfidence;
|
|
18
|
+
}>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ensureAgentSetupCurrent } from "./agent-setup.js";
|
|
2
|
+
export async function ensureRuntimeAgentSetup(params) {
|
|
3
|
+
return ensureAgentSetupCurrent({
|
|
4
|
+
rootPath: params.rootPath,
|
|
5
|
+
workspace: params.workspace,
|
|
6
|
+
repoUrl: params.git.remoteOrigin,
|
|
7
|
+
source: params.git.remoteOrigin ? "api-resolve" : "manual",
|
|
8
|
+
accessToken: params.session.accessToken,
|
|
9
|
+
apiClient: params.apiClient,
|
|
10
|
+
logger: params.logger,
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=runtime-agent-setup.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface LocalTaskExecutionInput {
|
|
2
|
+
execution: Record<string, unknown> | null | undefined;
|
|
3
|
+
workspaceRoot: string;
|
|
4
|
+
workspaceRef: string;
|
|
5
|
+
taskId: string;
|
|
6
|
+
stepId: string;
|
|
7
|
+
capability: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function executeLocalTaskStep(input: LocalTaskExecutionInput): Promise<{
|
|
10
|
+
command: string;
|
|
11
|
+
args: string[];
|
|
12
|
+
cwd: string;
|
|
13
|
+
exitCode: number;
|
|
14
|
+
stdout: string;
|
|
15
|
+
stderr: string;
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { ValidationError } from "./errors.js";
|
|
3
|
+
function interpolate(value, context) {
|
|
4
|
+
return value.replace(/\{([a-zA-Z0-9_]+)\}/g, (_, key) => context[key] ?? "");
|
|
5
|
+
}
|
|
6
|
+
function asStringArray(value) {
|
|
7
|
+
return Array.isArray(value) ? value.map((item) => String(item)) : [];
|
|
8
|
+
}
|
|
9
|
+
export async function executeLocalTaskStep(input) {
|
|
10
|
+
const execution = input.execution ?? {};
|
|
11
|
+
const type = typeof execution.type === "string" ? execution.type : "command";
|
|
12
|
+
if (type !== "command") {
|
|
13
|
+
throw new ValidationError("A execução local do step exige `metadata.execution.type = command`.");
|
|
14
|
+
}
|
|
15
|
+
const rawCommand = typeof execution.command === "string" ? execution.command.trim() : "";
|
|
16
|
+
if (!rawCommand) {
|
|
17
|
+
throw new ValidationError("A execução local do step exige `metadata.execution.command`.");
|
|
18
|
+
}
|
|
19
|
+
const context = {
|
|
20
|
+
workspaceRoot: input.workspaceRoot,
|
|
21
|
+
workspace: input.workspaceRef,
|
|
22
|
+
taskId: input.taskId,
|
|
23
|
+
stepId: input.stepId,
|
|
24
|
+
capability: input.capability,
|
|
25
|
+
};
|
|
26
|
+
const command = interpolate(rawCommand, context);
|
|
27
|
+
const args = asStringArray(execution.args).map((item) => interpolate(item, context));
|
|
28
|
+
const cwd = typeof execution.cwd === "string" && execution.cwd.trim()
|
|
29
|
+
? interpolate(execution.cwd, context)
|
|
30
|
+
: input.workspaceRoot;
|
|
31
|
+
const envOverrides = execution.env && typeof execution.env === "object"
|
|
32
|
+
? Object.fromEntries(Object.entries(execution.env).map(([key, value]) => [key, interpolate(String(value), context)]))
|
|
33
|
+
: {};
|
|
34
|
+
return new Promise((resolve, reject) => {
|
|
35
|
+
const child = spawn(command, args, {
|
|
36
|
+
cwd,
|
|
37
|
+
env: { ...process.env, ...envOverrides },
|
|
38
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
39
|
+
shell: false,
|
|
40
|
+
});
|
|
41
|
+
let stdout = "";
|
|
42
|
+
let stderr = "";
|
|
43
|
+
child.stdout.on("data", (chunk) => {
|
|
44
|
+
stdout += String(chunk);
|
|
45
|
+
});
|
|
46
|
+
child.stderr.on("data", (chunk) => {
|
|
47
|
+
stderr += String(chunk);
|
|
48
|
+
});
|
|
49
|
+
child.on("error", reject);
|
|
50
|
+
child.on("close", (exitCode) => {
|
|
51
|
+
resolve({
|
|
52
|
+
command,
|
|
53
|
+
args,
|
|
54
|
+
cwd,
|
|
55
|
+
exitCode: exitCode ?? 1,
|
|
56
|
+
stdout: stdout.trim(),
|
|
57
|
+
stderr: stderr.trim(),
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=task-runner.js.map
|
|
@@ -3,12 +3,17 @@ import type { GitContext } from "../types/workspace.js";
|
|
|
3
3
|
export declare function resolveWorkspaceRoot(cwd: string, git: GitContext): string;
|
|
4
4
|
export declare function deriveClientInstanceId(machineId: string, workspaceRoot: string, git: GitContext): string;
|
|
5
5
|
export declare function getBoundWorkspace(rootPath: string): Promise<string | null>;
|
|
6
|
+
export declare function getWorkspaceBinding(rootPath: string): Promise<import("../types/config.js").WorkspaceBinding>;
|
|
6
7
|
export declare function getBindingStore(): Promise<WorkspaceBindingStore>;
|
|
7
8
|
export declare function bindWorkspaceToRoot(params: {
|
|
8
9
|
rootPath: string;
|
|
9
10
|
workspace: string;
|
|
10
11
|
repoUrl: string | null;
|
|
11
12
|
source: "manual" | "api-resolve" | "session";
|
|
13
|
+
configuredAgent?: "claude" | "cursor" | "windsurf" | "copilot" | "codex" | "generic" | null;
|
|
14
|
+
agentConfidence?: "high" | "medium" | "low" | null;
|
|
15
|
+
templatePath?: string | null;
|
|
16
|
+
agentConfiguredAt?: string | null;
|
|
12
17
|
}): Promise<void>;
|
|
13
18
|
export declare function clearBoundWorkspace(rootPath: string): Promise<void>;
|
|
14
19
|
export declare function resolveWorkspacePreference(profile: CliProfileConfig, boundWorkspace: string | null): string | null;
|
|
@@ -17,6 +17,10 @@ export async function getBoundWorkspace(rootPath) {
|
|
|
17
17
|
const store = await loadWorkspaceBindings();
|
|
18
18
|
return store.bindings[rootPath]?.workspace ?? null;
|
|
19
19
|
}
|
|
20
|
+
export async function getWorkspaceBinding(rootPath) {
|
|
21
|
+
const store = await loadWorkspaceBindings();
|
|
22
|
+
return store.bindings[rootPath] ?? null;
|
|
23
|
+
}
|
|
20
24
|
export async function getBindingStore() {
|
|
21
25
|
return loadWorkspaceBindings();
|
|
22
26
|
}
|
|
@@ -27,6 +31,10 @@ export async function bindWorkspaceToRoot(params) {
|
|
|
27
31
|
repoUrl: params.repoUrl,
|
|
28
32
|
resolvedAt: new Date().toISOString(),
|
|
29
33
|
source: params.source,
|
|
34
|
+
configuredAgent: params.configuredAgent ?? null,
|
|
35
|
+
agentConfidence: params.agentConfidence ?? null,
|
|
36
|
+
templatePath: params.templatePath ?? null,
|
|
37
|
+
agentConfiguredAt: params.agentConfiguredAt ?? null,
|
|
30
38
|
});
|
|
31
39
|
}
|
|
32
40
|
export async function clearBoundWorkspace(rootPath) {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { VectorPlaneApiClient } from "./api.js";
|
|
2
|
+
import type { AuthSession } from "../types/auth.js";
|
|
3
|
+
import type { CliProfileConfig } from "../types/config.js";
|
|
4
|
+
import type { GitContext } from "../types/workspace.js";
|
|
5
|
+
export declare function resolveAuthorizedWorkspace(params: {
|
|
6
|
+
apiClient: VectorPlaneApiClient;
|
|
7
|
+
accessToken: string;
|
|
8
|
+
git: GitContext;
|
|
9
|
+
explicitWorkspace?: string;
|
|
10
|
+
profile: CliProfileConfig;
|
|
11
|
+
session: AuthSession;
|
|
12
|
+
}): Promise<string>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ValidationError } from "./errors.js";
|
|
2
|
+
export async function resolveAuthorizedWorkspace(params) {
|
|
3
|
+
if (params.git.remoteOrigin) {
|
|
4
|
+
const resolved = await params.apiClient.resolveWorkspaceByRepo(params.accessToken, {
|
|
5
|
+
repoUrl: params.git.remoteOrigin,
|
|
6
|
+
orgId: params.profile.orgId ?? undefined,
|
|
7
|
+
});
|
|
8
|
+
const resolvedWorkspace = String(resolved.workspaceId ?? resolved.id ?? resolved.slug ?? "");
|
|
9
|
+
const resolvedSlug = typeof resolved.slug === "string" ? resolved.slug : null;
|
|
10
|
+
if (params.explicitWorkspace && params.explicitWorkspace !== resolvedWorkspace && params.explicitWorkspace !== resolvedSlug) {
|
|
11
|
+
throw new ValidationError("O workspace solicitado não corresponde ao repositório remoto atual ou você não tem permissão para manipulá-lo.");
|
|
12
|
+
}
|
|
13
|
+
const workspace = resolvedWorkspace || resolvedSlug;
|
|
14
|
+
if (!workspace) {
|
|
15
|
+
throw new ValidationError("A API não retornou um identificador de workspace utilizável para o repositório atual.");
|
|
16
|
+
}
|
|
17
|
+
return workspace;
|
|
18
|
+
}
|
|
19
|
+
if (params.explicitWorkspace) {
|
|
20
|
+
return params.explicitWorkspace;
|
|
21
|
+
}
|
|
22
|
+
throw new ValidationError("Nenhum workspace resolvido para init. Configure um remote git correspondente ao workspace ou use --workspace com permissão válida.");
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=workspace-resolution.js.map
|
package/dist/index.js
CHANGED
|
@@ -7,11 +7,14 @@ import { runContextCommand } from "./commands/context.js";
|
|
|
7
7
|
import { runDoctorCommand } from "./commands/doctor.js";
|
|
8
8
|
import { runDraftCommand } from "./commands/draft.js";
|
|
9
9
|
import { runEventCommand } from "./commands/event.js";
|
|
10
|
+
import { runInitCommand } from "./commands/init.js";
|
|
10
11
|
import { runLoginCommand } from "./commands/login.js";
|
|
11
12
|
import { runLogoutCommand } from "./commands/logout.js";
|
|
13
|
+
import { runRegistryCommand } from "./commands/registry.js";
|
|
12
14
|
import { runSessionCommand } from "./commands/session.js";
|
|
13
15
|
import { runStatusCommand } from "./commands/status.js";
|
|
14
16
|
import { runSyncCommand } from "./commands/sync.js";
|
|
17
|
+
import { runTaskCommand } from "./commands/task.js";
|
|
15
18
|
import { runWhoAmICommand } from "./commands/whoami.js";
|
|
16
19
|
import { runWorkspaceCommand } from "./commands/workspace.js";
|
|
17
20
|
import { CLIError } from "./core/errors.js";
|
|
@@ -27,10 +30,13 @@ function printHelp() {
|
|
|
27
30
|
process.stdout.write("Uso: vp <comando>\n");
|
|
28
31
|
process.stdout.write("\n");
|
|
29
32
|
process.stdout.write("Comandos principais:\n");
|
|
33
|
+
process.stdout.write(" init [--agent <tipo>] [--workspace <workspace>] [--force]\n");
|
|
30
34
|
process.stdout.write(" login [--no-browser|--manual]\n");
|
|
31
35
|
process.stdout.write(" logout\n");
|
|
32
36
|
process.stdout.write(" sync [--force]\n");
|
|
33
37
|
process.stdout.write(" status\n");
|
|
38
|
+
process.stdout.write(" task <run|templates|list|inspect|claim|execute|daemon|approve|reject|delegate|step-update|handoff|observability|health>\n");
|
|
39
|
+
process.stdout.write(" registry <list|register|update|deactivate>\n");
|
|
34
40
|
process.stdout.write(" whoami\n");
|
|
35
41
|
process.stdout.write(" doctor\n");
|
|
36
42
|
process.stdout.write(" draft <create|list>\n");
|
|
@@ -52,12 +58,18 @@ export async function runCli(args) {
|
|
|
52
58
|
switch (command) {
|
|
53
59
|
case "login":
|
|
54
60
|
return runLoginCommand(cliVersion, rest);
|
|
61
|
+
case "init":
|
|
62
|
+
return runInitCommand(cliVersion, rest);
|
|
55
63
|
case "sync":
|
|
56
64
|
return runSyncCommand(cliVersion, rest);
|
|
57
65
|
case "logout":
|
|
58
66
|
return runLogoutCommand();
|
|
67
|
+
case "registry":
|
|
68
|
+
return runRegistryCommand(rest);
|
|
59
69
|
case "status":
|
|
60
70
|
return runStatusCommand();
|
|
71
|
+
case "task":
|
|
72
|
+
return runTaskCommand(cliVersion, rest);
|
|
61
73
|
case "whoami":
|
|
62
74
|
return runWhoAmICommand(cliVersion);
|
|
63
75
|
case "doctor":
|
package/dist/types/api.d.ts
CHANGED
|
@@ -6,6 +6,42 @@ export interface SyncRequest {
|
|
|
6
6
|
hash: string;
|
|
7
7
|
sent_at: string;
|
|
8
8
|
}
|
|
9
|
+
export interface WorkspaceAgentSetupFile {
|
|
10
|
+
filename: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
content: string;
|
|
13
|
+
}
|
|
14
|
+
export interface WorkspaceAgentSetupCli {
|
|
15
|
+
package: string;
|
|
16
|
+
command: string;
|
|
17
|
+
install: string;
|
|
18
|
+
login: string;
|
|
19
|
+
status: string;
|
|
20
|
+
sync: string;
|
|
21
|
+
workspaceUse: string;
|
|
22
|
+
bootstrap: string;
|
|
23
|
+
context: string;
|
|
24
|
+
deliveryContext: string;
|
|
25
|
+
draftCreate: string;
|
|
26
|
+
draftList: string;
|
|
27
|
+
sessionCheckIn: string;
|
|
28
|
+
sessionHeartbeat: string;
|
|
29
|
+
sessionCheckOut: string;
|
|
30
|
+
eventSend: string;
|
|
31
|
+
}
|
|
32
|
+
export interface WorkspaceAgentSetup {
|
|
33
|
+
workspaceId: string;
|
|
34
|
+
orgId: string;
|
|
35
|
+
mcpUrl: string;
|
|
36
|
+
apiUrl: string;
|
|
37
|
+
repoUrl: string | null;
|
|
38
|
+
cli: WorkspaceAgentSetupCli;
|
|
39
|
+
agents: Record<string, WorkspaceAgentSetupFile>;
|
|
40
|
+
hooks: Record<string, WorkspaceAgentSetupFile>;
|
|
41
|
+
githubActions: WorkspaceAgentSetupFile;
|
|
42
|
+
installScript: WorkspaceAgentSetupFile;
|
|
43
|
+
[key: string]: unknown;
|
|
44
|
+
}
|
|
9
45
|
export interface SyncResponse {
|
|
10
46
|
ok?: boolean;
|
|
11
47
|
workspace?: string;
|
|
@@ -30,6 +66,58 @@ export interface ResolveWorkspaceResponse {
|
|
|
30
66
|
repoUrl?: string | null;
|
|
31
67
|
[key: string]: unknown;
|
|
32
68
|
}
|
|
69
|
+
export type WorkspacePolicyRuleEffect = "allow" | "require_approval" | "block";
|
|
70
|
+
export interface WorkspacePolicyRuleConditions {
|
|
71
|
+
archetypes?: string[];
|
|
72
|
+
minTargetPathCount?: number;
|
|
73
|
+
requiredCapabilities?: string[];
|
|
74
|
+
}
|
|
75
|
+
export interface WorkspacePolicyRuleRecord {
|
|
76
|
+
id: string;
|
|
77
|
+
orgId: string;
|
|
78
|
+
workspaceId: string;
|
|
79
|
+
name: string;
|
|
80
|
+
pathPrefix: string | null;
|
|
81
|
+
capability: string | null;
|
|
82
|
+
effect: WorkspacePolicyRuleEffect;
|
|
83
|
+
rationale: string | null;
|
|
84
|
+
conditions: WorkspacePolicyRuleConditions | null;
|
|
85
|
+
approvalRole: string | null;
|
|
86
|
+
enabled: boolean;
|
|
87
|
+
createdAt: string;
|
|
88
|
+
updatedAt: string;
|
|
89
|
+
[key: string]: unknown;
|
|
90
|
+
}
|
|
91
|
+
export interface AgentRegistryRecord {
|
|
92
|
+
id: string;
|
|
93
|
+
orgId: string | null;
|
|
94
|
+
name: string;
|
|
95
|
+
runtimeType: string;
|
|
96
|
+
provider: string;
|
|
97
|
+
model: string;
|
|
98
|
+
capabilities: string[];
|
|
99
|
+
costProfile: string;
|
|
100
|
+
latencyProfile: string;
|
|
101
|
+
reliabilityScore: number;
|
|
102
|
+
status: string;
|
|
103
|
+
metadata?: Record<string, unknown> | null;
|
|
104
|
+
createdAt: string;
|
|
105
|
+
updatedAt: string;
|
|
106
|
+
}
|
|
107
|
+
export interface TaskTemplateRecord {
|
|
108
|
+
id: string;
|
|
109
|
+
slug: string;
|
|
110
|
+
name: string;
|
|
111
|
+
description: string | null;
|
|
112
|
+
defaultCapabilities: string[];
|
|
113
|
+
suggestedPaths: string[];
|
|
114
|
+
archetypeScope: string | null;
|
|
115
|
+
defaultRiskLevel: string | null;
|
|
116
|
+
enabled: boolean;
|
|
117
|
+
createdAt: string;
|
|
118
|
+
updatedAt: string;
|
|
119
|
+
[key: string]: unknown;
|
|
120
|
+
}
|
|
33
121
|
export interface AgentSessionRequest {
|
|
34
122
|
workspaceId: string;
|
|
35
123
|
agentName: string;
|
|
@@ -86,3 +174,120 @@ export interface MemoryDraftRecord {
|
|
|
86
174
|
updatedAt?: string;
|
|
87
175
|
[key: string]: unknown;
|
|
88
176
|
}
|
|
177
|
+
export interface MemorySearchRecord {
|
|
178
|
+
id: string;
|
|
179
|
+
workspaceId: string;
|
|
180
|
+
docType: MemoryDraftType;
|
|
181
|
+
authority: string;
|
|
182
|
+
title: string;
|
|
183
|
+
memoryKey: string | null;
|
|
184
|
+
excerpt: string;
|
|
185
|
+
score: number;
|
|
186
|
+
createdAt: string;
|
|
187
|
+
metadata?: Record<string, unknown> | null;
|
|
188
|
+
}
|
|
189
|
+
export interface TaskCreateRequest {
|
|
190
|
+
title: string;
|
|
191
|
+
intention: string;
|
|
192
|
+
templateSlug?: string;
|
|
193
|
+
requestedCapabilities?: string[];
|
|
194
|
+
targetPaths?: string[];
|
|
195
|
+
featureKey?: string;
|
|
196
|
+
taskKey?: string;
|
|
197
|
+
}
|
|
198
|
+
export interface TaskStepRecord {
|
|
199
|
+
id: string;
|
|
200
|
+
order: number;
|
|
201
|
+
name: string;
|
|
202
|
+
capability: string;
|
|
203
|
+
status: string;
|
|
204
|
+
assignedAgentId?: string | null;
|
|
205
|
+
assignedAgentName?: string | null;
|
|
206
|
+
output?: Record<string, unknown> | null;
|
|
207
|
+
lastError?: string | null;
|
|
208
|
+
[key: string]: unknown;
|
|
209
|
+
}
|
|
210
|
+
export interface ClaimableTaskStepRecord {
|
|
211
|
+
workspaceId: string;
|
|
212
|
+
taskId: string;
|
|
213
|
+
taskTitle: string;
|
|
214
|
+
stepId: string;
|
|
215
|
+
stepName: string;
|
|
216
|
+
capability: string;
|
|
217
|
+
status: string;
|
|
218
|
+
assignedAgentId: string;
|
|
219
|
+
assignedAgentName: string;
|
|
220
|
+
execution?: Record<string, unknown> | null;
|
|
221
|
+
createdAt: string;
|
|
222
|
+
updatedAt: string;
|
|
223
|
+
}
|
|
224
|
+
export interface ClaimedTaskStepResponse {
|
|
225
|
+
task: TaskRecord;
|
|
226
|
+
claim: ClaimableTaskStepRecord;
|
|
227
|
+
}
|
|
228
|
+
export interface TaskRecord {
|
|
229
|
+
id: string;
|
|
230
|
+
workspaceId: string;
|
|
231
|
+
title: string;
|
|
232
|
+
intention: string;
|
|
233
|
+
status: string;
|
|
234
|
+
riskLevel: string;
|
|
235
|
+
riskScore: number;
|
|
236
|
+
policyStatus: string;
|
|
237
|
+
conflictStatus: string;
|
|
238
|
+
requiresApproval?: boolean;
|
|
239
|
+
approvedBy?: string | null;
|
|
240
|
+
handoffSummary?: Record<string, unknown> | null;
|
|
241
|
+
requestedCapabilities: string[];
|
|
242
|
+
targetPaths: string[];
|
|
243
|
+
warnings: string[];
|
|
244
|
+
recommendedApproach?: string | null;
|
|
245
|
+
createdAt?: string;
|
|
246
|
+
updatedAt?: string;
|
|
247
|
+
handoffs?: Array<{
|
|
248
|
+
id: string;
|
|
249
|
+
title: string;
|
|
250
|
+
summary?: Record<string, unknown> | null;
|
|
251
|
+
nextSteps?: string[];
|
|
252
|
+
risks?: string[];
|
|
253
|
+
createdAt: string;
|
|
254
|
+
}>;
|
|
255
|
+
steps: TaskStepRecord[];
|
|
256
|
+
[key: string]: unknown;
|
|
257
|
+
}
|
|
258
|
+
export interface TaskHandoffRecord {
|
|
259
|
+
taskId: string;
|
|
260
|
+
workspaceId: string;
|
|
261
|
+
status: string;
|
|
262
|
+
title: string;
|
|
263
|
+
currentTitle?: string;
|
|
264
|
+
currentSummary?: Record<string, unknown> | null;
|
|
265
|
+
nextSteps?: string[];
|
|
266
|
+
risks?: string[];
|
|
267
|
+
memoryLanes?: string[];
|
|
268
|
+
[key: string]: unknown;
|
|
269
|
+
}
|
|
270
|
+
export interface TaskObservabilityRecord {
|
|
271
|
+
workspaceId: string;
|
|
272
|
+
taskId?: string;
|
|
273
|
+
title?: string;
|
|
274
|
+
status?: string;
|
|
275
|
+
riskLevel?: string;
|
|
276
|
+
policyStatus?: string;
|
|
277
|
+
conflictStatus?: string;
|
|
278
|
+
durationMs?: number;
|
|
279
|
+
delegationCount?: number;
|
|
280
|
+
handoffCount?: number;
|
|
281
|
+
attempts?: number;
|
|
282
|
+
totalTasks?: number;
|
|
283
|
+
completedTasks?: number;
|
|
284
|
+
failedTasks?: number;
|
|
285
|
+
blockedTasks?: number;
|
|
286
|
+
delegatedTasks?: number;
|
|
287
|
+
averageDurationMs?: number;
|
|
288
|
+
successRate?: number;
|
|
289
|
+
recentTasks?: Array<Record<string, unknown>>;
|
|
290
|
+
steps?: Array<Record<string, unknown>>;
|
|
291
|
+
timeline?: Array<Record<string, unknown>>;
|
|
292
|
+
[key: string]: unknown;
|
|
293
|
+
}
|
package/dist/types/config.d.ts
CHANGED
|
@@ -60,6 +60,10 @@ export interface WorkspaceBinding {
|
|
|
60
60
|
repoUrl: string | null;
|
|
61
61
|
resolvedAt: string;
|
|
62
62
|
source: "manual" | "api-resolve" | "session";
|
|
63
|
+
configuredAgent?: "claude" | "cursor" | "windsurf" | "copilot" | "codex" | "generic" | null;
|
|
64
|
+
agentConfidence?: "high" | "medium" | "low" | null;
|
|
65
|
+
templatePath?: string | null;
|
|
66
|
+
agentConfiguredAt?: string | null;
|
|
63
67
|
}
|
|
64
68
|
export interface WorkspaceBindingStore {
|
|
65
69
|
bindings: Record<string, WorkspaceBinding>;
|