jg-agent-hq 11.0.1 → 11.1.1
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 +10 -0
- package/api/README.md +1 -1
- package/dist/providers/codex/codex.js +10 -5
- package/dist/providers/codex/constants.d.ts +1 -0
- package/dist/providers/codex/constants.js +2 -0
- package/dist/providers/codex/skill-roots/constants.d.ts +1 -0
- package/dist/providers/codex/skill-roots/constants.js +2 -0
- package/dist/providers/codex/skill-roots/index.d.ts +2 -1
- package/dist/providers/codex/skill-roots/index.js +1 -1
- package/dist/providers/codex/skill-roots/skill-roots.d.ts +17 -12
- package/dist/providers/codex/skill-roots/skill-roots.js +68 -28
- package/dist/providers/codex/skill-roots/types.d.ts +8 -0
- package/dist/providers/codex/skill-roots/types.js +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 11.1.1
|
|
4
|
+
|
|
5
|
+
- Report the argument hint of every listed Codex skill whose `SKILL.md` declares a single-line `argument-hint`, whatever form its other frontmatter fields take. 11.1.0 read a listed skill's hint only when its `name` and `description` were single lines too, so a skill whose description is a YAML block, such as `description: >-`, showed no hint. A skill in the operator's extra roots still needs single-line `name` and `description` fields, which are its identity there.
|
|
6
|
+
- Store nothing new: the schema and existing databases are unchanged.
|
|
7
|
+
|
|
8
|
+
## 11.1.0
|
|
9
|
+
|
|
10
|
+
- Report each Codex skill's `argumentHint` from the `argument-hint` its `SKILL.md` declares. Codex's native skill list carries no hints, so a catalog read now reads the single-line frontmatter of the file at each listed skill's path, 8 files at a time, and of each skill in the operator's extra roots: a regular file of at most 65,536 bytes, without following a link at that path. A hint that is missing, empty, a block scalar or over 1,024 characters stays null, and a file that can't be read leaves only the hint null, without counting toward `unavailableCount`. Session and folder catalogs give a skill the same hint.
|
|
11
|
+
- Store nothing new: the schema and existing databases are unchanged.
|
|
12
|
+
|
|
3
13
|
## 11.0.1
|
|
4
14
|
|
|
5
15
|
- Credit an explicit skill the operator sends from a browser to the operator. A browser submission recorded a fingerprint only for text, so a skill's message linked to its action as a programmatic `host-action` with an unknown origin, and a client showed the operator's own skill as sent by its host. The skill's prepared invocation, the `$name args` or `/name args` the session received, now becomes the submission's fingerprint once its action is admitted, so the message reads back as `authenticated-host-action` from the operator. Skills sent before this version keep their recorded provenance.
|
package/api/README.md
CHANGED
|
@@ -314,7 +314,7 @@ Partial text uses temporary live identities until the final native message UUID
|
|
|
314
314
|
|
|
315
315
|
`skills` accepts `provider`, `workspaceRoot`, an optional managed `threadId`, optional `search`, `limit` (default 32, maximum 128) and `cursor`. The folder must be inside the allowed roots. With `threadId` it reads that controlled session's catalog, and the session must run for that provider in that folder, or the request fails with JG_AGENT_HQ_REQUEST_INVALID; it never adopts or resumes an external session. Without `threadId` it reads the catalog a session started in the folder would have, with no session: Codex lists the folder, and Claude starts a session-less read process there with the trusted additional directories, reads its initialization command list and closes it, without a user prompt or model turn. A skill's ID is derived from its provider, name and path, so a folder's catalog and a session started there give the same skill the same ID while the skills don't change, and an ID from the folder's catalog can name a skill for that session's input. Codex uses native `skills/list` for the workspace, plus the skills in the operator's Codex extra roots; Claude uses the native initialization command list, which includes explicit-only skills. Its refresh endpoint omits those skills, so HQ does not use it. Close and explicitly resume the session to refresh Claude's catalog. Inactive or unsupported sessions report `unavailable`, with no successful-empty fallback. Native discovery errors produce `partial` and an `unavailableCount`. `observedAt` records when the native inventory was observed; it stays fixed for a Claude session and is null when unavailable. `invocationPrefix` is the text that starts a skill invocation in the provider's native input, `/` for Claude and `$` for Codex, and is null when unavailable; a provider adapter supplies it with its inventory in `IProviderSkills`, from `readSkills(workspaceRoot, nativeId, call)`, which reads the folder's inventory when `nativeId` is undefined.
|
|
316
316
|
|
|
317
|
-
Rows contain an opaque `id`, native `name`, `description`, nullable `argumentHint`, `kind`, `path`, `scope`, `prerequisites` and `requiresExplicitInvocation`, plus native availability as `isEnabled`. Codex supplies skill identity, source/scope, enabled state and declared tool prerequisites. Claude supplies native command names, descriptions, argument hints and a built-in marker when available.
|
|
317
|
+
Rows contain an opaque `id`, native `name`, `description`, nullable `argumentHint`, `kind`, `path`, `scope`, `prerequisites` and `requiresExplicitInvocation`, plus native availability as `isEnabled`. Codex supplies skill identity, source/scope, enabled state and declared tool prerequisites, but no argument hints, so HQ reads each listed skill's single-line `argument-hint` frontmatter from the `SKILL.md` at its reported path, 8 files at a time: a regular file of at most 65,536 bytes, without following a link at that path. A hint that is missing, empty, a block scalar or over 1,024 characters is null, and a file HQ can't read leaves only the hint null, without counting toward `unavailableCount`. Claude supplies native command names, descriptions, argument hints and a built-in marker when available. Other missing fields are null or `kind: 'unavailable'`; HQ reads skill files only for those Codex hints and for Codex extra roots, which native discovery does not list: HQ reads each skill's single-line `name`, `description` and `argument-hint` frontmatter from `<root>/<directory>/SKILL.md`, reports it with scope `host`, skips linked directories and files, and counts unreadable entries in `unavailableCount`. A native skill with the same name takes precedence. Declared prerequisites are metadata, not proof that an integration is connected. Invocation rules remain with the CLI, including explicit-only skills.
|
|
318
318
|
|
|
319
319
|
Both native inventory interfaces are unpaged. HQ accepts at most 4,096 native rows and 1 MiB of normalized catalog metadata per read, then provides stable ID seek pages guarded by the complete inventory revision and query. A changed inventory invalidates continuation. Only metadata is read, never skill bodies or complete conversation histories. Concurrent reads of the same session, or of the same provider's folder, share their in-flight native request; Codex results are not retained as an HQ cache. Claude's native initialization metadata remains attached to its owned connection until that session closes. Native refresh and discovery caches remain provider-owned.
|
|
320
320
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Exception, isException } from 'jg-exception';
|
|
2
|
+
import { runInOrder } from 'jg-utilities';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
import { MAX_PAGE_SIZE, } from '../../contracts/index.js';
|
|
4
5
|
import { NativeIdSchema } from '../../contracts/identities/index.js';
|
|
5
6
|
import { decodeBase64Image, imageUnavailable, readImageFile } from '../../sessions/index.js';
|
|
6
|
-
import { LOADED_THREADS_PAGE_SIZE, MAX_TURN_TIME_PAGES, TURN_TIMES_PAGE_SIZE, } from './constants.js';
|
|
7
|
+
import { LOADED_THREADS_PAGE_SIZE, MAX_TURN_TIME_PAGES, SKILL_HINT_READ_CONCURRENCY, TURN_TIMES_PAGE_SIZE, } from './constants.js';
|
|
7
8
|
import { createCodexRpc } from './rpc.js';
|
|
8
9
|
import { createCodexExtensions } from './extensions/index.js';
|
|
9
10
|
import { createCodexAccounts } from './accounts/index.js';
|
|
@@ -13,7 +14,7 @@ import { NativeBucketSchema, NativeSkillsSchema, NativeItemPageSchema, NativeThr
|
|
|
13
14
|
import { toHistoryItem, toImageSources, toItemDetail, toThreadSummary, toTurnSummary, toUsageSnapshot, } from './transformers.js';
|
|
14
15
|
import { parseNative } from './validations.js';
|
|
15
16
|
import { toCodexModels } from './models/index.js';
|
|
16
|
-
import { HOST_SKILL_SCOPE, readSkillRoots, toCapabilityRoots } from './skill-roots/index.js';
|
|
17
|
+
import { HOST_SKILL_SCOPE, readSkillHint, readSkillRoots, toCapabilityRoots, } from './skill-roots/index.js';
|
|
17
18
|
import { toCodexConfiguration, toCodexServiceTier, toCodexSessionSettings, readCodexConfigurationObservation, } from './configuration/index.js';
|
|
18
19
|
/**
|
|
19
20
|
* Connects native history, account observations and explicitly admitted runtime controls.
|
|
@@ -403,6 +404,11 @@ export const createCodexProvider = async (extraSkillRoots = [], daemonLauncher =
|
|
|
403
404
|
kind: 'agent-unavailable',
|
|
404
405
|
},
|
|
405
406
|
});
|
|
407
|
+
// native discovery reports no argument hints, so HQ reads each listed skill file's own
|
|
408
|
+
const hints = await runInOrder(entry.skills, {
|
|
409
|
+
concurrency: SKILL_HINT_READ_CONCURRENCY,
|
|
410
|
+
execute: (skill) => readSkillHint(skill.path),
|
|
411
|
+
});
|
|
406
412
|
// native discovery never lists a thread's capability roots, so HQ adds its own; native wins
|
|
407
413
|
const roots = await readSkillRoots(extraSkillRoots);
|
|
408
414
|
const nativeNames = new Set(entry.skills.map((skill) => skill.name));
|
|
@@ -411,10 +417,10 @@ export const createCodexProvider = async (extraSkillRoots = [], daemonLauncher =
|
|
|
411
417
|
unavailableCount: entry.errors.length + roots.unavailableCount,
|
|
412
418
|
observedAt: Date.now(),
|
|
413
419
|
skills: [
|
|
414
|
-
...entry.skills.map((skill) => ({
|
|
420
|
+
...entry.skills.map((skill, index) => ({
|
|
415
421
|
name: skill.name,
|
|
416
422
|
description: skill.description,
|
|
417
|
-
argumentHint: null,
|
|
423
|
+
argumentHint: hints[index] ?? null,
|
|
418
424
|
kind: 'skill',
|
|
419
425
|
path: skill.path,
|
|
420
426
|
scope: skill.scope,
|
|
@@ -430,7 +436,6 @@ export const createCodexProvider = async (extraSkillRoots = [], daemonLauncher =
|
|
|
430
436
|
.filter((skill) => !nativeNames.has(skill.name))
|
|
431
437
|
.map((skill) => ({
|
|
432
438
|
...skill,
|
|
433
|
-
argumentHint: null,
|
|
434
439
|
kind: 'skill',
|
|
435
440
|
scope: HOST_SKILL_SCOPE,
|
|
436
441
|
isEnabled: true,
|
|
@@ -3,6 +3,7 @@ export declare const MAX_LOADED_THREAD_PAGES = 8;
|
|
|
3
3
|
export declare const TURN_TIMES_PAGE_SIZE = 128;
|
|
4
4
|
export declare const MAX_TURN_TIME_PAGES = 8;
|
|
5
5
|
export declare const RUNNING_TURNS_CAPACITY = 1024;
|
|
6
|
+
export declare const SKILL_HINT_READ_CONCURRENCY = 8;
|
|
6
7
|
export declare const LOST_NOTIFICATIONS: Map<string, "unknown" | "turn-started" | "turn-completed" | "approval-resolved">;
|
|
7
8
|
export declare const KNOWN_NATIVE_STATES: readonly ["notLoaded", "idle", "systemError", "active"];
|
|
8
9
|
export declare const CODEX_FAST_SERVICE_TIER = "priority";
|
|
@@ -6,6 +6,8 @@ export const TURN_TIMES_PAGE_SIZE = 128;
|
|
|
6
6
|
export const MAX_TURN_TIME_PAGES = 8;
|
|
7
7
|
// the most threads whose running turn the live events keep
|
|
8
8
|
export const RUNNING_TURNS_CAPACITY = 1024;
|
|
9
|
+
// the most skill files a catalog read reads at once for their argument hints
|
|
10
|
+
export const SKILL_HINT_READ_CONCURRENCY = 8;
|
|
9
11
|
// the lifecycle notifications whose loss a live re-check of the session makes up for
|
|
10
12
|
export const LOST_NOTIFICATIONS = new Map([
|
|
11
13
|
['turn/started', 'turn-started'],
|
|
@@ -3,5 +3,7 @@ export const LOCAL_ENVIRONMENT_ID = 'local';
|
|
|
3
3
|
// bounded inventory read from each operator-supplied root
|
|
4
4
|
export const MAX_ROOT_SKILLS = 128;
|
|
5
5
|
export const MAX_SKILL_FILE_BYTES = 65_536;
|
|
6
|
+
// the longest `argument-hint` a skill file can declare; a longer one reads as no hint
|
|
7
|
+
export const MAX_ARGUMENT_HINT_LENGTH = 1_024;
|
|
6
8
|
// catalog scope for skills HQ adds from its extra roots, which native discovery doesn't list
|
|
7
9
|
export const HOST_SKILL_SCOPE = 'host';
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
export type { IRootSkill, ISkillFrontmatter } from './types.js';
|
|
1
2
|
export { HOST_SKILL_SCOPE } from './constants.js';
|
|
2
|
-
export { parseSkillFrontmatter, readSkillRoots, toCapabilityRoots } from './skill-roots.js';
|
|
3
|
+
export { parseSkillFrontmatter, readSkillHint, readSkillRoots, toCapabilityRoots, } from './skill-roots.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// constants
|
|
2
2
|
export { HOST_SKILL_SCOPE } from './constants.js';
|
|
3
3
|
// skill roots
|
|
4
|
-
export { parseSkillFrontmatter, readSkillRoots, toCapabilityRoots } from './skill-roots.js';
|
|
4
|
+
export { parseSkillFrontmatter, readSkillHint, readSkillRoots, toCapabilityRoots, } from './skill-roots.js';
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
+
import type { IRootSkill, ISkillFrontmatter } from './types.js';
|
|
1
2
|
/**
|
|
2
|
-
* Reads a skill's single-line `name` and `
|
|
3
|
-
* skill files.
|
|
4
|
-
*
|
|
3
|
+
* Reads a skill's single-line `name`, `description` and `argument-hint` frontmatter, the only
|
|
4
|
+
* fields HQ takes from skill files. A hint that is missing, empty, a block scalar or over
|
|
5
|
+
* MAX_ARGUMENT_HINT_LENGTH characters reads as null and never rejects the skill's identity.
|
|
6
|
+
* @returns The skill's frontmatter, or null when its identity is missing or not plain single-line.
|
|
5
7
|
*/
|
|
6
|
-
export declare const parseSkillFrontmatter: (source: string) =>
|
|
7
|
-
name: string;
|
|
8
|
-
description: string;
|
|
9
|
-
} | null;
|
|
8
|
+
export declare const parseSkillFrontmatter: (source: string) => ISkillFrontmatter | null;
|
|
10
9
|
/**
|
|
11
10
|
* Builds the per-thread capability roots Codex resolves for a thread HQ starts, so HQ's skills
|
|
12
11
|
* never reach other sessions on the shared daemon.
|
|
@@ -20,16 +19,22 @@ export declare const toCapabilityRoots: (roots: string[]) => {
|
|
|
20
19
|
path: string;
|
|
21
20
|
};
|
|
22
21
|
}[];
|
|
22
|
+
/**
|
|
23
|
+
* Reads the `argument-hint` of the skill file at an absolute path, such as one native discovery
|
|
24
|
+
* lists, as `readSkillRoots` reads its files. The catalog that lists the skill supplies its
|
|
25
|
+
* identity, so the hint counts whatever form the file's other fields take, such as a description
|
|
26
|
+
* written as a YAML block. A file that can't be read leaves the skill without a hint, never
|
|
27
|
+
* without its listing.
|
|
28
|
+
* @returns A promise that resolves to the hint, or null when there is none or the file can't be
|
|
29
|
+
* read.
|
|
30
|
+
*/
|
|
31
|
+
export declare const readSkillHint: (path: string) => Promise<string | null>;
|
|
23
32
|
/**
|
|
24
33
|
* Lists the skills in operator-supplied roots, one directory per skill holding a regular
|
|
25
34
|
* `SKILL.md`. Linked directories and files are not followed.
|
|
26
35
|
* @returns The readable skills and how many entries could not be read.
|
|
27
36
|
*/
|
|
28
37
|
export declare const readSkillRoots: (roots: string[]) => Promise<{
|
|
29
|
-
skills:
|
|
30
|
-
name: string;
|
|
31
|
-
description: string;
|
|
32
|
-
path: string;
|
|
33
|
-
}[];
|
|
38
|
+
skills: IRootSkill[];
|
|
34
39
|
unavailableCount: number;
|
|
35
40
|
}>;
|
|
@@ -1,25 +1,37 @@
|
|
|
1
1
|
import { constants } from 'node:fs';
|
|
2
2
|
import { open, readdir } from 'node:fs/promises';
|
|
3
|
-
import { join } from 'node:path';
|
|
3
|
+
import { isAbsolute, join } from 'node:path';
|
|
4
4
|
import { hasErrorCode } from 'jg-exception';
|
|
5
|
-
import { LOCAL_ENVIRONMENT_ID, MAX_ROOT_SKILLS, MAX_SKILL_FILE_BYTES } from './constants.js';
|
|
5
|
+
import { LOCAL_ENVIRONMENT_ID, MAX_ARGUMENT_HINT_LENGTH, MAX_ROOT_SKILLS, MAX_SKILL_FILE_BYTES, } from './constants.js';
|
|
6
|
+
// a skill file's frontmatter block, or undefined when the file has none
|
|
7
|
+
const readFrontmatter = (source) => /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/.exec(source)?.[1];
|
|
8
|
+
// a frontmatter key's single-line value without its quotes, or null when the key is missing
|
|
9
|
+
const readField = (block, key) => {
|
|
10
|
+
const value = new RegExp(`^${key}:[ \\t]*(.*?)[ \\t]*$`, 'm').exec(block)?.[1];
|
|
11
|
+
if (value === undefined)
|
|
12
|
+
return null;
|
|
13
|
+
return /^(['"])(.*)\1$/.exec(value)?.[2] ?? value;
|
|
14
|
+
};
|
|
15
|
+
/*
|
|
16
|
+
* A frontmatter block's `argument-hint`, or null when it is missing, empty, a block scalar or over
|
|
17
|
+
* MAX_ARGUMENT_HINT_LENGTH characters. It never depends on the block's other fields.
|
|
18
|
+
*/
|
|
19
|
+
const readArgumentHint = (block) => {
|
|
20
|
+
const hint = readField(block, 'argument-hint');
|
|
21
|
+
return !hint || hint.length > MAX_ARGUMENT_HINT_LENGTH || /^[>|]/.test(hint) ? null : hint;
|
|
22
|
+
};
|
|
6
23
|
/**
|
|
7
|
-
* Reads a skill's single-line `name` and `
|
|
8
|
-
* skill files.
|
|
9
|
-
*
|
|
24
|
+
* Reads a skill's single-line `name`, `description` and `argument-hint` frontmatter, the only
|
|
25
|
+
* fields HQ takes from skill files. A hint that is missing, empty, a block scalar or over
|
|
26
|
+
* MAX_ARGUMENT_HINT_LENGTH characters reads as null and never rejects the skill's identity.
|
|
27
|
+
* @returns The skill's frontmatter, or null when its identity is missing or not plain single-line.
|
|
10
28
|
*/
|
|
11
29
|
export const parseSkillFrontmatter = (source) => {
|
|
12
|
-
const block =
|
|
30
|
+
const block = readFrontmatter(source);
|
|
13
31
|
if (block === undefined)
|
|
14
32
|
return null;
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
if (value === undefined)
|
|
18
|
-
return null;
|
|
19
|
-
return /^(['"])(.*)\1$/.exec(value)?.[2] ?? value;
|
|
20
|
-
};
|
|
21
|
-
const name = read('name');
|
|
22
|
-
const description = read('description');
|
|
33
|
+
const name = readField(block, 'name');
|
|
34
|
+
const description = readField(block, 'description');
|
|
23
35
|
if (!name ||
|
|
24
36
|
name.length > 256 ||
|
|
25
37
|
!/^[^\s\p{Cc}]+$/u.test(name) ||
|
|
@@ -27,7 +39,7 @@ export const parseSkillFrontmatter = (source) => {
|
|
|
27
39
|
description.length > 8192 ||
|
|
28
40
|
/^[>|]/.test(description))
|
|
29
41
|
return null;
|
|
30
|
-
return { name, description };
|
|
42
|
+
return { name, description, argumentHint: readArgumentHint(block) };
|
|
31
43
|
};
|
|
32
44
|
/**
|
|
33
45
|
* Builds the per-thread capability roots Codex resolves for a thread HQ starts, so HQ's skills
|
|
@@ -38,6 +50,45 @@ export const toCapabilityRoots = (roots) => roots.map((path, index) => ({
|
|
|
38
50
|
id: `jg-agent-hq-skills-${index}`,
|
|
39
51
|
location: { type: 'environment', environmentId: LOCAL_ENVIRONMENT_ID, path },
|
|
40
52
|
}));
|
|
53
|
+
/**
|
|
54
|
+
* Reads a skill file without following a link at its path: a regular file of at most
|
|
55
|
+
* MAX_SKILL_FILE_BYTES. The native error of opening or reading it, such as ENOENT when nothing is
|
|
56
|
+
* at the path, propagates for the caller to classify.
|
|
57
|
+
* @returns The file's text, or null when it is not a regular file or is too large.
|
|
58
|
+
*/
|
|
59
|
+
const readSkillFile = async (path) => {
|
|
60
|
+
const handle = await open(path, constants.O_RDONLY | constants.O_NOFOLLOW);
|
|
61
|
+
try {
|
|
62
|
+
const stats = await handle.stat();
|
|
63
|
+
if (!stats.isFile() || stats.size > MAX_SKILL_FILE_BYTES)
|
|
64
|
+
return null;
|
|
65
|
+
return await handle.readFile('utf8');
|
|
66
|
+
}
|
|
67
|
+
finally {
|
|
68
|
+
await handle.close();
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Reads the `argument-hint` of the skill file at an absolute path, such as one native discovery
|
|
73
|
+
* lists, as `readSkillRoots` reads its files. The catalog that lists the skill supplies its
|
|
74
|
+
* identity, so the hint counts whatever form the file's other fields take, such as a description
|
|
75
|
+
* written as a YAML block. A file that can't be read leaves the skill without a hint, never
|
|
76
|
+
* without its listing.
|
|
77
|
+
* @returns A promise that resolves to the hint, or null when there is none or the file can't be
|
|
78
|
+
* read.
|
|
79
|
+
*/
|
|
80
|
+
export const readSkillHint = async (path) => {
|
|
81
|
+
if (!isAbsolute(path))
|
|
82
|
+
return null;
|
|
83
|
+
try {
|
|
84
|
+
const source = await readSkillFile(path);
|
|
85
|
+
const block = source === null ? undefined : readFrontmatter(source);
|
|
86
|
+
return block === undefined ? null : readArgumentHint(block);
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
};
|
|
41
92
|
/**
|
|
42
93
|
* Lists the skills in operator-supplied roots, one directory per skill holding a regular
|
|
43
94
|
* `SKILL.md`. Linked directories and files are not followed.
|
|
@@ -63,18 +114,7 @@ export const readSkillRoots = async (roots) => {
|
|
|
63
114
|
const path = join(root, directory, 'SKILL.md');
|
|
64
115
|
let source;
|
|
65
116
|
try {
|
|
66
|
-
|
|
67
|
-
try {
|
|
68
|
-
const stats = await handle.stat();
|
|
69
|
-
if (!stats.isFile() || stats.size > MAX_SKILL_FILE_BYTES) {
|
|
70
|
-
unavailableCount += 1;
|
|
71
|
-
continue;
|
|
72
|
-
}
|
|
73
|
-
source = await handle.readFile('utf8');
|
|
74
|
-
}
|
|
75
|
-
finally {
|
|
76
|
-
await handle.close();
|
|
77
|
-
}
|
|
117
|
+
source = await readSkillFile(path);
|
|
78
118
|
}
|
|
79
119
|
catch (error) {
|
|
80
120
|
// a directory without SKILL.md is not a skill
|
|
@@ -82,7 +122,7 @@ export const readSkillRoots = async (roots) => {
|
|
|
82
122
|
unavailableCount += 1;
|
|
83
123
|
continue;
|
|
84
124
|
}
|
|
85
|
-
const parsed = parseSkillFrontmatter(source);
|
|
125
|
+
const parsed = source === null ? null : parseSkillFrontmatter(source);
|
|
86
126
|
if (parsed)
|
|
87
127
|
skills.push({ ...parsed, path });
|
|
88
128
|
else
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED