team-toon-tack 1.0.7 → 1.0.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "team-toon-tack",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "Linear task sync & management CLI with TOON format",
5
5
  "type": "module",
6
6
  "bin": {
package/scripts/init.ts CHANGED
@@ -177,12 +177,8 @@ async function init() {
177
177
  });
178
178
  const states = statesData.nodes;
179
179
 
180
- // Fetch current cycle
181
- const cyclesData = await selectedTeam.cycles({
182
- filter: { isActive: { eq: true } },
183
- first: 1
184
- });
185
- const currentCycle = cyclesData.nodes[0];
180
+ // Fetch current cycle using activeCycle (direct and accurate)
181
+ const currentCycle = await selectedTeam.activeCycle;
186
182
 
187
183
  // Select current user
188
184
  let currentUser = users[0];
@@ -280,7 +276,7 @@ async function init() {
280
276
  priority_order: ['urgent', 'high', 'medium', 'low', 'none'],
281
277
  current_cycle: currentCycle ? {
282
278
  id: currentCycle.id,
283
- name: currentCycle.name || 'Cycle',
279
+ name: currentCycle.name || `Cycle #${currentCycle.number}`,
284
280
  start_date: currentCycle.startsAt?.toISOString().split('T')[0] || '',
285
281
  end_date: currentCycle.endsAt?.toISOString().split('T')[0] || ''
286
282
  } : undefined,
@@ -359,7 +355,7 @@ async function init() {
359
355
  console.log(` User: ${currentUser.displayName || currentUser.name} (${currentUser.email})`);
360
356
  console.log(` Label: ${defaultLabel}`);
361
357
  if (currentCycle) {
362
- console.log(` Cycle: ${currentCycle.name}`);
358
+ console.log(` Cycle: ${currentCycle.name || `Cycle #${currentCycle.number}`}`);
363
359
  }
364
360
 
365
361
  console.log('\nNext steps:');
package/scripts/sync.ts CHANGED
@@ -33,22 +33,18 @@ Examples:
33
33
  .filter(Boolean)
34
34
  );
35
35
 
36
- // Phase 1: Fetch and update latest active cycle
36
+ // Phase 1: Fetch active cycle directly from team
37
37
  console.log('Fetching latest cycle...');
38
38
  const team = await client.team(teamId);
39
- const cycles = await team.cycles({
40
- filter: { isActive: { eq: true } },
41
- first: 1
42
- });
39
+ const activeCycle = await team.activeCycle;
43
40
 
44
- if (cycles.nodes.length === 0) {
41
+ if (!activeCycle) {
45
42
  console.error('No active cycle found.');
46
43
  process.exit(1);
47
44
  }
48
45
 
49
- const activeCycle = cycles.nodes[0];
50
46
  const cycleId = activeCycle.id;
51
- const cycleName = activeCycle.name ?? 'Cycle';
47
+ const cycleName = activeCycle.name ?? `Cycle #${activeCycle.number}`;
52
48
  const newCycleInfo: CycleInfo = {
53
49
  id: cycleId,
54
50
  name: cycleName,