@link-assistant/agent 0.21.0 → 0.22.0

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": "@link-assistant/agent",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "description": "A minimal, public domain AI CLI agent compatible with OpenCode's JSON interface. Bun-only runtime.",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -194,7 +194,8 @@ export async function runContinuousServerMode(
194
194
  systemMessage,
195
195
  appendSystemMessage,
196
196
  jsonStandard,
197
- compactionModel
197
+ compactionModel,
198
+ temperature
198
199
  ) {
199
200
  // Check both CLI flag and environment variable for compact JSON mode
200
201
  const compactJson = argv['compact-json'] === true || config.compactJson;
@@ -290,6 +291,7 @@ export async function runContinuousServerMode(
290
291
  compactionModel,
291
292
  system: systemMessage,
292
293
  appendSystem: appendSystemMessage,
294
+ temperature,
293
295
  }),
294
296
  }
295
297
  ).catch((error) => {
@@ -446,7 +448,8 @@ export async function runContinuousDirectMode(
446
448
  systemMessage,
447
449
  appendSystemMessage,
448
450
  jsonStandard,
449
- compactionModel
451
+ compactionModel,
452
+ temperature
450
453
  ) {
451
454
  // Check both CLI flag and environment variable for compact JSON mode
452
455
  const compactJson = argv['compact-json'] === true || config.compactJson;
@@ -523,6 +526,7 @@ export async function runContinuousDirectMode(
523
526
  compactionModel,
524
527
  system: systemMessage,
525
528
  appendSystem: appendSystemMessage,
529
+ temperature,
526
530
  }).catch((error) => {
527
531
  hasError = true;
528
532
  eventHandler.output({
@@ -168,5 +168,10 @@ export function buildRunOptions(yargs) {
168
168
  description:
169
169
  'Safety margin (%) of usable context window before triggering compaction. Only applies when the compaction model has equal or smaller context than the base model. Default: 15.',
170
170
  default: DEFAULT_COMPACTION_SAFETY_MARGIN_PERCENT,
171
+ })
172
+ .option('temperature', {
173
+ type: 'number',
174
+ description:
175
+ 'Override the temperature for model completions. When not set, the default per-model temperature is used.',
171
176
  });
172
177
  }
package/src/index.js CHANGED
@@ -313,7 +313,8 @@ async function runAgentMode(argv, request) {
313
313
  systemMessage,
314
314
  appendSystemMessage,
315
315
  jsonStandard,
316
- compactionModel
316
+ compactionModel,
317
+ argv.temperature
317
318
  );
318
319
  } else {
319
320
  // DIRECT MODE: Run everything in single process
@@ -325,7 +326,8 @@ async function runAgentMode(argv, request) {
325
326
  systemMessage,
326
327
  appendSystemMessage,
327
328
  jsonStandard,
328
- compactionModel
329
+ compactionModel,
330
+ argv.temperature
329
331
  );
330
332
  }
331
333
  },
@@ -399,7 +401,8 @@ async function runContinuousAgentMode(argv) {
399
401
  systemMessage,
400
402
  appendSystemMessage,
401
403
  jsonStandard,
402
- compactionModel
404
+ compactionModel,
405
+ argv.temperature
403
406
  );
404
407
  } else {
405
408
  // DIRECT MODE: Run everything in single process
@@ -410,7 +413,8 @@ async function runContinuousAgentMode(argv) {
410
413
  systemMessage,
411
414
  appendSystemMessage,
412
415
  jsonStandard,
413
- compactionModel
416
+ compactionModel,
417
+ argv.temperature
414
418
  );
415
419
  }
416
420
  },
@@ -433,7 +437,8 @@ async function runServerMode(
433
437
  systemMessage,
434
438
  appendSystemMessage,
435
439
  jsonStandard,
436
- compactionModel
440
+ compactionModel,
441
+ temperature
437
442
  ) {
438
443
  const compactJson = argv['compact-json'] === true;
439
444
 
@@ -502,6 +507,7 @@ async function runServerMode(
502
507
  compactionModel,
503
508
  system: systemMessage,
504
509
  appendSystem: appendSystemMessage,
510
+ temperature,
505
511
  }),
506
512
  }
507
513
  ).catch((error) => {
@@ -534,7 +540,8 @@ async function runDirectMode(
534
540
  systemMessage,
535
541
  appendSystemMessage,
536
542
  jsonStandard,
537
- compactionModel
543
+ compactionModel,
544
+ temperature
538
545
  ) {
539
546
  const compactJson = argv['compact-json'] === true;
540
547
 
@@ -587,6 +594,7 @@ async function runDirectMode(
587
594
  compactionModel,
588
595
  system: systemMessage,
589
596
  appendSystem: appendSystemMessage,
597
+ temperature,
590
598
  }).catch((error) => {
591
599
  hasError = true;
592
600
  eventHandler.output({
@@ -411,6 +411,7 @@ export namespace MessageV2 {
411
411
  .optional(),
412
412
  system: z.string().optional(),
413
413
  appendSystem: z.string().optional(),
414
+ temperature: z.number().optional(),
414
415
  tools: z.record(z.string(), z.boolean()).optional(),
415
416
  }).meta({
416
417
  ref: 'UserMessage',
@@ -110,6 +110,7 @@ export namespace SessionPrompt {
110
110
  noReply: z.boolean().optional(),
111
111
  system: z.string().optional(),
112
112
  appendSystem: z.string().optional(),
113
+ temperature: z.number().optional(),
113
114
  tools: z.record(z.string(), z.boolean()).optional(),
114
115
  parts: z.array(
115
116
  z.discriminatedUnion('type', [
@@ -734,10 +735,12 @@ export namespace SessionPrompt {
734
735
  });
735
736
  const params = {
736
737
  temperature:
737
- (model.info?.temperature ?? false)
738
- ? (agent.temperature ??
739
- ProviderTransform.temperature(model.providerID, model.modelID))
740
- : undefined,
738
+ lastUser.temperature != null
739
+ ? lastUser.temperature
740
+ : (model.info?.temperature ?? false)
741
+ ? (agent.temperature ??
742
+ ProviderTransform.temperature(model.providerID, model.modelID))
743
+ : undefined,
741
744
  topP:
742
745
  agent.topP ?? ProviderTransform.topP(model.providerID, model.modelID),
743
746
  options: {
@@ -1189,6 +1192,7 @@ export namespace SessionPrompt {
1189
1192
  tools: input.tools,
1190
1193
  system: input.system,
1191
1194
  appendSystem: input.appendSystem,
1195
+ temperature: input.temperature,
1192
1196
  agent: agent.name,
1193
1197
  model: await resolveModel({
1194
1198
  model: input.model,