Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ change follows, whether a person or a coding agent writes it.
## Releasing

Maintainers bump `version` in the root, `apps/hub`, `apps/web`,
`packages/client` and `packages/schemas` package.json files, run
`packages/client`, `packages/schemas`, `packages/tools-design` and
`packages/tools-hub` package.json files, run
`bun install`, and merge. Once the publish workflow for that commit on main has
finished, `git tag -s vX.Y.Z && git push origin vX.Y.Z` retags its hub and
sidecar images as `X.Y.Z` and publishes the GitHub release; a 0.x version or
Expand Down
2 changes: 2 additions & 0 deletions apps/hub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
"@corbits-builder/designer": "workspace:*",
"@corbits-builder/reviewer": "workspace:*",
"@corbits-builder/schemas": "workspace:*",
"@corbits-builder/tools-design": "workspace:*",
"@corbits-builder/tools-hub": "workspace:*",
"@corbits-builder/writer": "workspace:*",
"@corbits/agent-token": "0.2.2",
"@corbits/artifacts": "0.3.0",
Expand Down
28 changes: 28 additions & 0 deletions apps/hub/src/artifacts/design-bundle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { mkdir, rm, writeFile } from "node:fs/promises";
import { dirname, join, sep } from "node:path";
import { DesignBundle } from "@corbits-builder/schemas/artifact";

// Writes a bundle's files under root, skipping any path that would land outside it.
export async function writeBundle<T extends string | Uint8Array>(
root: string,
files: Readonly<Record<string, T>>,
) {
const written: Record<string, T> = {};
for (const [path, data] of Object.entries(files)) {
const target = join(root, path);
if (!target.startsWith(root + sep)) continue;
await mkdir(dirname(target), { recursive: true });
await writeFile(target, data);
written[path] = data;
}
return written;
}

// The coder builds against the design version its task names. It lands in .builder, which the
// coder's sandbox keeps read-only, so only the designer changes it.
export async function unpackDesign(content: string, workspace: string) {
const { files } = DesignBundle.assert(JSON.parse(content));
const root = join(workspace, ".builder");
await rm(root, { recursive: true, force: true });
return writeBundle(root, files);
}
2 changes: 1 addition & 1 deletion apps/hub/src/artifacts/design-draft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { hasCode } from "@intx/types";
import { packApp } from "../builds/app-snapshot.ts";
import { parseJson } from "../lib/json.ts";
import { ProjectError } from "../projects/errors.ts";
import { DESIGN_STYLES } from "./design-tweaks.ts";
import { DESIGN_STYLES } from "@corbits-builder/tools-design";
import { designStarterFiles } from "@corbits-builder/designer/skills" with { type: "macro" };

const STARTER_INDEX = designStarterFiles()[".builder/designs/index.html"];
Expand Down
169 changes: 0 additions & 169 deletions apps/hub/src/artifacts/design-tools.ts

This file was deleted.

7 changes: 5 additions & 2 deletions apps/hub/src/artifacts/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,11 @@ import {
appContent,
bundleFiles,
} from "../builds/app-snapshot.ts";
import { MAX_DESIGN_BYTES } from "./design-tools.ts";
import { DESIGN_STYLES, setThemeTokens } from "./design-tweaks.ts";
import {
DESIGN_STYLES,
MAX_DESIGN_BYTES,
setThemeTokens,
} from "@corbits-builder/tools-design";
import {
coordinatorTweaksNote,
designerTweaksNote,
Expand Down
9 changes: 5 additions & 4 deletions apps/hub/src/artifacts/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ import {
ArtifactReceipt,
} from "@corbits-builder/schemas/artifact";
import type { WorkflowRole } from "@corbits-builder/schemas/installed-workflows";
import { unpackDesign } from "./design-tools.ts";
import { unpackDesign } from "./design-bundle.ts";
import { projectScopeFailure } from "../workflows/project-scope.ts";
import {
projectScopeFailure,
resolveWorkflowProjectScope,
} from "../workflows/project-scope.ts";
import { workflowHttpJson, WorkflowHttpError } from "../workflows/http-json.ts";
workflowHttpJson,
WorkflowHttpError,
} from "@corbits-builder/tools-hub";

interface ArtifactToolEnv extends BaseEnv {
capabilities: RuntimeCapabilities;
Expand Down
2 changes: 1 addition & 1 deletion apps/hub/src/builds/app-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
mediatedHttpJson,
WorkflowHttpError,
workflowHttpJson,
} from "../workflows/http-json.ts";
} from "@corbits-builder/tools-hub";

