trakt-tools 1.7.0 → 1.8.0

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.
@@ -2,7 +2,7 @@
2
2
  "id": "trakt-tools",
3
3
  "name": "Trakt",
4
4
  "description": "Track movies and TV shows using trakt.tv",
5
- "version": "1.7.0",
5
+ "version": "1.8.0",
6
6
  "configSchema": {
7
7
  "type": "object",
8
8
  "properties": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trakt-tools",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "description": "OpenClaw plugin for Trakt.tv - track movies and TV shows",
5
5
  "type": "module",
6
6
  "openclaw": {
package/src/index.ts CHANGED
@@ -81,6 +81,24 @@ const TOOLS: ToolDef[] = [
81
81
  ),
82
82
  }),
83
83
  },
84
+ {
85
+ name: 'trakt_history_remove',
86
+ command: 'history',
87
+ subcommand: 'remove',
88
+ description:
89
+ 'Remove movies or shows from Trakt.tv watch history (undo a mark-as-watched). Searches by title; removing a show wipes ALL its episode plays, removing a movie wipes all its watches. There is no per-watch granular removal.',
90
+ parameters: Type.Object({
91
+ titles: Type.Array(Type.String(), {
92
+ description: 'Title(s) to remove from history',
93
+ minItems: 1,
94
+ }),
95
+ type: Type.Optional(
96
+ Type.Union([Type.Literal('movie'), Type.Literal('show')], {
97
+ description: 'Content type (default: show)',
98
+ })
99
+ ),
100
+ }),
101
+ },
84
102
  {
85
103
  name: 'trakt_watchlist',
86
104
  command: 'watchlist',
@@ -114,6 +132,43 @@ const TOOLS: ToolDef[] = [
114
132
  ),
115
133
  }),
116
134
  },
135
+ {
136
+ name: 'trakt_watchlist_remove',
137
+ command: 'watchlist',
138
+ subcommand: 'remove',
139
+ description:
140
+ 'Remove movies or shows from the Trakt.tv watchlist. Searches by title and removes matches in one sync call. Accepts multiple titles. Items that were not on the list are silent no-ops (deleted_*=0).',
141
+ parameters: Type.Object({
142
+ titles: Type.Array(Type.String(), {
143
+ description: 'Title(s) to remove from the watchlist',
144
+ minItems: 1,
145
+ }),
146
+ type: Type.Optional(
147
+ Type.Union([Type.Literal('movie'), Type.Literal('show')], {
148
+ description: 'Content type (default: show)',
149
+ })
150
+ ),
151
+ }),
152
+ },
153
+ {
154
+ name: 'trakt_calendar',
155
+ command: 'calendar',
156
+ description:
157
+ 'Show upcoming episodes of shows you watch. Returns forward-looking airings within a date window. Use for proactive "what airs next?" workflows — this is the only trakt tool that returns future data.',
158
+ parameters: Type.Object({
159
+ days: Type.Optional(
160
+ Type.Number({ description: 'Number of days to look ahead (default 7)' })
161
+ ),
162
+ start: Type.Optional(
163
+ Type.String({ description: 'Start date YYYY-MM-DD (defaults to today)' })
164
+ ),
165
+ new: Type.Optional(
166
+ Type.Boolean({
167
+ description: 'Only return series premieres (S01E01 airings)',
168
+ })
169
+ ),
170
+ }),
171
+ },
117
172
  {
118
173
  name: 'trakt_progress',
119
174
  command: 'progress',
@@ -226,10 +281,15 @@ function buildCliArgs(
226
281
  }
227
282
  }
228
283
 
229
- // watchlist add: same title-array shape as history add, minus watched_at
230
- // (the watchlist API has no "added at" field — Trakt assigns listed_at
231
- // server-side at sync time).
232
- if (command === 'watchlist' && subcommand === 'add') {
284
+ // Title-array commands (watchlist add/remove, history remove) all share
285
+ // the same shape: search by title, POST the matches. Only `history add`
286
+ // needs special handling for --watched-at.
287
+ const titleArrayCommands: Array<[string, string]> = [
288
+ ['watchlist', 'add'],
289
+ ['watchlist', 'remove'],
290
+ ['history', 'remove'],
291
+ ];
292
+ if (titleArrayCommands.some(([c, s]) => c === command && s === subcommand)) {
233
293
  const titles = params.titles as string[] | undefined;
234
294
  if (titles) {
235
295
  if (params.type) args.push('--type', String(params.type));