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.
Files changed (234) hide show
  1. package/README.md +4 -10
  2. package/agent-runtime/agentRecordConfig.ts +10 -0
  3. package/agent-runtime/hostAdapter.ts +10 -1
  4. package/agent-runtime/index.ts +9 -20
  5. package/agent-runtime/localLoop.ts +49 -2
  6. package/agent-runtime/localToolPolicy.ts +76 -34
  7. package/agent-runtime/localWorkspaceTools.ts +30 -333
  8. package/agent-runtime/openAiCompatibleProvider.ts +7 -3
  9. package/agent-runtime/openAiCompatibleProviderConfig.ts +15 -26
  10. package/agent-runtime/platformChatProvider.ts +47 -73
  11. package/agent-runtime/providerResolution.ts +244 -0
  12. package/agent-runtime/runtimeToolPolicy.ts +77 -29
  13. package/agent-runtime/shellCommandPolicy.ts +120 -0
  14. package/agentAliases.ts +14 -83
  15. package/agentCommandSupport.ts +3 -6
  16. package/agentInternalCommandEntries.ts +4 -13
  17. package/agentListCommands.ts +18 -27
  18. package/agentMachineCommands.ts +40 -336
  19. package/agentPullCommand.ts +30 -55
  20. package/agentRecordCommands.ts +84 -1
  21. package/agentRecordHelpers.ts +102 -186
  22. package/agentRunCommand.ts +438 -107
  23. package/agentRuntimeLocal.ts +2 -9
  24. package/ai/agent/cliExecutor.ts +19 -323
  25. package/ai/tools/toolNameAliases.ts +70 -0
  26. package/authCommands.ts +2 -36
  27. package/cli/agentAliases.ts +14 -83
  28. package/cli/agentCommandSupport.ts +3 -6
  29. package/cli/agentInternalCommandEntries.ts +4 -13
  30. package/cli/agentListCommands.ts +18 -27
  31. package/cli/agentMachineCommands.ts +40 -336
  32. package/cli/agentPullCommand.ts +30 -55
  33. package/cli/agentRecordCommands.ts +84 -1
  34. package/cli/agentRecordHelpers.ts +102 -186
  35. package/cli/agentRunCommand.ts +438 -107
  36. package/cli/agentRuntimeLocal.ts +2 -9
  37. package/cli/authCommands.ts +2 -36
  38. package/cli/cliCommandDispatch.ts +2 -2
  39. package/cli/cliEnvHelpers.ts +34 -107
  40. package/cli/client/agentRun.ts +854 -57
  41. package/cli/client/localRuntimeAdapter.ts +59 -159
  42. package/cli/client/streamingOutput.ts +3 -1
  43. package/cli/client/taskRunPrompt.ts +24 -7
  44. package/cli/commandRegistry.ts +4 -5
  45. package/cli/connectorRunArtifact.ts +10 -34
  46. package/cli/connectorWebSocketTarget.ts +6 -10
  47. package/cli/internalCommandEntries.ts +0 -8
  48. package/cli/localRuntimeDb.ts +2 -39
  49. package/cli/machineCommands.ts +189 -190
  50. package/cli/machineDaemonCommands.ts +165 -9
  51. package/cli/machineHeartbeatCommands.ts +2 -1
  52. package/cli/machineStatusCommands.ts +13 -5
  53. package/cli/machineWatchCommands.ts +1 -1
  54. package/cli/machineWsRunDispatch.ts +30 -44
  55. package/cli/machineWsSession.ts +0 -2
  56. package/cli/offlineMarxistsAgentCommand.ts +314 -0
  57. package/cli/runtimeDoctorCommands.ts +72 -15
  58. package/cli/scriptCommandEntries.ts +45 -5
  59. package/cli/tableCommands.ts +133 -33
  60. package/cli/taskRunCommand.ts +211 -16
  61. package/cli/tui/session.ts +372 -43
  62. package/cli/workflowInternalCommandEntries.ts +0 -20
  63. package/cliCommandDispatch.ts +2 -2
  64. package/cliEnvHelpers.ts +34 -107
  65. package/client/agentConfigResolver.test.ts +2 -0
  66. package/client/agentRun.test.ts +12 -208
  67. package/client/agentRun.ts +854 -57
  68. package/client/localProviderResolver.test.ts +26 -2
  69. package/client/localRuntimeAdapter.test.ts +296 -171
  70. package/client/localRuntimeAdapter.ts +59 -159
  71. package/client/localToolPolicy.test.ts +4 -28
  72. package/client/streamingOutput.ts +3 -1
  73. package/client/taskRunPrompt.ts +24 -7
  74. package/commandRegistry.ts +4 -5
  75. package/connectorRunArtifact.ts +10 -34
  76. package/connectorWebSocketTarget.ts +6 -10
  77. package/database/server/serverStoreFactory.ts +2 -8
  78. package/internalCommandEntries.ts +0 -8
  79. package/localRuntimeDb.ts +2 -39
  80. package/machineCommands.ts +189 -190
  81. package/machineDaemonCommands.ts +165 -9
  82. package/machineHeartbeatCommands.ts +2 -1
  83. package/machineStatusCommands.ts +13 -5
  84. package/machineWatchCommands.ts +1 -1
  85. package/machineWsRunDispatch.ts +30 -44
  86. package/machineWsSession.ts +0 -2
  87. package/offlineMarxistsAgentCommand.ts +314 -0
  88. package/package.json +52 -188
  89. package/runtimeDoctorCommands.ts +72 -15
  90. package/scriptCommandEntries.ts +45 -5
  91. package/tableCommands.ts +133 -33
  92. package/taskRunCommand.ts +211 -16
  93. package/tui/session.ts +372 -43
  94. package/workflowInternalCommandEntries.ts +0 -20
  95. package/agent-runtime/dialogStatus.ts +0 -139
  96. package/agent-runtime/hostRuntimeConfig.ts +0 -86
  97. package/agentCreateCustomCommands.ts +0 -278
  98. package/agentDialogsCommands.ts +0 -227
  99. package/agentDoctorCommands.ts +0 -203
  100. package/agentRunLocalWorkspace.ts +0 -182
  101. package/agentRunParsing.ts +0 -298
  102. package/agentSuperviseCommands.ts +0 -8
  103. package/agentUnpublishCommands.ts +0 -113
  104. package/ai/agent/agentRunDialogLineage.ts +0 -56
  105. package/ai/policy/types.ts +0 -64
  106. package/ai/skills/skillSummaryMarker.ts +0 -26
  107. package/app/types.ts +0 -358
  108. package/build.ts +0 -16
  109. package/buildPublish.ts +0 -138
  110. package/buildPublishArtifactAssembly.ts +0 -724
  111. package/buildPublishImportAnalysis.ts +0 -242
  112. package/chat/messages/fetchMessages.ts +0 -84
  113. package/chat/messages/types.ts +0 -185
  114. package/cli/agentCreateCustomCommands.ts +0 -278
  115. package/cli/agentDialogsCommands.ts +0 -227
  116. package/cli/agentDoctorCommands.ts +0 -203
  117. package/cli/agentRunLocalWorkspace.ts +0 -182
  118. package/cli/agentRunParsing.ts +0 -298
  119. package/cli/agentSuperviseCommands.ts +0 -8
  120. package/cli/agentUnpublishCommands.ts +0 -113
  121. package/cli/buildPublish.ts +0 -138
  122. package/cli/buildPublishArtifactAssembly.ts +0 -724
  123. package/cli/buildPublishImportAnalysis.ts +0 -242
  124. package/cli/cliIoTypes.ts +0 -3
  125. package/cli/cliRuntimeDoctorReport.ts +0 -193
  126. package/cli/client/agentRunInput.ts +0 -10
  127. package/cli/client/agentRunLocalExecution.ts +0 -124
  128. package/cli/client/agentRunLocalExecutor.ts +0 -179
  129. package/cli/client/agentRunRuntimeSelection.ts +0 -145
  130. package/cli/client/agentRunServerTransport.ts +0 -397
  131. package/cli/client/agentRunTaskRunRecorder.ts +0 -176
  132. package/cli/customCodingAgentFlow.ts +0 -208
  133. package/cli/customCodingAgentRecord.ts +0 -179
  134. package/cli/dialogDataAccess.ts +0 -186
  135. package/cli/dialogInternalCommandEntries.ts +0 -11
  136. package/cli/dialogReadCommands.ts +0 -180
  137. package/cli/dialogReadHelpers.ts +0 -226
  138. package/cli/dialogStatusCommands.ts +0 -123
  139. package/cli/docInternalCommandEntries.ts +0 -20
  140. package/cli/hybridReadHelpers.ts +0 -109
  141. package/cli/machineCommandPrompts.ts +0 -79
  142. package/cli/machineCommandResolution.ts +0 -43
  143. package/cli/noloReadBridgePrompt.ts +0 -16
  144. package/cli/pageCreateCommands.ts +0 -219
  145. package/cli/pageDeleteCommands.ts +0 -167
  146. package/cli/pageReadCommands.ts +0 -151
  147. package/cli/pageUpdateCommands.ts +0 -249
  148. package/cli/pageWriteHelpers.ts +0 -209
  149. package/cli/publishPackage.ts +0 -36
  150. package/cli/runtimeInternalCommandEntries.ts +0 -15
  151. package/cli/runtimePassthroughCommands.ts +0 -22
  152. package/cli/scriptPassthroughHelpers.ts +0 -28
  153. package/cli/secretScanHelpers.ts +0 -31
  154. package/cli/spaceAttachCommands.ts +0 -134
  155. package/cli/spaceCategoryCommands.ts +0 -263
  156. package/cli/spaceCommands.ts +0 -295
  157. package/cli/spaceDeleteCommands.ts +0 -312
  158. package/cli/spaceInternalCommandEntries.ts +0 -21
  159. package/cli/spaceMutationHelpers.ts +0 -135
  160. package/cli/spaceReadCommands.ts +0 -323
  161. package/cli/tableDataOutput.ts +0 -41
  162. package/cli/tableDataSafety.ts +0 -26
  163. package/cli/tableMetaCommands.ts +0 -307
  164. package/cli/tableMutationCommands.ts +0 -266
  165. package/cli/tableQueryParsing.ts +0 -90
  166. package/cli/tableQueryRequest.ts +0 -53
  167. package/cli/taskRunActions.ts +0 -122
  168. package/cli/taskRunParsing.ts +0 -86
  169. package/cli/taskRunPromptShared.ts +0 -55
  170. package/cli/tui/tuiCatalog.ts +0 -22
  171. package/cli/tui/tuiCommandInterpreter.ts +0 -253
  172. package/cli/tui/tuiPresentation.ts +0 -146
  173. package/cliIoTypes.ts +0 -3
  174. package/cliRuntimeDoctorReport.ts +0 -193
  175. package/client/agentRunInput.ts +0 -10
  176. package/client/agentRunLocalExecution.test.ts +0 -123
  177. package/client/agentRunLocalExecution.ts +0 -124
  178. package/client/agentRunLocalExecutor.ts +0 -179
  179. package/client/agentRunRuntimeSelection.test.ts +0 -159
  180. package/client/agentRunRuntimeSelection.ts +0 -145
  181. package/client/agentRunServerTransport.ts +0 -397
  182. package/client/agentRunTaskRunRecorder.ts +0 -176
  183. package/connector-experimental/daemonLauncher.ts +0 -223
  184. package/create/space/spaceKeys.ts +0 -65
  185. package/create/types.ts +0 -21
  186. package/customCodingAgentFlow.ts +0 -208
  187. package/customCodingAgentRecord.ts +0 -179
  188. package/database/keys.ts +0 -765
  189. package/database/tombstones.ts +0 -52
  190. package/database/utils/ulid.ts +0 -1
  191. package/dialogDataAccess.ts +0 -186
  192. package/dialogInternalCommandEntries.ts +0 -11
  193. package/dialogReadCommands.ts +0 -180
  194. package/dialogReadHelpers.ts +0 -226
  195. package/dialogStatusCommands.ts +0 -123
  196. package/docInternalCommandEntries.ts +0 -20
  197. package/hybridReadHelpers.ts +0 -109
  198. package/machineCommandPrompts.ts +0 -79
  199. package/machineCommandResolution.ts +0 -43
  200. package/noloReadBridgePrompt.ts +0 -16
  201. package/pageCreateCommands.ts +0 -219
  202. package/pageDeleteCommands.ts +0 -167
  203. package/pageReadCommands.ts +0 -151
  204. package/pageUpdateCommands.ts +0 -249
  205. package/pageWriteHelpers.ts +0 -209
  206. package/publishPackage.ts +0 -36
  207. package/runtimeInternalCommandEntries.ts +0 -15
  208. package/runtimePassthroughCommands.ts +0 -22
  209. package/scriptPassthroughHelpers.ts +0 -28
  210. package/secretScanHelpers.ts +0 -31
  211. package/share/helpers.ts +0 -302
  212. package/share/keys.ts +0 -243
  213. package/share/types.ts +0 -100
  214. package/spaceAttachCommands.ts +0 -134
  215. package/spaceCategoryCommands.ts +0 -263
  216. package/spaceCommands.ts +0 -295
  217. package/spaceDeleteCommands.ts +0 -312
  218. package/spaceInternalCommandEntries.ts +0 -21
  219. package/spaceMutationHelpers.ts +0 -135
  220. package/spaceReadCommands.ts +0 -323
  221. package/tableDataOutput.ts +0 -41
  222. package/tableDataSafety.ts +0 -26
  223. package/tableMetaCommands.ts +0 -307
  224. package/tableMutationCommands.ts +0 -266
  225. package/tableQueryParsing.ts +0 -90
  226. package/tableQueryRequest.ts +0 -53
  227. package/taskRunActions.ts +0 -122
  228. package/taskRunParsing.ts +0 -86
  229. package/taskRunPromptShared.ts +0 -55
  230. package/tui/tuiCatalog.ts +0 -22
  231. package/tui/tuiCommandInterpreter.test.ts +0 -169
  232. package/tui/tuiCommandInterpreter.ts +0 -253
  233. package/tui/tuiPresentation.test.ts +0 -154
  234. 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 resolveAgentKeyAlias(raw) ?? parseAgentKeyFromInput(raw);
62
+ return AGENT_ALIAS_TO_KEY[raw.trim().toLowerCase()] ?? parseAgentKeyFromInput(raw);
130
63
  }
131
-
132
- export const resolveAgentKeyInput = resolveCliAgentKeyInput;
@@ -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
- import type { OutputLike } from "./cliIoTypes";
5
- import type { MachineWsRunDispatchDeps } from "./machineWsRunDispatch";
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", "dialogs"], "Inspect recent dialogs for an agent", runAgentDialogsCommand),
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
- createArgsCommand(["agent", "supervise"], "Run an agent in autonomous cycles", runAgentSuperviseCommand),
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),
@@ -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
- const loadRemoteAgents = async () => {
48
- const remote = await readFromServerCandidates({
49
- serverCandidates,
50
- readRemote: (candidateUrl) =>
51
- listRemoteAgents({
52
- authToken,
53
- fallbackFetchImpl,
54
- fetchImpl,
55
- includeLegacy,
56
- serverUrl: candidateUrl,
57
- userId,
58
- queryUserRecords,
59
- readDbRecord,
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
- return remote.value;
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-"));