nolo-cli 0.1.19 → 0.1.20

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 (111) hide show
  1. package/README.md +9 -1
  2. package/agent-runtime/agentConfigOptions.ts +12 -0
  3. package/agent-runtime/agentRecordConfig.ts +99 -0
  4. package/agent-runtime/agentRecordKeys.ts +14 -0
  5. package/agent-runtime/dialogMessageRecord.ts +16 -0
  6. package/agent-runtime/dialogWritePlan.ts +130 -0
  7. package/agent-runtime/hostAdapter.ts +13 -0
  8. package/agent-runtime/hybridRecordStore.ts +147 -0
  9. package/agent-runtime/index.ts +69 -0
  10. package/agent-runtime/localLoop.ts +69 -5
  11. package/agent-runtime/localToolPolicy.ts +130 -0
  12. package/agent-runtime/localWorkspaceTools.ts +1532 -0
  13. package/agent-runtime/openAiCompatibleProvider.ts +70 -0
  14. package/agent-runtime/openAiCompatibleProviderConfig.ts +38 -0
  15. package/agent-runtime/platformChatProvider.ts +241 -0
  16. package/agent-runtime/taskWorkspace.ts +193 -0
  17. package/agent-runtime/types.ts +1 -0
  18. package/agent-runtime/workspaceSession.ts +76 -0
  19. package/agentAliases.ts +37 -0
  20. package/agentPullCommand.ts +1 -1
  21. package/agentRunCommand.ts +278 -52
  22. package/agentRuntimeCommands.ts +354 -164
  23. package/agentRuntimeLocal.ts +38 -0
  24. package/ai/agent/agentSlice.ts +10 -0
  25. package/ai/agent/buildEditingContext.ts +5 -0
  26. package/ai/agent/buildSystemPrompt.ts +41 -18
  27. package/ai/agent/canvasEditingContext.ts +49 -0
  28. package/ai/agent/cliExecutor.ts +15 -4
  29. package/ai/agent/createAgentSchema.ts +2 -0
  30. package/ai/agent/executeToolCall.ts +3 -2
  31. package/ai/agent/hooks/usePublicAgents.ts +6 -0
  32. package/ai/agent/pageBuilderHandoffRules.ts +75 -0
  33. package/ai/agent/runAgentClientLoop.ts +4 -1
  34. package/ai/agent/runtimeGuidance.ts +19 -0
  35. package/ai/agent/server/fetchPublicAgents.ts +51 -1
  36. package/ai/agent/streamAgentChatTurn.ts +20 -2
  37. package/ai/agent/streamAgentChatTurnUtils.ts +60 -16
  38. package/ai/chat/accumulateToolCallChunks.ts +40 -9
  39. package/ai/chat/parseApiError.ts +3 -0
  40. package/ai/chat/sendOpenAICompletionsRequest.native.ts +23 -10
  41. package/ai/chat/sendOpenAICompletionsRequest.ts +13 -1
  42. package/ai/chat/updateTotalUsage.ts +26 -9
  43. package/ai/llm/deepinfra.ts +51 -0
  44. package/ai/llm/getPricing.ts +6 -0
  45. package/ai/llm/kimi.ts +2 -0
  46. package/ai/llm/openrouterModels.ts +0 -135
  47. package/ai/llm/providers.ts +1 -0
  48. package/ai/llm/types.ts +8 -0
  49. package/ai/taskRun/taskRunProtocol.ts +823 -0
  50. package/ai/token/calculatePrice.ts +30 -0
  51. package/ai/token/externalToolCost.ts +49 -29
  52. package/ai/token/prepareTokenUsageData.ts +6 -1
  53. package/ai/token/serverTokenWriter.ts +4 -2
  54. package/ai/tools/agent/agentTools.ts +21 -0
  55. package/ai/tools/agent/presets/appBuilderPreset.ts +7 -0
  56. package/ai/tools/agent/streamParallelAgentsTool.ts +2 -1
  57. package/ai/tools/agent/taskRunTool.ts +112 -0
  58. package/ai/tools/applyEditTool.ts +6 -3
  59. package/ai/tools/applyLineEditsTool.ts +6 -3
  60. package/ai/tools/checkEnvTool.ts +14 -9
  61. package/ai/tools/codeSearchTool.ts +17 -5
  62. package/ai/tools/execBashTool.ts +33 -29
  63. package/ai/tools/fetchWebpageSupport.ts +24 -0
  64. package/ai/tools/fetchWebpageTool.ts +18 -5
  65. package/ai/tools/index.ts +158 -0
  66. package/ai/tools/jdProductScraperTool.ts +821 -0
  67. package/ai/tools/listFilesTool.ts +6 -3
  68. package/ai/tools/localFilesTool.ts +200 -0
  69. package/ai/tools/readFileTool.ts +6 -3
  70. package/ai/tools/searchRepoTool.ts +6 -3
  71. package/ai/tools/table/rowTools.ts +6 -1
  72. package/ai/tools/taobaoTmallProductScraperTool.ts +49 -0
  73. package/ai/tools/toolApiClient.ts +20 -6
  74. package/ai/tools/wereadGatewayTool.ts +152 -0
  75. package/ai/tools/writeFileTool.ts +6 -3
  76. package/client/agentConfigResolver.test.ts +70 -0
  77. package/client/agentConfigResolver.ts +1 -0
  78. package/client/agentRun.test.ts +361 -7
  79. package/client/agentRun.ts +449 -63
  80. package/client/hybridRecordStore.test.ts +115 -0
  81. package/client/hybridRecordStore.ts +41 -0
  82. package/client/localAgentRecords.test.ts +27 -0
  83. package/client/localAgentRecords.ts +7 -0
  84. package/client/localDialogRecords.test.ts +124 -0
  85. package/client/localDialogRecords.ts +30 -0
  86. package/client/localProviderResolver.test.ts +78 -0
  87. package/client/localProviderResolver.ts +1 -0
  88. package/client/localRuntimeAdapter.test.ts +621 -9
  89. package/client/localRuntimeAdapter.ts +275 -250
  90. package/client/localRuntimeDryRun.test.ts +116 -0
  91. package/client/localToolPolicy.ts +8 -81
  92. package/client/taskRunPrompt.ts +26 -0
  93. package/client/taskWorktree.ts +8 -0
  94. package/client/workspaceSession.test.ts +57 -0
  95. package/client/workspaceSession.ts +11 -0
  96. package/commandRegistry.ts +23 -6
  97. package/connectorRunArtifact.ts +121 -0
  98. package/database/actions/write.ts +16 -2
  99. package/database/hooks/useUserData.ts +9 -3
  100. package/database/server/dataHandlers.ts +18 -20
  101. package/database/server/emailRepository.ts +3 -3
  102. package/database/server/patch.ts +18 -10
  103. package/database/server/query.ts +43 -4
  104. package/database/server/read.ts +24 -38
  105. package/database/server/recordIdentity.ts +100 -0
  106. package/database/server/write.ts +21 -25
  107. package/index.ts +70 -33
  108. package/machineCommands.ts +318 -144
  109. package/package.json +4 -1
  110. package/tableCommands.ts +181 -0
  111. package/taskRunCommand.ts +237 -0
