Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
f9eeb40
feat(model-setup): the setup's page as React parts, and the studio's …
matthias Nov 24, 2026
301f00f
feat(model-setup): Ollama's models to use, download and remove, share…
matthias Nov 25, 2026
0857c91
feat(model-setup): LM Studio beside Ollama, Antigravity among the sha…
matthias Nov 25, 2026
8e5e3c4
feat(local-models): Apple MLX beside Ollama and LM Studio, through a …
matthias Nov 25, 2026
bad5a4f
fix(local-models): the MLX helper brings the Swift library macOS befo…
matthias Nov 25, 2026
99e0c92
feat(local-models): MLX reads ahead, says how far it has read and can…
matthias Nov 25, 2026
db64a9f
feat(local-models): MLX says when it thinks and keeps one read prompt…
matthias Nov 25, 2026
8af9571
feat(runs): a step on Apple MLX says in the run's log that the model …
matthias Nov 25, 2026
cc84ea9
fix(model-setup): a model's name and its notes are readable in full o…
matthias Nov 25, 2026
d1b8f21
feat(search-index): search over a catalogue by words and meaning, and…
matthias Nov 25, 2026
ad45ebc
feat(tool-harness): one harness around an agent's tools, with a searc…
matthias Nov 25, 2026
3a8b474
feat(tool-harness): a direct call of a tool outside the prompt goes t…
matthias Nov 25, 2026
eb41109
feat(chat): Goose and the space's AI take the connections' and plugin…
matthias Nov 25, 2026
53b6d44
feat(tool-harness): a host says what becomes of tools beyond a model'…
matthias Nov 25, 2026
264200b
Merge main
matthias Nov 25, 2026
74fcec9
Merge main
matthias Nov 25, 2026
8864069
Merge main
matthias Nov 25, 2026
bd949e0
Merge main
matthias Nov 25, 2026
aa9867b
Merge main
matthias Nov 25, 2026
6454d03
Merge main
matthias Nov 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,5 @@ apps/runtime/test
examples
# MIT libraries that go to npm on their own (scripts/npm-package.mjs) and that the runtime doesn't
# use: left out of the image's build context.
packages/decision-model
packages/search-index
packages/search-libsql
packages/goose
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
if: matrix.check == 'typecheck'
run: pnpm copy:check --strict

