@volter/teams 0.2.23 → 0.2.25
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/board-owner.mjs +1 -1
- package/checkout.mjs +11 -10
- package/package.json +1 -1
package/board-owner.mjs
CHANGED
|
@@ -40,7 +40,7 @@ export function boardOwnerSocket(root) {
|
|
|
40
40
|
* through the board door: the owner itself and its one-shot round, init, adoption, the board list, housekeeping and
|
|
41
41
|
* repair, migration, the dispatching switch, and the verbs that hold the call open (watch, tail, attach, events).
|
|
42
42
|
*/
|
|
43
|
-
export const BOARD_OPERATION_VERBS = new Set(['serve', 'daemon', 'dispatch', '
|
|
43
|
+
export const BOARD_OPERATION_VERBS = new Set(['serve', 'daemon', 'dispatch', 'init', 'boards', 'gc', 'repair', 'migrate', 'watch', 'tail', 'events']);
|
|
44
44
|
|
|
45
45
|
/** The facts of a caller's environment the owner reads, and nothing else of it. */
|
|
46
46
|
export const CALLER_FACTS = ['SUPERCODE_AGENT_ID', 'SUPERCODE_AUTOMATION', 'SUPERCODE_CONTEXT', 'HERMES_PROFILE', 'USER', 'SUPERCODE_CALLER', 'SUPERCODE_RUN_LAUNCH'];
|
package/checkout.mjs
CHANGED
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
// macOS guards, where the session that named the path does).
|
|
5
5
|
import { realpathSync } from 'node:fs';
|
|
6
6
|
import { resolve } from 'node:path';
|
|
7
|
-
import {
|
|
7
|
+
import { execFile } from 'node:child_process';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (
|
|
12
|
-
return
|
|
13
|
-
};
|
|
9
|
+
// awaited: a caller's event loop never waits on git
|
|
10
|
+
const git = (path, args, optional = false) => new Promise((done, fail) => execFile('git', ['-C', path, ...args], { encoding: 'utf8', timeout: 30_000 }, (error, stdout, stderr) => {
|
|
11
|
+
if (!error) return done(String(stdout).trim());
|
|
12
|
+
if (optional) return done(null);
|
|
13
|
+
fail(new Error(`git ${args[0]} in ${path}: ${(stderr || error.message || 'failed').trim()}`));
|
|
14
|
+
}));
|
|
14
15
|
export function repositoryId(value) {
|
|
15
16
|
let s = String(value ?? '').trim().replace(/\.git\/?$/, '').replace(/\/$/, '');
|
|
16
17
|
if (/^[^/@]+@[^:]+:/.test(s)) s = s.replace(/^[^@]+@/, '').replace(':', '/');
|
|
@@ -19,11 +20,11 @@ export function repositoryId(value) {
|
|
|
19
20
|
if (!/^[\w.-]+(?:\/[\w.-]+)+$/.test(s) || s.split('/').some(p => p === '.' || p === '..')) throw new Error('repository must be a git remote identity, for example volter-ai/editor; not a machine path');
|
|
20
21
|
return s;
|
|
21
22
|
}
|
|
22
|
-
export function inspectCheckout(path) {
|
|
23
|
-
const raw = git(path, ['rev-parse', '--path-format=absolute', '--show-toplevel', '--git-dir', '--git-common-dir']);
|
|
23
|
+
export async function inspectCheckout(path) {
|
|
24
|
+
const raw = await git(path, ['rev-parse', '--path-format=absolute', '--show-toplevel', '--git-dir', '--git-common-dir']);
|
|
24
25
|
const [root, dir, common] = raw.split('\n').map(p => realpathSync(resolve(path, p)));
|
|
25
26
|
// The repository the checkout declares (remote.origin.url), not where a URL rewrite (insteadOf: a mirror, a proxy, a
|
|
26
27
|
// World's twin) sends its transport.
|
|
27
|
-
const remote = git(root, ['config', '--get', 'remote.origin.url'], true);
|
|
28
|
-
return { path: realpathSync(path), root, linked: dir !== common, repository: remote ? repositoryId(remote) : null, branch: git(root, ['branch', '--show-current']) || null };
|
|
28
|
+
const remote = await git(root, ['config', '--get', 'remote.origin.url'], true);
|
|
29
|
+
return { path: realpathSync(path), root, linked: dir !== common, repository: remote ? repositoryId(remote) : null, branch: (await git(root, ['branch', '--show-current'])) || null };
|
|
29
30
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/teams",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.25",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Volter Teams, the neutral team plane: machine identity and daemon core, the local door and server link, admission from machine grants, product doors, and the Teams server's neutral routes (company RFC 0008).",
|
|
6
6
|
"license": "MIT",
|