@fastagent-sh/fastagent 0.26.1 → 0.27.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.
@@ -52,13 +52,15 @@ declare const AgentInfo_base: Schema.Opaque<AgentInfo, Schema.Struct<{
52
52
  }>>;
53
53
  /**
54
54
  * The models a session may name: those whose provider has a credential here. `contextWindow`, in tokens, is the
55
- * window the agent runs the model with, absent when the model declares none.
55
+ * window the agent runs the model with, absent when the model declares none. `thinkingLevels` are the levels the
56
+ * model supports, lowest first: `["off"]` for a model that does not reason.
56
57
  */
57
58
  readonly models: Schema.$Array<Schema.Struct<{
58
59
  readonly provider: Schema.String;
59
60
  readonly modelId: Schema.String;
60
61
  readonly name: Schema.optionalKey<Schema.String>;
61
62
  readonly contextWindow: Schema.optionalKey<Schema.Number>;
63
+ readonly thinkingLevels: Schema.$Array<Schema.Literals<readonly ["off", "minimal", "low", "medium", "high", "xhigh", "max"]>>;
62
64
  }>>;
63
65
  readonly defaultModel: Schema.optionalKey<Schema.Struct<{
64
66
  readonly provider: Schema.String;
@@ -79,13 +81,15 @@ declare const AgentInfo_base: Schema.Opaque<AgentInfo, Schema.Struct<{
79
81
  }>>;
80
82
  /**
81
83
  * The models a session may name: those whose provider has a credential here. `contextWindow`, in tokens, is the
82
- * window the agent runs the model with, absent when the model declares none.
84
+ * window the agent runs the model with, absent when the model declares none. `thinkingLevels` are the levels the
85
+ * model supports, lowest first: `["off"]` for a model that does not reason.
83
86
  */
84
87
  readonly models: Schema.$Array<Schema.Struct<{
85
88
  readonly provider: Schema.String;
86
89
  readonly modelId: Schema.String;
87
90
  readonly name: Schema.optionalKey<Schema.String>;
88
91
  readonly contextWindow: Schema.optionalKey<Schema.Number>;
92
+ readonly thinkingLevels: Schema.$Array<Schema.Literals<readonly ["off", "minimal", "low", "medium", "high", "xhigh", "max"]>>;
89
93
  }>>;
90
94
  readonly defaultModel: Schema.optionalKey<Schema.Struct<{
91
95
  readonly provider: Schema.String;
package/dist/agent-api.js CHANGED
@@ -30,13 +30,15 @@ export class AgentInfo extends Schema.Opaque()(Schema.Struct({
30
30
  tools: Schema.Array(Named),
31
31
  /**
32
32
  * The models a session may name: those whose provider has a credential here. `contextWindow`, in tokens, is the
33
- * window the agent runs the model with, absent when the model declares none.
33
+ * window the agent runs the model with, absent when the model declares none. `thinkingLevels` are the levels the
34
+ * model supports, lowest first: `["off"]` for a model that does not reason.
34
35
  */
35
36
  models: Schema.Array(Schema.Struct({
36
37
  provider: Schema.String,
37
38
  modelId: Schema.String,
38
39
  name: Schema.optionalKey(Schema.String),
39
40
  contextWindow: Schema.optionalKey(Schema.Number),
41
+ thinkingLevels: Schema.Array(ThinkingLevel),
40
42
  })),
41
43
  defaultModel: Schema.optionalKey(ModelRef),
42
44
  })) {
@@ -1,4 +1,4 @@
1
- import type { Models, ModelThinkingLevel } from "@earendil-works/pi-ai";
1
+ import { type Models, type ModelThinkingLevel } from "@earendil-works/pi-ai";
2
2
  import { type Conversation, Harness, type HarnessOptions, type HarnessSettings, type ModelRef, type RegistryReader, type Storage } from "@earendil-works/pi-durable";
3
3
  import { type Agent } from "../../agent-api.ts";
4
4
  /** What a Caller may offer as `/<name>`: a prompt template or a skill, expanded for the model (SPEC.md §5.1). */
@@ -4,6 +4,7 @@
4
4
  * one process owns a storage.
5
5
  */
6
6
  import { BACKGROUND_CONTEXT, withAbortSignal } from "@earendil-works/chord/context";
7
+ import { getSupportedThinkingLevels, } from "@earendil-works/pi-ai";
7
8
  import { AgentDoc, ConversationBusy, DEFAULT_RETRY_POLICY, Harness, InboxDoc, LiveDoc, SessionFailed, configure, } from "@earendil-works/pi-durable";
8
9
  import * as Cause from "effect/Cause";
9
10
  import * as Duration from "effect/Duration";
@@ -181,6 +182,7 @@ function durableAgent(harness, ids, sessions, lifetime, options) {
181
182
  ...(model.name ? { name: model.name } : {}),
182
183
  // pi reads a window a model does not declare (a virtual model's, before its first answer) as 0.
183
184
  ...(model.contextWindow > 0 ? { contextWindow: model.contextWindow } : {}),
185
+ thinkingLevels: getSupportedThinkingLevels(model),
184
186
  })),
185
187
  ...(options.model === undefined
186
188
  ? {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fastagent-sh/fastagent",
3
- "version": "0.26.1",
3
+ "version": "0.27.0",
4
4
  "description": "Vibe first. Then FastAgent: turn a local agent directory into a live service in your app, on Telegram, Slack, Feishu, or behind any channel.",
5
5
  "keywords": [
6
6
  "agent",