@wirecat/cli-core 0.666.0 → 0.667.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.
Files changed (36) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/dist/calendar/cli/conference.d.ts +3 -0
  3. package/dist/calendar/cli/conference.js +7 -0
  4. package/dist/calendar/cli/index.d.ts +1 -0
  5. package/dist/calendar/cli/index.js +4 -2
  6. package/dist/calendar/mcp/index.d.ts +62 -12
  7. package/dist/calendar/mcp/index.js +6 -0
  8. package/dist/calendar/testing/writer-contract.js +1 -0
  9. package/dist/calendar/testing/writer.d.ts +3 -0
  10. package/dist/calendar/testing/writer.js +9 -1
  11. package/dist/calendar/writer.d.ts +13 -0
  12. package/dist/calendar/writes.d.ts +3 -0
  13. package/dist/calendar/writes.js +21 -1
  14. package/dist/cli/documents/words.d.ts +1 -1
  15. package/dist/domain/providers.js +2 -1
  16. package/dist/entities/index.d.ts +6 -0
  17. package/dist/errors/reasons.js +1 -0
  18. package/dist/meetings/answers.d.ts +10 -0
  19. package/dist/meetings/answers.js +24 -1
  20. package/dist/meetings/cli/index.js +3 -2
  21. package/dist/meetings/cli/management.d.ts +1 -1
  22. package/dist/meetings/cli/management.js +67 -25
  23. package/dist/meetings/export.d.ts +2 -0
  24. package/dist/meetings/export.js +1 -0
  25. package/dist/meetings/index.d.ts +1 -1
  26. package/dist/meetings/index.js +1 -1
  27. package/dist/meetings/meeting-management.d.ts +68 -3
  28. package/dist/meetings/meeting-management.js +134 -17
  29. package/dist/meetings/read-answers.d.ts +1 -0
  30. package/dist/meetings/read-answers.js +1 -0
  31. package/dist/meetings/reads.d.ts +29 -2
  32. package/dist/meetings/reads.js +3 -2
  33. package/dist/meetings/result-items.d.ts +3 -0
  34. package/dist/meetings/result-items.js +9 -1
  35. package/dist/meetings/testing/management-contract.js +27 -5
  36. package/package.json +1 -1
