@swirls/looms 0.9.0 → 0.10.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 (82) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/actor/routing.js +2 -1
  3. package/dist/agent/debugger/agent-chat.js +6 -5
  4. package/dist/agent/debugger/index.js +2 -1
  5. package/dist/agent/module.d.ts +799 -593
  6. package/dist/agent/module.js +31 -0
  7. package/dist/agent/scope.js +1 -0
  8. package/dist/agent/signals.d.ts +108 -15
  9. package/dist/agent/signals.js +70 -47
  10. package/dist/approval/debugger/approvals-view.js +1 -1
  11. package/dist/approval/index.d.ts +1 -0
  12. package/dist/approval/index.js +1 -0
  13. package/dist/approval/module.d.ts +42 -1
  14. package/dist/approval/module.js +53 -0
  15. package/dist/approval/scope.js +1 -0
  16. package/dist/approval/signals.d.ts +19 -13
  17. package/dist/approval/signals.js +25 -45
  18. package/dist/approval/steps.d.ts +11 -0
  19. package/dist/approval/steps.js +39 -0
  20. package/dist/cli/commands.js +2 -2
  21. package/dist/client/client.d.ts +211 -0
  22. package/dist/client/client.js +18 -1
  23. package/dist/core/index.d.ts +1 -0
  24. package/dist/core/index.js +1 -0
  25. package/dist/core/module-scope.d.ts +50 -5
  26. package/dist/core/module-scope.js +22 -2
  27. package/dist/core/module.d.ts +29 -2
  28. package/dist/core/projection.d.ts +1 -0
  29. package/dist/core/published.d.ts +59 -1
  30. package/dist/core/published.js +97 -1
  31. package/dist/core/signals.d.ts +56 -0
  32. package/dist/core/signals.js +93 -0
  33. package/dist/core/validate-event.d.ts +12 -1
  34. package/dist/core/validate-event.js +34 -11
  35. package/dist/debugger/app/assets/index-CO5gIvV8.css +2 -0
  36. package/dist/debugger/app/assets/{index-CMRl_aWQ.js → index-D-2Q7ecG.js} +2 -2
  37. package/dist/debugger/app/assets/routes-lvmllT60.js +47 -0
  38. package/dist/debugger/app/index.html +2 -2
  39. package/dist/debugger/index.d.ts +1 -1
  40. package/dist/debugger/index.js +1 -1
  41. package/dist/debugger/lib/cn.d.ts +1 -1
  42. package/dist/debugger/lib/cn.js +12 -1
  43. package/dist/debugger/plugin.d.ts +11 -1
  44. package/dist/debugger/plugin.js +41 -0
  45. package/dist/debugger/shell/debugger-shell.js +1 -1
  46. package/dist/debugger/shell/form-fields.d.ts +17 -0
  47. package/dist/debugger/shell/form-fields.js +38 -0
  48. package/dist/debugger/shell/run-action.d.ts +6 -0
  49. package/dist/debugger/shell/run-action.js +15 -0
  50. package/dist/debugger/shell/run-controls.js +3 -55
  51. package/dist/debugger/shell/schema-form.d.ts +10 -1
  52. package/dist/debugger/shell/schema-form.js +108 -10
  53. package/dist/debugger/shell/signal-form.d.ts +18 -0
  54. package/dist/debugger/shell/signal-form.js +185 -0
  55. package/dist/debugger/shell/start-form.js +2 -32
  56. package/dist/debugger/shell/use-debounced-preview.d.ts +22 -0
  57. package/dist/debugger/shell/use-debounced-preview.js +68 -0
  58. package/dist/evaluator/index.d.ts +1 -1
  59. package/dist/evaluator/index.js +1 -1
  60. package/dist/evaluator/module.d.ts +8 -1
  61. package/dist/evaluator/module.js +33 -0
  62. package/dist/evaluator/scope.js +1 -0
  63. package/dist/runtime/server/routes/definitions.d.ts +1 -1
  64. package/dist/runtime/server/routes/definitions.js +58 -2
  65. package/dist/runtime/server/routes/runs.js +25 -1
  66. package/dist/schedule/module.d.ts +117 -1
  67. package/dist/schedule/module.js +30 -0
  68. package/dist/schedule/scope.js +1 -0
  69. package/dist/schedule/signals.d.ts +59 -7
  70. package/dist/schedule/signals.js +35 -17
  71. package/dist/testing/corpus-module.d.ts +1 -1
  72. package/dist/testing/index.js +2 -1
  73. package/dist/testing/module-examples.d.ts +6 -0
  74. package/dist/testing/module-examples.js +66 -0
  75. package/dist/workflow/module.d.ts +3 -1
  76. package/dist/workflow/module.js +13 -0
  77. package/dist/workflow/scope.js +1 -0
  78. package/package.json +1 -1
  79. package/dist/debugger/app/assets/index-B7GdT1UA.css +0 -2
  80. package/dist/debugger/app/assets/routes-CfXxKG45.js +0 -47
  81. /package/dist/evaluator/{signals.d.ts → steps.d.ts} +0 -0
  82. /package/dist/evaluator/{signals.js → steps.js} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @swirls/looms
