@kelpie/schemas 0.1.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 (158) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +33 -0
  3. package/dist/account.d.ts +79 -0
  4. package/dist/account.d.ts.map +1 -0
  5. package/dist/account.js +66 -0
  6. package/dist/account.js.map +1 -0
  7. package/dist/activity.d.ts +23 -0
  8. package/dist/activity.d.ts.map +1 -0
  9. package/dist/activity.js +27 -0
  10. package/dist/activity.js.map +1 -0
  11. package/dist/agentTask.d.ts +97 -0
  12. package/dist/agentTask.d.ts.map +1 -0
  13. package/dist/agentTask.js +127 -0
  14. package/dist/agentTask.js.map +1 -0
  15. package/dist/candidate.d.ts +39 -0
  16. package/dist/candidate.d.ts.map +1 -0
  17. package/dist/candidate.js +40 -0
  18. package/dist/candidate.js.map +1 -0
  19. package/dist/company.d.ts +38 -0
  20. package/dist/company.d.ts.map +1 -0
  21. package/dist/company.js +57 -0
  22. package/dist/company.js.map +1 -0
  23. package/dist/dashboard.d.ts +112 -0
  24. package/dist/dashboard.d.ts.map +1 -0
  25. package/dist/dashboard.js +165 -0
  26. package/dist/dashboard.js.map +1 -0
  27. package/dist/deal.d.ts +40 -0
  28. package/dist/deal.d.ts.map +1 -0
  29. package/dist/deal.js +59 -0
  30. package/dist/deal.js.map +1 -0
  31. package/dist/decision.d.ts +46 -0
  32. package/dist/decision.d.ts.map +1 -0
  33. package/dist/decision.js +48 -0
  34. package/dist/decision.js.map +1 -0
  35. package/dist/form.d.ts +97 -0
  36. package/dist/form.d.ts.map +1 -0
  37. package/dist/form.js +98 -0
  38. package/dist/form.js.map +1 -0
  39. package/dist/formSubmission.d.ts +47 -0
  40. package/dist/formSubmission.d.ts.map +1 -0
  41. package/dist/formSubmission.js +47 -0
  42. package/dist/formSubmission.js.map +1 -0
  43. package/dist/handbookPage.d.ts +52 -0
  44. package/dist/handbookPage.d.ts.map +1 -0
  45. package/dist/handbookPage.js +56 -0
  46. package/dist/handbookPage.js.map +1 -0
  47. package/dist/importExport.d.ts +143 -0
  48. package/dist/importExport.d.ts.map +1 -0
  49. package/dist/importExport.js +239 -0
  50. package/dist/importExport.js.map +1 -0
  51. package/dist/index.d.ts +75 -0
  52. package/dist/index.d.ts.map +1 -0
  53. package/dist/index.js +45 -0
  54. package/dist/index.js.map +1 -0
  55. package/dist/invite.d.ts +35 -0
  56. package/dist/invite.d.ts.map +1 -0
  57. package/dist/invite.js +31 -0
  58. package/dist/invite.js.map +1 -0
  59. package/dist/mcpTool.d.ts +26 -0
  60. package/dist/mcpTool.d.ts.map +1 -0
  61. package/dist/mcpTool.js +13 -0
  62. package/dist/mcpTool.js.map +1 -0
  63. package/dist/member.d.ts +26 -0
  64. package/dist/member.d.ts.map +1 -0
  65. package/dist/member.js +24 -0
  66. package/dist/member.js.map +1 -0
  67. package/dist/moduleSetting.d.ts +19 -0
  68. package/dist/moduleSetting.d.ts.map +1 -0
  69. package/dist/moduleSetting.js +16 -0
  70. package/dist/moduleSetting.js.map +1 -0
  71. package/dist/note.d.ts +34 -0
  72. package/dist/note.d.ts.map +1 -0
  73. package/dist/note.js +35 -0
  74. package/dist/note.js.map +1 -0
  75. package/dist/opportunity.d.ts +30 -0
  76. package/dist/opportunity.d.ts.map +1 -0
  77. package/dist/opportunity.js +41 -0
  78. package/dist/opportunity.js.map +1 -0
  79. package/dist/partnership.d.ts +36 -0
  80. package/dist/partnership.d.ts.map +1 -0
  81. package/dist/partnership.js +50 -0
  82. package/dist/partnership.js.map +1 -0
  83. package/dist/person.d.ts +45 -0
  84. package/dist/person.d.ts.map +1 -0
  85. package/dist/person.js +60 -0
  86. package/dist/person.js.map +1 -0
  87. package/dist/pipelineStage.d.ts +29 -0
  88. package/dist/pipelineStage.d.ts.map +1 -0
  89. package/dist/pipelineStage.js +38 -0
  90. package/dist/pipelineStage.js.map +1 -0
  91. package/dist/planItem.d.ts +43 -0
  92. package/dist/planItem.d.ts.map +1 -0
  93. package/dist/planItem.js +44 -0
  94. package/dist/planItem.js.map +1 -0
  95. package/dist/position.d.ts +22 -0
  96. package/dist/position.d.ts.map +1 -0
  97. package/dist/position.js +25 -0
  98. package/dist/position.js.map +1 -0
  99. package/dist/raise.d.ts +38 -0
  100. package/dist/raise.d.ts.map +1 -0
  101. package/dist/raise.js +53 -0
  102. package/dist/raise.js.map +1 -0
  103. package/dist/role.d.ts +21 -0
  104. package/dist/role.d.ts.map +1 -0
  105. package/dist/role.js +21 -0
  106. package/dist/role.js.map +1 -0
  107. package/dist/search.d.ts +41 -0
  108. package/dist/search.d.ts.map +1 -0
  109. package/dist/search.js +41 -0
  110. package/dist/search.js.map +1 -0
  111. package/dist/session.d.ts +92 -0
  112. package/dist/session.d.ts.map +1 -0
  113. package/dist/session.js +67 -0
  114. package/dist/session.js.map +1 -0
  115. package/dist/values.d.ts +216 -0
  116. package/dist/values.d.ts.map +1 -0
  117. package/dist/values.js +329 -0
  118. package/dist/values.js.map +1 -0
  119. package/dist/webhook.d.ts +85 -0
  120. package/dist/webhook.d.ts.map +1 -0
  121. package/dist/webhook.js +75 -0
  122. package/dist/webhook.js.map +1 -0
  123. package/dist/wire.d.ts +40 -0
  124. package/dist/wire.d.ts.map +1 -0
  125. package/dist/wire.js +40 -0
  126. package/dist/wire.js.map +1 -0
  127. package/package.json +51 -0
  128. package/src/account.ts +149 -0
  129. package/src/activity.ts +52 -0
  130. package/src/agentTask.ts +254 -0
  131. package/src/candidate.ts +83 -0
  132. package/src/company.ts +98 -0
  133. package/src/dashboard.ts +307 -0
  134. package/src/deal.ts +102 -0
  135. package/src/decision.ts +106 -0
  136. package/src/form.ts +217 -0
  137. package/src/formSubmission.ts +99 -0
  138. package/src/handbookPage.ts +99 -0
  139. package/src/importExport.ts +339 -0
  140. package/src/index.ts +324 -0
  141. package/src/invite.ts +69 -0
  142. package/src/mcpTool.ts +32 -0
  143. package/src/member.ts +53 -0
  144. package/src/moduleSetting.ts +37 -0
  145. package/src/note.ts +73 -0
  146. package/src/opportunity.ts +74 -0
  147. package/src/partnership.ts +89 -0
  148. package/src/person.ts +116 -0
  149. package/src/pipelineStage.ts +71 -0
  150. package/src/planItem.ts +91 -0
  151. package/src/position.ts +50 -0
  152. package/src/raise.ts +94 -0
  153. package/src/role.ts +45 -0
  154. package/src/search.ts +86 -0
  155. package/src/session.ts +177 -0
  156. package/src/values.ts +427 -0
  157. package/src/webhook.ts +164 -0
  158. package/src/wire.ts +51 -0
