@harperfast/agent 0.14.0 → 0.14.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.
Files changed (2) hide show
  1. package/dist/agent.js +37 -30
  2. package/package.json +2 -1
package/dist/agent.js CHANGED
@@ -243,30 +243,36 @@ function resolveSessionPathConsideringHarper(raw, cwd, originalCwd) {
243
243
  }
244
244
 
245
245
  // lifecycle/trackedState.ts
246
- var trackedState = {
247
- originalCwd: process.cwd(),
248
- cwd: process.cwd(),
249
- model: "",
250
- compactionModel: "",
251
- originalSessionPath: null,
252
- get sessionPath() {
253
- return resolveSessionPathConsideringHarper(trackedState.originalSessionPath, this.cwd, this.originalCwd);
254
- },
255
- set sessionPath(value) {
256
- trackedState.originalSessionPath = value;
257
- },
258
- useFlexTier: false,
259
- currentTurn: 0,
260
- maxTurns: 30,
261
- maxCost: null,
262
- autoApproveCodeInterpreter: false,
263
- autoApprovePatches: false,
264
- autoApproveShell: false,
265
- monitorRateLimits: true,
266
- rateLimitThreshold: 80,
267
- autonomous: false,
268
- prompt: null
269
- };
246
+ var trackedState = bootstrapTrackedState();
247
+ function resetTrackedState() {
248
+ trackedState = bootstrapTrackedState();
249
+ }
250
+ function bootstrapTrackedState() {
251
+ return {
252
+ originalCwd: process.cwd(),
253
+ cwd: process.cwd(),
254
+ model: "",
255
+ compactionModel: "",
256
+ originalSessionPath: null,
257
+ get sessionPath() {
258
+ return resolveSessionPathConsideringHarper(trackedState.originalSessionPath, this.cwd, this.originalCwd);
259
+ },
260
+ set sessionPath(value) {
261
+ trackedState.originalSessionPath = value;
262
+ },
263
+ useFlexTier: false,
264
+ currentTurn: 0,
265
+ maxTurns: 30,
266
+ maxCost: null,
267
+ autoApproveCodeInterpreter: false,
268
+ autoApprovePatches: false,
269
+ autoApproveShell: false,
270
+ monitorRateLimits: true,
271
+ rateLimitThreshold: 80,
272
+ autonomous: false,
273
+ prompt: null
274
+ };
275
+ }
270
276
 
271
277
  // lifecycle/defaultInstructions.ts
272
278
  function defaultInstructions() {
@@ -5980,7 +5986,7 @@ var compactorModelsByProvider = {
5980
5986
  OpenAI: modelsByProvider.OpenAI.slice().reverse(),
5981
5987
  Anthropic: modelsByProvider.Anthropic.slice().reverse(),
5982
5988
  Google: modelsByProvider.Google.slice().reverse(),
5983
- Ollama: modelsByProvider.Ollama.slice()
5989
+ Ollama: modelsByProvider.Ollama.slice().reverse()
5984
5990
  };
5985
5991
 
5986
5992
  // ink/configurationWizard/ModelSelectionStep.tsx
@@ -6213,8 +6219,10 @@ function ConfigurationWizard({ onComplete }) {
6213
6219
 
6214
6220
  // ink/main.tsx
6215
6221
  import { jsx as jsx26, jsxs as jsxs18 } from "react/jsx-runtime";
6216
- function bootstrapConfig(onComplete) {
6217
- render(/* @__PURE__ */ jsx26(MainConfig, { onComplete }));
6222
+ function bootstrapConfig() {
6223
+ return new Promise((resolve2) => {
6224
+ render(/* @__PURE__ */ jsx26(MainConfig, { onComplete: resolve2 }));
6225
+ });
6218
6226
  }
6219
6227
  function MainConfig({ onComplete }) {
6220
6228
  const { exit } = useApp();
@@ -6663,9 +6671,8 @@ function ensureApiKey() {
6663
6671
  await checkForUpdate();
6664
6672
  parseArgs();
6665
6673
  if (!ensureApiKey()) {
6666
- await new Promise((resolve2) => {
6667
- bootstrapConfig(resolve2);
6668
- });
6674
+ resetTrackedState();
6675
+ await bootstrapConfig();
6669
6676
  emitToListeners("ExitUI", void 0);
6670
6677
  parseArgs();
6671
6678
  if (!ensureApiKey()) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@harperfast/agent",
3
3
  "description": "AI to help you with Harper app management",
4
- "version": "0.14.0",
4
+ "version": "0.14.1",
5
5
  "main": "dist/agent.js",
6
6
  "repository": "github:HarperFast/harper-agent",
7
7
  "bugs": {
@@ -83,6 +83,7 @@
83
83
  "harperdb": "^4.7.19",
84
84
  "hono": "^4.11.9",
85
85
  "husky": "^9.1.7",
86
+ "ink-testing-library": "^4.0.0",
86
87
  "oxlint": "^1.43.0",
87
88
  "semantic-release": "^25.0.3",
88
89
  "tsup": "^8.5.1",