logicsrc/packages/sdk/src/index.ts
Anthony Ettinger 68f3151699 Merge master; OpenFleet keeps its name, PR 177's rental descriptor becomes OpenRental
PR 177 shipped a second OpenFleet under the same slug: a published listing of OpenAgent profiles and ipfile swarms with CoinPay rental offers. Anthony ruled that OpenFleet means the human-controlled fleet and the record of who spawned whom, so the rental contract is renamed OpenRental (slug openrental, catalogs family, group noun listing): docs/openrental.md, logicsrc-openrental.schema.json with type logicsrc.openrental and scope kind listing, fixtures/openrental, createOpenRental and OpenRental* types in the SDK, the openrental validator kind. Minor bumps because an export moved: @logicsrc/schemas 0.2.0, @logicsrc/validators 0.2.0, @logicsrc/sdk 0.2.0. The discovery contract test now covers openfleet, openrental and openwall, one per family, and accepts a landing-page link in llms.txt.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

Claude-Session: https://claude.ai/code/session_01RZV4zJ2pDZLNN3kE5jFCmV
2026-09-13 08:45:33 +00:00

96 lines
2.6 KiB
TypeScript

export { createOpenRental } from "./openrental.js";
export type {
OpenRental, OpenRentalJsonValue, OpenRentalMember, OpenRentalMemberReference,
OpenRentalRental, OpenRentalRentalScope
} from "./openrental.js";
export type LogicSrcId = string;
export interface LogicSrcTask {
type: "logicsrc.task";
version: string;
title: string;
description: string;
board: string;
creator_did: string;
status: "draft" | "open" | "funded" | "claimed" | "submitted" | "approved" | "rejected" | "disputed" | "closed";
budget?: {
amount: number;
currency: string;
};
assignee_did?: string;
}
export interface LogicSrcAgent {
type: "logicsrc.agent";
id: LogicSrcId;
name: string;
capabilities: string[];
logicsrc_compatibility_version?: string;
}
export interface LogicSrcRun {
type: "logicsrc.agent_run";
id: LogicSrcId;
agent_id: LogicSrcId;
status: "queued" | "running" | "succeeded" | "failed" | "canceled";
task_id?: LogicSrcId;
}
export interface LogicSrcEvent {
type: "logicsrc.event";
event: string;
resource_id: LogicSrcId;
created_at?: string;
}
export interface AgentSwarmSession {
type: "logicsrc.agentswarm.session";
status: "opening" | "active" | "paused" | "completed" | "failed";
mode: "yolo" | "review";
master_agent: string;
slave_agents: string[];
repo: string | null;
openspec_compatible: boolean;
openspec_only: boolean;
}
export interface LogicSrcClient {
createTask(input: Omit<LogicSrcTask, "type" | "version" | "status"> & Partial<Pick<LogicSrcTask, "version" | "status">>): Promise<LogicSrcTask>;
validateTask(input: unknown): Promise<{ ok: boolean; errors: string[] }>;
startAgentSwarm(input: {
repo?: string;
agents?: string[];
yolo?: boolean;
openspec?: boolean;
openspecOnly?: boolean;
}): Promise<AgentSwarmSession>;
}
export function createTask(input: Omit<LogicSrcTask, "type" | "version" | "status"> & Partial<Pick<LogicSrcTask, "version" | "status">>): LogicSrcTask {
return {
type: "logicsrc.task",
version: input.version ?? "0.1",
status: input.status ?? "draft",
...input
};
}
export function createAgentSwarmSession(input: {
repo?: string;
agents?: string[];
yolo?: boolean;
openspec?: boolean;
openspecOnly?: boolean;
}): AgentSwarmSession {
return {
type: "logicsrc.agentswarm.session",
status: "opening",
mode: input.yolo ? "yolo" : "review",
master_agent: "agentswarm-master",
slave_agents: input.agents ?? ["reproduce", "patch", "review"],
repo: input.repo ?? null,
openspec_compatible: input.openspec ?? false,
openspec_only: input.openspecOnly ?? false
};
}