@genesislcap/ai-assistant 15.78.1 → 15.79.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.
@@ -4157,237 +4157,6 @@
4157
4157
  }
4158
4158
  ]
4159
4159
  },
4160
- {
4161
- "kind": "javascript-module",
4162
- "path": "src/config/config.ts",
4163
- "declarations": [
4164
- {
4165
- "kind": "function",
4166
- "name": "defineAgent",
4167
- "description": "Identity helper that infers the narrowest possible type for an agent config,\npreserving string literal types (including `name`) without requiring `as const`.\n\nUse this when you need `typeof myAgent` to carry the literal `name` type —\nfor example, when wiring `ChatToolHandlers<typeof myAgent>`.\n\n```ts\nconst myAgent = defineAgent({ name: 'my_agent', ... });\ntype Handlers = ChatToolHandlers<typeof myAgent>;\n// requestSubAgent name param is now typed as 'my_agent'\n```"
4168
- }
4169
- ],
4170
- "exports": [
4171
- {
4172
- "kind": "js",
4173
- "name": "CachePolicy",
4174
- "declaration": {
4175
- "name": "CachePolicy",
4176
- "module": "src/config/config.ts"
4177
- }
4178
- },
4179
- {
4180
- "kind": "js",
4181
- "name": "ChatFallback",
4182
- "declaration": {
4183
- "name": "ChatFallback",
4184
- "module": "src/config/config.ts"
4185
- }
4186
- },
4187
- {
4188
- "kind": "js",
4189
- "name": "ChatInputDuringExecutionMode",
4190
- "declaration": {
4191
- "name": "ChatInputDuringExecutionMode",
4192
- "module": "src/config/config.ts"
4193
- }
4194
- },
4195
- {
4196
- "kind": "js",
4197
- "name": "ChatThinkingPolicy",
4198
- "declaration": {
4199
- "name": "ChatThinkingPolicy",
4200
- "module": "src/config/config.ts"
4201
- }
4202
- },
4203
- {
4204
- "kind": "js",
4205
- "name": "ChatToolChoice",
4206
- "declaration": {
4207
- "name": "ChatToolChoice",
4208
- "module": "src/config/config.ts"
4209
- }
4210
- },
4211
- {
4212
- "kind": "js",
4213
- "name": "defineAgent",
4214
- "declaration": {
4215
- "name": "defineAgent",
4216
- "module": "src/config/config.ts"
4217
- }
4218
- }
4219
- ]
4220
- },
4221
- {
4222
- "kind": "javascript-module",
4223
- "path": "src/config/define-stateful-agent.ts",
4224
- "declarations": [
4225
- {
4226
- "kind": "function",
4227
- "name": "restoreMachine",
4228
- "return": {
4229
- "type": {
4230
- "text": "void"
4231
- }
4232
- },
4233
- "parameters": [
4234
- {
4235
- "name": "machine",
4236
- "type": {
4237
- "text": "{ stop: () => void; start: (options?: { state?: unknown }) => void }"
4238
- },
4239
- "description": "the machine to restore (already constructed/started)."
4240
- },
4241
- {
4242
- "name": "restored",
4243
- "type": {
4244
- "text": "unknown"
4245
- },
4246
- "description": "the agent's serialized image (`ctx.restored` in `init`)."
4247
- },
4248
- {
4249
- "name": "key",
4250
- "default": "'machine'",
4251
- "description": "the property the machine occupies in the snapshot; defaults to\n`'machine'` to match the conventional `{ machine }` state bag."
4252
- }
4253
- ],
4254
- "description": "Restore a foundation-state-machine instance from a snapshot produced by the\ndefault serializer (or `machine.getPersistedSnapshot()`). Call inside a\nstateful agent's `init` to resume the machine in its exact prior place:\n\n```ts\ninit: ({ restored }) => {\n const machine = new MyMachine();\n restoreMachine(machine, restored); // resume, or no-op on a fresh start\n return { machine };\n}\n```\n\nNo-ops when there is nothing to restore (a fresh session), leaving the\nfreshly-constructed machine in its initial state."
4255
- },
4256
- {
4257
- "kind": "function",
4258
- "name": "defineStatefulAgent",
4259
- "return": {
4260
- "type": {
4261
- "text": "AgentConfig"
4262
- }
4263
- },
4264
- "parameters": [
4265
- {
4266
- "name": "opts",
4267
- "type": {
4268
- "text": "StatefulAgentInit<S>"
4269
- }
4270
- }
4271
- ],
4272
- "description": "Build an `AgentConfig` whose `systemPrompt`, `toolDefinitions`, and tool\nhandlers all close over a long-lived state object created on activation.\n\nThe framework wires the lifecycle: `init` on `onActivate`, `dispose` on\n`onDeactivate`. State is held inside the helper's closure — never exposed on\nthe resulting `AgentConfig` — so the redux serializer doesn't see it."
4273
- },
4274
- {
4275
- "kind": "function",
4276
- "name": "defineAutopilot",
4277
- "return": {
4278
- "type": {
4279
- "text": "AutopilotConfig<S>"
4280
- }
4281
- },
4282
- "parameters": [
4283
- {
4284
- "name": "config",
4285
- "type": {
4286
- "text": "AutopilotConfig<S>"
4287
- }
4288
- }
4289
- ],
4290
- "description": "Define an autopilot for a stateful agent whose state is `S` (GENC-1660). An identity function\nthat exists for its type: the resolvers get `S`, and the result goes on `defineStatefulAgent`'s\n`autopilot` option."
4291
- }
4292
- ],
4293
- "exports": [
4294
- {
4295
- "kind": "js",
4296
- "name": "restoreMachine",
4297
- "declaration": {
4298
- "name": "restoreMachine",
4299
- "module": "src/config/define-stateful-agent.ts"
4300
- }
4301
- },
4302
- {
4303
- "kind": "js",
4304
- "name": "defineStatefulAgent",
4305
- "declaration": {
4306
- "name": "defineStatefulAgent",
4307
- "module": "src/config/define-stateful-agent.ts"
4308
- }
4309
- },
4310
- {
4311
- "kind": "js",
4312
- "name": "defineAutopilot",
4313
- "declaration": {
4314
- "name": "defineAutopilot",
4315
- "module": "src/config/define-stateful-agent.ts"
4316
- }
4317
- }
4318
- ]
4319
- },
4320
- {
4321
- "kind": "javascript-module",
4322
- "path": "src/config/fallback-agents.ts",
4323
- "declarations": [
4324
- {
4325
- "kind": "variable",
4326
- "name": "friendlyFallbackAgent",
4327
- "type": {
4328
- "text": "FallbackAgentConfig"
4329
- },
4330
- "default": "{\n name: 'Assistant',\n fallback: true,\n systemPrompt: `You are a warm, friendly assistant. For general conversation like \"Hi\" or \"How are you\", you can have a friendly chat. For anything more complex, you cannot directly help, but you can explain what specialists are available. The available specialists are:\\n\\n{{agents}}\\n\\nPolitely let the user know what you can help with and invite them to rephrase their request if it is outside your scope.`,\n}",
4331
- "description": "A warm, conversational fallback agent. Acknowledges it can't help directly,\nexplains what the available specialists can do, and invites the user to retry.\n\nThe system prompt is generated at runtime by `OrchestratingDriver` from the\nspecialist list — no manual authoring required."
4332
- },
4333
- {
4334
- "kind": "variable",
4335
- "name": "strictFallbackAgent",
4336
- "type": {
4337
- "text": "FallbackAgentConfig"
4338
- },
4339
- "default": "{\n name: 'Assistant',\n fallback: true,\n systemPrompt: `You are a concise assistant. The user's request is outside your scope. The available specialists are: {{agents}}.\n\n{{unroutable}}\n\nAnswer in a single short sentence. Do not elaborate.`,\n}",
4340
- "description": "A brief, professional fallback agent. States what is available without\nelaboration. The `{{agents}}` placeholder is replaced at runtime by\n`OrchestratingDriver` with the generated specialist list.\n\nThe `{{unroutable}}` placeholder positions `UNROUTABLE_INSTRUCTION` — the framework's\ninstruction for a substantive request no specialist covers, which is otherwise APPENDED to a\nstring-form prompt. Positioned rather than appended for one reason: this preset's whole point is\nbrevity, and appended text would be the last thing the model reads. Putting the block above the\nbrevity rule leaves \"a single short sentence\" with the recency, so the two compose instead of\ncompeting. A prompt whose tone rules matter should do the same."
4341
- }
4342
- ],
4343
- "exports": [
4344
- {
4345
- "kind": "js",
4346
- "name": "friendlyFallbackAgent",
4347
- "declaration": {
4348
- "name": "friendlyFallbackAgent",
4349
- "module": "src/config/fallback-agents.ts"
4350
- }
4351
- },
4352
- {
4353
- "kind": "js",
4354
- "name": "strictFallbackAgent",
4355
- "declaration": {
4356
- "name": "strictFallbackAgent",
4357
- "module": "src/config/fallback-agents.ts"
4358
- }
4359
- }
4360
- ]
4361
- },
4362
- {
4363
- "kind": "javascript-module",
4364
- "path": "src/config/index.ts",
4365
- "declarations": [],
4366
- "exports": [
4367
- {
4368
- "kind": "js",
4369
- "name": "*",
4370
- "declaration": {
4371
- "name": "*",
4372
- "package": "./config"
4373
- }
4374
- },
4375
- {
4376
- "kind": "js",
4377
- "name": "*",
4378
- "declaration": {
4379
- "name": "*",
4380
- "package": "./fallback-agents"
4381
- }
4382
- }
4383
- ]
4384
- },
4385
- {
4386
- "kind": "javascript-module",
4387
- "path": "src/config/validate-providers.ts",
4388
- "declarations": [],
4389
- "exports": []
4390
- },
4391
4160
  {
4392
4161
  "kind": "javascript-module",
4393
4162
  "path": "src/components/flowing-waves-indicator.ts",
@@ -4912,6 +4681,237 @@
4912
4681
  }
