Join 11: gitea names the pipeline runner's contracts and takes a revision answer whole
gitea imports @novox/mesh-delivery-contracts-mesh-pipeline-runner, so its package.json names it and the Node fetch places the group's (design 47 G A-285); the catalog view's revision answer is typed with its revision and entries, which revisionAnswer already refuses loudly when the holder leaves them out. Builds: design 47 G A-285 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
@@ -30,8 +30,14 @@ export type Ask = (verb: string, input: RevisionInput) => Promise<unknown>;
|
||||
/** The hooks a part hands the view: everything of mesh-sdk's FollowerOptions but what the view sets itself. */
|
||||
export type CatalogHooks = Omit<FollowerOptions, "owner" | "tool" | "state" | "ask">;
|
||||
|
||||
/** The revision's answer, or the holder's refusal as an error: never an empty view taken for the trunk. */
|
||||
export function revisionAnswer(raw: unknown): RevisionAnswer {
|
||||
/** A revision's answer as the view takes it: the contract leaves its revision and entries optional, the view needs both. */
|
||||
export type HeldAnswer = RevisionAnswer & Required<Pick<RevisionAnswer, "revision" | "entries">>;
|
||||
|
||||
/**
|
||||
* The revision's answer, or the holder's refusal as an error: never an empty view taken for the trunk. An answer without
|
||||
* its revision or its entries is an error the caller sees (principle 3), never a default.
|
||||
*/
|
||||
export function revisionAnswer(raw: unknown): HeldAnswer {
|
||||
let a: unknown = raw;
|
||||
if (typeof raw === "string") {
|
||||
try {
|
||||
@@ -45,7 +51,7 @@ export function revisionAnswer(raw: unknown): RevisionAnswer {
|
||||
const said = r && typeof r === "object" && typeof r.error === "string" ? r.error : JSON.stringify(a ?? null).slice(0, 200);
|
||||
throw new Error(`${REVISION_VERB} answered no revision: ${said}`);
|
||||
}
|
||||
return r as RevisionAnswer;
|
||||
return r as HeldAnswer;
|
||||
}
|
||||
|
||||
export class CatalogView {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@novox/module-gitea",
|
||||
"version": "0.1.0",
|
||||
"description": "gitea — git hosting. Its API client, tools and events live here (novox/hq ADR 0039).",
|
||||
"description": "gitea \u2014 git hosting. Its API client, tools and events live here (novox/hq ADR 0039).",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
@@ -11,6 +11,7 @@
|
||||
"dependencies": {
|
||||
"@novox/mesh-delivery-contracts-git": "^0.1.0",
|
||||
"@novox/mesh-delivery-contracts-mesh-catalog": "^0.1.0",
|
||||
"@novox/mesh-delivery-contracts-mesh-pipeline-runner": "^0.1.0",
|
||||
"@novox/mesh-sdk": "^0.1.19"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
Reference in New Issue
Block a user