@volter/supercode-teams 0.3.138 → 0.3.140
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/connector/index.mjs +2 -1
- package/connector/native-effects.mjs +2 -1
- package/connector/path.mjs +9 -0
- package/machine.mjs +6 -3
- package/package.json +1 -1
package/connector/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { mkdirSync, readFileSync, writeFileSync, renameSync, existsSync, chmodSync,
|
|
1
|
+
import { mkdirSync, readFileSync, writeFileSync, renameSync, existsSync, chmodSync, statSync, openSync, closeSync, fsyncSync, unlinkSync, readSync, readdirSync, rmSync } from 'node:fs';
|
|
2
|
+
import { realpathSync } from './path.mjs';
|
|
2
3
|
import { redactionBasis } from '@volter/teams/redact';
|
|
3
4
|
import { Redactor } from './redactor.mjs';
|
|
4
5
|
import { basename, dirname, join, sep } from 'node:path';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createHash } from 'node:crypto';
|
|
2
|
-
import { mkdtempSync, mkdirSync, writeFileSync, rmSync,
|
|
2
|
+
import { mkdtempSync, mkdirSync, writeFileSync, rmSync, statSync } from 'node:fs';
|
|
3
|
+
import { realpathSync } from './path.mjs';
|
|
3
4
|
import { join, resolve, relative, dirname, isAbsolute, sep } from 'node:path';
|
|
4
5
|
|
|
5
6
|
const digest = value => createHash('sha256').update(value).digest('hex');
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { realpathSync as nodeRealpathSync } from 'node:fs';
|
|
2
|
+
|
|
3
|
+
// Rust discovery returns Windows namespace paths (\\?\C:\...). Node's JS
|
|
4
|
+
// resolver tries to lstat the drive component as "C:" and refuses those paths.
|
|
5
|
+
// The OS-native resolver accepts them and preserves filesystem resolution,
|
|
6
|
+
// including junctions and UNC paths. Keep the existing POSIX resolver.
|
|
7
|
+
export const realpathSync = process.platform === 'win32'
|
|
8
|
+
? nodeRealpathSync.native
|
|
9
|
+
: nodeRealpathSync;
|
package/machine.mjs
CHANGED
|
@@ -194,17 +194,20 @@ async function claudeTranscriptHolds(projectsDirs, sessionId, landed) {
|
|
|
194
194
|
return false;
|
|
195
195
|
}
|
|
196
196
|
/**
|
|
197
|
-
* The doors whose work waits on a session, with the bound each answers within (the node door's own is 30 s): a send or
|
|
197
|
+
* The doors whose work waits on a session or mailbox, with the bound each answers within (the node door's own is 30 s): a send or
|
|
198
198
|
* a hand-over waits on its receiver's door (a relay's receipt, up to 90 s; another machine's door, MAIL_SEND_MS), a
|
|
199
199
|
* delegation or a declaration that starts a session waits for it to appear (up to a minute). Past its bound a call is
|
|
200
|
-
* answered 504, which its client reads as unanswered: the work may still finish.
|
|
200
|
+
* answered 504, which its client reads as unanswered: the work may still finish. A board's mailbox long poll gets
|
|
201
|
+
* its maximum requested wait plus time to return the answer, rather than the ordinary door's shorter bound.
|
|
201
202
|
*/
|
|
203
|
+
const BOARD_WAIT_MAX_SECONDS = 120;
|
|
202
204
|
const DOOR_BOUNDS_MS = {
|
|
203
205
|
'harness.v1.mail.send': 170_000,
|
|
204
206
|
'harness.v1.mail.message': 170_000,
|
|
205
207
|
'harness.v1.mail.handover': 140_000,
|
|
206
208
|
'harness.v1.mail.delegate': 110_000,
|
|
207
209
|
'harness.v1.agent.declare': 110_000,
|
|
210
|
+
'harness.v1.mail.board_wait': (BOARD_WAIT_MAX_SECONDS + 10) * 1000,
|
|
208
211
|
};
|
|
209
212
|
/** How many typed lines' keys a machine remembers; a server retries a line for minutes, not thousands of lines. */
|
|
210
213
|
const TURN_KEYS_KEPT = 1000;
|
|
@@ -4133,7 +4136,7 @@ export class TeamsMachine extends MachineCore {
|
|
|
4133
4136
|
const board = new RegExp(`^sc:${machineName(this.env).replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}:board:[^:\\s]+$`);
|
|
4134
4137
|
if (method === 'harness.v1.mail.board_wait') {
|
|
4135
4138
|
const boards = (Array.isArray(params.boards) ? params.boards : []).filter((address) => typeof address === 'string' && board.test(address)).slice(0, 256);
|
|
4136
|
-
const seconds = Math.min(
|
|
4139
|
+
const seconds = Math.min(BOARD_WAIT_MAX_SECONDS, Math.max(0, Number.isFinite(Number(params.timeout)) ? Math.floor(Number(params.timeout)) : 60));
|
|
4137
4140
|
const waiting = () => boards.filter((address) => this.mailStore.hasClaimable(address));
|
|
4138
4141
|
let woken = waiting();
|
|
4139
4142
|
if (!woken.length && boards.length) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/supercode-teams",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.140",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A machine daemon serving this machine's doors, and a local or remote Teams server for shared session discovery, OpenTelemetry ingestion and access to enrolled machines.",
|
|
6
6
|
"license": "MIT",
|