@getfamiliar/shared 0.1.11 → 0.1.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/build/HandlerCatalog.d.ts +0 -10
- package/build/HandlerCatalog.js +8 -23
- package/build/index.d.ts +1 -1
- package/build/index.js +1 -1
- package/package.json +1 -1
|
@@ -18,16 +18,6 @@ export interface HandlerPath {
|
|
|
18
18
|
/** User-facing slash form, e.g. `/chat/telegram/index`. */
|
|
19
19
|
readonly slashPath: string;
|
|
20
20
|
}
|
|
21
|
-
/**
|
|
22
|
-
* Whether a workspace-relative path lies inside the top-level `skills/`
|
|
23
|
-
* folder. Shared by host (catalog, cron scheduler, `cron list`) and
|
|
24
|
-
* container (`HandlerFile.load`) so every side agrees that skills are
|
|
25
|
-
* never handlers.
|
|
26
|
-
*
|
|
27
|
-
* @param relativePath Workspace-relative posix path, e.g. `skills/jira-issue/SKILL.md`.
|
|
28
|
-
* @returns `true` when the first path segment is `skills`.
|
|
29
|
-
*/
|
|
30
|
-
export declare function isUnderSkillsFolder(relativePath: string): boolean;
|
|
31
21
|
/**
|
|
32
22
|
* Read-only view over the `workspace/` directory's handler files.
|
|
33
23
|
*
|
package/build/HandlerCatalog.js
CHANGED
|
@@ -2,24 +2,14 @@ import { promises as fs } from "node:fs";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { matchesAnyGlob } from "./PathGlob.js";
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* Workspace subtrees excluded from {@link HandlerCatalog.list} (cli-chat
|
|
6
|
+
* tab-completion), so `SKILL.md` recipes don't clutter the proposals.
|
|
7
|
+
* This is a listing concern only: handlers that live next to a skill
|
|
8
|
+
* (e.g. `skills/memory/save.md`, or a `skills/memory/dream.md` with a
|
|
9
|
+
* `cron:` field) are deliberately loadable, resolvable and
|
|
10
|
+
* cron-scheduled like any other handler.
|
|
9
11
|
*/
|
|
10
|
-
const
|
|
11
|
-
/**
|
|
12
|
-
* Whether a workspace-relative path lies inside the top-level `skills/`
|
|
13
|
-
* folder. Shared by host (catalog, cron scheduler, `cron list`) and
|
|
14
|
-
* container (`HandlerFile.load`) so every side agrees that skills are
|
|
15
|
-
* never handlers.
|
|
16
|
-
*
|
|
17
|
-
* @param relativePath Workspace-relative posix path, e.g. `skills/jira-issue/SKILL.md`.
|
|
18
|
-
* @returns `true` when the first path segment is `skills`.
|
|
19
|
-
*/
|
|
20
|
-
export function isUnderSkillsFolder(relativePath) {
|
|
21
|
-
return relativePath.split("/")[0] === SKILLS_FOLDER;
|
|
22
|
-
}
|
|
12
|
+
const RESERVED_TOP_DIRS = new Set(["skills"]);
|
|
23
13
|
/**
|
|
24
14
|
* Read-only view over the `workspace/` directory's handler files.
|
|
25
15
|
*
|
|
@@ -92,11 +82,6 @@ export class HandlerCatalog {
|
|
|
92
82
|
const relPosix = rel.split(path.sep).join("/");
|
|
93
83
|
const absolute = path.join(this.workspaceDir, rel);
|
|
94
84
|
if (await fileExists(absolute)) {
|
|
95
|
-
// Skills are shared recipes, never handlers — mirror the
|
|
96
|
-
// container's `HandlerFile.load` guard.
|
|
97
|
-
if (isUnderSkillsFolder(relPosix)) {
|
|
98
|
-
return null;
|
|
99
|
-
}
|
|
100
85
|
// A file under `core.writablePaths` is never a handler, even
|
|
101
86
|
// when it exists — mirror the container's `HandlerFile.load`
|
|
102
87
|
// guard so host-side callers agree it does not resolve.
|
|
@@ -125,7 +110,7 @@ async function walkMarkdown(dir, segments, out, workspaceDir, writablePathGlobs)
|
|
|
125
110
|
}
|
|
126
111
|
for (const entry of entries) {
|
|
127
112
|
if (entry.isDirectory()) {
|
|
128
|
-
if (segments.length === 0 && entry.name
|
|
113
|
+
if (segments.length === 0 && RESERVED_TOP_DIRS.has(entry.name)) {
|
|
129
114
|
continue;
|
|
130
115
|
}
|
|
131
116
|
await walkMarkdown(path.join(dir, entry.name), [...segments, entry.name], out, workspaceDir, writablePathGlobs);
|
package/build/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export type { EventFile, EventFilter, EventPatch, EventRow, EventState, NewEvent
|
|
|
11
11
|
export { EVENT_PRIORITY } from "./Event.js";
|
|
12
12
|
export { DuplicateIdempotencyKeyError, EventBus } from "./EventBus.js";
|
|
13
13
|
export { estimateTokens } from "./estimateTokens.js";
|
|
14
|
-
export { HandlerCatalog, type HandlerPath
|
|
14
|
+
export { HandlerCatalog, type HandlerPath } from "./HandlerCatalog.js";
|
|
15
15
|
export type { InferenceEventRow, InferenceOutcome, NewInferenceEvent, } from "./InferenceEvent.js";
|
|
16
16
|
export { InferenceEventBus } from "./InferenceEventBus.js";
|
|
17
17
|
export { type CreateLoggerOptions, createLogger, jsonStdoutStream, type Logger, type LogLevel, type LogStream, prettyStdoutStream, } from "./logging/Logger.js";
|
package/build/index.js
CHANGED
|
@@ -6,7 +6,7 @@ export { parseCron } from "./CronExpression.js";
|
|
|
6
6
|
export { EVENT_PRIORITY } from "./Event.js";
|
|
7
7
|
export { DuplicateIdempotencyKeyError, EventBus } from "./EventBus.js";
|
|
8
8
|
export { estimateTokens } from "./estimateTokens.js";
|
|
9
|
-
export { HandlerCatalog
|
|
9
|
+
export { HandlerCatalog } from "./HandlerCatalog.js";
|
|
10
10
|
export { InferenceEventBus } from "./InferenceEventBus.js";
|
|
11
11
|
export { createLogger, jsonStdoutStream, prettyStdoutStream, } from "./logging/Logger.js";
|
|
12
12
|
export { buildMailId, parseMailId, } from "./Mail.js";
|