mirror of
https://github.com/profullstack/logicsrc.git
synced 2026-12-02 17:54:48 +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
35
packages/sdk/src/openrental.test.ts
Normal file
35
packages/sdk/src/openrental.test.ts
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
import { describe, expect, it } from "vitest";
|
||||
import { createOpenRental, type OpenRentalMember } from "./index.js";
|
||||
|
||||
const members: OpenRentalMember[] = [
|
||||
{ kind: "openagent", id: "analyst.coinpay", url: "https://example.com/agent.json" },
|
||||
{ kind: "openswarm", id: `ed25519:${"a".repeat(64)}`, url: "https://example.com/manifest.json" }
|
||||
];
|
||||
|
||||
describe("createOpenRental", () => {
|
||||
it.each([members.slice(0, 1), members.slice(1), members])("constructs single-kind and mixed listings", (...fleetMembers) => {
|
||||
const listing = createOpenRental({
|
||||
id: "https://example.com/listings/research", name: "Research", owner_did: "operator.coinpay",
|
||||
members: fleetMembers
|
||||
});
|
||||
expect(listing.type).toBe("logicsrc.openrental");
|
||||
expect(listing.version).toBe("0.1");
|
||||
expect(listing.members).toEqual(fleetMembers);
|
||||
expect(listing.rentals).toBeUndefined();
|
||||
});
|
||||
|
||||
it("keeps rental amounts as decimal strings and preserves metadata", () => {
|
||||
const input: Parameters<typeof createOpenRental>[0] = {
|
||||
id: "https://example.com/listings/research", name: "Research", owner_did: "operator.coinpay", members,
|
||||
metadata: { support: { languages: ["en", "fr"] } },
|
||||
rentals: [{
|
||||
id: "hourly", scope: { kind: "listing" },
|
||||
rate: { amount: "9007199254740993.123456", currency: "USD", unit: "hour" },
|
||||
payment: { provider: "coinpay", payee_did: "operator.coinpay", checkout_url: "https://example.com/rent" }
|
||||
}]
|
||||
};
|
||||
const snapshot = structuredClone(input);
|
||||
expect(createOpenRental(input)).toEqual({ ...input, type: "logicsrc.openrental", version: "0.1" });
|
||||
expect(input).toEqual(snapshot);
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue