@smithers-orchestrator/components 0.16.9 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithers-orchestrator/components",
3
- "version": "0.16.9",
3
+ "version": "0.17.0",
4
4
  "description": "React components for Smithers workflows",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -24,19 +24,21 @@
24
24
  "react": "^19.2.5",
25
25
  "react-dom": "^19.2.5",
26
26
  "zod": "^4.3.6",
27
- "@smithers-orchestrator/db": "0.16.9",
28
- "@smithers-orchestrator/driver": "0.16.9",
29
- "@smithers-orchestrator/agents": "0.16.9",
30
- "@smithers-orchestrator/memory": "0.16.9",
31
- "@smithers-orchestrator/react-reconciler": "0.16.9",
32
- "@smithers-orchestrator/graph": "0.16.9",
33
- "@smithers-orchestrator/scorers": "0.16.9",
34
- "@smithers-orchestrator/errors": "0.16.9",
35
- "@smithers-orchestrator/scheduler": "0.16.9",
36
- "@smithers-orchestrator/observability": "0.16.9"
27
+ "@smithers-orchestrator/agents": "0.17.0",
28
+ "@smithers-orchestrator/db": "0.17.0",
29
+ "@smithers-orchestrator/graph": "0.17.0",
30
+ "@smithers-orchestrator/driver": "0.17.0",
31
+ "@smithers-orchestrator/errors": "0.17.0",
32
+ "@smithers-orchestrator/memory": "0.17.0",
33
+ "@smithers-orchestrator/react-reconciler": "0.17.0",
34
+ "@smithers-orchestrator/scheduler": "0.17.0",
35
+ "@smithers-orchestrator/observability": "0.17.0"
37
36
  },
38
37
  "devDependencies": {
38
+ "@tanstack/react-query": "^5.99.1",
39
39
  "@types/bun": "latest",
40
+ "drizzle-orm": "^0.45.2",
41
+ "effect": "^3.21.1",
40
42
  "typescript": "~5.9.3"
41
43
  },
