@fulldivevr/workcord-cli 1.0.0 → 1.1.1

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.
Files changed (81) hide show
  1. package/README.md +88 -30
  2. package/dist/auth.js +38 -4
  3. package/dist/cli.js +3 -1
  4. package/dist/client.js +21 -12
  5. package/dist/commands/auth.js +33 -14
  6. package/dist/commands/challenges.js +2 -7
  7. package/dist/commands/custom-agents.js +3 -8
  8. package/dist/commands/dm.js +2 -3
  9. package/dist/commands/health.js +29 -0
  10. package/dist/commands/messages.js +8 -21
  11. package/dist/commands/room-agents.js +2 -7
  12. package/dist/commands/rooms.js +24 -31
  13. package/dist/commands/users.js +4 -9
  14. package/dist/commands/whoami.js +24 -7
  15. package/dist/config.js +34 -0
  16. package/dist/generated/commands/activity.js +3 -6
  17. package/dist/generated/commands/ai.js +3 -6
  18. package/dist/generated/commands/ambassador.js +3 -6
  19. package/dist/generated/commands/apple-iap.js +4 -9
  20. package/dist/generated/commands/attribution.js +6 -15
  21. package/dist/generated/commands/auth.js +9 -24
  22. package/dist/generated/commands/challenges.js +13 -36
  23. package/dist/generated/commands/clips.js +3 -6
  24. package/dist/generated/commands/contact-match.js +7 -18
  25. package/dist/generated/commands/content-crawler.js +2 -3
  26. package/dist/generated/commands/custom-agents.js +22 -63
  27. package/dist/generated/commands/desktop-releases.js +5 -12
  28. package/dist/generated/commands/discover.js +9 -24
  29. package/dist/generated/commands/dm.js +10 -27
  30. package/dist/generated/commands/drafts.js +3 -6
  31. package/dist/generated/commands/embed.js +3 -6
  32. package/dist/generated/commands/explore.js +2 -3
  33. package/dist/generated/commands/feed.js +4 -9
  34. package/dist/generated/commands/feedback.js +2 -3
  35. package/dist/generated/commands/gamification.js +3 -6
  36. package/dist/generated/commands/google-play-iap.js +4 -9
  37. package/dist/generated/commands/internal.js +9 -24
  38. package/dist/generated/commands/interview.js +4 -9
  39. package/dist/generated/commands/invite-redirect.js +2 -3
  40. package/dist/generated/commands/jesuscord-admin.js +3 -6
  41. package/dist/generated/commands/join.js +2 -3
  42. package/dist/generated/commands/kits.js +7 -18
  43. package/dist/generated/commands/meetings.js +6 -15
  44. package/dist/generated/commands/message-folders.js +5 -12
  45. package/dist/generated/commands/messages.js +17 -48
  46. package/dist/generated/commands/one-emulator.js +2 -3
  47. package/dist/generated/commands/pdf-export.js +2 -3
  48. package/dist/generated/commands/pin-folders.js +5 -12
  49. package/dist/generated/commands/pinned-messages.js +4 -9
  50. package/dist/generated/commands/polls.js +6 -15
  51. package/dist/generated/commands/premium-feeds.js +2 -3
  52. package/dist/generated/commands/processors.js +2 -3
  53. package/dist/generated/commands/questions.js +3 -6
  54. package/dist/generated/commands/referrals.js +2 -3
  55. package/dist/generated/commands/reports.js +2 -3
  56. package/dist/generated/commands/room-a2-a.js +6 -15
  57. package/dist/generated/commands/room-agents.js +13 -36
  58. package/dist/generated/commands/room-invites.js +9 -24
  59. package/dist/generated/commands/room-owned-agent.js +3 -6
  60. package/dist/generated/commands/room-page.js +2 -3
  61. package/dist/generated/commands/rooms.js +45 -132
  62. package/dist/generated/commands/saved-messages.js +4 -9
  63. package/dist/generated/commands/saved-stories.js +7 -18
  64. package/dist/generated/commands/search.js +2 -3
  65. package/dist/generated/commands/shadow-home-agent.js +3 -6
  66. package/dist/generated/commands/shadow.js +5 -12
  67. package/dist/generated/commands/share-cards.js +4 -9
  68. package/dist/generated/commands/share.js +2 -3
  69. package/dist/generated/commands/sponsors.js +2 -3
  70. package/dist/generated/commands/stories.js +12 -33
  71. package/dist/generated/commands/story-by-id.js +2 -3
  72. package/dist/generated/commands/submissions.js +4 -9
  73. package/dist/generated/commands/subscriptions.js +8 -21
  74. package/dist/generated/commands/tips.js +3 -6
  75. package/dist/generated/commands/users.js +16 -45
  76. package/dist/generated/commands/voice-token.js +2 -3
  77. package/dist/generated/commands/well-known.js +3 -6
  78. package/dist/generated/commands/wrapped.js +2 -3
  79. package/dist/generated/index.js +0 -2
  80. package/package.json +3 -2
  81. package/dist/generated/commands/health.js +0 -32
