@wirecat/attio-cli 0.3.1 → 0.4.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  Notable changes to `@wirecat/attio-cli`. One section per version, newest first.
4
4
 
5
+ ## 0.4.0 — 24.11.2026
6
+
7
+ ### Added
8
+
9
+ - **Notes and tasks in the copy.** With the `activities` setting on, `sync` also copies the notes and tasks on the
10
+ deals, people and companies it keeps. `deals show` lists them, and `search all` finds a deal by the words of its
11
+ notes. It is off until you turn it on, and the token needs `note:read` and `task:read`. Example:
12
+ `attio work config set crm.attio:<workspace id>.activities on`. See
13
+ [notes and tasks](docs/usage.md#notes-and-tasks-on-a-deal).
14
+
5
15
  ## 0.3.1 — 23.11.2026
6
16
 
7
17
  ### Fixed
package/README.md CHANGED
@@ -193,9 +193,9 @@ More: [permissions](https://github.com/WireCatLabs/attio-cli/blob/main/docs/perm
193
193
 
194
194
  ## Limits
195
195
 
196
- - The deal commands read. Moving or closing a deal from `attio` is on the
197
- [roadmap](https://github.com/WireCatLabs/attio-cli/blob/main/docs/roadmap.md), and so are notes, tasks, custom
198
- objects, lists and a one-click sign-in.
196
+ - Adding notes and tasks with their own command, custom objects, lists and a one-click sign-in are on the
197
+ [roadmap](https://github.com/WireCatLabs/attio-cli/blob/main/docs/roadmap.md). Reading notes and tasks is in the
198
+ copy, with the `activities` setting on.
199
199
  - Only a workspace admin can make the token, and it reads the whole workspace.
200
200
  - Attio documents 100 reads and 25 writes a second
201
201
  ([rate limits](https://docs.attio.com/rest-api/guides/rate-limiting)).
package/dist/bin/attio.js CHANGED
@@ -9,7 +9,7 @@ if (
9
9
  (words[0] === "--version" || words[0] === "-V") &&
10
10
  !Object.keys(process.env).some((key) => key.endsWith("_TEST_ARGV_LOG"))
11
11
  ) {
12
- process.stdout.write("0.3.1\n")
12
+ process.stdout.write("0.4.0\n")
13
13
  } else {
14
14
  // Before the bundle compiles: the bundle's own call comes after its chunks.
15
15
  module.enableCompileCache()
@@ -28,7 +28,7 @@ if (
28
28
  : next(specifier, context),
29
29
  })
30
30
  }
31
- const chunks = ["../bundle/agent-63P427ER.js","../bundle/all-profiles-KCZGH7JK.js","../bundle/anthropic-4HCGQIHA.js","../bundle/app-server-VSYG36ER.js","../bundle/bun-CZK3ZADI.js","../bundle/bun-sqlite-CM5FSNH3.js","../bundle/decode-2W6JJN3B.js","../bundle/definitions-FODOIPM2.js","../bundle/dispatch-ZRVKJENQ.js","../bundle/dist-EM7KLEG4.js","../bundle/dist-PAKDDIBT.js","../bundle/echarts-R4BLGOSP.js","../bundle/embed-DIFO7RH4.js","../bundle/embedder-S5FKW4XZ.js","../bundle/failure-C2B7PYPJ.js","../bundle/first-screen-K6YMX3G5.js","../bundle/instructions-F22KNH4O.js","../bundle/mcp-VNOYBWW2.js","../bundle/node-KM3CUABH.js","../bundle/node-SF2NI2UT.js","../bundle/node-TLZSIHIJ.js","../bundle/node-sqlite-WH3MF6PF.js","../bundle/oauth-EWHT3YJ4.js","../bundle/open-LHEJSQCI.js","../bundle/openai-DDXBF7KV.js","../bundle/process-TEQQZ3C5.js","../bundle/program-IW3E56C2.js","../bundle/prompt-6OEYPNAI.js","../bundle/recognize-5CRXQMAQ.js","../bundle/remote-UZUYKGYQ.js","../bundle/rerank-IQ6GPSJ6.js","../bundle/schemas-7JX36UC7.js","../bundle/serve-63YMTENV.js","../bundle/server-LKXXSTXK.js","../bundle/server-WQUM4JX4.js","../bundle/sqlite-runtime-UO32UZHC.js","../bundle/state-XSRJFYSU.js","../bundle/store-A2J7I2NU.js","../bundle/store-QB5FEGT4.js","../bundle/store-maintenance-command-TOLBEUMR.js","../bundle/surface-NURI2TAG.js"]
31
+ const chunks = ["../bundle/agent-63P427ER.js","../bundle/all-profiles-KCZGH7JK.js","../bundle/anthropic-4HCGQIHA.js","../bundle/app-server-VSYG36ER.js","../bundle/bun-CZK3ZADI.js","../bundle/bun-sqlite-CM5FSNH3.js","../bundle/decode-2W6JJN3B.js","../bundle/definitions-FODOIPM2.js","../bundle/dispatch-ZRVKJENQ.js","../bundle/dist-EM7KLEG4.js","../bundle/dist-PAKDDIBT.js","../bundle/echarts-R4BLGOSP.js","../bundle/embed-DIFO7RH4.js","../bundle/embedder-S5FKW4XZ.js","../bundle/failure-C2B7PYPJ.js","../bundle/first-screen-K6YMX3G5.js","../bundle/instructions-F22KNH4O.js","../bundle/mcp-VNOYBWW2.js","../bundle/node-KM3CUABH.js","../bundle/node-SF2NI2UT.js","../bundle/node-TLZSIHIJ.js","../bundle/node-sqlite-WH3MF6PF.js","../bundle/oauth-EWHT3YJ4.js","../bundle/open-LHEJSQCI.js","../bundle/openai-DDXBF7KV.js","../bundle/process-TEQQZ3C5.js","../bundle/program-EUFRFWAE.js","../bundle/prompt-6OEYPNAI.js","../bundle/recognize-5CRXQMAQ.js","../bundle/remote-UZUYKGYQ.js","../bundle/rerank-IQ6GPSJ6.js","../bundle/schemas-7JX36UC7.js","../bundle/serve-63YMTENV.js","../bundle/server-LKXXSTXK.js","../bundle/server-WQUM4JX4.js","../bundle/sqlite-runtime-UO32UZHC.js","../bundle/state-XSRJFYSU.js","../bundle/store-A2J7I2NU.js","../bundle/store-QB5FEGT4.js","../bundle/store-maintenance-command-TOLBEUMR.js","../bundle/surface-NURI2TAG.js"]
32
32
  if (((words) => words
33
33
  .filter((word) => !word.startsWith("-"))
34
34
  .slice(0, 2)
@@ -3,7 +3,7 @@ import { createRequire as __bundleRequire } from "node:module";
3
3
  const require = __bundleRequire(import.meta.url);
4
4
  import {
5
5
  DESKTOP
6
- } from "./chunk-YN5K2P7M.js";
6
+ } from "./chunk-HYVMLDYF.js";
7
7
  import {
8
8
  installerOf
9
9
  } from "./chunk-K34B37AP.js";
@@ -177,7 +177,7 @@ var wcat = await wcatStart(DESKTOP);
177
177
  if (wcat.code !== void 0) {
178
178
  process.exitCode = wcat.code;
179
179
  } else {
180
- const { run } = await import("./program-IW3E56C2.js");
180
+ const { run } = await import("./program-EUFRFWAE.js");
181
181
  process.exitCode = await run(process.argv.slice(2));
182
182
  }
183
183
  stopCatching();
@@ -2,7 +2,7 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
 
4
4
  // dist/version.js
5
- var VERSION = "0.3.1";
5
+ var VERSION = "0.4.0";
6
6
 
7
7
  // dist/identity.js
8
8
  var PACKAGE = "@wirecat/attio-cli";
@@ -903,7 +903,7 @@ import {
903
903
  IDENTITY,
904
904
  PACKAGE,
905
905
  SKILL
906
- } from "./chunk-YN5K2P7M.js";
906
+ } from "./chunk-HYVMLDYF.js";
907
907
  import {
908
908
  installerOf
909
909
  } from "./chunk-K34B37AP.js";
@@ -1280,8 +1280,8 @@ var deliver = /* @__PURE__ */ __name(async (system, env, routes, parcel, { find,
1280
1280
  const argv = /* @__PURE__ */ __name((plain2, part2) => rendered ? renderedArgvOf(program, route, rendered, plain2, part2) : argvOf(program, route, parcel.title, report2, copy, plain2), "argv");
1281
1281
  const send = /* @__PURE__ */ __name(async (part2) => {
1282
1282
  const ran2 = await system.run(argv(false, part2), childEnv, options());
1283
- const refused = ran2.code !== 0 && ran2.code !== TIMED_OUT && (route.kind === "telegram-bot" ? codeOf(ran2.stderr) === REFUSED_CONTENT : rendered?.email !== void 0 && refusesHtmlFlag(ran2.stderr));
1284
- if (!refused)
1283
+ const refused2 = ran2.code !== 0 && ran2.code !== TIMED_OUT && (route.kind === "telegram-bot" ? codeOf(ran2.stderr) === REFUSED_CONTENT : rendered?.email !== void 0 && refusesHtmlFlag(ran2.stderr));
1284
+ if (!refused2)
1285
1285
  return { ran: ran2, fellBack: "" };
1286
1286
  return {
1287
1287
  ran: await system.run(argv(true, part2), childEnv, options(true)),
@@ -3959,9 +3959,9 @@ var guardedPress = /* @__PURE__ */ __name(async (guard, connection, { chat: chat
3959
3959
  const press = capability(connection, "pressButton", "press a bot's button");
3960
3960
  const { id: chatId } = await connection.resolve(chat2);
3961
3961
  const { row: row2, column, button } = pickButton(await buttons(chatId, message2), typed2);
3962
- const refused = REFUSED[button.kind];
3963
- if (refused)
3964
- throw new CliError("validation_error", `not pressed: "${button.text}" is a ${button.kind} button \u2014 ${refused}`);
3962
+ const refused2 = REFUSED[button.kind];
3963
+ if (refused2)
3964
+ throw new CliError("validation_error", `not pressed: "${button.text}" is a ${button.kind} button \u2014 ${refused2}`);
3965
3965
  if (button.kind !== "callback")
3966
3966
  throw new CliError("validation_error", `not pressed: "${button.text}" is a ${button.kind} button, which this CLI cannot press`);
3967
3967
  if (button.data?.startsWith(OWNER_HAND_ONLY_PREFIX))
@@ -5052,10 +5052,10 @@ Go ahead? [y/N] `);
5052
5052
  var recordedOf = /* @__PURE__ */ __name(async (app, env, profile) => {
5053
5053
  const store = await openStore({ env, command: app.command });
5054
5054
  try {
5055
- const member2 = `${app.command}:${profile}`;
5055
+ const member3 = `${app.command}:${profile}`;
5056
5056
  return {
5057
5057
  key: (await store.accounts.profiles())[app.command]?.[profile],
5058
- groups: Object.entries(await store.accounts.accountGroups()).filter(([, members]) => members.includes(member2)).map(([group]) => group)
5058
+ groups: Object.entries(await store.accounts.accountGroups()).filter(([, members]) => members.includes(member3)).map(([group]) => group)
5059
5059
  };
5060
5060
  } finally {
5061
5061
  await store.close();
@@ -5069,10 +5069,10 @@ var moveRecords = /* @__PURE__ */ __name(async (app, env, profile, next) => {
5069
5069
  await store.accounts.saveProfile(app.command, next, key);
5070
5070
  await store.accounts.forgetProfile(app.command, profile);
5071
5071
  }
5072
- const member2 = `${app.command}:${profile}`;
5072
+ const member3 = `${app.command}:${profile}`;
5073
5073
  for (const [group, members] of Object.entries(await store.accounts.accountGroups()))
5074
- if (members.includes(member2))
5075
- await store.accounts.saveAccountGroup(group, members.map((one) => one === member2 ? `${app.command}:${next}` : one));
5074
+ if (members.includes(member3))
5075
+ await store.accounts.saveAccountGroup(group, members.map((one) => one === member3 ? `${app.command}:${next}` : one));
5076
5076
  } finally {
5077
5077
  await store.close();
5078
5078
  }
@@ -15470,9 +15470,9 @@ var scopeOf4 = /* @__PURE__ */ __name((context, bot, across = {}) => {
15470
15470
  }
15471
15471
  const named3 = across.allBots ? allowed === true ? registryProfiles(bot.app, context.env) : [...allowed] : across.bots ?? [];
15472
15472
  if (allowed !== true) {
15473
- const refused = named3.filter((name3) => !allowed.includes(name3));
15474
- if (refused.length > 0) {
15475
- throw new CliError("permission_error", `profile ${profile} may read only ${allowed.join(", ") || "no other bot"} (read_other_bots) \u2014 not ${refused.join(", ")}`);
15473
+ const refused2 = named3.filter((name3) => !allowed.includes(name3));
15474
+ if (refused2.length > 0) {
15475
+ throw new CliError("permission_error", `profile ${profile} may read only ${allowed.join(", ") || "no other bot"} (read_other_bots) \u2014 not ${refused2.join(", ")}`);
15476
15476
  }
15477
15477
  }
15478
15478
  const ids = named3.filter((name3) => name3 !== profile).flatMap((name3) => {
@@ -18744,7 +18744,7 @@ var storeImportCommand = /* @__PURE__ */ __name((messenger) => changesStore(anno
18744
18744
  await store.people.savePeople(key, [file.account, ...people2]);
18745
18745
  await fill(store, key, { chats: chats2, messages });
18746
18746
  for (const [chatId, members] of Object.entries(file.members))
18747
- await store.roster.saveMembers(key, chatId, members.map((member2) => member2.id));
18747
+ await store.roster.saveMembers(key, chatId, members.map((member3) => member3.id));
18748
18748
  const after2 = await heldCounts(store, key);
18749
18749
  return {
18750
18750
  ...planned,
@@ -30511,7 +30511,85 @@ var described = /* @__PURE__ */ __name((record2, raw) => {
30511
30511
  const text4 = typeof first2?.value === "string" ? first2.value.trim() : "";
30512
30512
  return text4 ? { ...record2, metadata: { ...record2.metadata, description: { label: "Description", value: text4 } } } : record2;
30513
30513
  }, "described");
30514
+ var KINDS = { deals: "deal", people: "person", companies: "organization" };
30515
+ var NOTES_PAGE = 50;
30516
+ var TASKS_PAGE = 200;
30517
+ var member2 = /* @__PURE__ */ __name((actor) => actor?.referenced_actor_type === "workspace-member" ? actor.referenced_actor_id : actor?.type === "workspace-member" ? actor.id : null, "member");
30518
+ var noteActivity = /* @__PURE__ */ __name((note2) => {
30519
+ const at5 = Date.parse(note2.created_at);
30520
+ const kind3 = KINDS[note2.parent_object];
30521
+ return {
30522
+ externalId: `note:${note2.id.note_id}`,
30523
+ kind: "comment",
30524
+ subject: note2.title ?? "",
30525
+ body: note2.content_plaintext || null,
30526
+ done: true,
30527
+ assignee: member2(note2.created_by_actor) ?? null,
30528
+ createdAt: at5,
30529
+ updatedAt: at5,
30530
+ on: kind3 ? [{ kind: kind3, externalId: note2.parent_record_id }] : []
30531
+ };
30532
+ }, "noteActivity");
30533
+ var taskActivity = /* @__PURE__ */ __name((task, objects) => {
30534
+ const at5 = Date.parse(task.created_at);
30535
+ return {
30536
+ externalId: `task:${task.id.task_id}`,
30537
+ kind: "task",
30538
+ subject: task.content_plaintext ?? "",
30539
+ body: null,
30540
+ dueAt: task.deadline_at ? Date.parse(task.deadline_at) : null,
30541
+ done: task.is_completed,
30542
+ assignee: task.assignees.map(member2).find(Boolean) ?? null,
30543
+ createdAt: at5,
30544
+ updatedAt: task.completed_at ? Date.parse(task.completed_at) : at5,
30545
+ on: task.linked_records.flatMap((link) => {
30546
+ const kind3 = KINDS[link.target_object_id] ?? objects.get(link.target_object_id);
30547
+ return kind3 ? [{ kind: kind3, externalId: link.target_record_id }] : [];
30548
+ })
30549
+ };
30550
+ }, "taskActivity");
30551
+ var refused = /* @__PURE__ */ __name((error) => error instanceof CliError && (error.code === "permission_error" || typeof error.details?.scope === "string"), "refused");
30514
30552
  var hooks = {
30553
+ // Attio's notes and tasks lists take no time filter, so every sync reads them all, as it reads every record. A token
30554
+ // may have one of their scopes and not the other: the list it may not read is a gap, and the other is still read.
30555
+ extend: /* @__PURE__ */ __name((_base, { call }) => ({
30556
+ activities: /* @__PURE__ */ __name(async (_since, page, context) => {
30557
+ const [list2, at5] = (page ?? "notes:0").split(":");
30558
+ const offset = Number(at5);
30559
+ const query = /* @__PURE__ */ __name((limit) => ({ limit: String(limit), offset: String(offset) }), "query");
30560
+ const input = { path: {}, headers: {}, fields: {} };
30561
+ const read4 = /* @__PURE__ */ __name(async (operation, limit, scope) => {
30562
+ try {
30563
+ return (await call(operation, { ...input, query: query(limit) })).data;
30564
+ } catch (error) {
30565
+ if (!refused(error))
30566
+ throw error;
30567
+ context?.gap({ kind: "activities", scope, message: `${scope} scope missing: no ${list2} were read` });
30568
+ return null;
30569
+ }
30570
+ }, "read");
30571
+ if (list2 === "notes") {
30572
+ const data2 = await read4("getV2Notes", NOTES_PAGE, "note:read");
30573
+ const next = !data2 || data2.length < NOTES_PAGE ? "tasks:0" : `notes:${offset + NOTES_PAGE}`;
30574
+ return { items: (data2 ?? []).map(noteActivity), hasMore: true, nextCursor: next };
30575
+ }
30576
+ const data = await read4("getV2Tasks", TASKS_PAGE, "task:read");
30577
+ if (!data?.length)
30578
+ return { items: [], hasMore: false };
30579
+ context?.spend();
30580
+ const { data: types } = await call("getV2Objects", { ...input, query: {} });
30581
+ const objects = new Map(types.flatMap((one) => {
30582
+ const kind3 = KINDS[one.api_slug];
30583
+ return kind3 ? [[one.id.object_id, kind3]] : [];
30584
+ }));
30585
+ const more = data.length === TASKS_PAGE;
30586
+ return {
30587
+ items: data.map((task) => taskActivity(task, objects)),
30588
+ hasMore: more,
30589
+ ...more ? { nextCursor: `tasks:${offset + TASKS_PAGE}` } : {}
30590
+ };
30591
+ }, "activities")
30592
+ }), "extend"),
30515
30593
  after: { organization: described, person: described },
30516
30594
  // Attio's stages carry no outcome. A won one is celebrated or named so, since a workspace may turn the celebration
30517
30595
  // off; a lost one has only its title to tell it. A new workspace's deal stages are Lead, In Progress, Won 🎉 and Lost.
@@ -33631,8 +33709,8 @@ var open2 = /* @__PURE__ */ __name(async (command, { readOnly }) => {
33631
33709
  const call = serviceApiCall(sending);
33632
33710
  let source2;
33633
33711
  const crm = /* @__PURE__ */ __name(() => source2 ??= crmSourceFromManifest(SOURCE2, { api: API.manifest, call, ...HOOK_OPTIONS }), "crm");
33634
- let member2;
33635
- const self = /* @__PURE__ */ __name(() => member2 ??= call("getV2Self", { path: {}, query: {}, headers: {}, fields: {} }).then((answer2) => {
33712
+ let member3;
33713
+ const self = /* @__PURE__ */ __name(() => member3 ??= call("getV2Self", { path: {}, query: {}, headers: {}, fields: {} }).then((answer2) => {
33636
33714
  const id5 = answer2.authorized_by_workspace_member_id;
33637
33715
  return typeof id5 === "string" ? id5 : void 0;
33638
33716
  }), "self");
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAc7D,eAAO,MAAM,KAAK,EAAE,gBAanB,CAAA"}
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAqF7D,eAAO,MAAM,KAAK,EAAE,gBAuDnB,CAAA"}
package/dist/hooks.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { CliError } from "@wirecat/cli-base";
1
2
  // Attio's description is a system attribute, so the account's own fields leave it out; an agent asking about what a
2
3
  // client does finds it only here.
3
4
  const described = (record, raw) => {
@@ -7,7 +8,91 @@ const described = (record, raw) => {
7
8
  ? { ...record, metadata: { ...record.metadata, description: { label: "Description", value: text } } }
8
9
  : record;
9
10
  };
11
+ const KINDS = { deals: "deal", people: "person", companies: "organization" };
12
+ const NOTES_PAGE = 50;
13
+ const TASKS_PAGE = 200;
14
+ const member = (actor) => actor?.referenced_actor_type === "workspace-member"
15
+ ? actor.referenced_actor_id
16
+ : actor?.type === "workspace-member"
17
+ ? actor.id
18
+ : null;
19
+ const noteActivity = (note) => {
20
+ const at = Date.parse(note.created_at);
21
+ const kind = KINDS[note.parent_object];
22
+ return {
23
+ externalId: `note:${note.id.note_id}`,
24
+ kind: "comment",
25
+ subject: note.title ?? "",
26
+ body: note.content_plaintext || null,
27
+ done: true,
28
+ assignee: member(note.created_by_actor) ?? null,
29
+ createdAt: at,
30
+ updatedAt: at,
31
+ on: kind ? [{ kind, externalId: note.parent_record_id }] : [],
32
+ };
33
+ };
34
+ const taskActivity = (task, objects) => {
35
+ const at = Date.parse(task.created_at);
36
+ return {
37
+ externalId: `task:${task.id.task_id}`,
38
+ kind: "task",
39
+ subject: task.content_plaintext ?? "",
40
+ body: null,
41
+ dueAt: task.deadline_at ? Date.parse(task.deadline_at) : null,
42
+ done: task.is_completed,
43
+ assignee: task.assignees.map(member).find(Boolean) ?? null,
44
+ createdAt: at,
45
+ updatedAt: task.completed_at ? Date.parse(task.completed_at) : at,
46
+ on: task.linked_records.flatMap((link) => {
47
+ // Attio's spec calls it the object's id, and its examples give the slug.
48
+ const kind = KINDS[link.target_object_id] ?? objects.get(link.target_object_id);
49
+ return kind ? [{ kind, externalId: link.target_record_id }] : [];
50
+ }),
51
+ };
52
+ };
53
+ const refused = (error) => error instanceof CliError && (error.code === "permission_error" || typeof error.details?.scope === "string");
10
54
  export const hooks = {
55
+ // Attio's notes and tasks lists take no time filter, so every sync reads them all, as it reads every record. A token
56
+ // may have one of their scopes and not the other: the list it may not read is a gap, and the other is still read.
57
+ extend: (_base, { call }) => ({
58
+ activities: async (_since, page, context) => {
59
+ const [list, at] = (page ?? "notes:0").split(":");
60
+ const offset = Number(at);
61
+ const query = (limit) => ({ limit: String(limit), offset: String(offset) });
62
+ const input = { path: {}, headers: {}, fields: {} };
63
+ const read = async (operation, limit, scope) => {
64
+ try {
65
+ return (await call(operation, { ...input, query: query(limit) })).data;
66
+ }
67
+ catch (error) {
68
+ if (!refused(error))
69
+ throw error;
70
+ context?.gap({ kind: "activities", scope, message: `${scope} scope missing: no ${list} were read` });
71
+ return null;
72
+ }
73
+ };
74
+ if (list === "notes") {
75
+ const data = await read("getV2Notes", NOTES_PAGE, "note:read");
76
+ const next = !data || data.length < NOTES_PAGE ? "tasks:0" : `notes:${offset + NOTES_PAGE}`;
77
+ return { items: (data ?? []).map(noteActivity), hasMore: true, nextCursor: next };
78
+ }
79
+ const data = await read("getV2Tasks", TASKS_PAGE, "task:read");
80
+ if (!data?.length)
81
+ return { items: [], hasMore: false };
82
+ context?.spend();
83
+ const { data: types } = (await call("getV2Objects", { ...input, query: {} }));
84
+ const objects = new Map(types.flatMap((one) => {
85
+ const kind = KINDS[one.api_slug];
86
+ return kind ? [[one.id.object_id, kind]] : [];
87
+ }));
88
+ const more = data.length === TASKS_PAGE;
89
+ return {
90
+ items: data.map((task) => taskActivity(task, objects)),
91
+ hasMore: more,
92
+ ...(more ? { nextCursor: `tasks:${offset + TASKS_PAGE}` } : {}),
93
+ };
94
+ },
95
+ }),
11
96
  after: { organization: described, person: described },
12
97
  // Attio's stages carry no outcome. A won one is celebrated or named so, since a workspace may turn the celebration
13
98
  // off; a lost one has only its title to tell it. A new workspace's deal stages are Lead, In Progress, Won 🎉 and Lost.
package/dist/hooks.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAEA,oHAAoH;AACpH,kCAAkC;AAClC,MAAM,SAAS,GAAG,CAAkC,MAAS,EAAE,GAAY,EAAK,EAAE;IAChF,MAAM,CAAC,KAAK,CAAC,GAAG,CAAE,GAA4D,CAAC,MAAM,EAAE,WAAW,IAAI,EAAE,CAErG,CAAA;IACH,MAAM,IAAI,GAAG,OAAO,KAAK,EAAE,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IACvE,OAAO,IAAI;QACT,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,QAAQ,EAAE,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;QACr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CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;gBACtD,OAAO,EAAE,IAAI;gBACb,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,SAAS,MAAM,GAAG,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAChE,CAAA;QACH,CAAC;KACF,CAAC;IACF,KAAK,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE;IACrD,mHAAmH;IACnH,uHAAuH;IACvH,SAAS,EAAE;QACT,IAAI,EAAE;YACJ,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE;gBAC3B,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;gBACjC,IAAI,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC;oBAAE,OAAO,MAAM,CAAA;gBAC1C,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAA;YAC/C,CAAC;SACF;KACF;CACF,CAAA"}
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.3.1";
1
+ export declare const VERSION = "0.4.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = "0.3.1";
1
+ export const VERSION = "0.4.0";
2
2
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wirecat/attio-cli",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "Attio CRM: deals, people and companies for you and your AI agent",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Viacheslav Ptsarev",
@@ -49,7 +49,10 @@ unless the task says.
49
49
  - **The workspace's own attributes** are in each deal's `provider_metadata`; `fields list` names them.
50
50
  - **Missing is not absent.** A sync can be partial and still exit `0`: read `complete` and `issues`. Before you say
51
51
  something is not there, search in other words, and `sync` if the store is old.
52
- - **Anything else** (notes, tasks, lists, custom objects): `attio skill show api` lists Attio's API, one command per
52
+ - **Notes and tasks.** With the owner's `activities` setting on, `deals show` lists a deal's notes and tasks and
53
+ `search all` finds a deal by the words of its notes. Without it, or for a note on no kept deal, read them through
54
+ `api notes-list` and `api tasks-list`. Only the owner turns the setting on.
55
+ - **Anything else** (lists, custom objects): `attio skill show api` lists Attio's API, one command per
53
56
  operation: [references/api.md](references/api.md).
54
57
 
55
58
  ## Signing in