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/agentAliases.ts
CHANGED
|
@@ -10,17 +10,13 @@ export const NOLO_PROJECT_MANAGER_AGENT_KEY =
|
|
|
10
10
|
export const NOLO_FULLSTACK_AGENT_ID = "01NOLOFULLSTK00000001J740Q";
|
|
11
11
|
export const NOLO_FULLSTACK_AGENT_KEY =
|
|
12
12
|
`agent-${PLATFORM_DEMO_USER_ID}-${NOLO_FULLSTACK_AGENT_ID}`;
|
|
13
|
+
export const NOLO_SENIOR_FULLSTACK_AGENT_ID = "01NOLOFULLSTK00000000T3XR4";
|
|
14
|
+
export const NOLO_SENIOR_FULLSTACK_AGENT_KEY =
|
|
15
|
+
`agent-${PLATFORM_DEMO_USER_ID}-${NOLO_SENIOR_FULLSTACK_AGENT_ID}`;
|
|
13
16
|
export const NOLO_REVIEW_AGENT_ID = "01CODEXCLIMAIN00000001OK";
|
|
14
17
|
export const NOLO_REVIEW_AGENT_KEY =
|
|
15
18
|
`agent-${PLATFORM_DEMO_USER_ID}-${NOLO_REVIEW_AGENT_ID}`;
|
|
16
19
|
|
|
17
|
-
type PlatformAgentAliasSpec = {
|
|
18
|
-
agentId: string;
|
|
19
|
-
canonicalKey: string;
|
|
20
|
-
aliases: string[];
|
|
21
|
-
preferCurrentUserCopy?: boolean;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
20
|
const AGENT_ALIAS_TO_KEY: Record<string, string> = {
|
|
25
21
|
"nolo-frontend": FRONTEND_IMPLEMENTER_AGENT_KEY,
|
|
26
22
|
"frontend-implementer": FRONTEND_IMPLEMENTER_AGENT_KEY,
|
|
@@ -29,11 +25,21 @@ const AGENT_ALIAS_TO_KEY: Record<string, string> = {
|
|
|
29
25
|
"front-end": FRONTEND_IMPLEMENTER_AGENT_KEY,
|
|
30
26
|
"前端": FRONTEND_IMPLEMENTER_AGENT_KEY,
|
|
31
27
|
"前端实现员": FRONTEND_IMPLEMENTER_AGENT_KEY,
|
|
28
|
+
"nolo-project-manager": NOLO_PROJECT_MANAGER_AGENT_KEY,
|
|
29
|
+
"project-manager": NOLO_PROJECT_MANAGER_AGENT_KEY,
|
|
30
|
+
"nolo-pm": NOLO_PROJECT_MANAGER_AGENT_KEY,
|
|
31
|
+
pm: NOLO_PROJECT_MANAGER_AGENT_KEY,
|
|
32
|
+
"项目经理": NOLO_PROJECT_MANAGER_AGENT_KEY,
|
|
33
|
+
"nolo 项目经理": NOLO_PROJECT_MANAGER_AGENT_KEY,
|
|
32
34
|
"nolo-fullstack": NOLO_FULLSTACK_AGENT_KEY,
|
|
33
35
|
fullstack: NOLO_FULLSTACK_AGENT_KEY,
|
|
34
36
|
"full-stack": NOLO_FULLSTACK_AGENT_KEY,
|
|
35
37
|
"全栈": NOLO_FULLSTACK_AGENT_KEY,
|
|
36
38
|
"nolo 全栈工程师": NOLO_FULLSTACK_AGENT_KEY,
|
|
39
|
+
"senior-fullstack": NOLO_SENIOR_FULLSTACK_AGENT_KEY,
|
|
40
|
+
"nolo-senior-fullstack": NOLO_SENIOR_FULLSTACK_AGENT_KEY,
|
|
41
|
+
"高级全栈": NOLO_SENIOR_FULLSTACK_AGENT_KEY,
|
|
42
|
+
"nolo 高级全栈工程师": NOLO_SENIOR_FULLSTACK_AGENT_KEY,
|
|
37
43
|
"nolo-reviewer": NOLO_REVIEW_AGENT_KEY,
|
|
38
44
|
reviewer: NOLO_REVIEW_AGENT_KEY,
|
|
39
45
|
"nolo-code-review": NOLO_REVIEW_AGENT_KEY,
|
|
@@ -43,45 +49,6 @@ const AGENT_ALIAS_TO_KEY: Record<string, string> = {
|
|
|
43
49
|
"nolo 代码审查": NOLO_REVIEW_AGENT_KEY,
|
|
44
50
|
};
|
|
45
51
|
|
|
46
|
-
const PLATFORM_AGENT_ALIAS_SPECS: PlatformAgentAliasSpec[] = [
|
|
47
|
-
{
|
|
48
|
-
agentId: FRONTEND_IMPLEMENTER_AGENT_ID,
|
|
49
|
-
canonicalKey: FRONTEND_IMPLEMENTER_AGENT_KEY,
|
|
50
|
-
aliases: [
|
|
51
|
-
"nolo-frontend",
|
|
52
|
-
"frontend-implementer",
|
|
53
|
-
"frontend-agent",
|
|
54
|
-
"frontend",
|
|
55
|
-
"front-end",
|
|
56
|
-
"前端",
|
|
57
|
-
"前端实现员",
|
|
58
|
-
],
|
|
59
|
-
preferCurrentUserCopy: true,
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
agentId: NOLO_FULLSTACK_AGENT_ID,
|
|
63
|
-
canonicalKey: NOLO_FULLSTACK_AGENT_KEY,
|
|
64
|
-
aliases: ["nolo-fullstack", "fullstack", "full-stack", "全栈", "nolo 全栈工程师"],
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
agentId: NOLO_REVIEW_AGENT_ID,
|
|
68
|
-
canonicalKey: NOLO_REVIEW_AGENT_KEY,
|
|
69
|
-
aliases: [
|
|
70
|
-
"nolo-reviewer",
|
|
71
|
-
"reviewer",
|
|
72
|
-
"nolo-code-review",
|
|
73
|
-
"code-review",
|
|
74
|
-
"review",
|
|
75
|
-
"代码审查",
|
|
76
|
-
"nolo 代码审查",
|
|
77
|
-
],
|
|
78
|
-
},
|
|
79
|
-
];
|
|
80
|
-
|
|
81
|
-
function normalizeAlias(raw: string) {
|
|
82
|
-
return raw.trim().toLowerCase();
|
|
83
|
-
}
|
|
84
|
-
|
|
85
52
|
function parseAgentKeyFromInput(raw: string): string {
|
|
86
53
|
const trimmed = raw.trim();
|
|
87
54
|
if (trimmed.startsWith("http://") || trimmed.startsWith("https://")) {
|
|
@@ -91,42 +58,6 @@ function parseAgentKeyFromInput(raw: string): string {
|
|
|
91
58
|
return trimmed;
|
|
92
59
|
}
|
|
93
60
|
|
|
94
|
-
export function resolveAgentKeyAlias(raw: string): string | undefined {
|
|
95
|
-
return AGENT_ALIAS_TO_KEY[normalizeAlias(raw)];
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export function buildPrivateAgentKey(userId: string, agentId: string) {
|
|
99
|
-
return `agent-${userId}-${agentId}`;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export function resolvePlatformAgentAliasSpec(raw: string): PlatformAgentAliasSpec | undefined {
|
|
103
|
-
const normalized = normalizeAlias(raw);
|
|
104
|
-
return PLATFORM_AGENT_ALIAS_SPECS.find((spec) => spec.aliases.includes(normalized));
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export function buildCurrentUserPlatformAgentCandidateKeys(raw: string, userId?: string) {
|
|
108
|
-
const spec = resolvePlatformAgentAliasSpec(raw);
|
|
109
|
-
if (!spec) return [];
|
|
110
|
-
|
|
111
|
-
const keys: string[] = [];
|
|
112
|
-
const normalizedUserId = userId?.trim();
|
|
113
|
-
if (spec.preferCurrentUserCopy && normalizedUserId) {
|
|
114
|
-
keys.push(buildPrivateAgentKey(normalizedUserId, spec.agentId));
|
|
115
|
-
}
|
|
116
|
-
keys.push(spec.canonicalKey);
|
|
117
|
-
return Array.from(new Set(keys));
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export function isKnownPlatformAgentKey(raw?: string) {
|
|
121
|
-
const trimmed = raw?.trim();
|
|
122
|
-
if (!trimmed) return false;
|
|
123
|
-
return PLATFORM_AGENT_ALIAS_SPECS.some(
|
|
124
|
-
(spec) => trimmed === spec.agentId || trimmed.endsWith(`-${spec.agentId}`)
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
61
|
export function resolveCliAgentKeyInput(raw: string): string {
|
|
129
|
-
return
|
|
62
|
+
return AGENT_ALIAS_TO_KEY[raw.trim().toLowerCase()] ?? parseAgentKeyFromInput(raw);
|
|
130
63
|
}
|
|
131
|
-
|
|
132
|
-
export const resolveAgentKeyInput = resolveCliAgentKeyInput;
|
package/agentCommandSupport.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { MachineHeartbeat } from "./connector-experimental/protocol";
|
|
2
2
|
import type { CliKvDb } from "./client/hybridRecordStore";
|
|
3
3
|
import type { EnvLike } from "./cliEnvHelpers";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export type { OutputLike } from "./cliIoTypes";
|
|
4
|
+
|
|
5
|
+
export type OutputLike = { write(chunk: string): unknown };
|
|
7
6
|
|
|
8
7
|
export type SmokeWebSocketOptions = {
|
|
9
8
|
headers: Record<string, string>;
|
|
@@ -41,10 +40,8 @@ export type AgentCommandDeps = {
|
|
|
41
40
|
pushMessage: (response: string) => void,
|
|
42
41
|
executeCli: LocalCliExecutor,
|
|
43
42
|
env: EnvLike,
|
|
44
|
-
fetchImpl: typeof fetch
|
|
45
|
-
dispatchDeps?: MachineWsRunDispatchDeps,
|
|
43
|
+
fetchImpl: typeof fetch
|
|
46
44
|
) => Promise<void>;
|
|
47
|
-
connectorRunDispatchDeps?: MachineWsRunDispatchDeps;
|
|
48
45
|
localRuntimeProbe?: (env: EnvLike) => Promise<LocalRuntimeProbeResult>;
|
|
49
46
|
};
|
|
50
47
|
|
|
@@ -1,43 +1,34 @@
|
|
|
1
1
|
import { runAgentListCommand } from "./agentListCommands";
|
|
2
|
-
import { runAgentCreateCustomCommand } from "./agentCreateCustomCommands";
|
|
3
|
-
import { runAgentDialogsCommand } from "./agentDialogsCommands";
|
|
4
|
-
import { runAgentDoctorCommand } from "./agentDoctorCommands";
|
|
5
|
-
import { runAgentUnpublishCommand } from "./agentUnpublishCommands";
|
|
6
|
-
import { runAgentSuperviseCommand } from "./agentSuperviseCommands";
|
|
7
2
|
import {
|
|
8
3
|
runAgentBindCurrentCommand,
|
|
9
4
|
runAgentRuntimeDoctorCommand,
|
|
10
|
-
runAgentSmokeBoundCommand,
|
|
11
5
|
runAgentSmokeCurrentCommand,
|
|
12
6
|
} from "./agentMachineCommands";
|
|
13
7
|
import { runAgentPullCommand } from "./agentPullCommand";
|
|
14
8
|
import {
|
|
15
9
|
runAgentReadCommand,
|
|
16
10
|
runAgentUpdateCommand,
|
|
11
|
+
runAgentCreateCommand,
|
|
17
12
|
} from "./agentRecordCommands";
|
|
18
13
|
import { runAgentRunCommand } from "./agentRunCommand";
|
|
19
14
|
import {
|
|
20
|
-
createArgsCommand,
|
|
21
15
|
createEnvCommand,
|
|
22
16
|
createEnvScriptDirCommand,
|
|
23
17
|
} from "./cliCommandFactories";
|
|
24
18
|
import type { CommandEntry } from "./cliCommandTypes";
|
|
19
|
+
import { runSetupOfflineMarxistsAgentCommand } from "./offlineMarxistsAgentCommand";
|
|
25
20
|
|
|
26
21
|
export function getAgentInternalCommandEntries(): CommandEntry[] {
|
|
27
22
|
return [
|
|
28
23
|
createEnvScriptDirCommand(["chat"], "Chat with an agent", runAgentRunCommand),
|
|
29
|
-
createEnvCommand(["agent", "create-custom"], "Create a custom coding agent", runAgentCreateCustomCommand),
|
|
30
24
|
createEnvCommand(["agent", "list"], "List owned agents", runAgentListCommand),
|
|
31
|
-
createEnvCommand(["agent", "
|
|
32
|
-
createEnvCommand(["agent", "doctor"], "Audit agent workspace health", runAgentDoctorCommand),
|
|
33
|
-
createEnvCommand(["agent", "unpublish"], "Remove an agent's public record", runAgentUnpublishCommand),
|
|
25
|
+
createEnvCommand(["agent", "create"], "Create a new agent", runAgentCreateCommand),
|
|
34
26
|
createEnvCommand(["agent", "pull"], "Cache an agent for local runs", runAgentPullCommand),
|
|
35
27
|
createEnvCommand(["agent", "read"], "Read a single agent", runAgentReadCommand),
|
|
36
28
|
createEnvScriptDirCommand(["agent", "run"], "Run an agent", runAgentRunCommand),
|
|
37
|
-
|
|
29
|
+
createEnvCommand(["agent", "setup-offline-marxists"], "Create or update the Marxists.org offline book agent", runSetupOfflineMarxistsAgentCommand),
|
|
38
30
|
createEnvCommand(["agent", "update"], "Update agent fields", runAgentUpdateCommand),
|
|
39
31
|
createEnvCommand(["agent", "bind-current"], "Bind an agent to this machine", runAgentBindCurrentCommand),
|
|
40
|
-
createEnvCommand(["agent", "smoke-bound"], "Smoke test an agent through its existing runtime binding", runAgentSmokeBoundCommand),
|
|
41
32
|
createEnvCommand(["agent", "smoke-current"], "Smoke test a bound agent through this machine", runAgentSmokeCurrentCommand),
|
|
42
33
|
createEnvCommand(["agent", "runtime-doctor"], "Diagnose current machine runtime compatibility", runAgentRuntimeDoctorCommand),
|
|
43
34
|
createEnvScriptDirCommand(["agent", "chat"], "Chat with an agent", runAgentRunCommand),
|
package/agentListCommands.ts
CHANGED
|
@@ -12,10 +12,8 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
parseUserIdFromAuthToken,
|
|
14
14
|
resolveAuthToken,
|
|
15
|
-
resolveServerCandidates,
|
|
16
15
|
resolveServerUrl,
|
|
17
16
|
} from "./cliEnvHelpers";
|
|
18
|
-
import { readFromServerCandidates, readThroughList } from "./hybridReadHelpers";
|
|
19
17
|
|
|
20
18
|
export async function runAgentListCommand(
|
|
21
19
|
args: string[],
|
|
@@ -40,34 +38,27 @@ export async function runAgentListCommand(
|
|
|
40
38
|
const db = deps.db ?? await getReadableCliDb(output);
|
|
41
39
|
const fetchImpl = deps.fetchImpl ?? fetch;
|
|
42
40
|
const fallbackFetchImpl = deps.fallbackFetchImpl;
|
|
43
|
-
const serverUrl = resolveServerUrl(args, env);
|
|
44
|
-
const serverCandidates = resolveServerCandidates(args, env, serverUrl);
|
|
45
41
|
|
|
46
42
|
try {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
43
|
+
let agents: ListedAgent[];
|
|
44
|
+
let source: "local-cache" | "remote-cache";
|
|
45
|
+
try {
|
|
46
|
+
agents = await listLocalCachedAgents({ db, userId });
|
|
47
|
+
source = "local-cache";
|
|
48
|
+
} catch {
|
|
49
|
+
const serverUrl = resolveServerUrl(args, env);
|
|
50
|
+
agents = await listRemoteAgents({
|
|
51
|
+
authToken,
|
|
52
|
+
fallbackFetchImpl,
|
|
53
|
+
fetchImpl,
|
|
54
|
+
includeLegacy,
|
|
55
|
+
serverUrl,
|
|
56
|
+
userId,
|
|
57
|
+
queryUserRecords,
|
|
58
|
+
readDbRecord,
|
|
61
59
|
});
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const result = await readThroughList({
|
|
66
|
-
readLocal: () => listLocalCachedAgents({ db, userId }),
|
|
67
|
-
readRemote: loadRemoteAgents,
|
|
68
|
-
});
|
|
69
|
-
let agents = result.items;
|
|
70
|
-
const source = result.source;
|
|
60
|
+
source = "remote-cache";
|
|
61
|
+
}
|
|
71
62
|
|
|
72
63
|
if (!includeLegacy) {
|
|
73
64
|
agents = agents.filter((agent) => !agent.privateKey.startsWith("cybot-"));
|