@hasna/nopen 0.0.1
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/README.md +52 -0
- package/dist/adapters/cloudflare.d.ts +136 -0
- package/dist/adapters/cloudflare.d.ts.map +1 -0
- package/dist/adapters/deployment.d.ts +50 -0
- package/dist/adapters/deployment.d.ts.map +1 -0
- package/dist/adapters/domains.d.ts +44 -0
- package/dist/adapters/domains.d.ts.map +1 -0
- package/dist/adapters/email.d.ts +20 -0
- package/dist/adapters/email.d.ts.map +1 -0
- package/dist/adapters/index.d.ts +3 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/sandbox.d.ts +82 -0
- package/dist/adapters/sandbox.d.ts.map +1 -0
- package/dist/adapters/skills.d.ts +19 -0
- package/dist/adapters/skills.d.ts.map +1 -0
- package/dist/adapters/stripe.d.ts +85 -0
- package/dist/adapters/stripe.d.ts.map +1 -0
- package/dist/agents/architect.d.ts +26 -0
- package/dist/agents/architect.d.ts.map +1 -0
- package/dist/agents/autopilot.d.ts +23 -0
- package/dist/agents/autopilot.d.ts.map +1 -0
- package/dist/agents/build.d.ts +31 -0
- package/dist/agents/build.d.ts.map +1 -0
- package/dist/agents/coders.d.ts +77 -0
- package/dist/agents/coders.d.ts.map +1 -0
- package/dist/agents/deploy-guard.d.ts +18 -0
- package/dist/agents/deploy-guard.d.ts.map +1 -0
- package/dist/agents/digest.d.ts +12 -0
- package/dist/agents/digest.d.ts.map +1 -0
- package/dist/agents/goal-build.d.ts +43 -0
- package/dist/agents/goal-build.d.ts.map +1 -0
- package/dist/agents/harness.d.ts +56 -0
- package/dist/agents/harness.d.ts.map +1 -0
- package/dist/agents/index.d.ts +10 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/launch.d.ts +23 -0
- package/dist/agents/launch.d.ts.map +1 -0
- package/dist/agents/loop.d.ts +24 -0
- package/dist/agents/loop.d.ts.map +1 -0
- package/dist/agents/models.d.ts +7 -0
- package/dist/agents/models.d.ts.map +1 -0
- package/dist/agents/moderation.d.ts +22 -0
- package/dist/agents/moderation.d.ts.map +1 -0
- package/dist/agents/planner.d.ts +40 -0
- package/dist/agents/planner.d.ts.map +1 -0
- package/dist/agents/reconciler.d.ts +7 -0
- package/dist/agents/reconciler.d.ts.map +1 -0
- package/dist/agents/reviewer.d.ts +56 -0
- package/dist/agents/reviewer.d.ts.map +1 -0
- package/dist/agents/scaffolds.d.ts +36 -0
- package/dist/agents/scaffolds.d.ts.map +1 -0
- package/dist/agents/scheduler.d.ts +19 -0
- package/dist/agents/scheduler.d.ts.map +1 -0
- package/dist/agents/seeder.d.ts +16 -0
- package/dist/agents/seeder.d.ts.map +1 -0
- package/dist/agents/tools.d.ts +70 -0
- package/dist/agents/tools.d.ts.map +1 -0
- package/dist/agents/workers.d.ts +25 -0
- package/dist/agents/workers.d.ts.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +68984 -0
- package/dist/db/client.d.ts +32 -0
- package/dist/db/client.d.ts.map +1 -0
- package/dist/db/index.d.ts +2 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/migrate.d.ts +3 -0
- package/dist/db/migrate.d.ts.map +1 -0
- package/dist/db/repo.d.ts +320 -0
- package/dist/db/repo.d.ts.map +1 -0
- package/dist/db/rls.d.ts +16 -0
- package/dist/db/rls.d.ts.map +1 -0
- package/dist/db/schema.d.ts +3391 -0
- package/dist/db/schema.d.ts.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +85 -0
- package/dist/lib/auth.d.ts +65 -0
- package/dist/lib/auth.d.ts.map +1 -0
- package/dist/lib/build-agents.d.ts +81 -0
- package/dist/lib/build-agents.d.ts.map +1 -0
- package/dist/lib/checkout.d.ts +24 -0
- package/dist/lib/checkout.d.ts.map +1 -0
- package/dist/lib/client.d.ts +52 -0
- package/dist/lib/client.d.ts.map +1 -0
- package/dist/lib/config.d.ts +118 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/connect.d.ts +14 -0
- package/dist/lib/connect.d.ts.map +1 -0
- package/dist/lib/credits.d.ts +52 -0
- package/dist/lib/credits.d.ts.map +1 -0
- package/dist/lib/doctor.d.ts +25 -0
- package/dist/lib/doctor.d.ts.map +1 -0
- package/dist/lib/ingest.d.ts +9 -0
- package/dist/lib/ingest.d.ts.map +1 -0
- package/dist/lib/iprate.d.ts +26 -0
- package/dist/lib/iprate.d.ts.map +1 -0
- package/dist/lib/mailer.d.ts +15 -0
- package/dist/lib/mailer.d.ts.map +1 -0
- package/dist/lib/oauth.d.ts +10 -0
- package/dist/lib/oauth.d.ts.map +1 -0
- package/dist/lib/ratelimit.d.ts +14 -0
- package/dist/lib/ratelimit.d.ts.map +1 -0
- package/dist/lib/site-template.d.ts +73 -0
- package/dist/lib/site-template.d.ts.map +1 -0
- package/dist/lib/task-charge.d.ts +10 -0
- package/dist/lib/task-charge.d.ts.map +1 -0
- package/dist/mcp/index.d.ts +3 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +5265 -0
- package/dist/sdk/index.d.ts +18 -0
- package/dist/sdk/index.d.ts.map +1 -0
- package/dist/sdk/index.js +4246 -0
- package/dist/types/index.d.ts +51 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +81 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { type ModelRole } from "./models.js";
|
|
2
|
+
import { type BuildAgent, type BuildChoice } from "../lib/build-agents.js";
|
|
3
|
+
import type { Sandbox } from "../adapters/sandbox.js";
|
|
4
|
+
import type { SiteSpec } from "../lib/site-template.js";
|
|
5
|
+
export type CoderRole = "content" | "frontend" | "backend";
|
|
6
|
+
export interface CoderContext {
|
|
7
|
+
spec: SiteSpec;
|
|
8
|
+
/** Absolute project dir inside the sandbox. */
|
|
9
|
+
workdir: string;
|
|
10
|
+
/** File this coder owns (relative to workdir). */
|
|
11
|
+
target: string;
|
|
12
|
+
/** Natural-language instruction for this role. */
|
|
13
|
+
instruction: string;
|
|
14
|
+
/** Current (seed) content of the target file. */
|
|
15
|
+
seed: string;
|
|
16
|
+
}
|
|
17
|
+
export interface CoderResult {
|
|
18
|
+
role: CoderRole;
|
|
19
|
+
/** Which engine ran (white-labeled display name). */
|
|
20
|
+
coder: string;
|
|
21
|
+
ok: boolean;
|
|
22
|
+
/** True when the coder actually changed the file (vs left the seed). */
|
|
23
|
+
changed: boolean;
|
|
24
|
+
summary: string;
|
|
25
|
+
logs: string;
|
|
26
|
+
}
|
|
27
|
+
export interface Coder {
|
|
28
|
+
readonly role: CoderRole;
|
|
29
|
+
readonly name: string;
|
|
30
|
+
run(sb: Sandbox, ctx: CoderContext): Promise<CoderResult>;
|
|
31
|
+
}
|
|
32
|
+
/** Authors the target file with the role's model SDK, validates it locally for
|
|
33
|
+
* the required export/shape, and writes it into the sandbox. */
|
|
34
|
+
export declare class SdkCoder implements Coder {
|
|
35
|
+
readonly role: CoderRole;
|
|
36
|
+
readonly name: string;
|
|
37
|
+
private opts;
|
|
38
|
+
constructor(role: CoderRole, name: string, opts: {
|
|
39
|
+
modelRole: ModelRole;
|
|
40
|
+
/** Used if the primary provider errors (e.g. a stale key) so the role still authors. */
|
|
41
|
+
fallbackModelRole?: ModelRole;
|
|
42
|
+
enabled: () => boolean;
|
|
43
|
+
/** Quick structural check the authored file must pass to be accepted. */
|
|
44
|
+
validate: (content: string) => boolean;
|
|
45
|
+
system: string;
|
|
46
|
+
});
|
|
47
|
+
private author;
|
|
48
|
+
run(sb: Sandbox, ctx: CoderContext): Promise<CoderResult>;
|
|
49
|
+
}
|
|
50
|
+
/** Installs + runs the real agent CLI INSIDE the sandbox against the project. */
|
|
51
|
+
export declare class CliCoder implements Coder {
|
|
52
|
+
readonly role: CoderRole;
|
|
53
|
+
readonly name: string;
|
|
54
|
+
private opts;
|
|
55
|
+
constructor(role: CoderRole, name: string, opts: {
|
|
56
|
+
enabled: () => boolean;
|
|
57
|
+
install: string;
|
|
58
|
+
command: (ctx: CoderContext) => string;
|
|
59
|
+
env: () => Record<string, string>;
|
|
60
|
+
});
|
|
61
|
+
run(sb: Sandbox, ctx: CoderContext): Promise<CoderResult>;
|
|
62
|
+
}
|
|
63
|
+
/** One SDK coder for a role, bound to the SELECTED agent's provider. */
|
|
64
|
+
export declare function sdkCoderFor(agent: BuildAgent, role: CoderRole): Coder;
|
|
65
|
+
/** One CLI coder for a role, running the SELECTED agent's real CLI in the sandbox. */
|
|
66
|
+
export declare function cliCoderFor(agent: BuildAgent, role: CoderRole): Coder;
|
|
67
|
+
/**
|
|
68
|
+
* The coder fleet for a build choice. The ONE selected agent authors EVERY file
|
|
69
|
+
* (content + frontend + backend) — it is full-stack. Standard = the agent's model
|
|
70
|
+
* authors each file (single pass); expert = the agent's real CLI runs autonomously
|
|
71
|
+
* in the sandbox for each concern. Both then go through the same assemble/validate.
|
|
72
|
+
*/
|
|
73
|
+
export declare function coderFleetFor(build: BuildChoice | {
|
|
74
|
+
agent?: unknown;
|
|
75
|
+
expert?: unknown;
|
|
76
|
+
} | null | undefined): Record<CoderRole, Coder>;
|
|
77
|
+
//# sourceMappingURL=coders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coders.d.ts","sourceRoot":"","sources":["../../src/agents/coders.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deploy-safety gate — a static scan of the assembled Worker module before it is
|
|
3
|
+
* published. Agent-authored code (api.mjs/render.mjs) could try to turn the site
|
|
4
|
+
* into an open proxy/redirector, exfiltrate via outbound fetch, eval injected
|
|
5
|
+
* code, or strip the CSP. Autopilot publishes continuously, so this runs on
|
|
6
|
+
* EVERY deploy and hard-blocks violations.
|
|
7
|
+
*
|
|
8
|
+
* The embedded data constants (HTML/CONTENT, which are JSON strings produced by
|
|
9
|
+
* the assembler) are stripped before scanning so marketing copy can't trip the
|
|
10
|
+
* server-code checks; the visitor-facing HTML is already constrained by the CSP.
|
|
11
|
+
*/
|
|
12
|
+
export interface ScanResult {
|
|
13
|
+
ok: boolean;
|
|
14
|
+
violations: string[];
|
|
15
|
+
}
|
|
16
|
+
/** Scan a Worker ES-module source string. Returns ok=false with reasons if unsafe. */
|
|
17
|
+
export declare function scanWorkerModule(module: string): ScanResult;
|
|
18
|
+
//# sourceMappingURL=deploy-guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy-guard.d.ts","sourceRoot":"","sources":["../../src/agents/deploy-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,OAAO,CAAC;IACZ,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAgBD,sFAAsF;AACtF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAkB3D"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface Digest {
|
|
2
|
+
email: string;
|
|
3
|
+
subject: string;
|
|
4
|
+
html: string;
|
|
5
|
+
text: string;
|
|
6
|
+
appCount: number;
|
|
7
|
+
}
|
|
8
|
+
/** Build a digest for one user, or null if they have no apps. */
|
|
9
|
+
export declare function buildDigest(userId: string): Promise<Digest | null>;
|
|
10
|
+
/** Send a weekly digest to every owner that has apps. Returns count sent. */
|
|
11
|
+
export declare function sendWeeklyDigests(): Promise<number>;
|
|
12
|
+
//# sourceMappingURL=digest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"digest.d.ts","sourceRoot":"","sources":["../../src/agents/digest.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,iEAAiE;AACjE,wBAAsB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA2CxE;AAMD,6EAA6E;AAC7E,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC,CAczD"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Sandbox } from "../adapters/sandbox.js";
|
|
2
|
+
import type { SiteSpec } from "../lib/site-template.js";
|
|
3
|
+
/** Drive the coding agent one round toward `goal` in `workdir` (edits files in place). */
|
|
4
|
+
export type AgentRun = (sb: Sandbox, args: {
|
|
5
|
+
workdir: string;
|
|
6
|
+
goal: string;
|
|
7
|
+
feedback?: string;
|
|
8
|
+
}) => Promise<string>;
|
|
9
|
+
export interface GoalBuildResult {
|
|
10
|
+
ok: boolean;
|
|
11
|
+
iterations: number;
|
|
12
|
+
logs: string[];
|
|
13
|
+
}
|
|
14
|
+
export interface GoalBuildOptions {
|
|
15
|
+
workdir: string;
|
|
16
|
+
goal: string;
|
|
17
|
+
agentRun: AgentRun;
|
|
18
|
+
/** Returns true when the build+smoke passes; called after each round. */
|
|
19
|
+
validate: (sb: Sandbox, workdir: string) => Promise<boolean>;
|
|
20
|
+
maxIters?: number;
|
|
21
|
+
log?: (m: string) => void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Run the goal loop: agent authors/edits → validate (build+smoke) → if it passes,
|
|
25
|
+
* done; else feed the failing transcript back and retry, up to `maxIters`.
|
|
26
|
+
*/
|
|
27
|
+
export declare function runGoalBuild(sb: Sandbox, opts: GoalBuildOptions): Promise<GoalBuildResult>;
|
|
28
|
+
/** The goal text handed to the agent for a site build. */
|
|
29
|
+
export declare function siteBuildGoal(spec: SiteSpec): string;
|
|
30
|
+
/** The goal-loop builder runs for the premium "cloud" engine when enabled + keyed. */
|
|
31
|
+
export declare function goalBuildEnabled(agent: string): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* The goal-loop iteration budget for a build. An EXPERT cloud build buys a bigger
|
|
34
|
+
* budget (roughly double, still bounded by config) so the +2cr surcharge does real
|
|
35
|
+
* work — more self-correcting rounds — instead of running an identical loop.
|
|
36
|
+
*/
|
|
37
|
+
export declare function goalBuildMaxIters(expert: boolean): number;
|
|
38
|
+
/**
|
|
39
|
+
* Real cloud agent run: Claude Agent SDK / Claude Code headless in the sandbox,
|
|
40
|
+
* with Edit/Write/Read/Bash so it authors files AND runs the smoke test itself.
|
|
41
|
+
*/
|
|
42
|
+
export declare const cloudAgentRun: AgentRun;
|
|
43
|
+
//# sourceMappingURL=goal-build.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goal-build.d.ts","sourceRoot":"","sources":["../../src/agents/goal-build.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,0FAA0F;AAC1F,MAAM,MAAM,QAAQ,GAAG,CACrB,EAAE,EAAE,OAAO,EACX,IAAI,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,KACvD,OAAO,CAAC,MAAM,CAAC,CAAC;AAErB,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,OAAO,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,QAAQ,CAAC;IACnB,yEAAyE;IACzE,QAAQ,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3B;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC,CAehG;AAED,0DAA0D;AAC1D,wBAAgB,aAAa,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAQpD;AAED,sFAAsF;AACtF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAGzD;AAMD;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,QAY3B,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type SandboxProvider } from "../adapters/sandbox.js";
|
|
2
|
+
import { type Coder, type CoderResult, type CoderRole } from "./coders.js";
|
|
3
|
+
import { type BuildChoice } from "../lib/build-agents.js";
|
|
4
|
+
import { type ReviewGateOptions, type ReviewGateResult } from "./reviewer.js";
|
|
5
|
+
import { type AgentRun } from "./goal-build.js";
|
|
6
|
+
import type { SiteSpec } from "../lib/site-template.js";
|
|
7
|
+
export declare class SandboxUnavailableError extends Error {
|
|
8
|
+
constructor();
|
|
9
|
+
}
|
|
10
|
+
export interface HarnessOptions {
|
|
11
|
+
provider?: SandboxProvider | null;
|
|
12
|
+
coders?: Record<CoderRole, Coder>;
|
|
13
|
+
onProgress?: (msg: string) => void;
|
|
14
|
+
/** Extra content pages (from Grow workers) to publish at /p/:slug. */
|
|
15
|
+
pages?: ContentPage[];
|
|
16
|
+
/** Platform ingest URL for the site's subscribe form (audience capture). */
|
|
17
|
+
subscribeUrl?: string;
|
|
18
|
+
/** Platform pageview-beacon URL (traffic analytics). */
|
|
19
|
+
analyticsUrl?: string;
|
|
20
|
+
/** Which engine builds the app + whether it's an expert run. */
|
|
21
|
+
build?: BuildChoice;
|
|
22
|
+
/** Optional review gate (white-labeled). When present, a real agent build is
|
|
23
|
+
* reviewed before go-live; a build it can't approve reverts to the safe seed. */
|
|
24
|
+
review?: Pick<ReviewGateOptions, "reviewer" | "fixer" | "maxFixes">;
|
|
25
|
+
/** Optional goal-loop builder (the premium "cloud" engine). When present, ONE
|
|
26
|
+
* goal-directed agent session authors the whole app and iterates until smoke
|
|
27
|
+
* passes, replacing the per-role coder fleet for this build. */
|
|
28
|
+
builder?: {
|
|
29
|
+
agentRun: AgentRun;
|
|
30
|
+
maxIters?: number;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export interface HarnessResult {
|
|
34
|
+
ok: boolean;
|
|
35
|
+
/** The final, validated Worker ES-module source. */
|
|
36
|
+
workerModule: string;
|
|
37
|
+
sandboxId: string;
|
|
38
|
+
roles: CoderResult[];
|
|
39
|
+
usedSeedFallback: boolean;
|
|
40
|
+
logs: string;
|
|
41
|
+
/** Which engine actually authored the app ("cloud"|"codewith"|"seed"). */
|
|
42
|
+
agentUsed: string;
|
|
43
|
+
/** True when the requested agent/expert couldn't run and a cheaper path was used. */
|
|
44
|
+
downgraded: boolean;
|
|
45
|
+
/** Review-gate outcome, when the gate ran. */
|
|
46
|
+
review?: ReviewGateResult;
|
|
47
|
+
}
|
|
48
|
+
/** Run the build inside a sandbox and return the validated worker module. */
|
|
49
|
+
export declare function buildSiteInSandbox(spec: SiteSpec, opts?: HarnessOptions): Promise<HarnessResult>;
|
|
50
|
+
export interface ContentPage {
|
|
51
|
+
slug: string;
|
|
52
|
+
title: string;
|
|
53
|
+
html: string;
|
|
54
|
+
}
|
|
55
|
+
export declare function seedFiles(spec: SiteSpec, pages?: ContentPage[], subscribeUrl?: string, analyticsUrl?: string): Record<string, string>;
|
|
56
|
+
//# sourceMappingURL=harness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"harness.d.ts","sourceRoot":"","sources":["../../src/agents/harness.ts"],"names":[],"mappings":"AAgBA,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAiB,KAAK,KAAK,EAAE,KAAK,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAC1F,OAAO,EAAE,KAAK,WAAW,EAAwB,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAiB,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC7F,OAAO,EAA+B,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,qBAAa,uBAAwB,SAAQ,KAAK;;CAKjD;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAClC,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,sEAAsE;IACtE,KAAK,CAAC,EAAE,WAAW,EAAE,CAAC;IACtB,4EAA4E;IAC5E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wDAAwD;IACxD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gEAAgE;IAChE,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB;sFACkF;IAClF,MAAM,CAAC,EAAE,IAAI,CAAC,iBAAiB,EAAE,UAAU,GAAG,OAAO,GAAG,UAAU,CAAC,CAAC;IACpE;;qEAEiE;IACjE,OAAO,CAAC,EAAE;QAAE,QAAQ,EAAE,QAAQ,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACrD;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,OAAO,CAAC;IACZ,oDAAoD;IACpD,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,0EAA0E;IAC1E,SAAS,EAAE,MAAM,CAAC;IAClB,qFAAqF;IACrF,UAAU,EAAE,OAAO,CAAC;IACpB,8CAA8C;IAC9C,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B;AAuBD,6EAA6E;AAC7E,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,QAAQ,EACd,IAAI,GAAE,cAAmB,GACxB,OAAO,CAAC,aAAa,CAAC,CA8HxB;AA2BD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,GAAE,WAAW,EAAO,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAoBzI"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface AgenticResult {
|
|
2
|
+
text: string;
|
|
3
|
+
steps: number;
|
|
4
|
+
toolCalls: string[];
|
|
5
|
+
}
|
|
6
|
+
export declare function runAgenticBuild(goal: string, opts?: {
|
|
7
|
+
maxSteps?: number;
|
|
8
|
+
onProgress?: (m: string) => void;
|
|
9
|
+
}): Promise<AgenticResult>;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CAAO,GACjE,OAAO,CAAC,aAAa,CAAC,CAkBxB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Worker } from "./workers.js";
|
|
2
|
+
/** Create the site row immediately (status "planning") so the UI has something to
|
|
3
|
+
* poll while the heavy pipeline (architect → seed → build) runs in the background.
|
|
4
|
+
* The build choice (which agent + expert), the user's domain decision, and any
|
|
5
|
+
* domain suggestions they were shown are persisted now so the seeder, the build
|
|
6
|
+
* worker, and the per-build credit charge all honor them. */
|
|
7
|
+
export declare function startLaunch(prompt: string, userId: string, build?: {
|
|
8
|
+
agent?: unknown;
|
|
9
|
+
expert?: unknown;
|
|
10
|
+
} | null, opts?: {
|
|
11
|
+
buyDomain?: boolean;
|
|
12
|
+
domains?: string[];
|
|
13
|
+
}): Promise<{
|
|
14
|
+
siteId: string;
|
|
15
|
+
}>;
|
|
16
|
+
/** The heavy half of a launch, runnable in the background after startLaunch.
|
|
17
|
+
* Moderates, architects, seeds the scaffold, and runs the first build cycle,
|
|
18
|
+
* moving site.status through the phases the dashboard renders. */
|
|
19
|
+
export declare function continueLaunch(siteId: string, prompt: string, opts: {
|
|
20
|
+
registry?: Record<string, Worker>;
|
|
21
|
+
onProgress?: (m: string) => void;
|
|
22
|
+
}): Promise<void>;
|
|
23
|
+
//# sourceMappingURL=launch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launch.d.ts","sourceRoot":"","sources":["../../src/agents/launch.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C;;;;8DAI8D;AAC9D,wBAAsB,WAAW,CAC/B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,EACpD,IAAI,GAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;CAAO,GACrD,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAW7B;AAED;;mEAEmE;AACnE,wBAAsB,cAAc,CAClC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,IAAI,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,GAC5E,OAAO,CAAC,IAAI,CAAC,CAkCf"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type SiteSpec } from "../lib/site-template.js";
|
|
2
|
+
import type { RegistrantContact } from "../adapters/cloudflare.js";
|
|
3
|
+
export interface BuildOptions {
|
|
4
|
+
agentName?: string;
|
|
5
|
+
userId?: string;
|
|
6
|
+
maxIterations?: number;
|
|
7
|
+
/** Buy a real domain + attach it (spends money). Off by default. */
|
|
8
|
+
buyDomain?: boolean;
|
|
9
|
+
contact?: RegistrantContact;
|
|
10
|
+
/** Optional callback for streaming progress (CLI/MCP). */
|
|
11
|
+
onProgress?: (msg: string) => void;
|
|
12
|
+
}
|
|
13
|
+
export interface BuildResult {
|
|
14
|
+
siteId: string;
|
|
15
|
+
runId: string;
|
|
16
|
+
status: "live" | "failed";
|
|
17
|
+
url: string | null;
|
|
18
|
+
domain: string | null;
|
|
19
|
+
iterations: number;
|
|
20
|
+
spec: SiteSpec | null;
|
|
21
|
+
}
|
|
22
|
+
/** Run the autonomous closed loop for one site. */
|
|
23
|
+
export declare function runSiteBuild(prompt: string, opts?: BuildOptions): Promise<BuildResult>;
|
|
24
|
+
//# sourceMappingURL=loop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loop.d.ts","sourceRoot":"","sources":["../../src/agents/loop.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAIxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAGnE,MAAM,WAAW,YAAY;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oEAAoE;IACpE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,0DAA0D;IAC1D,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC1B,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;CACvB;AAaD,mDAAmD;AACnD,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,YAAiB,GACtB,OAAO,CAAC,WAAW,CAAC,CAgHtB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const anthropic: import("@ai-sdk/anthropic").AnthropicProvider;
|
|
2
|
+
declare const openai: import("@ai-sdk/openai").OpenAIProvider;
|
|
3
|
+
export type ModelRole = "architect" | "builder" | "fast";
|
|
4
|
+
/** Resolve an ai-sdk LanguageModel for a role. */
|
|
5
|
+
export declare function model(role: ModelRole): import("@ai-sdk/provider").LanguageModelV3;
|
|
6
|
+
export { anthropic, openai };
|
|
7
|
+
//# sourceMappingURL=models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/agents/models.ts"],"names":[],"mappings":"AAQA,QAAA,MAAM,SAAS,+CAAsD,CAAC;AACtE,QAAA,MAAM,MAAM,yCAAgD,CAAC;AAE7D,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,MAAM,CAAC;AAEzD,kDAAkD;AAClD,wBAAgB,KAAK,CAAC,IAAI,EAAE,SAAS,8CASpC;AAED,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface ModerationResult {
|
|
2
|
+
allowed: boolean;
|
|
3
|
+
category: string;
|
|
4
|
+
reason: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Screen a prompt. Keyword block first; model backstop when configured.
|
|
8
|
+
*
|
|
9
|
+
* On classifier error we FAIL CLOSED (block), not open: the system publishes fully
|
|
10
|
+
* autonomously on a shared Cloudflare account, so a borderline prompt that the cheap
|
|
11
|
+
* keyword screen didn't catch must not slip through just because the model had a
|
|
12
|
+
* transient outage. The owner can retry; that's cheaper than shipping abuse.
|
|
13
|
+
* `classify` is injectable for testing.
|
|
14
|
+
*/
|
|
15
|
+
export declare function moderatePrompt(prompt: string, opts?: {
|
|
16
|
+
classify?: (prompt: string) => Promise<ModerationResult>;
|
|
17
|
+
}): Promise<ModerationResult>;
|
|
18
|
+
export declare class ModerationError extends Error {
|
|
19
|
+
result: ModerationResult;
|
|
20
|
+
constructor(result: ModerationResult);
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=moderation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moderation.d.ts","sourceRoot":"","sources":["../../src/agents/moderation.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAyCD;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,MAAM,EACd,IAAI,GAAE;IAAE,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAA;CAAO,GACtE,OAAO,CAAC,gBAAgB,CAAC,CAyB3B;AAoBD,qBAAa,eAAgB,SAAQ,KAAK;IACrB,MAAM,EAAE,gBAAgB;gBAAxB,MAAM,EAAE,gBAAgB;CAI5C"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export type PlanEvent = {
|
|
2
|
+
type: "phase";
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
} | {
|
|
6
|
+
type: "phase_done";
|
|
7
|
+
key: string;
|
|
8
|
+
detail?: string;
|
|
9
|
+
} | {
|
|
10
|
+
type: "research";
|
|
11
|
+
items: string[];
|
|
12
|
+
} | {
|
|
13
|
+
type: "offer";
|
|
14
|
+
title: string;
|
|
15
|
+
tagline: string;
|
|
16
|
+
northStar: string;
|
|
17
|
+
successMetric: string;
|
|
18
|
+
} | {
|
|
19
|
+
type: "domain_check";
|
|
20
|
+
domain: string;
|
|
21
|
+
available: boolean | null;
|
|
22
|
+
priceCents: number | null;
|
|
23
|
+
} | {
|
|
24
|
+
type: "plan";
|
|
25
|
+
groups: Array<{
|
|
26
|
+
category: string;
|
|
27
|
+
tasks: string[];
|
|
28
|
+
}>;
|
|
29
|
+
credits: number;
|
|
30
|
+
} | {
|
|
31
|
+
type: "done";
|
|
32
|
+
} | {
|
|
33
|
+
type: "error";
|
|
34
|
+
message: string;
|
|
35
|
+
};
|
|
36
|
+
/** Stream the planning process for a business idea. */
|
|
37
|
+
export declare function planBusiness(prompt: string): AsyncGenerator<PlanEvent>;
|
|
38
|
+
/** Non-streaming convenience (used by tests). */
|
|
39
|
+
export declare function planBusinessOnce(prompt: string): Promise<PlanEvent[]>;
|
|
40
|
+
//# sourceMappingURL=planner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planner.d.ts","sourceRoot":"","sources":["../../src/agents/planner.ts"],"names":[],"mappings":"AAgBA,MAAM,MAAM,SAAS,GACjB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC7C;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GACpD;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GAC3F;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAAC;IAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAC9F;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,KAAK,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACvF;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAKvC,uDAAuD;AACvD,wBAAuB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,CAAC,SAAS,CAAC,CA0F7E;AAED,iDAAiD;AACjD,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAI3E"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface ReconcileResult {
|
|
2
|
+
domain: string;
|
|
3
|
+
live: boolean;
|
|
4
|
+
}
|
|
5
|
+
/** Reconcile all sites that have a domain but aren't verified live on it. */
|
|
6
|
+
export declare function reconcileDomains(onProgress?: (m: string) => void): Promise<ReconcileResult[]>;
|
|
7
|
+
//# sourceMappingURL=reconciler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconciler.d.ts","sourceRoot":"","sources":["../../src/agents/reconciler.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;CACf;AAED,6EAA6E;AAC7E,wBAAsB,gBAAgB,CACpC,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,GAC/B,OAAO,CAAC,eAAe,EAAE,CAAC,CAyC5B"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Sandbox } from "../adapters/sandbox.js";
|
|
2
|
+
export interface ReviewVerdict {
|
|
3
|
+
approved: boolean;
|
|
4
|
+
issues: string[];
|
|
5
|
+
/** True when the reviewer could NOT reach a verdict (CLI failed to run, empty
|
|
6
|
+
* output, or no recognizable verdict token). Distinct from a definite reject:
|
|
7
|
+
* the gate fails OPEN on this (keeps the already-smoke-passing agent build). */
|
|
8
|
+
inconclusive?: boolean;
|
|
9
|
+
/** Raw reviewer output (truncated), for logs/telemetry. */
|
|
10
|
+
raw: string;
|
|
11
|
+
}
|
|
12
|
+
/** A definite rejection = not approved AND the reviewer actually reached a verdict. */
|
|
13
|
+
export declare function isDefiniteReject(v: ReviewVerdict): boolean;
|
|
14
|
+
export interface Reviewer {
|
|
15
|
+
/** Review the project in `workdir`. MUST NOT throw on a failed review — return
|
|
16
|
+
* `approved:false` with issues so the gate can decide. */
|
|
17
|
+
review(sb: Sandbox, workdir: string): Promise<ReviewVerdict>;
|
|
18
|
+
}
|
|
19
|
+
export interface Fixer {
|
|
20
|
+
/** Best-effort, in-sandbox fix of the listed issues in `workdir`. */
|
|
21
|
+
fix(sb: Sandbox, workdir: string, issues: string[]): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
/** Re-run the build+smoke after a fix; the gate rejects a fix that breaks it. */
|
|
24
|
+
export type Revalidate = (sb: Sandbox, workdir: string) => Promise<boolean>;
|
|
25
|
+
export interface ReviewGateResult {
|
|
26
|
+
approved: boolean;
|
|
27
|
+
attempts: number;
|
|
28
|
+
fixesApplied: number;
|
|
29
|
+
verdict: ReviewVerdict;
|
|
30
|
+
}
|
|
31
|
+
export interface ReviewGateOptions {
|
|
32
|
+
reviewer: Reviewer;
|
|
33
|
+
fixer?: Fixer;
|
|
34
|
+
revalidate?: Revalidate;
|
|
35
|
+
maxFixes?: number;
|
|
36
|
+
log?: (m: string) => void;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Run the review gate: review → (on issues, if a fixer is given) fix → revalidate
|
|
40
|
+
* (build+smoke must still pass) → re-review, up to `maxFixes` rounds. Returns the
|
|
41
|
+
* final approval; callers gate go-live on `approved`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function runReviewGate(sb: Sandbox, workdir: string, opts: ReviewGateOptions): Promise<ReviewGateResult>;
|
|
44
|
+
/** Parse a `codewith review` transcript into a verdict. */
|
|
45
|
+
export declare function parseReviewVerdict(raw: string): ReviewVerdict;
|
|
46
|
+
/** Real reviewer: runs `codewith review` in the sandbox over the project. */
|
|
47
|
+
export declare class CodewithReviewer implements Reviewer {
|
|
48
|
+
review(sb: Sandbox, workdir: string): Promise<ReviewVerdict>;
|
|
49
|
+
}
|
|
50
|
+
/** Real fixer: runs `codewith exec` in the sandbox to address the reviewer's issues. */
|
|
51
|
+
export declare class CodewithFixer implements Fixer {
|
|
52
|
+
fix(sb: Sandbox, workdir: string, issues: string[]): Promise<void>;
|
|
53
|
+
}
|
|
54
|
+
/** The gate is enabled when an economical-engine credential is present (and not disabled). */
|
|
55
|
+
export declare function reviewEnabled(): boolean;
|
|
56
|
+
//# sourceMappingURL=reviewer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reviewer.d.ts","sourceRoot":"","sources":["../../src/agents/reviewer.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtD,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB;;qFAEiF;IACjF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,2DAA2D;IAC3D,GAAG,EAAE,MAAM,CAAC;CACb;AAED,uFAAuF;AACvF,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,aAAa,GAAG,OAAO,CAE1D;AAED,MAAM,WAAW,QAAQ;IACvB;+DAC2D;IAC3D,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CAC9D;AAED,MAAM,WAAW,KAAK;IACpB,qEAAqE;IACrE,GAAG,CAAC,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACpE;AAED,iFAAiF;AACjF,MAAM,MAAM,UAAU,GAAG,CAAC,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAE5E,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,aAAa,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3B;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CACjC,EAAE,EAAE,OAAO,EACX,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,iBAAiB,GACtB,OAAO,CAAC,gBAAgB,CAAC,CAyB3B;AAED,2DAA2D;AAC3D,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAc7D;AAUD,6EAA6E;AAC7E,qBAAa,gBAAiB,YAAW,QAAQ;IACzC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;CAmBnE;AAED,wFAAwF;AACxF,qBAAa,aAAc,YAAW,KAAK;IACnC,GAAG,CAAC,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAUzE;AAED,8FAA8F;AAC9F,wBAAgB,aAAa,IAAI,OAAO,CAEvC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task scaffolds — every new app is seeded from a template matched to its kind,
|
|
3
|
+
* spanning Build → Launch → Grow → Operate from day one (Polsia-style: small,
|
|
4
|
+
* defined scopes, cost-aware). The seeder expands these into app_tasks rows; the
|
|
5
|
+
* architect may append a few idea-specific tasks on top.
|
|
6
|
+
*/
|
|
7
|
+
import type { SiteSpec } from "../lib/site-template.js";
|
|
8
|
+
export declare const SCAFFOLD_VERSION = "2026.06.05";
|
|
9
|
+
export type TaskCategory = "build" | "launch" | "grow" | "operate";
|
|
10
|
+
export interface TaskTemplate {
|
|
11
|
+
category: TaskCategory;
|
|
12
|
+
/** Worker key (maps to the worker registry). */
|
|
13
|
+
type: string;
|
|
14
|
+
title: string;
|
|
15
|
+
scope?: string;
|
|
16
|
+
/** Lower runs sooner. */
|
|
17
|
+
priority?: number;
|
|
18
|
+
creditCost?: number;
|
|
19
|
+
scheduleKind?: "once" | "recurring";
|
|
20
|
+
/** For recurring tasks, the cadence ("every 7d" etc.). */
|
|
21
|
+
cron?: string;
|
|
22
|
+
/** Task types that must be `done` first. */
|
|
23
|
+
dependsOn?: string[];
|
|
24
|
+
requiresApproval?: boolean;
|
|
25
|
+
}
|
|
26
|
+
/** The full scaffold for an app of the given kind. */
|
|
27
|
+
export declare function scaffoldFor(kind: SiteSpec["kind"]): TaskTemplate[];
|
|
28
|
+
/**
|
|
29
|
+
* Filter a scaffold by the user's launch choices. Dropping a task also drops
|
|
30
|
+
* everything that (transitively) depends on it — a task whose dependency will
|
|
31
|
+
* never exist would otherwise sit "Queued" forever in the owner's roadmap.
|
|
32
|
+
*/
|
|
33
|
+
export declare function filterScaffold(templates: TaskTemplate[], opts: {
|
|
34
|
+
includeDomain: boolean;
|
|
35
|
+
}): TaskTemplate[];
|
|
36
|
+
//# sourceMappingURL=scaffolds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scaffolds.d.ts","sourceRoot":"","sources":["../../src/agents/scaffolds.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,eAAO,MAAM,gBAAgB,eAAe,CAAC;AAE7C,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;AAEnE,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,YAAY,CAAC;IACvB,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yBAAyB;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;IACpC,0DAA0D;IAC1D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAmDD,sDAAsD;AACtD,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,YAAY,EAAE,CAElE;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,YAAY,EAAE,EAAE,IAAI,EAAE;IAAE,aAAa,EAAE,OAAO,CAAA;CAAE,GAAG,YAAY,EAAE,CAe1G"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Upsert + heartbeat the platform agent. */
|
|
2
|
+
export declare function heartbeatAgent(name?: string): Promise<void>;
|
|
3
|
+
/** Run schedules whose nextRunAt is due. Returns count run. */
|
|
4
|
+
export declare function runDueSchedules(now?: Date): Promise<number>;
|
|
5
|
+
/** One scheduler tick. */
|
|
6
|
+
export declare function tick(onProgress?: (m: string) => void): Promise<void>;
|
|
7
|
+
/**
|
|
8
|
+
* Run one tick ONLY if this instance can grab the advisory lock — so multiple
|
|
9
|
+
* server instances all calling startSchedulerLoop won't double-run the queue.
|
|
10
|
+
* The session-level lock is held outside a transaction while the tick runs, so
|
|
11
|
+
* long provider/model work never leaves a pooled connection idle-in-transaction.
|
|
12
|
+
*/
|
|
13
|
+
export declare function tickIfLeader(onProgress?: (m: string) => void): Promise<boolean>;
|
|
14
|
+
/** Start an in-process scheduler loop so deploying the web server alone drives
|
|
15
|
+
* the autopilot queue (no separate daemon required). Idempotent. */
|
|
16
|
+
export declare function startSchedulerLoop(intervalMs?: number, onProgress?: (m: string) => void): void;
|
|
17
|
+
/** Run the daemon loop. */
|
|
18
|
+
export declare function runDaemon(intervalMs?: number, onProgress?: (m: string) => void): Promise<void>;
|
|
19
|
+
//# sourceMappingURL=scheduler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduler.d.ts","sourceRoot":"","sources":["../../src/agents/scheduler.ts"],"names":[],"mappings":"AAoBA,6CAA6C;AAC7C,wBAAsB,cAAc,CAAC,IAAI,SAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAQhE;AAED,+DAA+D;AAC/D,wBAAsB,eAAe,CAAC,GAAG,OAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAkBvE;AA4BD,0BAA0B;AAC1B,wBAAsB,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAsB1E;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAkBrF;AAGD;qEACqE;AACrE,wBAAgB,kBAAkB,CAAC,UAAU,SAAS,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAc9F;AAED,2BAA2B;AAC3B,wBAAsB,SAAS,CAAC,UAAU,SAAS,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAYpG"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type TaskTemplate } from "./scaffolds.js";
|
|
2
|
+
import type { AppGoal } from "./architect.js";
|
|
3
|
+
import type { SiteSpec } from "../lib/site-template.js";
|
|
4
|
+
export interface SeedResult {
|
|
5
|
+
goalId: string;
|
|
6
|
+
taskIds: string[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Seed a site's goal + task backlog from its scaffold. Returns the created ids.
|
|
10
|
+
* If tasks already exist for the site it does nothing (idempotent).
|
|
11
|
+
*/
|
|
12
|
+
export declare function seedAutopilot(siteId: string, spec: SiteSpec, goal: AppGoal, extraTasks?: TaskTemplate[], opts?: {
|
|
13
|
+
buildCreditCost?: number;
|
|
14
|
+
includeDomain?: boolean;
|
|
15
|
+
}): Promise<SeedResult>;
|
|
16
|
+
//# sourceMappingURL=seeder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seeder.d.ts","sourceRoot":"","sources":["../../src/agents/seeder.ts"],"names":[],"mappings":"AAMA,OAAO,EAAiD,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAClG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAKxD,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAkBD;;;GAGG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,OAAO,EACb,UAAU,GAAE,YAAY,EAAO,EAC/B,IAAI,GAAE;IAAE,eAAe,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,OAAO,CAAA;CAAO,GAC/D,OAAO,CAAC,UAAU,CAAC,CAoCrB"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export declare const agentTools: {
|
|
2
|
+
suggest_domains: import("ai").Tool<{
|
|
3
|
+
keyword: string;
|
|
4
|
+
}, import("../adapters/domains.js").DomainAvailability[]>;
|
|
5
|
+
check_domain: import("ai").Tool<{
|
|
6
|
+
domains: string[];
|
|
7
|
+
}, import("../adapters/domains.js").DomainAvailability[]>;
|
|
8
|
+
buy_domain: import("ai").Tool<{
|
|
9
|
+
domain: string;
|
|
10
|
+
}, import("../adapters/domains.js").RegisterResult>;
|
|
11
|
+
deploy_site: import("ai").Tool<{
|
|
12
|
+
workerName: string;
|
|
13
|
+
spec: {
|
|
14
|
+
kind: "landing" | "direct_response" | "mini_app" | "newsletter" | "digital_product" | "booking" | "lead_gen";
|
|
15
|
+
title: string;
|
|
16
|
+
tagline: string;
|
|
17
|
+
sections: {
|
|
18
|
+
body: string;
|
|
19
|
+
heading: string;
|
|
20
|
+
}[];
|
|
21
|
+
cta?: {
|
|
22
|
+
label: string;
|
|
23
|
+
href: string;
|
|
24
|
+
} | undefined;
|
|
25
|
+
accent?: string | undefined;
|
|
26
|
+
appInputLabel?: string | undefined;
|
|
27
|
+
appLogic?: string | undefined;
|
|
28
|
+
};
|
|
29
|
+
}, import("../adapters/deployment.js").DeployResult>;
|
|
30
|
+
provision_apex: import("ai").Tool<{
|
|
31
|
+
workerName: string;
|
|
32
|
+
domain: string;
|
|
33
|
+
zoneId: string;
|
|
34
|
+
}, {
|
|
35
|
+
live: boolean;
|
|
36
|
+
}>;
|
|
37
|
+
setup_email: import("ai").Tool<{
|
|
38
|
+
zoneId: string;
|
|
39
|
+
forwardTo?: string | undefined;
|
|
40
|
+
}, {
|
|
41
|
+
enabled: boolean;
|
|
42
|
+
dnsAdded: number;
|
|
43
|
+
}>;
|
|
44
|
+
check_status: import("ai").Tool<{
|
|
45
|
+
siteId: string;
|
|
46
|
+
}, {
|
|
47
|
+
workerName: string | null;
|
|
48
|
+
domain: string | null;
|
|
49
|
+
id: string;
|
|
50
|
+
name: string | null;
|
|
51
|
+
createdAt: Date;
|
|
52
|
+
prompt: string;
|
|
53
|
+
userId: string | null;
|
|
54
|
+
kind: string;
|
|
55
|
+
status: "pending" | "planning" | "buying_domain" | "generating" | "deploying" | "configuring_email" | "live" | "failed";
|
|
56
|
+
liveUrl: string | null;
|
|
57
|
+
sourceDir: string | null;
|
|
58
|
+
meta: Record<string, unknown> | null;
|
|
59
|
+
updatedAt: Date;
|
|
60
|
+
} | null>;
|
|
61
|
+
record_payment: import("ai").Tool<{
|
|
62
|
+
amountCents: number;
|
|
63
|
+
metadata?: Record<string, string> | undefined;
|
|
64
|
+
}, {
|
|
65
|
+
id: string;
|
|
66
|
+
status: string;
|
|
67
|
+
}>;
|
|
68
|
+
};
|
|
69
|
+
export type AgentToolName = keyof typeof agentTools;
|
|
70
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/agents/tools.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqDtB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,UAAU,CAAC"}
|