This commit is contained in:
-Puter
2026-08-03 18:13:45 +05:30
parent 289c16f11e
commit 48205a5e19
13 changed files with 5362 additions and 7318 deletions

View File

@@ -4,7 +4,6 @@
"private": true,
"type": "module",
"exports": {
"./agent": "./src/agent.ts",
"./convex": "./src/convex.ts",
"./native": "./src/native.ts",
"./server": "./src/server.ts",

View File

@@ -5,10 +5,7 @@ export const env = createEnv({
emptyStringAsUndefined: true,
runtimeEnv: process.env,
server: {
AGENT_BACKEND_URL: z.url().optional(),
CONVEX_SITE_URL: z.url().optional(),
FLUE_DB_TOKEN: z.string().min(1),
FLUE_URL: z.url().optional(),
GITEA_TOKEN: z.string().min(1).optional(),
GITEA_URL: z.url().default("https://git.openputer.com"),
GITEA_WEBHOOK_SECRET: z.string().min(1).optional(),

View File

@@ -16,8 +16,6 @@ export const env = createEnv({
DAEMON_ID: z.string().min(1),
DAEMON_NAME: z.string().min(1).optional(),
DAEMON_VERSION: z.string().default("0.0.0"),
FLUE_DB_TOKEN: z.string().min(1),
RIVET_ENDPOINT: z.url().optional(),
},
skipValidation: process.env.SKIP_ENV_VALIDATION === "true",
});

View File

@@ -5,28 +5,13 @@
"type": "module",
"exports": {
".": "./src/index.ts",
"./agent-os": "./src/agent-os.ts",
"./execution-runtime": "./src/execution-runtime.ts",
"./git": "./src/git.ts",
"./git-provider": "./src/git-provider.ts",
"./git-provisioning": "./src/git-provisioning.ts",
"./git-webhook": "./src/git-webhook.ts",
"./git-local-runtime": "./src/git-local-runtime.ts",
"./git-remote-runtime": "./src/git-remote-runtime.ts",
"./project": "./src/project.ts",
"./project-issue": "./src/project-issue.ts",
"./project-work": "./src/project-work.ts",
"./project-workspace": "./src/project-workspace.ts",
"./signal": "./src/signal.ts",
"./smoke": "./src/smoke.ts",
"./work": "./src/work.ts",
"./work-artifact": "./src/work-artifact.ts",
"./work-definition": "./src/work-definition.ts",
"./work-design": "./src/work-design.ts",
"./work-lifecycle": "./src/work-lifecycle.ts",
"./resolver": "./src/resolver.ts",
"./harness-runtime": "./src/harness-runtime.ts",
"./host-repository": "./src/host-repository.ts"
"./signal": "./src/signal.ts"
},
"scripts": {
"check-types": "tsc --noEmit",
@@ -34,9 +19,6 @@
"test:watch": "vitest"
},
"dependencies": {
"@agentos-software/git": "0.3.3",
"@agentos-software/pi": "0.2.7",
"@rivet-dev/agentos": "0.2.14",
"effect": "catalog:"
},
"devDependencies": {

View File

@@ -0,0 +1,81 @@
/* eslint-disable max-classes-per-file -- Git credential schemas share one error type. */
import { Effect, Schema } from "effect";
import { GitProvider } from "./git-provider";
export type { GitProvider } from "./git-provider";
const Text = Schema.String.check(
Schema.makeFilter((value) => value.trim().length > 0, {
expected: "a non-empty string",
})
);
const HttpUrl = Schema.String.check(
Schema.makeFilter(
(value) => {
try {
const url = new URL(value);
return url.protocol === "http:" || url.protocol === "https:";
} catch {
return false;
}
},
{ expected: "an HTTP URL" }
)
);
export const GitCredentialKind = Schema.Literals(["oauth", "token"]);
export type GitCredentialKind = typeof GitCredentialKind.Type;
export const GitConnectionInput = Schema.Struct({
credential: Text,
credentialKind: GitCredentialKind,
provider: GitProvider,
serverUrl: HttpUrl,
username: Schema.optional(Text),
});
export type GitConnectionInput = typeof GitConnectionInput.Type;
export const GitConnectionView = Schema.Struct({
connectedAt: Schema.Number,
credentialKind: GitCredentialKind,
id: Text,
provider: GitProvider,
serverUrl: HttpUrl,
username: Schema.optional(Text),
});
export type GitConnectionView = typeof GitConnectionView.Type;
export const RepositoryExecutionAuth = Schema.Struct({
credential: Text,
provider: GitProvider,
serverUrl: HttpUrl,
username: Schema.optional(Text),
});
export type RepositoryExecutionAuth = typeof RepositoryExecutionAuth.Type;
export const GitConnectionInputErrorReason = Schema.Literals(["InvalidInput"]);
export type GitConnectionInputErrorReason =
typeof GitConnectionInputErrorReason.Type;
export class GitConnectionInputError extends Schema.TaggedErrorClass<GitConnectionInputError>()(
"GitConnectionInputError",
{
message: Schema.String,
reason: GitConnectionInputErrorReason,
retryable: Schema.Boolean,
}
) {}
const invalidInput = (message: string) =>
new GitConnectionInputError({
message,
reason: "InvalidInput",
retryable: false,
});
export const decodeGitConnectionInput = (input: unknown) =>
Schema.decodeUnknownEffect(GitConnectionInput)(input).pipe(
Effect.mapError((cause) => invalidInput(cause.message))
);

View File

@@ -1,23 +1,8 @@
// oxlint-disable-next-line no-barrel-file -- The package root intentionally exposes its public modules.
export * from "./agent-os";
export * from "./execution-runtime";
export * from "./git";
export * from "./git-provider";
export * from "./git-provisioning";
export * from "./git-webhook";
export * from "./git-local-runtime";
export * from "./git-remote-runtime";
export * from "./project";
export * from "./project-issue";
export * from "./project-workspace";
export * from "./project-work";
export * from "./signal";
export * from "./smoke";
export * from "./work";
export * from "./work-artifact";
export * from "./work-definition";
export * from "./work-design";
export * from "./work-lifecycle";
export * from "./resolver";
export * from "./harness-runtime";
export * from "./host-repository";

View File

@@ -16,11 +16,6 @@
"dependencies": {
"@base-ui/react": "^1.6.0",
"@shadcn/react": "^0.2.0",
"@streamdown/cjk": "^1.0.3",
"@streamdown/code": "^1.1.1",
"@streamdown/math": "^1.0.2",
"@streamdown/mermaid": "^1.0.2",
"ai": "^7.0.35",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"lucide-react": "catalog:",
@@ -28,12 +23,9 @@
"react": "catalog:",
"react-dom": "catalog:",
"shadcn": "^4.12.0",
"shiki": "^4.3.1",
"sonner": "catalog:",
"streamdown": "catalog:",
"tailwind-merge": "catalog:",
"tw-animate-css": "^1.4.0",
"use-stick-to-bottom": "^1.1.6"
"tw-animate-css": "^1.4.0"
},
"devDependencies": {
"@code/config": "workspace:*",