42
44
  "scripts": {
@@ -8,7 +8,7 @@ import type { ApprovalAutoApprove } from "./ApprovalAutoApprove.ts";
8
8
  import type { ApprovalDecision } from "./ApprovalDecision.ts";
9
9
  import type { OutputTarget } from "./OutputTarget.ts";
10
10
 
11
- export type ApprovalProps<Row = ApprovalDecision, Output extends OutputTarget = OutputTarget> = {
11
+ export type ApprovalProps<_Row = ApprovalDecision, Output extends OutputTarget = OutputTarget> = {
12
12
  id: string;
13
13
  mode?: ApprovalMode;
14
14
  options?: ApprovalOption[];
@@ -51,7 +51,6 @@ export function EscalationChain(props) {
51
51
  //
52
52
  // For the composite pattern we wrap each subsequent level so it only
53
53
  // mounts when the prior level signals escalation.
54
- const prevLevel = levels[i - 1];
55
54
  const checkId = `${prefix}-check-${i - 1}`;
56
55
  const checkTask = React.createElement(Task, {
57
56
  id: checkId,
@@ -17,7 +17,7 @@ import { Task } from "./Task.js";
17
17
  export function Optimizer(props) {
18
18
  if (props.skipIf)
19
19
  return null;
20
- const { id, generator, evaluator, generateOutput, evaluateOutput, targetScore, maxIterations = 10, onMaxReached = "return-last", children, } = props;
20
+ const { id, generator, evaluator, generateOutput, evaluateOutput, maxIterations = 10, onMaxReached = "return-last", children, } = props;
21
21
  const prefix = id ?? "optimizer";
22
22
  const generateId = `${prefix}-generate`;
23
23
  const evaluateId = `${prefix}-evaluate`;
@@ -1,5 +1,4 @@
1
1
  import React from "react";
2
- import { z } from "zod";
3
2
  import { SmithersContext } from "@smithers-orchestrator/react-reconciler/context";
4
3
  import { stripAutoColumns } from "@smithers-orchestrator/db/react-output";
5
4
  import { SmithersError } from "@smithers-orchestrator/errors/SmithersError";
@@ -110,10 +110,9 @@ function mergeDependsOn(dependsOn, depNodeIds) {
110
110
  * @param {any} ctx
111
111
  * @param {DepsSpec | undefined} deps
112
112
  * @param {Record<string, string> | undefined} needs
113
- * @param {string} [taskId]
114
113
  * @returns {Record<string, unknown> | null}
115
114
  */
116
- function resolveDeps(ctx, deps, needs, taskId) {
115
+ function resolveDeps(ctx, deps, needs) {
117
116
  if (!deps)
118
117
  return Object.create(null);
119
118
  const keys = Object.keys(deps);
@@ -130,26 +129,6 @@ function resolveDeps(ctx, deps, needs, taskId) {
130
129
  }
131
130
  return resolved;
132
131
  }
133
- /**
134
- * Validate that all deps are satisfied. Throws a descriptive SmithersError
135
- * naming which dep is missing and which task needs it.
136
- * @param {{ outputMaybe: (target: unknown, opts: { nodeId: string }) => unknown }} ctx
137
- * @param {DepsSpec} deps
138
- * @param {Record<string, string> | undefined} needs
139
- * @param {string} [taskId]
140
- * @returns {void}
141
- */
142
- function validateDeps(ctx, deps, needs, taskId) {
143
- for (const key of Object.keys(deps)) {
144
- const target = deps[key];
145
- const nodeId = needs?.[key] ?? key;
146
- const value = ctx.outputMaybe(target, { nodeId });
147
- if (value === undefined) {
148
- throw new SmithersError("DEP_NOT_SATISFIED", `Task "${taskId}" dependency "${key}" (resolved from node "${nodeId}") is not satisfied. ` +
149
- `The upstream task must complete and produce output before this task can run.`, { taskId, depKey: key, resolvedNodeId: nodeId });
150
- }
151
- }
152
- }
153
132
  /**
154
133
  * @param {AgentLike} agent
155
134
  * @param {string[] | undefined} allowTools
@@ -225,7 +204,7 @@ export function Task(props) {
225
204
  if (deps && !ctx) {
226
205
  throw new SmithersError("CONTEXT_OUTSIDE_WORKFLOW", "Task deps require a workflow context. Build the workflow with createSmithers().");
227
206
  }
228
- const resolvedDeps = deps ? resolveDeps(ctx, deps, rest.needs, rest.id) : undefined;
207
+ const resolvedDeps = deps ? resolveDeps(ctx, deps, rest.needs) : undefined;
229
208
  if (deps && resolvedDeps == null) {
230
209
  // Deps not yet available — component defers until upstream tasks complete.
231
210
  // This is normal reactive behavior; the task will re-render once deps are ready.
@@ -4,7 +4,7 @@ import type { AgentLike } from "@smithers-orchestrator/agents/AgentLike";
4
4
  import type { SmithersCtx } from "@smithers-orchestrator/driver";
5
5
  import type { CachePolicy } from "@smithers-orchestrator/scheduler/CachePolicy";
6
6
  import type { RetryPolicy } from "@smithers-orchestrator/scheduler/RetryPolicy";
7
- import type { ScorersMap } from "@smithers-orchestrator/scorers/types";
7
+ import type { ScorersMap } from "@smithers-orchestrator/graph/types";
8
8
  import type { TaskMemoryConfig } from "@smithers-orchestrator/memory/types";
9
9
  import type { OutputTarget } from "./OutputTarget.ts";
10
10
  import type { DepsSpec } from "./DepsSpec.ts";
@@ -48,6 +48,10 @@ export type TaskProps<Row, Output extends OutputTarget = OutputTarget, D extends
48
48
  scorers?: ScorersMap;
49
49
  /** Optional cross-run memory configuration. */
50
50
  memory?: TaskMemoryConfig;
51
+ /** Request an immediate hijack handoff as soon as the task starts running. */
52
+ hijack?: boolean;
53
+ /** What Smithers should do after a hijacked session exits. */
54
+ onHijackExit?: "complete" | "reopen";
51
55
  allowTools?: string[];
52
56
  label?: string;
53
57
  meta?: Record<string, unknown>;
@@ -1,7 +1,4 @@
1
1
  import React from "react";
2
- import { getTaskRuntime } from "@smithers-orchestrator/driver/task-runtime";
3
- import { SmithersDb } from "@smithers-orchestrator/db/adapter";
4
- import { SmithersError } from "@smithers-orchestrator/errors/SmithersError";
5
2
  /** @typedef {import("./WaitForEventProps.ts").WaitForEventProps} WaitForEventProps */
6
3
 
7
4
  /**
@@ -56,7 +56,7 @@
56
56
  /** @typedef {import("./SandboxVolumeMount.ts").SandboxVolumeMount} SandboxVolumeMount */
57
57
  /** @typedef {import("./SandboxWorkspaceSpec.ts").SandboxWorkspaceSpec} SandboxWorkspaceSpec */
58
58
  /** @typedef {import("./ScanFixVerifyProps.ts").ScanFixVerifyProps} ScanFixVerifyProps */
59
- /** @typedef {import("@smithers-orchestrator/scorers/types").ScorersMap} ScorersMap */
59
+ /** @typedef {import("@smithers-orchestrator/graph/types").ScorersMap} ScorersMap */
60
60
  /** @typedef {import("./SequenceProps.ts").SequenceProps} SequenceProps */
61
61
  /**
62
62
  * @template Schema
package/src/index.d.ts CHANGED
@@ -23,8 +23,7 @@ import * as zod from 'zod';
23
23
  import { z } from 'zod';
24
24
  import { SmithersError } from '@smithers-orchestrator/errors/SmithersError';
25
25
  import { AgentLike } from '@smithers-orchestrator/agents/AgentLike';
26
- import * as _smithers_scorers_types from '@smithers-orchestrator/scorers/types';
27
- import { ScorersMap as ScorersMap$1 } from '@smithers-orchestrator/scorers/types';
26
+ import { ScorersMap as ScorersMap$1 } from '@smithers-orchestrator/graph/types';
28
27
  import { TaskMemoryConfig } from '@smithers-orchestrator/memory/types';
29
28
  import * as _smithers_errors from '@smithers-orchestrator/errors';
30
29
  import * as zod_v4_core from 'zod/v4/core';
@@ -152,6 +151,10 @@ type TaskProps$2<Row, Output extends OutputTarget$1 = OutputTarget$1, D extends
152
151
  scorers?: ScorersMap$1;
153
152
  /** Optional cross-run memory configuration. */
154
153
  memory?: TaskMemoryConfig;
154
+ /** Request an immediate hijack handoff as soon as the task starts running. */
155
+ hijack?: boolean;
156
+ /** What Smithers should do after a hijacked session exits. */
157
+ onHijackExit?: "complete" | "reopen";
155
158
  allowTools?: string[];
156
159
  label?: string;
157
160
  meta?: Record<string, unknown>;
@@ -1498,7 +1501,7 @@ type SandboxRuntime = SandboxRuntime$1;
1498
1501
  type SandboxVolumeMount = SandboxVolumeMount$1;
1499
1502
  type SandboxWorkspaceSpec = SandboxWorkspaceSpec$1;
1500
1503
  type ScanFixVerifyProps = ScanFixVerifyProps$2;
1501
- type ScorersMap = _smithers_scorers_types.ScorersMap;
1504
+ type ScorersMap = ScorersMap$1;
1502
1505
  type SequenceProps = SequenceProps$2;
1503
1506
  type SignalProps<Schema> = SignalProps$2<Schema>;
1504
1507
  type SourceDef = SourceDef$1;
@@ -1515,7 +1518,7 @@ type WorktreeProps = WorktreeProps$2;
1515
1518
  /** @type {Record<string, React.FC<any>>} */
1516
1519
  declare const markdownComponents: Record<string, React.FC<any>>;
1517
1520
 
1518
- /** @typedef {import("mdx/types").MDXContent} MDXContent */
1521
+ /** @typedef {import("react").ComponentType<Record<string, any>>} MDXContent */
1519
1522
  /**
1520
1523
  * Render an MDX component to plain markdown text.
1521
1524
  *
package/src/renderMdx.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { renderToStaticMarkup } from "react-dom/server";
3
3
  import { markdownComponents } from "./markdownComponents.js";
4
- /** @typedef {import("mdx/types").MDXContent} MDXContent */
4
+ /** @typedef {import("react").ComponentType<Record<string, any>>} MDXContent */
5
5
  /**
6
6
  * Render an MDX component to plain markdown text.
7
7
  *