effect-assistant 0.11.1 → 0.13.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.
Files changed (80) hide show
  1. package/dist/Assistant.d.ts +49 -4
  2. package/dist/Assistant.d.ts.map +1 -1
  3. package/dist/Assistant.js +33 -3
  4. package/dist/Assistant.js.map +1 -1
  5. package/dist/AssistantEngine.d.ts +6 -2
  6. package/dist/AssistantEngine.d.ts.map +1 -1
  7. package/dist/AssistantEngine.js +18 -10
  8. package/dist/AssistantEngine.js.map +1 -1
  9. package/dist/AssistantLoop.js +1 -1
  10. package/dist/AssistantTest.js +1 -1
  11. package/dist/BlockKit.js +1 -1
  12. package/dist/ChatSignal.d.ts +58 -0
  13. package/dist/ChatSignal.d.ts.map +1 -0
  14. package/dist/ChatSignal.js +73 -0
  15. package/dist/ChatSignal.js.map +1 -0
  16. package/dist/Compaction.js +2 -2
  17. package/dist/Memory.js +1 -1
  18. package/dist/Specialist.d.ts.map +1 -1
  19. package/dist/Specialist.js +2 -1
  20. package/dist/Specialist.js.map +1 -1
  21. package/dist/StatusSummary.d.ts +70 -0
  22. package/dist/StatusSummary.d.ts.map +1 -0
  23. package/dist/StatusSummary.js +84 -0
  24. package/dist/StatusSummary.js.map +1 -0
  25. package/dist/Timeline.d.ts +10 -2
  26. package/dist/Timeline.d.ts.map +1 -1
  27. package/dist/Timeline.js +74 -20
  28. package/dist/Timeline.js.map +1 -1
  29. package/dist/ToolStatus.d.ts +72 -0
  30. package/dist/ToolStatus.d.ts.map +1 -0
  31. package/dist/ToolStatus.js +71 -0
  32. package/dist/ToolStatus.js.map +1 -0
  33. package/dist/index.d.ts +4 -1
  34. package/dist/index.js +4 -1
  35. package/dist/internal/chat.js +19 -10
  36. package/dist/internal/chat.js.map +1 -1
  37. package/dist/internal/events.d.ts +1 -1
  38. package/dist/internal/events.js +1 -1
  39. package/dist/internal/history.js +1 -1
  40. package/dist/internal/live.js +87 -0
  41. package/dist/internal/live.js.map +1 -0
  42. package/dist/internal/loop.d.ts +1 -1
  43. package/dist/internal/loop.d.ts.map +1 -1
  44. package/dist/internal/loop.js +44 -13
  45. package/dist/internal/loop.js.map +1 -1
  46. package/dist/internal/schema.js +1 -1
  47. package/dist/internal/specialists.js +4 -3
  48. package/dist/internal/specialists.js.map +1 -1
  49. package/dist/internal/stream.js +72 -0
  50. package/dist/internal/stream.js.map +1 -0
  51. package/dist/internal/summary.js +65 -0
  52. package/dist/internal/summary.js.map +1 -0
  53. package/dist/internal/telemetry.js +16 -5
  54. package/dist/internal/telemetry.js.map +1 -1
  55. package/dist/internal/toolkit.js +1 -1
  56. package/dist/internal/tools.js +1 -1
  57. package/dist/internal/turns.d.ts +5 -0
  58. package/dist/internal/turns.d.ts.map +1 -1
  59. package/dist/internal/turns.js +18 -7
  60. package/dist/internal/turns.js.map +1 -1
  61. package/dist/internal/writer.d.ts +2 -0
  62. package/dist/internal/writer.d.ts.map +1 -1
  63. package/package.json +1 -1
  64. package/src/Assistant.ts +77 -13
  65. package/src/AssistantEngine.ts +25 -11
  66. package/src/ChatSignal.ts +71 -0
  67. package/src/Specialist.ts +5 -1
  68. package/src/StatusSummary.ts +126 -0
  69. package/src/Timeline.ts +82 -20
  70. package/src/ToolStatus.ts +90 -0
  71. package/src/index.ts +15 -0
  72. package/src/internal/chat.ts +41 -21
  73. package/src/internal/live.ts +133 -0
  74. package/src/internal/loop.ts +104 -25
  75. package/src/internal/specialists.ts +6 -0
  76. package/src/internal/stream.ts +98 -0
  77. package/src/internal/summary.ts +123 -0
  78. package/src/internal/telemetry.ts +25 -2
  79. package/src/internal/turns.ts +27 -3
  80. package/src/internal/writer.ts +3 -0
