@mindfoldhq/trellis 0.6.0-beta.12 → 0.6.0-beta.14
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/dist/commands/channel/adapters/codex.d.ts +8 -1
- package/dist/commands/channel/adapters/codex.d.ts.map +1 -1
- package/dist/commands/channel/adapters/codex.js +45 -12
- package/dist/commands/channel/adapters/codex.js.map +1 -1
- package/dist/commands/channel/context.d.ts +16 -0
- package/dist/commands/channel/context.d.ts.map +1 -0
- package/dist/commands/channel/context.js +83 -0
- package/dist/commands/channel/context.js.map +1 -0
- package/dist/commands/channel/create.d.ts +10 -8
- package/dist/commands/channel/create.d.ts.map +1 -1
- package/dist/commands/channel/create.js +22 -97
- package/dist/commands/channel/create.js.map +1 -1
- package/dist/commands/channel/index.d.ts.map +1 -1
- package/dist/commands/channel/index.js +117 -12
- package/dist/commands/channel/index.js.map +1 -1
- package/dist/commands/channel/list.js +14 -16
- package/dist/commands/channel/list.js.map +1 -1
- package/dist/commands/channel/messages.js +8 -10
- package/dist/commands/channel/messages.js.map +1 -1
- package/dist/commands/channel/send.d.ts.map +1 -1
- package/dist/commands/channel/send.js +15 -28
- package/dist/commands/channel/send.js.map +1 -1
- package/dist/commands/channel/store/events.d.ts +28 -64
- package/dist/commands/channel/store/events.d.ts.map +1 -1
- package/dist/commands/channel/store/events.js +27 -48
- package/dist/commands/channel/store/events.js.map +1 -1
- package/dist/commands/channel/store/filter.d.ts +2 -32
- package/dist/commands/channel/store/filter.d.ts.map +1 -1
- package/dist/commands/channel/store/filter.js +1 -62
- package/dist/commands/channel/store/filter.js.map +1 -1
- package/dist/commands/channel/store/schema.d.ts +25 -34
- package/dist/commands/channel/store/schema.d.ts.map +1 -1
- package/dist/commands/channel/store/schema.js +25 -82
- package/dist/commands/channel/store/schema.js.map +1 -1
- package/dist/commands/channel/store/thread-state.d.ts +3 -17
- package/dist/commands/channel/store/thread-state.d.ts.map +1 -1
- package/dist/commands/channel/store/thread-state.js +1 -66
- package/dist/commands/channel/store/thread-state.js.map +1 -1
- package/dist/commands/channel/text-body.d.ts +13 -0
- package/dist/commands/channel/text-body.d.ts.map +1 -0
- package/dist/commands/channel/text-body.js +47 -0
- package/dist/commands/channel/text-body.js.map +1 -0
- package/dist/commands/channel/threads.d.ts +11 -0
- package/dist/commands/channel/threads.d.ts.map +1 -1
- package/dist/commands/channel/threads.js +56 -46
- package/dist/commands/channel/threads.js.map +1 -1
- package/dist/commands/channel/title.d.ts +12 -0
- package/dist/commands/channel/title.d.ts.map +1 -0
- package/dist/commands/channel/title.js +24 -0
- package/dist/commands/channel/title.js.map +1 -0
- package/dist/migrations/manifests/0.6.0-beta.13.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.14.json +9 -0
- package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md.txt +1 -2
- package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +5 -5
- package/dist/utils/task-json.d.ts +9 -42
- package/dist/utils/task-json.d.ts.map +1 -1
- package/dist/utils/task-json.js +8 -45
- package/dist/utils/task-json.js.map +1 -1
- package/package.json +9 -8
|
@@ -1,75 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
linkedContext?: LinkedContextEntry[];
|
|
18
|
-
labels?: string[];
|
|
19
|
-
ephemeral?: boolean;
|
|
20
|
-
}
|
|
21
|
-
export interface MessageChannelEvent extends BaseChannelEvent<"message"> {
|
|
22
|
-
text?: string;
|
|
23
|
-
to?: string | string[];
|
|
24
|
-
tag?: string;
|
|
25
|
-
}
|
|
26
|
-
export interface ThreadChannelEvent extends BaseChannelEvent<"thread"> {
|
|
27
|
-
action?: ThreadAction;
|
|
28
|
-
thread: string;
|
|
29
|
-
title?: string;
|
|
30
|
-
text?: string;
|
|
31
|
-
description?: string;
|
|
32
|
-
status?: string;
|
|
33
|
-
labels?: string[];
|
|
34
|
-
assignees?: string[];
|
|
35
|
-
summary?: string;
|
|
36
|
-
linkedContext?: LinkedContextEntry[];
|
|
37
|
-
}
|
|
38
|
-
export interface SpawnedChannelEvent extends BaseChannelEvent<"spawned"> {
|
|
39
|
-
as?: string;
|
|
40
|
-
provider?: string;
|
|
41
|
-
pid?: number;
|
|
42
|
-
agent?: string;
|
|
43
|
-
files?: string[];
|
|
44
|
-
manifests?: string[];
|
|
45
|
-
}
|
|
46
|
-
export interface KilledChannelEvent extends BaseChannelEvent<"killed"> {
|
|
47
|
-
reason?: string;
|
|
48
|
-
signal?: string;
|
|
49
|
-
}
|
|
50
|
-
export interface DoneChannelEvent extends BaseChannelEvent<"done"> {
|
|
51
|
-
duration_ms?: number;
|
|
52
|
-
}
|
|
53
|
-
export interface ErrorChannelEvent extends BaseChannelEvent<"error"> {
|
|
54
|
-
message?: string;
|
|
55
|
-
}
|
|
56
|
-
export interface ProgressChannelEvent extends BaseChannelEvent<"progress"> {
|
|
57
|
-
detail?: Record<string, unknown>;
|
|
58
|
-
}
|
|
59
|
-
export type GenericChannelEvent = BaseChannelEvent<Exclude<ChannelEventKind, "create" | "message" | "thread" | "spawned" | "killed" | "done" | "error" | "progress">>;
|
|
60
|
-
export type ChannelEvent = CreateChannelEvent | MessageChannelEvent | ThreadChannelEvent | SpawnedChannelEvent | KilledChannelEvent | DoneChannelEvent | ErrorChannelEvent | ProgressChannelEvent | GenericChannelEvent;
|
|
61
|
-
export declare function isCreateEvent(ev: ChannelEvent): ev is CreateChannelEvent;
|
|
62
|
-
export declare function isThreadEvent(ev: ChannelEvent): ev is ThreadChannelEvent;
|
|
63
|
-
export declare function metadataFromCreateEvent(create: ChannelEvent | undefined): ChannelMetadata;
|
|
1
|
+
/**
|
|
2
|
+
* Channel events local module.
|
|
3
|
+
*
|
|
4
|
+
* Canonical types and reducers come from `@mindfoldhq/trellis-core`.
|
|
5
|
+
* The legacy local `appendEvent` / `readLastSeq` primitives remain
|
|
6
|
+
* here for CLI runtime callers (supervisor / spawn / kill) that still
|
|
7
|
+
* write directly to the JSONL during the Phase 5 supervisor migration.
|
|
8
|
+
*
|
|
9
|
+
* Local `appendEvent` shares the channel-level lock with core, so
|
|
10
|
+
* concurrent writes stay mutually exclusive. Core's seq sidecar
|
|
11
|
+
* self-repairs on the next core append if a CLI-runtime write lands
|
|
12
|
+
* without updating it.
|
|
13
|
+
*/
|
|
14
|
+
import { type ChannelEvent, type ChannelMetadata } from "@mindfoldhq/trellis-core/channel";
|
|
15
|
+
export { CHANNEL_EVENT_KINDS, parseChannelKind, isCreateEvent, isThreadEvent, isContextEvent, isChannelMetadataEvent, reduceChannelMetadata, } from "@mindfoldhq/trellis-core/channel";
|
|
16
|
+
export type { ChannelEvent, ChannelEventKind, CreateChannelEvent, MessageChannelEvent, ThreadChannelEvent, ContextChannelEvent, ChannelMetadataEvent, SpawnedChannelEvent, KilledChannelEvent, DoneChannelEvent, ErrorChannelEvent, ProgressChannelEvent, } from "@mindfoldhq/trellis-core/channel";
|
|
64
17
|
export declare function ensureChannelDir(name: string, project?: string): Promise<string>;
|
|
65
18
|
export declare function readLastSeq(name: string, project?: string): Promise<number>;
|
|
66
19
|
export interface AppendablePartial {
|
|
67
|
-
kind:
|
|
20
|
+
kind: ChannelEvent["kind"];
|
|
68
21
|
by: string;
|
|
69
22
|
ts?: string;
|
|
70
23
|
[extra: string]: unknown;
|
|
71
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Local channel append used by CLI runtime code (supervisor / spawn /
|
|
27
|
+
* kill) until the Phase 5 supervisor migration moves those callers to
|
|
28
|
+
* core's typed APIs. Shares the channel-level lock with core, so
|
|
29
|
+
* concurrent writes stay mutually exclusive.
|
|
30
|
+
*/
|
|
72
31
|
export declare function appendEvent(name: string, partial: AppendablePartial, project?: string): Promise<ChannelEvent>;
|
|
73
32
|
export declare function readChannelEvents(name: string, project?: string): Promise<ChannelEvent[]>;
|
|
33
|
+
/**
|
|
34
|
+
* Read projected channel metadata from disk. Delegates to the core
|
|
35
|
+
* reducer so list / messages / threads commands share projection
|
|
36
|
+
* semantics with downstream consumers.
|
|
37
|
+
*/
|
|
74
38
|
export declare function readChannelMetadata(name: string, project?: string): Promise<ChannelMetadata>;
|
|
75
39
|
//# sourceMappingURL=events.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../src/commands/channel/store/events.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../src/commands/channel/store/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,eAAe,EACrB,MAAM,kCAAkC,CAAC;AAK1C,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,cAAc,EACd,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,kCAAkC,CAAC;AAE1C,YAAY,EACV,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,kCAAkC,CAAC;AAE1C,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,CAAC,CAIjB;AAED,wBAAsB,WAAW,CAC/B,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,CAAC,CAajB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,iBAAiB,EAC1B,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,YAAY,CAAC,CAgBvB;AAED,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,YAAY,EAAE,CAAC,CAczB;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,eAAe,CAAC,CAE1B"}
|
|
@@ -1,51 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Channel events local module.
|
|
3
|
+
*
|
|
4
|
+
* Canonical types and reducers come from `@mindfoldhq/trellis-core`.
|
|
5
|
+
* The legacy local `appendEvent` / `readLastSeq` primitives remain
|
|
6
|
+
* here for CLI runtime callers (supervisor / spawn / kill) that still
|
|
7
|
+
* write directly to the JSONL during the Phase 5 supervisor migration.
|
|
8
|
+
*
|
|
9
|
+
* Local `appendEvent` shares the channel-level lock with core, so
|
|
10
|
+
* concurrent writes stay mutually exclusive. Core's seq sidecar
|
|
11
|
+
* self-repairs on the next core append if a CLI-runtime write lands
|
|
12
|
+
* without updating it.
|
|
13
|
+
*/
|
|
1
14
|
import fs from "node:fs";
|
|
2
15
|
import fsp from "node:fs/promises";
|
|
16
|
+
import { reduceChannelMetadata, } from "@mindfoldhq/trellis-core/channel";
|
|
3
17
|
import { withLock } from "./lock.js";
|
|
4
18
|
import { eventsPath, channelDir, lockPath } from "./paths.js";
|
|
5
|
-
|
|
6
|
-
export const CHANNEL_EVENT_KINDS = new Set([
|
|
7
|
-
"create",
|
|
8
|
-
"join",
|
|
9
|
-
"leave",
|
|
10
|
-
"message",
|
|
11
|
-
"thread",
|
|
12
|
-
"spawned",
|
|
13
|
-
"killed",
|
|
14
|
-
"respawned",
|
|
15
|
-
"progress",
|
|
16
|
-
"done",
|
|
17
|
-
"error",
|
|
18
|
-
"waiting",
|
|
19
|
-
"awake",
|
|
20
|
-
]);
|
|
21
|
-
export function parseChannelKind(v) {
|
|
22
|
-
if (v === undefined)
|
|
23
|
-
return undefined;
|
|
24
|
-
if (!CHANNEL_EVENT_KINDS.has(v)) {
|
|
25
|
-
throw new Error(`Invalid --kind '${v}'. Must be one of: ${[...CHANNEL_EVENT_KINDS].join(", ")}`);
|
|
26
|
-
}
|
|
27
|
-
return v;
|
|
28
|
-
}
|
|
29
|
-
export function isCreateEvent(ev) {
|
|
30
|
-
return ev.kind === "create";
|
|
31
|
-
}
|
|
32
|
-
export function isThreadEvent(ev) {
|
|
33
|
-
return ev.kind === "thread" && typeof ev.thread === "string";
|
|
34
|
-
}
|
|
35
|
-
export function metadataFromCreateEvent(create) {
|
|
36
|
-
if (!create || !isCreateEvent(create))
|
|
37
|
-
return { type: "chat" };
|
|
38
|
-
const linkedContext = asLinkedContextEntries(create.linkedContext);
|
|
39
|
-
const labels = asStringArray(create.labels);
|
|
40
|
-
return {
|
|
41
|
-
type: create.type === "thread" ? "thread" : "chat",
|
|
42
|
-
...(typeof create.description === "string"
|
|
43
|
-
? { description: create.description }
|
|
44
|
-
: {}),
|
|
45
|
-
...(linkedContext ? { linkedContext } : {}),
|
|
46
|
-
...(labels ? { labels } : {}),
|
|
47
|
-
};
|
|
48
|
-
}
|
|
19
|
+
export { CHANNEL_EVENT_KINDS, parseChannelKind, isCreateEvent, isThreadEvent, isContextEvent, isChannelMetadataEvent, reduceChannelMetadata, } from "@mindfoldhq/trellis-core/channel";
|
|
49
20
|
export async function ensureChannelDir(name, project) {
|
|
50
21
|
const dir = channelDir(name, project);
|
|
51
22
|
await fsp.mkdir(dir, { recursive: true, mode: 0o700 });
|
|
@@ -68,10 +39,14 @@ export async function readLastSeq(name, project) {
|
|
|
68
39
|
return 0;
|
|
69
40
|
}
|
|
70
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Local channel append used by CLI runtime code (supervisor / spawn /
|
|
44
|
+
* kill) until the Phase 5 supervisor migration moves those callers to
|
|
45
|
+
* core's typed APIs. Shares the channel-level lock with core, so
|
|
46
|
+
* concurrent writes stay mutually exclusive.
|
|
47
|
+
*/
|
|
71
48
|
export async function appendEvent(name, partial, project) {
|
|
72
49
|
await ensureChannelDir(name, project);
|
|
73
|
-
// Hold the channel-level lock so concurrent supervisors / CLIs can't
|
|
74
|
-
// race seq assignment. The read-then-append window is the hot spot.
|
|
75
50
|
return withLock(lockPath(name, project), async () => {
|
|
76
51
|
const lastSeq = await readLastSeq(name, project);
|
|
77
52
|
const event = {
|
|
@@ -101,8 +76,12 @@ export async function readChannelEvents(name, project) {
|
|
|
101
76
|
}
|
|
102
77
|
return events;
|
|
103
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Read projected channel metadata from disk. Delegates to the core
|
|
81
|
+
* reducer so list / messages / threads commands share projection
|
|
82
|
+
* semantics with downstream consumers.
|
|
83
|
+
*/
|
|
104
84
|
export async function readChannelMetadata(name, project) {
|
|
105
|
-
|
|
106
|
-
return metadataFromCreateEvent(events.find(isCreateEvent));
|
|
85
|
+
return reduceChannelMetadata(await readChannelEvents(name, project));
|
|
107
86
|
}
|
|
108
87
|
//# sourceMappingURL=events.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../../../src/commands/channel/store/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,GAAG,MAAM,kBAAkB,CAAC;AAEnC,OAAO,
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../../../src/commands/channel/store/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,MAAM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AE,OAAO,CAAC,CAAC;IAC/C,MAAM,MAAM,GAAmB,EAAE,CAAC;IAClC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QACpC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YAAE,SAAS;QAC3B,IAAI,CAAC;YACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAiB,CAAC,CAAC;QAChD,CAAC;QAAC,MAAM,CAAC;YACP,SAAS;QACX,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,IAAY,EACZ,OAAgB;IAEhB,OAAO,qBAAqB,CAAC,MAAM,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;AACvE,CAAC"}
|
|
@@ -1,33 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Wake-worthy event kinds for live waits. Passive status pings stay out
|
|
5
|
-
* unless a caller explicitly asks for non-meaningful events.
|
|
6
|
-
*/
|
|
7
|
-
export declare const MEANINGFUL_EVENT_KINDS: ReadonlySet<ChannelEventKind>;
|
|
8
|
-
export interface ChannelEventFilter {
|
|
9
|
-
/** Only events from one of these agents. */
|
|
10
|
-
from?: string[];
|
|
11
|
-
/** Only events with this kind. */
|
|
12
|
-
kind?: ChannelEventKind;
|
|
13
|
-
/** Only events with this message tag. */
|
|
14
|
-
tag?: string;
|
|
15
|
-
/**
|
|
16
|
-
* `to` filter:
|
|
17
|
-
* - "<agent>" — broadcasts pass; explicit mismatch rejects
|
|
18
|
-
* - "exclusive" — only events with explicit `to`
|
|
19
|
-
*/
|
|
20
|
-
to?: string;
|
|
21
|
-
/** The current agent; filters out self-authored events. */
|
|
22
|
-
self?: string;
|
|
23
|
-
/** Include progress events. */
|
|
24
|
-
includeProgress?: boolean;
|
|
25
|
-
/** Include passive status events such as waiting/awake. */
|
|
26
|
-
includeNonMeaningful?: boolean;
|
|
27
|
-
/** Only thread events for this thread key. */
|
|
28
|
-
thread?: string;
|
|
29
|
-
/** Only thread events with this action. */
|
|
30
|
-
action?: ThreadAction;
|
|
31
|
-
}
|
|
32
|
-
export declare function matchesEventFilter(ev: ChannelEvent, filter: ChannelEventFilter): boolean;
|
|
1
|
+
export { MEANINGFUL_EVENT_KINDS, matchesEventFilter, } from "@mindfoldhq/trellis-core/channel";
|
|
2
|
+
export type { ChannelEventFilter } from "@mindfoldhq/trellis-core/channel";
|
|
33
3
|
//# sourceMappingURL=filter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../../../src/commands/channel/store/filter.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../../../src/commands/channel/store/filter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,kCAAkC,CAAC;AAE1C,YAAY,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC"}
|
|
@@ -1,63 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Wake-worthy event kinds for live waits. Passive status pings stay out
|
|
4
|
-
* unless a caller explicitly asks for non-meaningful events.
|
|
5
|
-
*/
|
|
6
|
-
export const MEANINGFUL_EVENT_KINDS = new Set([
|
|
7
|
-
"create",
|
|
8
|
-
"join",
|
|
9
|
-
"leave",
|
|
10
|
-
"message",
|
|
11
|
-
"thread",
|
|
12
|
-
"spawned",
|
|
13
|
-
"killed",
|
|
14
|
-
"respawned",
|
|
15
|
-
"done",
|
|
16
|
-
"error",
|
|
17
|
-
]);
|
|
18
|
-
export function matchesEventFilter(ev, filter) {
|
|
19
|
-
if (filter.self && ev.by === filter.self)
|
|
20
|
-
return false;
|
|
21
|
-
if (!filter.includeNonMeaningful && !MEANINGFUL_EVENT_KINDS.has(ev.kind)) {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
if (!filter.includeProgress && ev.kind === "progress")
|
|
25
|
-
return false;
|
|
26
|
-
if (filter.kind && ev.kind !== filter.kind)
|
|
27
|
-
return false;
|
|
28
|
-
if (filter.thread !== undefined) {
|
|
29
|
-
if (!isThreadEvent(ev))
|
|
30
|
-
return false;
|
|
31
|
-
if (ev.thread !== filter.thread)
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
if (filter.action !== undefined) {
|
|
35
|
-
if (!isThreadEvent(ev))
|
|
36
|
-
return false;
|
|
37
|
-
if (ev.action !== filter.action)
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
if (filter.from && filter.from.length > 0) {
|
|
41
|
-
if (!filter.from.includes(ev.by))
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
if (filter.tag !== undefined && ev.tag !== filter.tag) {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
if (filter.to) {
|
|
48
|
-
const evTo = ev.to;
|
|
49
|
-
if (filter.to === "exclusive") {
|
|
50
|
-
if (!evTo)
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
if (!evTo)
|
|
55
|
-
return true;
|
|
56
|
-
if (Array.isArray(evTo))
|
|
57
|
-
return evTo.includes(filter.to);
|
|
58
|
-
return evTo === filter.to;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return true;
|
|
62
|
-
}
|
|
1
|
+
export { MEANINGFUL_EVENT_KINDS, matchesEventFilter, } from "@mindfoldhq/trellis-core/channel";
|
|
63
2
|
//# sourceMappingURL=filter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.js","sourceRoot":"","sources":["../../../../src/commands/channel/store/filter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"filter.js","sourceRoot":"","sources":["../../../../src/commands/channel/store/filter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,kCAAkC,CAAC"}
|
|
@@ -1,36 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
scope: ChannelScope;
|
|
19
|
-
project: string;
|
|
20
|
-
dir: string;
|
|
21
|
-
}
|
|
22
|
-
export interface ChannelMetadata {
|
|
23
|
-
type: ChannelType;
|
|
24
|
-
description?: string;
|
|
25
|
-
linkedContext?: LinkedContextEntry[];
|
|
26
|
-
labels?: string[];
|
|
27
|
-
}
|
|
28
|
-
export declare function parseChannelScope(v: string | undefined): ChannelScope | undefined;
|
|
29
|
-
export declare function parseChannelType(v: string | undefined): ChannelType;
|
|
30
|
-
export declare function parseThreadAction(v: string): ThreadAction;
|
|
31
|
-
export declare function normalizeThreadKey(v: string): string;
|
|
32
|
-
export declare function parseLinkedContext(files: string[] | undefined, raw: string[] | undefined): LinkedContextEntry[] | undefined;
|
|
1
|
+
/**
|
|
2
|
+
* Channel schema re-exports.
|
|
3
|
+
*
|
|
4
|
+
* Canonical source: `@mindfoldhq/trellis-core/channel`. This module is
|
|
5
|
+
* kept as a thin pass-through during the supervisor/wait migration so
|
|
6
|
+
* CLI runtime code (supervisor, spawn, kill, wait) can continue to
|
|
7
|
+
* import from a stable local path while command files migrate to the
|
|
8
|
+
* core public API directly.
|
|
9
|
+
*/
|
|
10
|
+
export { GLOBAL_PROJECT_KEY, CHANNEL_TYPES, THREAD_ACTIONS, parseChannelScope, parseChannelType, parseThreadAction, normalizeThreadKey, asStringArray, asContextEntries, buildContextEntries, } from "@mindfoldhq/trellis-core/channel";
|
|
11
|
+
export type { ChannelScope, ChannelType, ChannelRef, ChannelMetadata, ContextEntry, FileContextEntry, RawContextEntry, ThreadAction, EventOrigin, } from "@mindfoldhq/trellis-core/channel";
|
|
12
|
+
import type { ContextEntry } from "@mindfoldhq/trellis-core/channel";
|
|
13
|
+
/**
|
|
14
|
+
* CSV parser kept colocated with the schema for CLI command files that
|
|
15
|
+
* trim comma-separated label / target lists. Pure helper — does not
|
|
16
|
+
* touch the channel store.
|
|
17
|
+
*/
|
|
33
18
|
export declare function parseCsv(value: string | undefined): string[] | undefined;
|
|
34
|
-
|
|
35
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Legacy alias accepted by CLI flag parsers — old code calls this when
|
|
21
|
+
* processing `--linked-context-file` / `--linked-context-raw`. New code
|
|
22
|
+
* uses {@link buildContextEntries} directly.
|
|
23
|
+
*
|
|
24
|
+
* @deprecated Use buildContextEntries.
|
|
25
|
+
*/
|
|
26
|
+
export declare function parseLinkedContext(files: string[] | undefined, raw: string[] | undefined): ContextEntry[] | undefined;
|
|
36
27
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/commands/channel/store/schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/commands/channel/store/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,kCAAkC,CAAC;AAE1C,YAAY,EACV,YAAY,EACZ,WAAW,EACX,UAAU,EACV,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,WAAW,GACZ,MAAM,kCAAkC,CAAC;AAG1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAErE;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,EAAE,GAAG,SAAS,CAMxE;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EAAE,GAAG,SAAS,EAC3B,GAAG,EAAE,MAAM,EAAE,GAAG,SAAS,GACxB,YAAY,EAAE,GAAG,SAAS,CAE5B"}
|
|
@@ -1,66 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
if (v === undefined)
|
|
18
|
-
return undefined;
|
|
19
|
-
if (v !== "project" && v !== "global") {
|
|
20
|
-
throw new Error("Invalid --scope. Must be one of: project, global");
|
|
21
|
-
}
|
|
22
|
-
return v;
|
|
23
|
-
}
|
|
24
|
-
export function parseChannelType(v) {
|
|
25
|
-
if (v === undefined)
|
|
26
|
-
return "chat";
|
|
27
|
-
if (!CHANNEL_TYPES.has(v)) {
|
|
28
|
-
throw new Error("Invalid --type. Must be one of: chat, thread");
|
|
29
|
-
}
|
|
30
|
-
return v;
|
|
31
|
-
}
|
|
32
|
-
export function parseThreadAction(v) {
|
|
33
|
-
if (!THREAD_ACTIONS.has(v)) {
|
|
34
|
-
throw new Error(`Invalid thread action '${v}'. Must be one of: ${[...THREAD_ACTIONS].join(", ")}`);
|
|
35
|
-
}
|
|
36
|
-
return v;
|
|
37
|
-
}
|
|
38
|
-
export function normalizeThreadKey(v) {
|
|
39
|
-
const trimmed = v.trim();
|
|
40
|
-
if (!trimmed)
|
|
41
|
-
throw new Error("Thread key must not be empty");
|
|
42
|
-
if (!/^[A-Za-z0-9._-]+$/.test(trimmed)) {
|
|
43
|
-
throw new Error("Thread key may only contain letters, numbers, '.', '_' and '-'");
|
|
44
|
-
}
|
|
45
|
-
return trimmed;
|
|
46
|
-
}
|
|
47
|
-
export function parseLinkedContext(files, raw) {
|
|
48
|
-
const entries = [];
|
|
49
|
-
for (const file of files ?? []) {
|
|
50
|
-
const value = file.trim();
|
|
51
|
-
if (!path.isAbsolute(value)) {
|
|
52
|
-
throw new Error(`--linked-context-file must be absolute: ${file}`);
|
|
53
|
-
}
|
|
54
|
-
entries.push({ type: "file", path: value });
|
|
55
|
-
}
|
|
56
|
-
for (const text of raw ?? []) {
|
|
57
|
-
if (!text.trim()) {
|
|
58
|
-
throw new Error("--linked-context-raw must not be empty");
|
|
59
|
-
}
|
|
60
|
-
entries.push({ type: "raw", text });
|
|
61
|
-
}
|
|
62
|
-
return entries.length > 0 ? entries : undefined;
|
|
63
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Channel schema re-exports.
|
|
3
|
+
*
|
|
4
|
+
* Canonical source: `@mindfoldhq/trellis-core/channel`. This module is
|
|
5
|
+
* kept as a thin pass-through during the supervisor/wait migration so
|
|
6
|
+
* CLI runtime code (supervisor, spawn, kill, wait) can continue to
|
|
7
|
+
* import from a stable local path while command files migrate to the
|
|
8
|
+
* core public API directly.
|
|
9
|
+
*/
|
|
10
|
+
export { GLOBAL_PROJECT_KEY, CHANNEL_TYPES, THREAD_ACTIONS, parseChannelScope, parseChannelType, parseThreadAction, normalizeThreadKey, asStringArray, asContextEntries, buildContextEntries, } from "@mindfoldhq/trellis-core/channel";
|
|
11
|
+
import { buildContextEntries } from "@mindfoldhq/trellis-core/channel";
|
|
12
|
+
/**
|
|
13
|
+
* CSV parser kept colocated with the schema for CLI command files that
|
|
14
|
+
* trim comma-separated label / target lists. Pure helper — does not
|
|
15
|
+
* touch the channel store.
|
|
16
|
+
*/
|
|
64
17
|
export function parseCsv(value) {
|
|
65
18
|
const out = value
|
|
66
19
|
?.split(",")
|
|
@@ -68,24 +21,14 @@ export function parseCsv(value) {
|
|
|
68
21
|
.filter(Boolean);
|
|
69
22
|
return out && out.length > 0 ? out : undefined;
|
|
70
23
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
if (!entry || typeof entry !== "object")
|
|
81
|
-
return false;
|
|
82
|
-
const candidate = entry;
|
|
83
|
-
if (candidate.type === "file")
|
|
84
|
-
return typeof candidate.path === "string";
|
|
85
|
-
if (candidate.type === "raw")
|
|
86
|
-
return typeof candidate.text === "string";
|
|
87
|
-
return false;
|
|
88
|
-
});
|
|
89
|
-
return entries.length > 0 ? entries : undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Legacy alias accepted by CLI flag parsers — old code calls this when
|
|
26
|
+
* processing `--linked-context-file` / `--linked-context-raw`. New code
|
|
27
|
+
* uses {@link buildContextEntries} directly.
|
|
28
|
+
*
|
|
29
|
+
* @deprecated Use buildContextEntries.
|
|
30
|
+
*/
|
|
31
|
+
export function parseLinkedContext(files, raw) {
|
|
32
|
+
return buildContextEntries(files, raw);
|
|
90
33
|
}
|
|
91
34
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/commands/channel/store/schema.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/commands/channel/store/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,kCAAkC,CAAC;AAc1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAGvE;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAyB;IAChD,MAAM,GAAG,GAAG,KAAK;QACf,EAAE,KAAK,CAAC,GAAG,CAAC;SACX,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACpB,MAAM,CAAC,OAAO,CAAC,CAAC;IACnB,OAAO,GAAG,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;AACjD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAChC,KAA2B,EAC3B,GAAyB;IAEzB,OAAO,mBAAmB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -1,19 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
thread: string;
|
|
5
|
-
title?: string;
|
|
6
|
-
status: string;
|
|
7
|
-
labels: string[];
|
|
8
|
-
assignees: string[];
|
|
9
|
-
description?: string;
|
|
10
|
-
linkedContext?: LinkedContextEntry[];
|
|
11
|
-
summary?: string;
|
|
12
|
-
openedAt?: string;
|
|
13
|
-
updatedAt?: string;
|
|
14
|
-
lastSeq: number;
|
|
15
|
-
comments: number;
|
|
16
|
-
}
|
|
17
|
-
export declare function reduceThreads(events: ChannelEvent[]): ThreadState[];
|
|
1
|
+
export { reduceThreads, buildThreadAliasResolver, collectThreadTimeline, } from "@mindfoldhq/trellis-core/channel";
|
|
2
|
+
export type { ThreadState, ThreadAliasResolver, } from "@mindfoldhq/trellis-core/channel";
|
|
3
|
+
import type { ThreadState } from "@mindfoldhq/trellis-core/channel";
|
|
18
4
|
export declare function formatThreadBoard(states: ThreadState[]): string[];
|
|
19
5
|
//# sourceMappingURL=thread-state.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thread-state.d.ts","sourceRoot":"","sources":["../../../../src/commands/channel/store/thread-state.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"thread-state.d.ts","sourceRoot":"","sources":["../../../../src/commands/channel/store/thread-state.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,kCAAkC,CAAC;AAE1C,YAAY,EACV,WAAW,EACX,mBAAmB,GACpB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAEpE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,EAAE,CAcjE"}
|