oasis_test 0.1.39 → 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 +12 -5
- 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) => {
|
|
@@ -55440,10 +55446,11 @@ async function startServe(opts) {
|
|
|
55440
55446
|
}
|
|
55441
55447
|
}
|
|
55442
55448
|
}
|
|
55449
|
+
const sessionLine = chatSessionId ? `chat_session_id: ${chatSessionId}` : `runtime_session_id: ${runtimeSessionId}`;
|
|
55443
55450
|
const taskHeader = workspace ? [
|
|
55444
55451
|
"# \u4E0E\u5DE5\u5355\u7BA1\u7406\u8005\u5BF9\u8BDD",
|
|
55445
55452
|
"",
|
|
55446
|
-
|
|
55453
|
+
sessionLine,
|
|
55447
55454
|
`actor_id: ${actorId}`,
|
|
55448
55455
|
`workspace: ${workspace}`,
|
|
55449
55456
|
"",
|
|
@@ -55451,7 +55458,7 @@ async function startServe(opts) {
|
|
|
55451
55458
|
] : [
|
|
55452
55459
|
"# \u5373\u65F6\u8111\u66B4\u5BF9\u8BDD",
|
|
55453
55460
|
"",
|
|
55454
|
-
|
|
55461
|
+
sessionLine,
|
|
55455
55462
|
`actor_id: ${actorId}`,
|
|
55456
55463
|
"",
|
|
55457
55464
|
"\u8BF7\u76F4\u63A5\u56DE\u7B54\u7528\u6237\u95EE\u9898\u3002\u9664\u975E\u7528\u6237\u660E\u786E\u8981\u6C42\u5199\u5165\u7CFB\u7EDF\uFF0C\u5426\u5219\u4E0D\u8981\u521B\u5EFA\u6216\u4FEE\u6539 artifact\u3002"
|
|
@@ -58121,7 +58128,7 @@ ${res.warning}`);
|
|
|
58121
58128
|
}
|
|
58122
58129
|
|
|
58123
58130
|
// src/index.ts
|
|
58124
|
-
var PKG_VERSION = true ? "0.1.
|
|
58131
|
+
var PKG_VERSION = true ? "0.1.41" : "dev";
|
|
58125
58132
|
var OASIS_DIR = path18.join(os10.homedir(), ".oasis");
|
|
58126
58133
|
var CONFIG_FILE = path18.join(OASIS_DIR, "node-config.json");
|
|
58127
58134
|
var PID_FILE = path18.join(OASIS_DIR, "node.pid");
|