const AppPushAccess = type({
path: "string",
Expand Down
5 changes: 4 additions & 1 deletion apps/hub/src/builds/app-snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ import {
DesignDraft,
MAX_APP_BYTES,
} from "@corbits-builder/schemas/artifact";
import { WorkflowHttpError, workflowHttpJson } from "../workflows/http-json.ts";
import {
WorkflowHttpError,
workflowHttpJson,
} from "@corbits-builder/tools-hub";
import { INPUTS_DIRECTORY } from "../config/inputs.ts";

// Installs and builds are rebuilt by setup and check-app, and .builder and the inputs come from
Expand Down
8 changes: 5 additions & 3 deletions apps/hub/src/builds/sidecar-tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ import {
type ToolRunner,
} from "@intx/types/runtime";
import type { RuntimeCapabilities } from "@intx/types/runtime-capabilities";
import { resolveWorkflowProjectScope } from "../workflows/project-scope.ts";
import { WorkflowHttpError } from "../workflows/http-json.ts";
import {
resolveWorkflowProjectScope,
WorkflowHttpError,
} from "@corbits-builder/tools-hub";
import { APP_STATUS_TOOL, createCodingTools } from "./coding-tools.ts";
import { createPosixBuildExecutor } from "./posix-sandbox.ts";
import { browserTools } from "./browser.ts";
Expand Down Expand Up @@ -55,7 +57,7 @@ import {
DESIGNS,
touchesDesigns,
type DesignCheck,
} from "./design-check.ts";
} from "@corbits-builder/tools-design";

// A model retries a refused absolute path verbatim until the doom guard ends the run, as with the
// workspace path with "/" typed for "-", or "/builder" meaning ".builder". Naming the workspace path
Expand Down
2 changes: 1 addition & 1 deletion apps/hub/src/builds/starter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
AppBundle,
type ArtifactContent,
} from "@corbits-builder/schemas/artifact";
import { unpackDesign, writeBundle } from "../artifacts/design-tools.ts";
import { unpackDesign, writeBundle } from "../artifacts/design-bundle.ts";
import { bundleFiles } from "./app-snapshot.ts";
import type { AppRepository } from "./app-repository.ts";
import {
Expand Down
2 changes: 1 addition & 1 deletion apps/hub/src/live-app/host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { liveAppWording } from "../config/live-app.ts";
import { errorCode } from "../request-error.ts";
import type { HostReport } from "./host-report.ts";
import { parseJson } from "../lib/json.ts";
import { writeBundle } from "../artifacts/design-tools.ts";
import { writeBundle } from "../artifacts/design-bundle.ts";
import { bundleFiles, collectApp } from "../builds/app-snapshot.ts";
import { buildPackageLayout } from "../builds/package-layout.ts";
import {
Expand Down
7 changes: 4 additions & 3 deletions apps/hub/src/projects/deploy-tools.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { projectScopeFailure } from "../workflows/project-scope.ts";
import {
projectScopeFailure,
resolveWorkflowProjectScope,
} from "../workflows/project-scope.ts";
workflowHttpJson,
WorkflowHttpError,
} from "@corbits-builder/tools-hub";
import {
defineTool,
type BaseEnv,
Expand Down Expand Up @@ -50,7 +52,6 @@ import {
designLookIdeas,
} from "../config/design.ts";
import { QUESTIONS_ASKED } from "../config/questions.ts";
import { workflowHttpJson, WorkflowHttpError } from "../workflows/http-json.ts";
import { assignmentToWriterMessage } from "../workflows/writer-task.ts";
import { coderTaskMessage } from "@corbits-builder/coder/contract";

Expand Down
2 changes: 1 addition & 1 deletion apps/hub/src/workflows/compaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {
RetryPolicy,
} from "@intx/types/runtime";
import { REPETITION_ABORT } from "../inference/repetition.ts";
import { CHECK_DESIGN_TOOL } from "../builds/design-check.ts";
import { CHECK_DESIGN_TOOL } from "@corbits-builder/tools-design";

const COMPACTOR = "@corbits-builder/trim-history";
// Old tool arguments and results longer than this are replaced by a note saying what they were. Never
Expand Down
5 changes: 3 additions & 2 deletions apps/hub/src/workflows/entries/designer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import {
createSidecarCodingTools,
type CodingSidecarEnv,
} from "../../builds/sidecar-tools.ts";
import { createDesignTools } from "../../artifacts/design-tools.ts";
import { createDesignTools } from "@corbits-builder/tools-design/sidecar-bundle";
import { failure } from "../../artifacts/tools.ts";
import { roleInference } from "../role-inference.ts";
import {
compactingDirector,
Expand All @@ -27,7 +28,7 @@ const agent = createDesignerAgent<CodingSidecarEnv & MailToolEnv>({
standards: [],
inference: { ...source, parameters },
tools: [
createDesignTools(),
createDesignTools({ failure }),
mail,
createSidecarCodingTools({ approval: "allow", workspace: "design" }),
],
Expand Down
Loading