mirror of
https://github.com/profullstack/logicsrc.git
synced 2026-10-03 21:27:07 +00:00
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
This commit is contained in:
commit
68f3151699
35 changed files with 2068 additions and 14 deletions
71
packages/sdk/src/openrental.ts
Normal file
71
packages/sdk/src/openrental.ts
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
export type OpenRentalJsonValue =
|
||||
| null | boolean | number | string
|
||||
| OpenRentalJsonValue[] | { [key: string]: OpenRentalJsonValue };
|
||||
|
||||
/** OpenAgent binds to a logicsrc.agent DID; OpenSwarm binds to a file key. */
|
||||
export type OpenRentalMemberReference =
|
||||
| { kind: "openagent"; id: string }
|
||||
| { kind: "openswarm"; id: `ed25519:${string}` };
|
||||
|
||||
export type OpenRentalMember = OpenRentalMemberReference & {
|
||||
/** HTTPS URL of the agent profile or the signed ipfile manifest. */
|
||||
url: string;
|
||||
name?: string;
|
||||
role?: string;
|
||||
metadata?: Record<string, OpenRentalJsonValue>;
|
||||
};
|
||||
|
||||
export type OpenRentalRentalScope =
|
||||
| { kind: "listing" }
|
||||
| { kind: "members"; members: OpenRentalMemberReference[] };
|
||||
|
||||
export interface OpenRentalRental {
|
||||
id: string;
|
||||
name?: string;
|
||||
scope: OpenRentalRentalScope;
|
||||
rate: {
|
||||
/** Exact non-negative USD decimal string, with six fractional digits. */
|
||||
amount: string;
|
||||
currency: "USD";
|
||||
/** Whole billing units; a month is 30 days, a task an agreed deliverable. */
|
||||
unit: "hour" | "day" | "month" | "task";
|
||||
};
|
||||
minimum_units?: number;
|
||||
maximum_units?: number;
|
||||
valid_from?: string;
|
||||
valid_until?: string;
|
||||
terms_url?: string;
|
||||
payment: {
|
||||
provider: "coinpay";
|
||||
payee_did: string;
|
||||
/** Merchant-published HTTPS checkout entry point; no fixed CoinPay API. */
|
||||
checkout_url: string;
|
||||
};
|
||||
metadata?: Record<string, OpenRentalJsonValue>;
|
||||
}
|
||||
|
||||
export interface OpenRental {
|
||||
type: "logicsrc.openrental";
|
||||
version: "0.1";
|
||||
/** Stable HTTPS listing identifier, unique at its publisher's origin. */
|
||||
id: string;
|
||||
name: string;
|
||||
owner_did: string;
|
||||
description?: string;
|
||||
updated_at?: string;
|
||||
availability?: "available" | "busy" | "offline" | "unknown";
|
||||
tags?: string[];
|
||||
capabilities?: string[];
|
||||
metadata?: Record<string, OpenRentalJsonValue>;
|
||||
members: OpenRentalMember[];
|
||||
rentals?: OpenRentalRental[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a descriptor without fetching members or initiating payments.
|
||||
* Use validate("openrental", document) from @logicsrc/validators before use:
|
||||
* TypeScript alone cannot check DID/key formats or rental references.
|
||||
*/
|
||||
export function createOpenRental(input: Omit<OpenRental, "type" | "version">): OpenRental {
|
||||
return { ...input, type: "logicsrc.openrental", version: "0.1" };
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue