osagent 0.1.71 → 0.1.72

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/cli.js +20 -3
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -146587,7 +146587,7 @@ function createContentGeneratorConfig(config2, authType, generationConfig) {
146587
146587
  };
146588
146588
  }
146589
146589
  async function createContentGenerator(config2, gcConfig, sessionId2, isInitialAuth) {
146590
- const version3 = "0.1.71";
146590
+ const version3 = "0.1.72";
146591
146591
  const userAgent2 = `OSAgent/${version3} (${process.platform}; ${process.arch})`;
146592
146592
  const baseHeaders = {
146593
146593
  "User-Agent": userAgent2
@@ -335720,7 +335720,7 @@ __name(getPackageJson, "getPackageJson");
335720
335720
  // packages/cli/src/utils/version.ts
335721
335721
  async function getCliVersion() {
335722
335722
  const pkgJson = await getPackageJson();
335723
- return "0.1.71";
335723
+ return "0.1.72";
335724
335724
  }
335725
335725
  __name(getCliVersion, "getCliVersion");
335726
335726
 
@@ -339908,7 +339908,7 @@ var formatDuration = /* @__PURE__ */ __name((milliseconds) => {
339908
339908
  // packages/cli/src/generated/git-commit.ts
339909
339909
  init_esbuild_shims();
339910
339910
  var GIT_COMMIT_INFO2 = "3160e61";
339911
- var CLI_VERSION2 = "0.1.71";
339911
+ var CLI_VERSION2 = "0.1.72";
339912
339912
 
339913
339913
  // packages/cli/src/utils/systemInfo.ts
339914
339914
  async function getNpmVersion() {
@@ -351070,17 +351070,33 @@ var import_react30 = __toESM(require_react(), 1);
351070
351070
  function useHistory() {
351071
351071
  const [history, setHistory] = (0, import_react30.useState)([]);
351072
351072
  const messageIdCounterRef = (0, import_react30.useRef)(0);
351073
+ const lastAddedMessageRef = (0, import_react30.useRef)(null);
351073
351074
  const getNextMessageId = (0, import_react30.useCallback)((baseTimestamp) => {
351074
351075
  messageIdCounterRef.current += 1;
351075
351076
  return baseTimestamp + messageIdCounterRef.current;
351076
351077
  }, []);
351077
351078
  const loadHistory = (0, import_react30.useCallback)((newHistory) => {
351078
351079
  setHistory(newHistory);
351080
+ if (newHistory.length > 0) {
351081
+ const lastItem = newHistory[newHistory.length - 1];
351082
+ lastAddedMessageRef.current = {
351083
+ type: String(lastItem.type),
351084
+ text: "text" in lastItem ? String(lastItem.text) : ""
351085
+ };
351086
+ } else {
351087
+ lastAddedMessageRef.current = null;
351088
+ }
351079
351089
  }, []);
351080
351090
  const addItem = (0, import_react30.useCallback)(
351081
351091
  (itemData, baseTimestamp) => {
351082
351092
  const id = getNextMessageId(baseTimestamp);
351083
351093
  const newItem = { ...itemData, id };
351094
+ const newItemType = String(newItem.type);
351095
+ const newItemText = "text" in newItem ? String(newItem.text) : "";
351096
+ if (lastAddedMessageRef.current && lastAddedMessageRef.current.type === newItemType && lastAddedMessageRef.current.text === newItemText) {
351097
+ return id;
351098
+ }
351099
+ lastAddedMessageRef.current = { type: newItemType, text: newItemText };
351084
351100
  setHistory((prevHistory) => {
351085
351101
  if (prevHistory.length > 0) {
351086
351102
  const lastItem = prevHistory[prevHistory.length - 1];
@@ -351111,6 +351127,7 @@ function useHistory() {
351111
351127
  const clearItems = (0, import_react30.useCallback)(() => {
351112
351128
  setHistory([]);
351113
351129
  messageIdCounterRef.current = 0;
351130
+ lastAddedMessageRef.current = null;
351114
351131
  }, []);
351115
351132
  return {
351116
351133
  history,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "osagent",
3
- "version": "0.1.71",
3
+ "version": "0.1.72",
4
4
  "description": "OS Agent - AI-powered CLI for autonomous coding with Ollama Cloud and Qwen models",
5
5
  "author": "Roberto Luna",
6
6
  "license": "Apache-2.0",