halfcycle 0.6.0 → 0.7.1
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 +3523 -2168
- package/bin/pre-tool-use-filter.sh +6 -2
- package/dist/bin.js +0 -0
- package/dist/check-criteria.d.ts +57 -0
- package/dist/check-criteria.d.ts.map +1 -0
- package/dist/check-report.d.ts +2 -1
- package/dist/check-report.d.ts.map +1 -1
- package/dist/check-tasks.d.ts +75 -22
- package/dist/check-tasks.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 +1407 -367
- package/dist/cli.js.map +3 -3
- package/dist/close-phase.d.ts +39 -1
- package/dist/close-phase.d.ts.map +1 -1
- package/dist/index.js +116 -17
- package/dist/index.js.map +3 -3
- package/dist/install.d.ts +7 -2
- package/dist/install.d.ts.map +1 -1
- package/dist/pace.d.ts +19 -4
- package/dist/pace.d.ts.map +1 -1
- package/dist/ready.d.ts +6 -3
- package/dist/ready.d.ts.map +1 -1
- package/dist/route.d.ts +95 -0
- package/dist/route.d.ts.map +1 -0
- package/package.json +11 -11
- package/dist/claude-plan.d.ts +0 -133
- package/dist/claude-plan.d.ts.map +0 -1
package/dist/close-phase.d.ts
CHANGED
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
* SHIPS TO CLIENT DISK inside the CLI: every string here is a sentence a person reads,
|
|
50
50
|
* and no comment sits beside an object member.
|
|
51
51
|
*/
|
|
52
|
-
import { unfinishedStepLine, type AcceptanceOutcome, type OwnerWaitDeclaration, type ObserveRunResult, type OpenReviewAnswer, type TimeRunResult, type TimeSummary, type WorkCall } from '@halfcycle/events';
|
|
52
|
+
import { PHASE_LIMIT_FILENAME, RELAYED_CHOICES_FILENAME, type PhaseExpected, type PhaseWork, unfinishedStepLine, type AcceptanceOutcome, type OwnerWaitDeclaration, type ObserveRunResult, type OpenReviewAnswer, type TimeRunResult, type TimeSummary, type WorkCall } from '@halfcycle/events';
|
|
53
53
|
import type { RepoCredential } from './open-phase.js';
|
|
54
54
|
/**
|
|
55
55
|
* Whether the commit this phase closed at could be read, and if so the full hash
|
|
@@ -395,4 +395,42 @@ export declare function wentAheadCloseLines(calls: readonly WorkCall[]): string[
|
|
|
395
395
|
* this line at all rather than guess at a count it could not read.
|
|
396
396
|
*/
|
|
397
397
|
export declare function callsListedLine(n: number): string;
|
|
398
|
+
/** The project's machine-level pacing folder's files the close reads. */
|
|
399
|
+
export { PHASE_LIMIT_FILENAME, RELAYED_CHOICES_FILENAME };
|
|
400
|
+
export declare const PHASE_MODELS_FILENAME = "phase-models.json";
|
|
401
|
+
/**
|
|
402
|
+
* What was expected of `phase`, from its limit file, or null when there is none, it
|
|
403
|
+
* cannot be read, or it is for another phase. Never throws.
|
|
404
|
+
*/
|
|
405
|
+
export declare function readPhaseExpected(engagementId: string, phase: string, home?: string): PhaseExpected | null;
|
|
406
|
+
/**
|
|
407
|
+
* C1, then each change to the limit as C2 or C3 in the order they happened, from the
|
|
408
|
+
* phase's limit file on this machine. "You" only where a person typed it; a raise taken
|
|
409
|
+
* from Codex as relayed is not here (CX1 lists it). No file is the none-case of C1; a
|
|
410
|
+
* file that cannot be read or is another phase's prints nothing. Nothing is sent.
|
|
411
|
+
*/
|
|
412
|
+
export declare function phaseLimitLines(engagementId: string, phase: string, home?: string): string[];
|
|
413
|
+
/**
|
|
414
|
+
* One CX1 for each choice Codex relayed that let the phase use more, in the order they
|
|
415
|
+
* happened, from the relayed list on this machine. It reads nothing of the limit file, so
|
|
416
|
+
* a phase with no limit still lists its relayed choices. A list that cannot be read or is
|
|
417
|
+
* another phase's prints nothing. Nothing is sent.
|
|
418
|
+
*/
|
|
419
|
+
export declare function relayedChoiceLines(engagementId: string, phase: string, home?: string): string[];
|
|
420
|
+
/**
|
|
421
|
+
* Each task's models as this computer's tally of the coding agent's records saw them,
|
|
422
|
+
* for `phase` (and, when the time summary could be read, for the opening it names),
|
|
423
|
+
* or null when there is no tally for it or it cannot be read. Never throws.
|
|
424
|
+
*/
|
|
425
|
+
export declare function readPhaseModels(engagementId: string, phase: string, openedAt: string | null, home?: string): Readonly<Record<string, Readonly<Record<string, number>>>> | null;
|
|
426
|
+
/**
|
|
427
|
+
* Z1, Z2 and each Z3, printed after the time totals and the usage limit's lines. Z1
|
|
428
|
+
* is the reviews' word, over the phase's work read; Z2 compares the limit file's
|
|
429
|
+
* expectation with the time summary; Z3, Halfcycle's own reading, names the models
|
|
430
|
+
* this computer's tally saw for each task that had an attempt on the cheaper tier.
|
|
431
|
+
* What cannot be read gives that line's none-case or nothing: an unreadable work read
|
|
432
|
+
* prints no Z1 and no Z3, a missing limit file the third Z2, an unreadable summary no
|
|
433
|
+
* Z2, and a missing tally no Z3. Nothing here stops the close.
|
|
434
|
+
*/
|
|
435
|
+
export declare function tierFigureLines(work: PhaseWork | null, expected: PhaseExpected | null, summary: TimeSummary | null, models: Readonly<Record<string, Readonly<Record<string, number>>>> | null): string[];
|
|
398
436
|
//# sourceMappingURL=close-phase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"close-phase.d.ts","sourceRoot":"","sources":["../src/close-phase.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"close-phase.d.ts","sourceRoot":"","sources":["../src/close-phase.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAGH,OAAO,EAQL,oBAAoB,EACpB,wBAAwB,EAUxB,KAAK,aAAa,EAElB,KAAK,SAAS,EAYd,kBAAkB,EAClB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EAGzB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EA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EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAU/F;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,IAAI,CAAC,EAAE,MAAM,GACZ,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAWnE;AAOD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,SAAS,GAAG,IAAI,EACtB,QAAQ,EAAE,aAAa,GAAG,IAAI,EAC9B,OAAO,EAAE,WAAW,GAAG,IAAI,EAC3B,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,GACxE,MAAM,EAAE,CAeV"}
|
package/dist/index.js
CHANGED
|
@@ -300,15 +300,21 @@ var HOOK_REMEDY = `Run ${SIGN_IN_COMMAND} in the project folder to sign in.`;
|
|
|
300
300
|
import { z as z2 } from "zod";
|
|
301
301
|
var TASK_PLAN_FILE = "docs/build-records/task-plan.json";
|
|
302
302
|
var TASK_LIST_FILE = "docs/build-records/build-tasks.json";
|
|
303
|
+
var AGENT_NAME_MAX = 32;
|
|
303
304
|
var TASK_PLAN_TASKS_MAX = 500;
|
|
304
305
|
var TASK_PLAN_ID_MAX = 64;
|
|
305
306
|
var TASK_PLAN_BUILDS_NONE = "none";
|
|
306
307
|
var TASK_PLAN_CRITERIA_NONE = "none";
|
|
307
308
|
var TASK_PLAN_SPECS_NONE = "none";
|
|
309
|
+
var CITATION = /^([a-z0-9][a-z0-9-]{0,63}) AC((?:0|[1-9][0-9]*)[a-z]?)$/;
|
|
310
|
+
function isCriterionCitation(text) {
|
|
311
|
+
return CITATION.test(text);
|
|
312
|
+
}
|
|
308
313
|
var TASK_PLAN_KINDS = ["build", "review", "spec", "walk", "check"];
|
|
309
314
|
var CONTROL_CHARACTER = /[\u0000-\u001f\u007f-\u009f]/;
|
|
310
315
|
var planText = z2.string().refine((text) => !CONTROL_CHARACTER.test(text), { message: "holds a control character" });
|
|
311
316
|
var taskIdSchema = z2.string().min(1).max(TASK_PLAN_ID_MAX).refine((text) => !CONTROL_CHARACTER.test(text), { message: "holds a control character" });
|
|
317
|
+
var agentNameText = z2.string().min(1).max(AGENT_NAME_MAX).refine((text) => !CONTROL_CHARACTER.test(text), { message: "holds a control character" });
|
|
312
318
|
var taskPlanTaskSchema = z2.object({
|
|
313
319
|
id: taskIdSchema,
|
|
314
320
|
kind: z2.enum(TASK_PLAN_KINDS),
|
|
@@ -323,8 +329,25 @@ var taskPlanTaskSchema = z2.object({
|
|
|
323
329
|
ships: z2.enum(["deploy", "release"]).optional(),
|
|
324
330
|
builds: z2.union([z2.literal(TASK_PLAN_BUILDS_NONE), z2.array(planText)]).optional(),
|
|
325
331
|
criteria: z2.union([z2.literal(TASK_PLAN_CRITERIA_NONE), z2.array(planText)]).optional(),
|
|
326
|
-
whyOutsidePlan: planText.optional()
|
|
332
|
+
whyOutsidePlan: planText.optional(),
|
|
333
|
+
agent: agentNameText.optional(),
|
|
334
|
+
cheapFirst: z2.literal(true).optional(),
|
|
335
|
+
criteriaCheck: z2.literal(true).optional()
|
|
327
336
|
}).strict().superRefine((task, ctx) => {
|
|
337
|
+
if (task.criteriaCheck !== void 0 && (task.kind !== "check" || task.wholeProject !== void 0)) {
|
|
338
|
+
ctx.addIssue({
|
|
339
|
+
code: "custom",
|
|
340
|
+
path: ["criteriaCheck"],
|
|
341
|
+
message: "only a check task that is not a whole-project check is the check against the acceptance criteria"
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
if (task.agent !== void 0 && task.heldBy !== void 0) {
|
|
345
|
+
ctx.addIssue({
|
|
346
|
+
code: "custom",
|
|
347
|
+
path: ["agent"],
|
|
348
|
+
message: "a task a person holds names no crew member"
|
|
349
|
+
});
|
|
350
|
+
}
|
|
328
351
|
if (task.reviews !== void 0 && task.kind !== "review") {
|
|
329
352
|
ctx.addIssue({
|
|
330
353
|
code: "custom",
|
|
@@ -557,8 +580,8 @@ import { z as z5 } from "zod";
|
|
|
557
580
|
// ../events/dist/human-agent.js
|
|
558
581
|
import { z as z4 } from "zod";
|
|
559
582
|
var HUMAN_AGENT = "Human";
|
|
560
|
-
var
|
|
561
|
-
var agentNameSchema = z4.string().min(1).max(
|
|
583
|
+
var AGENT_NAME_MAX2 = AGENT_NAME_MAX;
|
|
584
|
+
var agentNameSchema = z4.string().min(1).max(AGENT_NAME_MAX2);
|
|
562
585
|
|
|
563
586
|
// ../events/dist/state.js
|
|
564
587
|
var utcIso8601 = z5.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/, "must be a UTC ISO-8601 timestamp ending in Z");
|
|
@@ -1965,9 +1988,54 @@ var workCallRecordSchema = z14.object({
|
|
|
1965
1988
|
message: "says how to undo it exactly when it can be undone",
|
|
1966
1989
|
path: ["how"]
|
|
1967
1990
|
});
|
|
1991
|
+
var WORK_CRITERIA_ROWS_MAX = 500;
|
|
1992
|
+
var workCriterionSchema = agentWorkText.refine((t) => isCriterionCitation(t), {
|
|
1993
|
+
message: "must name a criterion as its spec name, a space, then AC and its number, such as order-intake AC1"
|
|
1994
|
+
});
|
|
1995
|
+
var workCriteriaTestEvidenceSchema = z14.object({
|
|
1996
|
+
kind: z14.literal("test"),
|
|
1997
|
+
task: buildTaskIdSchema,
|
|
1998
|
+
label: agentWorkText,
|
|
1999
|
+
writtenIn: buildTaskIdSchema.optional()
|
|
2000
|
+
}).strict();
|
|
2001
|
+
var workCriteriaPathEvidenceSchema = z14.object({
|
|
2002
|
+
kind: z14.literal("path"),
|
|
2003
|
+
path: agentWorkText
|
|
2004
|
+
}).strict();
|
|
2005
|
+
var workCriteriaWalkEvidenceSchema = z14.object({
|
|
2006
|
+
kind: z14.literal("walk"),
|
|
2007
|
+
leg: agentWorkText
|
|
2008
|
+
}).strict();
|
|
2009
|
+
var workCriteriaEvidenceSchema = z14.discriminatedUnion("kind", [
|
|
2010
|
+
workCriteriaTestEvidenceSchema,
|
|
2011
|
+
workCriteriaPathEvidenceSchema,
|
|
2012
|
+
workCriteriaWalkEvidenceSchema
|
|
2013
|
+
]);
|
|
2014
|
+
var workCriteriaMetRowSchema = z14.object({
|
|
2015
|
+
criterion: workCriterionSchema,
|
|
2016
|
+
edge: z14.literal(true).optional(),
|
|
2017
|
+
status: z14.literal("met"),
|
|
2018
|
+
evidence: workCriteriaEvidenceSchema
|
|
2019
|
+
}).strict();
|
|
2020
|
+
var workCriteriaFixRowSchema = z14.object({
|
|
2021
|
+
criterion: workCriterionSchema,
|
|
2022
|
+
edge: z14.literal(true).optional(),
|
|
2023
|
+
status: z14.literal("fix"),
|
|
2024
|
+
gap: agentWorkText,
|
|
2025
|
+
task: buildTaskIdSchema
|
|
2026
|
+
}).strict();
|
|
2027
|
+
var workCriteriaRowSchema = z14.discriminatedUnion("status", [workCriteriaMetRowSchema, workCriteriaFixRowSchema]);
|
|
2028
|
+
var workCriteriaRecordSchema = z14.object({
|
|
2029
|
+
record: z14.literal("criteria"),
|
|
2030
|
+
subject: workPhaseSubjectSchema,
|
|
2031
|
+
check: buildTaskIdSchema,
|
|
2032
|
+
by: agentNameSchema,
|
|
2033
|
+
rows: z14.array(workCriteriaRowSchema).min(1, { message: "must carry at least one criterion" }).max(WORK_CRITERIA_ROWS_MAX, { message: `can carry at most ${WORK_CRITERIA_ROWS_MAX} criteria` })
|
|
2034
|
+
}).strict();
|
|
1968
2035
|
var workRecordSchema = z14.discriminatedUnion("record", [
|
|
1969
2036
|
workReviewRecordSchema,
|
|
1970
2037
|
workOutcomesRecordSchema,
|
|
2038
|
+
workCriteriaRecordSchema,
|
|
1971
2039
|
workClaimsRecordSchema,
|
|
1972
2040
|
workDiagnosisRecordSchema,
|
|
1973
2041
|
workCallRecordSchema
|
|
@@ -2014,7 +2082,8 @@ var WORK_REFUSAL_STATUS = Object.freeze({
|
|
|
2014
2082
|
held: 409,
|
|
2015
2083
|
"attempt-limit": 409,
|
|
2016
2084
|
"same-attempt": 409,
|
|
2017
|
-
"call-not-recorded": 409
|
|
2085
|
+
"call-not-recorded": 409,
|
|
2086
|
+
"other-version": 409
|
|
2018
2087
|
});
|
|
2019
2088
|
var WORK_REFUSALS = Object.freeze(Object.keys(WORK_REFUSAL_STATUS));
|
|
2020
2089
|
var workRefusalSchema = z14.enum(WORK_REFUSALS);
|
|
@@ -3413,6 +3482,25 @@ function recordedClaimLine(claim) {
|
|
|
3413
3482
|
}
|
|
3414
3483
|
var NO_UNCHECKED_CLAIMS_LINE = "No agent said a check passes that Halfcycle never ran.";
|
|
3415
3484
|
|
|
3485
|
+
// ../events/dist/tier-figures.js
|
|
3486
|
+
import { z as z26 } from "zod";
|
|
3487
|
+
function hasCheaperRole(member) {
|
|
3488
|
+
return member.role === "builder" && member.tier === "standard";
|
|
3489
|
+
}
|
|
3490
|
+
function cheaperRoleNameOf(callsign) {
|
|
3491
|
+
return `${callsign.toLowerCase()}fast`;
|
|
3492
|
+
}
|
|
3493
|
+
var routingRecordSchema = z26.object({
|
|
3494
|
+
phase: z26.string().min(1).max(200),
|
|
3495
|
+
cheapStarted: z26.array(z26.string().min(1).max(200)).max(2e3)
|
|
3496
|
+
}).strict();
|
|
3497
|
+
var PHASE_MODEL_NAME_MAX = 64;
|
|
3498
|
+
var phaseModelsFileSchema = z26.object({
|
|
3499
|
+
phase: z26.string().min(1).max(200),
|
|
3500
|
+
openedAt: z26.string().min(1).max(64),
|
|
3501
|
+
tasks: z26.record(z26.string().min(1).max(200), z26.record(z26.string().min(1).max(PHASE_MODEL_NAME_MAX), z26.number().int().min(0)))
|
|
3502
|
+
}).strict();
|
|
3503
|
+
|
|
3416
3504
|
// dist/engagement-credential.js
|
|
3417
3505
|
import { chmodSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
3418
3506
|
import { platform as platform2 } from "node:os";
|
|
@@ -5046,8 +5134,9 @@ function crewProfileBody(role, group, tier) {
|
|
|
5046
5134
|
return `${lines.join("\n")}
|
|
5047
5135
|
`;
|
|
5048
5136
|
}
|
|
5049
|
-
function crewProfileDescription(member) {
|
|
5050
|
-
|
|
5137
|
+
function crewProfileDescription(member, cheaper = false) {
|
|
5138
|
+
const attempt = cheaper ? " (cheaper attempt)" : "";
|
|
5139
|
+
return `${member.callsign}, ${CREW_ROLE_WORDS[member.role]} (${member.discipline})${attempt}, a member of this project's build crew.`;
|
|
5051
5140
|
}
|
|
5052
5141
|
function plainYamlValue(value) {
|
|
5053
5142
|
if (/[\r\n]|: | #|^[-?:,[\]{}#&*!|>'"%@`\s]|\s$/.test(value)) {
|
|
@@ -5068,17 +5157,19 @@ function claudeCrewProfile(member) {
|
|
|
5068
5157
|
crewProfileBody(member.role, member.group, member.tier)
|
|
5069
5158
|
].join("\n");
|
|
5070
5159
|
}
|
|
5071
|
-
function codexCrewProfile(member) {
|
|
5072
|
-
const
|
|
5160
|
+
function codexCrewProfile(member, cheaper = false) {
|
|
5161
|
+
const tier = cheaper ? "fast" : member.tier;
|
|
5162
|
+
const { model, effort } = AGENT_PROFILES.codex.tierModels[tier];
|
|
5073
5163
|
if (effort === void 0)
|
|
5074
|
-
throw new Error(`[halfcycle] Codex's ${
|
|
5075
|
-
const body = crewProfileBody(member.role, member.group,
|
|
5164
|
+
throw new Error(`[halfcycle] Codex's ${tier} tier names no reasoning effort.`);
|
|
5165
|
+
const body = crewProfileBody(member.role, member.group, tier);
|
|
5076
5166
|
if (/[\\"]|[\u0000-\u0009\u000b-\u001f\u007f]/.test(body)) {
|
|
5077
5167
|
throw new Error("[halfcycle] a crew profile body holds a character a Codex role cannot carry as written.");
|
|
5078
5168
|
}
|
|
5169
|
+
const name = cheaper ? cheaperRoleNameOf(member.callsign) : member.callsign.toLowerCase();
|
|
5079
5170
|
return [
|
|
5080
|
-
`name = ${tomlBasicString(
|
|
5081
|
-
`description = ${tomlBasicString(crewProfileDescription(member))}`,
|
|
5171
|
+
`name = ${tomlBasicString(name)}`,
|
|
5172
|
+
`description = ${tomlBasicString(crewProfileDescription(member, cheaper))}`,
|
|
5082
5173
|
`model = ${tomlBasicString(model)}`,
|
|
5083
5174
|
`model_reasoning_effort = ${tomlBasicString(effort)}`,
|
|
5084
5175
|
`developer_instructions = """`,
|
|
@@ -5089,7 +5180,10 @@ function codexCrewProfile(member) {
|
|
|
5089
5180
|
function renderCrewProfiles(roster = CREW_ROSTER) {
|
|
5090
5181
|
return [
|
|
5091
5182
|
...roster.map((member) => ({ rel: crewProfileRel("claude-code", member.callsign), text: claudeCrewProfile(member) })),
|
|
5092
|
-
...roster.filter((member) => member.group !== "reviewer").
|
|
5183
|
+
...roster.filter((member) => member.group !== "reviewer").flatMap((member) => [
|
|
5184
|
+
{ rel: crewProfileRel("codex", member.callsign), text: codexCrewProfile(member) },
|
|
5185
|
+
...hasCheaperRole(member) ? [{ rel: crewProfileRel("codex", `${member.callsign}FAST`), text: codexCrewProfile(member, true) }] : []
|
|
5186
|
+
])
|
|
5093
5187
|
];
|
|
5094
5188
|
}
|
|
5095
5189
|
var __filename = fileURLToPath(import.meta.url);
|
|
@@ -5948,14 +6042,19 @@ ${GENERATED_USER_PROMPT_SCOPE_HEADER} the Halfcycle installer, now also for the
|
|
|
5948
6042
|
# <phase>/<part>", "question <phase>/<part>: <words>", "carry <phase>/<part>:
|
|
5949
6043
|
# <words>", "drop <phase>/<part>: <words>", "reject <phase>/<task>: <words>",
|
|
5950
6044
|
# "autonomy on" or "autonomy off". Also lets the person who is typing let one
|
|
5951
|
-
# step Halfcycle paused run once, by typing "allow" as the whole prompt
|
|
6045
|
+
# step Halfcycle paused run once, by typing "allow" as the whole prompt, and change
|
|
6046
|
+
# how a build is paced, by typing "faster", "run 5 agents", "keep 30% free" or
|
|
6047
|
+
# "use up to 70%" as the whole prompt, and answer a phase's usage limit by
|
|
6048
|
+
# typing "keep going", "stop", "limit it to 1.5 times" or "limit it to 300
|
|
6049
|
+
# million" as the whole prompt.
|
|
5952
6050
|
#
|
|
5953
6051
|
# AN ORDINARY PROMPT STARTS NOTHING. This script reads the hook input once and
|
|
5954
6052
|
# looks only at the start of the prompt's value. Unless the prompt begins, after
|
|
5955
6053
|
# any whitespace (typed, or escaped in the input), with "approve ", "send back ",
|
|
5956
6054
|
# "accept ", "question ", "carry ", "drop ", "reject " or "autonomy ", in any case,
|
|
5957
|
-
# or is "allow"
|
|
5958
|
-
#
|
|
6055
|
+
# or is "allow", one of the five pacing phrases or one of the usage-limit phrases
|
|
6056
|
+
# and nothing else but whitespace,
|
|
6057
|
+
# it exits 0 with no output, and Node never starts. A quote inside any other field arrives
|
|
5959
6058
|
# escaped, so no other field (the folder the session is in, for one) can read as
|
|
5960
6059
|
# the start of the prompt.
|
|
5961
6060
|
#
|
|
@@ -5981,7 +6080,7 @@ IFS= read -r -d '' HC_INPUT || true
|
|
|
5981
6080
|
# \\u escape, or as the UTF-8 bytes of a Unicode space. Compared byte for byte.
|
|
5982
6081
|
HC_LEAD='[[:space:]]|\\\\[nrtf]|\\\\u(000[9a-d]|0020|00a0|1680|200[0-9a]|202[89f]|205f|3000|feff)'
|
|
5983
6082
|
HC_LEAD="$HC_LEAD|"$'\\xc2\\xa0|\\xe1\\x9a\\x80|\\xe2\\x80[\\x80-\\x8a\\xa8\\xa9\\xaf]|\\xe2\\x81\\x9f|\\xe3\\x80\\x80|\\xef\\xbb\\xbf'
|
|
5984
|
-
if ! printf '%s' "$HC_INPUT" | LC_ALL=C grep -Eiq "\\"prompt\\"[[:space:]]*:[[:space:]]*\\"($HC_LEAD)*((approve|send back|accept|question|carry|drop|reject|autonomy) |allow($HC_LEAD)*\\")"; then
|
|
6083
|
+
if ! printf '%s' "$HC_INPUT" | LC_ALL=C grep -Eiq "\\"prompt\\"[[:space:]]*:[[:space:]]*\\"($HC_LEAD)*((approve|send back|accept|question|carry|drop|reject|autonomy|decline) |allow($HC_LEAD)*\\"|(faster|go faster|run [0-9]{1,3} agents?|keep [0-9]{1,3}% free|use up to [0-9]{1,3}%|keep going|stop|stop here|limit it to [0-9]{1,9}(\\.[0-9]{1,2})? (times|million|billion|million tokens|billion tokens))($HC_LEAD)*\\")"; then
|
|
5985
6084
|
exit 0
|
|
5986
6085
|
fi
|
|
5987
6086
|
|