@@ -1,141 +1,6 @@
1
1
  import { ModelDefinition } from '../types';
2
2
 
3
3
  export const OPENROUTER_MODELS: ModelDefinition[] = [
4
- // ==================== anthropic ====================
5
- {
6
- id: 'anthropic/claude-opus-4.7',
7
- name: 'Claude Opus 4.7',
8
- provider: 'anthropic',
9
- description: 'Claude Opus 4.7 是 Anthropic 新一代 Opus 家族模型,专为长时运行异步 Agent 设计,擅长复杂多步任务和大型代码库',
10
- contextWindow: 1000000,
11
- maxTokens: 8192,
12
- supportVision: false,
13
- supportTool: false,
14
- supportReasoning: true,
15
- supportStreaming: true,
16
- temperatureRange: { min: 0, max: 1, default: 0.7 },
17
- pricing: { input: 5, output: 25 },
18
- capabilities: ['文本生成', '代码编写', '复杂推理', 'Agent 执行', '长上下文'],
19
- group: 'anthropic',
20
- recommended: false,
21
- deprecated: false,
22
- },
23
- {
24
- id: 'anthropic/claude-opus-4.6',
25
- name: 'Claude Opus 4.6',
26
- provider: 'anthropic',
27
- description: 'Claude Opus 4.6 是 Anthropic 的高性能 Opus 模型,适合复杂推理与高难度任务',
28
- contextWindow: 200000,
29
- maxTokens: 8192,
30
- supportVision: true,
31
- supportTool: true,
32
- supportReasoning: true,
33
- supportStreaming: true,
34
- temperatureRange: { min: 0, max: 1, default: 0.7 },
35
- pricing: { input: 15, output: 75 },
36
- capabilities: ['文本生成', '代码编写', '复杂推理', '多模态理解'],
37
- group: 'anthropic',
38
- recommended: false,
39
- deprecated: false,
40
- },
41
- {
42
- id: 'anthropic/claude-sonnet-4.6',
43
- name: 'Claude Sonnet 4.6',
44
- provider: 'anthropic',
45
- description: 'Claude Sonnet 4.6 是 Anthropic 的通用高性价比模型,适合日常编码和复杂分析',
46
- contextWindow: 200000,
47
- maxTokens: 8192,
48
- supportVision: true,
49
- supportTool: true,
50
- supportReasoning: true,
51
- supportStreaming: true,
52
- temperatureRange: { min: 0, max: 1, default: 0.7 },
53
- pricing: { input: 3, output: 15 },
54
- capabilities: ['文本生成', '代码编写', '推理', '多模态理解'],
55
- group: 'anthropic',
56
- recommended: false,
57
- deprecated: false,
58
- },
59
- {
60
- id: 'anthropic/claude-haiku-4.6',
61
- name: 'Claude Haiku 4.6',
62
- provider: 'anthropic',
63
- description: 'Claude Haiku 4.6 是 Anthropic 的轻量高速模型,适合低延迟与轻量任务',
64
- contextWindow: 200000,
65
- maxTokens: 4096,
66
- supportVision: false,
67
- supportTool: true,
68
- supportReasoning: true,
69
- supportStreaming: true,
70
- temperatureRange: { min: 0, max: 1, default: 0.7 },
71
- pricing: { input: 0.25, output: 1.25 },
72
- capabilities: ['快速响应', '简单任务', '代码辅助'],
73
- group: 'anthropic',
74
- recommended: false,
75
- deprecated: false,
76
- },
77
- // ==================== openai ====================
78
- // ==================== gemini ====================
79
- {
80
- id: 'google/gemini-2.5-pro-preview-03-25',
81
- name: 'Gemini 2.5 Pro',
82
- provider: 'google',
83
- description: 'Gemini 2.5 Pro 是 Google 最新的多模态大模型,支持超长上下文',
84
- contextWindow: 1048576,
85
- maxTokens: 65536,
86
- supportVision: true,
87
- supportTool: true,
88
- supportReasoning: false,
89
- supportStreaming: true,
90
- temperatureRange: { min: 0, max: 2, default: 0.7 },
91
- pricing: { input: 1.25, output: 10 },
92
- capabilities: ['超长上下文', '文本生成', '多模态理解', '代码编写'],
93
- group: 'google',
94
- recommended: true,
95
- deprecated: false,
96
- },
97
- // ==================== fireworks ====================
98
- // ==================== moonshotai ====================
99
- {
100
- id: 'moonshotai/kimi-k2.6',
101
- name: 'Kimi K2.6',
102
- provider: 'moonshotai',
103
- description: 'Kimi K2.6 是 Moonshot AI 的下一代多模态模型,专为长时程编程、UI/UX 生成和多 Agent 编排设计',
104
- contextWindow: 262144,
105
- maxTokens: 8192,
106
- supportVision: true,
107
- supportTool: true,
108
- supportReasoning: true,
109
- supportStreaming: true,
110
- temperatureRange: { min: 0, max: 2, default: 0.7 },
111
- pricing: { input: 6, output: 28 },
112
- capabilities: ['文本生成', '代码编写', '多模态理解', 'Agent 编排', 'UI/UX 生成'],
113
- group: 'moonshotai',
114
- recommended: false,
115
- deprecated: false,
116
- },
117
-
118
- // ==================== xiaomi ====================
119
- {
120
- id: 'xiaomi/mimo-v2.5-pro',
121
- name: 'xiaomi/mimo-v2.5-pro',
122
- displayName: 'Xiaomi: MiMo V2.5 Pro',
123
- provider: 'xiaomi',
124
- description: 'MiMo V2.5 Pro 是 Xiaomi 的长上下文 agentic/code 模型,适合复杂软件工程和工具调用工作流',
125
- contextWindow: 1048576,
126
- maxTokens: 131072,
127
- supportVision: true,
128
- supportTool: true,
129
- supportReasoning: true,
130
- supportStreaming: true,
131
- temperatureRange: { min: 0, max: 2, default: 0.7 },
132
- pricing: { input: 1, output: 3 },
133
- capabilities: ['文本生成', '代码编写', '复杂推理', '长上下文', '工具调用'],
134
- group: 'xiaomi',
135
- recommended: true,
136
- deprecated: false,
137
- },
138
-
139
4
  ];