# The MIT packages (packages/runner, decision-model, search-index, search-libsql, goose, vault,
# The MIT packages (packages/runner, decision-model, search-index, search-libsql, tool-harness, goose, vault,
# plugins, browser, local-models, model-setup)
# depend only on MIT or permissive packages: scripts/mit-deps-check.mjs.
- name: MIT dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ name: Release
# The packages also go to npm while the repository variable PUBLISH_NPM is `true` and the secret
# NPM_TOKEN holds a token that may publish `wizards`, `@engenty/wizards-runtime`,
# `@engenty/wizards` and the MIT libraries `@engenty/chatviews`, `@engenty/decision-model`, `@engenty/search-index`,
# `@engenty/search-libsql`, `@engenty/goose`, `@engenty/vault`, `@engenty/plugins`, `@engenty/browser`, `@engenty/local-models` and `@engenty/model-setup` without a second factor: the
# `@engenty/search-libsql`, `@engenty/tool-harness`, `@engenty/goose`, `@engenty/vault`, `@engenty/plugins`, `@engenty/browser`, `@engenty/local-models` and `@engenty/model-setup` without a second factor: the
# runtime for the updates and the launcher, then the launcher for `npx wizards`, then what code
# outside the repo imports (scripts/npm-package.mjs).
# Run by hand (workflow_dispatch), it builds and tests everything and publishes nothing. On a pull
Expand Down Expand Up @@ -434,7 +434,7 @@ jobs:
served wizards "wizards-$version.tgz"
publish @engenty/wizards "engenty-wizards-$version.tgz"
served @engenty/wizards "wizards-$version.tgz"
libraries="chatviews decision-model search-index search-libsql goose vault plugins browser local-models model-setup"
libraries="chatviews decision-model search-index search-libsql tool-harness goose vault plugins browser local-models model-setup"
for library in $libraries; do
publish "@engenty/$library" "engenty-$library-$version.tgz"
done
Expand Down
3 changes: 2 additions & 1 deletion COPYRIGHTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ choice of whoever uses them (`FSL-1.1-MIT OR MIT`, [packages/shared/LICENSE-MIT]
Each says so in its first line. The runner package (`packages/runner`, MIT) bundles them under MIT.
`@engenty/wizards` on npm is `FSL-1.1-MIT`; its `/openui` bundles the runner, whose MIT licence
ships beside it (`dist/openui/LICENSE-MIT`).
Ten libraries are under the MIT licence, each with its own `LICENSE`, and go to npm with each
Eleven libraries are under the MIT licence, each with its own `LICENSE`, and go to npm with each
release: `packages/chatviews` (`@engenty/chatviews`), `packages/decision-model` (`@engenty/decision-model`), `packages/search-index`
(`@engenty/search-index`), `packages/search-libsql` (`@engenty/search-libsql`),
`packages/tool-harness` (`@engenty/tool-harness`),
`packages/goose` (`@engenty/goose`), `packages/vault` (`@engenty/vault`),
`packages/plugins` (`@engenty/plugins`), `packages/browser` (`@engenty/browser`),
`packages/local-models` (`@engenty/local-models`) and `packages/model-setup` (`@engenty/model-setup`). They depend only on each other and on MIT or permissive
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ The wizard format, the runner and the libraries are MIT. The rest of the code is
|---|---|
| The wizard format: the fifteen files of `packages/shared` that define a wizard, read it and pack it as a `.wizard` file | MIT or FSL-1.1-MIT, your choice ([LICENSE-MIT](packages/shared/LICENSE-MIT)) |
| The runner, `packages/runner` | MIT ([LICENSE](packages/runner/LICENSE)) |
| The libraries `@engenty/chatviews`, `@engenty/decision-model`, `@engenty/search-index`, `@engenty/search-libsql`, `@engenty/goose`, `@engenty/vault`, `@engenty/plugins`, `@engenty/browser`, `@engenty/local-models` and `@engenty/model-setup` on npm, in `packages/chatviews`, `packages/decision-model`, `packages/search-index`, `packages/search-libsql`, `packages/goose`, `packages/vault`, `packages/plugins`, `packages/browser`, `packages/local-models` and `packages/model-setup` | MIT (the `LICENSE` in each folder) |
| The libraries `@engenty/chatviews`, `@engenty/decision-model`, `@engenty/search-index`, `@engenty/search-libsql`, `@engenty/tool-harness`, `@engenty/goose`, `@engenty/vault`, `@engenty/plugins`, `@engenty/browser`, `@engenty/local-models` and `@engenty/model-setup` on npm, in `packages/chatviews`, `packages/decision-model`, `packages/search-index`, `packages/search-libsql`, `packages/tool-harness`, `packages/goose`, `packages/vault`, `packages/plugins`, `packages/browser`, `packages/local-models` and `packages/model-setup` | MIT (the `LICENSE` in each folder) |
| The plugin for the AI apps, `plugin/`, without the engenty figures in it | MIT ([LICENSE](plugin/LICENSE)) |
| Everything else: the studio, the runtime, the `wizards` command, `@engenty/wizards` on npm | FSL-1.1-MIT ([LICENSE](LICENSE)) |
| The engenty figures as artwork | CC BY 4.0 ([LICENSE-FIGURES](LICENSE-FIGURES)) |
Expand Down
11 changes: 11 additions & 0 deletions apps/runtime/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ COPY packages/shared/package.json packages/shared/
COPY packages/wizards/package.json packages/wizards/
COPY packages/runner/package.json packages/runner/
COPY packages/local-models/package.json packages/local-models/
COPY packages/decision-model/package.json packages/decision-model/
COPY packages/search-index/package.json packages/search-index/
COPY packages/tool-harness/package.json packages/tool-harness/
COPY packages/model-setup/package.json packages/model-setup/
RUN sed -i 's/"version": *"[^"]*"/"version": "0.0.0"/' package.json

Expand Down Expand Up @@ -80,6 +83,8 @@ COPY --from=prod-deps /app/apps/runtime/node_modules ./apps/runtime/node_modules
COPY --from=prod-deps /app/packages/chatviews/node_modules ./packages/chatviews/node_modules
COPY --from=prod-deps /app/packages/shared/node_modules ./packages/shared/node_modules
COPY --from=prod-deps /app/packages/local-models/node_modules ./packages/local-models/node_modules
COPY --from=prod-deps /app/packages/decision-model/node_modules ./packages/decision-model/node_modules
COPY --from=prod-deps /app/packages/tool-harness/node_modules ./packages/tool-harness/node_modules
COPY --from=prod-deps /app/packages/model-setup/node_modules ./packages/model-setup/node_modules
# The built-in terminal (packages/model-setup/src/server/terminal.ts) needs node-pty's binary for this
# platform: an image whose terminal cannot start a command is not built.
Expand All @@ -92,6 +97,12 @@ COPY --from=build /app/packages/shared/package.json ./packages/shared/
COPY --from=build /app/packages/shared/dist ./packages/shared/dist
COPY --from=build /app/packages/wizards/package.json ./packages/wizards/
COPY --from=build /app/packages/wizards/dist ./packages/wizards/dist
COPY --from=build /app/packages/decision-model/package.json ./packages/decision-model/
COPY --from=build /app/packages/decision-model/dist ./packages/decision-model/dist
COPY --from=build /app/packages/search-index/package.json ./packages/search-index/
COPY --from=build /app/packages/search-index/dist ./packages/search-index/dist
COPY --from=build /app/packages/tool-harness/package.json ./packages/tool-harness/
COPY --from=build /app/packages/tool-harness/dist ./packages/tool-harness/dist
COPY --from=build /app/packages/local-models/package.json ./packages/local-models/
COPY --from=build /app/packages/local-models/dist ./packages/local-models/dist
COPY --from=build /app/packages/model-setup/package.json ./packages/model-setup/
Expand Down
3 changes: 3 additions & 0 deletions apps/runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
"@engenty/chatviews": "workspace:*",
"@engenty/local-models": "workspace:*",
"@engenty/model-setup": "workspace:*",
"@engenty/search-index": "workspace:*",
"@engenty/tool-harness": "workspace:*",
"@engenty/decision-model": "workspace:*",
"@engenty/wizards": "workspace:*",
"@engenty/wizards-shared": "workspace:*",
"@executor-js/plugin-openapi": "1.6.11",
Expand Down
10 changes: 7 additions & 3 deletions apps/runtime/src/agents/studio-assistant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ import {
import { ownedSpace, type SpaceRow, updateSpace } from "../services/spaces.js";
import { currentTenant } from "../tenants/tenant.js";
import { type ServerKey, serverText } from "../texts.js";
import { harnessed, harnessedModel, oneOfMany } from "../tools/harness.js";
import { assistantPageOf, assistantToolsOf } from "../tools/plugin.js";
import { attempt as attemptTool, imageOutput } from "../tools/shared.js";
import { gatewayWebSearch } from "../tools/web-search.js";
Expand Down Expand Up @@ -1180,12 +1181,14 @@ export async function runStudioAssistant(input: AssistantInput): Promise<Assista
tools.web_search = gatewayTools.perplexitySearch({ maxResults: 6 });
}
const instructions = system(switches.capabilities === true);
// The person's connections and the plugins' tools: many, and few of them in one chat.
const harness = harnessed(tools, resolved, (_name, tool) => oneOfMany(tool));
const agent = spaceAgent({
id: "studio-assistant",
name: "Studio assistant",
instructions,
resolved,
tools,
resolved: harnessedModel(resolved),
tools: harness.tools,
});
const page = input.page;
const pluginPage =
Expand Down Expand Up @@ -1235,6 +1238,7 @@ export async function runStudioAssistant(input: AssistantInput): Promise<Assista
: part === "skills"
? prompt("goose", "turn.skills_empty")
: "",
await harness.hint(input.message, input.signal),
input.message,
]
.filter(Boolean)
Expand All @@ -1244,7 +1248,7 @@ export async function runStudioAssistant(input: AssistantInput): Promise<Assista
system: instructions,
context,
history: history.messages.map((m) => ({ role: m.role, chars: m.content.length })),
tools: toolSizes(tools),
tools: toolSizes(harness.tools),
});
let reply = "";
// Where the part the result holds begins: a message written meanwhile cuts the answer there.
Expand Down
8 changes: 6 additions & 2 deletions apps/runtime/src/engine/decide.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export interface DecideInput {
signal?: AbortSignal;
/** A person waits: give up after this long, whichever way is answering. */
deadlineMs?: number;
/** Only a decision model answers: what it leaves open is an error, not a language model's. */
modelOnly?: boolean;
/** Books what the language model cost on the run. */
charge?: (usd: number) => Promise<void>;
}
Expand Down Expand Up @@ -116,8 +118,10 @@ export async function decide(input: DecideInput): Promise<Decision> {
if (!Object.keys(open).length) {
return { answers, source: "systemone" };
}
if (signal?.aborted) {
throw new DecisionError("No answer in time.");
if (signal?.aborted || input.modelOnly) {
throw new DecisionError(
signal?.aborted ? "No answer in time." : "The decision model left it open.",
);
}
const filled = await askLanguageModel(input, open, signal);
return {
Expand Down
34 changes: 19 additions & 15 deletions apps/runtime/src/services/work-ai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { pluginsOf } from "../plugins/registry.js";
import { prompt } from "../prompts.js";
import { type ExecResult, sandboxCapabilities, shellToolDescription } from "../sandbox/index.js";
import { currentTenant } from "../tenants/tenant.js";
import { harnessed, harnessedModel, oneOfMany } from "../tools/harness.js";
import { assistantToolPlugin, assistantToolRisk, assistantToolsOf } from "../tools/plugin.js";
import { clip } from "../tools/shared.js";
import { skillsBlock } from "../tools/skills.js";
Expand Down Expand Up @@ -373,21 +374,24 @@ export async function workTurn(
choice.web !== false ? toolAccess() : null,
]);
const client = turn.role === "client";
const made = gated(
await toolsFor(
resolved,
turn.space,
turn.userId,
signal,
choice,
turn.chatId,
null,
turn.role ?? null,
web,
),
turn,
const all = await toolsFor(
resolved,
turn.space,
turn.userId,
signal,
choice,
turn.chatId,
null,
turn.role ?? null,
web,
);
const tools = resolved.model instanceof ClientModel ? steps.wrap(made) : made;
// The connections' actions and the plugins' tools: many, and few of them in one chat.
const many = new Set(Object.keys(all).filter((name) => oneOfMany(all[name])));
const made = gated(all, turn);
const tools =
resolved.model instanceof ClientModel
? steps.wrap(made)
: sortedTools(harnessed(made, resolved, (name) => many.has(name)).tools);
attachTools(resolved, tools);
const skills = client ? null : await spaceSkills(turn.space.id);
const block = skills
Expand All @@ -409,7 +413,7 @@ export async function workTurn(
.join("\n")
: "";
return {
resolved,
resolved: harnessedModel(resolved),
tools,
instructions: [
instructionsFor(turn.space.name, block, "space_search" in tools, client),
Expand Down
4 changes: 4 additions & 0 deletions apps/runtime/src/tools/connections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ export interface ConnectionTool {
kind: ActionKind;
}

/** The tools that are a connection's action. */
export const connectionTools = new WeakSet<object>();

/** How the chat runs a confirmed action, once the AI has filled in its fields. */
export type WriteRunner = (tool: ConnectionTool, input: unknown) => Promise<unknown>;

Expand Down Expand Up @@ -194,6 +197,7 @@ export function makeConnectionTools(options: {
)
: options.write(tool, input),
});
connectionTools.add(tools[name] as object);
if (!read) {
writes.add(name);
}
Expand Down
Loading
Loading