4913
4682
  ]
4914
4683
  },
4684
+ {
4685
+ "kind": "javascript-module",
4686
+ "path": "src/config/config.ts",
4687
+ "declarations": [
4688
+ {
4689
+ "kind": "function",
4690
+ "name": "defineAgent",
4691
+ "description": "Identity helper that infers the narrowest possible type for an agent config,\npreserving string literal types (including `name`) without requiring `as const`.\n\nUse this when you need `typeof myAgent` to carry the literal `name` type —\nfor example, when wiring `ChatToolHandlers<typeof myAgent>`.\n\n```ts\nconst myAgent = defineAgent({ name: 'my_agent', ... });\ntype Handlers = ChatToolHandlers<typeof myAgent>;\n// requestSubAgent name param is now typed as 'my_agent'\n```"
4692
+ }
4693
+ ],
4694
+ "exports": [
4695
+ {
4696
+ "kind": "js",
4697
+ "name": "CachePolicy",
4698
+ "declaration": {
4699
+ "name": "CachePolicy",
4700
+ "module": "src/config/config.ts"
4701
+ }
4702
+ },
4703
+ {
4704
+ "kind": "js",
4705
+ "name": "ChatFallback",
4706
+ "declaration": {
4707
+ "name": "ChatFallback",
4708
+ "module": "src/config/config.ts"
4709
+ }
4710
+ },
4711
+ {
4712
+ "kind": "js",
4713
+ "name": "ChatInputDuringExecutionMode",
4714
+ "declaration": {
4715
+ "name": "ChatInputDuringExecutionMode",
4716
+ "module": "src/config/config.ts"
4717
+ }
4718
+ },
4719
+ {
4720
+ "kind": "js",
4721
+ "name": "ChatThinkingPolicy",
4722
+ "declaration": {
4723
+ "name": "ChatThinkingPolicy",
4724
+ "module": "src/config/config.ts"
4725
+ }
4726
+ },
4727
+ {
4728
+ "kind": "js",
4729
+ "name": "ChatToolChoice",
4730
+ "declaration": {
4731
+ "name": "ChatToolChoice",
4732
+ "module": "src/config/config.ts"
4733
+ }
4734
+ },
4735
+ {
4736
+ "kind": "js",
4737
+ "name": "defineAgent",
4738
+ "declaration": {
4739
+ "name": "defineAgent",
4740
+ "module": "src/config/config.ts"
4741
+ }
4742
+ }
4743
+ ]
4744
+ },
4745
+ {
4746
+ "kind": "javascript-module",
4747
+ "path": "src/config/define-stateful-agent.ts",
4748
+ "declarations": [
4749
+ {
4750
+ "kind": "function",
4751
+ "name": "restoreMachine",
4752
+ "return": {
4753
+ "type": {
4754
+ "text": "void"
4755
+ }
4756
+ },
4757
+ "parameters": [
4758
+ {
4759
+ "name": "machine",
4760
+ "type": {
4761
+ "text": "{ stop: () => void; start: (options?: { state?: unknown }) => void }"
4762
+ },
4763
+ "description": "the machine to restore (already constructed/started)."
4764
+ },
4765
+ {
4766
+ "name": "restored",
4767
+ "type": {
4768
+ "text": "unknown"
4769
+ },
4770
+ "description": "the agent's serialized image (`ctx.restored` in `init`)."
4771
+ },
4772
+ {
4773
+ "name": "key",
4774
+ "default": "'machine'",
4775
+ "description": "the property the machine occupies in the snapshot; defaults to\n`'machine'` to match the conventional `{ machine }` state bag."
4776
+ }
4777
+ ],
4778
+ "description": "Restore a foundation-state-machine instance from a snapshot produced by the\ndefault serializer (or `machine.getPersistedSnapshot()`). Call inside a\nstateful agent's `init` to resume the machine in its exact prior place:\n\n```ts\ninit: ({ restored }) => {\n const machine = new MyMachine();\n restoreMachine(machine, restored); // resume, or no-op on a fresh start\n return { machine };\n}\n```\n\nNo-ops when there is nothing to restore (a fresh session), leaving the\nfreshly-constructed machine in its initial state."
4779
+ },
4780
+ {
4781
+ "kind": "function",
4782
+ "name": "defineStatefulAgent",
4783
+ "return": {
4784
+ "type": {
4785
+ "text": "AgentConfig"
4786
+ }
4787
+ },
4788
+ "parameters": [
4789
+ {
4790
+ "name": "opts",
4791
+ "type": {
4792
+ "text": "StatefulAgentInit<S>"
4793
+ }
4794
+ }
4795
+ ],
4796
+ "description": "Build an `AgentConfig` whose `systemPrompt`, `toolDefinitions`, and tool\nhandlers all close over a long-lived state object created on activation.\n\nThe framework wires the lifecycle: `init` on `onActivate`, `dispose` on\n`onDeactivate`. State is held inside the helper's closure — never exposed on\nthe resulting `AgentConfig` — so the redux serializer doesn't see it."
4797
+ },
4798
+ {
4799
+ "kind": "function",
4800
+ "name": "defineAutopilot",
4801
+ "return": {
4802
+ "type": {
4803
+ "text": "AutopilotConfig<S>"
4804
+ }
4805
+ },
4806
+ "parameters": [
4807
+ {
4808
+ "name": "config",
4809
+ "type": {
4810
+ "text": "AutopilotConfig<S>"
4811
+ }
4812
+ }
4813
+ ],
4814
+ "description": "Define an autopilot for a stateful agent whose state is `S` (GENC-1660). An identity function\nthat exists for its type: the resolvers get `S`, and the result goes on `defineStatefulAgent`'s\n`autopilot` option."
4815
+ }
4816
+ ],
4817
+ "exports": [
4818
+ {
4819
+ "kind": "js",
4820
+ "name": "restoreMachine",
4821
+ "declaration": {
4822
+ "name": "restoreMachine",
4823
+ "module": "src/config/define-stateful-agent.ts"
4824
+ }
4825
+ },
4826
+ {
4827
+ "kind": "js",
4828
+ "name": "defineStatefulAgent",
4829
+ "declaration": {
4830
+ "name": "defineStatefulAgent",
4831
+ "module": "src/config/define-stateful-agent.ts"
4832
+ }
4833
+ },
4834
+ {
4835
+ "kind": "js",
4836
+ "name": "defineAutopilot",
4837
+ "declaration": {
4838
+ "name": "defineAutopilot",
4839
+ "module": "src/config/define-stateful-agent.ts"
4840
+ }
4841
+ }
4842
+ ]
4843
+ },
4844
+ {
4845
+ "kind": "javascript-module",
4846
+ "path": "src/config/fallback-agents.ts",
4847
+ "declarations": [
4848
+ {
4849
+ "kind": "variable",
4850
+ "name": "friendlyFallbackAgent",
4851
+ "type": {
4852
+ "text": "FallbackAgentConfig"
4853
+ },
4854
+ "default": "{\n name: 'Assistant',\n fallback: true,\n systemPrompt: `You are a warm, friendly assistant. For general conversation like \"Hi\" or \"How are you\", you can have a friendly chat. For anything more complex, you cannot directly help, but you can explain what specialists are available. The available specialists are:\\n\\n{{agents}}\\n\\nPolitely let the user know what you can help with and invite them to rephrase their request if it is outside your scope.`,\n}",
4855
+ "description": "A warm, conversational fallback agent. Acknowledges it can't help directly,\nexplains what the available specialists can do, and invites the user to retry.\n\nThe system prompt is generated at runtime by `OrchestratingDriver` from the\nspecialist list — no manual authoring required."
4856
+ },
4857
+ {
4858
+ "kind": "variable",
4859
+ "name": "strictFallbackAgent",
4860
+ "type": {
4861
+ "text": "FallbackAgentConfig"
4862
+ },
4863
+ "default": "{\n name: 'Assistant',\n fallback: true,\n systemPrompt: `You are a concise assistant. The user's request is outside your scope. The available specialists are: {{agents}}.\n\n{{unroutable}}\n\nAnswer in a single short sentence. Do not elaborate.`,\n}",
4864
+ "description": "A brief, professional fallback agent. States what is available without\nelaboration. The `{{agents}}` placeholder is replaced at runtime by\n`OrchestratingDriver` with the generated specialist list.\n\nThe `{{unroutable}}` placeholder positions `UNROUTABLE_INSTRUCTION` — the framework's\ninstruction for a substantive request no specialist covers, which is otherwise APPENDED to a\nstring-form prompt. Positioned rather than appended for one reason: this preset's whole point is\nbrevity, and appended text would be the last thing the model reads. Putting the block above the\nbrevity rule leaves \"a single short sentence\" with the recency, so the two compose instead of\ncompeting. A prompt whose tone rules matter should do the same."
4865
+ }
4866
+ ],
4867
+ "exports": [
4868
+ {
4869
+ "kind": "js",
4870
+ "name": "friendlyFallbackAgent",
4871
+ "declaration": {
4872
+ "name": "friendlyFallbackAgent",
4873
+ "module": "src/config/fallback-agents.ts"
4874
+ }
4875
+ },
4876
+ {
4877
+ "kind": "js",
4878
+ "name": "strictFallbackAgent",
4879
+ "declaration": {
4880
+ "name": "strictFallbackAgent",
4881
+ "module": "src/config/fallback-agents.ts"
4882
+ }
4883
+ }
4884
+ ]
4885
+ },
4886
+ {
4887
+ "kind": "javascript-module",
4888
+ "path": "src/config/index.ts",
4889
+ "declarations": [],
4890
+ "exports": [
4891
+ {
4892
+ "kind": "js",
4893
+ "name": "*",
4894
+ "declaration": {
4895
+ "name": "*",
4896
+ "package": "./config"
4897
+ }
4898
+ },
4899
+ {
4900
+ "kind": "js",
4901
+ "name": "*",
4902
+ "declaration": {
4903
+ "name": "*",
4904
+ "package": "./fallback-agents"
4905
+ }
4906
+ }
4907
+ ]
4908
+ },
4909
+ {
4910
+ "kind": "javascript-module",
4911
+ "path": "src/config/validate-providers.ts",
4912
+ "declarations": [],
4913
+ "exports": []
4914
+ },
4915
4915
  {
4916
4916
  "kind": "javascript-module",
4917
4917
  "path": "src/genesis/calendar.ts",
@@ -1 +1 @@
1
- {"version":3,"file":"orchestrating-driver.d.ts","sourceRoot":"","sources":["../../../../src/components/orchestrating-driver/orchestrating-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,WAAW,EAEZ,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EACV,WAAW,EAMZ,MAAM,qBAAqB,CAAC;AAI7B,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,+BAA+B,CAAC;AAKvC,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClG,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EACL,UAAU,EACV,KAAK,0BAA0B,EAEhC,MAAM,4BAA4B,CAAC;AAkBpC;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,eAAe;AACzB,kDAAkD;AAChD,YAAY;AACd,6EAA6E;GAC3E,UAAU;AACZ;;;;;GAKG;GACD,kBAAkB;AACpB,+DAA+D;GAC7D,kBAAkB;AACpB,kDAAkD;GAChD,gBAAgB;AAClB,kFAAkF;GAChF,sBAAsB;AACxB,oEAAoE;GAClE,mBAAmB;AACrB,0EAA0E;GACxE,QAAQ,CAAC;AAwEb;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,mBAAmB,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,sBAAsB,ijBAIyH,CAAC;AAuB7J;;;;;;;;;;;;GAYG;AACH,qBAAa,mBAAoB,SAAQ,mBAA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G,mBAAmB,GAAG,SAAS,CAKjF"}
1
+ {"version":3,"file":"orchestrating-driver.d.ts","sourceRoot":"","sources":["../../../../src/components/orchestrating-driver/orchestrating-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,WAAW,EAEZ,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EACV,WAAW,EAMZ,MAAM,qBAAqB,CAAC;AAI7B,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,+BAA+B,CAAC;AAKvC,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClG,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EACL,UAAU,EACV,KAAK,0BAA0B,EAEhC,MAAM,4BAA4B,CAAC;AAkBpC;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,eAAe;AACzB,kDAAkD;AAChD,YAAY;AACd,6EAA6E;GAC3E,UAAU;AACZ;;;;;GAKG;GACD,kBAAkB;AACpB,+DAA+D;GAC7D,kBAAkB;AACpB,kDAAkD;GAChD,gBAAgB;AAClB,kFAAkF;GAChF,sBAAsB;AACxB,oEAAoE;GAClE,mBAAmB;AACrB,0EAA0E;GACxE,QAAQ,CAAC;AAwEb;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,mBAAmB,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,sBAAsB,ijBAIyH,CAAC;AA0C7J;;;;;;;;;;;;GAYG;AACH,qBAAa,mBAAoB,SAAQ,mBAAmB,CAAC,UAAU,CAAC;IAoDpE,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,MAAM;IApDzB,uDAAu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ot directly help with the user's request, but the following specialists are available:\n\n${agentList}\n\nPolitely let the user know what you can help with and invite them to rephrase their request.\n\n${UNROUTABLE_INSTRUCTION}`;
145
145
  }
146
+ /**
147
+ * The note a handoff's continuation ends on, so the request closes on a user turn (see the call in
148
+ * `runOrchestratedTurn`).
149
+ *
150
+ * The fallback's note names no work, because its routing note already says the work is nobody's
151
+ * here, and the same work restated last would read as a work order — the shape that drew blank
152
+ * turns from it (GENC-1573). A specialist gets what remains or, when the agent handing off did not
153
+ * say, the user's request, which is also what the re-classify routed on.
154
+ */
155
+ function handoffTailNote(agent, remainingTask) {
156
+ if (isFallback(agent)) {
157
+ return '[Hand-off]: no specialist here can take on what remains. Reply to the user now, as the routing note says.';
158
+ }
159
+ const work = remainingTask === null || remainingTask === void 0 ? void 0 : remainingTask.trim();
160
+ return work
161
+ ? `[Hand-off]: the previous agent passed the rest of this request to you. What remains: ${work}`
162
+ : "[Hand-off]: the previous agent passed the rest of this request to you without saying what remains. Carry on with the user's request above.";
163
+ }
146
164
  /**
147
165
  * Orchestrates multiple specialist agents. Sits between `FoundationAiAssistant`
148
166
  * and `ChatDriver`, classifying each user message and routing it to the right
@@ -308,6 +326,10 @@ export class OrchestratingDriver extends BaseDriverDecorator {
308
326
  this.dispatchEvent(new CustomEvent('history-updated', {
309
327
  detail: [...history, Object.assign({ role: 'user', content: input, attachments }, delegated)],
310
328
  }));
329
+ // What the turn is routed on — and routed on again after a handoff that names no remaining task.
330
+ const routingInput = delegated.delegate
331
+ ? frameDelegatedContent(input, delegated.delegateFraming)
332
+ : input;
311
333
  const pinned = this.resolvePinnedAgent();
312
334
  if (!pinned)
313
335
  this.dispatchEvent(new CustomEvent('orchestrating-start'));
@@ -320,7 +342,7 @@ export class OrchestratingDriver extends BaseDriverDecorator {
320
342
  routed = { agent: pinned, decision: 'pinned' };
321
343
  }
322
344
  else {
323
- routed = yield this.classify(delegated.delegate ? frameDelegatedContent(input, delegated.delegateFraming) : input, history, this.activeAgent);
345
+ routed = yield this.classify(routingInput, history, this.activeAgent);
324
346
  }
325
347
  let currentAgent = routed.agent;
326
348
  let isHandoff = false;
@@ -381,8 +403,18 @@ export class OrchestratingDriver extends BaseDriverDecorator {
381
403
  'yourself, and do not return an empty response.',
382
404
  });
383
405
  }
406
+ // The primer LEADS the request, and the history after it closes on the previous agent's
407
+ // turn: its `request_continuation` call, flattened to assistant prose for an agent that did
408
+ // not make it (`transformHistoryForAgent`). A request ending on an assistant turn is a
409
+ // prefill, which Anthropic refuses outright: a handoff on Claude ended in "Sorry, something
410
+ // went wrong" unless the agent reached had a tail context of its own, and Gemini, which
411
+ // tolerates it, never showed it. The tail note lands after the history as a user turn. It
412
+ // rides the first model call only, so the primer stays where it is: it has to outlast that
413
+ // call, for the whole tool loop.
384
414
  // oxlint-disable-next-line no-await-in-loop
385
- result = yield this.chatDriver.continueFromHistory(contextPrimer);
415
+ result = yield this.chatDriver.continueFromHistory(contextPrimer, {
416
+ tailNote: handoffTailNote(currentAgent, remainingTask),
417
+ });
386
418
  }
387
419
  else {
388
420
  // From here the inner driver owns the user message — it appends it as
@@ -426,8 +458,13 @@ export class OrchestratingDriver extends BaseDriverDecorator {
426
458
  }
427
459
  const updatedHistory = this.chatDriver.getHistory();
428
460
  this.dispatchEvent(new CustomEvent('orchestrating-start'));
461
+ // The tool schema requires `remaining_task`, but nothing holds a model to `required`: Claude
462
+ // handed off with a `summary` alone, and an empty task is a classifier request with no
463
+ // message in it, which Anthropic refuses — on every attempt, so the turn fell to the fallback
464
+ // as `classifier-failed`. Route on the request the turn began with instead. The agent that
465
+ // just declined it is off the ballot, so the question put is the right one: who else.
429
466
  // oxlint-disable-next-line no-await-in-loop
430
- routed = yield this.classify(remainingTask, updatedHistory, undefined, attempted);
467
+ routed = yield this.classify((remainingTask === null || remainingTask === void 0 ? void 0 : remainingTask.trim()) || routingInput, updatedHistory, undefined, attempted);
431
468
  currentAgent = routed.agent;
432
469
  }
433
470
  // The orchestrated turn reports the outcome of the agent turn that ENDED it.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/ai-assistant",
3
3
  "description": "Genesis AI Assistant micro-frontend",
4
- "version": "15.78.1",
4
+ "version": "15.79.0",
5
5
  "license": "SEE LICENSE IN license.txt",
6
6
  "main": "dist/esm/index.js",
7
7
  "types": "dist/ai-assistant.d.ts",
@@ -92,31 +92,31 @@
92
92
  }
93
93
  },
94
94
  "devDependencies": {
95
- "@genesislcap/foundation-comms": "15.78.1",
96
- "@genesislcap/foundation-testing": "15.78.1",
97
- "@genesislcap/genx": "15.78.1",
98
- "@genesislcap/ts-builder": "15.78.1",
99
- "@genesislcap/uvu-playwright-builder": "15.78.1",
100
- "@genesislcap/vite-builder": "15.78.1",
101
- "@genesislcap/webpack-builder": "15.78.1",
95
+ "@genesislcap/foundation-comms": "15.79.0",
96
+ "@genesislcap/foundation-testing": "15.79.0",
97
+ "@genesislcap/genx": "15.79.0",
98
+ "@genesislcap/ts-builder": "15.79.0",
99
+ "@genesislcap/uvu-playwright-builder": "15.79.0",
100
+ "@genesislcap/vite-builder": "15.79.0",
101
+ "@genesislcap/webpack-builder": "15.79.0",
102
102
  "@types/dompurify": "^3.0.5",
103
103
  "@types/marked": "^5.0.2",
104
104
  "esbuild": "0.25.12"
105
105
  },
106
106
  "dependencies": {
107
- "@genesislcap/foundation-ai": "15.78.1",
108
- "@genesislcap/foundation-logger": "15.78.1",
109
- "@genesislcap/foundation-notifications": "15.78.1",
110
- "@genesislcap/foundation-redux": "15.78.1",
111
- "@genesislcap/foundation-ui": "15.78.1",
112
- "@genesislcap/foundation-utils": "15.78.1",
113
- "@genesislcap/rapid-design-system": "15.78.1",
114
- "@genesislcap/web-core": "15.78.1",
107
+ "@genesislcap/foundation-ai": "15.79.0",
108
+ "@genesislcap/foundation-logger": "15.79.0",
109
+ "@genesislcap/foundation-notifications": "15.79.0",
110
+ "@genesislcap/foundation-redux": "15.79.0",
111
+ "@genesislcap/foundation-ui": "15.79.0",
112
+ "@genesislcap/foundation-utils": "15.79.0",
113
+ "@genesislcap/rapid-design-system": "15.79.0",
114
+ "@genesislcap/web-core": "15.79.0",
115
115
  "dompurify": "^3.3.1",
116
116
  "marked": "^17.0.3"
117
117
  },
118
118
  "peerDependencies": {
119
- "@genesislcap/foundation-comms": "^15.78.1"
119
+ "@genesislcap/foundation-comms": "^15.79.0"
120
120
  },
121
121
  "peerDependenciesMeta": {
122
122
  "@genesislcap/foundation-comms": {