openwork 0.1.1-rc.2 → 0.1.1-rc.3

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.
@@ -34262,7 +34262,13 @@ var BaseMessage = class extends Serializable {
34262
34262
  function isOpenAIToolCallArray(value) {
34263
34263
  return Array.isArray(value) && value.every((v2) => typeof v2.index === "number");
34264
34264
  }
34265
- function _mergeDicts(left, right) {
34265
+ const DEFAULT_MERGE_IGNORE_KEYS = [
34266
+ "index",
34267
+ "created",
34268
+ "timestamp"
34269
+ ];
34270
+ function _mergeDicts(left, right, options) {
34271
+ const ignoreKeys = options?.ignoreKeys ?? DEFAULT_MERGE_IGNORE_KEYS;
34266
34272
  if (left === void 0 && right === void 0) return void 0;
34267
34273
  if (left === void 0 || right === void 0) return left ?? right;
34268
34274
  const merged = { ...left };
@@ -34277,15 +34283,18 @@ function _mergeDicts(left, right) {
34277
34283
  "model_provider"
34278
34284
  ].includes(key2)) {
34279
34285
  if (value) merged[key2] = value;
34280
- } else merged[key2] += value;
34281
- else if (typeof merged[key2] === "number") merged[key2] = merged[key2] + value;
34282
- else if (typeof merged[key2] === "object" && !Array.isArray(merged[key2])) merged[key2] = _mergeDicts(merged[key2], value);
34283
- else if (Array.isArray(merged[key2])) merged[key2] = _mergeLists(merged[key2], value);
34286
+ } else if (ignoreKeys.includes(key2)) continue;
34287
+ else merged[key2] += value;
34288
+ else if (typeof merged[key2] === "number") {
34289
+ if (ignoreKeys.includes(key2)) continue;
34290
+ merged[key2] = merged[key2] + value;
34291
+ } else if (typeof merged[key2] === "object" && !Array.isArray(merged[key2])) merged[key2] = _mergeDicts(merged[key2], value, options);
34292
+ else if (Array.isArray(merged[key2])) merged[key2] = _mergeLists(merged[key2], value, options);
34284
34293
  else if (merged[key2] === value) continue;
34285
34294
  else console.warn(`field[${key2}] already exists in this message chunk and value has unsupported type.`);
34286
34295
  return merged;
34287
34296
  }
34288
- function _mergeLists(left, right) {
34297
+ function _mergeLists(left, right, options) {
34289
34298
  if (left === void 0 && right === void 0) return void 0;
34290
34299
  else if (left === void 0 || right === void 0) return left || right;
34291
34300
  else {
@@ -34298,22 +34307,22 @@ function _mergeLists(left, right) {
34298
34307
  const eitherItemMissingID = !("id" in leftItem) || !leftItem?.id || !("id" in item) || !item?.id;
34299
34308
  return isObject && indiciesMatch && (idsMatch || eitherItemMissingID);
34300
34309
  });
34301
- if (toMerge !== -1 && typeof merged[toMerge] === "object" && merged[toMerge] !== null) merged[toMerge] = _mergeDicts(merged[toMerge], item);
34310
+ if (toMerge !== -1 && typeof merged[toMerge] === "object" && merged[toMerge] !== null) merged[toMerge] = _mergeDicts(merged[toMerge], item, options);
34302
34311
  else merged.push(item);
34303
34312
  } else if (typeof item === "object" && item !== null && "text" in item && item.text === "") continue;
34304
34313
  else merged.push(item);
34305
34314
  return merged;
34306
34315
  }
34307
34316
  }
