@indigoai-us/hq-cli 5.310.0 → 5.311.0
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/CHANGELOG.md +16 -0
- package/assets/scaffold/core/scripts/jobs-validate.sh +1 -1
- package/dist/command-catalog.generated.d.ts +2 -2
- package/dist/command-catalog.generated.js +2 -2
- package/dist/commands/channels.d.ts +1 -9
- package/dist/commands/channels.js +2 -2
- package/dist/commands/company-transfer.d.ts +4 -28
- package/dist/commands/company-transfer.js +5 -49
- package/dist/commands/core-checkpoint-stop-gate-native.d.ts +34 -0
- package/dist/commands/core-checkpoint-stop-gate-native.js +713 -0
- package/dist/commands/core-checkpoint.d.ts +0 -24
- package/dist/commands/core-checkpoint.js +4 -4
- package/dist/commands/core-command-catalog.js +1 -1
- package/dist/commands/core-hq-session-native.d.ts +39 -0
- package/dist/commands/core-hq-session-native.js +579 -0
- package/dist/commands/core-jobs-native.js +1 -4
- package/dist/commands/core-native-session-flag.d.ts +4 -0
- package/dist/commands/core-native-session-flag.js +7 -0
- package/dist/commands/core-native-worker-skills-flag.d.ts +4 -0
- package/dist/commands/core-native-worker-skills-flag.js +7 -0
- package/dist/commands/core-worker-lint-native.d.ts +4 -0
- package/dist/commands/core-worker-lint-native.js +160 -0
- package/dist/commands/core-worker-share-native.d.ts +5 -0
- package/dist/commands/core-worker-share-native.js +260 -0
- package/dist/commands/core-worker-skills-command.d.ts +8 -0
- package/dist/commands/core-worker-skills-command.js +33 -0
- package/dist/commands/core-worker-skills-runtime.d.ts +33 -0
- package/dist/commands/core-worker-skills-runtime.js +86 -0
- package/dist/commands/core.js +4 -2
- package/dist/commands/dm.d.ts +3 -7
- package/dist/commands/dm.js +3 -3
- package/dist/commands/integrations-import.d.ts +1 -1
- package/dist/commands/integrations-import.js +34 -19
- package/dist/commands/lanes-accounts.js +3 -1
- package/dist/commands/lanes-message.js +84 -10
- package/dist/commands/lanes-shared.d.ts +4 -1
- package/dist/commands/lanes.d.ts +4 -1
- package/dist/commands/lanes.js +48 -7
- package/dist/commands/personal-connector-settings-flag.d.ts +4 -0
- package/dist/commands/personal-connector-settings-flag.js +7 -0
- package/dist/commands/report.d.ts +1 -26
- package/dist/commands/report.js +6 -6
- package/dist/fast-core.js +15 -2
- package/dist/fast-scaffold.js +25 -2
- package/dist/index.js +8 -0
- package/dist/lib/bot/continuity.d.ts +2 -1
- package/dist/lib/bot/job-completions.d.ts +0 -2
- package/dist/lib/bot/job-completions.js +2 -2
- package/dist/lib/bot/local-config.d.ts +0 -10
- package/dist/lib/bot/local-config.js +3 -9
- package/dist/lib/bot/owner-context.d.ts +2 -6
- package/dist/lib/bot/owner-context.js +3 -3
- package/dist/lib/bot/runtime/windows.d.ts +0 -2
- package/dist/lib/bot/runtime/windows.js +1 -1
- package/dist/lib/bot/setup-explain.d.ts +0 -4
- package/dist/lib/bot/setup-explain.js +2 -2
- package/dist/lib/daemon/catalog.d.ts +3 -2
- package/dist/lib/daemon/hq-cloud.d.ts +2 -2
- package/dist/lib/daemon/hq-cloud.js +1 -1
- package/dist/lib/daemon/machine-type.d.ts +3 -4
- package/dist/lib/daemon/machine-type.js +2 -2
- package/dist/lib/daemon/remote-control.d.ts +0 -1
- package/dist/lib/daemon/remote-control.js +1 -1
- package/dist/lib/daemon/supervisor.d.ts +4 -9
- package/dist/lib/daemon/supervisor.js +5 -5
- package/dist/lib/lanes/admission-host.d.ts +3 -0
- package/dist/lib/lanes/admission-host.js +4 -0
- package/dist/lib/lanes/autopilot-registry.d.ts +62 -0
- package/dist/lib/lanes/autopilot-registry.js +192 -0
- package/dist/lib/lanes/autopilot.d.ts +2 -0
- package/dist/lib/lanes/autopilot.js +18 -5
- package/dist/lib/lanes/claude-balance.d.ts +6 -0
- package/dist/lib/lanes/claude-balance.js +17 -2
- package/dist/lib/lanes/keep-alive.d.ts +3 -0
- package/dist/lib/lanes/keep-alive.js +3 -0
- package/dist/lib/lanes/reconcile.js +14 -6
- package/dist/lib/lanes/spawn.js +2 -0
- package/dist/lib/mesh/live/daemon/credentials.d.ts +2 -17
- package/dist/lib/mesh/live/daemon/credentials.js +9 -9
- package/dist/lib/mesh/live/daemon/index.d.ts +5 -5
- package/dist/lib/mesh/live/daemon/index.js +2 -2
- package/dist/lib/mesh/live/daemon/state.d.ts +1 -1
- package/dist/lib/mesh/live/daemon/transcript-watch.d.ts +4 -11
- package/dist/lib/mesh/live/daemon/transcript-watch.js +5 -5
- package/dist/lib/work-context/company.d.ts +2 -25
- package/dist/lib/work-context/company.js +3 -3
- package/dist/lib/work-context/config.d.ts +3 -8
- package/dist/lib/work-context/config.js +2 -13
- package/dist/lib/work-context/state.d.ts +4 -13
- package/dist/lib/work-context/state.js +2 -30
- package/package.json +1 -1
|
@@ -36,21 +36,6 @@ export declare const CHECKPOINT_REPLY_REMINDER: string;
|
|
|
36
36
|
* demands the findings), so the conditional half still points there.
|
|
37
37
|
*/
|
|
38
38
|
export declare const CHECKPOINT_IDLE_REPLY_REMINDER: string;
|
|
39
|
-
/**
|
|
40
|
-
* Kept in TypeScript rather than in a bundled asset: it is an instruction to
|
|
41
|
-
* a locally-installed agent, not a scaffold script that should be packaged.
|
|
42
|
-
*/
|
|
43
|
-
export declare const SIBLING_PROMPT_TEMPLATE = "You are the HQ checkpoint sibling \u2014 a background maintenance agent for this\nHQ install. Your parent session's state is in <payloadPath>. Work\nquietly and do not ask questions; if something is ambiguous, record it in the\nreport instead of guessing.\n\n1. Read the payload. If it lists a transcript path that exists, read its tail (~400 lines)\n both for session context and to extract additional reusable learnings/insights\n the parent did not pass explicitly. Never quote secrets\n or tokens from the transcript. If .claude/skills/checkpoint/SKILL.md exists\n under this HQ root, read it and follow it wherever it goes beyond these instructions;\n the write bounds below always win over the skill text.\n2. Upgrade the thread file named in the payload IN PLACE: verify/repair its\n JSON; fill git.remote_url, git.initial_commit, git.commits_made, and\n git.knowledge_repos by scanning core/knowledge/public/*,\n core/knowledge/private/*, personal/knowledge/*, and companies/*/knowledge\n for symlinks or directories containing .git, recording dirty repositories\n as {\"<name>\": {\"commit\": \"<short>\", \"dirty\": true}}. Fill worker,\n next_steps, and insights; set type to \"checkpoint\"; then rename the file to\n drop -auto- from its filename. Use the renamed path in every reference you\n write afterwards.\n3. For every explicit or transcript-derived learning that is a reusable rule,\n FIRST search the existing policies for one the learning refines, contradicts\n or duplicates. Then take exactly one of these actions and name it in the\n report \u2014 the policy set is curated, not append-only:\n - AMEND an existing policy in place when the learning sharpens it, narrows\n its scope, or adds a case, and the rule as written is still correct.\n - SUPERSEDE it when the learning contradicts it: rewrite the rule to what is\n now true and record inside the file what changed and why.\n - MERGE near-duplicates into the single best-named file, then delete the\n files you merged away.\n - CREATE a new policy only when no existing policy covers the rule.\n Follow core/knowledge/public/hq-core/policies-spec.md. Write under\n personal/policies/ or, only when the payload names a company and the rule is\n company-specific, companies/<company>/policies/.\n DELETION BOUNDS: delete a policy only as the MERGE or SUPERSEDE step above,\n only inside those two directories, and never one whose body marks it HARD \u2014\n if a hard policy now looks wrong, leave it untouched and flag it in the\n report for a human to decide. Never delete a file you have not read.\n Apply the same curation to durable facts (not rules) under\n personal/knowledge/ or companies/<company>/knowledge/: correct a stale fact\n in place rather than appending a second, contradictory copy of it.\n Store up to two explicit or transcript-derived insights per\n core/knowledge/public/hq-core/insights-spec.md when present, otherwise\n workspace/insights/.\n4. Close an active session journal fail-soft with\n bash .claude/skills/_shared/journal.sh close \"<project_dir>\" \"<one-line synthesis>\".\n Write a legacy checkpoint JSON under workspace/checkpoints/<id>.json with\n id, created_at, summary, files, and next_steps for backward compatibility.\n5. Update workspace/threads/recent.md and regenerate\n workspace/threads/INDEX.md. For each company whose knowledge path appears\n in files_touched, regenerate companies/<company>/knowledge/INDEX.md under\n core/knowledge/public/hq-core/index-md-spec.md. Mechanical index generation\n is allowed for those companies, but knowledge/policy content writes remain\n restricted to the payload's named company.\n<ontologyStep>6. Run .claude/skills/document-release/SKILL.md best-effort when it exists;\n skip silently on any failure. Hook or automation improvements go ONLY under\n personal/hooks/ as proposals.\n7. WRITE BOUNDS: you may write only under personal/, workspace/, and companies/<company>/ as constrained above. You must NEVER write into .claude/, core/, .agents/, .codex/, repos/, or anywhere outside the HQ root.\n8. Write <runDir>/report.md \u2014 full prose: what you read, what you changed\n (paths), and what you skipped and why. List every policy or knowledge file\n you amended, superseded, merged or deleted with the reason, so a human can\n audit and reverse it; a deletion you do not name in the report is a defect.\n Then drain the queue: while\n workspace/checkpoints/sibling/pending.jsonl exists and is non-empty, claim\n it atomically by renaming it aside \u2014\n mv workspace/checkpoints/sibling/pending.jsonl <runDir>/pending-claimed-N.jsonl\n (N counting up from 2) \u2014 and process the claimed payloads with this same\n flow. Repeat until a claim finds nothing left, then update the report.\n NEVER read the queue and truncate it in place: a payload appended between\n your read and the truncate is lost, and its checkpoint is never enriched.\n";
|
|
44
|
-
/**
|
|
45
|
-
* Rendered into the sibling prompt only when the payload names a company. The
|
|
46
|
-
* flag check happens inside `hq core ontology plan`, in the sibling, because
|
|
47
|
-
* the checkpoint parent performs no network I/O. Only this run's own payload
|
|
48
|
-
* gets the step. A queued payload's company files are recorded as queued
|
|
49
|
-
* touches when it is queued (CO-59), and a later plan for that company takes
|
|
50
|
-
* them while checkpoint.ontology.queued-touches is on; a run with no company
|
|
51
|
-
* of its own gets the step for the company whose touches waited longest.
|
|
52
|
-
*/
|
|
53
|
-
export declare const SIBLING_ONTOLOGY_STEP = "5b. ONTOLOGY (this run's own payload only; skip it for claimed queue payloads).\n Run: hq core ontology plan --run-dir \"<runDir>\" --hq-root \"<hqRoot>\"\n If it prints \"ontology: skipped\", do nothing more for this step. Otherwise\n read <runDir>/ontology-plan.json, follow its \"instructions\" exactly, and\n write <runDir>/ontology-candidates.json. Read only the files and line\n ranges the plan lists. Then run:\n hq core ontology apply --run-dir \"<runDir>\" --hq-root \"<hqRoot>\"\n Never write under the company's ontology/ folder yourself, and never edit\n payload.json or ontology-plan.json. Copy the command's one-line output into\n the report. If either command fails, record the error and continue.\n";
|
|
54
39
|
export declare function renderSiblingPrompt(runDir: string, payloadPath: string, options?: {
|
|
55
40
|
company?: string | null;
|
|
56
41
|
hqRoot?: string;
|
|
@@ -84,15 +69,6 @@ export declare function autoBackendPreference(preferGrok?: boolean): SpawnableBa
|
|
|
84
69
|
* registry; a flag change takes effect from the checkpoint after the next plan.
|
|
85
70
|
*/
|
|
86
71
|
export declare function companyPrefersGrok(liveRoot: string, companySlug: string | null | undefined): boolean;
|
|
87
|
-
/**
|
|
88
|
-
* Whether the maintenance sibling may run at all. The process environment wins
|
|
89
|
-
* over the settings file, so a one-off `HQ_CHECKPOINT_AGENT=0 hq core
|
|
90
|
-
* checkpoint …` still works and a host that exports the settings `env` block
|
|
91
|
-
* (Claude Code does) agrees with a host that does not.
|
|
92
|
-
*/
|
|
93
|
-
export declare function siblingEnabledBySetting(liveRoot: string): boolean;
|
|
94
|
-
/** The sibling's environment: the caller's, minus lane identity. */
|
|
95
|
-
export declare function siblingEnv(base: NodeJS.ProcessEnv, backend: SpawnableBackend): NodeJS.ProcessEnv;
|
|
96
72
|
export declare function siblingArgs(backend: SpawnableBackend, prompt: string): string[];
|
|
97
73
|
/** Attach the native checkpoint command to the hidden `hq core` group. */
|
|
98
74
|
export declare function registerCoreCheckpointCommand(core: Command): void;
|
|
@@ -115,7 +115,7 @@ function printError(line) {
|
|
|
115
115
|
* Kept in TypeScript rather than in a bundled asset: it is an instruction to
|
|
116
116
|
* a locally-installed agent, not a scaffold script that should be packaged.
|
|
117
117
|
*/
|
|
118
|
-
|
|
118
|
+
const SIBLING_PROMPT_TEMPLATE = `You are the HQ checkpoint sibling — a background maintenance agent for this
|
|
119
119
|
HQ install. Your parent session's state is in <payloadPath>. Work
|
|
120
120
|
quietly and do not ask questions; if something is ambiguous, record it in the
|
|
121
121
|
report instead of guessing.
|
|
@@ -195,7 +195,7 @@ report instead of guessing.
|
|
|
195
195
|
* them while checkpoint.ontology.queued-touches is on; a run with no company
|
|
196
196
|
* of its own gets the step for the company whose touches waited longest.
|
|
197
197
|
*/
|
|
198
|
-
|
|
198
|
+
const SIBLING_ONTOLOGY_STEP = `5b. ONTOLOGY (this run's own payload only; skip it for claimed queue payloads).
|
|
199
199
|
Run: hq core ontology plan --run-dir "<runDir>" --hq-root "<hqRoot>"
|
|
200
200
|
If it prints "ontology: skipped", do nothing more for this step. Otherwise
|
|
201
201
|
read <runDir>/ontology-plan.json, follow its "instructions" exactly, and
|
|
@@ -784,7 +784,7 @@ function resolveSwitchSetting(liveRoot, key) {
|
|
|
784
784
|
* checkpoint …` still works and a host that exports the settings `env` block
|
|
785
785
|
* (Claude Code does) agrees with a host that does not.
|
|
786
786
|
*/
|
|
787
|
-
|
|
787
|
+
function siblingEnabledBySetting(liveRoot) {
|
|
788
788
|
return resolveSwitchSetting(liveRoot, SIBLING_SETTING) ?? true;
|
|
789
789
|
}
|
|
790
790
|
/** Rejects an unknown `--backend` without paying for the probe that resolves one. */
|
|
@@ -814,7 +814,7 @@ function resolveBackend(requested, liveRoot, company) {
|
|
|
814
814
|
*/
|
|
815
815
|
const LANE_ENV_KEYS = ["HQ_LANE_ID", "HQ_PROJECT_ID", "HQ_STORY_ID", "HQ_POLICY_WORKER_DIR"];
|
|
816
816
|
/** The sibling's environment: the caller's, minus lane identity. */
|
|
817
|
-
|
|
817
|
+
function siblingEnv(base, backend) {
|
|
818
818
|
const vars = { ...base };
|
|
819
819
|
for (const name of LANE_ENV_KEYS)
|
|
820
820
|
delete vars[name];
|
|
@@ -46,7 +46,7 @@ export function fastScaffoldListingMismatches(listing, fastScripts) {
|
|
|
46
46
|
else if (fast.kind === "shell" && listed.asset !== fast.asset) {
|
|
47
47
|
mismatches.push(`${fast.name} lists ${listed.asset ?? "no asset"}, fast path uses ${fast.asset ?? "no asset"}`);
|
|
48
48
|
}
|
|
49
|
-
else if (fast.kind === "native" && (listed.execution !== "native" ||
|
|
49
|
+
else if (fast.kind === "native" && ((listed.execution !== "native" && listed.execution !== "bundled-shell") ||
|
|
50
50
|
(fast.asset === undefined ? listed.asset !== undefined : listed.asset !== fast.asset))) {
|
|
51
51
|
mismatches.push(`${fast.name} has fast-route metadata that differs from the native command catalog`);
|
|
52
52
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare const HQ_SESSION_ASSET = "core/scripts/hq-session.sh";
|
|
2
|
+
export declare const HQ_SESSION_HELP: string;
|
|
3
|
+
export type HqSessionResult = {
|
|
4
|
+
code: number;
|
|
5
|
+
stdout: string;
|
|
6
|
+
stderr: string;
|
|
7
|
+
};
|
|
8
|
+
export type HqSessionDependencies = {
|
|
9
|
+
env: NodeJS.ProcessEnv;
|
|
10
|
+
now: () => Date;
|
|
11
|
+
readFile: (filePath: string, encoding: BufferEncoding) => string;
|
|
12
|
+
exists: (filePath: string) => boolean;
|
|
13
|
+
isFile: (filePath: string) => boolean;
|
|
14
|
+
isDirectory: (filePath: string) => boolean;
|
|
15
|
+
isSymlink: (filePath: string) => boolean;
|
|
16
|
+
listDirectory: (directory: string) => string[];
|
|
17
|
+
mkdir: (directory: string) => void;
|
|
18
|
+
writeFile: (filePath: string, contents: string, mode?: number) => void;
|
|
19
|
+
rename: (from: string, to: string) => void;
|
|
20
|
+
remove: (filePath: string) => void;
|
|
21
|
+
makeTempPath: () => string;
|
|
22
|
+
umask: () => number;
|
|
23
|
+
findExecutable: (name: string, env?: NodeJS.ProcessEnv) => string | undefined;
|
|
24
|
+
spawnDetached: (command: string, args: string[], cwd: string, env: NodeJS.ProcessEnv, logFile: string) => void;
|
|
25
|
+
runCommand: (command: string, args: string[], cwd: string, env: NodeJS.ProcessEnv) => {
|
|
26
|
+
status: number | null;
|
|
27
|
+
stdout: string;
|
|
28
|
+
stderr: string;
|
|
29
|
+
error?: Error;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
/** In-process command body, with injectable file access for parity tests. */
|
|
33
|
+
export declare function executeHqSession(argv: readonly string[], context: {
|
|
34
|
+
cwd: string;
|
|
35
|
+
hqRoot?: string;
|
|
36
|
+
}, overrides?: Partial<HqSessionDependencies>): HqSessionResult;
|
|
37
|
+
/** Signature consumed by the lightweight fast-core dispatcher. */
|
|
38
|
+
export declare function runHqSessionFast(argv: readonly string[], _stdin: string, cwd: string, hqRoot: string | undefined): Promise<number>;
|
|
39
|
+
//# sourceMappingURL=core-hq-session-native.d.ts.map
|