2
2
 
3
+ ## 0.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - ddcb70f: Schema-first signals: declare builders with `m.signal` / `defineSignal`, publish and run them over HTTP, and use a schema-aware debugger signal picker. Built-in signal helpers take object input. Modules also publish a description and keep signals, steps, and example traces as first-class members.
8
+
3
9
  ## 0.9.0
4
10
 
5
11
  ### Minor Changes
@@ -1,5 +1,5 @@
1
1
  import { Data, Effect, Option, Predicate, Schema } from 'effect';
2
- import { composeModules, createRunId, isJsonObject, publishDefinition, publishEffects, stringifyJson, } from '@swirls/looms/core';
2
+ import { composeModules, createRunId, isJsonObject, publishDefinition, publishEffects, publishModules, stringifyJson, } from '@swirls/looms/core';
3
3
  const RunTargetBodySchema = Schema.Struct({
4
4
  runId: Schema.optional(Schema.NonEmptyString),
5
5
  });
@@ -56,6 +56,7 @@ export function definitionsResponse(req, modules) {
56
56
  return Response.json({
57
57
  definitions: registry.definitions.map(publishDefinition),
58
58
  projections: [...registry.projections.keys()],
59
+ modules: publishModules(registry.modules),
59
60
  });
60
61
  }
61
62
  export class RunTargetError extends Data.TaggedError('RunTargetError') {
@@ -115,7 +115,7 @@ export function AgentChat(context) {
115
115
  }
116
116
  setDraft('');
117
117
  start(input, session
118
- ? (started) => client.signal(started.runId, agentSessionMessageEvents(createEventId(), content, { threadId: started.threadId }))
118
+ ? (started) => client.signal(started.runId, agentSessionMessageEvents({ messageId: createEventId(), text: content }, { threadId: started.threadId }))
119
119
  : undefined);
120
120
  }
121
121
  return (_jsxs("div", { className: "flex h-full min-h-0 flex-col", children: [runId ? (_jsx(Transcript, { runId: runId })) : (_jsx("div", { className: "min-h-0 flex-1", children: _jsx(EmptyState, { icon: _jsx(MessageSquare, {}), title: `Talk to ${definition.name}`, children: "Your first message starts a new run." }) })), runId ? (_jsx(FollowUp, { runId: runId, session: session, delivery: delivery, setDelivery: setDelivery, startError: error, onForked: context.onStarted })) : (_jsx(Composer, { value: draft, onChange: setDraft, onSubmit: send, pending: pending, placeholder: `Message ${definition.name}…`, submitLabel: "Start", error: error }))] }));
@@ -166,12 +166,13 @@ function Reply({ runId, session, delivery, setDelivery, startError }) {
166
166
  setPending(true);
167
167
  setError(null);
168
168
  const events = session
169
- ? agentSessionMessageEvents(createEventId(), content, {
169
+ ? agentSessionMessageEvents({
170
+ messageId: createEventId(),
171
+ text: content,
170
172
  delivery,
171
- threadId: rootThreadId,
172
173
  activeChildThreadId: delivery === 'steer' ? activeSessionChild(store.events()) : undefined,
173
- })
174
- : [userMessage(content, { threadId: rootThreadId })];
174
+ }, { threadId: rootThreadId })
175
+ : [userMessage({ content }, { threadId: rootThreadId })];
175
176
  const [only] = events;
176
177
  const commit = events.length === 1 && only ? store.commit(only) : store.commit(events);
177
178
  commit
@@ -1,5 +1,5 @@
1
1
  import { inputForm, messageInput } from '@swirls/looms/debugger';
2
- import { tokenUsage } from '../projections.js';
2
+ import { conversation, tokenUsage, turnActivity } from '../projections.js';
3
3
  import { AgentChat } from './agent-chat.js';
4
4
  import { summarizeAgentEvent } from './summarize.js';
5
5
  import { TokenUsageView } from './token-usage.js';
@@ -15,5 +15,6 @@ export const agentDebugger = {
15
15
  component: AgentChat,
16
16
  },
17
17
  projections: [{ name: tokenUsage.name, component: TokenUsageView }],
18
+ headlessProjections: [conversation.name, turnActivity.name],
18
19
  };
19
20
  export { AgentChat, TokenUsageView };