@@ -0,0 +1,58 @@
1
+ import * as Schema from "effect/Schema";
2
+ declare namespace ChatSignal_d_exports {
3
+ export { ChatSignal, Status, TypingStarted, TypingStopped, isChatSignal };
4
+ }
5
+ declare const Status_base: Schema.Class<Status, Schema.TaggedStruct<"Status", {
6
+ readonly text: Schema.String;
7
+ }>, {}>;
8
+ /**
9
+ * Represents the line the chat shows next to the assistant while a turn works, like "Checking
10
+ * last summer's campaign budget". The latest one shows until the next, until the model starts
11
+ * writing to the user, or until the turn ends.
12
+ *
13
+ * @category schemas
14
+ * @since 0.13.0
15
+ */
16
+ export declare class Status extends Status_base {}
17
+ declare const TypingStarted_base: Schema.Class<TypingStarted, Schema.TaggedStruct<"TypingStarted", {}>, {}>;
18
+ /**
19
+ * Represents the model starting to write a message to the user. The status line goes: the user
20
+ * sees the message coming instead.
21
+ *
22
+ * @category schemas
23
+ * @since 0.13.0
24
+ */
25
+ export declare class TypingStarted extends TypingStarted_base {}
26
+ declare const TypingStopped_base: Schema.Class<TypingStopped, Schema.TaggedStruct<"TypingStopped", {}>, {}>;
27
+ /**
28
+ * Represents the end of the typing: the message is in the chat's log, or the model wrote none.
29
+ *
30
+ * @category schemas
31
+ * @since 0.13.0
32
+ */
33
+ export declare class TypingStopped extends TypingStopped_base {}
34
+ /**
35
+ * Schema for any of a chat's signals.
36
+ *
37
+ * @category schemas
38
+ * @since 0.13.0
39
+ */
40
+ export declare const ChatSignal: Schema.Union<readonly [typeof Status, typeof TypingStarted, typeof TypingStopped]>;
41
+ /**
42
+ * Represents any of a chat's signals.
43
+ *
44
+ * @category models
45
+ * @since 0.13.0
46
+ */
47
+ export type ChatSignal = typeof ChatSignal.Type;
48
+ /**
49
+ * Returns whether a value is one of a chat's signals, such as an item of a live subscription that
50
+ * isn't an entry.
51
+ *
52
+ * @category guards
53
+ * @since 0.13.0
54
+ */
55
+ export declare const isChatSignal: (u: unknown) => u is ChatSignal;
56
+ //#endregion
57
+ export { ChatSignal_d_exports };
58
+ //# sourceMappingURL=ChatSignal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatSignal.d.ts","names":[],"sources":["../src/ChatSignal.ts"],"mappings":";;;;;;;;;;;;;;;qBA0Ba,eAAe;;;;;;;;;qBAWf,sBAAsB;;;;;;;;qBAQtB,sBAAsB;;;;;;;qBAQtB,YAAU,OAAA,uBAAA,eAAA,sBAAA;;;;;;;YAQX,oBAAoB,WAAW;;;;;;;;qBAS9B,eAAe,eAAe,KAAK"}
@@ -0,0 +1,73 @@
1
+ import { __exportAll } from "./_virtual/_rolldown/runtime.js";
2
+ import * as Schema from "effect/Schema";
3
+ //#region src/ChatSignal.ts
4
+ /**
5
+ * This module provides the signals a chat sends its live subscribers while a turn works: a short
6
+ * status of what the assistant is doing, and whether it is writing a message to the user.
7
+ *
8
+ * Signals are never stored. They reach only the subscribers that are listening when they are sent
9
+ * (`assistant.subscribe(chatId, { live: true })`), between the chat's entries and in order with
10
+ * them. A turn's model never reads them, compaction never sees them, and a client that loads the
11
+ * chat again starts without them. The turn itself shows in the log, from its `TurnStarted` to its
12
+ * `TurnCompleted` or `TurnFailed`.
13
+ *
14
+ * There is no signal that clears a status: the next one replaces it, typing hides it, and the
15
+ * turn's end clears it. Typing stops before the turn ends, also when it fails, so neither
16
+ * outlives its turn.
17
+ *
18
+ * @since 0.13.0
19
+ */
20
+ var ChatSignal_exports = /* @__PURE__ */ __exportAll({
21
+ ChatSignal: () => ChatSignal,
22
+ Status: () => Status,
23
+ TypingStarted: () => TypingStarted,
24
+ TypingStopped: () => TypingStopped,
25
+ isChatSignal: () => isChatSignal
26
+ });
27
+ /**
28
+ * Represents the line the chat shows next to the assistant while a turn works, like "Checking
29
+ * last summer's campaign budget". The latest one shows until the next, until the model starts
30
+ * writing to the user, or until the turn ends.
31
+ *
32
+ * @category schemas
33
+ * @since 0.13.0
34
+ */
35
+ var Status = class extends Schema.TaggedClass()("Status", { text: Schema.String }) {};
36
+ /**
37
+ * Represents the model starting to write a message to the user. The status line goes: the user
38
+ * sees the message coming instead.
39
+ *
40
+ * @category schemas
41
+ * @since 0.13.0
42
+ */
43
+ var TypingStarted = class extends Schema.TaggedClass()("TypingStarted", {}) {};
44
+ /**
45
+ * Represents the end of the typing: the message is in the chat's log, or the model wrote none.
46
+ *
47
+ * @category schemas
48
+ * @since 0.13.0
49
+ */
50
+ var TypingStopped = class extends Schema.TaggedClass()("TypingStopped", {}) {};
51
+ /**
52
+ * Schema for any of a chat's signals.
53
+ *
54
+ * @category schemas
55
+ * @since 0.13.0
56
+ */
57
+ const ChatSignal = Schema.Union([
58
+ Status,
59
+ TypingStarted,
60
+ TypingStopped
61
+ ]);
62
+ /**
63
+ * Returns whether a value is one of a chat's signals, such as an item of a live subscription that
64
+ * isn't an entry.
65
+ *
66
+ * @category guards
67
+ * @since 0.13.0
68
+ */
69
+ const isChatSignal = Schema.is(ChatSignal);
70
+ //#endregion
71
+ export { ChatSignal, ChatSignal_exports, Status, TypingStarted, TypingStopped, isChatSignal };
72
+
73
+ //# sourceMappingURL=ChatSignal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatSignal.js","names":[],"sources":["../src/ChatSignal.ts"],"sourcesContent":["/**\n * This module provides the signals a chat sends its live subscribers while a turn works: a short\n * status of what the assistant is doing, and whether it is writing a message to the user.\n *\n * Signals are never stored. They reach only the subscribers that are listening when they are sent\n * (`assistant.subscribe(chatId, { live: true })`), between the chat's entries and in order with\n * them. A turn's model never reads them, compaction never sees them, and a client that loads the\n * chat again starts without them. The turn itself shows in the log, from its `TurnStarted` to its\n * `TurnCompleted` or `TurnFailed`.\n *\n * There is no signal that clears a status: the next one replaces it, typing hides it, and the\n * turn's end clears it. Typing stops before the turn ends, also when it fails, so neither\n * outlives its turn.\n *\n * @since 0.13.0\n */\nimport * as Schema from \"effect/Schema\"\n\n/**\n * Represents the line the chat shows next to the assistant while a turn works, like \"Checking\n * last summer's campaign budget\". The latest one shows until the next, until the model starts\n * writing to the user, or until the turn ends.\n *\n * @category schemas\n * @since 0.13.0\n */\nexport class Status extends Schema.TaggedClass<Status>()(\"Status\", {\n text: Schema.String\n}) {}\n\n/**\n * Represents the model starting to write a message to the user. The status line goes: the user\n * sees the message coming instead.\n *\n * @category schemas\n * @since 0.13.0\n */\nexport class TypingStarted extends Schema.TaggedClass<TypingStarted>()(\"TypingStarted\", {}) {}\n\n/**\n * Represents the end of the typing: the message is in the chat's log, or the model wrote none.\n *\n * @category schemas\n * @since 0.13.0\n */\nexport class TypingStopped extends Schema.TaggedClass<TypingStopped>()(\"TypingStopped\", {}) {}\n\n/**\n * Schema for any of a chat's signals.\n *\n * @category schemas\n * @since 0.13.0\n */\nexport const ChatSignal = Schema.Union([Status, TypingStarted, TypingStopped])\n\n/**\n * Represents any of a chat's signals.\n *\n * @category models\n * @since 0.13.0\n */\nexport type ChatSignal = typeof ChatSignal.Type\n\n/**\n * Returns whether a value is one of a chat's signals, such as an item of a live subscription that\n * isn't an entry.\n *\n * @category guards\n * @since 0.13.0\n */\nexport const isChatSignal: (u: unknown) => u is ChatSignal = Schema.is(ChatSignal)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAa,SAAb,cAA4B,OAAO,YAAoB,CAAC,CAAC,UAAU,EACjE,MAAM,OAAO,OACf,CAAC,CAAC,CAAC,CAAC;;;;;;;;AASJ,IAAa,gBAAb,cAAmC,OAAO,YAA2B,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;;;;;;;AAQ7F,IAAa,gBAAb,cAAmC,OAAO,YAA2B,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;;;;;;;AAQ7F,MAAa,aAAa,OAAO,MAAM;CAAC;CAAQ;CAAe;AAAa,CAAC;;;;;;;;AAiB7E,MAAa,eAAgD,OAAO,GAAG,UAAU"}
@@ -1,12 +1,12 @@
1
1
  import { __exportAll } from "./_virtual/_rolldown/runtime.js";
2
2
  import { attachmentLine, isLibraryEvent } from "./AssistantEvent.js";
3
- import { fromEntries } from "./ToolApproval.js";
4
3
  import { toJsonText } from "./internal/schema.js";
4
+ import { fromEntries } from "./ToolApproval.js";
5
5
  import { userText } from "./internal/history.js";
6
6
  import { fromEntries as fromEntries$1 } from "./BlockKit.js";
7
7
  import { fromEntries as fromEntries$2 } from "./AssistantActivity.js";
8
- import * as Predicate from "effect/Predicate";
9
8
  import * as Option from "effect/Option";
9
+ import * as Predicate from "effect/Predicate";
10
10
  //#region src/Compaction.ts
