@giladbarnea/pi-simple-team 1.0.6 → 1.0.7
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/index.ts +6 -1
- package/package.json +1 -1
- package/render.ts +7 -6
- package/teamlog.ts +2 -2
package/index.ts
CHANGED
|
@@ -697,7 +697,12 @@ export default function (pi: ExtensionAPI) {
|
|
|
697
697
|
parameters: Type.Object({
|
|
698
698
|
team: Type.Optional(Type.String({ description: "Team name; optional only when exactly one team exists" })),
|
|
699
699
|
teammate: Type.Optional(Type.String({ description: "Filter to one teammate name" })),
|
|
700
|
-
kind: Type.Optional(
|
|
700
|
+
kind: Type.Optional(
|
|
701
|
+
Type.Array(Type.String({ minLength: 1 }), {
|
|
702
|
+
minItems: 1,
|
|
703
|
+
description: "Filter to any of these normalized event kinds",
|
|
704
|
+
}),
|
|
705
|
+
),
|
|
701
706
|
search: Type.Optional(Type.String({ description: "Case-insensitive substring search over summary, teammate, direction, kind, and details" })),
|
|
702
707
|
since: Type.Optional(Type.String({ description: "ISO timestamp filter; only entries at or after this time" })),
|
|
703
708
|
limit: Type.Optional(Type.Integer({ minimum: 1, maximum: 100, description: "Max rows to return, default 20, maximum 100" })),
|
package/package.json
CHANGED
package/render.ts
CHANGED
|
@@ -482,17 +482,18 @@ function actionRows(theme: ThemeLike, actions: LogAction[], roster: string[], ha
|
|
|
482
482
|
function filterStats(theme: ThemeLike, filters: Record<string, unknown>, roster: string[]): string[] {
|
|
483
483
|
const stats: string[] = [];
|
|
484
484
|
for (const [key, value] of Object.entries(filters)) {
|
|
485
|
-
|
|
485
|
+
const displayValue = Array.isArray(value) ? value.join(",") : value;
|
|
486
|
+
if (typeof displayValue !== "string" || !displayValue) continue;
|
|
486
487
|
if (key === "since") {
|
|
487
|
-
const parsed = Date.parse(
|
|
488
|
-
stats.push(theme.fg("borderMuted", `since ${Number.isFinite(parsed) ? timeOfDay(parsed) :
|
|
488
|
+
const parsed = Date.parse(displayValue);
|
|
489
|
+
stats.push(theme.fg("borderMuted", `since ${Number.isFinite(parsed) ? timeOfDay(parsed) : displayValue}`));
|
|
489
490
|
continue;
|
|
490
491
|
}
|
|
491
492
|
if (key === "teammate") {
|
|
492
|
-
stats.push(`${theme.fg("borderMuted", "teammate=")}${theme.fg(actorHueToken(
|
|
493
|
+
stats.push(`${theme.fg("borderMuted", "teammate=")}${theme.fg(actorHueToken(displayValue, roster), displayValue)}`);
|
|
493
494
|
continue;
|
|
494
495
|
}
|
|
495
|
-
stats.push(theme.fg("borderMuted", `${key}=${
|
|
496
|
+
stats.push(theme.fg("borderMuted", `${key}=${displayValue}`));
|
|
496
497
|
}
|
|
497
498
|
return stats;
|
|
498
499
|
}
|
|
@@ -617,7 +618,7 @@ function callBodyFor(tool: TeamToolName, theme: ThemeLike, args: Record<string,
|
|
|
617
618
|
}
|
|
618
619
|
if (tool === "teamlog") {
|
|
619
620
|
const filterStats = ["teammate", "kind", "search", "since", "cursor"]
|
|
620
|
-
.filter((key) => typeof args[key] === "string" && args[key])
|
|
621
|
+
.filter((key) => (typeof args[key] === "string" && args[key]) || (Array.isArray(args[key]) && args[key].length > 0))
|
|
621
622
|
.map((key) => {
|
|
622
623
|
const value = String(args[key]);
|
|
623
624
|
if (key === "teammate") return `${theme.fg("dim", "teammate=")}${theme.fg(actorHueToken(value, roster), value)}`;
|
package/teamlog.ts
CHANGED
|
@@ -36,7 +36,7 @@ export type TeamLogEntryInput = Omit<TeamLogEntry, "sequence" | "timestamp" | "e
|
|
|
36
36
|
|
|
37
37
|
export interface TeamLogFilterParams {
|
|
38
38
|
teammate?: string;
|
|
39
|
-
kind?: string;
|
|
39
|
+
kind?: string[];
|
|
40
40
|
search?: string;
|
|
41
41
|
since?: string;
|
|
42
42
|
}
|
|
@@ -118,7 +118,7 @@ export function filterTeamLog(entries: TeamLogEntry[], params: TeamLogFilterPara
|
|
|
118
118
|
const sinceThreshold = parseSince(params.since);
|
|
119
119
|
return entries.filter((entry) => {
|
|
120
120
|
if (params.teammate !== undefined && entry.teammate !== params.teammate) return false;
|
|
121
|
-
if (params.kind !== undefined &&
|
|
121
|
+
if (params.kind !== undefined && !params.kind.includes(entry.kind)) return false;
|
|
122
122
|
if (sinceThreshold !== undefined && entry.epochMilliseconds < sinceThreshold) return false;
|
|
123
123
|
if (params.search !== undefined && !matchesSearch(entry, params.search)) return false;
|
|
124
124
|
return true;
|