@vectorize-io/hindsight-coding-agents 0.0.4 → 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/dist/kilo.js CHANGED
@@ -110,10 +110,24 @@ function startBackgroundSeed(repoDir, opts = {}) {
110
110
 
111
111
  // src/core/config.ts
112
112
  var CONFIG_PATH = process.env.HINDSIGHT_CONFIG || join3(homedir2(), ".hindsight", "coding-agent.json");
113
+ var DEFAULT_DAEMON_PORT = 9077;
114
+ var DEFAULT_DAEMON_IDLE_TIMEOUT = 300;
115
+ var DEFAULT_DAEMON_PROFILE = "coding-agent";
113
116
  function resolveConfig(raw = {}) {
117
+ const serverMode = ["cloud", "self-hosted", "daemon"].includes(raw.serverMode) ? raw.serverMode : "cloud";
118
+ const apiPort = raw.apiPort || DEFAULT_DAEMON_PORT;
114
119
  return {
115
- apiUrl: raw.apiUrl ?? "https://api.hindsight.vectorize.io",
120
+ serverMode,
121
+ // Daemon mode resolves the URL HERE rather than at each call site: every entry point already
122
+ // builds its client from cfg.apiUrl, so collapsing the mode into that one field means the
123
+ // daemon needs no plumbing through eight separate constructors.
124
+ apiUrl: serverMode === "daemon" ? `http://127.0.0.1:${apiPort}` : raw.apiUrl ?? "https://api.hindsight.vectorize.io",
116
125
  apiToken: raw.apiToken || void 0,
126
+ apiPort,
127
+ daemonIdleTimeout: raw.daemonIdleTimeout ?? DEFAULT_DAEMON_IDLE_TIMEOUT,
128
+ daemonProfile: raw.daemonProfile || DEFAULT_DAEMON_PROFILE,
129
+ embedVersion: raw.embedVersion || void 0,
130
+ embedPackagePath: raw.embedPackagePath || void 0,
117
131
  bankId: raw.bankId,
118
132
  dynamicBankId: raw.dynamicBankId,
119
133
  bankIdTemplate: raw.bankIdTemplate,
@@ -159,8 +173,16 @@ function applyLayer(raw, layer, harness) {
159
173
  return out;
160
174
  }
161
175
  var ENV_KEYS = {
176
+ serverMode: "HINDSIGHT_SERVER_MODE",
162
177
  apiUrl: "HINDSIGHT_API_URL",
163
178
  apiToken: "HINDSIGHT_API_TOKEN",
179
+ // These four keep the names the old per-agent Claude Code plugin used, so a user migrating from
180
+ // it can carry their existing environment over unchanged.
181
+ apiPort: "HINDSIGHT_API_PORT",
182
+ daemonIdleTimeout: "HINDSIGHT_DAEMON_IDLE_TIMEOUT",
183
+ embedVersion: "HINDSIGHT_EMBED_VERSION",
184
+ embedPackagePath: "HINDSIGHT_EMBED_PACKAGE_PATH",
185
+ daemonProfile: "HINDSIGHT_DAEMON_PROFILE",
164
186
  bankId: "HINDSIGHT_BANK_ID",
165
187
  dynamicBankId: "HINDSIGHT_DYNAMIC_BANK_ID",
166
188
  bankIdTemplate: "HINDSIGHT_BANK_ID_TEMPLATE",
@@ -191,6 +213,8 @@ var ENV_BOOLEANS = /* @__PURE__ */ new Set([
191
213
  "codebaseSurvey"
192
214
  ]);
193
215
  var ENV_NUMBERS = /* @__PURE__ */ new Set([
216
+ "apiPort",
217
+ "daemonIdleTimeout",
194
218
  "retainEveryTurns",
195
219
  "reflectTimeoutMs",
196
220
  "pageRefreshEveryTurns",
@@ -15808,6 +15832,11 @@ import { homedir as homedir5 } from "os";
15808
15832
  import { dirname as dirname5, join as join7 } from "path";
15809
15833
  import { fileURLToPath as fileURLToPath3 } from "url";
15810
15834
 
15835
+ // src/core/daemon.ts
15836
+ import { execFileSync as execFileSync4, spawn as realSpawn3 } from "child_process";
15837
+ import { dirname as dirname6, join as join8 } from "path";
15838
+ import { fileURLToPath as fileURLToPath4 } from "url";
15839
+
15811
15840
  // src/core/brand.ts
15812
15841
  function brandWord() {
15813
15842
  const start = [0, 116, 217];
@@ -15825,9 +15854,9 @@ function brandWord() {
15825
15854
  // src/core/session-cache.ts
15826
15855
  import { mkdirSync as mkdirSync2, readFileSync as readFileSync3, writeFileSync } from "fs";
15827
15856
  import { tmpdir as tmpdir2 } from "os";
15828
- import { dirname as dirname6, join as join8 } from "path";
15857
+ import { dirname as dirname7, join as join9 } from "path";
15829
15858
  function sessionCacheFile(harness, sessionId) {
15830
- return join8(tmpdir2(), `hindsight-${harness}`, `${sessionId}.json`);
15859
+ return join9(tmpdir2(), `hindsight-${harness}`, `${sessionId}.json`);
15831
15860
  }
15832
15861
  function readSessionCache(cacheFile) {
15833
15862
  try {
@@ -15838,7 +15867,7 @@ function readSessionCache(cacheFile) {
15838
15867
  }
15839
15868
  function writeSessionCache(cacheFile, cache) {
15840
15869
  try {
15841
- mkdirSync2(dirname6(cacheFile), { recursive: true });
15870
+ mkdirSync2(dirname7(cacheFile), { recursive: true });
15842
15871
  writeFileSync(cacheFile, JSON.stringify(cache));
15843
15872
  } catch {
15844
15873
  }
@@ -15862,9 +15891,9 @@ async function gitSyncNote(args) {
15862
15891
  const deepened = [...gitIds].filter((id) => id.startsWith("git:")).length;
15863
15892
  let target = DEEPEN_DIFF_TARGET;
15864
15893
  try {
15865
- const { execFileSync: execFileSync4 } = await import("child_process");
15894
+ const { execFileSync: execFileSync5 } = await import("child_process");
15866
15895
  const n = Number(
15867
- execFileSync4("git", ["-C", cwd, "rev-list", "--count", "HEAD"], { encoding: "utf8" }).trim()
15896
+ execFileSync5("git", ["-C", cwd, "rev-list", "--count", "HEAD"], { encoding: "utf8" }).trim()
15868
15897
  );
15869
15898
  if (n > 0) target = Math.min(DEEPEN_DIFF_TARGET, n);
15870
15899
  } catch {
@@ -30970,10 +30970,24 @@ var DEFAULT_SEED_LIMIT = 300;
30970
30970
 
30971
30971
  // src/core/config.ts
30972
30972
  var CONFIG_PATH = process.env.HINDSIGHT_CONFIG || join2(homedir(), ".hindsight", "coding-agent.json");
30973
+ var DEFAULT_DAEMON_PORT = 9077;
30974
+ var DEFAULT_DAEMON_IDLE_TIMEOUT = 300;
30975
+ var DEFAULT_DAEMON_PROFILE = "coding-agent";
30973
30976
  function resolveConfig(raw = {}) {
30977
+ const serverMode = ["cloud", "self-hosted", "daemon"].includes(raw.serverMode) ? raw.serverMode : "cloud";
30978
+ const apiPort = raw.apiPort || DEFAULT_DAEMON_PORT;
30974
30979
  return {
30975
- apiUrl: raw.apiUrl ?? "https://api.hindsight.vectorize.io",
30980
+ serverMode,
30981
+ // Daemon mode resolves the URL HERE rather than at each call site: every entry point already
30982
+ // builds its client from cfg.apiUrl, so collapsing the mode into that one field means the
30983
+ // daemon needs no plumbing through eight separate constructors.
30984
+ apiUrl: serverMode === "daemon" ? `http://127.0.0.1:${apiPort}` : raw.apiUrl ?? "https://api.hindsight.vectorize.io",
30976
30985
  apiToken: raw.apiToken || void 0,
30986
+ apiPort,
30987
+ daemonIdleTimeout: raw.daemonIdleTimeout ?? DEFAULT_DAEMON_IDLE_TIMEOUT,
30988
+ daemonProfile: raw.daemonProfile || DEFAULT_DAEMON_PROFILE,
30989
+ embedVersion: raw.embedVersion || void 0,
30990
+ embedPackagePath: raw.embedPackagePath || void 0,
30977
30991
  bankId: raw.bankId,
30978
30992
  dynamicBankId: raw.dynamicBankId,
30979
30993
  bankIdTemplate: raw.bankIdTemplate,
@@ -31019,8 +31033,16 @@ function applyLayer(raw, layer, harness) {
31019
31033
  return out;
31020
31034
  }
31021
31035
  var ENV_KEYS = {
31036
+ serverMode: "HINDSIGHT_SERVER_MODE",
31022
31037
  apiUrl: "HINDSIGHT_API_URL",
31023
31038
  apiToken: "HINDSIGHT_API_TOKEN",
31039
+ // These four keep the names the old per-agent Claude Code plugin used, so a user migrating from
31040
+ // it can carry their existing environment over unchanged.
31041
+ apiPort: "HINDSIGHT_API_PORT",
31042
+ daemonIdleTimeout: "HINDSIGHT_DAEMON_IDLE_TIMEOUT",
31043
+ embedVersion: "HINDSIGHT_EMBED_VERSION",
31044
+ embedPackagePath: "HINDSIGHT_EMBED_PACKAGE_PATH",
31045
+ daemonProfile: "HINDSIGHT_DAEMON_PROFILE",
31024
31046
  bankId: "HINDSIGHT_BANK_ID",
31025
31047
  dynamicBankId: "HINDSIGHT_DYNAMIC_BANK_ID",
31026
31048
  bankIdTemplate: "HINDSIGHT_BANK_ID_TEMPLATE",
@@ -31051,6 +31073,8 @@ var ENV_BOOLEANS = /* @__PURE__ */ new Set([
31051
31073
  "codebaseSurvey"
31052
31074
  ]);
31053
31075
  var ENV_NUMBERS = /* @__PURE__ */ new Set([
31076
+ "apiPort",
31077
+ "daemonIdleTimeout",
31054
31078
  "retainEveryTurns",
31055
31079
  "reflectTimeoutMs",
31056
31080
  "pageRefreshEveryTurns",
package/dist/status.js CHANGED
@@ -80,10 +80,24 @@ var DEFAULT_SEED_LIMIT = 300;
80
80
 
81
81
  // src/core/config.ts
82
82
  var CONFIG_PATH = process.env.HINDSIGHT_CONFIG || join3(homedir2(), ".hindsight", "coding-agent.json");
83
+ var DEFAULT_DAEMON_PORT = 9077;
84
+ var DEFAULT_DAEMON_IDLE_TIMEOUT = 300;
85
+ var DEFAULT_DAEMON_PROFILE = "coding-agent";
83
86
  function resolveConfig(raw = {}) {
87
+ const serverMode = ["cloud", "self-hosted", "daemon"].includes(raw.serverMode) ? raw.serverMode : "cloud";
88
+ const apiPort = raw.apiPort || DEFAULT_DAEMON_PORT;
84
89
  return {
85
- apiUrl: raw.apiUrl ?? "https://api.hindsight.vectorize.io",
90
+ serverMode,
91
+ // Daemon mode resolves the URL HERE rather than at each call site: every entry point already
92
+ // builds its client from cfg.apiUrl, so collapsing the mode into that one field means the
93
+ // daemon needs no plumbing through eight separate constructors.
94
+ apiUrl: serverMode === "daemon" ? `http://127.0.0.1:${apiPort}` : raw.apiUrl ?? "https://api.hindsight.vectorize.io",
86
95
  apiToken: raw.apiToken || void 0,
96
+ apiPort,
97
+ daemonIdleTimeout: raw.daemonIdleTimeout ?? DEFAULT_DAEMON_IDLE_TIMEOUT,
98
+ daemonProfile: raw.daemonProfile || DEFAULT_DAEMON_PROFILE,
99
+ embedVersion: raw.embedVersion || void 0,
100
+ embedPackagePath: raw.embedPackagePath || void 0,
87
101
  bankId: raw.bankId,
88
102
  dynamicBankId: raw.dynamicBankId,
89
103
  bankIdTemplate: raw.bankIdTemplate,
@@ -129,8 +143,16 @@ function applyLayer(raw, layer, harness) {
129
143
  return out;
130
144
  }
131
145
  var ENV_KEYS = {
146
+ serverMode: "HINDSIGHT_SERVER_MODE",
132
147
  apiUrl: "HINDSIGHT_API_URL",
133
148
  apiToken: "HINDSIGHT_API_TOKEN",
149
+ // These four keep the names the old per-agent Claude Code plugin used, so a user migrating from
150
+ // it can carry their existing environment over unchanged.
151
+ apiPort: "HINDSIGHT_API_PORT",
152
+ daemonIdleTimeout: "HINDSIGHT_DAEMON_IDLE_TIMEOUT",
153
+ embedVersion: "HINDSIGHT_EMBED_VERSION",
154
+ embedPackagePath: "HINDSIGHT_EMBED_PACKAGE_PATH",
155
+ daemonProfile: "HINDSIGHT_DAEMON_PROFILE",
134
156
  bankId: "HINDSIGHT_BANK_ID",
135
157
  dynamicBankId: "HINDSIGHT_DYNAMIC_BANK_ID",
136
158
  bankIdTemplate: "HINDSIGHT_BANK_ID_TEMPLATE",
@@ -161,6 +183,8 @@ var ENV_BOOLEANS = /* @__PURE__ */ new Set([
161
183
  "codebaseSurvey"
162
184
  ]);
163
185
  var ENV_NUMBERS = /* @__PURE__ */ new Set([
186
+ "apiPort",
187
+ "daemonIdleTimeout",
164
188
  "retainEveryTurns",
165
189
  "reflectTimeoutMs",
166
190
  "pageRefreshEveryTurns",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectorize-io/hindsight-coding-agents",
3
- "version": "0.0.4",
3
+ "version": "0.1.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/vectorize-io/hindsight.git",
@@ -52,6 +52,7 @@
52
52
  },
53
53
  "dependencies": {
54
54
  "@modelcontextprotocol/sdk": "^1.29.0",
55
+ "@vectorize-io/hindsight-all": "^0.8.6",
55
56
  "zod": "^4.4.3"
56
57
  },
57
58
  "devDependencies": {