nolo-cli 0.1.32 → 0.1.34
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 +4 -10
- package/agent-runtime/agentRecordConfig.ts +10 -0
- package/agent-runtime/hostAdapter.ts +10 -1
- package/agent-runtime/index.ts +9 -20
- package/agent-runtime/localLoop.ts +49 -2
- package/agent-runtime/localToolPolicy.ts +76 -34
- package/agent-runtime/localWorkspaceTools.ts +30 -333
- package/agent-runtime/openAiCompatibleProvider.ts +7 -3
- package/agent-runtime/openAiCompatibleProviderConfig.ts +15 -26
- package/agent-runtime/platformChatProvider.ts +47 -73
- package/agent-runtime/providerResolution.ts +244 -0
- package/agent-runtime/runtimeToolPolicy.ts +77 -29
- package/agent-runtime/shellCommandPolicy.ts +120 -0
- package/agentAliases.ts +14 -83
- package/agentCommandSupport.ts +3 -6
- package/agentInternalCommandEntries.ts +4 -13
- package/agentListCommands.ts +18 -27
- package/agentMachineCommands.ts +40 -336
- package/agentPullCommand.ts +30 -55
- package/agentRecordCommands.ts +84 -1
- package/agentRecordHelpers.ts +102 -186
- package/agentRunCommand.ts +438 -107
- package/agentRuntimeLocal.ts +2 -9
- package/ai/agent/cliExecutor.ts +19 -323
- package/ai/tools/toolNameAliases.ts +70 -0
- package/authCommands.ts +2 -36
- package/cli/agentAliases.ts +14 -83
- package/cli/agentCommandSupport.ts +3 -6
- package/cli/agentInternalCommandEntries.ts +4 -13
- package/cli/agentListCommands.ts +18 -27
- package/cli/agentMachineCommands.ts +40 -336
- package/cli/agentPullCommand.ts +30 -55
- package/cli/agentRecordCommands.ts +84 -1
- package/cli/agentRecordHelpers.ts +102 -186
- package/cli/agentRunCommand.ts +438 -107
- package/cli/agentRuntimeLocal.ts +2 -9
- package/cli/authCommands.ts +2 -36
- package/cli/cliCommandDispatch.ts +2 -2
- package/cli/cliEnvHelpers.ts +34 -107
- package/cli/client/agentRun.ts +854 -57
- package/cli/client/localRuntimeAdapter.ts +59 -159
- package/cli/client/streamingOutput.ts +3 -1
- package/cli/client/taskRunPrompt.ts +24 -7
- package/cli/commandRegistry.ts +4 -5
- package/cli/connectorRunArtifact.ts +10 -34
- package/cli/connectorWebSocketTarget.ts +6 -10
- package/cli/internalCommandEntries.ts +0 -8
- package/cli/localRuntimeDb.ts +2 -39
- package/cli/machineCommands.ts +189 -190
- package/cli/machineDaemonCommands.ts +165 -9
- package/cli/machineHeartbeatCommands.ts +2 -1
- package/cli/machineStatusCommands.ts +13 -5
- package/cli/machineWatchCommands.ts +1 -1
- package/cli/machineWsRunDispatch.ts +30 -44
- package/cli/machineWsSession.ts +0 -2
- package/cli/offlineMarxistsAgentCommand.ts +314 -0
- package/cli/runtimeDoctorCommands.ts +72 -15
- package/cli/scriptCommandEntries.ts +45 -5
- package/cli/tableCommands.ts +133 -33
- package/cli/taskRunCommand.ts +211 -16
- package/cli/tui/session.ts +372 -43
- package/cli/workflowInternalCommandEntries.ts +0 -20
- package/cliCommandDispatch.ts +2 -2
- package/cliEnvHelpers.ts +34 -107
- package/client/agentConfigResolver.test.ts +2 -0
- package/client/agentRun.test.ts +12 -208
- package/client/agentRun.ts +854 -57
- package/client/localProviderResolver.test.ts +26 -2
- package/client/localRuntimeAdapter.test.ts +296 -171
- package/client/localRuntimeAdapter.ts +59 -159
- package/client/localToolPolicy.test.ts +4 -28
- package/client/streamingOutput.ts +3 -1
- package/client/taskRunPrompt.ts +24 -7
- package/commandRegistry.ts +4 -5
- package/connectorRunArtifact.ts +10 -34
- package/connectorWebSocketTarget.ts +6 -10
- package/database/server/serverStoreFactory.ts +2 -8
- package/internalCommandEntries.ts +0 -8
- package/localRuntimeDb.ts +2 -39
- package/machineCommands.ts +189 -190
- package/machineDaemonCommands.ts +165 -9
- package/machineHeartbeatCommands.ts +2 -1
- package/machineStatusCommands.ts +13 -5
- package/machineWatchCommands.ts +1 -1
- package/machineWsRunDispatch.ts +30 -44
- package/machineWsSession.ts +0 -2
- package/offlineMarxistsAgentCommand.ts +314 -0
- package/package.json +52 -188
- package/runtimeDoctorCommands.ts +72 -15
- package/scriptCommandEntries.ts +45 -5
- package/tableCommands.ts +133 -33
- package/taskRunCommand.ts +211 -16
- package/tui/session.ts +372 -43
- package/workflowInternalCommandEntries.ts +0 -20
- package/agent-runtime/dialogStatus.ts +0 -139
- package/agent-runtime/hostRuntimeConfig.ts +0 -86
- package/agentCreateCustomCommands.ts +0 -278
- package/agentDialogsCommands.ts +0 -227
- package/agentDoctorCommands.ts +0 -203
- package/agentRunLocalWorkspace.ts +0 -182
- package/agentRunParsing.ts +0 -298
- package/agentSuperviseCommands.ts +0 -8
- package/agentUnpublishCommands.ts +0 -113
- package/ai/agent/agentRunDialogLineage.ts +0 -56
- package/ai/policy/types.ts +0 -64
- package/ai/skills/skillSummaryMarker.ts +0 -26
- package/app/types.ts +0 -358
- package/build.ts +0 -16
- package/buildPublish.ts +0 -138
- package/buildPublishArtifactAssembly.ts +0 -724
- package/buildPublishImportAnalysis.ts +0 -242
- package/chat/messages/fetchMessages.ts +0 -84
- package/chat/messages/types.ts +0 -185
- package/cli/agentCreateCustomCommands.ts +0 -278
- package/cli/agentDialogsCommands.ts +0 -227
- package/cli/agentDoctorCommands.ts +0 -203
- package/cli/agentRunLocalWorkspace.ts +0 -182
- package/cli/agentRunParsing.ts +0 -298
- package/cli/agentSuperviseCommands.ts +0 -8
- package/cli/agentUnpublishCommands.ts +0 -113
- package/cli/buildPublish.ts +0 -138
- package/cli/buildPublishArtifactAssembly.ts +0 -724
- package/cli/buildPublishImportAnalysis.ts +0 -242
- package/cli/cliIoTypes.ts +0 -3
- package/cli/cliRuntimeDoctorReport.ts +0 -193
- package/cli/client/agentRunInput.ts +0 -10
- package/cli/client/agentRunLocalExecution.ts +0 -124
- package/cli/client/agentRunLocalExecutor.ts +0 -179
- package/cli/client/agentRunRuntimeSelection.ts +0 -145
- package/cli/client/agentRunServerTransport.ts +0 -397
- package/cli/client/agentRunTaskRunRecorder.ts +0 -176
- package/cli/customCodingAgentFlow.ts +0 -208
- package/cli/customCodingAgentRecord.ts +0 -179
- package/cli/dialogDataAccess.ts +0 -186
- package/cli/dialogInternalCommandEntries.ts +0 -11
- package/cli/dialogReadCommands.ts +0 -180
- package/cli/dialogReadHelpers.ts +0 -226
- package/cli/dialogStatusCommands.ts +0 -123
- package/cli/docInternalCommandEntries.ts +0 -20
- package/cli/hybridReadHelpers.ts +0 -109
- package/cli/machineCommandPrompts.ts +0 -79
- package/cli/machineCommandResolution.ts +0 -43
- package/cli/noloReadBridgePrompt.ts +0 -16
- package/cli/pageCreateCommands.ts +0 -219
- package/cli/pageDeleteCommands.ts +0 -167
- package/cli/pageReadCommands.ts +0 -151
- package/cli/pageUpdateCommands.ts +0 -249
- package/cli/pageWriteHelpers.ts +0 -209
- package/cli/publishPackage.ts +0 -36
- package/cli/runtimeInternalCommandEntries.ts +0 -15
- package/cli/runtimePassthroughCommands.ts +0 -22
- package/cli/scriptPassthroughHelpers.ts +0 -28
- package/cli/secretScanHelpers.ts +0 -31
- package/cli/spaceAttachCommands.ts +0 -134
- package/cli/spaceCategoryCommands.ts +0 -263
- package/cli/spaceCommands.ts +0 -295
- package/cli/spaceDeleteCommands.ts +0 -312
- package/cli/spaceInternalCommandEntries.ts +0 -21
- package/cli/spaceMutationHelpers.ts +0 -135
- package/cli/spaceReadCommands.ts +0 -323
- package/cli/tableDataOutput.ts +0 -41
- package/cli/tableDataSafety.ts +0 -26
- package/cli/tableMetaCommands.ts +0 -307
- package/cli/tableMutationCommands.ts +0 -266
- package/cli/tableQueryParsing.ts +0 -90
- package/cli/tableQueryRequest.ts +0 -53
- package/cli/taskRunActions.ts +0 -122
- package/cli/taskRunParsing.ts +0 -86
- package/cli/taskRunPromptShared.ts +0 -55
- package/cli/tui/tuiCatalog.ts +0 -22
- package/cli/tui/tuiCommandInterpreter.ts +0 -253
- package/cli/tui/tuiPresentation.ts +0 -146
- package/cliIoTypes.ts +0 -3
- package/cliRuntimeDoctorReport.ts +0 -193
- package/client/agentRunInput.ts +0 -10
- package/client/agentRunLocalExecution.test.ts +0 -123
- package/client/agentRunLocalExecution.ts +0 -124
- package/client/agentRunLocalExecutor.ts +0 -179
- package/client/agentRunRuntimeSelection.test.ts +0 -159
- package/client/agentRunRuntimeSelection.ts +0 -145
- package/client/agentRunServerTransport.ts +0 -397
- package/client/agentRunTaskRunRecorder.ts +0 -176
- package/connector-experimental/daemonLauncher.ts +0 -223
- package/create/space/spaceKeys.ts +0 -65
- package/create/types.ts +0 -21
- package/customCodingAgentFlow.ts +0 -208
- package/customCodingAgentRecord.ts +0 -179
- package/database/keys.ts +0 -765
- package/database/tombstones.ts +0 -52
- package/database/utils/ulid.ts +0 -1
- package/dialogDataAccess.ts +0 -186
- package/dialogInternalCommandEntries.ts +0 -11
- package/dialogReadCommands.ts +0 -180
- package/dialogReadHelpers.ts +0 -226
- package/dialogStatusCommands.ts +0 -123
- package/docInternalCommandEntries.ts +0 -20
- package/hybridReadHelpers.ts +0 -109
- package/machineCommandPrompts.ts +0 -79
- package/machineCommandResolution.ts +0 -43
- package/noloReadBridgePrompt.ts +0 -16
- package/pageCreateCommands.ts +0 -219
- package/pageDeleteCommands.ts +0 -167
- package/pageReadCommands.ts +0 -151
- package/pageUpdateCommands.ts +0 -249
- package/pageWriteHelpers.ts +0 -209
- package/publishPackage.ts +0 -36
- package/runtimeInternalCommandEntries.ts +0 -15
- package/runtimePassthroughCommands.ts +0 -22
- package/scriptPassthroughHelpers.ts +0 -28
- package/secretScanHelpers.ts +0 -31
- package/share/helpers.ts +0 -302
- package/share/keys.ts +0 -243
- package/share/types.ts +0 -100
- package/spaceAttachCommands.ts +0 -134
- package/spaceCategoryCommands.ts +0 -263
- package/spaceCommands.ts +0 -295
- package/spaceDeleteCommands.ts +0 -312
- package/spaceInternalCommandEntries.ts +0 -21
- package/spaceMutationHelpers.ts +0 -135
- package/spaceReadCommands.ts +0 -323
- package/tableDataOutput.ts +0 -41
- package/tableDataSafety.ts +0 -26
- package/tableMetaCommands.ts +0 -307
- package/tableMutationCommands.ts +0 -266
- package/tableQueryParsing.ts +0 -90
- package/tableQueryRequest.ts +0 -53
- package/taskRunActions.ts +0 -122
- package/taskRunParsing.ts +0 -86
- package/taskRunPromptShared.ts +0 -55
- package/tui/tuiCatalog.ts +0 -22
- package/tui/tuiCommandInterpreter.test.ts +0 -169
- package/tui/tuiCommandInterpreter.ts +0 -253
- package/tui/tuiPresentation.test.ts +0 -154
- package/tui/tuiPresentation.ts +0 -146
package/agentRunCommand.ts
CHANGED
|
@@ -1,33 +1,25 @@
|
|
|
1
|
+
import { DEFAULT_NOLO_SERVER_URL } from "./defaultServer";
|
|
1
2
|
import { runAgentTurn, type RunAgentTurnResult } from "./client/agentRun";
|
|
2
|
-
import type { AgentRuntimeHostAdapter } from "./agentRuntimeLocal";
|
|
3
|
-
import {
|
|
3
|
+
import type { AgentRuntimeHostAdapter, AgentRuntimeRequestedMode } from "./agentRuntimeLocal";
|
|
4
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
5
|
+
import { extname, resolve } from "node:path";
|
|
6
|
+
import { parseSkillDocProtocol, type WorkflowReferenceConfig } from "./ai/skills/skillDocProtocol";
|
|
7
|
+
import { resolveCliAgentKeyInput } from "./agentAliases";
|
|
4
8
|
import {
|
|
5
|
-
prepareTaskWorktree,
|
|
6
9
|
ensureWorkspacePackageLinks,
|
|
10
|
+
formatPreparedTaskWorktree,
|
|
11
|
+
prepareTaskWorktree,
|
|
12
|
+
type PreparedTaskWorktree,
|
|
7
13
|
} from "./client/taskWorktree";
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
prepareLocalRunWorkspace,
|
|
12
|
-
type EnvLike,
|
|
13
|
-
type OutputLike,
|
|
14
|
-
} from "./agentRunLocalWorkspace";
|
|
15
|
-
import {
|
|
16
|
-
normalizeCliImageInput,
|
|
17
|
-
parseAgentRunArgs,
|
|
18
|
-
readAgentRunInput,
|
|
19
|
-
prependWorkflowReferencePrompt,
|
|
20
|
-
resolveWorkflowReference,
|
|
21
|
-
type ParsedAgentRunArgs,
|
|
22
|
-
type ResolvedWorkflowReference,
|
|
23
|
-
} from "./agentRunParsing";
|
|
24
|
-
import { resolveAgentRecordFromHybridStore } from "./agentRecordHelpers";
|
|
25
|
-
import {
|
|
26
|
-
buildCurrentUserPlatformAgentCandidateKeys,
|
|
27
|
-
} from "./agentAliases";
|
|
28
|
-
import { parseUserIdFromAuthToken, resolveAuthToken, resolveServerUrl } from "./cliEnvHelpers";
|
|
14
|
+
import type { TaskRunPromptContext } from "./client/taskRunPrompt";
|
|
15
|
+
|
|
16
|
+
type EnvLike = Record<string, string | undefined>;
|
|
29
17
|
|
|
30
|
-
type
|
|
18
|
+
type OutputLike = {
|
|
19
|
+
write(chunk: string): unknown;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
type AgentRunCommandDeps = {
|
|
31
23
|
env?: EnvLike;
|
|
32
24
|
scriptDir: string;
|
|
33
25
|
output?: OutputLike;
|
|
@@ -39,15 +31,325 @@ type AgentRunCommandDeps = AgentCommandDeps & {
|
|
|
39
31
|
resolveWorkflowReference?: typeof resolveWorkflowReference;
|
|
40
32
|
};
|
|
41
33
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
34
|
+
type LocalRunWorkspaceInspection = {
|
|
35
|
+
cwd: string;
|
|
36
|
+
clean: boolean;
|
|
37
|
+
status: string;
|
|
38
|
+
commit?: {
|
|
39
|
+
hash: string;
|
|
40
|
+
subject: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
type ParseAgentRunArgsOptions = {
|
|
45
|
+
readTextFile?: (path: string) => string;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
type ParsedAgentRunArgs = {
|
|
49
|
+
agentKey: string;
|
|
50
|
+
message: string;
|
|
51
|
+
imageUrls: string[];
|
|
52
|
+
allowShell: boolean;
|
|
53
|
+
runtimeMode?: AgentRuntimeRequestedMode;
|
|
54
|
+
continueDialogId?: string;
|
|
55
|
+
spaceId?: string;
|
|
56
|
+
category?: string;
|
|
57
|
+
inheritedFromDialogKey?: string;
|
|
58
|
+
parentDialogId?: string;
|
|
59
|
+
background: boolean;
|
|
60
|
+
noStream: boolean;
|
|
61
|
+
noDefaultTestRoot: boolean;
|
|
62
|
+
cwd?: string;
|
|
63
|
+
maxToolRounds?: number;
|
|
64
|
+
timeoutMs?: number;
|
|
65
|
+
traceTools: boolean;
|
|
66
|
+
useTaskWorktree: boolean;
|
|
67
|
+
taskRunContext?: TaskRunPromptContext;
|
|
68
|
+
workflowRef?: string;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
type ResolvedWorkflowReference = {
|
|
72
|
+
ref: string;
|
|
73
|
+
content: string;
|
|
74
|
+
config?: Partial<WorkflowReferenceConfig>;
|
|
49
75
|
};
|
|
50
76
|
|
|
77
|
+
const DEFAULT_TEST_ROOT_DIALOG_ID = "01KN6V3MVEQA4Q1PNKVM2W7YY8";
|
|
78
|
+
const DEFAULT_TEST_ROOT_DIALOG_KEY = `dialog-b2e06f801f-${DEFAULT_TEST_ROOT_DIALOG_ID}`;
|
|
79
|
+
const DEFAULT_TEST_DIALOG_CATEGORY_ID = "test-dialogs";
|
|
80
|
+
|
|
81
|
+
function readFlagValue(args: string[], flag: string) {
|
|
82
|
+
const index = args.indexOf(flag);
|
|
83
|
+
if (index < 0) return undefined;
|
|
84
|
+
return args[index + 1];
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function readRepeatedFlagValues(args: string[], flag: string) {
|
|
88
|
+
const values: string[] = [];
|
|
89
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
90
|
+
if (args[index] === flag && args[index + 1]) {
|
|
91
|
+
values.push(args[index + 1]);
|
|
92
|
+
index += 1;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return values;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function runtimeModeFromArgs(args: string[]): AgentRuntimeRequestedMode | undefined {
|
|
99
|
+
if (args.includes("--local")) return "local";
|
|
100
|
+
if (args.includes("--server")) return "server";
|
|
101
|
+
if (args.includes("--auto")) return "auto";
|
|
102
|
+
return undefined;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function parseNonNegativeInteger(value: string | undefined) {
|
|
106
|
+
if (!value) return undefined;
|
|
107
|
+
const parsed = Number(value);
|
|
108
|
+
if (!Number.isFinite(parsed) || parsed < 0) return undefined;
|
|
109
|
+
return Math.floor(parsed);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function parsePositiveInteger(value: string | undefined) {
|
|
113
|
+
if (!value) return undefined;
|
|
114
|
+
const parsed = Number(value);
|
|
115
|
+
if (!Number.isFinite(parsed) || parsed <= 0) return undefined;
|
|
116
|
+
return Math.floor(parsed);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function positionalArgs(args: string[]) {
|
|
120
|
+
const values: string[] = [];
|
|
121
|
+
const valuelessFlags = new Set([
|
|
122
|
+
"--local",
|
|
123
|
+
"--server",
|
|
124
|
+
"--auto",
|
|
125
|
+
"--dangerously-allow-shell",
|
|
126
|
+
"--worktree-task",
|
|
127
|
+
"--trace-tools",
|
|
128
|
+
"--bg",
|
|
129
|
+
"--no-stream",
|
|
130
|
+
"--debug",
|
|
131
|
+
"--no-default-test-root",
|
|
132
|
+
]);
|
|
133
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
134
|
+
const arg = args[index];
|
|
135
|
+
if (valuelessFlags.has(arg)) continue;
|
|
136
|
+
if (arg.startsWith("--")) {
|
|
137
|
+
index += 1;
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
values.push(arg);
|
|
141
|
+
}
|
|
142
|
+
return values;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export function parseAgentRunArgs(
|
|
146
|
+
args: string[],
|
|
147
|
+
options: ParseAgentRunArgsOptions = {}
|
|
148
|
+
): ParsedAgentRunArgs | null {
|
|
149
|
+
const agentKey = readFlagValue(args, "--agent") ?? positionalArgs(args)[0];
|
|
150
|
+
const explicitMsg = readFlagValue(args, "--msg");
|
|
151
|
+
const msgFile = readFlagValue(args, "--msg-file");
|
|
152
|
+
const fileMessage = msgFile
|
|
153
|
+
? (options.readTextFile ?? ((path: string) => readFileSync(path, "utf8")))(msgFile)
|
|
154
|
+
: undefined;
|
|
155
|
+
const rawMessage = explicitMsg ?? fileMessage ?? positionalArgs(args).slice(1).join(" ");
|
|
156
|
+
if (!agentKey || !rawMessage.trim()) return null;
|
|
157
|
+
const message = rawMessage.trim();
|
|
158
|
+
const runtimeMode = runtimeModeFromArgs(args);
|
|
159
|
+
const continueDialogId = readFlagValue(args, "--continue") ?? readFlagValue(args, "--dialog");
|
|
160
|
+
const spaceId = readFlagValue(args, "--space");
|
|
161
|
+
const category = readFlagValue(args, "--category");
|
|
162
|
+
const inheritedFromDialog = readFlagValue(args, "--inherit-from-dialog");
|
|
163
|
+
const noDefaultTestRoot = args.includes("--no-default-test-root");
|
|
164
|
+
const cwd = readFlagValue(args, "--cwd");
|
|
165
|
+
const maxToolRounds = parseNonNegativeInteger(
|
|
166
|
+
readFlagValue(args, "--max-tool-rounds") ?? readFlagValue(args, "--rounds")
|
|
167
|
+
);
|
|
168
|
+
const timeoutMs = parsePositiveInteger(readFlagValue(args, "--timeout-ms"));
|
|
169
|
+
const inheritedRef = inheritedFromDialog
|
|
170
|
+
? parseDialogReference(inheritedFromDialog)
|
|
171
|
+
: !continueDialogId && !noDefaultTestRoot
|
|
172
|
+
? {
|
|
173
|
+
dialogKey: DEFAULT_TEST_ROOT_DIALOG_KEY,
|
|
174
|
+
dialogId: DEFAULT_TEST_ROOT_DIALOG_ID,
|
|
175
|
+
}
|
|
176
|
+
: undefined;
|
|
177
|
+
const imageUrls = [
|
|
178
|
+
...readRepeatedFlagValues(args, "--image"),
|
|
179
|
+
...readRepeatedFlagValues(args, "--image-url"),
|
|
180
|
+
];
|
|
181
|
+
const useTaskWorktree = args.includes("--worktree-task");
|
|
182
|
+
const workflowRef = readFlagValue(args, "--workflow");
|
|
183
|
+
const taskRowDbKey = readFlagValue(args, "--task-row-dbkey");
|
|
184
|
+
const artifactIds = readFlagValue(args, "--artifact-ids")
|
|
185
|
+
?.split(",")
|
|
186
|
+
.map((item) => item.trim())
|
|
187
|
+
.filter(Boolean);
|
|
188
|
+
return {
|
|
189
|
+
agentKey: resolveCliAgentKeyInput(agentKey),
|
|
190
|
+
message,
|
|
191
|
+
imageUrls,
|
|
192
|
+
allowShell: args.includes("--dangerously-allow-shell"),
|
|
193
|
+
traceTools: args.includes("--trace-tools"),
|
|
194
|
+
useTaskWorktree,
|
|
195
|
+
...(workflowRef ? { workflowRef } : {}),
|
|
196
|
+
...(taskRowDbKey
|
|
197
|
+
? {
|
|
198
|
+
taskRunContext: {
|
|
199
|
+
rowDbKey: taskRowDbKey,
|
|
200
|
+
...(readFlagValue(args, "--task-run-id") ? { taskRunId: readFlagValue(args, "--task-run-id") } : {}),
|
|
201
|
+
...(readFlagValue(args, "--work-item-id") ? { workItemId: readFlagValue(args, "--work-item-id") } : {}),
|
|
202
|
+
...(artifactIds?.length ? { artifactIds } : {}),
|
|
203
|
+
},
|
|
204
|
+
}
|
|
205
|
+
: {}),
|
|
206
|
+
...(runtimeMode ? { runtimeMode } : useTaskWorktree ? { runtimeMode: "local" as const } : {}),
|
|
207
|
+
background: args.includes("--bg"),
|
|
208
|
+
noStream: args.includes("--no-stream"),
|
|
209
|
+
noDefaultTestRoot,
|
|
210
|
+
...(continueDialogId ? { continueDialogId } : {}),
|
|
211
|
+
...(!continueDialogId && spaceId ? { spaceId } : {}),
|
|
212
|
+
...(category ? { category } : !continueDialogId && !noDefaultTestRoot ? { category: DEFAULT_TEST_DIALOG_CATEGORY_ID } : {}),
|
|
213
|
+
...(inheritedRef?.dialogKey ? { inheritedFromDialogKey: inheritedRef.dialogKey } : {}),
|
|
214
|
+
...(inheritedRef?.dialogId ? { parentDialogId: inheritedRef.dialogId } : {}),
|
|
215
|
+
...(cwd ? { cwd } : {}),
|
|
216
|
+
...(typeof maxToolRounds === "number" ? { maxToolRounds } : {}),
|
|
217
|
+
...(typeof timeoutMs === "number" ? { timeoutMs } : {}),
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function workflowRefToCandidatePath(cwd: string, ref: string) {
|
|
222
|
+
const normalized = ref.trim();
|
|
223
|
+
if (!normalized) return "";
|
|
224
|
+
if (normalized.endsWith(".md") || normalized.includes("/") || normalized.includes("\\")) {
|
|
225
|
+
const directPath = resolve(cwd, normalized);
|
|
226
|
+
if (existsSync(directPath)) return directPath;
|
|
227
|
+
}
|
|
228
|
+
const fileName = normalized.replace(/[^a-zA-Z0-9\u4e00-\u9fa5]+/g, "-").replace(/^-+|-+$/g, "");
|
|
229
|
+
return resolve(cwd, "docs", "workflows", `${fileName}.md`);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export async function resolveWorkflowReference(ref: string, cwd = process.cwd()): Promise<ResolvedWorkflowReference> {
|
|
233
|
+
const path = workflowRefToCandidatePath(cwd, ref);
|
|
234
|
+
if (!path || !existsSync(path)) {
|
|
235
|
+
throw new Error(`Workflow reference not found: ${ref}`);
|
|
236
|
+
}
|
|
237
|
+
const markdown = readFileSync(path, "utf8");
|
|
238
|
+
const parsed = parseSkillDocProtocol(markdown);
|
|
239
|
+
return {
|
|
240
|
+
ref,
|
|
241
|
+
content: parsed.content,
|
|
242
|
+
...(parsed.meta?.workflowConfig ? { config: parsed.meta.workflowConfig } : {}),
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export function prependWorkflowReferencePrompt(message: string, workflow?: ResolvedWorkflowReference): string {
|
|
247
|
+
if (!workflow) return message;
|
|
248
|
+
const config = workflow.config;
|
|
249
|
+
return [
|
|
250
|
+
"AI-native workflow reference:",
|
|
251
|
+
"- This reference is guidance for the agent, not a central workflow engine.",
|
|
252
|
+
`- ref: ${workflow.ref}`,
|
|
253
|
+
...(config?.id ? [`- id: ${config.id}`] : []),
|
|
254
|
+
...(config?.name ? [`- name: ${config.name}`] : []),
|
|
255
|
+
...(config?.defaultAgent ? [`- suggested defaultAgent: ${config.defaultAgent}`] : []),
|
|
256
|
+
...(config?.inputs?.length ? [`- inputs: ${config.inputs.join(", ")}`] : []),
|
|
257
|
+
...(config?.recommendedTools?.length ? [`- recommendedTools: ${config.recommendedTools.join(", ")}`] : []),
|
|
258
|
+
...(config?.requiredTools?.length ? [`- requiredTools: ${config.requiredTools.join(", ")}`] : []),
|
|
259
|
+
...(config?.requiredOutputs?.length ? [`- requiredOutputs: ${config.requiredOutputs.join(", ")}`] : []),
|
|
260
|
+
...(config?.gates?.length ? [`- gates: ${config.gates.join(", ")}`] : []),
|
|
261
|
+
...(config?.contextStrategy ? [`- contextStrategy: ${config.contextStrategy}`] : []),
|
|
262
|
+
...(config?.failureProtocol ? [`- failureProtocol: ${config.failureProtocol}`] : []),
|
|
263
|
+
"",
|
|
264
|
+
"Reference body:",
|
|
265
|
+
workflow.content,
|
|
266
|
+
"",
|
|
267
|
+
"User task:",
|
|
268
|
+
message,
|
|
269
|
+
].join("\n");
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
function parseDialogReference(rawInput: string) {
|
|
273
|
+
const normalized = rawInput.trim();
|
|
274
|
+
if (normalized.startsWith("dialog-")) {
|
|
275
|
+
const parts = normalized.split("-");
|
|
276
|
+
return {
|
|
277
|
+
dialogKey: normalized,
|
|
278
|
+
dialogId: parts.at(-1) ?? normalized,
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
const dialogMatch = normalized.match(/dialog-([a-zA-Z0-9]+)-([a-zA-Z0-9]+)/);
|
|
282
|
+
if (dialogMatch) {
|
|
283
|
+
return {
|
|
284
|
+
dialogKey: `dialog-${dialogMatch[1]}-${dialogMatch[2]}`,
|
|
285
|
+
dialogId: dialogMatch[2],
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
return {
|
|
289
|
+
dialogId: normalized,
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
function mimeTypeForPath(path: string) {
|
|
294
|
+
switch (extname(path).toLowerCase()) {
|
|
295
|
+
case ".jpg":
|
|
296
|
+
case ".jpeg":
|
|
297
|
+
return "image/jpeg";
|
|
298
|
+
case ".webp":
|
|
299
|
+
return "image/webp";
|
|
300
|
+
case ".gif":
|
|
301
|
+
return "image/gif";
|
|
302
|
+
default:
|
|
303
|
+
return "image/png";
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
export function normalizeCliImageInput(input: string) {
|
|
308
|
+
if (/^(https?:|data:|file:)/i.test(input)) return input;
|
|
309
|
+
const absolutePath = resolve(input);
|
|
310
|
+
if (!existsSync(absolutePath)) return input;
|
|
311
|
+
const base64 = readFileSync(absolutePath).toString("base64");
|
|
312
|
+
return `data:${mimeTypeForPath(absolutePath)};base64,${base64}`;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
async function runGitForLocalSummary(args: {
|
|
316
|
+
cwd: string;
|
|
317
|
+
gitArgs: string[];
|
|
318
|
+
}) {
|
|
319
|
+
const proc = Bun.spawn(["git", ...args.gitArgs], {
|
|
320
|
+
cwd: args.cwd,
|
|
321
|
+
stdout: "pipe",
|
|
322
|
+
stderr: "pipe",
|
|
323
|
+
});
|
|
324
|
+
const [stdout, stderr, exitCode] = await Promise.all([
|
|
325
|
+
new Response(proc.stdout).text(),
|
|
326
|
+
new Response(proc.stderr).text(),
|
|
327
|
+
proc.exited,
|
|
328
|
+
]);
|
|
329
|
+
if (exitCode !== 0) {
|
|
330
|
+
throw new Error((stderr || stdout || `git ${args.gitArgs.join(" ")} failed`).trim());
|
|
331
|
+
}
|
|
332
|
+
return stdout.trim();
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
async function inspectLocalRunWorkspace(cwd: string): Promise<LocalRunWorkspaceInspection> {
|
|
336
|
+
const status = await runGitForLocalSummary({
|
|
337
|
+
cwd,
|
|
338
|
+
gitArgs: ["status", "--short"],
|
|
339
|
+
});
|
|
340
|
+
const rawCommit = await runGitForLocalSummary({
|
|
341
|
+
cwd,
|
|
342
|
+
gitArgs: ["log", "-1", "--format=%h%x00%s"],
|
|
343
|
+
}).catch(() => "");
|
|
344
|
+
const [hash, subject] = rawCommit.split("\0");
|
|
345
|
+
return {
|
|
346
|
+
cwd,
|
|
347
|
+
clean: status.trim() === "",
|
|
348
|
+
status,
|
|
349
|
+
...(hash ? { commit: { hash, subject: subject ?? "" } } : {}),
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
|
|
51
353
|
function shouldPrintLocalRunSummary(args: {
|
|
52
354
|
parsed: ParsedAgentRunArgs;
|
|
53
355
|
localRuntimeCwd?: string;
|
|
@@ -55,46 +357,51 @@ function shouldPrintLocalRunSummary(args: {
|
|
|
55
357
|
return Boolean(args.localRuntimeCwd && args.parsed.runtimeMode === "local");
|
|
56
358
|
}
|
|
57
359
|
|
|
58
|
-
function
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
360
|
+
function formatLocalRunSummary(args: {
|
|
361
|
+
dialogId?: string;
|
|
362
|
+
inspection: LocalRunWorkspaceInspection;
|
|
363
|
+
}) {
|
|
364
|
+
return [
|
|
365
|
+
"",
|
|
366
|
+
"[nolo] local run summary",
|
|
367
|
+
`workspace: ${args.inspection.cwd}`,
|
|
368
|
+
...(args.dialogId ? [`dialog: ${args.dialogId}`] : []),
|
|
369
|
+
...(args.inspection.commit
|
|
370
|
+
? [`commit: ${args.inspection.commit.hash} ${args.inspection.commit.subject}`]
|
|
371
|
+
: []),
|
|
372
|
+
`dirty: ${args.inspection.clean ? "clean" : "dirty"}`,
|
|
373
|
+
...(!args.inspection.clean && args.inspection.status.trim()
|
|
374
|
+
? [`status:\n${args.inspection.status.trim()}`]
|
|
375
|
+
: []),
|
|
376
|
+
"",
|
|
377
|
+
].join("\n");
|
|
63
378
|
}
|
|
64
379
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
env: EnvLike;
|
|
69
|
-
output: OutputLike;
|
|
70
|
-
parsed: ParsedAgentRunArgs;
|
|
71
|
-
}) {
|
|
72
|
-
const agentInput = readAgentRunInput(args.cliArgs);
|
|
73
|
-
if (!agentInput) return args.parsed;
|
|
380
|
+
function resolveServerUrl(env: EnvLike) {
|
|
381
|
+
return (env.NOLO_SERVER || env.BASE_URL || DEFAULT_NOLO_SERVER_URL).replace(/\/+$/, "");
|
|
382
|
+
}
|
|
74
383
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
384
|
+
function shouldPrepareTaskWorktree(parsed: ParsedAgentRunArgs) {
|
|
385
|
+
return !parsed.cwd && (parsed.useTaskWorktree || parsed.allowShell);
|
|
386
|
+
}
|
|
78
387
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
388
|
+
function buildTaskWorktreeEnv(args: {
|
|
389
|
+
env: EnvLike;
|
|
390
|
+
worktreePath?: string;
|
|
391
|
+
allowShell: boolean;
|
|
392
|
+
}) {
|
|
393
|
+
return {
|
|
394
|
+
...args.env,
|
|
395
|
+
...(args.allowShell ? { NOLO_LOCAL_SHELL_MODE: "worktree" } : {}),
|
|
396
|
+
...(args.worktreePath ? { NOLO_LOCAL_WORKTREE: args.worktreePath } : {}),
|
|
397
|
+
};
|
|
398
|
+
}
|
|
83
399
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
env: args.env,
|
|
90
|
-
db,
|
|
91
|
-
fetchImpl: args.deps.fetchImpl ?? fetch,
|
|
92
|
-
fallbackFetchImpl: args.deps.fallbackFetchImpl,
|
|
93
|
-
});
|
|
94
|
-
return resolved ? { ...args.parsed, agentKey: resolved.agentKey } : args.parsed;
|
|
95
|
-
} catch {
|
|
96
|
-
return args.parsed;
|
|
97
|
-
}
|
|
400
|
+
function writeUsage(output: OutputLike) {
|
|
401
|
+
output.write(
|
|
402
|
+
"Usage: nolo agent run <agent> <message> [--local|--server|--auto] [--continue <dialogId>] [--cwd <path>] [--max-tool-rounds <n>]\n" +
|
|
403
|
+
" nolo agent run --agent <agent> --msg <message> [--image <url-or-path>] [--space <spaceId>] [--category <name>] [--inherit-from-dialog <dialog>] [--task-row-dbkey <key>] [--bg] [--timeout-ms <n>] [--no-stream]\n"
|
|
404
|
+
);
|
|
98
405
|
}
|
|
99
406
|
|
|
100
407
|
export async function runAgentRunCommand(args: string[], deps: AgentRunCommandDeps) {
|
|
@@ -105,43 +412,67 @@ export async function runAgentRunCommand(args: string[], deps: AgentRunCommandDe
|
|
|
105
412
|
writeUsage(output);
|
|
106
413
|
return 1;
|
|
107
414
|
}
|
|
108
|
-
const resolvedParsed = await maybeResolveCurrentUserPlatformAgentKey({
|
|
109
|
-
cliArgs: args,
|
|
110
|
-
deps,
|
|
111
|
-
env,
|
|
112
|
-
output,
|
|
113
|
-
parsed,
|
|
114
|
-
});
|
|
115
415
|
|
|
116
416
|
const runner = deps.runner ?? runAgentTurn;
|
|
117
417
|
let workflowReference: ResolvedWorkflowReference | undefined;
|
|
118
|
-
if (
|
|
418
|
+
if (parsed.workflowRef) {
|
|
119
419
|
try {
|
|
120
420
|
workflowReference = await (deps.resolveWorkflowReference ?? resolveWorkflowReference)(
|
|
121
|
-
|
|
421
|
+
parsed.workflowRef
|
|
122
422
|
);
|
|
123
423
|
} catch (error) {
|
|
124
424
|
output.write(`[nolo] ${error instanceof Error ? error.message : String(error)}\n`);
|
|
125
425
|
return 1;
|
|
126
426
|
}
|
|
127
427
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
428
|
+
let localRuntimeCwd = parsed.cwd;
|
|
429
|
+
if (shouldPrepareTaskWorktree(parsed)) {
|
|
430
|
+
try {
|
|
431
|
+
const preparedWorktree = await (deps.prepareTaskWorktree ?? prepareTaskWorktree)({
|
|
432
|
+
agentKey: parsed.agentKey,
|
|
433
|
+
env,
|
|
434
|
+
});
|
|
435
|
+
localRuntimeCwd = preparedWorktree.path;
|
|
436
|
+
output.write(formatPreparedTaskWorktree(preparedWorktree));
|
|
437
|
+
} catch (error) {
|
|
438
|
+
output.write(
|
|
439
|
+
"[nolo] Could not prepare a local task worktree.\n" +
|
|
440
|
+
"Run from inside a git repository, or set NOLO_LOCAL_WORKTREE to an existing isolated checkout.\n" +
|
|
441
|
+
`Reason: ${error instanceof Error ? error.message : String(error)}\n`
|
|
442
|
+
);
|
|
443
|
+
return 1;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
const shouldBindLocalWorkspace =
|
|
447
|
+
!!localRuntimeCwd &&
|
|
448
|
+
(parsed.runtimeMode === "local" || parsed.allowShell || parsed.useTaskWorktree);
|
|
449
|
+
if (shouldBindLocalWorkspace) {
|
|
450
|
+
try {
|
|
451
|
+
await (deps.ensureWorkspacePackageLinks ?? ensureWorkspacePackageLinks)(
|
|
452
|
+
localRuntimeCwd!
|
|
453
|
+
);
|
|
454
|
+
} catch (error) {
|
|
455
|
+
output.write(
|
|
456
|
+
"[nolo] Dependency preflight failed for local task worktree.\n" +
|
|
457
|
+
"The worktree may have node_modules entries that point outside the task checkout, or paths that cannot be repaired safely.\n" +
|
|
458
|
+
`Reason: ${error instanceof Error ? error.message : String(error)}\n`
|
|
459
|
+
);
|
|
460
|
+
return 1;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
const runEnv = shouldBindLocalWorkspace
|
|
464
|
+
? buildTaskWorktreeEnv({
|
|
465
|
+
env,
|
|
466
|
+
worktreePath: localRuntimeCwd,
|
|
467
|
+
allowShell: parsed.allowShell,
|
|
468
|
+
})
|
|
469
|
+
: env;
|
|
139
470
|
const result: RunAgentTurnResult = await runner({
|
|
140
|
-
agentName:
|
|
141
|
-
agentKey:
|
|
142
|
-
serverUrl: resolveServerUrl(
|
|
143
|
-
message: prependWorkflowReferencePrompt(
|
|
144
|
-
imageUrls:
|
|
471
|
+
agentName: parsed.agentKey,
|
|
472
|
+
agentKey: parsed.agentKey,
|
|
473
|
+
serverUrl: resolveServerUrl(env),
|
|
474
|
+
message: prependWorkflowReferencePrompt(parsed.message, workflowReference),
|
|
475
|
+
imageUrls: parsed.imageUrls.map(normalizeCliImageInput),
|
|
145
476
|
scriptDir: deps.scriptDir,
|
|
146
477
|
env: runEnv,
|
|
147
478
|
output,
|
|
@@ -149,30 +480,30 @@ export async function runAgentRunCommand(args: string[], deps: AgentRunCommandDe
|
|
|
149
480
|
? { localRuntimeAdapterFactory: deps.localRuntimeAdapterFactory }
|
|
150
481
|
: {}),
|
|
151
482
|
...(localRuntimeCwd ? { localRuntimeCwd } : {}),
|
|
152
|
-
...(
|
|
153
|
-
...(
|
|
154
|
-
...(
|
|
155
|
-
...(
|
|
156
|
-
...(
|
|
157
|
-
...(
|
|
158
|
-
background:
|
|
159
|
-
noStream:
|
|
160
|
-
noDefaultTestRoot:
|
|
161
|
-
...(typeof
|
|
162
|
-
...(typeof
|
|
163
|
-
traceTools:
|
|
164
|
-
...(
|
|
483
|
+
...(parsed.runtimeMode ? { runtimeMode: parsed.runtimeMode } : {}),
|
|
484
|
+
...(parsed.continueDialogId ? { continueDialogId: parsed.continueDialogId } : {}),
|
|
485
|
+
...(parsed.spaceId ? { spaceId: parsed.spaceId } : {}),
|
|
486
|
+
...(parsed.category ? { category: parsed.category } : {}),
|
|
487
|
+
...(parsed.inheritedFromDialogKey ? { inheritedFromDialogKey: parsed.inheritedFromDialogKey } : {}),
|
|
488
|
+
...(parsed.parentDialogId ? { parentDialogId: parsed.parentDialogId } : {}),
|
|
489
|
+
background: parsed.background,
|
|
490
|
+
noStream: parsed.noStream,
|
|
491
|
+
noDefaultTestRoot: parsed.noDefaultTestRoot,
|
|
492
|
+
...(typeof parsed.maxToolRounds === "number" ? { maxToolRounds: parsed.maxToolRounds } : {}),
|
|
493
|
+
...(typeof parsed.timeoutMs === "number" ? { timeoutMs: parsed.timeoutMs } : {}),
|
|
494
|
+
traceTools: parsed.traceTools,
|
|
495
|
+
...(parsed.taskRunContext ? { taskRunContext: parsed.taskRunContext } : {}),
|
|
165
496
|
});
|
|
166
497
|
|
|
167
498
|
if (result.dialogId) {
|
|
168
|
-
if (
|
|
499
|
+
if (parsed.background) {
|
|
169
500
|
output.write(`\n[nolo] background dialog ${result.dialogId}\n`);
|
|
170
501
|
output.write(`[nolo] read: nolo dialog read ${result.dialogId}\n`);
|
|
171
502
|
} else {
|
|
172
503
|
output.write(`\n[nolo] dialog ${result.dialogId}\n`);
|
|
173
504
|
}
|
|
174
505
|
}
|
|
175
|
-
if (shouldPrintLocalRunSummary({ parsed
|
|
506
|
+
if (shouldPrintLocalRunSummary({ parsed, localRuntimeCwd })) {
|
|
176
507
|
try {
|
|
177
508
|
const inspect = deps.inspectLocalRunWorkspace ?? inspectLocalRunWorkspace;
|
|
178
509
|
const inspection = await inspect(localRuntimeCwd!);
|
package/agentRuntimeLocal.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
export {
|
|
2
|
-
createHostRuntimeConfig,
|
|
3
2
|
buildOpenAiCompatibleChatCompletionRequest,
|
|
4
3
|
buildPlatformChatCompletionRequest,
|
|
5
4
|
canUsePlatformChatProvider,
|
|
6
|
-
createHostRuntimeCapabilities,
|
|
7
5
|
hasDirectOpenAiCompatibleProvider,
|
|
8
6
|
createHybridRecordStore,
|
|
9
7
|
executeLocalToolWithPolicy,
|
|
@@ -18,12 +16,12 @@ export {
|
|
|
18
16
|
parsePlatformChatCompletionData,
|
|
19
17
|
parsePlatformChatCompletionResponse,
|
|
20
18
|
resolveAgentRuntimeConfigFromRecord,
|
|
21
|
-
resolveHostRuntimeConfigFromEnv,
|
|
22
|
-
resolveHostRuntimeCapabilitiesFromEnv,
|
|
23
19
|
resolvePlatformChatProviderConfig,
|
|
24
20
|
resolveLocalToolPolicy,
|
|
25
21
|
resolveOpenAiCompatibleProviderConfig,
|
|
26
22
|
resolveRequestedRuntimeToolNames,
|
|
23
|
+
evaluateShellCommandPolicy,
|
|
24
|
+
isDestructiveShellCommand,
|
|
27
25
|
shouldUsePlatformChatProvider,
|
|
28
26
|
shouldCacheHybridRemoteRecord,
|
|
29
27
|
shouldFetchAgentRuntimeRecordRemotely,
|
|
@@ -32,7 +30,6 @@ export { runLocalAgentTurn } from "./agent-runtime/localLoop";
|
|
|
32
30
|
export {
|
|
33
31
|
buildLocalWorkspaceOpenAiTools,
|
|
34
32
|
buildLocalWorkspacePolicyToolNames,
|
|
35
|
-
resolveLocalWorkspaceShellToolExposure,
|
|
36
33
|
buildLocalWorkspaceToolset,
|
|
37
34
|
createLocalWorkspaceToolExecutors,
|
|
38
35
|
} from "./agent-runtime/localWorkspaceTools";
|
|
@@ -41,10 +38,6 @@ export type {
|
|
|
41
38
|
AgentRuntimeHostAdapter,
|
|
42
39
|
AgentRuntimeRequestedMode,
|
|
43
40
|
AgentRuntimeSaveTurnInput,
|
|
44
|
-
HostRuntimeConfig,
|
|
45
|
-
HostRuntimeCapabilities,
|
|
46
|
-
HostRuntimeSurface,
|
|
47
|
-
HostRuntimeWorkspaceBinding,
|
|
48
41
|
HybridRecordKvDb,
|
|
49
42
|
HybridRecordStore,
|
|
50
43
|
LocalToolPolicyDecision,
|