agent-trajectory 0.2.3__tar.gz → 0.2.5__tar.gz

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 (17) hide show
  1. {agent_trajectory-0.2.3 → agent_trajectory-0.2.5}/PKG-INFO +1 -1
  2. {agent_trajectory-0.2.3 → agent_trajectory-0.2.5}/pyproject.toml +1 -1
  3. {agent_trajectory-0.2.3 → agent_trajectory-0.2.5}/python/src/agent_trajectory.egg-info/PKG-INFO +1 -1
  4. {agent_trajectory-0.2.3 → agent_trajectory-0.2.5}/python/src/trajectory/__init__.py +1 -1
  5. {agent_trajectory-0.2.3 → agent_trajectory-0.2.5}/python/src/trajectory/_vendor/trajectory-cli.mjs +9 -7
  6. {agent_trajectory-0.2.3 → agent_trajectory-0.2.5}/LICENSE +0 -0
  7. {agent_trajectory-0.2.3 → agent_trajectory-0.2.5}/README.md +0 -0
  8. {agent_trajectory-0.2.3 → agent_trajectory-0.2.5}/python/src/agent_trajectory.egg-info/SOURCES.txt +0 -0
  9. {agent_trajectory-0.2.3 → agent_trajectory-0.2.5}/python/src/agent_trajectory.egg-info/dependency_links.txt +0 -0
  10. {agent_trajectory-0.2.3 → agent_trajectory-0.2.5}/python/src/agent_trajectory.egg-info/requires.txt +0 -0
  11. {agent_trajectory-0.2.3 → agent_trajectory-0.2.5}/python/src/agent_trajectory.egg-info/top_level.txt +0 -0
  12. {agent_trajectory-0.2.3 → agent_trajectory-0.2.5}/python/src/trajectory/_client.py +0 -0
  13. {agent_trajectory-0.2.3 → agent_trajectory-0.2.5}/python/src/trajectory/_errors.py +0 -0
  14. {agent_trajectory-0.2.3 → agent_trajectory-0.2.5}/python/src/trajectory/_types.py +0 -0
  15. {agent_trajectory-0.2.3 → agent_trajectory-0.2.5}/python/src/trajectory/_vendor/deepagents_checkpoint.py +0 -0
  16. {agent_trajectory-0.2.3 → agent_trajectory-0.2.5}/python/src/trajectory/py.typed +0 -0
  17. {agent_trajectory-0.2.3 → agent_trajectory-0.2.5}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agent-trajectory
3
- Version: 0.2.3
3
+ Version: 0.2.5
4
4
  Summary: Normalize native agent transcripts into a shared trajectory format.
5
5
  Author: Letta
6
6
  License-Expression: Apache-2.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "agent-trajectory"
7
- version = "0.2.3"
7
+ version = "0.2.5"
8
8
  description = "Normalize native agent transcripts into a shared trajectory format."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agent-trajectory
3
- Version: 0.2.3
3
+ Version: 0.2.5
4
4
  Summary: Normalize native agent transcripts into a shared trajectory format.
5
5
  Author: Letta
6
6
  License-Expression: Apache-2.0
@@ -76,4 +76,4 @@ __all__ = [
76
76
  "normalize_transcript",
77
77
  ]
78
78
 
79
- __version__ = "0.2.3"
79
+ __version__ = "0.2.5"
@@ -216,11 +216,10 @@ var claudeCodeAdapter = {
216
216
  if (agentIds.size > 1) {
217
217
  throw new NormalizationError("source_group_conflict", `Claude Code subagent transcript contains multiple agent ids: ${[...agentIds].map((id) => JSON.stringify(id)).sort().join(", ")}.`);
218
218
  }
219
- if (sessionIds.size > 1 && (!standaloneSidechain || agentIds.size === 0)) {
220
- throw new NormalizationError("source_group_conflict", `Claude Code transcript contains multiple session ids: ${[...sessionIds].map((id) => JSON.stringify(id)).sort().join(", ")}.`);
221
- }
222
- const [sessionId] = sessionIds;
219
+ const sessionId = sessionIds.size === 1 ? sessionIds.values().next().value : undefined;
223
220
  const [agentId] = agentIds;
221
+ const sourceGroupId = agentId ?? sessionId;
222
+ const sourceGroupAmbiguous = sessionIds.size > 1 && !agentId;
224
223
  const cwd = cwdCandidate?.value;
225
224
  const gitBranch = branchCandidate?.value;
226
225
  return {
@@ -229,7 +228,8 @@ var claudeCodeAdapter = {
229
228
  source: "claude-code",
230
229
  ...cwd ? { cwd } : {},
231
230
  ...gitBranch ? { gitBranch } : {},
232
- ...agentId || sessionId ? { sourceGroupId: agentId || sessionId } : {}
231
+ ...sourceGroupId ? { sourceGroupId } : {},
232
+ ...sourceGroupAmbiguous ? { sourceGroupAmbiguous: true } : {}
233
233
  },
234
234
  diagnostics
235
235
  };
@@ -942,12 +942,14 @@ var geminiCliAdapter = {
942
942
  }
943
943
  }
944
944
  const sourceGroupId = nonemptyString2(document.sessionId);
945
+ const sourceGroupRequired = !sourceGroupId && !nonemptyString2(document.projectHash);
945
946
  const createdAt = parseTimestamp(document.startTime);
946
947
  return {
947
948
  events,
948
949
  context: {
949
950
  source: "gemini-cli",
950
951
  ...sourceGroupId ? { sourceGroupId } : {},
952
+ ...sourceGroupRequired ? { sourceGroupRequired: true } : {},
951
953
  ...createdAt ? { createdAt } : {}
952
954
  },
953
955
  diagnostics
@@ -961,7 +963,7 @@ function parseGeminiDocument(transcript) {
961
963
  } catch {
962
964
  throw invalidGeminiTranscript();
963
965
  }
964
- if (!isObject(parsed) || !Array.isArray(parsed.messages) || typeof parsed.sessionId !== "string" && typeof parsed.projectHash !== "string") {
966
+ if (!isObject(parsed) || !Array.isArray(parsed.messages)) {
965
967
  throw invalidGeminiTranscript();
966
968
  }
967
969
  return parsed;
@@ -1000,7 +1002,7 @@ function stringContent(value) {
1000
1002
  return isObject(value) || Array.isArray(value) ? jsonString(value) : String(value);
1001
1003
  }
1002
1004
  function invalidGeminiTranscript() {
1003
- return new NormalizationError("invalid_input", "Gemini CLI transcript must be one native session JSON document with " + "session metadata and a messages array.");
1005
+ return new NormalizationError("invalid_input", "Gemini CLI transcript must be one native session JSON document with a messages array.");
1004
1006
  }
1005
1007
 
1006
1008
  // src/adapters/hermes/index.ts