@pulsarinteractive/geniustasker 0.1.0-beta.11 → 0.1.0-beta.12
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/CHANGELOG.md +16 -0
- package/README.md +7 -1
- package/docs/ARCHITECTURE.md +15 -13
- package/docs/CLI.md +109 -1
- package/docs/INTEGRATIONS.md +2 -2
- package/docs/MEMORY.md +9 -0
- package/docs/WORKFLOWS.md +14 -0
- package/examples/codex.toml +1 -1
- package/examples/mcp.json +1 -1
- package/mcp.json +1 -1
- package/package.json +2 -2
- package/plugin.json +1 -1
- package/remote/tool-catalog.json +112 -1
- package/remote/workflows.json +33 -2
- package/skills/geniustasker/SKILL.md +5 -0
- package/skills/geniustasker/references/agent-runs.md +144 -0
- package/skills/geniustasker/references/host-events.md +116 -0
- package/skills/geniustasker/references/importance.md +90 -0
- package/skills/geniustasker/references/protocols.md +156 -0
- package/skills/geniustasker/references/updates.md +31 -0
- package/skills/geniustasker-graph/SKILL.md +10 -0
- package/skills/geniustasker-memory/SKILL.md +15 -5
- package/skills/geniustasker-memory/references/knowledge-workflows.md +42 -0
- package/skills/geniustasker-planning/SKILL.md +6 -1
- package/src/cli.mjs +69 -4
- package/src/command-catalog.mjs +753 -562
- package/src/command-input-schemas.d.mts +8 -0
- package/src/command-input-schemas.mjs +470 -0
- package/src/commands.mjs +58 -22
- package/src/mcp.mjs +31 -3
- package/src/protocols.mjs +122 -0
- package/src/run-events.mjs +145 -0
- package/src/update-runtime.mjs +169 -0
- package/src/update.mjs +306 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
import { fail } from './errors.mjs';
|
|
3
|
+
|
|
4
|
+
const uuid = z
|
|
5
|
+
.string()
|
|
6
|
+
.regex(/^[a-f0-9]{8}-[a-f0-9]{4}-[1-8][a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$/);
|
|
7
|
+
const scope = z
|
|
8
|
+
.string()
|
|
9
|
+
.max(128)
|
|
10
|
+
.regex(/^project:[A-Za-z0-9_-]+$/);
|
|
11
|
+
const digest = z.string().regex(/^[a-f0-9]{64}$/);
|
|
12
|
+
const primitive = z.union([
|
|
13
|
+
z.string().max(2000),
|
|
14
|
+
z.number().min(-Number.MAX_SAFE_INTEGER).max(Number.MAX_SAFE_INTEGER),
|
|
15
|
+
z.boolean(),
|
|
16
|
+
]);
|
|
17
|
+
export const protocolPreviewSchema = z
|
|
18
|
+
.object({
|
|
19
|
+
scope,
|
|
20
|
+
protocolVersionId: uuid,
|
|
21
|
+
bindings: z
|
|
22
|
+
.object({
|
|
23
|
+
instanceId: uuid,
|
|
24
|
+
scope,
|
|
25
|
+
epoch: z.string().min(1).max(128),
|
|
26
|
+
anchor: z
|
|
27
|
+
.string()
|
|
28
|
+
.max(35)
|
|
29
|
+
.regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,3})?(?:Z|[+-]\d{2}:\d{2})$/),
|
|
30
|
+
values: z
|
|
31
|
+
.record(z.string().regex(/^[a-z][a-z0-9_-]{0,47}$/), primitive)
|
|
32
|
+
.refine((value) => Object.keys(value).length <= 24),
|
|
33
|
+
})
|
|
34
|
+
.strict(),
|
|
35
|
+
after: z.number().int().min(0).max(199).optional(),
|
|
36
|
+
digest: digest.optional(),
|
|
37
|
+
})
|
|
38
|
+
.strict()
|
|
39
|
+
.refine((value) => value.scope === value.bindings.scope, {
|
|
40
|
+
message: 'The binding must use the requested scope.',
|
|
41
|
+
})
|
|
42
|
+
.refine((value) => !(value.after > 0) || !!value.digest, {
|
|
43
|
+
message: 'Continuation needs the original digest.',
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const delivery = z.object({
|
|
47
|
+
push: z.enum(['inherit', 'silent', 'request']),
|
|
48
|
+
recap: z.boolean(),
|
|
49
|
+
animation: z.enum(['inherit', 'silent', 'request']),
|
|
50
|
+
});
|
|
51
|
+
const step = z.object({
|
|
52
|
+
key: z.string().regex(/^[a-z][a-z0-9_-]{0,47}$/),
|
|
53
|
+
id: uuid,
|
|
54
|
+
title: z.string().min(3).max(200),
|
|
55
|
+
description: z.string().max(600),
|
|
56
|
+
kind: z.enum(['Epic', 'Ticket', 'Subtask']),
|
|
57
|
+
parent: uuid.nullable(),
|
|
58
|
+
dependencies: z.array(uuid).max(20),
|
|
59
|
+
owner: z.string().regex(/^[A-Za-z0-9_-]{1,128}$/),
|
|
60
|
+
dueDate: z.string().max(35).nullable(),
|
|
61
|
+
importance: z.enum(['Minor', 'Normal', 'Important', 'Critical']),
|
|
62
|
+
importanceReason: z.string().max(400),
|
|
63
|
+
delivery,
|
|
64
|
+
acceptance: z.array(z.string().min(1).max(500)).min(1).max(10),
|
|
65
|
+
});
|
|
66
|
+
const resultSchema = z.object({
|
|
67
|
+
protocolVersionId: uuid,
|
|
68
|
+
instanceId: uuid,
|
|
69
|
+
epoch: z.string().min(1).max(128),
|
|
70
|
+
digest,
|
|
71
|
+
total: z.number().int().min(1).max(200),
|
|
72
|
+
batchSize: z.literal(20),
|
|
73
|
+
steps: z.array(step).max(20),
|
|
74
|
+
nextAfter: z.number().int().min(1).max(199).nullable(),
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
/** One metered read, despite POST carrying its structured bindings. No command
|
|
78
|
+
* journal, response cache, implicit pagination, retries or task creation. */
|
|
79
|
+
export async function previewProtocol(client, input) {
|
|
80
|
+
const checked = protocolPreviewSchema.safeParse(input);
|
|
81
|
+
if (!checked.success) {
|
|
82
|
+
fail(
|
|
83
|
+
'invalid_arguments',
|
|
84
|
+
'Use a published protocol version, matching project bindings and the original digest for continuation.',
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
const request = checked.data;
|
|
88
|
+
const token = await client.accessToken();
|
|
89
|
+
const response = await client.transport.request('/api/agents/v1/protocols/preview', {
|
|
90
|
+
method: 'POST',
|
|
91
|
+
json: request,
|
|
92
|
+
token,
|
|
93
|
+
});
|
|
94
|
+
const parsed = resultSchema.safeParse(response);
|
|
95
|
+
if (!parsed.success) {
|
|
96
|
+
fail(
|
|
97
|
+
'invalid_response',
|
|
98
|
+
'The protocol preview response is invalid or exceeds its page bounds.',
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
const result = parsed.data,
|
|
102
|
+
after = request.after ?? 0,
|
|
103
|
+
end = after + result.steps.length;
|
|
104
|
+
if (
|
|
105
|
+
result.protocolVersionId !== request.protocolVersionId ||
|
|
106
|
+
result.instanceId !== request.bindings.instanceId ||
|
|
107
|
+
result.epoch !== request.bindings.epoch ||
|
|
108
|
+
(request.digest && result.digest !== request.digest) ||
|
|
109
|
+
after >= result.total ||
|
|
110
|
+
end > result.total ||
|
|
111
|
+
result.steps.length === 0 ||
|
|
112
|
+
result.nextAfter !== (end < result.total ? end : null) ||
|
|
113
|
+
new Set(result.steps.map((value) => value.id)).size !== result.steps.length ||
|
|
114
|
+
new Set(result.steps.map((value) => value.key)).size !== result.steps.length
|
|
115
|
+
) {
|
|
116
|
+
fail(
|
|
117
|
+
'invalid_response',
|
|
118
|
+
'The protocol preview does not match the requested identity, digest or page.',
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
return result;
|
|
122
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
import schemas from './command-input-schemas.mjs';
|
|
3
|
+
import { CommandJournal, commandSchema, operationIdSchema, validateCommand } from './commands.mjs';
|
|
4
|
+
import { fail } from './errors.mjs';
|
|
5
|
+
|
|
6
|
+
const claim = schemas['run.claim'].properties;
|
|
7
|
+
const report = schemas['run.checkpoint'].properties;
|
|
8
|
+
const evidence = report.evidence.items.properties;
|
|
9
|
+
const meaningful = (max) =>
|
|
10
|
+
z
|
|
11
|
+
.string()
|
|
12
|
+
.min(1)
|
|
13
|
+
.max(max)
|
|
14
|
+
.refine((value) => !!value.trim());
|
|
15
|
+
const lease = z.number().int().min(report.leaseSeconds.minimum).max(report.leaseSeconds.maximum);
|
|
16
|
+
const base = {
|
|
17
|
+
eventId: operationIdSchema,
|
|
18
|
+
occurredAt: commandSchema.shape.issuedAt,
|
|
19
|
+
scope: commandSchema.shape.scope.refine((value) => value.startsWith('project:')),
|
|
20
|
+
epoch: commandSchema.shape.epoch,
|
|
21
|
+
runId: operationIdSchema,
|
|
22
|
+
summary: meaningful(report.summary.maxLength),
|
|
23
|
+
};
|
|
24
|
+
const links = z
|
|
25
|
+
.array(
|
|
26
|
+
z
|
|
27
|
+
.object({
|
|
28
|
+
label: meaningful(evidence.label.maxLength),
|
|
29
|
+
url: meaningful(evidence.url.maxLength).refine((value) => {
|
|
30
|
+
try {
|
|
31
|
+
const url = new URL(value);
|
|
32
|
+
return (
|
|
33
|
+
url.protocol === 'https:' &&
|
|
34
|
+
!!url.hostname &&
|
|
35
|
+
!url.username &&
|
|
36
|
+
!url.password &&
|
|
37
|
+
!/\s/.test(value)
|
|
38
|
+
);
|
|
39
|
+
} catch {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
}),
|
|
43
|
+
})
|
|
44
|
+
.strict(),
|
|
45
|
+
)
|
|
46
|
+
.max(report.evidence.maxItems);
|
|
47
|
+
const details = {
|
|
48
|
+
expectedRevision: commandSchema.shape.expectedRevision.unwrap(),
|
|
49
|
+
nextSteps: z.string().max(report.nextSteps.maxLength).optional(),
|
|
50
|
+
evidence: links.optional(),
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/** An opt-in host event, not a terminal/process observer. Unknown fields are
|
|
54
|
+
* refused, so arguments, environment, raw logs and arbitrary patches cannot
|
|
55
|
+
* accidentally be forwarded through a generic host event object. */
|
|
56
|
+
export const runEventSchema = z
|
|
57
|
+
.discriminatedUnion('type', [
|
|
58
|
+
z
|
|
59
|
+
.object({
|
|
60
|
+
...base,
|
|
61
|
+
type: z.literal('started'),
|
|
62
|
+
expectedRevision: z.null(),
|
|
63
|
+
task: meaningful(claim.task.maxLength),
|
|
64
|
+
taskRevision: commandSchema.shape.expectedRevision.unwrap(),
|
|
65
|
+
leaseSeconds: lease.optional(),
|
|
66
|
+
})
|
|
67
|
+
.strict(),
|
|
68
|
+
z
|
|
69
|
+
.object({
|
|
70
|
+
...base,
|
|
71
|
+
...details,
|
|
72
|
+
type: z.enum(['checkpoint', 'waiting', 'review', 'process_exited']),
|
|
73
|
+
leaseSeconds: lease.optional(),
|
|
74
|
+
})
|
|
75
|
+
.strict(),
|
|
76
|
+
z.object({ ...base, ...details, type: z.enum(['finished', 'failed', 'cancelled']) }).strict(),
|
|
77
|
+
])
|
|
78
|
+
.superRefine((value, context) => {
|
|
79
|
+
if (['waiting', 'review', 'process_exited'].includes(value.type) && !value.nextSteps?.trim()) {
|
|
80
|
+
context.addIssue({
|
|
81
|
+
code: 'custom',
|
|
82
|
+
path: ['nextSteps'],
|
|
83
|
+
message: 'Waiting and review need an explicit next step.',
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
export const runEventToolSchema = z
|
|
88
|
+
.object({ event: runEventSchema, prepareOnly: z.boolean().optional() })
|
|
89
|
+
.strict();
|
|
90
|
+
|
|
91
|
+
export function runEventCommand(value) {
|
|
92
|
+
const parsed = runEventSchema.safeParse(value);
|
|
93
|
+
if (!parsed.success) {
|
|
94
|
+
fail(
|
|
95
|
+
'invalid_arguments',
|
|
96
|
+
'Use a documented host event with stable eventId/occurredAt, current run revision and a bounded factual summary. Waiting/review need nextSteps; do not include process arguments, environment or logs.',
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
const event = parsed.data;
|
|
100
|
+
const state = {
|
|
101
|
+
checkpoint: 'Working',
|
|
102
|
+
waiting: 'Waiting',
|
|
103
|
+
review: 'NeedsReview',
|
|
104
|
+
process_exited: 'NeedsReview',
|
|
105
|
+
finished: 'Completed',
|
|
106
|
+
failed: 'Failed',
|
|
107
|
+
cancelled: 'Cancelled',
|
|
108
|
+
}[event.type];
|
|
109
|
+
const kind =
|
|
110
|
+
event.type === 'started'
|
|
111
|
+
? 'run.claim'
|
|
112
|
+
: ['finished', 'failed', 'cancelled'].includes(event.type)
|
|
113
|
+
? 'run.finish'
|
|
114
|
+
: 'run.checkpoint';
|
|
115
|
+
const data =
|
|
116
|
+
event.type === 'started'
|
|
117
|
+
? { task: event.task, taskRevision: event.taskRevision, summary: event.summary }
|
|
118
|
+
: {
|
|
119
|
+
state,
|
|
120
|
+
summary: event.summary,
|
|
121
|
+
...(event.nextSteps !== undefined ? { nextSteps: event.nextSteps } : {}),
|
|
122
|
+
...(event.evidence !== undefined ? { evidence: event.evidence } : {}),
|
|
123
|
+
};
|
|
124
|
+
if (event.leaseSeconds !== undefined) {
|
|
125
|
+
data.leaseSeconds = event.leaseSeconds;
|
|
126
|
+
}
|
|
127
|
+
return validateCommand({
|
|
128
|
+
operationId: event.eventId,
|
|
129
|
+
issuedAt: event.occurredAt,
|
|
130
|
+
scope: event.scope,
|
|
131
|
+
epoch: event.epoch,
|
|
132
|
+
id: event.runId,
|
|
133
|
+
expectedRevision: event.expectedRevision,
|
|
134
|
+
kind,
|
|
135
|
+
data,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** Exactly one explicit invocation. No reads/rebase/retry loop or subprocess. */
|
|
140
|
+
export async function reportRunEvent(client, value, { prepareOnly = false } = {}) {
|
|
141
|
+
const command = runEventCommand(value),
|
|
142
|
+
journal = new CommandJournal(client);
|
|
143
|
+
const result = await (prepareOnly ? journal.prepareExact(command) : journal.execute(command));
|
|
144
|
+
return { eventId: command.operationId, kind: command.kind, ...result };
|
|
145
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { constants, unlinkSync } from 'node:fs';
|
|
2
|
+
import { lstat, mkdir, open, opendir, realpath, rmdir, unlink } from 'node:fs/promises';
|
|
3
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
4
|
+
import { homedir } from 'node:os';
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
7
|
+
import { fail } from './errors.mjs';
|
|
8
|
+
|
|
9
|
+
const installation = fileURLToPath(new URL('../', import.meta.url));
|
|
10
|
+
// The package's canonical path separates global, npx and source installations.
|
|
11
|
+
// This directory never contains account IDs, credentials or operation bodies.
|
|
12
|
+
export async function runtimePath(packageDirectory = installation) {
|
|
13
|
+
const path = await realpath(packageDirectory);
|
|
14
|
+
const key = createHash('sha256').update(path).digest('hex').slice(0, 24);
|
|
15
|
+
return join(homedir(), '.cache', 'geniustasker', 'cli-runtime', key);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function busy() {
|
|
19
|
+
fail('update_runtime_busy', 'Another GeniusTasker process or installer is active.', {
|
|
20
|
+
status: 409,
|
|
21
|
+
remediation:
|
|
22
|
+
'Let CLI commands finish and close local MCP servers before updating. Retry the same saved operation after restarting; do not remove its journal. An interrupted installer leaves install.lock; remove that empty directory only after all clients and npm installers have stopped.',
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
async function privateDirectory(path) {
|
|
26
|
+
await mkdir(path, { recursive: true, mode: 0o700 });
|
|
27
|
+
const info = await lstat(path);
|
|
28
|
+
if (
|
|
29
|
+
!info.isDirectory() ||
|
|
30
|
+
info.isSymbolicLink() ||
|
|
31
|
+
(process.getuid && info.uid !== process.getuid()) ||
|
|
32
|
+
(process.platform !== 'win32' && info.mode & 0o077)
|
|
33
|
+
) {
|
|
34
|
+
fail(
|
|
35
|
+
'unsafe_update_runtime',
|
|
36
|
+
'The local update runtime directory must be private and owned by you.',
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
async function exists(path) {
|
|
41
|
+
try {
|
|
42
|
+
await lstat(path);
|
|
43
|
+
return true;
|
|
44
|
+
} catch (error) {
|
|
45
|
+
if (error.code === 'ENOENT') {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
throw error;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Readers register before checking the writer barrier. Writers create that
|
|
53
|
+
* barrier before checking readers. Every interleaving either observes a reader
|
|
54
|
+
* or rejects it before work begins; regular commands can still run concurrently.
|
|
55
|
+
*/
|
|
56
|
+
export async function acquireRuntime(directory = runtimePath()) {
|
|
57
|
+
directory = await directory;
|
|
58
|
+
await privateDirectory(directory);
|
|
59
|
+
const active = join(directory, 'active');
|
|
60
|
+
await privateDirectory(active);
|
|
61
|
+
const path = join(active, `${process.pid}-${randomUUID()}.lock`);
|
|
62
|
+
const handle = await open(path, constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL, 0o600);
|
|
63
|
+
await handle.close();
|
|
64
|
+
const cleanup = () => {
|
|
65
|
+
try {
|
|
66
|
+
unlinkSync(path);
|
|
67
|
+
} catch {
|
|
68
|
+
/* Dead-process records are reclaimed on install. */
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
process.once('exit', cleanup);
|
|
72
|
+
let released = false;
|
|
73
|
+
const release = async () => {
|
|
74
|
+
if (released) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
released = true;
|
|
78
|
+
process.removeListener('exit', cleanup);
|
|
79
|
+
await unlink(path).catch((error) => {
|
|
80
|
+
if (error.code !== 'ENOENT') {
|
|
81
|
+
throw error;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
try {
|
|
86
|
+
if (await exists(join(directory, 'install.lock'))) {
|
|
87
|
+
busy();
|
|
88
|
+
}
|
|
89
|
+
return release;
|
|
90
|
+
} catch (error) {
|
|
91
|
+
await release();
|
|
92
|
+
throw error;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function processAlive(pid) {
|
|
97
|
+
try {
|
|
98
|
+
process.kill(pid, 0);
|
|
99
|
+
return true;
|
|
100
|
+
} catch (error) {
|
|
101
|
+
return error.code !== 'ESRCH';
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
export async function acquireInstallation(directory = runtimePath()) {
|
|
105
|
+
directory = await directory;
|
|
106
|
+
await privateDirectory(directory);
|
|
107
|
+
const active = join(directory, 'active');
|
|
108
|
+
await privateDirectory(active);
|
|
109
|
+
const lock = join(directory, 'install.lock');
|
|
110
|
+
try {
|
|
111
|
+
await mkdir(lock, { mode: 0o700 });
|
|
112
|
+
} catch (error) {
|
|
113
|
+
if (error.code === 'EEXIST') {
|
|
114
|
+
busy();
|
|
115
|
+
}
|
|
116
|
+
throw error;
|
|
117
|
+
}
|
|
118
|
+
let released = false;
|
|
119
|
+
const release = async () => {
|
|
120
|
+
if (released) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
released = true;
|
|
124
|
+
await rmdir(lock);
|
|
125
|
+
};
|
|
126
|
+
try {
|
|
127
|
+
const entries = await opendir(active);
|
|
128
|
+
let count = 0;
|
|
129
|
+
for await (const entry of entries) {
|
|
130
|
+
if (++count > 256) {
|
|
131
|
+
busy();
|
|
132
|
+
}
|
|
133
|
+
const match = /^([1-9]\d*)-[a-f0-9-]{36}\.lock$/.exec(entry.name);
|
|
134
|
+
const path = join(active, entry.name);
|
|
135
|
+
let info;
|
|
136
|
+
try {
|
|
137
|
+
info = await lstat(path);
|
|
138
|
+
} catch (error) {
|
|
139
|
+
if (error.code === 'ENOENT') {
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
throw error;
|
|
143
|
+
}
|
|
144
|
+
if (
|
|
145
|
+
!match ||
|
|
146
|
+
!info.isFile() ||
|
|
147
|
+
info.isSymbolicLink() ||
|
|
148
|
+
info.nlink !== 1 ||
|
|
149
|
+
(process.getuid && info.uid !== process.getuid()) ||
|
|
150
|
+
(process.platform !== 'win32' && info.mode & 0o077) ||
|
|
151
|
+
!Number.isSafeInteger(Number(match[1])) ||
|
|
152
|
+
processAlive(Number(match[1]))
|
|
153
|
+
) {
|
|
154
|
+
busy();
|
|
155
|
+
}
|
|
156
|
+
// Unique filenames are never reused. Only positively dead processes are
|
|
157
|
+
// reclaimed; PID reuse and inaccessible processes conservatively block.
|
|
158
|
+
await unlink(path).catch((error) => {
|
|
159
|
+
if (error.code !== 'ENOENT') {
|
|
160
|
+
throw error;
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
return release;
|
|
165
|
+
} catch (error) {
|
|
166
|
+
await release();
|
|
167
|
+
throw error;
|
|
168
|
+
}
|
|
169
|
+
}
|