@agentproto/runtime 0.8.0 → 1.1.0
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/dist/index.d.ts +1069 -95
- package/dist/index.mjs +2214 -306
- package/dist/index.mjs.map +1 -1
- package/dist/resume-strategies.mjs +42 -13
- package/dist/resume-strategies.mjs.map +1 -1
- package/dist/session-story.d.ts +2 -0
- package/dist/workspaces-config.mjs +13 -3
- package/dist/workspaces-config.mjs.map +1 -1
- package/package.json +16 -14
|
@@ -207,7 +207,7 @@ async function exportClaudeCodeSession(adapterSessionId, cwd) {
|
|
|
207
207
|
"claude-code exporter: cwd is required to locate the JSONL file.\nPass cwd explicitly or use a session id that is in the registry."
|
|
208
208
|
);
|
|
209
209
|
}
|
|
210
|
-
const encoded = cwd
|
|
210
|
+
const encoded = claudeProjectSlug(cwd);
|
|
211
211
|
const filePath = join(homedir(), ".claude", "projects", encoded, `${adapterSessionId}.jsonl`);
|
|
212
212
|
let stream;
|
|
213
213
|
try {
|
|
@@ -715,6 +715,7 @@ var init_transcript_export = __esm({
|
|
|
715
715
|
"src/transcript-export.ts"() {
|
|
716
716
|
init_tool_presenter();
|
|
717
717
|
init_transcript_writer();
|
|
718
|
+
init_conversation_store();
|
|
718
719
|
ROLE_ICON = {
|
|
719
720
|
user: "\u{1F9D1} User",
|
|
720
721
|
assistant: "\u{1F916} Assistant",
|
|
@@ -738,9 +739,11 @@ var init_transcript_export = __esm({
|
|
|
738
739
|
};
|
|
739
740
|
}
|
|
740
741
|
});
|
|
742
|
+
function claudeProjectSlug(cwd) {
|
|
743
|
+
return cwd.replace(/[^a-zA-Z0-9]/g, "-");
|
|
744
|
+
}
|
|
741
745
|
function claudeCodeProjectDir(cwd) {
|
|
742
|
-
|
|
743
|
-
return resolve(homedir(), ".claude", "projects", encoded);
|
|
746
|
+
return resolve(homedir(), ".claude", "projects", claudeProjectSlug(cwd));
|
|
744
747
|
}
|
|
745
748
|
function extractFirstText(content) {
|
|
746
749
|
if (typeof content === "string") {
|
|
@@ -851,18 +854,44 @@ async function readClaudeCode(conversationId, cwd) {
|
|
|
851
854
|
const { exportClaudeCodeSession: exportClaudeCodeSession2 } = await Promise.resolve().then(() => (init_transcript_export(), transcript_export_exports));
|
|
852
855
|
return exportClaudeCodeSession2(conversationId, cwd);
|
|
853
856
|
}
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
857
|
+
async function discoverHermes(input) {
|
|
858
|
+
const { discoverHermesSessions: discoverHermesSessions2 } = await Promise.resolve().then(() => (init_transcript_export(), transcript_export_exports));
|
|
859
|
+
return discoverHermesSessions2(input.cwd, input.since, input.expectedId);
|
|
860
|
+
}
|
|
861
|
+
async function readHermes(conversationId) {
|
|
862
|
+
const { exportHermesSession: exportHermesSession2 } = await Promise.resolve().then(() => (init_transcript_export(), transcript_export_exports));
|
|
863
|
+
return exportHermesSession2(conversationId);
|
|
864
|
+
}
|
|
865
|
+
var CONVERSATION_STORES;
|
|
866
|
+
var init_conversation_store = __esm({
|
|
867
|
+
"src/conversation-store.ts"() {
|
|
868
|
+
CONVERSATION_STORES = {
|
|
869
|
+
"claude-code": {
|
|
870
|
+
storeAs: "claudeResumeId",
|
|
871
|
+
// Printed by claude on graceful exit when session persistence is on
|
|
872
|
+
// (default). Example: `claude --resume 0e483f81-1a44-4bec-9667-b37158450296`
|
|
873
|
+
outputHint: /claude\s+--resume\s+([0-9a-f-]{8,})/i,
|
|
874
|
+
attachArgv: (conversationId) => ["claude", "--resume", conversationId],
|
|
875
|
+
discover: discoverClaudeCode,
|
|
876
|
+
read: readClaudeCode
|
|
877
|
+
},
|
|
878
|
+
hermes: {
|
|
879
|
+
storeAs: "hermesResumeId",
|
|
880
|
+
// `hermes acp` is the ACP arm (bin_args in adapters/hermes/src/index.ts);
|
|
881
|
+
// `--resume SESSION --tui` is the native TUI resume path — same binary,
|
|
882
|
+
// different flags, unlike claude-code where the two arms are different
|
|
883
|
+
// binaries. Verified via `hermes --help`: `--resume SESSION, -r` =
|
|
884
|
+
// "Resume a previous session by ID or title", `--tui` = the real TUI.
|
|
885
|
+
attachArgv: (conversationId) => ["hermes", "--resume", conversationId, "--tui"],
|
|
886
|
+
discover: discoverHermes,
|
|
887
|
+
read: readHermes
|
|
888
|
+
}
|
|
889
|
+
};
|
|
890
|
+
}
|
|
891
|
+
});
|
|
864
892
|
|
|
865
893
|
// src/resume-strategies.ts
|
|
894
|
+
init_conversation_store();
|
|
866
895
|
var claudeCodeStore = CONVERSATION_STORES["claude-code"];
|
|
867
896
|
var RESUME_STRATEGIES = {
|
|
868
897
|
"claude-code": {
|