@pensar/apex 0.0.107 → 0.0.108-canary.40bd0631

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/build/auth.js CHANGED
@@ -8,7 +8,7 @@ import fs from "fs/promises";
8
8
  // package.json
9
9
  var package_default = {
10
10
  name: "@pensar/apex",
11
- version: "0.0.107",
11
+ version: "0.0.108-canary.40bd0631",
12
12
  description: "AI-powered penetration testing CLI tool with terminal UI",
13
13
  module: "src/tui/index.tsx",
14
14
  main: "build/index.js",
package/build/index.js CHANGED
@@ -31977,7 +31977,7 @@ var package_default2;
31977
31977
  var init_package = __esm(() => {
31978
31978
  package_default2 = {
31979
31979
  name: "@pensar/apex",
31980
- version: "0.0.107",
31980
+ version: "0.0.108-canary.40bd0631",
31981
31981
  description: "AI-powered penetration testing CLI tool with terminal UI",
31982
31982
  module: "src/tui/index.tsx",
31983
31983
  main: "build/index.js",
@@ -194961,6 +194961,21 @@ var init_offensiveSecurityAgent = __esm(() => {
194961
194961
  }
194962
194962
  ]
194963
194963
  };
194964
+ const PERSIST_INTERVAL_MS = 15000;
194965
+ let persistTimer = null;
194966
+ let latestMessages = null;
194967
+ const schedulePersist = () => {
194968
+ if (persistTimer)
194969
+ return;
194970
+ persistTimer = setTimeout(() => {
194971
+ persistTimer = null;
194972
+ if (latestMessages) {
194973
+ const toWrite = latestMessages;
194974
+ latestMessages = null;
194975
+ writeFile3(messagesPath, JSON.stringify(toWrite)).catch(() => {});
194976
+ }
194977
+ }, PERSIST_INTERVAL_MS);
194978
+ };
194964
194979
  this.streamResult = streamResponse({
194965
194980
  prompt: input.prompt,
194966
194981
  system: (input.system ?? BASE_SYSTEM_PROMPT) + buildSessionWorkspaceSection(input.session),
@@ -194971,17 +194986,28 @@ var init_offensiveSecurityAgent = __esm(() => {
194971
194986
  stopWhen,
194972
194987
  toolChoice: "auto",
194973
194988
  onStepFinish: (event) => {
194974
- const allMessages = [
194989
+ latestMessages = [
194975
194990
  ...initialMessagesRef.current,
194976
194991
  ...event.response.messages
194977
194992
  ];
194978
- writeFile3(messagesPath, JSON.stringify(allMessages, null, 2)).catch(() => {});
194993
+ schedulePersist();
194979
194994
  input.onStepFinish?.(event);
194980
194995
  },
194981
194996
  onSummarized: () => {
194982
194997
  initialMessagesRef.current = [];
194983
194998
  },
194984
- onFinish: input.onFinish,
194999
+ onFinish: async (event) => {
195000
+ if (persistTimer) {
195001
+ clearTimeout(persistTimer);
195002
+ persistTimer = null;
195003
+ }
195004
+ const finalMessages = latestMessages ?? [
195005
+ ...initialMessagesRef.current,
195006
+ ...event.response.messages
195007
+ ];
195008
+ await writeFile3(messagesPath, JSON.stringify(finalMessages)).catch(() => {});
195009
+ await input.onFinish?.(event);
195010
+ },
194985
195011
  abortSignal: input.abortSignal,
194986
195012
  authConfig: input.authConfig,
194987
195013
  silent: true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pensar/apex",
3
- "version": "0.0.107",
3
+ "version": "0.0.108-canary.40bd0631",
4
4
  "description": "AI-powered penetration testing CLI tool with terminal UI",
5
5
  "module": "src/tui/index.tsx",
6
6
  "main": "build/index.js",