@@ -1,4 +1,5 @@
1
1
  import { call } from "../../client.js";
2
+ import { actingUserId } from "../../auth.js";
2
3
  import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
3
4
  export function register(program) {
4
5
  const group = getOrCreateGroup(program, "room-a2-a", "RoomA2A operations");
@@ -8,9 +9,7 @@ export function register(program) {
8
9
  .description("GET /api/v1/rooms/{id}/.well-known/agent.json")
9
10
  .requiredOption("--id <value>", "id (path param)")
10
11
  .action(async (opts) => {
11
- const { as } = program.opts();
12
- if (!as)
13
- throw new Error("--as <userId> is required");
12
+ const as = actingUserId(program);
14
13
  const path = `/api/v1/rooms/${encodeURIComponent(opts.id)}/.well-known/agent.json`;
15
14
  const data = await call({ method: "GET", path, asUserId: as });
16
15
  process.stdout.write(JSON.stringify(data) + "\n");
@@ -23,9 +22,7 @@ export function register(program) {
23
22
  .requiredOption("--id <value>", "id (path param)")
24
23
  .option("--body <json>", "request body as JSON (no schema available)")
25
24
  .action(async (opts) => {
26
- const { as } = program.opts();
27
- if (!as)
28
- throw new Error("--as <userId> is required");
25
+ const as = actingUserId(program);
29
26
  const path = `/api/v1/rooms/${encodeURIComponent(opts.id)}/a2a`;
30
27
  const body = opts.body ? JSON.parse(opts.body) : undefined;
31
28
  const data = await call({ method: "POST", path, asUserId: as, body });
@@ -39,9 +36,7 @@ export function register(program) {
39
36
  .requiredOption("--id <value>", "id (path param)")
40
37
  .option("--body <json>", "request body as JSON (no schema available)")
41
38
  .action(async (opts) => {
42
- const { as } = program.opts();
43
- if (!as)
44
- throw new Error("--as <userId> is required");
39
+ const as = actingUserId(program);
45
40
  const path = `/api/v1/rooms/${encodeURIComponent(opts.id)}/a2a-keys`;
46
41
  const body = opts.body ? JSON.parse(opts.body) : undefined;
47
42
  const data = await call({ method: "POST", path, asUserId: as, body });
@@ -54,9 +49,7 @@ export function register(program) {
54
49
  .description("GET /api/v1/rooms/{id}/a2a-keys")
55
50
  .requiredOption("--id <value>", "id (path param)")
56
51
  .action(async (opts) => {
57
- const { as } = program.opts();
58
- if (!as)
59
- throw new Error("--as <userId> is required");
52
+ const as = actingUserId(program);
60
53
  const path = `/api/v1/rooms/${encodeURIComponent(opts.id)}/a2a-keys`;
61
54
  const data = await call({ method: "GET", path, asUserId: as });
62
55
  process.stdout.write(JSON.stringify(data) + "\n");
@@ -69,9 +62,7 @@ export function register(program) {
69
62
  .requiredOption("--id <value>", "id (path param)")
70
63
  .requiredOption("--key-id <value>", "keyId (path param)")
71
64
  .action(async (opts) => {
72
- const { as } = program.opts();
73
- if (!as)
74
- throw new Error("--as <userId> is required");
65
+ const as = actingUserId(program);
75
66
  const path = `/api/v1/rooms/${encodeURIComponent(opts.id)}/a2a-keys/${encodeURIComponent(opts.keyId)}`;
76
67
  const data = await call({ method: "DELETE", path, asUserId: as });
77
68
  process.stdout.write(JSON.stringify(data) + "\n");
@@ -1,6 +1,7 @@
1
1
  // Auto-generated. Do not edit by hand. Regenerate via `npm run generate`.
2
2
  import { Option } from "commander";
3
3
  import { call } from "../../client.js";
4
+ import { actingUserId } from "../../auth.js";
4
5
  import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
5
6
  export function register(program) {
6
7
  const group = getOrCreateGroup(program, "room-agents", "RoomAgents operations");
@@ -10,9 +11,7 @@ export function register(program) {
10
11
  .description("POST /api/v1/agents/preview")
11
12
  .requiredOption("--card-url <value>", "string")
12
13
  .action(async (opts) => {
13
- const { as } = program.opts();
14
- if (!as)
15
- throw new Error("--as <userId> is required");
14
+ const as = actingUserId(program);
16
15
  const path = `/api/v1/agents/preview`;
17
16
  const body = {};
18
17
  {
@@ -30,9 +29,7 @@ export function register(program) {
30
29
  .description("GET /api/v1/agents/room-agents/available")
31
30
  .option("--target-room-id <value>", "string")
32
31
  .action(async (opts) => {
33
- const { as } = program.opts();
34
- if (!as)
35
- throw new Error("--as <userId> is required");
32
+ const as = actingUserId(program);
36
33
  const path = `/api/v1/agents/room-agents/available`;
37
34
  const query = {};
38
35
  {
@@ -52,9 +49,7 @@ export function register(program) {
52
49
  .requiredOption("--source-room-id <value>", "sourceRoomId (path param)")
53
50
  .option("--body <json>", "request body as JSON (no schema available)")
54
51
  .action(async (opts) => {
55
- const { as } = program.opts();
56
- if (!as)
57
- throw new Error("--as <userId> is required");
52
+ const as = actingUserId(program);
58
53
  const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/agents/install-room-agent/${encodeURIComponent(opts.sourceRoomId)}`;
59
54
  const body = opts.body ? JSON.parse(opts.body) : undefined;
60
55
  const data = await call({ method: "POST", path, asUserId: as, body });
@@ -68,9 +63,7 @@ export function register(program) {
68
63
  .requiredOption("--source-room-id <value>", "sourceRoomId (path param)")
69
64
  .option("--body <json>", "request body as JSON (no schema available)")
70
65
  .action(async (opts) => {
71
- const { as } = program.opts();
72
- if (!as)
73
- throw new Error("--as <userId> is required");
66
+ const as = actingUserId(program);
74
67
  const path = `/api/v1/agents/room-agents/${encodeURIComponent(opts.sourceRoomId)}/start-dm`;
75
68
  const body = opts.body ? JSON.parse(opts.body) : undefined;
76
69
  const data = await call({ method: "POST", path, asUserId: as, body });
@@ -83,9 +76,7 @@ export function register(program) {
83
76
  .description("GET /api/v1/rooms/{roomId}/agents")
84
77
  .requiredOption("--room-id <value>", "roomId (path param)")
85
78
  .action(async (opts) => {
86
- const { as } = program.opts();
87
- if (!as)
88
- throw new Error("--as <userId> is required");
79
+ const as = actingUserId(program);
89
80
  const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/agents`;
90
81
  const data = await call({ method: "GET", path, asUserId: as });
91
82
  process.stdout.write(JSON.stringify(data) + "\n");
@@ -99,9 +90,7 @@ export function register(program) {
99
90
  .requiredOption("--card-url <value>", "string")
100
91
  .requiredOption("--api-key <value>", "string")
101
92
  .action(async (opts) => {
102
- const { as } = program.opts();
103
- if (!as)
104
- throw new Error("--as <userId> is required");
93
+ const as = actingUserId(program);
105
94
  const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/agents`;
106
95
  const body = {};
107
96
  {
@@ -125,9 +114,7 @@ export function register(program) {
125
114
  .requiredOption("--room-id <value>", "roomId (path param)")
126
115
  .requiredOption("--card-url <value>", "string")
127
116
  .action(async (opts) => {
128
- const { as } = program.opts();
129
- if (!as)
130
- throw new Error("--as <userId> is required");
117
+ const as = actingUserId(program);
131
118
  const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/agents/preview`;
132
119
  const body = {};
133
120
  {
@@ -154,9 +141,7 @@ export function register(program) {
154
141
  .option("--trigger-rule <value>", "string, ≤500 chars")
155
142
  .option("--priority <n>", "number")
156
143
  .action(async (opts) => {
157
- const { as } = program.opts();
158
- if (!as)
159
- throw new Error("--as <userId> is required");
144
+ const as = actingUserId(program);
160
145
  const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/agents/${encodeURIComponent(opts.agentId)}`;
161
146
  const body = {};
162
147
  {
@@ -210,9 +195,7 @@ export function register(program) {
210
195
  .requiredOption("--room-id <value>", "roomId (path param)")
211
196
  .requiredOption("--agent-id <value>", "agentId (path param)")
212
197
  .action(async (opts) => {
213
- const { as } = program.opts();
214
- if (!as)
215
- throw new Error("--as <userId> is required");
198
+ const as = actingUserId(program);
216
199
  const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/agents/${encodeURIComponent(opts.agentId)}`;
217
200
  const data = await call({ method: "DELETE", path, asUserId: as });
218
201
  process.stdout.write(JSON.stringify(data) + "\n");
@@ -225,9 +208,7 @@ export function register(program) {
225
208
  .requiredOption("--room-id <value>", "roomId (path param)")
226
209
  .requiredOption("--message <value>", "string, ≤1000 chars")
227
210
  .action(async (opts) => {
228
- const { as } = program.opts();
229
- if (!as)
230
- throw new Error("--as <userId> is required");
211
+ const as = actingUserId(program);
231
212
  const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/agents/orchestrator-test`;
232
213
  const body = {};
233
214
  {
@@ -245,9 +226,7 @@ export function register(program) {
245
226
  .description("POST /api/v1/a2a")
246
227
  .option("--body <json>", "request body as JSON (no schema available)")
247
228
  .action(async (opts) => {
248
- const { as } = program.opts();
249
- if (!as)
250
- throw new Error("--as <userId> is required");
229
+ const as = actingUserId(program);
251
230
  const path = `/api/v1/a2a`;
252
231
  const body = opts.body ? JSON.parse(opts.body) : undefined;
253
232
  const data = await call({ method: "POST", path, asUserId: as, body });
@@ -260,9 +239,7 @@ export function register(program) {
260
239
  .description("POST /api/v1/a2a/push")
261
240
  .option("--body <json>", "request body as JSON (no schema available)")
262
241
  .action(async (opts) => {
263
- const { as } = program.opts();
264
- if (!as)
265
- throw new Error("--as <userId> is required");
242
+ const as = actingUserId(program);
266
243
  const path = `/api/v1/a2a/push`;
267
244
  const body = opts.body ? JSON.parse(opts.body) : undefined;
268
245
  const data = await call({ method: "POST", path, asUserId: as, body });
@@ -1,4 +1,5 @@
1
1
  import { call } from "../../client.js";
2
+ import { actingUserId } from "../../auth.js";
2
3
  import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
3
4
  export function register(program) {
4
5
  const group = getOrCreateGroup(program, "room-invites", "RoomInvites operations");
@@ -9,9 +10,7 @@ export function register(program) {
9
10
  .requiredOption("--room-id <value>", "roomId (path param)")
10
11
  .option("--body <json>", "request body as JSON (no schema available)")
11
12
  .action(async (opts) => {
12
- const { as } = program.opts();
13
- if (!as)
14
- throw new Error("--as <userId> is required");
13
+ const as = actingUserId(program);
15
14
  const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/invite-token`;
16
15
  const body = opts.body ? JSON.parse(opts.body) : undefined;
17
16
  const data = await call({ method: "POST", path, asUserId: as, body });
@@ -24,9 +23,7 @@ export function register(program) {
24
23
  .description("POST /api/v1/users/me/app-invite")
25
24
  .option("--body <json>", "request body as JSON (no schema available)")
26
25
  .action(async (opts) => {
27
- const { as } = program.opts();
28
- if (!as)
29
- throw new Error("--as <userId> is required");
26
+ const as = actingUserId(program);
30
27
  const path = `/api/v1/users/me/app-invite`;
31
28
  const body = opts.body ? JSON.parse(opts.body) : undefined;
32
29
  const data = await call({ method: "POST", path, asUserId: as, body });
@@ -39,9 +36,7 @@ export function register(program) {
39
36
  .description("POST /api/v1/users/me/accept-app-invite")
40
37
  .option("--body <json>", "request body as JSON (no schema available)")
41
38
  .action(async (opts) => {
42
- const { as } = program.opts();
43
- if (!as)
44
- throw new Error("--as <userId> is required");
39
+ const as = actingUserId(program);
45
40
  const path = `/api/v1/users/me/accept-app-invite`;
46
41
  const body = opts.body ? JSON.parse(opts.body) : undefined;
47
42
  const data = await call({ method: "POST", path, asUserId: as, body });
@@ -55,9 +50,7 @@ export function register(program) {
55
50
  .requiredOption("--room-id <value>", "roomId (path param)")
56
51
  .option("--limit <value>", "string")
57
52
  .action(async (opts) => {
58
- const { as } = program.opts();
59
- if (!as)
60
- throw new Error("--as <userId> is required");
53
+ const as = actingUserId(program);
61
54
  const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/top-inviters`;
62
55
  const query = {};
63
56
  {
@@ -75,9 +68,7 @@ export function register(program) {
75
68
  .description("GET /api/v1/users/me/invite-stats")
76
69
  .option("--channel <value>", "string")
77
70
  .action(async (opts) => {
78
- const { as } = program.opts();
79
- if (!as)
80
- throw new Error("--as <userId> is required");
71
+ const as = actingUserId(program);
81
72
  const path = `/api/v1/users/me/invite-stats`;
82
73
  const query = {};
83
74
  {
@@ -96,9 +87,7 @@ export function register(program) {
96
87
  .option("--limit <value>", "string")
97
88
  .option("--skip <value>", "string")
98
89
  .action(async (opts) => {
99
- const { as } = program.opts();
100
- if (!as)
101
- throw new Error("--as <userId> is required");
90
+ const as = actingUserId(program);
102
91
  const path = `/api/v1/users/me/invite-history`;
103
92
  const query = {};
104
93
  {
@@ -122,9 +111,7 @@ export function register(program) {
122
111
  .requiredOption("--room-id <value>", "roomId (path param)")
123
112
  .option("--personal-message <value>", "string")
124
113
  .action(async (opts) => {
125
- const { as } = program.opts();
126
- if (!as)
127
- throw new Error("--as <userId> is required");
114
+ const as = actingUserId(program);
128
115
  const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/invite-email-preview`;
129
116
  const query = {};
130
117
  {
@@ -142,9 +129,7 @@ export function register(program) {
142
129
  .description("POST /api/v1/invites/extract-emails")
143
130
  .option("--body <json>", "request body as JSON (no schema available)")
144
131
  .action(async (opts) => {
145
- const { as } = program.opts();
146
- if (!as)
147
- throw new Error("--as <userId> is required");
132
+ const as = actingUserId(program);
148
133
  const path = `/api/v1/invites/extract-emails`;
149
134
  const body = opts.body ? JSON.parse(opts.body) : undefined;
150
135
  const data = await call({ method: "POST", path, asUserId: as, body });
@@ -1,4 +1,5 @@
1
1
  import { call } from "../../client.js";
2
+ import { actingUserId } from "../../auth.js";
2
3
  import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
3
4
  export function register(program) {
4
5
  const group = getOrCreateGroup(program, "room-owned-agent", "RoomOwnedAgent operations");
@@ -8,9 +9,7 @@ export function register(program) {
8
9
  .description("GET /api/v1/rooms/{id}/agent/.well-known/agent.json")
9
10
  .requiredOption("--id <value>", "id (path param)")
10
11
  .action(async (opts) => {
11
- const { as } = program.opts();
12
- if (!as)
13
- throw new Error("--as <userId> is required");
12
+ const as = actingUserId(program);
14
13
  const path = `/api/v1/rooms/${encodeURIComponent(opts.id)}/agent/.well-known/agent.json`;
15
14
  const data = await call({ method: "GET", path, asUserId: as });
16
15
  process.stdout.write(JSON.stringify(data) + "\n");
@@ -23,9 +22,7 @@ export function register(program) {
23
22
  .requiredOption("--id <value>", "id (path param)")
24
23
  .option("--body <json>", "request body as JSON (no schema available)")
25
24
  .action(async (opts) => {
26
- const { as } = program.opts();
27
- if (!as)
28
- throw new Error("--as <userId> is required");
25
+ const as = actingUserId(program);
29
26
  const path = `/api/v1/rooms/${encodeURIComponent(opts.id)}/agent/a2a`;
30
27
  const body = opts.body ? JSON.parse(opts.body) : undefined;
31
28
  const data = await call({ method: "POST", path, asUserId: as, body });
@@ -1,4 +1,5 @@
1
1
  import { call } from "../../client.js";
2
+ import { actingUserId } from "../../auth.js";
2
3
  import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
3
4
  export function register(program) {
4
5
  const group = getOrCreateGroup(program, "room-page", "RoomPage operations");
@@ -8,9 +9,7 @@ export function register(program) {
8
9
  .description("GET /r/{slug}")
9
10
  .requiredOption("--slug <value>", "slug (path param)")
10
11
  .action(async (opts) => {
11
- const { as } = program.opts();
12
- if (!as)
13
- throw new Error("--as <userId> is required");
12
+ const as = actingUserId(program);
14
13
  const path = `/r/${encodeURIComponent(opts.slug)}`;
15
14
  const data = await call({ method: "GET", path, asUserId: as });
16
15
  process.stdout.write(JSON.stringify(data) + "\n");