@manishbht/helpcode 0.2.3 → 0.3.5
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/dist/bin/helpcode.js +0 -0
- package/dist/src/commands/ask.js +15 -1
- package/dist/src/commands/ask.js.map +1 -1
- package/dist/src/commands/cockpit.d.ts +13 -0
- package/dist/src/commands/cockpit.js +33 -0
- package/dist/src/commands/cockpit.js.map +1 -0
- package/dist/src/commands/plan.d.ts +14 -0
- package/dist/src/commands/plan.js +113 -0
- package/dist/src/commands/plan.js.map +1 -0
- package/dist/src/commands/run.js +51 -4
- package/dist/src/commands/run.js.map +1 -1
- package/dist/src/core/cockpit.d.ts +27 -0
- package/dist/src/core/cockpit.js +109 -0
- package/dist/src/core/cockpit.js.map +1 -0
- package/dist/src/core/cockpitHtml.d.ts +52 -0
- package/dist/src/core/cockpitHtml.js +395 -0
- package/dist/src/core/cockpitHtml.js.map +1 -0
- package/dist/src/core/consent.d.ts +20 -0
- package/dist/src/core/consent.js +34 -0
- package/dist/src/core/consent.js.map +1 -0
- package/dist/src/core/decompose.d.ts +45 -0
- package/dist/src/core/decompose.js +86 -0
- package/dist/src/core/decompose.js.map +1 -0
- package/dist/src/core/gemini.d.ts +41 -0
- package/dist/src/core/gemini.js +91 -0
- package/dist/src/core/gemini.js.map +1 -0
- package/dist/src/core/keys.d.ts +29 -0
- package/dist/src/core/keys.js +92 -0
- package/dist/src/core/keys.js.map +1 -0
- package/dist/src/core/llmSelector.d.ts +6 -0
- package/dist/src/core/llmSelector.js +22 -7
- package/dist/src/core/llmSelector.js.map +1 -1
- package/dist/src/core/providers.d.ts +60 -0
- package/dist/src/core/providers.js +117 -0
- package/dist/src/core/providers.js.map +1 -0
- package/dist/src/core/remoteRouter.d.ts +27 -0
- package/dist/src/core/remoteRouter.js +71 -0
- package/dist/src/core/remoteRouter.js.map +1 -0
- package/dist/src/core/selector.d.ts +9 -4
- package/dist/src/core/selector.js +85 -29
- package/dist/src/core/selector.js.map +1 -1
- package/dist/src/core/souschef.d.ts +63 -0
- package/dist/src/core/souschef.js +55 -0
- package/dist/src/core/souschef.js.map +1 -0
- package/dist/src/core/state.d.ts +13 -1
- package/dist/src/core/state.js +47 -5
- package/dist/src/core/state.js.map +1 -1
- package/dist/src/core/triage.d.ts +14 -1
- package/dist/src/core/triage.js +23 -5
- package/dist/src/core/triage.js.map +1 -1
- package/dist/src/index.d.ts +8 -7
- package/dist/src/index.js +21 -8
- package/dist/src/index.js.map +1 -1
- package/dist/src/types.d.ts +70 -1
- package/package.json +1 -1
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,OAAO,GAAG,OAAO,CAAC;AAExB,MAAM,IAAI,GAAG,aAAa,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BhC,CAAC;AAEF,MAAM,CAAC,KAAK,U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;IAClD,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,IAAI,GAAG,KAAK,CAAC,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACtD,MAAM,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACpC,CAAC"}
|
package/dist/src/types.d.ts
CHANGED
|
@@ -19,6 +19,30 @@ export interface ProjectConfig {
|
|
|
19
19
|
createdAt: string;
|
|
20
20
|
/** Optional local-LLM (Ollama) settings for smarter file selection (v0.2). */
|
|
21
21
|
ollama?: OllamaSettings;
|
|
22
|
+
/** Optional remote free-tier sous-chef settings (v0.3.2). */
|
|
23
|
+
remote?: RemoteSettings;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Remote free-tier sous-chef configuration (v0.3.2). Opt-in by presence of an
|
|
27
|
+
* API key (env var or .helpcode/keys.json) — this block only carries the
|
|
28
|
+
* privacy preference, never the key itself (keys must never touch project.json).
|
|
29
|
+
*/
|
|
30
|
+
export interface RemoteSettings {
|
|
31
|
+
/**
|
|
32
|
+
* Allow code-bearing tasks (file selection, output triage) to be sent to a
|
|
33
|
+
* remote FREE-TIER provider, whose terms may use inputs to train their models.
|
|
34
|
+
* Default false: by default only decomposition (task description, no code)
|
|
35
|
+
* goes remote. Flip to true ONLY if you accept your source code leaving the
|
|
36
|
+
* machine to a free tier. A one-time notice is shown the first time it takes
|
|
37
|
+
* effect.
|
|
38
|
+
*/
|
|
39
|
+
allowRemoteCode: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Preferred remote provider id ("gemini" | "kimi" | "grok" | "openai"). If
|
|
42
|
+
* set and that provider has a key, it's used; otherwise helpcode falls back
|
|
43
|
+
* to priority order among providers that have keys.
|
|
44
|
+
*/
|
|
45
|
+
provider?: string;
|
|
22
46
|
}
|
|
23
47
|
/** Local-LLM configuration. Opt-in; absent or disabled = heuristic only. */
|
|
24
48
|
export interface OllamaSettings {
|
|
@@ -36,10 +60,23 @@ export type TaskStatus = 'idle' | 'awaiting_paste' | 'applying' | 'testing' | 'r
|
|
|
36
60
|
/** The agent's memory across CLI invocations. Stored at .helpcode/state.json. */
|
|
37
61
|
export interface AgentState {
|
|
38
62
|
/** Schema version so we can migrate later without breaking installs. */
|
|
39
|
-
version:
|
|
63
|
+
version: 2;
|
|
40
64
|
currentTask: CurrentTask | null;
|
|
41
65
|
/** History of resolved tasks (summary only, not full content). */
|
|
42
66
|
history: TaskHistoryEntry[];
|
|
67
|
+
/**
|
|
68
|
+
* Rolling log of sous-chef work this session (v0.3). The cockpit reads this;
|
|
69
|
+
* the tasks (and future engine) append to it. Capped to a recent window so
|
|
70
|
+
* the state file stays small.
|
|
71
|
+
*/
|
|
72
|
+
sousChefLog: SousChefEvent[];
|
|
73
|
+
/** One-time UI flags (e.g. consent notices already shown). Optional. */
|
|
74
|
+
flags?: StateFlags;
|
|
75
|
+
}
|
|
76
|
+
/** One-time flags persisted so we don't repeat notices. All optional. */
|
|
77
|
+
export interface StateFlags {
|
|
78
|
+
/** True once the "sending code to a free tier" notice has been shown. */
|
|
79
|
+
remoteCodeNoticeShown?: boolean;
|
|
43
80
|
}
|
|
44
81
|
export interface CurrentTask {
|
|
45
82
|
id: string;
|
|
@@ -68,3 +105,35 @@ export interface TaskHistoryEntry {
|
|
|
68
105
|
resolvedAt: string;
|
|
69
106
|
iterations: number;
|
|
70
107
|
}
|
|
108
|
+
/** Who did a unit of prep work. */
|
|
109
|
+
export type WorkerKind = 'local' | 'remote' | 'deterministic' | 'principal';
|
|
110
|
+
/** A prep task helpcode knows how to route to a worker. */
|
|
111
|
+
export type SousChefTask = 'file_selection' | 'output_triage' | 'decomposition' | 'other';
|
|
112
|
+
/** One recorded unit of work, written by whoever performed it. */
|
|
113
|
+
export interface SousChefEvent {
|
|
114
|
+
/** ISO timestamp. */
|
|
115
|
+
at: string;
|
|
116
|
+
/** Which prep task. */
|
|
117
|
+
task: SousChefTask;
|
|
118
|
+
/** Who did it. */
|
|
119
|
+
worker: WorkerKind;
|
|
120
|
+
/** Model tag if a model did it (e.g. "qwen2.5-coder:7b"), else null. */
|
|
121
|
+
model: string | null;
|
|
122
|
+
/** One-line human-readable summary of what happened. */
|
|
123
|
+
summary: string;
|
|
124
|
+
/** Did this work succeed, or fall back to a cheaper worker? */
|
|
125
|
+
outcome: 'ok' | 'fallback' | 'escalated';
|
|
126
|
+
/** Rough estimate of principal tokens this prep saved, if known. */
|
|
127
|
+
estTokensSaved: number | null;
|
|
128
|
+
}
|
|
129
|
+
/** Per-worker rolling status for the cockpit panels. */
|
|
130
|
+
export interface WorkerStatus {
|
|
131
|
+
kind: WorkerKind;
|
|
132
|
+
model: string | null;
|
|
133
|
+
/** Free-tier quota used 0..1, if the worker has a quota (remote). null = N/A. */
|
|
134
|
+
quotaUsed: number | null;
|
|
135
|
+
/** Count of events this session. */
|
|
136
|
+
eventsThisSession: number;
|
|
137
|
+
/** Last summary line, for the panel log. */
|
|
138
|
+
lastSummary: string | null;
|
|
139
|
+
}
|
package/package.json
CHANGED