oasis_test 0.1.40 → 0.1.41
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.js +9 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -38983,15 +38983,16 @@ async function runACPSession(job, cfg) {
|
|
|
38983
38983
|
});
|
|
38984
38984
|
void (async () => {
|
|
38985
38985
|
try {
|
|
38986
|
-
await client.request("initialize", {
|
|
38986
|
+
const initRes = await client.request("initialize", {
|
|
38987
38987
|
protocolVersion: 1,
|
|
38988
38988
|
clientInfo: { name: "oasis-adapter", version: "0.1.0" },
|
|
38989
38989
|
clientCapabilities: {}
|
|
38990
38990
|
});
|
|
38991
|
+
const advertisedLoadSession = initRes?.agentCapabilities?.loadSession === true;
|
|
38991
38992
|
const resolvedModel = job.model ?? cfg.model;
|
|
38992
38993
|
let sessionId = "";
|
|
38993
38994
|
let ambiguousResume = false;
|
|
38994
|
-
if (job.resumeRuntimeSession && job.runtimeSessionId) {
|
|
38995
|
+
if (job.resumeRuntimeSession && job.runtimeSessionId && advertisedLoadSession) {
|
|
38995
38996
|
const method = cfg.resumeMethod ?? "session/load";
|
|
38996
38997
|
try {
|
|
38997
38998
|
const resumeRes = await client.request(method, {
|
|
@@ -39110,6 +39111,11 @@ var init_acp = __esm({
|
|
|
39110
39111
|
seq = 0;
|
|
39111
39112
|
/** Token usage accumulator (updated from UsageUpdate notifications) */
|
|
39112
39113
|
usage = newUsageAcc();
|
|
39114
|
+
/**
|
|
39115
|
+
* 单调递增的通知计数——用于 drainReplayQuiet 探测 hermes/session/load 后的 replay 通知
|
|
39116
|
+
* 是否还在流。每收到一条 session/update / session/notification 就 +1,主循环轮询该值。
|
|
39117
|
+
*/
|
|
39118
|
+
notificationCount = 0;
|
|
39113
39119
|
request(method, params) {
|
|
39114
39120
|
const id = this.nextId++;
|
|
39115
39121
|
return new Promise((resolve4, reject) => {
|
|
@@ -58122,7 +58128,7 @@ ${res.warning}`);
|
|
|
58122
58128
|
}
|
|
58123
58129
|
|
|
58124
58130
|
// src/index.ts
|
|
58125
|
-
var PKG_VERSION = true ? "0.1.
|
|
58131
|
+
var PKG_VERSION = true ? "0.1.41" : "dev";
|
|
58126
58132
|
var OASIS_DIR = path18.join(os10.homedir(), ".oasis");
|
|
58127
58133
|
var CONFIG_FILE = path18.join(OASIS_DIR, "node-config.json");
|
|
58128
58134
|
var PID_FILE = path18.join(OASIS_DIR, "node.pid");
|