halfcycle 0.4.6 → 0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/bin/bin.bundle.mjs +1325 -155
- package/commands/agent-teams-orchestration.md +1 -1
- package/commands/stack-assembly-worker.md +1 -1
- package/commands/task-execution.md +1 -1
- package/dist/bin.d.ts +2 -1
- package/dist/bin.d.ts.map +1 -1
- package/dist/cli-contract.d.ts +1 -1
- package/dist/cli-contract.d.ts.map +1 -1
- package/dist/cli.js +1460 -417
- package/dist/cli.js.map +3 -3
- package/dist/close-phase.d.ts +8 -1
- package/dist/close-phase.d.ts.map +1 -1
- package/dist/draw/index.d.ts +76 -32
- package/dist/draw/index.d.ts.map +1 -1
- package/dist/draw/write.d.ts +71 -21
- package/dist/draw/write.d.ts.map +1 -1
- package/dist/index.js +69 -6
- package/dist/index.js.map +3 -3
- package/dist/install.d.ts +33 -1
- package/dist/install.d.ts.map +1 -1
- package/dist/open-phase.d.ts +8 -1
- package/dist/open-phase.d.ts.map +1 -1
- package/dist/plan.d.ts +200 -0
- package/dist/plan.d.ts.map +1 -0
- package/dist/system-report.d.ts +20 -9
- package/dist/system-report.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/plan.d.ts
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The client half of `npx halfcycle@latest plan <phase> [--show]` (System view · E2,
|
|
3
|
+
* feature `phase-plan-and-scope-approval`, AC2): check the project's description and the
|
|
4
|
+
* phase's plan file on the machine, report the description, then report the plan bound
|
|
5
|
+
* to that description version; with `--show`, list every part to the person and record
|
|
6
|
+
* on this machine which phase, number and plan version were shown.
|
|
7
|
+
*
|
|
8
|
+
* THE ORDER IS THE SPEC'S. (1) the description stage, `checkAndReportDescription`
|
|
9
|
+
* (`./system-report.ts`), never a copy of it; (2) the plan is read and checked in that
|
|
10
|
+
* stage's `beforeSend`, which runs after the description passed and before the
|
|
11
|
+
* credential is read or anything sent, so a bad plan sends nothing, the description
|
|
12
|
+
* included; (3) the plan that was checked is the plan sent, never a second read of the
|
|
13
|
+
* file; (4) with `--show`, the list is printed and the shown record written.
|
|
14
|
+
*
|
|
15
|
+
* ONE HOME FOR EVERY RULE THIS VERB APPLIES (INV-003). The plan's shape and its check
|
|
16
|
+
* against a description are `@halfcycle/events`' `checkPhasePlan`; the route's request
|
|
17
|
+
* and answer are its `phasePlanRequestSchema` and `phasePlanResultSchema`. The plan
|
|
18
|
+
* file's name is `renderPhaseSegment`'s (INV-023), and "is the file's phase the phase
|
|
19
|
+
* asked for" compares the two segments it renders, because that function is where a
|
|
20
|
+
* number and its decimal string become one phase. The shown record's format is
|
|
21
|
+
* `@halfcycle/core`'s `serialiseShownPlans` and `parseShownPlans`; this module keeps
|
|
22
|
+
* only the I/O. Whether a typed number reaches this phase is `resolvePhaseReference`
|
|
23
|
+
* (`@halfcycle/core`). The two approval-line swaps take their sentences and the floor
|
|
24
|
+
* from `client-version.ts` (`@halfcycle/events`); the switched-off swap is decided by
|
|
25
|
+
* the server's `typedApprovalOffered`, never by the client's copy of the switch, and
|
|
26
|
+
* delivery's `clientOffersChatApproval` is never called here. "Is this a service
|
|
27
|
+
* without the route" is `isMissingRoute`.
|
|
28
|
+
*
|
|
29
|
+
* THE CHANGE WORDS are the system picture's `PART_STATES` labels for `padd`, `pchg`
|
|
30
|
+
* and `pdel`, repeated in `PLAN_CHANGE_LABELS` because this package may not import the
|
|
31
|
+
* picture package (INV-001). `test/plan-verb.test.ts` reads that package's source and
|
|
32
|
+
* holds the two equal.
|
|
33
|
+
*
|
|
34
|
+
* WHAT LEAVES THE MACHINE. The checked description (through the shared stage), then
|
|
35
|
+
* `{ descriptionVersion, plan }`. Nothing is written into the person's tree; the shown
|
|
36
|
+
* record is machine state under the home folder (INV-019).
|
|
37
|
+
*
|
|
38
|
+
* INV-001: Node builtins, the global `fetch`, `@halfcycle/events` and `@halfcycle/core`
|
|
39
|
+
* only. SHIPS TO CLIENT DISK inside the CLI: every string here is a sentence a person
|
|
40
|
+
* reads, so none names an internal register, route or setting; no comment sits beside
|
|
41
|
+
* an object member.
|
|
42
|
+
*/
|
|
43
|
+
import { type PhasePlan, type PhasePlanChange, type PhasePlanProblem, type PlannedScopeState, type SystemDescription } from '@halfcycle/events';
|
|
44
|
+
import { type ShownPlanEntry } from '@halfcycle/core';
|
|
45
|
+
import type { RepoCredential } from './open-phase.js';
|
|
46
|
+
import { type DescriptionVerb, type SystemDeps, type SystemRun } from './system-report.js';
|
|
47
|
+
/** The usage line, printed for no phase, an extra argument or an unknown flag. */
|
|
48
|
+
export declare const PLAN_USAGE = "npx halfcycle@latest plan <phase> [--show] [--repo <root>]";
|
|
49
|
+
/** The folder the plan file sits in, relative to the repository root. */
|
|
50
|
+
export declare const PLAN_DIR_REL = "docs/phases";
|
|
51
|
+
/**
|
|
52
|
+
* The plan file for `phase`, relative to the repository root:
|
|
53
|
+
* `docs/phases/<segment>.plan.json`, the segment being `renderPhaseSegment`'s and no
|
|
54
|
+
* other. Throws on a phase that is not a valid identity, as that function does.
|
|
55
|
+
*/
|
|
56
|
+
export declare function planFileRel(phase: string | number): string;
|
|
57
|
+
/**
|
|
58
|
+
* The words for each change, as the system picture labels them (`PART_STATES`' `padd`,
|
|
59
|
+
* `pchg` and `pdel`). A test holds them equal to that package's source.
|
|
60
|
+
*/
|
|
61
|
+
export declare const PLAN_CHANGE_LABELS: Readonly<Record<PhasePlanChange, string>>;
|
|
62
|
+
/**
|
|
63
|
+
* What the arguments after `plan` came to. Exactly one positional (the phase), at most
|
|
64
|
+
* one `--show` and at most one `--repo <root>`; anything else, no phase included, is
|
|
65
|
+
* usage.
|
|
66
|
+
*/
|
|
67
|
+
export type PlanArgs = {
|
|
68
|
+
ok: true;
|
|
69
|
+
phase: string;
|
|
70
|
+
show: boolean;
|
|
71
|
+
repoRoot: string | undefined;
|
|
72
|
+
} | {
|
|
73
|
+
ok: false;
|
|
74
|
+
};
|
|
75
|
+
export declare function parsePlanArgs(argv: readonly string[]): PlanArgs;
|
|
76
|
+
/** One line per plan problem, each naming where it is. */
|
|
77
|
+
export declare function planProblemLines(raw: unknown, fileRel: string, problems: readonly PhasePlanProblem[]): string;
|
|
78
|
+
/** What reading and checking the plan file came to: the checked plan, or the line to print. */
|
|
79
|
+
export type PlanFileCheck = {
|
|
80
|
+
ok: true;
|
|
81
|
+
plan: PhasePlan;
|
|
82
|
+
} | {
|
|
83
|
+
ok: false;
|
|
84
|
+
line: string;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Read `docs/phases/<segment>.plan.json` under `repoRoot` and check it against the
|
|
88
|
+
* checked `description`. Never throws. `phase` must already be a valid identity.
|
|
89
|
+
*
|
|
90
|
+
* In order: a missing file names the path and the remedy; a file that cannot be read,
|
|
91
|
+
* or is not JSON, says so (the parser's own sentence for the second); a plan naming a
|
|
92
|
+
* valid phase other than `phase` is refused naming both, before its other problems,
|
|
93
|
+
* because it is the wrong file; otherwise every problem `checkPhasePlan` finds. Each
|
|
94
|
+
* line says nothing was sent, because nothing is.
|
|
95
|
+
*/
|
|
96
|
+
export declare function readAndCheckPlan(repoRoot: string, phase: string, description: SystemDescription, verb: DescriptionVerb): PlanFileCheck;
|
|
97
|
+
/**
|
|
98
|
+
* What came of reporting the plan. `recorded`: the service's answer, as its schema
|
|
99
|
+
* parsed it. `refused`: the service's own problems. `no-route`: this service cannot
|
|
100
|
+
* take a plan yet. `unavailable`: it could not be reported, and `why` says so.
|
|
101
|
+
*/
|
|
102
|
+
export type PlanOutcome = {
|
|
103
|
+
kind: 'recorded';
|
|
104
|
+
version: number;
|
|
105
|
+
phaseNumber: number;
|
|
106
|
+
state: PlannedScopeState;
|
|
107
|
+
changedParts: readonly string[];
|
|
108
|
+
typedApprovalOffered: boolean;
|
|
109
|
+
} | {
|
|
110
|
+
kind: 'refused';
|
|
111
|
+
problems: PhasePlanProblem[];
|
|
112
|
+
} | {
|
|
113
|
+
kind: 'no-route';
|
|
114
|
+
} | {
|
|
115
|
+
kind: 'unavailable';
|
|
116
|
+
why: string;
|
|
117
|
+
};
|
|
118
|
+
/** The address the plan is reported to: the engagement and the phase are each one path segment, encoded once. */
|
|
119
|
+
export declare function planReportUrl(credential: RepoCredential, phase: string | number): string;
|
|
120
|
+
/**
|
|
121
|
+
* Report a checked plan bound to `descriptionVersion`. Never throws.
|
|
122
|
+
*
|
|
123
|
+
* One response-handling rule, the description report's: a body that parses under
|
|
124
|
+
* `phasePlanResultSchema` is authoritative whatever its status; otherwise the
|
|
125
|
+
* service's missing-route answer means it predates plans; anything else is reported
|
|
126
|
+
* by its status and the service's own sentence.
|
|
127
|
+
*/
|
|
128
|
+
export declare function reportPhasePlan(credential: RepoCredential, plan: PhasePlan, descriptionVersion: number): Promise<PlanOutcome>;
|
|
129
|
+
/** What writing the shown record came to: on success, every entry the record now holds. */
|
|
130
|
+
export type ShownWrite = {
|
|
131
|
+
ok: true;
|
|
132
|
+
entries: readonly ShownPlanEntry[];
|
|
133
|
+
} | {
|
|
134
|
+
ok: false;
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* Record on this machine that `entry` was shown: `~/.halfcycle/engagements/<id>/`
|
|
138
|
+
* `shown-plans.json`, the directory composed by `engagementStateDir` (which checks the
|
|
139
|
+
* id) and the filename `SHOWN_PLANS_FILENAME`. Never throws.
|
|
140
|
+
*
|
|
141
|
+
* The record keeps the latest entry per phase, so the entry for this phase is
|
|
142
|
+
* replaced. An entry holding this number under another phase is dropped too: the
|
|
143
|
+
* service gives each phase one number and never changes it, so such an entry is
|
|
144
|
+
* stale, and `serialiseShownPlans` refuses two entries with one number, which would
|
|
145
|
+
* otherwise fail every later write. A missing or malformed record reads as nothing
|
|
146
|
+
* shown (`parseShownPlans`).
|
|
147
|
+
*
|
|
148
|
+
* Written to a temporary file in the same folder, mode `0600` set on it before the
|
|
149
|
+
* rename (a rename carries the source's bits), then renamed into place, so a reader
|
|
150
|
+
* sees the old record or the new one and never a part of one. `chmod` is skipped on
|
|
151
|
+
* Windows, where the bits mean nothing.
|
|
152
|
+
*/
|
|
153
|
+
export declare function writeShownPlan(engagementId: string, entry: ShownPlanEntry, home?: string): ShownWrite;
|
|
154
|
+
/**
|
|
155
|
+
* The installed Halfcycle's version, as the project's `.halfcycle/bundle.json` holds
|
|
156
|
+
* it, or `undefined` when there is no pin, it cannot be read, or it holds no string
|
|
157
|
+
* version. The floor treats `undefined` as older than every release.
|
|
158
|
+
*/
|
|
159
|
+
export declare function readPinnedClientVersion(repoRoot: string): string | undefined;
|
|
160
|
+
/**
|
|
161
|
+
* The line for a plan the service refused, as `plan` prints it, prefixed by the verb
|
|
162
|
+
* that is running. `draw phase` prints a refusal through this too, so the two verbs
|
|
163
|
+
* word it one way.
|
|
164
|
+
*/
|
|
165
|
+
export declare function planRefusedLines(verb: DescriptionVerb, phase: string, plan: PhasePlan, problems: readonly PhasePlanProblem[]): string;
|
|
166
|
+
/**
|
|
167
|
+
* The line for a phase name `isValidPhaseIdentity` refuses, prefixed by the verb that
|
|
168
|
+
* is running. Nothing has been sent when it is printed.
|
|
169
|
+
*/
|
|
170
|
+
export declare function notAPhaseNameLine(verb: DescriptionVerb, phase: string): string;
|
|
171
|
+
/** The pieces `runPlan` reaches outside itself through; replaced in tests. */
|
|
172
|
+
export interface PlanDeps extends SystemDeps {
|
|
173
|
+
readonly reportPlan: (credential: RepoCredential, plan: PhasePlan, descriptionVersion: number) => Promise<PlanOutcome>;
|
|
174
|
+
readonly pinnedClientVersion: (repoRoot: string) => string | undefined;
|
|
175
|
+
readonly recordShown: (engagementId: string, entry: ShownPlanEntry) => ShownWrite;
|
|
176
|
+
readonly now: () => Date;
|
|
177
|
+
}
|
|
178
|
+
/** The sentence for the phase's state after the plan was recorded. */
|
|
179
|
+
export declare function planStateSentence(state: PlannedScopeState): string;
|
|
180
|
+
/**
|
|
181
|
+
* The line saying how the owner approves, with its two swaps (AC2). The server's
|
|
182
|
+
* `typedApprovalOffered: false` gives the switched-off sentence, whatever the client;
|
|
183
|
+
* otherwise a pinned version below the floor (none included) gives the update
|
|
184
|
+
* sentence; otherwise the typing offer.
|
|
185
|
+
*
|
|
186
|
+
* The offer names the phase, and its number too when typing the number would reach
|
|
187
|
+
* this phase among the phases shown on this machine (`resolvePhaseReference`): a
|
|
188
|
+
* phase whose name is that number would otherwise take it.
|
|
189
|
+
*/
|
|
190
|
+
export declare function approvalLine(phase: string, number: number, typedApprovalOffered: boolean, pinnedVersion: string | undefined, shown: readonly ShownPlanEntry[]): string;
|
|
191
|
+
/** One line per change, in plan order: the part's name, what changes, the plan's line, and the changed mark. */
|
|
192
|
+
export declare function changeLines(plan: PhasePlan, description: SystemDescription, changed: readonly string[]): string;
|
|
193
|
+
/**
|
|
194
|
+
* The whole verb, in the order the module header gives. Exit 0 only when the plan is
|
|
195
|
+
* recorded and, with `--show`, the shown record is written. When that write fails the
|
|
196
|
+
* list is still printed, but not the approval line: an approval typed for a list this
|
|
197
|
+
* machine did not record could not bind to it, so the verb does not invite one.
|
|
198
|
+
*/
|
|
199
|
+
export declare function runPlan(repoRoot: string, phase: string, show: boolean, deps: PlanDeps): Promise<SystemRun>;
|
|
200
|
+
//# sourceMappingURL=plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../src/plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAKH,OAAO,EAQL,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,gBAAgB,EAErB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAML,KAAK,cAAc,EACpB,MAAM,iBAAiB,CAAC;AAIzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAEL,KAAK,eAAe,EACpB,KAA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
13
|
* package's `systemReportResultSchema`. "Is this a service without the route" is
|
|
14
14
|
* `isMissingRoute` (`./missing-route.ts`), shared with `build-record` and `draw`.
|
|
15
|
-
* `draw`
|
|
16
|
-
*
|
|
15
|
+
* `draw` and `plan` take this module's first stage, `checkAndReportDescription`,
|
|
16
|
+
* whole: the verbs read, check and report the description by one path, not copies.
|
|
17
17
|
*
|
|
18
18
|
* ONE RESPONSE-HANDLING RULE, the Build Record path's. A body that parses under
|
|
19
19
|
* `systemReportResultSchema` is authoritative, whatever its status. Otherwise the
|
|
@@ -90,8 +90,11 @@ export declare const listTrackedFiles: ListTrackedFiles;
|
|
|
90
90
|
* ranking.
|
|
91
91
|
*/
|
|
92
92
|
export declare function unownedPatterns(description: SystemDescription, tracked: readonly string[] | null): UnownedPattern[] | null;
|
|
93
|
-
/**
|
|
94
|
-
|
|
93
|
+
/**
|
|
94
|
+
* The warning lines for unowned patterns, one per pattern, each prefixed by the verb
|
|
95
|
+
* that is running (`draw`, `plan` or `system`), as every other line it prints is.
|
|
96
|
+
*/
|
|
97
|
+
export declare function unownedPatternLines(unowned: readonly UnownedPattern[], verb: DescriptionVerb): string;
|
|
95
98
|
/**
|
|
96
99
|
* What came of reporting the description. `recorded`: the service holds it as
|
|
97
100
|
* `version` (a description it already had returns that version). `refused`: the
|
|
@@ -150,19 +153,27 @@ export type DescriptionStage = {
|
|
|
150
153
|
warnings: string;
|
|
151
154
|
};
|
|
152
155
|
/** The verbs that report the description first. Names the prefix of every line. */
|
|
153
|
-
export type DescriptionVerb = 'system' | 'draw';
|
|
156
|
+
export type DescriptionVerb = 'system' | 'draw' | 'plan';
|
|
157
|
+
/**
|
|
158
|
+
* A verb's own local refusal, asked with the description that just passed the check:
|
|
159
|
+
* the line to print, or `null` to go on. `plan` checks its plan file against that
|
|
160
|
+
* description here; `draw` ignores the argument.
|
|
161
|
+
*/
|
|
162
|
+
export type BeforeSend = (description: SystemDescription) => string | null;
|
|
154
163
|
/**
|
|
155
|
-
* READ, CHECK, WARN, REPORT — the one path
|
|
164
|
+
* READ, CHECK, WARN, REPORT — the one path `system`, `draw` and `plan` take before
|
|
156
165
|
* anything else (feature `diagram-files-for-docs`, step 1 and 2 of the command). The
|
|
157
166
|
* order is the spec's: nothing is sent unless the file reads, parses and passes every
|
|
158
167
|
* rule, and the credential is only looked for once there is something to send.
|
|
159
168
|
*
|
|
160
169
|
* `beforeSend` is the caller's own local refusal, asked after the description passed
|
|
161
170
|
* and before the credential is read or anything sent: `draw` refuses there when a file
|
|
162
|
-
* it does not own is in the way,
|
|
163
|
-
*
|
|
171
|
+
* it does not own is in the way, and `plan` when its plan file is missing, unreadable or
|
|
172
|
+
* fails `checkPhasePlan` against the checked description it is handed, so a refusal it
|
|
173
|
+
* can make on the machine never costs a request (the description included). It returns
|
|
174
|
+
* the line to print, or `null` to go on.
|
|
164
175
|
*/
|
|
165
|
-
export declare function checkAndReportDescription(repoRoot: string, deps: SystemDeps, verb: DescriptionVerb, beforeSend?:
|
|
176
|
+
export declare function checkAndReportDescription(repoRoot: string, deps: SystemDeps, verb: DescriptionVerb, beforeSend?: BeforeSend): Promise<DescriptionStage>;
|
|
166
177
|
/** The whole `system` verb: the shared stage, then its version printed. */
|
|
167
178
|
export declare function runSystem(repoRoot: string, deps: SystemDeps): Promise<SystemRun>;
|
|
168
179
|
//# sourceMappingURL=system-report.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-report.d.ts","sourceRoot":"","sources":["../src/system-report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAKH,OAAO,EAIL,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC9B,MAAM,mBAAmB,CAAC;AAI3B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,oEAAoE;AACpE,eAAO,MAAM,sBAAsB,qBAAqB,CAAC;AAEzD;;;;;GAKG;AACH,MAAM,MAAM,eAAe,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