@hwip/cli 0.0.1 → 0.1.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/LICENSE +190 -0
- package/NOTICE +11 -0
- package/README.md +1979 -0
- package/dist/agent-list.d.ts +76 -0
- package/dist/agent-list.js +102 -0
- package/dist/agent-read.d.ts +105 -0
- package/dist/agent-read.js +309 -0
- package/dist/agent-rules-fetch.d.ts +51 -0
- package/dist/agent-rules-fetch.js +275 -0
- package/dist/agent-rules.default.d.ts +30 -0
- package/dist/agent-rules.default.js +292 -0
- package/dist/agent-session.d.ts +23 -0
- package/dist/agent-session.js +44 -0
- package/dist/agent-state.d.ts +84 -0
- package/dist/agent-state.js +188 -0
- package/dist/agent-target.d.ts +60 -0
- package/dist/agent-target.js +81 -0
- package/dist/agents.d.ts +31 -0
- package/dist/agents.js +75 -0
- package/dist/api.d.ts +28 -0
- package/dist/api.js +76 -0
- package/dist/args.d.ts +74 -0
- package/dist/args.js +254 -0
- package/dist/ask-context-attach.d.ts +73 -0
- package/dist/ask-context-attach.js +151 -0
- package/dist/ask-context-screen.d.ts +21 -0
- package/dist/ask-context-screen.js +49 -0
- package/dist/ask-context-switch.d.ts +31 -0
- package/dist/ask-context-switch.js +74 -0
- package/dist/ask-context.d.ts +84 -0
- package/dist/ask-context.js +172 -0
- package/dist/ask-pending.d.ts +47 -0
- package/dist/ask-pending.js +221 -0
- package/dist/ask-seal.d.ts +120 -0
- package/dist/ask-seal.js +179 -0
- package/dist/ask.d.ts +107 -0
- package/dist/ask.js +551 -0
- package/dist/blocked-prompt-seal.d.ts +35 -0
- package/dist/blocked-prompt-seal.js +89 -0
- package/dist/blocked-prompt.d.ts +57 -0
- package/dist/blocked-prompt.js +181 -0
- package/dist/channel.d.ts +67 -0
- package/dist/channel.js +136 -0
- package/dist/check-update.d.ts +28 -0
- package/dist/check-update.js +153 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +813 -0
- package/dist/codex-config.d.ts +24 -0
- package/dist/codex-config.js +169 -0
- package/dist/codex-transcript.d.ts +59 -0
- package/dist/codex-transcript.js +373 -0
- package/dist/command-refusal.d.ts +56 -0
- package/dist/command-refusal.js +127 -0
- package/dist/command-scan.d.ts +46 -0
- package/dist/command-scan.js +154 -0
- package/dist/command-seal.d.ts +57 -0
- package/dist/command-seal.js +88 -0
- package/dist/command-seq.d.ts +30 -0
- package/dist/command-seq.js +150 -0
- package/dist/config.d.ts +156 -0
- package/dist/config.js +392 -0
- package/dist/core-sections.d.ts +18 -0
- package/dist/core-sections.js +28 -0
- package/dist/crypto.d.ts +278 -0
- package/dist/crypto.js +698 -0
- package/dist/desktop-notify.d.ts +33 -0
- package/dist/desktop-notify.js +49 -0
- package/dist/device-directory.d.ts +36 -0
- package/dist/device-directory.js +97 -0
- package/dist/device-presence.d.ts +17 -0
- package/dist/device-presence.js +62 -0
- package/dist/downloads.d.ts +29 -0
- package/dist/downloads.js +106 -0
- package/dist/errors.d.ts +12 -0
- package/dist/errors.js +28 -0
- package/dist/file-crypto.d.ts +94 -0
- package/dist/file-crypto.js +272 -0
- package/dist/file-view-budget.d.ts +15 -0
- package/dist/file-view-budget.js +34 -0
- package/dist/file-view-switch.d.ts +28 -0
- package/dist/file-view-switch.js +122 -0
- package/dist/file-view.d.ts +108 -0
- package/dist/file-view.js +327 -0
- package/dist/gate.d.ts +141 -0
- package/dist/gate.js +336 -0
- package/dist/gemini-transcript.d.ts +32 -0
- package/dist/gemini-transcript.js +189 -0
- package/dist/http-failure.d.ts +98 -0
- package/dist/http-failure.js +349 -0
- package/dist/hwip-core.generated.d.ts +7 -0
- package/dist/hwip-core.generated.js +14 -0
- package/dist/hwip-hook.d.ts +77 -0
- package/dist/hwip-hook.js +340 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +14 -0
- package/dist/input-sequencer.d.ts +65 -0
- package/dist/input-sequencer.js +142 -0
- package/dist/insecure-url.d.ts +16 -0
- package/dist/insecure-url.js +76 -0
- package/dist/installer.d.ts +96 -0
- package/dist/installer.js +850 -0
- package/dist/inventory-offload.d.ts +49 -0
- package/dist/inventory-offload.js +209 -0
- package/dist/inventory-worker.d.ts +2 -0
- package/dist/inventory-worker.js +27 -0
- package/dist/jsonc-doc.d.ts +106 -0
- package/dist/jsonc-doc.js +354 -0
- package/dist/keep-awake.d.ts +32 -0
- package/dist/keep-awake.js +46 -0
- package/dist/key-changes.d.ts +48 -0
- package/dist/key-changes.js +140 -0
- package/dist/lan-auth.d.ts +140 -0
- package/dist/lan-auth.js +217 -0
- package/dist/lan-endpoint.d.ts +41 -0
- package/dist/lan-endpoint.js +115 -0
- package/dist/lan-receiver.d.ts +122 -0
- package/dist/lan-receiver.js +510 -0
- package/dist/lan-sender.d.ts +76 -0
- package/dist/lan-sender.js +184 -0
- package/dist/lan-transfer.d.ts +36 -0
- package/dist/lan-transfer.js +54 -0
- package/dist/listener-device-id.d.ts +20 -0
- package/dist/listener-device-id.js +133 -0
- package/dist/listener-log.d.ts +4 -0
- package/dist/listener-log.js +23 -0
- package/dist/listener-process.d.ts +200 -0
- package/dist/listener-process.js +470 -0
- package/dist/listener-service.d.ts +225 -0
- package/dist/listener-service.js +682 -0
- package/dist/listener-worktree-cleanup.d.ts +27 -0
- package/dist/listener-worktree-cleanup.js +62 -0
- package/dist/listener.d.ts +1325 -0
- package/dist/listener.js +5680 -0
- package/dist/login-address.d.ts +25 -0
- package/dist/login-address.js +97 -0
- package/dist/login-page.d.ts +29 -0
- package/dist/login-page.js +93 -0
- package/dist/login.d.ts +98 -0
- package/dist/login.js +388 -0
- package/dist/mcp-command.d.ts +45 -0
- package/dist/mcp-command.js +50 -0
- package/dist/mcp.d.ts +19 -0
- package/dist/mcp.js +29 -0
- package/dist/node-support.d.ts +19 -0
- package/dist/node-support.js +38 -0
- package/dist/notify-failure.d.ts +57 -0
- package/dist/notify-failure.js +150 -0
- package/dist/opencode-transcript.d.ts +139 -0
- package/dist/opencode-transcript.js +390 -0
- package/dist/optional-features.d.ts +6 -0
- package/dist/optional-features.js +19 -0
- package/dist/pane-fit.d.ts +40 -0
- package/dist/pane-fit.js +119 -0
- package/dist/peer-key.d.ts +33 -0
- package/dist/peer-key.js +34 -0
- package/dist/pi-transcript.d.ts +26 -0
- package/dist/pi-transcript.js +255 -0
- package/dist/presence.d.ts +14 -0
- package/dist/presence.js +124 -0
- package/dist/private-files.d.ts +51 -0
- package/dist/private-files.js +218 -0
- package/dist/project-switch.d.ts +19 -0
- package/dist/project-switch.js +60 -0
- package/dist/redact.d.ts +10 -0
- package/dist/redact.js +21 -0
- package/dist/remote-agents.d.ts +410 -0
- package/dist/remote-agents.js +1218 -0
- package/dist/remote-hook.d.ts +12 -0
- package/dist/remote-hook.js +196 -0
- package/dist/replace-file.d.ts +50 -0
- package/dist/replace-file.js +328 -0
- package/dist/schedule-command.d.ts +35 -0
- package/dist/schedule-command.js +260 -0
- package/dist/schedule-launch.d.ts +15 -0
- package/dist/schedule-launch.js +24 -0
- package/dist/schedule-ready.d.ts +44 -0
- package/dist/schedule-ready.js +71 -0
- package/dist/schedule-remote.d.ts +77 -0
- package/dist/schedule-remote.js +167 -0
- package/dist/schedule-runner.d.ts +89 -0
- package/dist/schedule-runner.js +452 -0
- package/dist/schedule.d.ts +149 -0
- package/dist/schedule.js +428 -0
- package/dist/secret-mask.d.ts +29 -0
- package/dist/secret-mask.js +245 -0
- package/dist/self-register.d.ts +45 -0
- package/dist/self-register.js +67 -0
- package/dist/send.d.ts +56 -0
- package/dist/send.js +104 -0
- package/dist/session-diff.d.ts +161 -0
- package/dist/session-diff.js +445 -0
- package/dist/session-registry.d.ts +143 -0
- package/dist/session-registry.js +216 -0
- package/dist/sessions-report.d.ts +59 -0
- package/dist/sessions-report.js +99 -0
- package/dist/shell-audit.d.ts +34 -0
- package/dist/shell-audit.js +47 -0
- package/dist/subagent-transcripts.d.ts +167 -0
- package/dist/subagent-transcripts.js +437 -0
- package/dist/subscriber-trust.d.ts +128 -0
- package/dist/subscriber-trust.js +397 -0
- package/dist/templates.d.ts +105 -0
- package/dist/templates.js +871 -0
- package/dist/tmux-install.d.ts +44 -0
- package/dist/tmux-install.js +65 -0
- package/dist/tmux-liveness.d.ts +45 -0
- package/dist/tmux-liveness.js +71 -0
- package/dist/tmux-pane.d.ts +55 -0
- package/dist/tmux-pane.js +126 -0
- package/dist/tmux-socket.d.ts +20 -0
- package/dist/tmux-socket.js +292 -0
- package/dist/todo-fold.d.ts +31 -0
- package/dist/todo-fold.js +102 -0
- package/dist/transcript-tail.d.ts +312 -0
- package/dist/transcript-tail.js +718 -0
- package/dist/trust-command.d.ts +49 -0
- package/dist/trust-command.js +200 -0
- package/dist/trust-lock.d.ts +26 -0
- package/dist/trust-lock.js +94 -0
- package/dist/trust-pins.d.ts +37 -0
- package/dist/trust-pins.js +82 -0
- package/dist/turn-recorder-wire.d.ts +70 -0
- package/dist/turn-recorder-wire.js +165 -0
- package/dist/turn-recorder.d.ts +190 -0
- package/dist/turn-recorder.js +695 -0
- package/dist/turn-ring.d.ts +93 -0
- package/dist/turn-ring.js +418 -0
- package/dist/turn-watch.d.ts +177 -0
- package/dist/turn-watch.js +630 -0
- package/dist/types.d.ts +63 -0
- package/dist/types.js +2 -0
- package/dist/uninstall.d.ts +55 -0
- package/dist/uninstall.js +507 -0
- package/dist/usage.d.ts +17 -0
- package/dist/usage.js +421 -0
- package/dist/verify.d.ts +47 -0
- package/dist/verify.js +396 -0
- package/dist/worktree.d.ts +144 -0
- package/dist/worktree.js +310 -0
- package/dist/wrapper.d.ts +254 -0
- package/dist/wrapper.js +704 -0
- package/dist/ws-url.d.ts +109 -0
- package/dist/ws-url.js +202 -0
- package/package.json +78 -10
- package/bin/hwip.js +0 -3
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { HwipConfig } from './config.js';
|
|
2
|
+
import type { Agent } from './agents.js';
|
|
3
|
+
interface InstallArgs {
|
|
4
|
+
key?: string;
|
|
5
|
+
hook?: string;
|
|
6
|
+
'base-url'?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* True when install should auto-open browser login (ADR 0002): interactive
|
|
10
|
+
* context with no existing credential (--key/env/config all absent).
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Interactive install, past the `--key` path: open a browser login only when
|
|
14
|
+
* there's nothing saved yet, or the user explicitly asked to re-authenticate
|
|
15
|
+
* with `--relogin`. A plain re-run keeps the saved login untouched.
|
|
16
|
+
*/
|
|
17
|
+
export declare const shouldReauth: (currentKey: string | undefined, relogin: boolean) => boolean;
|
|
18
|
+
/**
|
|
19
|
+
* A merge step that left the user's file alone: why, then the JSON to add by
|
|
20
|
+
* hand. Exported for tests — it is the user's only way forward.
|
|
21
|
+
*/
|
|
22
|
+
export declare const mergeFailureLines: (label: string, filePath: string, err: unknown, snippet: Record<string, unknown>) => string[];
|
|
23
|
+
/** Exported for tests, with `failedStepCount`. */
|
|
24
|
+
export declare const failMerge: (label: string, filePath: string, err: unknown, snippet: Record<string, unknown>) => void;
|
|
25
|
+
export declare const failedStepCount: () => number;
|
|
26
|
+
/** The detection list. An agent that is not installed is information, not a
|
|
27
|
+
* failed step — it never counts toward the closing line. Exported for tests. */
|
|
28
|
+
export declare const reportDetectedAgents: (agents: Agent[]) => void;
|
|
29
|
+
/** The install's last line. Exported for tests. */
|
|
30
|
+
export declare const closingLine: (failed: number) => string;
|
|
31
|
+
/** Exported for tests (installGemini shells out to the real `gemini` binary,
|
|
32
|
+
* so the merge semantics can't be covered through it deterministically). */
|
|
33
|
+
export declare const mergeJsonFile: (filePath: string, patch: Record<string, unknown>) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Write a Hwip rule into a SHARED agent rule file (Windsurf global_rules.md,
|
|
36
|
+
* Gemini GEMINI.md, Codex AGENTS.md) without clobbering the user's own
|
|
37
|
+
* content. The rule lands inside <!-- HWIP:START/END --> markers; a re-run
|
|
38
|
+
* replaces just that block.
|
|
39
|
+
*/
|
|
40
|
+
/** Exported for tests. */
|
|
41
|
+
export declare const writeManagedRule: (filePath: string, rule: string) => void;
|
|
42
|
+
/**
|
|
43
|
+
* Add a `read:` entry to ~/.aider.conf.yml so Aider always loads the Hwip
|
|
44
|
+
* conventions file. Idempotent — skips if the path is already referenced.
|
|
45
|
+
* Aider's config is YAML; we do a minimal text-level append to avoid
|
|
46
|
+
* pulling in a YAML dependency (the SDK is zero-dep by design).
|
|
47
|
+
*/
|
|
48
|
+
/** Exported for tests. */
|
|
49
|
+
export declare const addAiderReadDirective: (confPath: string, conventionsPath: string) => void;
|
|
50
|
+
/** Add the hwip entry under `key` in an MCP registry JSON file, preserving
|
|
51
|
+
* everything else in it. Exported for tests (merge semantics). */
|
|
52
|
+
export declare const injectMcpEntry: (filePath: string, key: string, entry: Record<string, unknown>) => void;
|
|
53
|
+
/** `[mcp_servers.hwip]` in codex's own TOML config — the one registry that is
|
|
54
|
+
* not JSON. Exported for tests, like `injectMcpEntry`. */
|
|
55
|
+
export declare const injectCodexMcpEntry: (filePath: string) => void;
|
|
56
|
+
/** The first non-empty line a failed child process wrote to stderr, cut to one terminal line; undefined when it wrote none. */
|
|
57
|
+
export declare const firstStderrLine: (err: unknown) => string | undefined;
|
|
58
|
+
/** Exported for tests — each runs against the HOME the module was loaded with. */
|
|
59
|
+
export declare const AGENT_INSTALLERS: Record<string, () => void>;
|
|
60
|
+
/**
|
|
61
|
+
* Resolve agents from a non-interactive `--only cursor,gemini` flag.
|
|
62
|
+
* Matches on agent id (`cc` is accepted for `claude`); ids that are not
|
|
63
|
+
* detected are dropped here, and `unknownOnlyIds` is what flags a typo.
|
|
64
|
+
* Exported for unit testing.
|
|
65
|
+
*/
|
|
66
|
+
export declare const filterAgentsByIds: (detected: Agent[], only: string) => Agent[];
|
|
67
|
+
/** The `--only` ids that name no agent hwip knows (detected or not): a typo, not "nothing to install". Exported for tests. */
|
|
68
|
+
export declare const unknownOnlyIds: (all: Agent[], only: string) => string[];
|
|
69
|
+
interface ResolvedCredentials {
|
|
70
|
+
apiKey?: string;
|
|
71
|
+
hookId?: string;
|
|
72
|
+
baseUrl?: string;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Resolve API key + hook for install. Priority: --key/env/config (non-interactive)
|
|
76
|
+
* → a saved login is reused untouched on re-run → otherwise a brand-new
|
|
77
|
+
* interactive install opens browser login (ADR 0002), falling back to manual
|
|
78
|
+
* paste when headless. wsUrl/deviceId from a login are persisted by
|
|
79
|
+
* runLoginFlow and re-read at config-save time.
|
|
80
|
+
*/
|
|
81
|
+
/** Exported for tests. */
|
|
82
|
+
export declare const collectCredentials: (args: Record<string, string | boolean>, installArgs: InstallArgs, nonInteractive: boolean, existing: HwipConfig) => Promise<ResolvedCredentials>;
|
|
83
|
+
/**
|
|
84
|
+
* Whether this install should register the service that starts the listener
|
|
85
|
+
* at login (a LaunchAgent on macOS, a systemd user unit on Linux).
|
|
86
|
+
*
|
|
87
|
+
* Interactive installs offer it and default to yes: an empty phone picker
|
|
88
|
+
* after every reboot is precisely the kind of thing a default should fix.
|
|
89
|
+
* Scripted installs (`--key`, CI, provisioning) get it only when asked —
|
|
90
|
+
* planting a background job on a machine whose operator only wanted an API
|
|
91
|
+
* key written is a surprise, not a convenience.
|
|
92
|
+
*/
|
|
93
|
+
export declare const serviceInstallChoice: (args: Record<string, string | boolean>, nonInteractive: boolean) => "yes" | "no" | "ask";
|
|
94
|
+
export declare const handleInstall: (args: Record<string, string | boolean>) => Promise<number>;
|
|
95
|
+
export {};
|
|
96
|
+
//# sourceMappingURL=installer.d.ts.map
|