mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-15 09:25:28 +02:00
fix(bin): delete zero-caller scripts; make host-config-export's docstring honest
- bin/gstack-open-url (14 lines): announced in a CHANGELOG entry, wired into nothing, ever. bin/gstack-platform-detect (27 lines): zero callers, and its hand-rolled host list was already stale (SLATE_HOST.md cites it as a problem). Note: the deprecated gstack-brain-consumer/reader pair the audit flagged was already deleted upstream in v1.63 with a stay-deleted tripwire. - scripts/task-emission-schema.ts (61 lines): a typed schema module nothing imported; the tasks-section comment now documents the JSONL fields inline. - scripts/host-config-export.ts claimed to be the 'shell bridge for the bash setup script' — setup never calls it (its hand-rolled host lists drifting is a known follow-up). Docstring now states what it IS: a standalone, test-pinned query CLI not yet wired into setup. Its validateValue + CLI_REGEX/PATH_REGEX internals were dead (defined for a guarantee the header claimed but nothing enforced). - KEPT deliberately: scripts/preflight-agent-sdk.ts — a documented manual diagnostic (CONTRIBUTING.md + USING_GBRAIN_WITH_GSTACK.md reference it). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
d38a7b54e3
commit
60134c4320
@@ -1,6 +1,10 @@
|
||||
#!/usr/bin/env bun
|
||||
/**
|
||||
* Export host configs as shell-safe values for consumption by the bash setup script.
|
||||
* Standalone query CLI for host configs (list / get / detect / validate).
|
||||
*
|
||||
* NOT yet wired into ./setup — setup still hand-rolls its host lists (a
|
||||
* known drift source; driving setup from this CLI is queued follow-up work).
|
||||
* Behavior is pinned by test/host-config.test.ts.
|
||||
*
|
||||
* Usage: bun run scripts/host-config-export.ts <command> [args]
|
||||
*
|
||||
@@ -18,19 +22,11 @@ import { validateAllConfigs } from './host-config';
|
||||
import { RESOLVERS } from './resolvers';
|
||||
import { execSync } from 'child_process';
|
||||
|
||||
const CLI_REGEX = /^[a-z][a-z0-9_-]*$/;
|
||||
const PATH_REGEX = /^[a-zA-Z0-9_.\/${}~-]+$/;
|
||||
|
||||
function shellEscape(s: string): string {
|
||||
return "'" + s.replace(/'/g, "'\\''") + "'";
|
||||
}
|
||||
|
||||
function validateValue(val: string, context: string): void {
|
||||
if (!PATH_REGEX.test(val) && !CLI_REGEX.test(val)) {
|
||||
throw new Error(`Unsafe value for ${context}: ${val}`);
|
||||
}
|
||||
}
|
||||
|
||||
const [command, ...args] = process.argv.slice(2);
|
||||
|
||||
switch (command) {
|
||||
|
||||
Reference in New Issue
Block a user