140
5
 
141
6
  export const openrouterModels = OPENROUTER_MODELS;
@@ -92,6 +92,7 @@ const toModel = (candidate: ModelLookupCandidate): Model => ({
92
92
  contextWindow: candidate.contextWindow,
93
93
  price: candidate.price ?? candidate.pricing ?? { input: 0, output: 0 },
94
94
  pricingStrategy: candidate.pricingStrategy,
95
+ serviceTierPriceMultipliers: candidate.serviceTierPriceMultipliers,
95
96
  maxOutputTokens: candidate.maxOutputTokens ?? candidate.maxTokens,
96
97
  jsonOutput: candidate.jsonOutput,
97
98
  fnCall:
package/ai/llm/types.ts CHANGED
@@ -20,6 +20,11 @@ export interface PricingStrategy {
20
20
  tiers: PricingTier[];
21
21
  }
22
22
 
23
+ export interface ServiceTierPriceMultiplier {
24
+ inputOutput: number;
25
+ cache?: number;
26
+ }
27
+
23
28
  export interface Model {
24
29
  name: string;
25
30
  displayName?: string; // 可选的 displayName 字段
@@ -29,6 +34,9 @@ export interface Model {
29
34
 
30
35
  // 新增字段:支持高级定价策略
31
36
  pricingStrategy?: PricingStrategy;
37
+ serviceTierPriceMultipliers?: Partial<
38
+ Record<"batch" | "flex" | "priority", ServiceTierPriceMultiplier>
39
+ >;
32
40
 
33
41
  maxOutputTokens?: any; // 最大输出令牌数,建议改为 number
34
42
  jsonOutput?: boolean; // 是否支持 JSON 结构化输出