chief-helm 0.1.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/Readme.md +220 -0
- package/dist/commands/config.d.ts +26 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +111 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/inputs.d.ts +21 -0
- package/dist/commands/inputs.d.ts.map +1 -0
- package/dist/commands/inputs.js +158 -0
- package/dist/commands/inputs.js.map +1 -0
- package/dist/commands/push.d.ts +21 -0
- package/dist/commands/push.d.ts.map +1 -0
- package/dist/commands/push.js +51 -0
- package/dist/commands/push.js.map +1 -0
- package/dist/commands/secrets.d.ts +21 -0
- package/dist/commands/secrets.d.ts.map +1 -0
- package/dist/commands/secrets.js +110 -0
- package/dist/commands/secrets.js.map +1 -0
- package/dist/commands/setup.d.ts +24 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +421 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/status.d.ts +20 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +184 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/sync.d.ts +19 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +47 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/core/config.d.ts +74 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +182 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/git.d.ts +73 -0
- package/dist/core/git.d.ts.map +1 -0
- package/dist/core/git.js +188 -0
- package/dist/core/git.js.map +1 -0
- package/dist/core/inputs.d.ts +40 -0
- package/dist/core/inputs.d.ts.map +1 -0
- package/dist/core/inputs.js +360 -0
- package/dist/core/inputs.js.map +1 -0
- package/dist/core/repo.d.ts +71 -0
- package/dist/core/repo.d.ts.map +1 -0
- package/dist/core/repo.js +152 -0
- package/dist/core/repo.js.map +1 -0
- package/dist/core/secrets.d.ts +79 -0
- package/dist/core/secrets.d.ts.map +1 -0
- package/dist/core/secrets.js +168 -0
- package/dist/core/secrets.js.map +1 -0
- package/dist/core/state.d.ts +46 -0
- package/dist/core/state.d.ts.map +1 -0
- package/dist/core/state.js +119 -0
- package/dist/core/state.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +163 -0
- package/dist/index.js.map +1 -0
- package/dist/types/index.d.ts +210 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +10 -0
- package/dist/types/index.js.map +1 -0
- package/dist/ui/components/Header.d.ts +32 -0
- package/dist/ui/components/Header.d.ts.map +1 -0
- package/dist/ui/components/Header.js +15 -0
- package/dist/ui/components/Header.js.map +1 -0
- package/dist/ui/components/Panel.d.ts +30 -0
- package/dist/ui/components/Panel.d.ts.map +1 -0
- package/dist/ui/components/Panel.js +15 -0
- package/dist/ui/components/Panel.js.map +1 -0
- package/dist/ui/components/StatusRow.d.ts +39 -0
- package/dist/ui/components/StatusRow.d.ts.map +1 -0
- package/dist/ui/components/StatusRow.js +27 -0
- package/dist/ui/components/StatusRow.js.map +1 -0
- package/dist/ui/theme.d.ts +60 -0
- package/dist/ui/theme.d.ts.map +1 -0
- package/dist/ui/theme.js +60 -0
- package/dist/ui/theme.js.map +1 -0
- package/dist/utils/errors.d.ts +50 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +63 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/format.d.ts +66 -0
- package/dist/utils/format.d.ts.map +1 -0
- package/dist/utils/format.js +107 -0
- package/dist/utils/format.js.map +1 -0
- package/dist/utils/logger.d.ts +35 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +71 -0
- package/dist/utils/logger.js.map +1 -0
- package/package.json +53 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* @file HELM CLI entry point.
|
|
4
|
+
*
|
|
5
|
+
* Responsibilities:
|
|
6
|
+
* 1. Startup checks — Node version ≥ 20, git in PATH — before any
|
|
7
|
+
* command executes. Failures here produce clear errors and exit 1.
|
|
8
|
+
* 2. Commander program setup — version, description, global error handling.
|
|
9
|
+
* 3. Command registration — one call per command module.
|
|
10
|
+
* 4. Global error handler — catches HelmError and unexpected errors from
|
|
11
|
+
* all command actions, formats them consistently, and exits 1.
|
|
12
|
+
*
|
|
13
|
+
* All command modules export a register[Name]Command(program) function
|
|
14
|
+
* and are responsible for their own subcommands, options, and actions.
|
|
15
|
+
*
|
|
16
|
+
* This file contains no business logic. It wires together the application.
|
|
17
|
+
*/
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;GAeG"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* @file HELM CLI entry point.
|
|
4
|
+
*
|
|
5
|
+
* Responsibilities:
|
|
6
|
+
* 1. Startup checks — Node version ≥ 20, git in PATH — before any
|
|
7
|
+
* command executes. Failures here produce clear errors and exit 1.
|
|
8
|
+
* 2. Commander program setup — version, description, global error handling.
|
|
9
|
+
* 3. Command registration — one call per command module.
|
|
10
|
+
* 4. Global error handler — catches HelmError and unexpected errors from
|
|
11
|
+
* all command actions, formats them consistently, and exits 1.
|
|
12
|
+
*
|
|
13
|
+
* All command modules export a register[Name]Command(program) function
|
|
14
|
+
* and are responsible for their own subcommands, options, and actions.
|
|
15
|
+
*
|
|
16
|
+
* This file contains no business logic. It wires together the application.
|
|
17
|
+
*/
|
|
18
|
+
import { Command } from "commander";
|
|
19
|
+
import chalk from "chalk";
|
|
20
|
+
import { isGitAvailable } from "./core/git.js";
|
|
21
|
+
import { HelmError, formatHelmError, formatUnexpectedError } from "./utils/errors.js";
|
|
22
|
+
import { theme } from "./ui/theme.js";
|
|
23
|
+
import { registerSetupCommand } from "./commands/setup.js";
|
|
24
|
+
import { registerStatusCommand } from "./commands/status.js";
|
|
25
|
+
import { registerSecretsCommand } from "./commands/secrets.js";
|
|
26
|
+
import { registerSyncCommand } from "./commands/sync.js";
|
|
27
|
+
import { registerPushCommand } from "./commands/push.js";
|
|
28
|
+
import { registerInputsCommand } from "./commands/inputs.js";
|
|
29
|
+
import { registerConfigCommand } from "./commands/config.js";
|
|
30
|
+
// ─── Startup Checks ───────────────────────────────────────────────────────────
|
|
31
|
+
/**
|
|
32
|
+
* Validates that the current Node.js runtime meets the minimum version
|
|
33
|
+
* requirement of v20. Exits with a clear error if it does not.
|
|
34
|
+
*
|
|
35
|
+
* Must be called before Commander parses any arguments so the check
|
|
36
|
+
* fires even on `helm --version` invocations on incompatible runtimes.
|
|
37
|
+
*/
|
|
38
|
+
function checkNodeVersion() {
|
|
39
|
+
const versionStr = process.versions.node;
|
|
40
|
+
const major = parseInt(versionStr.split(".")[0] ?? "0", 10);
|
|
41
|
+
if (major < 20) {
|
|
42
|
+
console.error(chalk.hex(theme.error)(`âś— Error: Node.js v${versionStr} is not supported.\n` +
|
|
43
|
+
` → Install Node.js v20 or later from https://nodejs.org`));
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Validates that `git` is available in PATH. Exits with a clear error
|
|
49
|
+
* if it is not found. Must complete before any command runs.
|
|
50
|
+
*/
|
|
51
|
+
async function checkGitAvailable() {
|
|
52
|
+
const available = await isGitAvailable();
|
|
53
|
+
if (!available) {
|
|
54
|
+
console.error(chalk.hex(theme.error)("âś— Error: git is not available in PATH.\n" +
|
|
55
|
+
" → macOS: git is pre-installed, or install via Homebrew: brew install git\n" +
|
|
56
|
+
" → Windows: download from https://git-scm.com"));
|
|
57
|
+
process.exit(1);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
// ─── Error Handler ────────────────────────────────────────────────────────────
|
|
61
|
+
/**
|
|
62
|
+
* Wraps an async command action so that HelmErrors and unexpected errors
|
|
63
|
+
* are both caught, formatted consistently, and cause a clean exit(1)
|
|
64
|
+
* rather than an unhandled promise rejection.
|
|
65
|
+
*
|
|
66
|
+
* All command actions must be wrapped with this function.
|
|
67
|
+
*
|
|
68
|
+
* @param fn - The async command action to wrap.
|
|
69
|
+
*/
|
|
70
|
+
function action(fn) {
|
|
71
|
+
return async (...args) => {
|
|
72
|
+
try {
|
|
73
|
+
await fn(...args);
|
|
74
|
+
}
|
|
75
|
+
catch (err) {
|
|
76
|
+
if (err instanceof HelmError) {
|
|
77
|
+
console.error(chalk.hex(theme.error)(formatHelmError(err)));
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
console.error(chalk.hex(theme.error)(formatUnexpectedError(err)));
|
|
81
|
+
}
|
|
82
|
+
process.exit(1);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
// ─── Program ──────────────────────────────────────────────────────────────────
|
|
87
|
+
const program = new Command();
|
|
88
|
+
program
|
|
89
|
+
.name("helm")
|
|
90
|
+
.description("CHIEF — Personal AI Operations System CLI")
|
|
91
|
+
.version("0.1.0", "-v, --version", "Print version number")
|
|
92
|
+
.helpOption("-h, --help", "Show help");
|
|
93
|
+
// Commander does not propagate async action errors by default.
|
|
94
|
+
// exitOverride turns Commander exceptions into thrown errors so our
|
|
95
|
+
// try/catch in action() can handle them uniformly.
|
|
96
|
+
program.exitOverride();
|
|
97
|
+
// ─── Command Registration ─────────────────────────────────────────────────────
|
|
98
|
+
registerSetupCommand(program);
|
|
99
|
+
registerStatusCommand(program);
|
|
100
|
+
registerSecretsCommand(program);
|
|
101
|
+
registerSyncCommand(program);
|
|
102
|
+
registerPushCommand(program);
|
|
103
|
+
registerInputsCommand(program);
|
|
104
|
+
registerConfigCommand(program);
|
|
105
|
+
// ─── Placeholder Stubs for Phase 2 / 3 Commands ─────────────────────────────
|
|
106
|
+
// These prevent "unknown command" errors if a user tries a Phase 2 command
|
|
107
|
+
// and surface a clear "not yet available" message instead.
|
|
108
|
+
for (const name of [
|
|
109
|
+
"run",
|
|
110
|
+
"sweep",
|
|
111
|
+
"block",
|
|
112
|
+
"agents",
|
|
113
|
+
"flows",
|
|
114
|
+
"triggers",
|
|
115
|
+
"docs",
|
|
116
|
+
"logs",
|
|
117
|
+
"outputs",
|
|
118
|
+
"tune",
|
|
119
|
+
]) {
|
|
120
|
+
program
|
|
121
|
+
.command(name, { hidden: true })
|
|
122
|
+
.allowUnknownOption(true)
|
|
123
|
+
.action(() => {
|
|
124
|
+
console.log(chalk.hex(theme.muted)(` helm ${name} is not available in this version (Phase 1).\n` +
|
|
125
|
+
` It will be added in a future release.`));
|
|
126
|
+
process.exit(1);
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
// ─── Bootstrap ────────────────────────────────────────────────────────────────
|
|
130
|
+
/**
|
|
131
|
+
* Main entry point. Runs startup checks then delegates to Commander.
|
|
132
|
+
*/
|
|
133
|
+
async function main() {
|
|
134
|
+
checkNodeVersion();
|
|
135
|
+
await checkGitAvailable();
|
|
136
|
+
try {
|
|
137
|
+
await program.parseAsync(process.argv);
|
|
138
|
+
}
|
|
139
|
+
catch (err) {
|
|
140
|
+
// Commander throws CommanderError on --help, --version, and exitOverride.
|
|
141
|
+
// These are normal control-flow exits — do not treat as failures.
|
|
142
|
+
if (err instanceof Error &&
|
|
143
|
+
"code" in err &&
|
|
144
|
+
typeof err.code === "string" &&
|
|
145
|
+
err.code.startsWith("commander.")) {
|
|
146
|
+
const code = err.code;
|
|
147
|
+
// commander.helpDisplayed and commander.version are clean exits.
|
|
148
|
+
if (code === "commander.helpDisplayed" || code === "commander.version") {
|
|
149
|
+
process.exit(0);
|
|
150
|
+
}
|
|
151
|
+
// commander.unknownCommand and others are user errors.
|
|
152
|
+
process.exit(1);
|
|
153
|
+
}
|
|
154
|
+
// Unhandled error outside a command action.
|
|
155
|
+
console.error(chalk.hex(theme.error)(formatUnexpectedError(err)));
|
|
156
|
+
process.exit(1);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
main().catch((err) => {
|
|
160
|
+
console.error(chalk.hex(theme.error)(formatUnexpectedError(err)));
|
|
161
|
+
process.exit(1);
|
|
162
|
+
});
|
|
163
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AACtF,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,iFAAiF;AAEjF;;;;;;GAMG;AACH,SAAS,gBAAgB;IACvB,MAAM,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;IACzC,MAAM,KAAK,GAAG,QAAQ,CAAC,UAAU,C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
|
1
|
+
/**
|
|
2
|
+
* @file Shared TypeScript types and interfaces for HELM.
|
|
3
|
+
*
|
|
4
|
+
* This is the single source of truth for all data shapes used across
|
|
5
|
+
* the CLI. Types map directly to the YAML schemas in the user's
|
|
6
|
+
* personal instance repo under /config/ and to local machine state
|
|
7
|
+
* at ~/.chief/config.json.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* A single external data source integration (Gmail, Todoist, etc.).
|
|
11
|
+
* Persisted in config/inputs.yaml in the instance repo.
|
|
12
|
+
*/
|
|
13
|
+
export interface Input {
|
|
14
|
+
/** Unique machine identifier, e.g. "gmail". */
|
|
15
|
+
id: string;
|
|
16
|
+
/** Human-readable display label. */
|
|
17
|
+
label: string;
|
|
18
|
+
/** Whether this input participates in flow runs. */
|
|
19
|
+
enabled: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Whether credentials have been stored and the last connectivity
|
|
22
|
+
* test passed. Set to true by HELM after a successful test.
|
|
23
|
+
*/
|
|
24
|
+
configured: boolean;
|
|
25
|
+
/** OAuth scopes or permission strings required by this input. */
|
|
26
|
+
scope?: string[];
|
|
27
|
+
/** Short text shown during helm setup to guide credential collection. */
|
|
28
|
+
setup_guide: string;
|
|
29
|
+
/**
|
|
30
|
+
* Primary secret key name for this input (used as a human-readable
|
|
31
|
+
* reference only). All required key names are defined in
|
|
32
|
+
* INPUT_CREDENTIAL_KEYS in core/inputs.ts.
|
|
33
|
+
*/
|
|
34
|
+
credentials_ref: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* An AI agent definition.
|
|
38
|
+
* Persisted in config/agents.yaml in the instance repo.
|
|
39
|
+
*/
|
|
40
|
+
export interface Agent {
|
|
41
|
+
/** Unique machine identifier, e.g. "email_drafter". */
|
|
42
|
+
id: string;
|
|
43
|
+
/** Human-readable display label. */
|
|
44
|
+
label: string;
|
|
45
|
+
/** Whether this agent is active and will be invoked during flow runs. */
|
|
46
|
+
enabled: boolean;
|
|
47
|
+
/** Repo-relative path to the agent's instruction markdown file. */
|
|
48
|
+
instruction_file: string;
|
|
49
|
+
/** IDs of Input entries this agent depends on. */
|
|
50
|
+
inputs: string[];
|
|
51
|
+
/** Semantic keys describing what this agent produces. */
|
|
52
|
+
outputs: string[];
|
|
53
|
+
/** Context document keys to include in this agent's context package. */
|
|
54
|
+
context_keys: string[];
|
|
55
|
+
/**
|
|
56
|
+
* Non-overridable behavioural constraints for this agent.
|
|
57
|
+
* Values may be boolean flags or numeric limits.
|
|
58
|
+
*/
|
|
59
|
+
hard_limits?: Record<string, boolean | number>;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* A named process flow that orchestrates one or more agents.
|
|
63
|
+
* Persisted in config/flows.yaml in the instance repo.
|
|
64
|
+
*/
|
|
65
|
+
export interface Flow {
|
|
66
|
+
/** Unique machine identifier, e.g. "am-sweep". */
|
|
67
|
+
id: string;
|
|
68
|
+
/** Human-readable display label. */
|
|
69
|
+
label: string;
|
|
70
|
+
/** Whether this flow can be triggered. */
|
|
71
|
+
enabled: boolean;
|
|
72
|
+
/** Repo-relative path to the flow's instruction markdown file. */
|
|
73
|
+
instruction_file: string;
|
|
74
|
+
/** Ordered list of Agent IDs to run in this flow. */
|
|
75
|
+
agents: string[];
|
|
76
|
+
/** Input IDs that must be configured before this flow can run. */
|
|
77
|
+
inputs_required: string[];
|
|
78
|
+
/** Whether to pause for human review before dispatching agents. */
|
|
79
|
+
human_gate_before_agents: boolean;
|
|
80
|
+
/** Whether agents run concurrently rather than sequentially. */
|
|
81
|
+
parallel?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Key used to prevent duplicate runs within a single calendar day.
|
|
84
|
+
* When set, HELM checks processed_ids.json before executing.
|
|
85
|
+
*/
|
|
86
|
+
idempotency_key?: string;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* A scheduled or manual invocation entry point for a flow.
|
|
90
|
+
* Persisted in config/triggers.yaml in the instance repo.
|
|
91
|
+
*/
|
|
92
|
+
export interface Trigger {
|
|
93
|
+
/** Unique machine identifier. */
|
|
94
|
+
id: string;
|
|
95
|
+
/** Human-readable display label. */
|
|
96
|
+
label: string;
|
|
97
|
+
/** Whether this trigger is active. */
|
|
98
|
+
enabled: boolean;
|
|
99
|
+
/** How this trigger fires. */
|
|
100
|
+
type: "scheduled" | "manual";
|
|
101
|
+
/** Cron expression (required when type is "scheduled"). */
|
|
102
|
+
schedule?: string;
|
|
103
|
+
/** Where the scheduled job runs. Railway schedules are managed externally. */
|
|
104
|
+
platform?: "railway" | "local";
|
|
105
|
+
/** CLI command or URL used to invoke this trigger externally. */
|
|
106
|
+
invocation?: string;
|
|
107
|
+
/** ID of the Flow this trigger activates. */
|
|
108
|
+
flow: string;
|
|
109
|
+
/** Whether a human approval gate is required before agents run. */
|
|
110
|
+
human_gate: boolean;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Top-level system settings.
|
|
114
|
+
* Persisted in config/system.yaml in the instance repo.
|
|
115
|
+
*/
|
|
116
|
+
export interface SystemConfig {
|
|
117
|
+
/** Schema version for this config file. */
|
|
118
|
+
version: string;
|
|
119
|
+
/** Username of the active user on this instance. */
|
|
120
|
+
active_user: string;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Orchestration engine configuration.
|
|
124
|
+
* Persisted in config/engine.yaml in the instance repo.
|
|
125
|
+
*/
|
|
126
|
+
export interface EngineConfig {
|
|
127
|
+
/**
|
|
128
|
+
* Engine implementation identifier.
|
|
129
|
+
* Only "claude-code" is supported in Phase 1.
|
|
130
|
+
*/
|
|
131
|
+
engine: "claude-code" | "anthropic-api";
|
|
132
|
+
/** Shell command used to invoke the engine (e.g. "claude"). */
|
|
133
|
+
command: string;
|
|
134
|
+
/** Hard timeout in seconds before an agent run is killed. */
|
|
135
|
+
timeout_seconds: number;
|
|
136
|
+
/**
|
|
137
|
+
* Model identifier passed to the engine.
|
|
138
|
+
* Required when engine is "anthropic-api".
|
|
139
|
+
*/
|
|
140
|
+
model?: string;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Machine-local configuration stored at ~/.chief/config.json.
|
|
144
|
+
* Never committed to git. Managed by the conf package.
|
|
145
|
+
*/
|
|
146
|
+
export interface LocalConfig {
|
|
147
|
+
/** Absolute path to the user's personal CHIEF instance repo. */
|
|
148
|
+
instance_repo_path: string;
|
|
149
|
+
/** Username active on this machine (matches /users/[username]/ in the repo). */
|
|
150
|
+
active_user: string;
|
|
151
|
+
/** Shell command used to open files in the user's preferred editor. */
|
|
152
|
+
editor: string;
|
|
153
|
+
/** True only after helm setup completes including a successful git push. */
|
|
154
|
+
setup_complete: boolean;
|
|
155
|
+
/** ISO 8601 timestamp of the last successful helm sync. */
|
|
156
|
+
last_sync: string;
|
|
157
|
+
/**
|
|
158
|
+
* List of secret key names stored in the OS keychain for this machine.
|
|
159
|
+
* Format: "[username]/[KEY_NAME]". Values are never stored here — only names.
|
|
160
|
+
* This manifest exists because the OS keychain API does not support enumeration.
|
|
161
|
+
*/
|
|
162
|
+
secrets_manifest: string[];
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* A single flow's last execution record.
|
|
166
|
+
*/
|
|
167
|
+
export interface LastRunRecord {
|
|
168
|
+
/** ISO 8601 timestamp of the last execution. */
|
|
169
|
+
timestamp: string;
|
|
170
|
+
/** Terminal status of the last run. */
|
|
171
|
+
status: "success" | "failed";
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Contents of state/[username]/last_run.json.
|
|
175
|
+
* Keys are flow IDs.
|
|
176
|
+
*/
|
|
177
|
+
export type LastRunState = Record<string, LastRunRecord>;
|
|
178
|
+
/**
|
|
179
|
+
* Result of an input connectivity test.
|
|
180
|
+
*/
|
|
181
|
+
export interface InputTestResult {
|
|
182
|
+
/** Input ID that was tested. */
|
|
183
|
+
inputId: string;
|
|
184
|
+
/** Whether the test call succeeded. */
|
|
185
|
+
ok: boolean;
|
|
186
|
+
/**
|
|
187
|
+
* Human-readable detail returned by the test (e.g. email address, count).
|
|
188
|
+
* Only populated on success.
|
|
189
|
+
*/
|
|
190
|
+
detail?: string;
|
|
191
|
+
/**
|
|
192
|
+
* Error description on failure.
|
|
193
|
+
* Never contains secret values.
|
|
194
|
+
*/
|
|
195
|
+
error?: string;
|
|
196
|
+
/**
|
|
197
|
+
* Specific remediation instruction shown to the user on failure.
|
|
198
|
+
*/
|
|
199
|
+
fix?: string;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Git repository status summary used by helm status and helm sync.
|
|
203
|
+
*/
|
|
204
|
+
export interface RepoStatus {
|
|
205
|
+
/** Whether the working tree has no uncommitted changes. */
|
|
206
|
+
clean: boolean;
|
|
207
|
+
/** Number of modified, added, or deleted files when not clean. */
|
|
208
|
+
fileCount: number;
|
|
209
|
+
}
|
|
210
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH;;;GAGG;AACH,MAAM,WAAW,KAAK;IACpB,+CAA+C;IAC/C,EAAE,EAAE,MAAM,CAAC;IACX,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,yEAAyE;IACzE,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,KAAK;IACpB,uDAAuD;IACvD,EAAE,EAAE,MAAM,CAAC;IACX,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,OAAO,EAAE,OAAO,CAAC;IACjB,mEAAmE;IACnE,gB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M,WAAW,UAAU;IACzB,2DAA2D;IAC3D,KAAK,EAAE,OAAO,CAAC;IACf,kEAAkE;IAClE,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Shared TypeScript types and interfaces for HELM.
|
|
3
|
+
*
|
|
4
|
+
* This is the single source of truth for all data shapes used across
|
|
5
|
+
* the CLI. Types map directly to the YAML schemas in the user's
|
|
6
|
+
* personal instance repo under /config/ and to local machine state
|
|
7
|
+
* at ~/.chief/config.json.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Header Ink component.
|
|
3
|
+
*
|
|
4
|
+
* Renders the top chrome bar used in all interactive HELM panels.
|
|
5
|
+
* Format: CHIEF · [SCREEN] · [username] · [context]
|
|
6
|
+
*
|
|
7
|
+
* Context is optional. When omitted, the trailing separator and segment
|
|
8
|
+
* are not rendered so the header does not end with a dangling "·".
|
|
9
|
+
*
|
|
10
|
+
* Used in Phase 2 interactive views (HumanGate, AgentProgress).
|
|
11
|
+
* Phase 1 static commands (helm status) render equivalent chrome
|
|
12
|
+
* inline using chalk + box-drawing helpers.
|
|
13
|
+
*/
|
|
14
|
+
import React from "react";
|
|
15
|
+
/** Props for the Header component. */
|
|
16
|
+
export interface HeaderProps {
|
|
17
|
+
/** Screen name displayed in the second segment, e.g. "STATUS". */
|
|
18
|
+
screen: string;
|
|
19
|
+
/** Active username displayed in the third segment. */
|
|
20
|
+
username: string;
|
|
21
|
+
/** Optional contextual label for the fourth segment (flow id, date, etc.). */
|
|
22
|
+
context?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Top-level header bar following the CHIEF visual design system.
|
|
26
|
+
*
|
|
27
|
+
* All text segments are separated by the design system bullet character.
|
|
28
|
+
* The "CHIEF" prefix is always bold. The screen name uses the accent
|
|
29
|
+
* colour to draw the eye. Username and context use the muted colour.
|
|
30
|
+
*/
|
|
31
|
+
export declare function Header({ screen, username, context }: HeaderProps): React.ReactElement;
|
|
32
|
+
//# sourceMappingURL=Header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../src/ui/components/Header.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,sCAAsC;AACtC,MAAM,WAAW,WAAW;IAC1B,kEAAkE;IAClE,MAAM,EAAE,MAAM,CAAC;IACf,sDAAsD;IACtD,QAAQ,EAAE,MAAM,CAAC;IACjB,8EAA8E;IAC9E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,WAAW,GAAG,KAAK,CAAC,YAAY,CAwBrF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import { theme, symbol } from "../theme.js";
|
|
4
|
+
/**
|
|
5
|
+
* Top-level header bar following the CHIEF visual design system.
|
|
6
|
+
*
|
|
7
|
+
* All text segments are separated by the design system bullet character.
|
|
8
|
+
* The "CHIEF" prefix is always bold. The screen name uses the accent
|
|
9
|
+
* colour to draw the eye. Username and context use the muted colour.
|
|
10
|
+
*/
|
|
11
|
+
export function Header({ screen, username, context }) {
|
|
12
|
+
const sep = (_jsx(Text, { color: theme.border, children: " " + symbol.bullet + " " }));
|
|
13
|
+
return (_jsxs(Box, { children: [_jsx(Text, { bold: true, color: theme.text, children: "CHIEF" }), sep, _jsx(Text, { bold: true, color: theme.accent, children: screen }), sep, _jsx(Text, { color: theme.muted, children: username }), context !== undefined && (_jsxs(_Fragment, { children: [sep, _jsx(Text, { color: theme.muted, children: context })] }))] }));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=Header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../../src/ui/components/Header.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAY5C;;;;;;GAMG;AACH,MAAM,UAAU,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAe;IAC/D,MAAM,GAAG,GAAG,CACV,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,MAAM,YAAG,IAAI,GAAG,MAAM,CAAC,MAAM,GAAG,IAAI,GAAQ,CAChE,CAAC;IAEF,OAAO,CACL,MAAC,GAAG,eACF,KAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAE,KAAK,CAAC,IAAI,sBAErB,EACN,GAAG,EACJ,KAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAE,KAAK,CAAC,MAAM,YAC3B,MAAM,GACF,EACN,GAAG,EACJ,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,YAAG,QAAQ,GAAQ,EAC1C,OAAO,KAAK,SAAS,IAAI,CACxB,8BACG,GAAG,EACJ,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,YAAG,OAAO,GAAQ,IACzC,CACJ,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Panel Ink component.
|
|
3
|
+
*
|
|
4
|
+
* A bordered container that wraps content in the CHIEF single-border
|
|
5
|
+
* style. All interactive HELM views (HumanGate, AgentProgress,
|
|
6
|
+
* CompletionReport) are composed inside a Panel.
|
|
7
|
+
*
|
|
8
|
+
* Used in Phase 2 interactive views.
|
|
9
|
+
*/
|
|
10
|
+
import React from "react";
|
|
11
|
+
/** Props for the Panel component. */
|
|
12
|
+
export interface PanelProps {
|
|
13
|
+
/** Content to render inside the bordered container. */
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Total column width of the panel including borders.
|
|
17
|
+
* Defaults to 62 columns to match the Phase 1 static panel width.
|
|
18
|
+
*/
|
|
19
|
+
width?: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Bordered panel container using the CHIEF border colour.
|
|
23
|
+
*
|
|
24
|
+
* Uses Ink's built-in borderStyle so that the single-line box
|
|
25
|
+
* characters are rendered correctly across all supported terminals.
|
|
26
|
+
* Horizontal padding of 1 column is applied inside the border on
|
|
27
|
+
* each side.
|
|
28
|
+
*/
|
|
29
|
+
export declare function Panel({ children, width }: PanelProps): React.ReactElement;
|
|
30
|
+
//# sourceMappingURL=Panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Panel.d.ts","sourceRoot":"","sources":["../../../src/ui/components/Panel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,qCAAqC;AACrC,MAAM,WAAW,UAAU;IACzB,uDAAuD;IACvD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,EAAE,QAAQ,EAAE,KAAU,EAAE,EAAE,UAAU,GAAG,KAAK,CAAC,YAAY,CAY9E"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from "ink";
|
|
3
|
+
import { theme } from "../theme.js";
|
|
4
|
+
/**
|
|
5
|
+
* Bordered panel container using the CHIEF border colour.
|
|
6
|
+
*
|
|
7
|
+
* Uses Ink's built-in borderStyle so that the single-line box
|
|
8
|
+
* characters are rendered correctly across all supported terminals.
|
|
9
|
+
* Horizontal padding of 1 column is applied inside the border on
|
|
10
|
+
* each side.
|
|
11
|
+
*/
|
|
12
|
+
export function Panel({ children, width = 62 }) {
|
|
13
|
+
return (_jsx(Box, { borderStyle: "single", borderColor: theme.border, width: width, flexDirection: "column", paddingX: 1, children: children }));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=Panel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Panel.js","sourceRoot":"","sources":["../../../src/ui/components/Panel.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAapC;;;;;;;GAOG;AACH,MAAM,UAAU,KAAK,CAAC,EAAE,QAAQ,EAAE,KAAK,GAAG,EAAE,EAAc;IACxD,OAAO,CACL,KAAC,GAAG,IACF,WAAW,EAAC,QAAQ,EACpB,WAAW,EAAE,KAAK,CAAC,MAAM,EACzB,KAAK,EAAE,KAAK,EACZ,aAAa,EAAC,QAAQ,EACtB,QAAQ,EAAE,CAAC,YAEV,QAAQ,GACL,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file StatusRow Ink component.
|
|
3
|
+
*
|
|
4
|
+
* A single horizontal row displaying a status symbol, a label, and an
|
|
5
|
+
* optional detail string. Used inside Panel to build list-style sections
|
|
6
|
+
* in interactive views (agent progress, completion reports).
|
|
7
|
+
*
|
|
8
|
+
* The four status variants map directly to the CHIEF design system
|
|
9
|
+
* symbol and colour conventions defined in theme.ts.
|
|
10
|
+
*/
|
|
11
|
+
import React from "react";
|
|
12
|
+
/** The four supported visual states for a status row. */
|
|
13
|
+
export type StatusVariant = "success" | "error" | "warning" | "disabled";
|
|
14
|
+
/** Props for the StatusRow component. */
|
|
15
|
+
export interface StatusRowProps {
|
|
16
|
+
/** Text label identifying the item (agent name, input name, etc.). */
|
|
17
|
+
label: string;
|
|
18
|
+
/** Visual variant that determines the symbol and colour. */
|
|
19
|
+
status: StatusVariant;
|
|
20
|
+
/**
|
|
21
|
+
* Optional secondary text shown after the label.
|
|
22
|
+
* Rendered in the muted colour (e.g. "connected", "12s", "drafting…").
|
|
23
|
+
*/
|
|
24
|
+
detail?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Fixed width for the label column in characters.
|
|
27
|
+
* Defaults to 22 to align detail text across rows in a list.
|
|
28
|
+
*/
|
|
29
|
+
labelWidth?: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Renders a single status row with a leading symbol, a fixed-width
|
|
33
|
+
* label column, and an optional trailing detail string.
|
|
34
|
+
*
|
|
35
|
+
* Label padding is applied in the Text content rather than via Ink
|
|
36
|
+
* layout so the row renders correctly even in narrow terminals.
|
|
37
|
+
*/
|
|
38
|
+
export declare function StatusRow({ label, status, detail, labelWidth, }: StatusRowProps): React.ReactElement;
|
|
39
|
+
//# sourceMappingURL=StatusRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusRow.d.ts","sourceRoot":"","sources":["../../../src/ui/components/StatusRow.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,yDAAyD;AACzD,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,UAAU,CAAC;AAEzE,yCAAyC;AACzC,MAAM,WAAW,cAAc;IAC7B,sEAAsE;IACtE,KAAK,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,MAAM,EAAE,aAAa,CAAC;IACtB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAgBD;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,MAAM,EACN,MAAM,EACN,UAAe,GAChB,EAAE,cAAc,GAAG,KAAK,CAAC,YAAY,CAarC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import { theme, symbol } from "../theme.js";
|
|
4
|
+
const SYMBOLS = {
|
|
5
|
+
success: symbol.success,
|
|
6
|
+
error: symbol.error,
|
|
7
|
+
warning: symbol.warning,
|
|
8
|
+
disabled: symbol.disabled,
|
|
9
|
+
};
|
|
10
|
+
const COLORS = {
|
|
11
|
+
success: theme.success,
|
|
12
|
+
error: theme.error,
|
|
13
|
+
warning: theme.warning,
|
|
14
|
+
disabled: theme.skip,
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Renders a single status row with a leading symbol, a fixed-width
|
|
18
|
+
* label column, and an optional trailing detail string.
|
|
19
|
+
*
|
|
20
|
+
* Label padding is applied in the Text content rather than via Ink
|
|
21
|
+
* layout so the row renders correctly even in narrow terminals.
|
|
22
|
+
*/
|
|
23
|
+
export function StatusRow({ label, status, detail, labelWidth = 22, }) {
|
|
24
|
+
const paddedLabel = label.padEnd(labelWidth);
|
|
25
|
+
return (_jsxs(Box, { children: [_jsx(Text, { color: COLORS[status], children: SYMBOLS[status] }), _jsx(Text, { children: " " }), _jsx(Text, { color: theme.text, children: paddedLabel }), detail !== undefined && (_jsx(Text, { color: theme.muted, children: detail }))] }));
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=StatusRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusRow.js","sourceRoot":"","sources":["../../../src/ui/components/StatusRow.tsx"],"names":[],"mappings":";AAYA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAuB5C,MAAM,OAAO,GAAkC;IAC7C,OAAO,EAAE,MAAM,CAAC,OAAO;IACvB,KAAK,EAAE,MAAM,CAAC,KAAK;IACnB,OAAO,EAAE,MAAM,CAAC,OAAO;IACvB,QAAQ,EAAE,MAAM,CAAC,QAAQ;CAC1B,CAAC;AAEF,MAAM,MAAM,GAAkC;IAC5C,OAAO,EAAE,KAAK,CAAC,OAAO;IACtB,KAAK,EAAE,KAAK,CAAC,KAAK;IAClB,OAAO,EAAE,KAAK,CAAC,OAAO;IACtB,QAAQ,EAAE,KAAK,CAAC,IAAI;CACrB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,EACxB,KAAK,EACL,MAAM,EACN,MAAM,EACN,UAAU,GAAG,EAAE,GACA;IACf,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAE7C,OAAO,CACL,MAAC,GAAG,eACF,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,YAAG,OAAO,CAAC,MAAM,CAAC,GAAQ,EACrD,KAAC,IAAI,oBAAS,EACd,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,IAAI,YAAG,WAAW,GAAQ,EAC5C,MAAM,KAAK,SAAS,IAAI,CACvB,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,YAAG,MAAM,GAAQ,CAC1C,IACG,CACP,CAAC;AACJ,CAAC"}
|