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

@@ -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";