@gajae-code/agent-core 0.2.1 → 0.2.2

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/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.2.2] - 2026-05-31
6
+
7
+ ### Changed
8
+
9
+ - Refreshed agent-core package metadata for the GJC 0.2.2 release.
10
+
5
11
  ## [0.2.1] - 2026-05-30
6
12
 
7
13
  ### Changed
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@gajae-code/agent-core",
4
- "version": "0.2.1",
4
+ "version": "0.2.2",
5
5
  "description": "General-purpose agent with transport abstraction, state management, and attachment support",
6
6
  "homepage": "https://gaebal-gajae.dev",
7
7
  "author": "Yeachan-Heo",
@@ -35,9 +35,9 @@
35
35
  "fmt": "biome format --write ."
36
36
  },
37
37
  "dependencies": {
38
- "@gajae-code/ai": "0.2.1",
39
- "@gajae-code/natives": "0.2.1",
40
- "@gajae-code/utils": "0.2.1",
38
+ "@gajae-code/ai": "0.2.2",
39
+ "@gajae-code/natives": "0.2.2",
40
+ "@gajae-code/utils": "0.2.2",
41
41
  "@opentelemetry/api": "^1.9.0"
42
42
  },
43
43
  "devDependencies": {
package/src/agent-loop.ts CHANGED
@@ -857,37 +857,35 @@ async function streamAssistantResponse(
857
857
  }
858
858
 
859
859
  function emitAbortedAssistantMessage(
860
- partialMessage: AssistantMessage | null,
860
+ _partialMessage: AssistantMessage | null,
861
861
  addedPartial: boolean,
862
862
  context: AgentContext,
863
863
  config: AgentLoopConfig,
864
864
  stream: EventStream<AgentEvent, AgentMessage[]>,
865
865
  ): AssistantMessage {
866
866
  const errorMessage = "Request was aborted";
867
- const abortedMessage: AssistantMessage = partialMessage
868
- ? { ...partialMessage, stopReason: "aborted", errorMessage }
869
- : {
870
- role: "assistant",
871
- content: [],
872
- api: config.model.api,
873
- provider: config.model.provider,
874
- model: config.model.id,
875
- usage: {
876
- input: 0,
877
- output: 0,
878
- cacheRead: 0,
879
- cacheWrite: 0,
880
- totalTokens: 0,
881
- cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },
882
- },
883
- stopReason: "aborted",
884
- errorMessage,
885
- timestamp: Date.now(),
886
- };
867
+ const now = Date.now();
868
+ const abortedMessage: AssistantMessage = {
869
+ role: "assistant",
870
+ content: [],
871
+ api: config.model.api,
872
+ provider: config.model.provider,
873
+ model: config.model.id,
874
+ usage: {
875
+ input: 0,
876
+ output: 0,
877
+ cacheRead: 0,
878
+ cacheWrite: 0,
879
+ totalTokens: 0,
880
+ cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },
881
+ },
882
+ stopReason: "aborted",
883
+ errorMessage,
884
+ timestamp: now,
885
+ };
887
886
  if (addedPartial) {
888
- context.messages[context.messages.length - 1] = abortedMessage;
887
+ context.messages.pop();
889
888
  } else {
890
- context.messages.push(abortedMessage);
891
889
  stream.push({ type: "message_start", message: { ...abortedMessage } });
892
890
  }
893
891
  stream.push({ type: "message_end", message: abortedMessage });