@tansr/serve 0.2.0 → 0.3.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/dist/index.d.ts CHANGED
@@ -4397,7 +4397,24 @@ declare const CreateSessionBodySchema: z.ZodObject<{
4397
4397
  readOnly?: boolean | undefined;
4398
4398
  }>, "many">>;
4399
4399
  capabilitiesProfile: z.ZodOptional<z.ZodString>;
4400
+ /**
4401
+ * S-TH2(用户拍板 2026-09-01,doc/98 冻结面加法):思考生成(生成面旋钮)
4402
+ * ——逐轮透传内核 IRRequest.thinking(budget = 思考 token 预算,按模型
4403
+ * 方言映射;平台令牌档经 TWP reasoning 档位出线,S-TH1)。缺席 = 装配面
4404
+ * 缺省(工厂 thinking 选项),两级皆缺席恒不注入(现状零漂移)。思考的
4405
+ * 呈现走客户端 SessionView delivery(呈现面),与本键正交。
4406
+ */
4407
+ thinking: z.ZodOptional<z.ZodObject<{
4408
+ budget: z.ZodOptional<z.ZodNumber>;
4409
+ }, "strip", z.ZodTypeAny, {
4410
+ budget?: number | undefined;
4411
+ }, {
4412
+ budget?: number | undefined;
4413
+ }>>;
4400
4414
  }, "strip", z.ZodTypeAny, {
4415
+ thinking?: {
4416
+ budget?: number | undefined;
4417
+ } | undefined;
4401
4418
  model?: string | undefined;
4402
4419
  tools?: string[] | undefined;
4403
4420
  budget?: {
@@ -4422,6 +4439,9 @@ declare const CreateSessionBodySchema: z.ZodObject<{
4422
4439
  }[] | undefined;
4423
4440
  capabilitiesProfile?: string | undefined;
4424
4441
  }, {
4442
+ thinking?: {
4443
+ budget?: number | undefined;
4444
+ } | undefined;
4425
4445
  model?: string | undefined;
4426
4446
  tools?: string[] | undefined;
4427
4447
  budget?: {
@@ -4815,6 +4835,10 @@ interface AgentSessionCreateInit {
4815
4835
  resume?: {
4816
4836
  sessionId: string;
4817
4837
  };
4838
+ /** S-TH2:思考生成(生成面;缺席 = 装配面缺省,两级皆缺席恒不注入) */
4839
+ thinking?: {
4840
+ budget?: number;
4841
+ };
4818
4842
  }
4819
4843
  interface AgentSessionCreateResult {
4820
4844
  handle: AgentSessionHandle;
@@ -4916,6 +4940,14 @@ interface SessionInit {
4916
4940
  maxUsd?: number;
4917
4941
  maxTokens?: number;
4918
4942
  };
4943
+ /**
4944
+ * S-TH2(2026-09-01):思考生成(生成面旋钮)——逐轮透传 IRRequest.thinking。
4945
+ * 优先级:本键(wire,per-会话)> 装配面缺省(工厂选项/profile effort)>
4946
+ * 恒不注入(现状)。
4947
+ */
4948
+ thinking?: {
4949
+ budget?: number;
4950
+ };
4919
4951
  }
4920
4952
  /**
4921
4953
  * 会话句柄——装配层对内核会话的最小操控面。
@@ -9522,8 +9554,9 @@ interface ServeSessionDriverOptions {
9522
9554
  /** 缺省 8192 */
9523
9555
  maxTokens?: number;
9524
9556
  /**
9525
- * 思考预算(OPT-15 effort 档位映射产物;工厂经 applyEffort 计算):
9526
- * 逐轮透传 runQuery IRRequest.thinking。缺省不注入(现状)
9557
+ * 思考预算:逐轮透传 runQuery IRRequest.thinking。取值三级(S-TH2
9558
+ * 用户拍板 2026-09-01):wire thinking (per-会话)> 装配面缺省(平台
9559
+ * 形工厂 options.thinking / cli 形 profile effort 档)> 缺席恒不注入。
9527
9560
  */
9528
9561
  thinking?: {
9529
9562
  budget?: number;
@@ -9830,6 +9863,13 @@ interface PlatformServeSessionFactoryOptions {
9830
9863
  maxTokens?: number;
9831
9864
  /** 单轮 modelTurns 上限(防失控;缺省不设) */
9832
9865
  maxTurnsPerQuery?: number;
9866
+ /**
9867
+ * S-TH2(用户拍板 2026-09-01):装配面思考生成缺省(serve 旋钮)——
9868
+ * 会话未带 wire thinking 键时的兜底;wire 键恒胜。两级皆缺席恒不注入。
9869
+ */
9870
+ thinking?: {
9871
+ budget?: number;
9872
+ };
9833
9873
  /** runQuery 注入缝(测试脚本化;缺省 kernel runQuery) */
9834
9874
  runQueryImpl?: typeof runQuery;
9835
9875
  }
package/dist/index.js CHANGED
@@ -37955,7 +37955,15 @@ var CreateSessionBodySchema = z11.object({
37955
37955
  endUser: z11.object({ id: z11.string().regex(END_USER_ID_PATTERN) }).optional(),
37956
37956
  resume: z11.object({ sessionId: z11.string().min(1) }).optional(),
37957
37957
  clientTools: z11.array(ClientToolDeclSchema).max(V2_LIMITS.maxClientTools).optional(),
37958
- capabilitiesProfile: z11.string().min(1).optional()
37958
+ capabilitiesProfile: z11.string().min(1).optional(),
37959
+ /**
37960
+ * S-TH2(用户拍板 2026-09-01,doc/98 冻结面加法):思考生成(生成面旋钮)
37961
+ * ——逐轮透传内核 IRRequest.thinking(budget = 思考 token 预算,按模型
37962
+ * 方言映射;平台令牌档经 TWP reasoning 档位出线,S-TH1)。缺席 = 装配面
37963
+ * 缺省(工厂 thinking 选项),两级皆缺席恒不注入(现状零漂移)。思考的
37964
+ * 呈现走客户端 SessionView delivery(呈现面),与本键正交。
37965
+ */
37966
+ thinking: z11.object({ budget: z11.number().int().positive().optional() }).optional()
37959
37967
  });
37960
37968
  var MessageBlockSchema = z11.discriminatedUnion("t", [
37961
37969
  z11.object({ t: z11.literal("text"), text: z11.string().min(1).max(V2_LIMITS.textBlockMaxChars) }),
@@ -38509,7 +38517,8 @@ function createAgentRoutesHandler(deps) {
38509
38517
  ...init.tools !== void 0 ? { tools: init.tools } : {},
38510
38518
  ...init.clientTools !== void 0 ? { clientTools: init.clientTools } : {},
38511
38519
  ...init.capabilitiesProfile !== void 0 ? { capabilitiesProfile: init.capabilitiesProfile } : {},
38512
- ...init.resume !== void 0 ? { resume: init.resume } : {}
38520
+ ...init.resume !== void 0 ? { resume: init.resume } : {},
38521
+ ...init.thinking !== void 0 ? { thinking: init.thinking } : {}
38513
38522
  };
38514
38523
  let handle;
38515
38524
  let resumed;
@@ -61126,6 +61135,8 @@ function createPlatformServeSessionFactory(options) {
61126
61135
  compaction: assembled.compaction ?? {},
61127
61136
  ...assembled.compactionManagerOptions !== void 0 ? { compactionManagerOptions: assembled.compactionManagerOptions } : {},
61128
61137
  reminders: createReminderProvider({ todoStore }),
61138
+ // S-TH2:思考生成两级取值——wire 键(per-会话)恒胜装配面缺省
61139
+ ...init.thinking !== void 0 ? { thinking: init.thinking } : options.thinking !== void 0 ? { thinking: options.thinking } : {},
61129
61140
  ...extras?.onTurnEnd !== void 0 ? { onTurnEnd: extras.onTurnEnd } : {},
61130
61141
  ...options.runQueryImpl !== void 0 ? { runQueryImpl: options.runQueryImpl } : {}
61131
61142
  });
@@ -61327,7 +61338,8 @@ function createAgentSessionFactory(options) {
61327
61338
  ...init.profile !== void 0 ? { profile: init.profile } : {},
61328
61339
  ...init.labels !== void 0 ? { labels: init.labels } : {},
61329
61340
  ...init.budget !== void 0 ? { budget: init.budget } : {},
61330
- ...effectiveTools !== void 0 ? { tools: [...effectiveTools] } : {}
61341
+ ...effectiveTools !== void 0 ? { tools: [...effectiveTools] } : {},
61342
+ ...init.thinking !== void 0 ? { thinking: init.thinking } : {}
61331
61343
  },
61332
61344
  {
61333
61345
  sessionId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tansr/serve",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Tansr agent session server: the bare /v2 agent-session protocol engine (REST + SSE) you embed in your own Node service. Session auth is fully yours via the authenticate seam. Published as @tansr/serve (decided 2026-09-01); the pack script stamps the publish name into the tarball.",
5
5
  "license": "MIT",
6
6
  "type": "module",