@agi-cli/server 0.1.122 → 0.1.123

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agi-cli/server",
3
- "version": "0.1.122",
3
+ "version": "0.1.123",
4
4
  "description": "HTTP API server for AGI CLI",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -29,8 +29,8 @@
29
29
  "typecheck": "tsc --noEmit"
30
30
  },
31
31
  "dependencies": {
32
- "@agi-cli/sdk": "0.1.122",
33
- "@agi-cli/database": "0.1.122",
32
+ "@agi-cli/sdk": "0.1.123",
33
+ "@agi-cli/database": "0.1.123",
34
34
  "drizzle-orm": "^0.44.5",
35
35
  "hono": "^4.9.9",
36
36
  "zod": "^4.1.8"
package/src/presets.ts CHANGED
@@ -78,6 +78,7 @@ export const BUILTIN_TOOLS = [
78
78
  'websearch',
79
79
  'progress_update',
80
80
  'finish',
81
+ 'skill',
81
82
  ] as const;
82
83
 
83
84
  export type BuiltinAgent = keyof typeof BUILTIN_AGENTS;
@@ -123,33 +123,43 @@ export function registerCommitRoutes(app: Hono) {
123
123
  'claude-3-5-sonnet-20241022';
124
124
  const model = await resolveModel(provider, modelId, config);
125
125
 
126
- const userPrompt = `Generate a concise, conventional commit message for these git changes.
126
+ const userPrompt = `Generate a commit message for these git changes.
127
127
 
128
128
  Staged files:
129
129
  ${fileList}
130
130
 
131
- Diff (first 2000 chars):
132
- ${diff.slice(0, 2000)}
131
+ Diff (first 4000 chars):
132
+ ${diff.slice(0, 4000)}
133
133
 
134
134
  Guidelines:
135
- - Use conventional commits format (feat:, fix:, docs:, etc.)
136
- - Keep the first line under 72 characters
137
- - Be specific but concise
138
- - Focus on what changed and why, not how
139
- - Do not include any markdown formatting or code blocks
135
+ - CAREFULLY READ the diff above - describe what ACTUALLY changed
136
+ - Use conventional commits format: type(scope): description
137
+ - First line under 72 characters
138
+ - Add a blank line, then 2-4 short bullet points
139
+ - Each bullet describes ONE specific change you see in the diff
140
+ - Be ACCURATE - don't invent changes that aren't in the diff
141
+ - Keep bullets short (under 80 chars each)
142
+ - Do not include markdown code blocks or backticks
140
143
  - Return ONLY the commit message text, nothing else
141
144
 
145
+ Example (for a diff that adds boolean returns to functions):
146
+ refactor(auth): return success status from login functions
147
+
148
+ - Add boolean return type to auth functions
149
+ - Return false on user cancellation or failure
150
+ - Check return value before proceeding with auth flow
151
+
142
152
  Commit message:`;
143
153
 
144
154
  const systemPrompt = spoofPrompt
145
155
  ? spoofPrompt
146
- : 'You are a helpful assistant that generates git commit messages.';
156
+ : 'You are a helpful assistant that generates accurate git commit messages based on the actual diff content.';
147
157
 
148
158
  const { text } = await generateText({
149
159
  model,
150
160
  system: systemPrompt,
151
161
  prompt: userPrompt,
152
- maxTokens: 200,
162
+ maxTokens: 500,
153
163
  });
154
164
 
155
165
  const message = text.trim();
@@ -109,7 +109,7 @@ function mergeAgentEntries(
109
109
  return merged;
110
110
  }
111
111
 
112
- const baseToolSet = ['progress_update', 'finish'] as const;
112
+ const baseToolSet = ['progress_update', 'finish', 'skill'] as const;
113
113
 
114
114
  const defaultToolExtras: Record<string, string[]> = {
115
115
  build: [
@@ -26,7 +26,6 @@ import { pruneSession } from '../message/compaction.ts';
26
26
  import { setupRunner } from './runner-setup.ts';
27
27
  import {
28
28
  type ReasoningState,
29
- serializeReasoningContent,
30
29
  handleReasoningStart,
31
30
  handleReasoningDelta,
32
31
  handleReasoningEnd,
@@ -157,11 +156,11 @@ async function runAssistant(opts: RunOpts) {
157
156
  const onFinish = createFinishHandler(opts, db, completeAssistantMessage);
158
157
 
159
158
  try {
160
- // biome-ignore lint/suspicious/noExplicitAny: AI SDK message types are complex
161
159
  const result = streamText({
162
160
  model,
163
161
  tools: toolset,
164
162
  ...(system ? { system } : {}),
163
+ // biome-ignore lint/suspicious/noExplicitAny: AI SDK message types are complex
165
164
  messages: messagesWithSystemInstructions as any,
166
165
  ...(effectiveMaxOutputTokens
167
166
  ? { maxOutputTokens: effectiveMaxOutputTokens }
@@ -169,10 +168,15 @@ async function runAssistant(opts: RunOpts) {
169
168
  ...(Object.keys(providerOptions).length > 0 ? { providerOptions } : {}),
170
169
  abortSignal: opts.abortSignal,
171
170
  stopWhen: hasToolCall('finish'),
171
+ // biome-ignore lint/suspicious/noExplicitAny: AI SDK callback types mismatch
172
172
  onStepFinish: onStepFinish as any,
173
+ // biome-ignore lint/suspicious/noExplicitAny: AI SDK callback types mismatch
173
174
  onError: onError as any,
175
+ // biome-ignore lint/suspicious/noExplicitAny: AI SDK callback types mismatch
174
176
  onAbort: onAbort as any,
177
+ // biome-ignore lint/suspicious/noExplicitAny: AI SDK callback types mismatch
175
178
  onFinish: onFinish as any,
179
+ // biome-ignore lint/suspicious/noExplicitAny: AI SDK streamText options type
176
180
  } as any);
177
181
 
178
182
  for await (const part of result.fullStream) {