11
11
  var Compaction_exports = /* @__PURE__ */ __exportAll({
12
12
  attachedFiles: () => attachedFiles,
package/dist/Memory.js CHANGED
@@ -5,8 +5,8 @@ import { ToolFailure, fail } from "./ToolFailure.js";
5
5
  import * as Context from "effect/Context";
6
6
  import * as Effect from "effect/Effect";
7
7
  import * as Layer from "effect/Layer";
8
- import * as Schema from "effect/Schema";
9
8
  import * as Option from "effect/Option";
9
+ import * as Schema from "effect/Schema";
10
10
  import * as Clock from "effect/Clock";
11
11
  import * as Ref from "effect/Ref";
12
12
  import * as Tool from "effect/ai/Tool";
@@ -1 +1 @@
1
- {"version":3,"file":"Specialist.d.ts","names":[],"sources":["../src/Specialist.ts"],"mappings":";;;;;;;;;;;;;;;;;;;cA0BM;;;;;;;iBAQW,WAAW;YAChB,gBAAgB;WACjB,MAAM;;WAEN;;WAEA,SAAS,QAAQ,IAAI,kBAAkB,OAAO;;;;;WAK9C,UAAU,WAAW,YAAY,WAAW,YACnD,QAAQ,QAAQ,GAAG,MAAM,OAAO,OAAO,QAAQ,GAAG,KAAK,GAAG,OACxD,cAAc,QAAQ,IAAI,IAAI,eAAe,KAAK,KAAK,sBACtD,MAAM,MAAM,kBAAkB,cAAc,QAAQ,IAAI,MAAM,QAAQ,eAAe,aAAa,IAAI;;;;;;;;;;;;;;YAejG,cAAc,eAAe;WAG1B;aACE;aACA,UAAU;;;;;;;;;;;;YAaf,aAAa,KAAK,QAAQ,GAAG,KAAK;;;;;;;YAQlC,MAAM;;;;;;;iBAQD,kBAAkB;WACxB,oBAAoB;;;;;;;;YASnB,UAAU,KAAK,UAAU,iBAAiB,QAAQ,kBAAkB;;;;;;;;YASpE,eAAe,cAAc,SAAS,cAAc;;;;;;;iBAQ/C,WAAW,UAAU,eAAe,KAAK,OAAO;WACtD,uBAAuB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AR5C,eAAe"}
@@ -1,4 +1,5 @@
1
1
  import { __exportAll } from "./_virtual/_rolldown/runtime.js";
2
+ import { withoutTracing } from "./internal/telemetry.js";
2
3
  import * as Context from "effect/Context";
3
4
  import * as Effect from "effect/Effect";
4
5
  import * as Layer from "effect/Layer";
@@ -54,7 +55,7 @@ const make = (name, options) => {
54
55
  const Handler = Context.Service(`effect-assistant/Specialist/${name}`);
55
56
  function toLayer(build) {
56
57
  return Layer.effect(Handler, Effect.gen(function* () {
57
- const context = yield* Effect.context().pipe(Effect.map(Context.omit(Scope.Scope)));
58
+ const context = yield* Effect.context().pipe(Effect.map(Context.omit(Scope.Scope)), Effect.map(withoutTracing));
58
59
  return { open: Effect.gen(function* () {
59
60
  const handler = Effect.isEffect(build) ? yield* build : build;
60
61
  return (turn) => Stream.provide(toStream(handler(turn)), context);
@@ -1 +1 @@
1
- {"version":3,"file":"Specialist.js","names":[],"sources":["../src/Specialist.ts"],"sourcesContent":["/**\n * Defines specialists, which are focused agents an assistant hands work to in the background.\n *\n * A specialist has a definition, created with {@link make}, that gives its name and when to use\n * it, and a handler, provided with its `toLayer`, that works on a {@link Brief} as a loop. The\n * {@link Runner} service starts, steers, and stops a chat's specialist runs.\n *\n * @since 0.1.0\n */\nimport type * as AiError from \"effect/ai/AiError\"\nimport type * as LanguageModel from \"effect/ai/LanguageModel\"\nimport type * as Prompt from \"effect/ai/Prompt\"\nimport type * as Tool from \"effect/ai/Tool\"\nimport type * as Toolkit from \"effect/ai/Toolkit\"\nimport * as Context from \"effect/Context\"\nimport * as Effect from \"effect/Effect\"\nimport * as Layer from \"effect/Layer\"\nimport * as Schema from \"effect/Schema\"\nimport * as Scope from \"effect/Scope\"\nimport * as Stream from \"effect/Stream\"\nimport type * as AssistantLoop from \"./AssistantLoop.ts\"\nimport type { ChatId } from \"./ChatId.ts\"\nimport type { CurrentChat } from \"./CurrentChat.ts\"\nimport type * as Instructions from \"./Instructions.ts\"\nimport type { RunId } from \"./RunId.ts\"\n\nconst TypeId = \"~effect-assistant/Specialist\"\n\n/**\n * Represents a specialist's definition.\n *\n * @category models\n * @since 0.1.0\n */\nexport interface Specialist<Name extends string = string> {\n readonly [TypeId]: typeof TypeId\n readonly name: Name\n /** When to use the specialist. The assistant sees this. */\n readonly description: string\n /** The key of the specialist's handler, as `toLayer` provides it. */\n readonly Handler: Context.Key<SpecialistHandler<Name>, Built>\n /**\n * Provides the specialist's handler. The handler may use the {@link TurnServices} and the\n * services its build Effect required (see {@link CheckServices}).\n */\n readonly toLayer: <R = never, RE = never, E = never, RX = never>(\n build: (Handler<R, RE> | Effect.Effect<Handler<R, RE>, E, RX>) &\n CheckServices<Exclude<R | RE, TurnServices | RX | Tool.Handler<string>>>\n ) => Layer.Layer<SpecialistHandler<Name>, never, Exclude<RX, Scope.Scope | CurrentChat> | ToolHandlers<R | RE>>\n}\n\n/**\n * Represents the check `toLayer` applies to the services a handler uses.\n *\n * **Details**\n *\n * Every service a handler uses must be one the run (or turn) provides, or one its build Effect\n * required, which the layer provides. A handler that uses any other service gets this type\n * error, which names those services.\n *\n * @category utility types\n * @since 0.1.0\n */\nexport type CheckServices<Undeclared> = [Undeclared] extends [never]\n ? unknown\n : {\n readonly \"~undeclaredServices\": {\n readonly error: \"The handler uses services that neither the turn provides nor its build Effect requires\"\n readonly services: Undeclared\n }\n }\n\n/**\n * Extracts the tool handlers (`Toolkit.toLayer`) that a handler's loop uses.\n *\n * They are requirements of the layer, so `Layer.provide(MyToolsLive)` provides them, and a\n * missing one is a type error.\n *\n * @category utility types\n * @since 0.1.0\n */\nexport type ToolHandlers<R> = Extract<R, Tool.Handler<string>>\n\n/**\n * Represents any specialist.\n *\n * @category utility types\n * @since 0.1.0\n */\nexport type Any = Specialist<any>\n\n/**\n * Identifies a specialist's handler in a context.\n *\n * @category models\n * @since 0.1.0\n */\nexport interface SpecialistHandler<Name extends string> {\n readonly _SpecialistHandler: Name\n}\n\n/**\n * Extracts the handlers that these specialists need.\n *\n * @category utility types\n * @since 0.1.0\n */\nexport type HandlerOf<S> = S extends Specialist<infer Name> ? SpecialistHandler<Name> : never\n\n/**\n * The services a turn provides to its handler, which are its chat, the chat's runner, and the\n * model.\n *\n * @category utility types\n * @since 0.1.0\n */\nexport type TurnServices = CurrentChat | Runner | LanguageModel.LanguageModel\n\n/**\n * Represents the options for `turn.run`.\n *\n * @category models\n * @since 0.1.0\n */\nexport interface RunOptions<T extends Record<string, Tool.Any> = Record<never, never>> {\n readonly instructions: string | Instructions.Resolved\n /**\n * The loop's tools, as a native toolkit whose handlers come from the layer. Merge in a\n * `Skill.toolkit(...)` for playbooks.\n */\n readonly toolkit?: Toolkit.Toolkit<T> | undefined\n /** The model calls allowed per brief. Defaults to 8. */\n readonly maxSteps?: number | undefined\n}\n\n/**\n * Represents one turn of a specialist's run, as its handler sees it. The first turn works on the\n * brief, and each later one on the messages sent to the run since (follow-ups and steering).\n *\n * @category models\n * @since 0.1.0\n */\nexport interface Turn {\n readonly runId: RunId\n /** The chat the run belongs to, which is the chat of the turn that spawned it. */\n readonly chatId: ChatId\n readonly brief: Brief\n /**\n * The run's history, with the brief, what the run did so far, and the messages sent to it since\n * (follow-ups and steering). Read it before every model call, as the loop does.\n */\n readonly history: Effect.Effect<ReadonlyArray<Prompt.Message>>\n /** Runs the agent loop over the run's history, with the given instructions and tools. */\n readonly run: <T extends Record<string, Tool.Any> = Record<never, never>>(\n options: RunOptions<T>\n ) => Stream.Stream<\n AssistantLoop.Event,\n AiError.AiError,\n LanguageModel.LanguageModel | AssistantLoop.ToolkitServices<T>\n >\n}\n\n/**\n * Represents a specialist's handler, which works on a brief and returns a stream of what the loop\n * did.\n *\n * It may return the stream from an Effect. `R` is the services the stream needs, and `RE` the\n * services the Effect needs.\n *\n * @category models\n * @since 0.1.0\n */\nexport type Handler<R = never, RE = R> = (\n turn: Turn\n) =>\n | Stream.Stream<AssistantLoop.Event, unknown, R>\n | Effect.Effect<Stream.Stream<AssistantLoop.Event, unknown, R>, unknown, RE>\n\n/**\n * Represents a specialist's handler as its layer provides it.\n *\n * `open` runs the build for a chat (once per chat activation, see `CurrentChat`) and returns\n * the handler with the layer's services already provided.\n *\n * @category models\n * @since 0.1.0\n */\nexport interface Built {\n readonly open: Effect.Effect<\n (turn: Turn) => Stream.Stream<AssistantLoop.Event, unknown, TurnServices>,\n never,\n Scope.Scope | CurrentChat\n >\n}\n\nconst toStream = <R, RE>(\n result:\n | Stream.Stream<AssistantLoop.Event, unknown, R>\n | Effect.Effect<Stream.Stream<AssistantLoop.Event, unknown, R>, unknown, RE>\n): Stream.Stream<AssistantLoop.Event, unknown, R | RE> => (Effect.isEffect(result) ? Stream.unwrap(result) : result)\n\n/**\n * Creates a specialist from its name and a description of when to use it.\n *\n * **Details**\n *\n * The specialist's `toLayer` provides its handler, which is usually `turn.run` with the\n * specialist's own instructions and tools. List the specialist in `Assistant.make`'s\n * `specialists`, and provide its layer to the assistant's.\n *\n * **Example** (Defining a research specialist)\n *\n * ```ts\n * import { Assistant, Specialist } from \"effect-assistant\"\n * import * as Layer from \"effect/Layer\"\n *\n * const Research = Specialist.make(\"research\", {\n * description: \"Researches past campaigns and orders. Give it the question and any context.\"\n * })\n *\n * const ResearchLive = Research.toLayer((turn) =>\n * turn.run({\n * instructions: \"Answer with the findings and numbers the colleague needs, in a few lines.\",\n * toolkit: ResearchTools\n * })\n * ).pipe(Layer.provide(ResearchToolsLive))\n *\n * export const MyAssistant = Assistant.make(\"my-assistant\", { specialists: [Research] })\n *\n * const MyAssistantLive = MyAssistant.toLayer((turn) => turn.run({ instructions })).pipe(\n * Layer.provide(ResearchLive)\n * )\n * ```\n *\n * @category constructors\n * @since 0.1.0\n */\nexport const make = <const Name extends string>(\n name: Name,\n options: {\n /** When to use it. The assistant sees this. */\n readonly description: string\n }\n): Specialist<Name> => {\n const Handler = Context.Service<SpecialistHandler<Name>, Built>(`effect-assistant/Specialist/${name}`)\n\n // The signature checks what the handler uses (`CheckServices`); the layer's services, which the\n // build required, are provided to it and to every run's stream, so what's left is the run\n // services.\n function toLayer<R = never, RE = never, E = never, RX = never>(\n build: (Handler<R, RE> | Effect.Effect<Handler<R, RE>, E, RX>) &\n CheckServices<Exclude<R | RE, TurnServices | RX | Tool.Handler<string>>>\n ): Layer.Layer<SpecialistHandler<Name>, never, Exclude<RX, Scope.Scope | CurrentChat> | ToolHandlers<R | RE>>\n function toLayer(\n build: Handler<any, any> | Effect.Effect<Handler<any, any>, unknown, any>\n ): Layer.Layer<SpecialistHandler<Name>, never, any> {\n return Layer.effect(\n Handler,\n Effect.gen(function* () {\n // Without the layer's scope: what a build or a turn sets up lives as long as the chat or the turn.\n const context = yield* Effect.context().pipe(Effect.map(Context.omit(Scope.Scope)))\n\n return {\n // The build runs per chat activation, in the chat; here it only keeps the layer's\n // services for it.\n open: Effect.gen(function* () {\n const handler = Effect.isEffect(build) ? yield* build : build\n\n return (turn: Turn) => Stream.provide(toStream(handler(turn)), context)\n }).pipe(Effect.provide(context), Effect.orDie)\n }\n })\n )\n }\n\n return { [TypeId]: TypeId, name, description: options.description, Handler, toLayer }\n}\n\n/**\n * Schema for the brief the assistant gives a specialist.\n *\n * Only `goal` is required.\n *\n * @category schemas\n * @since 0.1.0\n */\nexport const Brief = Schema.Struct({\n goal: Schema.String.annotate({ description: \"What to find out or do.\" }),\n context: Schema.optional(Schema.String).annotate({\n description: \"What it needs to know. It can't see this chat.\"\n }),\n successCriteria: Schema.optional(Schema.String).annotate({ description: \"When it is done.\" }),\n report: Schema.optional(Schema.String).annotate({\n description: \"What to put in the answer, and how.\"\n }),\n limits: Schema.optional(Schema.String).annotate({\n description: \"Hard limits for this job, like read-only or a deadline.\"\n })\n})\n\n/**\n * Represents the brief the assistant gives a specialist.\n *\n * @category models\n * @since 0.1.0\n */\nexport type Brief = typeof Brief.Type\n\n/**\n * Represents a request to start a specialist run in the runner's chat.\n *\n * @category models\n * @since 0.1.0\n */\nexport interface SpawnRequest {\n /** The specialist's name. */\n readonly specialist: string\n readonly brief: Brief\n}\n\n/**\n * Represents why a run request can't be carried out.\n *\n * **Details**\n *\n * The `reason` says which request failed: `\"UnknownSpecialist\"` when `spawn` names no specialist\n * of the assistant, `\"RunNotFound\"` when `message` names a run that is gone, and `\"NotRunning\"`\n * when `stop` names a run that isn't running. The `message` is written for the model.\n *\n * @category errors\n * @since 0.1.0\n */\nexport class SpecialistError extends Schema.Error<SpecialistError>(\"effect-assistant/Specialist/SpecialistError\")({\n _tag: Schema.tag(\"SpecialistError\"),\n reason: Schema.Literals([\"UnknownSpecialist\", \"RunNotFound\", \"NotRunning\"]),\n message: Schema.String\n}) {}\n\n/**\n * Service that runs a chat's specialists and keeps finished runs warm for follow-ups.\n *\n * The engine provides it to every turn. The specialist tools use it, and a handler can too.\n *\n * @category services\n * @since 0.1.0\n */\nexport class Runner extends Context.Service<\n Runner,\n {\n /** Starts a run and returns its id. */\n readonly spawn: (request: SpawnRequest) => Effect.Effect<RunId, SpecialistError>\n /** Steers a running run, or continues a finished one. */\n readonly message: (runId: RunId, text: string) => Effect.Effect<\"steered\" | \"continued\", SpecialistError>\n /** Interrupts a running run. */\n readonly stop: (runId: RunId) => Effect.Effect<void, SpecialistError>\n }\n>()(\"effect-assistant/Specialist/Runner\") {}\n"],"mappings":";;;;;;;;;;;;;;AA0BA,MAAM,SAAS;AAyKf,MAAM,YACJ,WAGyD,OAAO,SAAS,MAAM,IAAI,OAAO,OAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsC7G,MAAa,QACX,MACA,YAIqB;CACrB,MAAM,UAAU,QAAQ,QAAwC,+BAA+B,MAAM;CASrG,SAAS,QACP,OACkD;EAClD,OAAO,MAAM,OACX,SACA,OAAO,IAAI,aAAa;GAEtB,MAAM,UAAU,OAAO,OAAO,QAAQ,CAAC,CAAC,KAAK,OAAO,IAAI,QAAQ,KAAK,MAAM,KAAK,CAAC,CAAC;GAElF,OAAO,EAGL,MAAM,OAAO,IAAI,aAAa;IAC5B,MAAM,UAAU,OAAO,SAAS,KAAK,IAAI,OAAO,QAAQ;IAExD,QAAQ,SAAe,OAAO,QAAQ,SAAS,QAAQ,IAAI,CAAC,GAAG,OAAO;GACxE,CAAC,CAAC,CAAC,KAAK,OAAO,QAAQ,OAAO,GAAG,OAAO,KAAK,EAC/C;EACF,CAAC,CACH;CACF;CAEA,OAAO;GAAG,SAAS;EAAQ;EAAM,aAAa,QAAQ;EAAa;EAAS;CAAQ;AACtF;;;;;;;;;AAUA,MAAa,QAAQ,OAAO,OAAO;CACjC,MAAM,OAAO,OAAO,SAAS,EAAE,aAAa,0BAA0B,CAAC;CACvE,SAAS,OAAO,SAAS,OAAO,MAAM,CAAC,CAAC,SAAS,EAC/C,aAAa,iDACf,CAAC;CACD,iBAAiB,OAAO,SAAS,OAAO,MAAM,CAAC,CAAC,SAAS,EAAE,aAAa,mBAAmB,CAAC;CAC5F,QAAQ,OAAO,SAAS,OAAO,MAAM,CAAC,CAAC,SAAS,EAC9C,aAAa,sCACf,CAAC;CACD,QAAQ,OAAO,SAAS,OAAO,MAAM,CAAC,CAAC,SAAS,EAC9C,aAAa,0DACf,CAAC;AACH,CAAC;;;;;;;;;;;;;AAkCD,IAAa,kBAAb,cAAqC,OAAO,MAAuB,6CAA6C,CAAC,CAAC;CAChH,MAAM,OAAO,IAAI,iBAAiB;CAClC,QAAQ,OAAO,SAAS;EAAC;EAAqB;EAAe;CAAY,CAAC;CAC1E,SAAS,OAAO;AAClB,CAAC,CAAC,CAAC,CAAC;;;;;;;;;AAUJ,IAAa,SAAb,cAA4B,QAAQ,QAUlC,CAAC,CAAC,oCAAoC,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"Specialist.js","names":["Telemetry.withoutTracing"],"sources":["../src/Specialist.ts"],"sourcesContent":["/**\n * Defines specialists, which are focused agents an assistant hands work to in the background.\n *\n * A specialist has a definition, created with {@link make}, that gives its name and when to use\n * it, and a handler, provided with its `toLayer`, that works on a {@link Brief} as a loop. The\n * {@link Runner} service starts, steers, and stops a chat's specialist runs.\n *\n * @since 0.1.0\n */\nimport type * as AiError from \"effect/ai/AiError\"\nimport type * as LanguageModel from \"effect/ai/LanguageModel\"\nimport type * as Prompt from \"effect/ai/Prompt\"\nimport type * as Tool from \"effect/ai/Tool\"\nimport type * as Toolkit from \"effect/ai/Toolkit\"\nimport * as Context from \"effect/Context\"\nimport * as Effect from \"effect/Effect\"\nimport * as Layer from \"effect/Layer\"\nimport * as Schema from \"effect/Schema\"\nimport * as Scope from \"effect/Scope\"\nimport * as Stream from \"effect/Stream\"\nimport type * as AssistantLoop from \"./AssistantLoop.ts\"\nimport type { ChatId } from \"./ChatId.ts\"\nimport type { CurrentChat } from \"./CurrentChat.ts\"\nimport type * as Instructions from \"./Instructions.ts\"\nimport * as Telemetry from \"./internal/telemetry.ts\"\nimport type { RunId } from \"./RunId.ts\"\n\nconst TypeId = \"~effect-assistant/Specialist\"\n\n/**\n * Represents a specialist's definition.\n *\n * @category models\n * @since 0.1.0\n */\nexport interface Specialist<Name extends string = string> {\n readonly [TypeId]: typeof TypeId\n readonly name: Name\n /** When to use the specialist. The assistant sees this. */\n readonly description: string\n /** The key of the specialist's handler, as `toLayer` provides it. */\n readonly Handler: Context.Key<SpecialistHandler<Name>, Built>\n /**\n * Provides the specialist's handler. The handler may use the {@link TurnServices} and the\n * services its build Effect required (see {@link CheckServices}).\n */\n readonly toLayer: <R = never, RE = never, E = never, RX = never>(\n build: (Handler<R, RE> | Effect.Effect<Handler<R, RE>, E, RX>) &\n CheckServices<Exclude<R | RE, TurnServices | RX | Tool.Handler<string>>>\n ) => Layer.Layer<SpecialistHandler<Name>, never, Exclude<RX, Scope.Scope | CurrentChat> | ToolHandlers<R | RE>>\n}\n\n/**\n * Represents the check `toLayer` applies to the services a handler uses.\n *\n * **Details**\n *\n * Every service a handler uses must be one the run (or turn) provides, or one its build Effect\n * required, which the layer provides. A handler that uses any other service gets this type\n * error, which names those services.\n *\n * @category utility types\n * @since 0.1.0\n */\nexport type CheckServices<Undeclared> = [Undeclared] extends [never]\n ? unknown\n : {\n readonly \"~undeclaredServices\": {\n readonly error: \"The handler uses services that neither the turn provides nor its build Effect requires\"\n readonly services: Undeclared\n }\n }\n\n/**\n * Extracts the tool handlers (`Toolkit.toLayer`) that a handler's loop uses.\n *\n * They are requirements of the layer, so `Layer.provide(MyToolsLive)` provides them, and a\n * missing one is a type error.\n *\n * @category utility types\n * @since 0.1.0\n */\nexport type ToolHandlers<R> = Extract<R, Tool.Handler<string>>\n\n/**\n * Represents any specialist.\n *\n * @category utility types\n * @since 0.1.0\n */\nexport type Any = Specialist<any>\n\n/**\n * Identifies a specialist's handler in a context.\n *\n * @category models\n * @since 0.1.0\n */\nexport interface SpecialistHandler<Name extends string> {\n readonly _SpecialistHandler: Name\n}\n\n/**\n * Extracts the handlers that these specialists need.\n *\n * @category utility types\n * @since 0.1.0\n */\nexport type HandlerOf<S> = S extends Specialist<infer Name> ? SpecialistHandler<Name> : never\n\n/**\n * The services a turn provides to its handler, which are its chat, the chat's runner, and the\n * model.\n *\n * @category utility types\n * @since 0.1.0\n */\nexport type TurnServices = CurrentChat | Runner | LanguageModel.LanguageModel\n\n/**\n * Represents the options for `turn.run`.\n *\n * @category models\n * @since 0.1.0\n */\nexport interface RunOptions<T extends Record<string, Tool.Any> = Record<never, never>> {\n readonly instructions: string | Instructions.Resolved\n /**\n * The loop's tools, as a native toolkit whose handlers come from the layer. Merge in a\n * `Skill.toolkit(...)` for playbooks.\n */\n readonly toolkit?: Toolkit.Toolkit<T> | undefined\n /** The model calls allowed per brief. Defaults to 8. */\n readonly maxSteps?: number | undefined\n}\n\n/**\n * Represents one turn of a specialist's run, as its handler sees it. The first turn works on the\n * brief, and each later one on the messages sent to the run since (follow-ups and steering).\n *\n * @category models\n * @since 0.1.0\n */\nexport interface Turn {\n readonly runId: RunId\n /** The chat the run belongs to, which is the chat of the turn that spawned it. */\n readonly chatId: ChatId\n readonly brief: Brief\n /**\n * The run's history, with the brief, what the run did so far, and the messages sent to it since\n * (follow-ups and steering). Read it before every model call, as the loop does.\n */\n readonly history: Effect.Effect<ReadonlyArray<Prompt.Message>>\n /** Runs the agent loop over the run's history, with the given instructions and tools. */\n readonly run: <T extends Record<string, Tool.Any> = Record<never, never>>(\n options: RunOptions<T>\n ) => Stream.Stream<\n AssistantLoop.Event,\n AiError.AiError,\n LanguageModel.LanguageModel | AssistantLoop.ToolkitServices<T>\n >\n}\n\n/**\n * Represents a specialist's handler, which works on a brief and returns a stream of what the loop\n * did.\n *\n * It may return the stream from an Effect. `R` is the services the stream needs, and `RE` the\n * services the Effect needs.\n *\n * @category models\n * @since 0.1.0\n */\nexport type Handler<R = never, RE = R> = (\n turn: Turn\n) =>\n | Stream.Stream<AssistantLoop.Event, unknown, R>\n | Effect.Effect<Stream.Stream<AssistantLoop.Event, unknown, R>, unknown, RE>\n\n/**\n * Represents a specialist's handler as its layer provides it.\n *\n * `open` runs the build for a chat (once per chat activation, see `CurrentChat`) and returns\n * the handler with the layer's services already provided.\n *\n * @category models\n * @since 0.1.0\n */\nexport interface Built {\n readonly open: Effect.Effect<\n (turn: Turn) => Stream.Stream<AssistantLoop.Event, unknown, TurnServices>,\n never,\n Scope.Scope | CurrentChat\n >\n}\n\nconst toStream = <R, RE>(\n result:\n | Stream.Stream<AssistantLoop.Event, unknown, R>\n | Effect.Effect<Stream.Stream<AssistantLoop.Event, unknown, R>, unknown, RE>\n): Stream.Stream<AssistantLoop.Event, unknown, R | RE> => (Effect.isEffect(result) ? Stream.unwrap(result) : result)\n\n/**\n * Creates a specialist from its name and a description of when to use it.\n *\n * **Details**\n *\n * The specialist's `toLayer` provides its handler, which is usually `turn.run` with the\n * specialist's own instructions and tools. List the specialist in `Assistant.make`'s\n * `specialists`, and provide its layer to the assistant's.\n *\n * **Example** (Defining a research specialist)\n *\n * ```ts\n * import { Assistant, Specialist } from \"effect-assistant\"\n * import * as Layer from \"effect/Layer\"\n *\n * const Research = Specialist.make(\"research\", {\n * description: \"Researches past campaigns and orders. Give it the question and any context.\"\n * })\n *\n * const ResearchLive = Research.toLayer((turn) =>\n * turn.run({\n * instructions: \"Answer with the findings and numbers the colleague needs, in a few lines.\",\n * toolkit: ResearchTools\n * })\n * ).pipe(Layer.provide(ResearchToolsLive))\n *\n * export const MyAssistant = Assistant.make(\"my-assistant\", { specialists: [Research] })\n *\n * const MyAssistantLive = MyAssistant.toLayer((turn) => turn.run({ instructions })).pipe(\n * Layer.provide(ResearchLive)\n * )\n * ```\n *\n * @category constructors\n * @since 0.1.0\n */\nexport const make = <const Name extends string>(\n name: Name,\n options: {\n /** When to use it. The assistant sees this. */\n readonly description: string\n }\n): Specialist<Name> => {\n const Handler = Context.Service<SpecialistHandler<Name>, Built>(`effect-assistant/Specialist/${name}`)\n\n // The signature checks what the handler uses (`CheckServices`); the layer's services, which the\n // build required, are provided to it and to every run's stream, so what's left is the run\n // services.\n function toLayer<R = never, RE = never, E = never, RX = never>(\n build: (Handler<R, RE> | Effect.Effect<Handler<R, RE>, E, RX>) &\n CheckServices<Exclude<R | RE, TurnServices | RX | Tool.Handler<string>>>\n ): Layer.Layer<SpecialistHandler<Name>, never, Exclude<RX, Scope.Scope | CurrentChat> | ToolHandlers<R | RE>>\n function toLayer(\n build: Handler<any, any> | Effect.Effect<Handler<any, any>, unknown, any>\n ): Layer.Layer<SpecialistHandler<Name>, never, any> {\n return Layer.effect(\n Handler,\n Effect.gen(function* () {\n // Without the layer's scope: what a build or a turn sets up lives as long as the chat or the turn.\n const context = yield* Effect.context().pipe(\n Effect.map(Context.omit(Scope.Scope)),\n Effect.map(Telemetry.withoutTracing)\n )\n\n return {\n // The build runs per chat activation, in the chat; here it only keeps the layer's\n // services for it.\n open: Effect.gen(function* () {\n const handler = Effect.isEffect(build) ? yield* build : build\n\n return (turn: Turn) => Stream.provide(toStream(handler(turn)), context)\n }).pipe(Effect.provide(context), Effect.orDie)\n }\n })\n )\n }\n\n return { [TypeId]: TypeId, name, description: options.description, Handler, toLayer }\n}\n\n/**\n * Schema for the brief the assistant gives a specialist.\n *\n * Only `goal` is required.\n *\n * @category schemas\n * @since 0.1.0\n */\nexport const Brief = Schema.Struct({\n goal: Schema.String.annotate({ description: \"What to find out or do.\" }),\n context: Schema.optional(Schema.String).annotate({\n description: \"What it needs to know. It can't see this chat.\"\n }),\n successCriteria: Schema.optional(Schema.String).annotate({ description: \"When it is done.\" }),\n report: Schema.optional(Schema.String).annotate({\n description: \"What to put in the answer, and how.\"\n }),\n limits: Schema.optional(Schema.String).annotate({\n description: \"Hard limits for this job, like read-only or a deadline.\"\n })\n})\n\n/**\n * Represents the brief the assistant gives a specialist.\n *\n * @category models\n * @since 0.1.0\n */\nexport type Brief = typeof Brief.Type\n\n/**\n * Represents a request to start a specialist run in the runner's chat.\n *\n * @category models\n * @since 0.1.0\n */\nexport interface SpawnRequest {\n /** The specialist's name. */\n readonly specialist: string\n readonly brief: Brief\n}\n\n/**\n * Represents why a run request can't be carried out.\n *\n * **Details**\n *\n * The `reason` says which request failed: `\"UnknownSpecialist\"` when `spawn` names no specialist\n * of the assistant, `\"RunNotFound\"` when `message` names a run that is gone, and `\"NotRunning\"`\n * when `stop` names a run that isn't running. The `message` is written for the model.\n *\n * @category errors\n * @since 0.1.0\n */\nexport class SpecialistError extends Schema.Error<SpecialistError>(\"effect-assistant/Specialist/SpecialistError\")({\n _tag: Schema.tag(\"SpecialistError\"),\n reason: Schema.Literals([\"UnknownSpecialist\", \"RunNotFound\", \"NotRunning\"]),\n message: Schema.String\n}) {}\n\n/**\n * Service that runs a chat's specialists and keeps finished runs warm for follow-ups.\n *\n * The engine provides it to every turn. The specialist tools use it, and a handler can too.\n *\n * @category services\n * @since 0.1.0\n */\nexport class Runner extends Context.Service<\n Runner,\n {\n /** Starts a run and returns its id. */\n readonly spawn: (request: SpawnRequest) => Effect.Effect<RunId, SpecialistError>\n /** Steers a running run, or continues a finished one. */\n readonly message: (runId: RunId, text: string) => Effect.Effect<\"steered\" | \"continued\", SpecialistError>\n /** Interrup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OAAO,MAAM,CAAC,CAAC,SAAS,EAC9C,aAAa,0DACf,CAAC;AACH,CAAC;;;;;;;;;;;;;AAkCD,IAAa,kBAAb,cAAqC,OAAO,MAAuB,6CAA6C,CAAC,CAAC;CAChH,MAAM,OAAO,IAAI,iBAAiB;CAClC,QAAQ,OAAO,SAAS;EAAC;EAAqB;EAAe;CAAY,CAAC;CAC1E,SAAS,OAAO;AAClB,CAAC,CAAC,CAAC,CAAC;;;;;;;;;AAUJ,IAAa,SAAb,cAA4B,QAAQ,QAUlC,CAAC,CAAC,oCAAoC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,70 @@
1
+ import * as Context from "effect/Context";
2
+ import * as Effect from "effect/Effect";
3
+ import * as Layer from "effect/Layer";
4
+ import * as Option from "effect/Option";
5
+ import * as LanguageModel from "effect/ai/LanguageModel";
6
+ import * as Duration from "effect/Duration";
7
+ declare namespace StatusSummary_d_exports {
8
+ export { Options, StatusSummary, defaultInstructions, layer };
9
+ }
10
+ /**
11
+ * The instructions the summary's model gets by default.
12
+ *
13
+ * @category constants
14
+ * @since 0.13.0
15
+ */
16
+ export declare const defaultInstructions = "You write the status line a chat shows while an assistant works for its user. Read what the assistant did so far in this turn and say what it is doing now, in 3 to 5 plain words, in the language the user writes in, like \"Comparing last year's budgets\". No tool names, ids, code, quotes or final period. Answer with the status only.";
17
+ /**
18
+ * Represents the options accepted by {@link layer}.
19
+ *
20
+ * @category models
21
+ * @since 0.13.0
22
+ */
23
+ export interface Options {
24
+ /** How long the line may stay empty before a summary fills it. Defaults to 2 seconds. */
25
+ readonly after?: Duration.Input | undefined;
26
+ /** How long a line may stay unchanged before a summary refreshes it. Defaults to 5 seconds. */
27
+ readonly staleAfter?: Duration.Input | undefined;
28
+ /** The summary model's instructions. Defaults to {@link defaultInstructions}. */
29
+ readonly instructions?: string | undefined;
30
+ }
31
+ declare const StatusSummary_base: Context.ServiceClass<StatusSummary, "effect-assistant/StatusSummary", {
32
+ readonly after: Duration.Duration;
33
+ readonly staleAfter: Duration.Duration;
34
+ /**
35
+ * Returns the status for a turn, from its transcript: the user's input and what the assistant
36
+ * did since. `None` when the model wrote nothing usable or its call failed.
37
+ */
38
+ readonly summarize: (transcript: string) => Effect.Effect<Option.Option<string>>;
39
+ }>;
40
+ /**
41
+ * Service that writes a turn's status from what the turn did so far.
42
+ *
43
+ * @category services
44
+ * @since 0.13.0
45
+ */
46
+ export declare class StatusSummary extends StatusSummary_base {}
47
+ /**
48
+ * Creates the summary on the model it is given: provide a small, fast one.
49
+ *
50
+ * **Example** (A cheap model for statuses)
51
+ *
52
+ * ```ts
53
+ * import { StatusSummary } from "effect-assistant"
54
+ * import * as Layer from "effect/Layer"
55
+ *
56
+ * declare const MyAssistantLive: Layer.Layer<never>
57
+ * declare const FastModel: Layer.Layer<import("effect/ai/LanguageModel").LanguageModel>
58
+ *
59
+ * export const Live = MyAssistantLive.pipe(
60
+ * Layer.provide(StatusSummary.layer({ after: "2 seconds" }).pipe(Layer.provide(FastModel)))
61
+ * )
62
+ * ```
63
+ *
64
+ * @category layers
65
+ * @since 0.13.0
66
+ */
67
+ export declare const layer: (options?: Options) => Layer.Layer<StatusSummary, never, LanguageModel.LanguageModel>;
68
+ //#endregion
69
+ export { StatusSummary_d_exports };
70
+ //# sourceMappingURL=StatusSummary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StatusSummary.d.ts","names":[],"sources":["../src/StatusSummary.ts"],"mappings":";;;;;;;;;;;;;;;qBA4Ba;;;;;;;iBASI;;WAEN,QAAQ,SAAS;;WAEjB,aAAa,SAAS;;WAEtB;;;WAYS,OAAA,SAAS;WACJ,YAAA,SAAS;;;;;WAKV,YAAC,uBAAuB,OAAO,OAAO,OAAO;;;;;;;;qBATxD,sBAAsB;;;;;;;;;;;;;;;;;;;;;qBA4CtB,QAAK,UAAc,YAAU,MAAM,MAAM,sBAAsB,cAAc"}
@@ -0,0 +1,84 @@
1
+ import { __exportAll } from "./_virtual/_rolldown/runtime.js";
2
+ import * as Context from "effect/Context";
3
+ import * as Effect from "effect/Effect";
4
+ import * as Layer from "effect/Layer";
5
+ import * as Option from "effect/Option";
6
+ import * as Prompt from "effect/ai/Prompt";
7
+ import * as LanguageModel from "effect/ai/LanguageModel";
8
+ import * as Duration from "effect/Duration";
9
+ //#region src/StatusSummary.ts
10
+ /**
11
+ * This module provides the status a turn shows when nothing else says what it is doing: when the
12
+ * line stays empty for a while, or a call's status still shows after that call ended, a model reads
13
+ * the turn so far and writes a few words about it, like "Comparing last year's budgets".
14
+ *
15
+ * Provide {@link layer} next to the assistant's `toLayer`, with a small, fast model of its own.
16
+ * Without it, a turn shows only the statuses its tool calls write (see `ToolStatus`). The summary
17
+ * is a `ChatSignal.Status` like any other: it is never stored and the turn's model never reads it.
18
+ * It never replaces the status of a described call that still runs, never shows while the model
19
+ * writes to the user, and never after the turn's message unless the model starts new work. A
20
+ * summary that says what the line says already isn't sent.
21
+ *
22
+ * @since 0.13.0
23
+ */
24
+ var StatusSummary_exports = /* @__PURE__ */ __exportAll({
25
+ StatusSummary: () => StatusSummary,
26
+ defaultInstructions: () => defaultInstructions,
27
+ layer: () => layer
28
+ });
29
+ /**
30
+ * The instructions the summary's model gets by default.
31
+ *
32
+ * @category constants
33
+ * @since 0.13.0
34
+ */
35
+ const defaultInstructions = "You write the status line a chat shows while an assistant works for its user. Read what the assistant did so far in this turn and say what it is doing now, in 3 to 5 plain words, in the language the user writes in, like \"Comparing last year's budgets\". No tool names, ids, code, quotes or final period. Answer with the status only.";
36
+ /**
37
+ * Service that writes a turn's status from what the turn did so far.
38
+ *
39
+ * @category services
40
+ * @since 0.13.0
41
+ */
42
+ var StatusSummary = class extends Context.Service()("effect-assistant/StatusSummary") {};
43
+ const MAX_LENGTH = 60;
44
+ const clean = (text) => {
45
+ const line = (text.trim().split("\n")[0] ?? "").replace(/^["'“”‘’]+|["'“”‘’]+$/g, "").replace(/[.…]+$/, "").trim();
46
+ return line === "" || line.length > MAX_LENGTH ? Option.none() : Option.some(line);
47
+ };
48
+ /**
49
+ * Creates the summary on the model it is given: provide a small, fast one.
50
+ *
51
+ * **Example** (A cheap model for statuses)
52
+ *
53
+ * ```ts
54
+ * import { StatusSummary } from "effect-assistant"
55
+ * import * as Layer from "effect/Layer"
56
+ *
57
+ * declare const MyAssistantLive: Layer.Layer<never>
58
+ * declare const FastModel: Layer.Layer<import("effect/ai/LanguageModel").LanguageModel>
59
+ *
60
+ * export const Live = MyAssistantLive.pipe(
61
+ * Layer.provide(StatusSummary.layer({ after: "2 seconds" }).pipe(Layer.provide(FastModel)))
62
+ * )
63
+ * ```
64
+ *
65
+ * @category layers
66
+ * @since 0.13.0
67
+ */
68
+ const layer = (options) => Layer.effect(StatusSummary, Effect.gen(function* () {
69
+ const model = yield* LanguageModel.LanguageModel;
70
+ const instructions = options?.instructions ?? "You write the status line a chat shows while an assistant works for its user. Read what the assistant did so far in this turn and say what it is doing now, in 3 to 5 plain words, in the language the user writes in, like \"Comparing last year's budgets\". No tool names, ids, code, quotes or final period. Answer with the status only.";
71
+ const summarize = Effect.fn("StatusSummary.summarize")(function* (transcript) {
72
+ const response = yield* model.generateText({ prompt: Prompt.fromMessages([Prompt.systemMessage({ content: instructions }), Prompt.userMessage({ content: [Prompt.textPart({ text: transcript })] })]) });
73
+ return clean(response.text);
74
+ });
75
+ return StatusSummary.of({
76
+ after: Duration.fromInputUnsafe(options?.after ?? "2 seconds"),
77
+ staleAfter: Duration.fromInputUnsafe(options?.staleAfter ?? "5 seconds"),
78
+ summarize: (transcript) => summarize(transcript).pipe(Effect.catchCause((cause) => Effect.as(Effect.logDebug("assistant status summary failed", cause), Option.none())))
79
+ });
80
+ }));
81
+ //#endregion
82
+ export { StatusSummary, StatusSummary_exports, defaultInstructions, layer };
83
+
84
+ //# sourceMappingURL=StatusSummary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StatusSummary.js","names":[],"sources":["../src/StatusSummary.ts"],"sourcesContent":["/**\n * This module provides the status a turn shows when nothing else says what it is doing: when the\n * line stays empty for a while, or a call's status still shows after that call ended, a model reads\n * the turn so far and writes a few words about it, like \"Comparing last year's budgets\".\n *\n * Provide {@link layer} next to the assistant's `toLayer`, with a small, fast model of its own.\n * Without it, a turn shows only the statuses its tool calls write (see `ToolStatus`). The summary\n * is a `ChatSignal.Status` like any other: it is never stored and the turn's model never reads it.\n * It never replaces the status of a described call that still runs, never shows while the model\n * writes to the user, and never after the turn's message unless the model starts new work. A\n * summary that says what the line says already isn't sent.\n *\n * @since 0.13.0\n */\nimport * as LanguageModel from \"effect/ai/LanguageModel\"\nimport * as Prompt from \"effect/ai/Prompt\"\nimport * as Context from \"effect/Context\"\nimport * as Duration from \"effect/Duration\"\nimport * as Effect from \"effect/Effect\"\nimport * as Layer from \"effect/Layer\"\nimport * as Option from \"effect/Option\"\n\n/**\n * The instructions the summary's model gets by default.\n *\n * @category constants\n * @since 0.13.0\n */\nexport const defaultInstructions =\n 'You write the status line a chat shows while an assistant works for its user. Read what the assistant did so far in this turn and say what it is doing now, in 3 to 5 plain words, in the language the user writes in, like \"Comparing last year\\'s budgets\". No tool names, ids, code, quotes or final period. Answer with the status only.'\n\n/**\n * Represents the options accepted by {@link layer}.\n *\n * @category models\n * @since 0.13.0\n */\nexport interface Options {\n /** How long the line may stay empty before a summary fills it. Defaults to 2 seconds. */\n readonly after?: Duration.Input | undefined\n /** How long a line may stay unchanged before a summary refreshes it. Defaults to 5 seconds. */\n readonly staleAfter?: Duration.Input | undefined\n /** The summary model's instructions. Defaults to {@link defaultInstructions}. */\n readonly instructions?: string | undefined\n}\n\n/**\n * Service that writes a turn's status from what the turn did so far.\n *\n * @category services\n * @since 0.13.0\n */\nexport class StatusSummary extends Context.Service<\n StatusSummary,\n {\n readonly after: Duration.Duration\n readonly staleAfter: Duration.Duration\n /**\n * Returns the status for a turn, from its transcript: the user's input and what the assistant\n * did since. `None` when the model wrote nothing usable or its call failed.\n */\n readonly summarize: (transcript: string) => Effect.Effect<Option.Option<string>>\n }\n>()(\"effect-assistant/StatusSummary\") {}\n\nconst MAX_LENGTH = 60\n\nconst clean = (text: string): Option.Option<string> => {\n const line = (text.trim().split(\"\\n\")[0] ?? \"\")\n .replace(/^[\"'“”‘’]+|[\"'“”‘’]+$/g, \"\")\n .replace(/[.…]+$/, \"\")\n .trim()\n\n return line === \"\" || line.length > MAX_LENGTH ? Option.none() : Option.some(line)\n}\n\n/**\n * Creates the summary on the model it is given: provide a small, fast one.\n *\n * **Example** (A cheap model for statuses)\n *\n * ```ts\n * import { StatusSummary } from \"effect-assistant\"\n * import * as Layer from \"effect/Layer\"\n *\n * declare const MyAssistantLive: Layer.Layer<never>\n * declare const FastModel: Layer.Layer<import(\"effect/ai/LanguageModel\").LanguageModel>\n *\n * export const Live = MyAssistantLive.pipe(\n * Layer.provide(StatusSummary.layer({ after: \"2 seconds\" }).pipe(Layer.provide(FastModel)))\n * )\n * ```\n *\n * @category layers\n * @since 0.13.0\n */\nexport const layer = (options?: Options): Layer.Layer<StatusSummary, never, LanguageModel.LanguageModel> =>\n Layer.effect(\n StatusSummary,\n Effect.gen(function* () {\n const model = yield* LanguageModel.LanguageModel\n const instructions = options?.instructions ?? defaultInstructions\n\n const summarize = Effect.fn(\"StatusSummary.summarize\")(function* (transcript: string) {\n const response = yield* model.generateText({\n prompt: Prompt.fromMessages([\n Prompt.systemMessage({ content: instructions }),\n Prompt.userMessage({ content: [Prompt.textPart({ text: transcript })] })\n ])\n })\n\n return clean(response.text)\n })\n\n return StatusSummary.of({\n after: Duration.fromInputUnsafe(options?.after ?? \"2 seconds\"),\n staleAfter: Duration.fromInputUnsafe(options?.staleAfter ?? \"5 seconds\"),\n summarize: (transcript) =>\n summarize(transcript).pipe(\n Effect.catchCause((cause) =>\n Effect.as(Effect.logDebug(\"assistant status summary failed\", cause), Option.none())\n )\n )\n })\n })\n )\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAa,sBACX;;;;;;;AAuBF,IAAa,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
3
  import { Assistant_d_exports, Entry } from "./Assistant.js";
3
4
  import * as Schema from "effect/Schema";
4
5
  import * as Stream from "effect/Stream";
@@ -201,6 +202,11 @@ export type SpecialistWorking = typeof SpecialistWorking.Type;
201
202
  * something that arrived. `specialists` lists the specialists that are working. When the chat is
202
203
  * idle, nothing is working, even if a workflow is waiting on a timer or on the user.
203
204
  *
205
+ * On a live subscription (`subscribe(chatId, { live: true })`), `status` is a short line about what
206
+ * the running turn is doing, and `typing` is true while the model writes a message to the user. Both
207
+ * come from the chat's signals (see `ChatSignal`): they go when the turn ends, and a timeline
208
+ * folded from the log alone has neither.
209
+ *
204
210
  * @category schemas
205
211
  * @since 0.1.0
206
212
  */
@@ -210,6 +216,8 @@ export declare const Activity: Schema.Struct<{
210
216
  readonly specialist: Schema.String;
211
217
  readonly since: Schema.Finite;
212
218
  }>>;
219
+ readonly status: Schema.optional<Schema.String>;
220
+ readonly typing: Schema.Boolean;
213
221
  }>;
214
222
  /**
215
223
  * Represents what is working in the chat.
@@ -512,8 +520,8 @@ export interface ChangesOptions<Show extends ReadonlyArray<AppEventSchema> = rea
512
520
  * @since 0.3.0
513
521
  */
514
522
  export declare const changes: {
515
- <Events, const Show extends Shown<Events> = readonly []>(definition: Definition<Events>, options?: ChangesOptions<Show>): <E, R>(entries: Stream.Stream<AnyEntry, E, R>) => Stream.Stream<Change<Show[number]["Type"]>, E, R>;
516
- <E, R, Events, const Show extends Shown<Events> = readonly []>(entries: Stream.Stream<AnyEntry, E, R>, definition: Definition<Events>, options?: ChangesOptions<Show>): Stream.Stream<Change<Show[number]["Type"]>, E, R>;
523
+ <Events, const Show extends Shown<Events> = readonly []>(definition: Definition<Events>, options?: ChangesOptions<Show>): <E, R>(entries: Stream.Stream<AnyEntry | ChatSignal, E, R>) => Stream.Stream<Change<Show[number]["Type"]>, E, R>;
524
+ <E, R, Events, const Show extends Shown<Events> = readonly []>(entries: Stream.Stream<AnyEntry | ChatSignal, E, R>, definition: Definition<Events>, options?: ChangesOptions<Show>): Stream.Stream<Change<Show[number]["Type"]>, E, R>;
517
525
  };
518
526
  //#endregion
519
527
  export { Timeline_d_exports };
@@ -1 +1 @@
1
- {"version":3,"file":"Timeline.d.ts","names":[],"sources":["../src/Timeline.ts"],"mappings":";;;;;;;;;;;;;;;qBA4Ca,aAAW,OAAA;;;;;;;YAQZ,qBAAqB,YAAY;;;;;;;;;qBAUhC,OAAK,OAAA;;;;;;;;;;;;;;YAeN,eAAe,MAAM;;;;;;;;qBASpB,aAAW,OAAA;;;;;;;;;;;;;;;;;YAaZ,qBAAqB,YAAY;;;;;;;qBAQhC,kBAAgB,OAAA;;;;;;;;;;;;;;;;;;;YAajB,0BAA0B,iBAAiB;;;;;;;;;;;;;;;;YAiB3C,UAAU,KAAK;WAAqB,YAAY;;WAC7C,MAAM;WAAc;WAAqB;WAAqB,OAAO;;;;;;;;;;;;;;;;;;qBAmBvE,cAAY,OAAA;;;;;;;;;;;;;;;YAgBb,sBAAsB,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;YA2BnC,KAAK,kBAAkB,cAAc,mBAAmB,UAAU,UAAU;;;;;;;;qBAS3E,mBAAiB,OAAA;;;;;;;;;;YAWlB,2BAA2B,kBAAkB;;;;;;;;;;;qBAY5C,UAAQ,OAAA;;;;;;;;;;;;;YAWT,kBAAkB,SAAS;;;;;;;;;iBAUtB,SAAS;WACf;WACA,OAAO,cAAc,KAAK;WAC1B,UAAU;;WAEV;;WAEA;;;;;;;;;;;;;;;iBAgBM,OAAO;WACb;WACA,OAAO,cAAc,KAAK;WAC1B,UAAU;WACV;WACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAsEE,eAAe,eAAe,cAAc,+BACvD,SAAS,WACN,OAAO,MAAM,OAAO,yBAAyB,OAAO;;;;;;;;qBAS5C,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA0CP,QAAS,QAAM,UAAY,SAAS,SAAO,QAAU,OAAO,YAAU,SAAS;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