34308
- function _mergeObj(left, right) {
34317
+ function _mergeObj(left, right, options) {
34309
34318
  if (left === void 0 && right === void 0) return void 0;
34310
34319
  if (left === void 0 || right === void 0) return left ?? right;
34311
34320
  else if (typeof left !== typeof right) throw new Error(`Cannot merge objects of different types.
34312
34321
  Left ${typeof left}
34313
34322
  Right ${typeof right}`);
34314
34323
  else if (typeof left === "string" && typeof right === "string") return left + right;
34315
- else if (Array.isArray(left) && Array.isArray(right)) return _mergeLists(left, right);
34316
- else if (typeof left === "object" && typeof right === "object") return _mergeDicts(left, right);
34324
+ else if (Array.isArray(left) && Array.isArray(right)) return _mergeLists(left, right, options);
34325
+ else if (typeof left === "object" && typeof right === "object") return _mergeDicts(left, right, options);
34317
34326
  else if (left === right) return left;
34318
34327
  else throw new Error(`Can not merge objects of different types.
34319
34328
  Left ${left}
@@ -47969,12 +47978,14 @@ const STATUS_NO_RETRY$1 = [
47969
47978
  409
47970
47979
  ];
47971
47980
  const defaultFailedAttemptHandler = (error) => {
47972
- if (error.message.startsWith("Cancel") || error.message.startsWith("AbortError") || error.name === "AbortError") throw error;
47973
- if (error?.code === "ECONNABORTED") throw error;
47974
- const status = error?.response?.status ?? error?.status;
47981
+ if (typeof error !== "object" || error === null) return;
47982
+ if ("message" in error && typeof error.message === "string" && (error.message.startsWith("Cancel") || error.message.startsWith("AbortError")) || "name" in error && typeof error.name === "string" && error.name === "AbortError") throw error;
47983
+ if ("code" in error && typeof error.code === "string" && error.code === "ECONNABORTED") throw error;
47984
+ const status = "response" in error && typeof error.response === "object" && error.response !== null && "status" in error.response && typeof error.response.status === "number" ? error.response.status : void 0;
47975
47985
  if (status && STATUS_NO_RETRY$1.includes(+status)) throw error;
47976
- if (error?.error?.code === "insufficient_quota") {
47977
- const err = new Error(error?.message);
47986
+ const code2 = "error" in error && typeof error.error === "object" && error.error !== null && "code" in error.error && typeof error.error.code === "string" ? error.error.code : void 0;
47987
+ if (code2 === "insufficient_quota") {
47988
+ const err = new Error("message" in error && typeof error.message === "string" ? error.message : "Insufficient quota");
47978
47989
  err.name = "InsufficientQuotaError";
47979
47990
  throw err;
47980
47991
  }
@@ -57172,6 +57183,7 @@ __export(messages_exports, {
57172
57183
  BaseMessageChunk: () => BaseMessageChunk,
57173
57184
  ChatMessage: () => ChatMessage,
57174
57185
  ChatMessageChunk: () => ChatMessageChunk,
57186
+ DEFAULT_MERGE_IGNORE_KEYS: () => DEFAULT_MERGE_IGNORE_KEYS,
57175
57187
  FunctionMessage: () => FunctionMessage,
57176
57188
  FunctionMessageChunk: () => FunctionMessageChunk,
57177
57189
  HumanMessage: () => HumanMessage,
@@ -75120,7 +75132,7 @@ function TaskItem({ todo }) {
75120
75132
  function FilesContent() {
75121
75133
  const { workspaceFiles, workspacePath, currentThreadId, setWorkspacePath, setWorkspaceFiles } = useAppStore();
75122
75134
  const [syncing, setSyncing] = reactExports.useState(false);
75123
- const [syncSuccess, _setSyncSuccess] = reactExports.useState(false);
75135
+ const [syncSuccess] = reactExports.useState(false);
75124
75136
  reactExports.useEffect(() => {
75125
75137
  async function loadWorkspace() {
75126
75138
  if (currentThreadId) {
@@ -75136,6 +75148,19 @@ function FilesContent() {
75136
75148
  }
75137
75149
  loadWorkspace();
75138
75150
  }, [currentThreadId, setWorkspacePath, setWorkspaceFiles]);
75151
+ reactExports.useEffect(() => {
75152
+ if (!currentThreadId) return;
75153
+ const cleanup = window.api.workspace.onFilesChanged(async (data) => {
75154
+ if (data.threadId === currentThreadId) {
75155
+ console.log("[FilesContent] Files changed, reloading...", data);
75156
+ const result = await window.api.workspace.loadFromDisk(currentThreadId);
75157
+ if (result.success && result.files) {
75158
+ setWorkspaceFiles(result.files);
75159
+ }
75160
+ }
75161
+ });
75162
+ return cleanup;
75163
+ }, [currentThreadId, setWorkspaceFiles]);
75139
75164
  async function handleSelectFolder() {
75140
75165
  if (!currentThreadId) return;
75141
75166
  setSyncing(true);
@@ -75535,7 +75560,7 @@ function App() {
75535
75560
  },
75536
75561
  children: [
75537
75562
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "app-badge-name", children: "OPENWORK" }),
75538
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "app-badge-version", children: "0.1.1-rc.2" })
75563
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "app-badge-version", children: "0.1.1-rc.3" })
75539
75564
  ]
75540
75565
  }
75541
75566
  ),
@@ -7,7 +7,7 @@
7
7
  http-equiv="Content-Security-Policy"
8
8
  content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:"
9
9
  />
10
- <script type="module" crossorigin src="./assets/index-Dyv8tZ_T.js"></script>
10
+ <script type="module" crossorigin src="./assets/index-Dvk2R-ko.js"></script>
11
11
  <link rel="stylesheet" crossorigin href="./assets/index-D2W2biEe.css">
12
12
  </head>
13
13
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openwork",
3
- "version": "0.1.1-rc.2",
3
+ "version": "0.1.1-rc.3",
4
4
  "description": "A tactical agent interface for deepagentsjs",
5
5
  "main": "./out/main/index.js",
6
6
  "files": [
@@ -47,12 +47,12 @@
47
47
  },
48
48
  "dependencies": {
49
49
  "electron": "^39.2.6",
50
- "@langchain/anthropic": "^1.3.7",
51
- "@langchain/core": "^1.1.12",
50
+ "@langchain/anthropic": "^1.3.10",
51
+ "@langchain/core": "1.1.15",
52
52
  "@langchain/langgraph": "^1.0.15",
53
53
  "@langchain/langgraph-checkpoint": "^1.0.0",
54
54
  "@langchain/langgraph-sdk": "^1.5.3",
55
- "@langchain/openai": "^1.2.1",
55
+ "@langchain/openai": "^1.2.2",
56
56
  "@radix-ui/react-context-menu": "^2.2.16",
57
57
  "@radix-ui/react-dialog": "^1.1.15",
58
58
  "@radix-ui/react-dropdown-menu": "^2.1.16",