feat(plugin-kit): browser-safe ./wire subpath for provider schemas (0.1.1)
apple / swift (push) Successful in 1m22s
apple / screenshots (push) Successful in 6m35s
ci / web (push) Successful in 1m13s
ci / docs-site (push) Successful in 1m14s
android / android (push) Successful in 17m3s
decky / build-publish (push) Successful in 18s
docker / build-push (--build-arg FEDORA_VERSION=44, ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora44-rpm) (push) Successful in 11s
docker / build-push (., web/Dockerfile, punktfunk-web) (push) Successful in 10s
docker / build-push (ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora-rpm) (push) Successful in 9s
docker / build-push (ci, ci/rust-ci-noble.Dockerfile, punktfunk-rust-ci-noble) (push) Successful in 9s
docker / build-push (ci, ci/rust-ci.Dockerfile, punktfunk-rust-ci) (push) Successful in 9s
docker / build-push (docs-site, docs-site/Dockerfile, punktfunk-docs) (push) Successful in 8s
arch / build-publish (push) Successful in 16m33s
ci / bench (push) Successful in 14m48s
deb / build-publish (push) Successful in 14m48s
ci / rust (push) Successful in 22m36s
deb / build-publish-host (push) Successful in 18m16s
rpm / build-publish (43, bazzite, punktfunk-fedora-rpm) (push) Successful in 18m30s
docker / deploy-docs (push) Successful in 23s
rpm / build-publish (44, fedora-44, punktfunk-fedora44-rpm) (push) Successful in 28m25s
apple / swift (push) Successful in 1m22s
apple / screenshots (push) Successful in 6m35s
ci / web (push) Successful in 1m13s
ci / docs-site (push) Successful in 1m14s
android / android (push) Successful in 17m3s
decky / build-publish (push) Successful in 18s
docker / build-push (--build-arg FEDORA_VERSION=44, ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora44-rpm) (push) Successful in 11s
docker / build-push (., web/Dockerfile, punktfunk-web) (push) Successful in 10s
docker / build-push (ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora-rpm) (push) Successful in 9s
docker / build-push (ci, ci/rust-ci-noble.Dockerfile, punktfunk-rust-ci-noble) (push) Successful in 9s
docker / build-push (ci, ci/rust-ci.Dockerfile, punktfunk-rust-ci) (push) Successful in 9s
docker / build-push (docs-site, docs-site/Dockerfile, punktfunk-docs) (push) Successful in 8s
arch / build-publish (push) Successful in 16m33s
ci / bench (push) Successful in 14m48s
deb / build-publish (push) Successful in 14m48s
ci / rust (push) Successful in 22m36s
deb / build-publish-host (push) Successful in 18m16s
rpm / build-publish (43, bazzite, punktfunk-fedora-rpm) (push) Successful in 18m30s
docker / deploy-docs (push) Successful in 23s
rpm / build-publish (44, fedora-44, punktfunk-fedora44-rpm) (push) Successful in 28m25s
Plugin contracts share ProviderEntry/Artwork/LaunchSpec/PrepStep with their UIs; the kit root stays node-only (reconcile keeps the HostClient transport). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@punktfunk/plugin-kit",
|
"name": "@punktfunk/plugin-kit",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"description": "Effect-based framework for punktfunk plugins: lifecycle runtime, config/state, sync engine, UI serving, CLI scaffold, and browser helpers.",
|
"description": "Effect-based framework for punktfunk plugins: lifecycle runtime, config/state, sync engine, UI serving, CLI scaffold, and browser helpers.",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"license": "MIT OR Apache-2.0",
|
"license": "MIT OR Apache-2.0",
|
||||||
@@ -25,6 +25,10 @@
|
|||||||
"types": "./dist/react/index.d.ts",
|
"types": "./dist/react/index.d.ts",
|
||||||
"default": "./dist/react/index.js"
|
"default": "./dist/react/index.js"
|
||||||
},
|
},
|
||||||
|
"./wire": {
|
||||||
|
"types": "./dist/wire.d.ts",
|
||||||
|
"default": "./dist/wire.js"
|
||||||
|
},
|
||||||
"./theme.css": "./dist/theme.css"
|
"./theme.css": "./dist/theme.css"
|
||||||
},
|
},
|
||||||
"files": ["dist", "README.md"],
|
"files": ["dist", "README.md"],
|
||||||
|
|||||||
@@ -1,40 +1,13 @@
|
|||||||
// The library-provider wire, owned by the kit so plugins stop hand-copying `wire.ts`.
|
// The library-provider client, owned by the kit so plugins stop hand-copying host calls.
|
||||||
// Schemas mirror the host's `ProviderEntryInput` (crates/punktfunk-host mgmt/library.rs);
|
// The wire SCHEMAS live in ./wire.ts (browser-safe — plugin contracts re-use them); the
|
||||||
// the transport stays the SDK's untyped `pf.request` seam (version-skew-safe under the
|
// transport here stays the SDK's untyped `pf.request` seam (version-skew-safe under the
|
||||||
// runner-bundled SDK — design D7). These schemas are identity codecs (plain JSON shapes),
|
// runner-bundled SDK — design D7).
|
||||||
// so entries pass through unencoded; the value is the shared type + authoring validation.
|
import { Context, Effect, Layer } from "effect";
|
||||||
import { Context, Effect, Layer, Schema } from "effect";
|
|
||||||
import type { HostRequestError } from "./errors.js";
|
import type { HostRequestError } from "./errors.js";
|
||||||
import { HostClient } from "./host-client.js";
|
import { HostClient } from "./host-client.js";
|
||||||
|
import type { ProviderEntry } from "./wire.js";
|
||||||
|
|
||||||
export const Artwork = Schema.Struct({
|
export * from "./wire.js";
|
||||||
portrait: Schema.optionalKey(Schema.NullOr(Schema.String)),
|
|
||||||
hero: Schema.optionalKey(Schema.NullOr(Schema.String)),
|
|
||||||
logo: Schema.optionalKey(Schema.NullOr(Schema.String)),
|
|
||||||
header: Schema.optionalKey(Schema.NullOr(Schema.String)),
|
|
||||||
});
|
|
||||||
export type Artwork = typeof Artwork.Type;
|
|
||||||
|
|
||||||
export const LaunchSpec = Schema.Struct({
|
|
||||||
kind: Schema.Literal("command"),
|
|
||||||
value: Schema.String,
|
|
||||||
});
|
|
||||||
export type LaunchSpec = typeof LaunchSpec.Type;
|
|
||||||
|
|
||||||
export const PrepStep = Schema.Struct({
|
|
||||||
do: Schema.String,
|
|
||||||
undo: Schema.optionalKey(Schema.NullOr(Schema.String)),
|
|
||||||
});
|
|
||||||
export type PrepStep = typeof PrepStep.Type;
|
|
||||||
|
|
||||||
export const ProviderEntry = Schema.Struct({
|
|
||||||
external_id: Schema.String,
|
|
||||||
title: Schema.String,
|
|
||||||
art: Schema.optionalKey(Artwork),
|
|
||||||
launch: Schema.optionalKey(Schema.NullOr(LaunchSpec)),
|
|
||||||
prep: Schema.optionalKey(Schema.Array(PrepStep)),
|
|
||||||
});
|
|
||||||
export type ProviderEntry = typeof ProviderEntry.Type;
|
|
||||||
|
|
||||||
export interface ProviderClientService {
|
export interface ProviderClientService {
|
||||||
/** Full-replace reconcile: PUT the desired set; the host diffs by `external_id`. */
|
/** Full-replace reconcile: PUT the desired set; the host diffs by `external_id`. */
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
// The library-provider wire schemas — a browser-safe module (no node imports) so plugin
|
||||||
|
// CONTRACTS can share these types with their UIs. Mirrors the host's `ProviderEntryInput`
|
||||||
|
// (crates/punktfunk-host mgmt/library.rs). Identity codecs: plain JSON shapes, so values
|
||||||
|
// pass through unencoded; the value is the shared type + authoring validation.
|
||||||
|
import { Schema } from "effect";
|
||||||
|
|
||||||
|
export const Artwork = Schema.Struct({
|
||||||
|
portrait: Schema.optionalKey(Schema.NullOr(Schema.String)),
|
||||||
|
hero: Schema.optionalKey(Schema.NullOr(Schema.String)),
|
||||||
|
logo: Schema.optionalKey(Schema.NullOr(Schema.String)),
|
||||||
|
header: Schema.optionalKey(Schema.NullOr(Schema.String)),
|
||||||
|
});
|
||||||
|
export type Artwork = typeof Artwork.Type;
|
||||||
|
|
||||||
|
export const LaunchSpec = Schema.Struct({
|
||||||
|
kind: Schema.Literal("command"),
|
||||||
|
value: Schema.String,
|
||||||
|
});
|
||||||
|
export type LaunchSpec = typeof LaunchSpec.Type;
|
||||||
|
|
||||||
|
export const PrepStep = Schema.Struct({
|
||||||
|
do: Schema.String,
|
||||||
|
undo: Schema.optionalKey(Schema.NullOr(Schema.String)),
|
||||||
|
});
|
||||||
|
export type PrepStep = typeof PrepStep.Type;
|
||||||
|
|
||||||
|
export const ProviderEntry = Schema.Struct({
|
||||||
|
external_id: Schema.String,
|
||||||
|
title: Schema.String,
|
||||||
|
art: Schema.optionalKey(Artwork),
|
||||||
|
launch: Schema.optionalKey(Schema.NullOr(LaunchSpec)),
|
||||||
|
prep: Schema.optionalKey(Schema.Array(PrepStep)),
|
||||||
|
});
|
||||||
|
export type ProviderEntry = typeof ProviderEntry.Type;
|
||||||
Reference in New Issue
Block a user