@@ -0,0 +1,38 @@
1
+ import { z } from 'zod';
2
+ import type { RecordTimestamps } from './wire.ts';
3
+ /** Wire and write shapes for `/v1/raises`. */
4
+ export interface Raise extends RecordTimestamps {
5
+ readonly id: string;
6
+ readonly name: string;
7
+ /** Required: the firm. The ongoing investor relationship stays a Partnership. */
8
+ readonly companyId: string;
9
+ readonly stageId: string;
10
+ readonly checkSizeCents: number | null;
11
+ readonly currency: string | null;
12
+ readonly thesisFit: string;
13
+ /** Why they said no. Meaningful whenever set, not only in the passed stage. */
14
+ readonly passReason: string | null;
15
+ readonly ownerId: string | null;
16
+ /** `YYYY-MM-DD`, per `api.md` date-only fields. */
17
+ readonly expectedClose: string | null;
18
+ readonly personIds: readonly string[];
19
+ readonly summary: string;
20
+ readonly tags: readonly string[];
21
+ }
22
+ export declare const raiseSchema: z.ZodType<Raise, unknown>;
23
+ export interface RaiseInput {
24
+ readonly name?: string;
25
+ readonly companyId?: string;
26
+ readonly stageId?: string;
27
+ readonly checkSizeCents?: number | null;
28
+ readonly currency?: string | null;
29
+ readonly thesisFit?: string;
30
+ readonly passReason?: string | null;
31
+ readonly ownerId?: string | null;
32
+ readonly expectedClose?: string | null;
33
+ readonly personIds?: readonly string[];
34
+ readonly summary?: string;
35
+ readonly tags?: readonly string[];
36
+ }
37
+ export declare function raiseBody(input: RaiseInput): Record<string, unknown>;
38
+ //# sourceMappingURL=raise.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"raise.d.ts","sourceRoot":"","sources":["../src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Q,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACnC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAChC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtC,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACtC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAClC;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAepE"}
package/dist/raise.js ADDED
@@ -0,0 +1,53 @@
1
+ import { z } from 'zod';
2
+ import { definedFields, idSchema, recordTimestamps } from './wire.js';
3
+ export const raiseSchema = z
4
+ .object({
5
+ id: idSchema,
6
+ name: z.string(),
7
+ company_id: idSchema,
8
+ stage_id: idSchema,
9
+ check_size_cents: z.number().int().nullable(),
10
+ currency: z.string().nullable(),
11
+ thesis_fit: z.string(),
12
+ pass_reason: z.string().nullable(),
13
+ owner_id: idSchema.nullable(),
14
+ expected_close: z.string().nullable(),
15
+ person_ids: z.array(idSchema),
16
+ summary: z.string(),
17
+ tags: z.array(z.string()),
18
+ ...recordTimestamps,
19
+ })
20
+ .transform((wire) => ({
21
+ id: wire.id,
22
+ name: wire.name,
23
+ companyId: wire.company_id,
24
+ stageId: wire.stage_id,
25
+ checkSizeCents: wire.check_size_cents,
26
+ currency: wire.currency,
27
+ thesisFit: wire.thesis_fit,
28
+ passReason: wire.pass_reason,
29
+ ownerId: wire.owner_id,
30
+ expectedClose: wire.expected_close,
31
+ personIds: wire.person_ids,
32
+ summary: wire.summary,
33
+ tags: wire.tags,
34
+ createdAt: wire.created_at,
35
+ updatedAt: wire.updated_at,
36
+ }));
37
+ export function raiseBody(input) {
38
+ return definedFields({
39
+ name: input.name,
40
+ company_id: input.companyId,
41
+ stage_id: input.stageId,
42
+ check_size_cents: input.checkSizeCents,
43
+ currency: input.currency,
44
+ thesis_fit: input.thesisFit,
45
+ pass_reason: input.passReason,
46
+ owner_id: input.ownerId,
47
+ expected_close: input.expectedClose,
48
+ person_ids: input.personIds,
49
+ summary: input.summary,
50
+ tags: input.tags,
51
+ });
52
+ }
53
+ //# sourceMappingURL=raise.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"raise.js","sourceRoot":"","sources":["../src/raise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAwBrE,MAAM,CAAC,MAAM,WAAW,GAA8B,CAAC;KACpD,MAAM,CAAC;IACN,EAAE,EAAE,QAAQ;IACZ,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,UAAU,EAAE,QAAQ;IACpB,QAAQ,EAAE,QAAQ;IAClB,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IAC7C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE;IAC7B,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC7B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,IAAI,EAAE,CAAC,CAAC,KAA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AC"}
package/dist/role.d.ts ADDED
@@ -0,0 +1,21 @@
1
+ import { z } from 'zod';
2
+ import type { RoleStatus } from './values.ts';
3
+ import type { RecordTimestamps } from './wire.ts';
4
+ /**
5
+ * Wire and write shapes for `/v1/roles`, an opening the workspace is hiring for.
6
+ *
7
+ * A Role holds no people. Candidates attach through `/v1/candidates`, which is
8
+ * the Person↔Role link and the only place hiring pipeline state lives.
9
+ */
10
+ export interface Role extends RecordTimestamps {
11
+ readonly id: string;
12
+ readonly title: string;
13
+ readonly status: RoleStatus;
14
+ }
15
+ export declare const roleSchema: z.ZodType<Role, unknown>;
16
+ export interface RoleInput {
17
+ readonly title?: string;
18
+ readonly status?: RoleStatus;
19
+ }
20
+ export declare function roleBody(input: RoleInput): Record<string, unknown>;
21
+ //# sourceMappingURL=role.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"role.d.ts","sourceRoot":"","sources":["../src/role.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAE7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAEjD;;;;;GAKG;AAEH,MAAM,WAAW,IAAK,SAAQ,gBAAgB;IAC5C,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAA;CAC5B;AAED,eAAO,MAAM,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAe7C,CAAA;AAEH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,UAAU,CAAA;CAC7B;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAElE"}
package/dist/role.js ADDED
@@ -0,0 +1,21 @@
1
+ import { z } from 'zod';
2
+ import { ROLE_STATUSES } from './values.js';
3
+ import { definedFields, idSchema, recordTimestamps } from './wire.js';
4
+ export const roleSchema = z
5
+ .object({
6
+ id: idSchema,
7
+ title: z.string(),
8
+ status: z.enum(ROLE_STATUSES),
9
+ ...recordTimestamps,
10
+ })
11
+ .transform((wire) => ({
12
+ id: wire.id,
13
+ title: wire.title,
14
+ status: wire.status,
15
+ createdAt: wire.created_at,
16
+ updatedAt: wire.updated_at,
17
+ }));
18
+ export function roleBody(input) {
19
+ return definedFields({ title: input.title, status: input.status });
20
+ }
21
+ //# sourceMappingURL=role.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"role.js","sourceRoot":"","sources":["../src/role.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAgBrE,MAAM,CAAC,MAAM,UAAU,GAA6B,CAAC;KAClD,MAAM,CAAC;IACN,EAAE,EAAE,QAAQ;IACZ,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC;IAC7B,GAAG,gBAAgB;CACpB,CAAC;KACD,SAAS,CACR,CAAC,IAAI,EAAQ,EAAE,CAAC,CAAC;IACf,EAAE,EAAE,IAAI,CAAC,EAAE;IACX,KAAK,EAAE,IAAI,CAAC,KAAK;IACjB,MAAM,EAAE,IAAI,CAAC,MAAM;IACnB,SAAS,EAAE,IAAI,CAAC,UAAU;IAC1B,SAAS,EAAE,IAAI,CAAC,UAAU;CAC3B,CAAC,CACH,CAAA;AAOH,MAAM,UAAU,QAAQ,CAAC,KAAgB;IACvC,OAAO,aAAa,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAA;AACpE,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { z } from 'zod';
2
+ import type { SearchCollection } from './values.ts';
3
+ /**
4
+ * Wire shape for `GET /v1/search`. Read-only, so there is no body builder.
5
+ *
6
+ * One object rather than a list envelope, and no cursor. Nine collections are
7
+ * ranked separately, because a `ts_rank` over a handbook page and one over a
8
+ * three-word Role title are not comparable numbers, and "which Deal" and "which
9
+ * handbook page" are different questions anyway.
10
+ *
11
+ * Every group carries `total`, the count of every match, beside `items`, which
12
+ * holds however many the request's `?limit=` allowed.
13
+ */
14
+ export interface SearchResult {
15
+ readonly id: string;
16
+ readonly title: string;
17
+ /**
18
+ * The record's one line of context, already resolved. What it holds depends on
19
+ * the collection: an email for a Person, a domain for a Company, the stage
20
+ * label for a Deal or Raise, the kind for an Opportunity or Partnership, the
21
+ * status for a Role, the slug for a handbook page, and the date decided for a
22
+ * Decision as `YYYY-MM-DD`.
23
+ */
24
+ readonly subtitle: string | null;
25
+ /** A fragment of the record's prose centred on the match. Empty when it has none. */
26
+ readonly snippet: string;
27
+ }
28
+ export interface SearchResultGroup {
29
+ readonly collection: SearchCollection;
30
+ readonly total: number;
31
+ readonly items: readonly SearchResult[];
32
+ }
33
+ export interface SearchResults {
34
+ readonly query: string;
35
+ readonly limit: number;
36
+ /** Across every group, which is what a "12 results" heading is built from. */
37
+ readonly total: number;
38
+ readonly groups: readonly SearchResultGroup[];
39
+ }
40
+ export declare const searchResultsSchema: z.ZodType<SearchResults, unknown>;
41
+ //# sourceMappingURL=search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../src/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAGnD;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IAChC,qFAAqF;IACrF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAA;IACrC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,CAAA;CACxC;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,8EAA8E;IAC9E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,SAAS,iBAAiB,EAAE,CAAA;CAC9C;AA4BD,eAAO,MAAM,mBAAmB,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,EAAE,OAAO,CAY7D,CAAA"}
package/dist/search.js ADDED
@@ -0,0 +1,41 @@
1
+ import { z } from 'zod';
2
+ import { SEARCH_COLLECTIONS } from './values.js';
3
+ import { idSchema } from './wire.js';
4
+ const resultSchema = z
5
+ .object({
6
+ id: idSchema,
7
+ title: z.string(),
8
+ subtitle: z.string().nullable(),
9
+ snippet: z.string(),
10
+ })
11
+ .transform((wire) => ({
12
+ id: wire.id,
13
+ title: wire.title,
14
+ subtitle: wire.subtitle,
15
+ snippet: wire.snippet,
16
+ }));
17
+ const groupSchema = z
18
+ .object({
19
+ type: z.enum(SEARCH_COLLECTIONS),
20
+ total: z.number().int(),
21
+ items: z.array(resultSchema),
22
+ })
23
+ .transform((wire) => ({
24
+ collection: wire.type,
25
+ total: wire.total,
26
+ items: wire.items,
27
+ }));
28
+ export const searchResultsSchema = z
29
+ .object({
30
+ query: z.string(),
31
+ limit: z.number().int(),
32
+ total: z.number().int(),
33
+ groups: z.array(groupSchema),
34
+ })
35
+ .transform((wire) => ({
36
+ query: wire.query,
37
+ limit: wire.limit,
38
+ total: wire.total,
39
+ groups: wire.groups,
40
+ }));
41
+ //# sourceMappingURL=search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.js","sourceRoot":"","sources":["../src/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AA2CpC,MAAM,YAAY,GAAqC,CAAC;KACrD,MAAM,CAAC;IACN,EAAE,EAAE,QAAQ;IACZ,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC;KACD,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACpB,EAAE,EAAE,IAAI,CAAC,EAAE;IACX,KAAK,EAAE,IAAI,CAAC,KAAK;IACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ;IACvB,OAAO,EAAE,IAAI,CAAC,OAAO;CACtB,CAAC,CAAC,CAAA;AAEL,MAAM,WAAW,GAA0C,CAAC;KACzD,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC;IAChC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IACvB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC;CAC7B,CAAC;KACD,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACpB,UAAU,EAAE,IAAI,CAAC,IAAI;IACrB,KAAK,EAAE,IAAI,CAAC,KAAK;IACjB,KAAK,EAAE,IAAI,CAAC,KAAK;CAClB,CAAC,CAAC,CAAA;AAEL,MAAM,CAAC,MAAM,mBAAmB,GAAsC,CAAC;KACpE,MAAM,CAAC;IACN,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IACvB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IACvB,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC;CAC7B,CAAC;KACD,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACpB,KAAK,EAAE,IAAI,CAAC,KAAK;IACjB,KAAK,EAAE,IAAI,CAAC,KAAK;IACjB,KAAK,EAAE,IAAI,CAAC,KAAK;IACjB,MAAM,EAAE,IAAI,CAAC,MAAM;CACpB,CAAC,CAAC,CAAA"}
@@ -0,0 +1,92 @@
1
+ import { z } from 'zod';
2
+ import type { Account } from './account.ts';
3
+ import type { MemberRole } from './values.ts';
4
+ /**
5
+ * Wire shapes for `/v1/auth/*` and `/v1/workspaces`: how a browser gets a
6
+ * session, and which workspace that session is in.
7
+ *
8
+ * `workspaceId` is nullable because signup creates an account and nothing else.
9
+ * Every CRM endpoint answers `403` until a workspace exists, so the shell has to
10
+ * be able to tell "signed out" from "signed in, no workspace yet".
11
+ *
12
+ * The password-reset pair belongs here rather than in `account.ts` for the same
13
+ * reason sign-in does: a caller running them has no account context yet. What
14
+ * `account.ts` holds is the signed-in person.
15
+ */
16
+ export interface Session {
17
+ readonly userId: string;
18
+ readonly sessionId: string;
19
+ readonly workspaceId: string | null;
20
+ readonly role: MemberRole | null;
21
+ }
22
+ export declare const sessionSchema: z.ZodType<Session, unknown>;
23
+ /** What `POST /v1/auth/login` and `/v1/auth/signup` answer with. */
24
+ export interface SignedInAccount {
25
+ readonly account: Account;
26
+ readonly activeWorkspaceId: string | null;
27
+ }
28
+ export declare const signedInAccountSchema: z.ZodType<SignedInAccount, unknown>;
29
+ export interface Workspace {
30
+ readonly id: string;
31
+ readonly name: string;
32
+ readonly slug: string;
33
+ readonly timezone: string;
34
+ readonly tagline: string | null;
35
+ readonly oneLiner: string | null;
36
+ }
37
+ export declare const workspaceSchema: z.ZodType<Workspace, unknown>;
38
+ export interface CreateWorkspaceInput {
39
+ readonly name: string;
40
+ readonly slug: string;
41
+ readonly timezone: string;
42
+ }
43
+ export declare function createWorkspaceBody(input: CreateWorkspaceInput): Record<string, unknown>;
44
+ /**
45
+ * Settings a workspace admin can change.
46
+ *
47
+ * `tagline` and `oneLiner` are the two strings an agent reads to say who this
48
+ * company is, so `null` clears them and `undefined` leaves them alone, per
49
+ * `api.md`. `definedFields` is what keeps those two apart on the wire.
50
+ */
51
+ export interface UpdateWorkspaceInput {
52
+ readonly name?: string;
53
+ readonly slug?: string;
54
+ readonly timezone?: string;
55
+ readonly tagline?: string | null;
56
+ readonly oneLiner?: string | null;
57
+ }
58
+ export declare function updateWorkspaceBody(input: UpdateWorkspaceInput): Record<string, unknown>;
59
+ export interface LogInInput {
60
+ readonly email: string;
61
+ readonly password: string;
62
+ }
63
+ export declare function logInBody(input: LogInInput): Record<string, unknown>;
64
+ /**
65
+ * Creating an account. It answers the same shape sign-in does, with
66
+ * `activeWorkspaceId` null: signup makes the user and stops there.
67
+ */
68
+ export interface SignUpInput {
69
+ readonly name: string;
70
+ readonly email: string;
71
+ readonly password: string;
72
+ }
73
+ export declare function signUpBody(input: SignUpInput): Record<string, unknown>;
74
+ /**
75
+ * Asking for a reset link.
76
+ *
77
+ * `resetUrlTemplate` carries the literal `{token}`, which the email replaces.
78
+ * The caller supplies it for the same reason an invitation does: the service
79
+ * sends the mail and has no idea what address the browser reached it at.
80
+ */
81
+ export interface RequestPasswordResetInput {
82
+ readonly email: string;
83
+ readonly resetUrlTemplate: string;
84
+ }
85
+ export declare function requestPasswordResetBody(input: RequestPasswordResetInput): Record<string, unknown>;
86
+ /** Spending the token from that email. Answers `204`; it does not sign anyone in. */
87
+ export interface ConfirmPasswordResetInput {
88
+ readonly token: string;
89
+ readonly password: string;
90
+ }
91
+ export declare function confirmPasswordResetBody(input: ConfirmPasswordResetInput): Record<string, unknown>;
92
+ //# sourceMappingURL=session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAG7C;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IACnC,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAAA;CACjC;AAED,eAAO,MAAM,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAcnD,CAAA;AAEH,oEAAoE;AACpE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1C;AAED,eAAO,MAAM,qBAAqB,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,EAAE,OAAO,CAUnE,CAAA;AAEH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,QAAQ,EAAE,M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ACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAC1B;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEtE;AAED;;;;;;GAMG;AACH,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;CAClC;AAED,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,yBAAyB,GAC/B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzB;AAED,qFAAqF;AACrF,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAC1B;AAED,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,yBAAyB,GAC/B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzB"}
@@ -0,0 +1,67 @@
1
+ import { z } from 'zod';
2
+ import { MEMBER_ROLES } from './values.js';
3
+ import { definedFields, idSchema } from './wire.js';
4
+ export const sessionSchema = z
5
+ .object({
6
+ user_id: idSchema,
7
+ session_id: idSchema,
8
+ workspace_id: idSchema.nullable(),
9
+ role: z.enum(MEMBER_ROLES).nullable(),
10
+ })
11
+ .transform((wire) => ({
12
+ userId: wire.user_id,
13
+ sessionId: wire.session_id,
14
+ workspaceId: wire.workspace_id,
15
+ role: wire.role,
16
+ }));
17
+ export const signedInAccountSchema = z
18
+ .object({
19
+ account: z.object({ id: idSchema, email: z.string(), name: z.string() }),
20
+ active_workspace_id: idSchema.nullable(),
21
+ })
22
+ .transform((wire) => ({
23
+ account: wire.account,
24
+ activeWorkspaceId: wire.active_workspace_id,
25
+ }));
26
+ export const workspaceSchema = z
27
+ .object({
28
+ id: idSchema,
29
+ name: z.string(),
30
+ slug: z.string(),
31
+ timezone: z.string(),
32
+ tagline: z.string().nullable(),
33
+ one_liner: z.string().nullable(),
34
+ })
35
+ .transform((wire) => ({
36
+ id: wire.id,
37
+ name: wire.name,
38
+ slug: wire.slug,
39
+ timezone: wire.timezone,
40
+ tagline: wire.tagline,
41
+ oneLiner: wire.one_liner,
42
+ }));
43
+ export function createWorkspaceBody(input) {
44
+ return { name: input.name, slug: input.slug, timezone: input.timezone };
45
+ }
46
+ export function updateWorkspaceBody(input) {
47
+ return definedFields({
48
+ name: input.name,
49
+ slug: input.slug,
50
+ timezone: input.timezone,
51
+ tagline: input.tagline,
52
+ one_liner: input.oneLiner,
53
+ });
54
+ }
55
+ export function logInBody(input) {
56
+ return { email: input.email, password: input.password };
57
+ }
58
+ export function signUpBody(input) {
59
+ return { name: input.name, email: input.email, password: input.password };
60
+ }
61
+ export function requestPasswordResetBody(input) {
62
+ return { email: input.email, reset_url_template: input.resetUrlTemplate };
63
+ }
64
+ export function confirmPasswordResetBody(input) {
65
+ return { token: input.token, password: input.password };
66
+ }
67
+ //# sourceMappingURL=session.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.js","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAsBnD,MAAM,CAAC,MAAM,aAAa,GAAgC,CAAC;KACxD,MAAM,CAAC;IACN,OAAO,EAAE,QAAQ;IACjB,UAAU,EAAE,QAAQ;IACpB,YAAY,EAAE,QAAQ,CAAC,QAAQ,EAAE;IACjC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE;CACtC,CAAC;KACD,SAAS,CACR,CAAC,IAAI,EAAW,EAAE,CAAC,CAAC;IAClB,MAAM,EAAE,IAAI,CAAC,OAAO;IACpB,SAAS,EAAE,IAAI,CAAC,UAA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O,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAA;AACzE,CAAC;AAiBD,MAAM,UAAU,mBAAmB,CAAC,KAA2B;IAC7D,OAAO,aAAa,CAAC;QACnB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,SAAS,EAAE,KAAK,CAAC,QAAQ;KAC1B,CAAC,CAAA;AACJ,CAAC;AAOD,MAAM,UAAU,SAAS,CAAC,KAAiB;IACzC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAA;AACzD,CAAC;AAYD,MAAM,UAAU,UAAU,CAAC,KAAkB;IAC3C,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAA;AAC3E,CAAC;AAcD,MAAM,UAAU,wBAAwB,CACtC,KAAgC;IAEhC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,kBAAkB,EAAE,KAAK,CAAC,gBAAgB,EAAE,CAAA;AAC3E,CAAC;AAQD,MAAM,UAAU,wBAAwB,CACtC,KAAgC;IAEhC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAA;AACzD,CAAC"}
@@ -0,0 +1,216 @@
1
+ /**
2
+ * Fixed value sets shared by the wire schemas and by any UI that renders a
3
+ * dropdown over one.
4
+ *
5
+ * This is the only copy. `@kelpie/server`'s module schemas import from here and
6
+ * re-export, so one array drives a table's check constraint, the route's Zod
7
+ * enum, and the browser's decoder. The dependency runs one way: the server may
8
+ * import this package, and this package depends on Zod and nothing else, which
9
+ * is what keeps it usable from a browser bundle and from the cloud repo.
10
+ */
11
+ export declare const PREFERRED_CHANNELS: readonly ['email', 'call', 'linkedin'];
12
+ export declare const INFLUENCE_LEVELS: readonly ['champion', 'decision_maker', 'influencer', 'blocker', 'end_user'];
13
+ export declare const RELATIONSHIP_LEVELS: readonly ['cold', 'warm', 'strong'];
14
+ export type PreferredChannel = (typeof PREFERRED_CHANNELS)[number];
15
+ export type Influence = (typeof INFLUENCE_LEVELS)[number];
16
+ export type Relationship = (typeof RELATIONSHIP_LEVELS)[number];
17
+ export declare const COMPANY_STAGES: readonly ['startup', 'growth', 'enterprise', 'other'];
18
+ export declare const SIZE_BANDS: readonly ['1-10', '11-50', '51-200', '201+'];
19
+ export declare const ACCOUNT_TYPES: readonly ['prospect', 'customer', 'partner', 'investor', 'other'];
20
+ export declare const ICP_FITS: readonly ['high', 'medium', 'low', 'unknown'];
21
+ export type CompanyStage = (typeof COMPANY_STAGES)[number];
22
+ export type SizeBand = (typeof SIZE_BANDS)[number];
23
+ export type AccountType = (typeof ACCOUNT_TYPES)[number];
24
+ export type IcpFit = (typeof ICP_FITS)[number];
25
+ /** Networks a person can be linked on. One list beats a column per network. */
26
+ export declare const SOCIAL_NETWORK_IDS: readonly ['angellist', 'bluesky', 'crunchbase', 'facebook', 'github', 'instagram', 'linkedin', 'mastodon', 'medium', 'substack', 'threads', 'tiktok', 'twitter', 'youtube', 'other'];
27
+ export type SocialNetworkId = (typeof SOCIAL_NETWORK_IDS)[number];
28
+ /** Display names for `SOCIAL_NETWORK_IDS`, in the same order. */
29
+ export declare const SOCIAL_NETWORK_LABELS: Readonly<Record<SocialNetworkId, string>>;
30
+ /**
31
+ * The record types a detail page exists for, and therefore the ones a UI module
32
+ * can add a tab or a sidebar card to. Lived in `@kelpie/ui` until this package
33
+ * gave it a home both the UI and the cloud repo can import.
34
+ *
35
+ * Narrower than the server's `RECORD_OBJECT_TYPES`, which is the list a
36
+ * `record.*` event may carry. A Position, a Form, and a Handbook page are all
37
+ * written and all publish events, but none of them has a detail page for a
38
+ * module to hang anything off.
39
+ */
40
+ export declare const EXTENSIBLE_RECORD_TYPES: readonly ['person', 'company', 'deal', 'opportunity', 'partnership', 'raise', 'role', 'candidate'];
41
+ export type ExtensibleRecordType = (typeof EXTENSIBLE_RECORD_TYPES)[number];
42
+ /**
43
+ * The record types a note, activity, decision, or plan item attaches to.
44
+ *
45
+ * Not the same list as `EXTENSIBLE_RECORD_TYPES`: a Role is a detail page a UI
46
+ * module can extend, but nothing attaches a note to it. Interview notes go on
47
+ * the Candidate, which is the person-and-role link.
48
+ */
49
+ export declare const RECORD_TARGET_TYPES: readonly ['person', 'company', 'deal', 'opportunity', 'partnership', 'raise', 'candidate'];
50
+ export type RecordTargetType = (typeof RECORD_TARGET_TYPES)[number];
51
+ /**
52
+ * What `GET /v1/search` looks through, and the order its groups come back in.
53
+ *
54
+ * Handbook leads because a question phrased in words rather than names is usually
55
+ * a question the handbook answers. The rest follow the sidebar.
56
+ *
57
+ * Neither of the lists above fits. `RECORD_OBJECT_TYPES` on the server has no
58
+ * Decision and does have Position, Candidate and Form: a Position is reachable
59
+ * only as the person holding it, and nobody searches for a Candidate by name
60
+ * without finding the Person first.
61
+ */
62
+ export declare const SEARCH_COLLECTIONS: readonly ['handbook_page', 'person', 'role', 'company', 'deal', 'opportunity', 'raise', 'partnership', 'decision'];
63
+ export type SearchCollection = (typeof SEARCH_COLLECTIONS)[number];
64
+ /** Whether a Role is still being hired for. */
65
+ export declare const ROLE_STATUSES: readonly ['open', 'closed'];
66
+ export type RoleStatus = (typeof ROLE_STATUSES)[number];
67
+ export declare const ROLE_STATUS_LABELS: Readonly<Record<RoleStatus, string>>;
68
+ /**
69
+ * Where a Candidate stands with the Role they are attached to.
70
+ *
71
+ * This is the Person↔Role link's state, never a column on Person: the same
72
+ * person can be in process for one role and in the nurture pile for another.
73
+ */
74
+ export declare const CANDIDATE_STATUSES: readonly ['in_process', 'nurture', 'hired', 'passed', 'withdrawn'];
75
+ export type CandidateStatus = (typeof CANDIDATE_STATUSES)[number];
76
+ export declare const CANDIDATE_STATUS_LABELS: Readonly<Record<CandidateStatus, string>>;
77
+ /** The one status that carries an interview stage. Every other status clears it. */
78
+ export declare const IN_PROCESS: CandidateStatus;
79
+ /**
80
+ * How far through interviewing a candidate is, in order. Meaningful only while
81
+ * the candidate is in process, which is why `interview_stage` is nullable.
82
+ */
83
+ export declare const INTERVIEW_STAGES: readonly ['sourced', 'screen', 'interview', 'offer'];
84
+ export type InterviewStage = (typeof INTERVIEW_STAGES)[number];
85
+ export declare const INTERVIEW_STAGE_LABELS: Readonly<Record<InterviewStage, string>>;
86
+ /** Where a candidate enters the process when no stage is named. */
87
+ export declare const FIRST_INTERVIEW_STAGE: InterviewStage;
88
+ /**
89
+ * The four pipelines whose board columns live in `pipeline_stages`. A Deal moves
90
+ * through `deal` stages and so on; the kinds are fixed even though the stages
91
+ * within each are workspace-configurable.
92
+ */
93
+ export declare const PIPELINE_KINDS: readonly ['deal', 'opportunity', 'raise', 'partnership'];
94
+ export type PipelineKind = (typeof PIPELINE_KINDS)[number];
95
+ /** Display names for `PIPELINE_KINDS`. "Fundraising" is what the nav calls a Raise. */
96
+ export declare const PIPELINE_KIND_LABELS: Readonly<Record<PipelineKind, string>>;
97
+ /**
98
+ * How far along a plan item is. Stored, never derived: whether something is
99
+ * overdue is a question about its date, and whether it is finished is a question
100
+ * about this column, and conflating the two would make a late-but-done item
101
+ * shout for attention forever.
102
+ */
103
+ export declare const PLAN_ITEM_STATUSES: readonly ['todo', 'in_progress', 'done'];
104
+ export type PlanItemStatus = (typeof PLAN_ITEM_STATUSES)[number];
105
+ export declare const PLAN_ITEM_STATUS_LABELS: Readonly<Record<PlanItemStatus, string>>;
106
+ /** The statuses that still need doing. `plan.completed` fires on leaving this set. */
107
+ export declare const OPEN_PLAN_ITEM_STATUSES: readonly ['todo', 'in_progress'];
108
+ /**
109
+ * What an activity says happened. `created`, `updated`, `stage_changed`,
110
+ * `note_added`, `linked` and `unlinked` are emitted by the server; `email`,
111
+ * `call` and `meeting` are logged history an integration or an agent supplies.
112
+ *
113
+ * `unlinked` is only filed when a link is deleted through its own route. A link
114
+ * that dies with either of its ends never reaches a service, so the timeline
115
+ * that survives keeps the `linked` row without a counterpart. That row is
116
+ * history rather than a claim about the present, so it stays true either way.
117
+ */
118
+ export declare const ACTIVITY_KINDS: readonly ['created', 'updated', 'stage_changed', 'note_added', 'email', 'call', 'meeting', 'linked', 'unlinked'];
119
+ export type ActivityKind = (typeof ACTIVITY_KINDS)[number];
120
+ export declare const MEMBER_ROLES: readonly ['owner', 'admin', 'member'];
121
+ export type MemberRole = (typeof MEMBER_ROLES)[number];
122
+ /**
123
+ * Roles an invitation may offer. Ownership is created with the workspace or
124
+ * transferred between members; it is never invited, and the `invites.role` check
125
+ * constraint says the same.
126
+ */
127
+ export declare const INVITABLE_ROLES: readonly ['admin', 'member'];
128
+ export type InvitableRole = (typeof INVITABLE_ROLES)[number];
129
+ /** What a pending invitation is called once its `expires_at` has passed. */
130
+ export declare const INVITE_STATUSES: readonly ['pending', 'expired'];
131
+ export type InviteStatus = (typeof INVITE_STATUSES)[number];
132
+ /**
133
+ * Light, dark, or whatever the operating system says.
134
+ *
135
+ * `system` is a stored answer rather than the absence of one: a reader who has
136
+ * chosen to follow the machine has expressed a preference, and it has to survive
137
+ * a move to a browser whose machine currently says something else.
138
+ */
139
+ export declare const THEME_PREFERENCES: readonly ['system', 'light', 'dark'];
140
+ export type ThemePreference = (typeof THEME_PREFERENCES)[number];
141
+ /** A paused form still exists and still renders; its submit answers 409 (`forms.md`). */
142
+ export declare const FORM_STATUSES: readonly ['active', 'paused'];
143
+ export type FormStatus = (typeof FORM_STATUSES)[number];
144
+ /**
145
+ * What a field renders as in the embed. Deliberately short: `forms.md` puts file
146
+ * uploads, multi-page forms and branching out of scope, and every type here is
147
+ * one `<input>`, `<textarea>` or `<select>`.
148
+ */
149
+ export declare const FORM_FIELD_TYPES: readonly ['text', 'email', 'textarea', 'select'];
150
+ export type FormFieldType = (typeof FORM_FIELD_TYPES)[number];
151
+ /**
152
+ * Where a field's answer lands on submit.
153
+ *
154
+ * `position.title` rather than a person field, because a job title belongs to the
155
+ * Person↔Company link and nowhere else. `submission` stores the answer without
156
+ * writing any CRM record, which is what a free-text "How can we help?" wants.
157
+ */
158
+ export declare const FORM_FIELD_MAP_TARGETS: readonly ['person.name', 'person.email', 'company.name', 'company.domain', 'position.title', 'deal.name', 'submission'];
159
+ export type FormFieldMapTarget = (typeof FORM_FIELD_MAP_TARGETS)[number];
160
+ export declare const FORM_FIELD_MAP_TARGET_LABELS: Readonly<Record<FormFieldMapTarget, string>>;
161
+ /** The one mapping a form cannot process without, and may carry at most once. */
162
+ export declare const PERSON_EMAIL_TARGET: FormFieldMapTarget;
163
+ /**
164
+ * How a select option's stored key should be read back.
165
+ *
166
+ * The answer map is `fieldId → string` on the wire either way; this says what
167
+ * the string means, so a consumer knows `"true"` was a checkbox and not a word.
168
+ */
169
+ export declare const FORM_OPTION_VALUE_TYPES: readonly ['string', 'number', 'boolean'];
170
+ export type FormOptionValueType = (typeof FORM_OPTION_VALUE_TYPES)[number];
171
+ /**
172
+ * The domain events a webhook can subscribe to.
173
+ *
174
+ * A subset of the server's event catalog on purpose: the ticket's minimum
175
+ * viable set, and the events whose payloads describe something a receiver
176
+ * outside Kelpie can act on. The rest of the catalog (`stage.changed`,
177
+ * `note.added`, membership and workspace events) is not deliverable yet, so it
178
+ * is not offered rather than accepted and silently never sent.
179
+ */
180
+ export declare const WEBHOOK_EVENTS: readonly ['record.created', 'record.updated', 'record.deleted', 'form.submitted'];
181
+ export type WebhookEvent = (typeof WEBHOOK_EVENTS)[number];
182
+ /**
183
+ * `failing` is the delivery engine's, not the customer's: it means the last
184
+ * delivery exhausted its attempts. `paused` is the customer's, and stops
185
+ * delivery entirely. A failing webhook keeps being tried, which is what lets it
186
+ * return to `active` on its own once the endpoint recovers.
187
+ */
188
+ export declare const WEBHOOK_STATUSES: readonly ['active', 'failing', 'paused'];
189
+ export type WebhookStatus = (typeof WEBHOOK_STATUSES)[number];
190
+ /** What a `PATCH` may set. `failing` is a report on the endpoint, not a request. */
191
+ export declare const WEBHOOK_SETTABLE_STATUSES: readonly ['active', 'paused'];
192
+ export type WebhookSettableStatus = (typeof WEBHOOK_SETTABLE_STATUSES)[number];
193
+ /** A delivery is only logged once it has settled, so there is no pending value. */
194
+ export declare const WEBHOOK_DELIVERY_STATUSES: readonly ['success', 'failed'];
195
+ export type WebhookDeliveryStatus = (typeof WEBHOOK_DELIVERY_STATUSES)[number];
196
+ export declare const WEBHOOK_STATUS_LABELS: Readonly<Record<WebhookStatus, string>>;
197
+ /**
198
+ * What an agent task can point at: the seven attachable record types, plus
199
+ * three surfaces that carry tasks without being note targets — a Role, a
200
+ * Handbook page, and the workspace itself (`agent-tasks.md`).
201
+ */
202
+ export declare const AGENT_TASK_TARGET_TYPES: readonly ['person', 'company', 'deal', 'opportunity', 'partnership', 'raise', 'candidate', 'role', 'handbook', 'workspace'];
203
+ export type AgentTaskTargetType = (typeof AGENT_TASK_TARGET_TYPES)[number];
204
+ /** `primary` shows as a compact action; `overflow` lives under "More". */
205
+ export declare const AGENT_TASK_PLACEMENTS: readonly ['primary', 'overflow'];
206
+ export type AgentTaskPlacement = (typeof AGENT_TASK_PLACEMENTS)[number];
207
+ /**
208
+ * Where a run's dispatch stands. The lifecycle describes the POST to the
209
+ * registered agent, not the agent's own work: Kelpie hands the prompt over and
210
+ * records whether the handover landed. `agent-tasks.md` defines no callback for
211
+ * an agent to report completion, so anything past the dispatch would be a guess.
212
+ */
213
+ export declare const AGENT_RUN_STATUSES: readonly ['queued', 'running', 'succeeded', 'failed'];
214
+ export type AgentRunStatus = (typeof AGENT_RUN_STATUSES)[number];
215
+ export declare const AGENT_RUN_STATUS_LABELS: Readonly<Record<AgentRunStatus, string>>;
216
+ //# sourceMappingURL=values.d.ts.map