Skip to content

Commit 9760499

Browse files
committed
fix: omit SDP command from skill reference
1 parent df1bc3e commit 9760499

3 files changed

Lines changed: 29 additions & 16 deletions

File tree

internal/skilldoc/generate.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,13 @@ func FenceEnd(group string) string { return fmt.Sprintf(fenceEndFmt, group) }
4444
func groupCommands(d Dump, group string) []Command {
4545
var cmds []Command
4646
for _, c := range d.Commands {
47-
if c.Group == group {
48-
cmds = append(cmds, c)
47+
if c.Group != group {
48+
continue
49+
}
50+
if c.Path == "incident sdp-request-list" {
51+
continue
4952
}
53+
cmds = append(cmds, c)
5054
}
5155
sort.Slice(cmds, func(i, j int) bool { return cmds[i].Path < cmds[j].Path })
5256
return cmds

internal/skilldoc/generate_test.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,29 @@ import (
55
"testing"
66
)
77

8+
func TestGenerateFence_ExcludesLowFrequencyCommand(t *testing.T) {
9+
10+
d := Dump{Commands: []Command{
11+
12+
{Path: "incident list", Group: "incident", Short: "List incidents"},
13+
14+
{Path: "incident sdp-request-list", Group: "incident", Short: "Get ServiceDeskPlus linked incidents"},
15+
}}
16+
17+
got := GenerateFence(d, "incident")
18+
if !strings.Contains(got, "### list") {
19+
20+
t.Fatalf("ordinary incident command missing from generated fence:\n%s", got)
21+
22+
}
23+
if strings.Contains(got, "sdp-request-list") {
24+
25+
t.Fatalf("low-frequency command must not appear in generated fence:\n%s", got)
26+
27+
}
28+
29+
}
30+
831
// generatorDump mirrors the real cligen Long shape: a Request fields block with
932
// a required enum flag, a non-required flag, and a nested --data body field.
1033
func generatorDump() Dump {

skills/flashduty/reference/incident.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -328,20 +328,6 @@ Add incident responder
328328
- `<person-ids>` (positional, required) intSlice — Member IDs to add as responders.
329329
- body-only (`--data`): notify (object)
330330

331-
### sdp-request-list
332-
Get ServiceDeskPlus linked incidents
333-
- `--asc` bool — When 'true', sort by internal record ID ascending; otherwise descending.
334-
- `--channel-ids` intSlice — Channel IDs to filter by.
335-
- `--end-time` string — Window end, Unix seconds. Must be greater than or equal to 'start_time'. Optional when 'incident_id' is provided. (min 0) Accepts a duration (7d, 24h), '+7d' for the future, 'now', a date, or Unix seconds.
336-
- `--incident-id` string — Flashduty incident ID. When set, the time window can be omitted. (≤64 chars)
337-
- `--integration-id` int64 — ServiceDeskPlus integration ID. (min 0)
338-
- `--limit` int64 — Page size. Defaults to 20; maximum 100. (0-100)
339-
- `--page` int64 — Page number starting at 1. Ignored when 'search_after_ctx' is set. (min 0)
340-
- `--request-id` string — ServiceDeskPlus request ID. (≤64 chars)
341-
- `--search-after-ctx` string — Cursor returned by the previous page.
342-
- `--start-time` string — Window start, Unix seconds. Optional when 'incident_id' is provided. (min 0) Accepts a duration (7d, 24h), '+7d' for the future, 'now', a date, or Unix seconds.
343-
- `--status` string — Synchronization status filter. · enum: success | failed
344-
345331
### similar <id>
346332
Find similar incidents
347333
- `--limit` int

0 commit comments

Comments
 (0)