@@ -23,14 +23,29 @@ export declare const listed: <T>(items: T[], page?: {
23
23
  export declare const meetingPeople: (store: MeetingStore & Partial<MeetingParticipantSearchStore>, query: string, accountId?: number, options?: Omit<MeetingParticipantSearchOptions, "accountId">) => Promise<{
24
24
  limit: number;
25
25
  hasMore: boolean;
26
- items: import("./model.js").Participant[];
26
+ items: {
27
+ createdAt: number;
28
+ updatedAt: number;
29
+ id: number;
30
+ meetingId: number;
31
+ identityId: number;
32
+ displayName: string | null;
33
+ email: string | null;
34
+ role: string | null;
35
+ joinedAt: number | null;
36
+ leftAt: number | null;
37
+ durationMs: number | null;
38
+ sessions: import("./model.js").JsonValue;
39
+ externalId: string | null;
40
+ metadata: import("./model.js").Metadata;
41
+ untrusted: string[];
42
+ }[];
27
43
  page: number;
28
44
  } | {
29
45
  schema_version: 1;
30
46
  kind: "meeting_participants";
31
47
  account_id: number;
32
48
  query: string;
33
- items: import("./participant-search.js").MeetingParticipantCandidate[];
34
49
  ambiguity: {
35
50
  scope: "page";
36
51
  multiple_identities: boolean;
@@ -42,6 +57,18 @@ export declare const meetingPeople: (store: MeetingStore & Partial<MeetingPartic
42
57
  archive_completeness: "unknown";
43
58
  truncated_by: "limit" | "scan_limit" | "read_bytes" | null;
44
59
  };
60
+ items: {
61
+ participant_id: number;
62
+ meeting_id: number;
63
+ identity_id: number;
64
+ display_name: string | null;
65
+ email: string | null;
66
+ person: {
67
+ ref: string;
68
+ name: string | null;
69
+ } | null;
70
+ untrusted: string[];
71
+ }[];
45
72
  page: {
46
73
  mode: string;
47
74
  limit: number;
@@ -1,7 +1,7 @@
1
1
  import { CliError } from "@wirecat/cli-base";
2
2
  import { parseLucene, validateQuery } from "@wirecat/cli-base/query";
3
3
  import { STEPS, stepOf } from "@wirecat/cli-base/standards";
4
- import { meetingDetailsItem, meetingSummaryItem, meetingTranscriptItem, wholeList, } from "./answers.js";
4
+ import { meetingDetailsItem, meetingSummaryItem, meetingTranscriptItem, PARTICIPANT_UNTRUSTED, wholeList, } from "./answers.js";
5
5
  import { MEETING_QUERY, meetingItem } from "./item.js";
6
6
  import { validateMeetingParticipantQuery, validateMeetingParticipantSearch, } from "./participant-search.js";
7
7
  export class MeetingError extends CliError {
@@ -52,6 +52,7 @@ export const meetingPeople = async (store, query, accountId, options = {}) => {
52
52
  });
53
53
  return {
54
54
  ...packet,
55
+ items: packet.items.map((one) => ({ ...one, untrusted: [...PARTICIPANT_UNTRUSTED] })),
55
56
  page: { mode: "cursor", limit, has_more, ...(next_cursor ? { next_cursor } : {}) },
56
57
  ...(next_cursor
57
58
  ? {
@@ -74,7 +75,7 @@ export const meetingPeople = async (store, query, accountId, options = {}) => {
74
75
  }
75
76
  if (Object.values(options).some((value) => value !== undefined))
76
77
  throw new MeetingError("configuration_error", "bounded participant lookup needs a selected account and capable store");
77
- return listed(await store.participants(query, accountId));
78
+ return listed((await store.participants(query, accountId)).map((one) => ({ ...one, untrusted: [...PARTICIPANT_UNTRUSTED] })));
78
79
  };
79
80
  const PAGE_NEXT = STEPS.find((step) => step.id === "page.next");
80
81
  /** Newest first; `filter.query` is a list query `meetingsQuery` validated. The answer pages by `limit`. */
@@ -13,6 +13,7 @@ export declare const MEETING_RESULT_ENTITIES: {
13
13
  readonly duration_minutes: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
14
14
  readonly timezone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
15
15
  readonly agenda: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
16
+ readonly settings: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnionSchema<[v.StringSchema<undefined>, v.BooleanSchema<undefined>], undefined>, undefined>, undefined>;
16
17
  }, undefined>, undefined>;
17
18
  readonly applied: v.BooleanSchema<undefined>;
18
19
  readonly meeting: v.OptionalSchema<v.StrictObjectSchema<{
@@ -25,6 +26,7 @@ export declare const MEETING_RESULT_ENTITIES: {
25
26
  readonly agenda: v.NullableSchema<v.StringSchema<undefined>, undefined>;
26
27
  readonly join_url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
27
28
  }, undefined>, undefined>;
29
+ readonly untrusted: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
28
30
  }, undefined>;
29
31
  readonly meeting_invitation: v.StrictObjectSchema<{
30
32
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
@@ -47,6 +49,7 @@ export declare const MEETING_RESULT_ENTITIES: {
47
49
  readonly format: v.PicklistSchema<["markdown", "vtt"], undefined>;
48
50
  readonly filename: v.StringSchema<undefined>;
49
51
  readonly content: v.StringSchema<undefined>;
52
+ readonly untrusted: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
50
53
  }, undefined>, v.StrictObjectSchema<{
51
54
  readonly meeting_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
52
55
  readonly format: v.PicklistSchema<["markdown", "vtt"], undefined>;
@@ -14,7 +14,13 @@ const run = v.strictObject({
14
14
  timezone: v.optional(text),
15
15
  });
16
16
  const exported = v.union([
17
- v.strictObject({ meeting_id: identifier, format: v.picklist(["markdown", "vtt"]), filename: text, content: text }),
17
+ v.strictObject({
18
+ meeting_id: identifier,
19
+ format: v.picklist(["markdown", "vtt"]),
20
+ filename: text,
21
+ content: text,
22
+ untrusted: v.optional(v.array(text)),
23
+ }),
18
24
  v.strictObject({ meeting_id: identifier, format: v.picklist(["markdown", "vtt"]), output: text }),
19
25
  ]);
20
26
  const eventChange = v.strictObject({
@@ -138,6 +144,7 @@ const managedChange = v.strictObject({
138
144
  duration_minutes: v.optional(count),
139
145
  timezone: v.optional(text),
140
146
  agenda: v.optional(text),
147
+ settings: v.optional(v.record(text, v.union([text, flag]))),
141
148
  })),
142
149
  applied: flag,
143
150
  meeting: v.optional(v.strictObject({
@@ -150,6 +157,7 @@ const managedChange = v.strictObject({
150
157
  agenda: nullableText,
151
158
  join_url: nullableText,
152
159
  })),
160
+ untrusted: v.optional(v.array(text)),
153
161
  });
154
162
  const invitation = v.strictObject({ id: identifier, invitation: text, untrusted: v.optional(v.array(text)) });
155
163
  export const MEETING_RESULT_ENTITIES = {
@@ -1,5 +1,23 @@
1
1
  import assert from "node:assert/strict";
2
- import { createMeetingManagement } from "../meeting-management.js";
2
+ import { createMeetingManagement, declareMeetingFields, } from "../meeting-management.js";
3
+ const sampleSetting = (setting) => setting.type === "choice" ? setting.values[0] : setting.type === "boolean" ? true : "Bob Sample note";
4
+ /** A change that uses only what the port declares, so a service without a title or an agenda is checked too. */
5
+ const sampleChange = (declared, create) => {
6
+ const has = (field) => declared.fields.includes(field);
7
+ const first = declared.settings[0];
8
+ const settings = first ? { settings: { [first.name]: sampleSetting(first) } } : {};
9
+ if (create)
10
+ return {
11
+ ...(has("title") ? { title: "Alice Example planning" } : {}),
12
+ ...(has("kind") ? { kind: "instant" } : has("startTime") ? { startTime: "2026-11-20T10:00:00Z" } : {}),
13
+ ...settings,
14
+ };
15
+ if (has("agenda"))
16
+ return { agenda: "Bob Sample agenda" };
17
+ if (has("title"))
18
+ return { title: "Alice Example planning" };
19
+ return settings;
20
+ };
3
21
  /** Factories must use invented fixtures and injected transports; cases can apply writes. */
4
22
  export const meetingManagementContract = (make) => {
5
23
  const test = (name, check) => ({
@@ -15,14 +33,15 @@ export const meetingManagementContract = (make) => {
15
33
  ...(ports.create ? { create: fail } : {}),
16
34
  ...(ports.update ? { update: fail } : {}),
17
35
  ...(ports.cancel ? { cancel: fail } : {}),
36
+ ...(ports.fields ? { fields: ports.fields } : {}),
18
37
  });
19
38
  if (ports.create) {
20
- const receipt = await sdk.create({ title: "Alice Example planning", kind: "instant" });
39
+ const receipt = await sdk.create(sampleChange(sdk.fields.create, true));
21
40
  assert.equal(receipt.applied, false);
22
41
  assert.deepEqual(receipt.scope, scope);
23
42
  }
24
43
  if (ports.update)
25
- assert.equal((await sdk.update(id, { agenda: "Bob Sample agenda" })).applied, false);
44
+ assert.equal((await sdk.update(id, sampleChange(sdk.fields.update, false))).applied, false);
26
45
  if (ports.cancel)
27
46
  assert.equal((await sdk.cancel(id, { apply: true, dryRun: true })).applied, false);
28
47
  }),
@@ -38,8 +57,9 @@ export const meetingManagementContract = (make) => {
38
57
  assert.equal(Object.isFrozen(context.scope), true);
39
58
  return create(change, context);
40
59
  },
60
+ ...(ports.fields ? { fields: ports.fields } : {}),
41
61
  });
42
- const receipt = await sdk.create({ title: "Alice Example planning", kind: "instant" }, { apply: true });
62
+ const receipt = await sdk.create(sampleChange(sdk.fields.create, true), { apply: true });
43
63
  assert.equal(calls, 1);
44
64
  assert.equal(receipt.applied, true);
45
65
  assert.ok(receipt.meeting?.id);
@@ -80,9 +100,11 @@ export const meetingManagementContract = (make) => {
80
100
  },
81
101
  }
82
102
  : {}),
103
+ ...(ports.fields ? { fields: ports.fields } : {}),
83
104
  });
84
105
  if (update) {
85
- assert.equal((await sdk.update(id, { agenda: "Bob Sample agenda" }, { apply: true })).applied, true);
106
+ const change = sampleChange(declareMeetingFields(ports.fields?.update, "update"), false);
107
+ assert.equal((await sdk.update(id, change, { apply: true })).applied, true);
86
108
  assert.equal(updates, 1);
87
109
  }
88
110
  if (cancel) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wirecat/cli-core",
3
- "version": "0.666.0",
3
+ "version": "0.667.0",
4
4
  "description": "The messenger-neutral half of a messaging CLI: domain model, message locators, rendering, name resolution, the SQLite seam, the command skeleton and shared read commands, the send guard, run records and the message store",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Viacheslav Ptsarev",