@noodleseed/one 0.161.2 → 0.162.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 (60) hide show
  1. package/dist/cli.d.ts.map +1 -1
  2. package/dist/cli.js +3 -0
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/catalog.d.ts.map +1 -1
  5. package/dist/commands/catalog.js +1 -0
  6. package/dist/commands/catalog.js.map +1 -1
  7. package/dist/commands/solutions-ops.d.ts +7 -0
  8. package/dist/commands/solutions-ops.d.ts.map +1 -0
  9. package/dist/commands/solutions-ops.js +283 -0
  10. package/dist/commands/solutions-ops.js.map +1 -0
  11. package/dist/index.d.ts +1 -1
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +1 -1
  14. package/dist/index.js.map +1 -1
  15. package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.js +4 -0
  16. package/node_modules/@noodle-borg/agent-kit/dist/curated/error-fixes.js +2 -1
  17. package/node_modules/@noodle-borg/agent-kit/dist/generated/example-files.js +3 -3
  18. package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.js +3 -0
  19. package/node_modules/@noodle-borg/agent-kit/dist/skill-authoring-refs.js +7 -0
  20. package/node_modules/@noodle-borg/authoring/dist/index.d.ts +1 -0
  21. package/node_modules/@noodle-borg/authoring/dist/index.js +1 -0
  22. package/node_modules/@noodle-borg/authoring/dist/load-authored.js +1 -1
  23. package/node_modules/@noodle-borg/authoring/dist/managed-collection.d.ts +26 -0
  24. package/node_modules/@noodle-borg/authoring/dist/managed-collection.js +20 -0
  25. package/node_modules/@noodle-borg/authoring/dist/server.d.ts +3 -0
  26. package/node_modules/@noodle-borg/authoring/dist/server.js +2 -0
  27. package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-tenant-resources.js +241 -0
  28. package/node_modules/@noodle-borg/compiler/dist/artifact/assemble.js +4 -1
  29. package/node_modules/@noodle-borg/compiler/dist/artifact/types.d.ts +10 -0
  30. package/node_modules/@noodle-borg/compiler/dist/artifact/version.d.ts +4 -1
  31. package/node_modules/@noodle-borg/compiler/dist/artifact/version.js +4 -1
  32. package/node_modules/@noodle-borg/compiler/dist/compile.js +3 -0
  33. package/node_modules/@noodle-borg/compiler/dist/errors.d.ts +1 -1
  34. package/node_modules/@noodle-borg/compiler/dist/index.d.ts +2 -1
  35. package/node_modules/@noodle-borg/compiler/dist/index.js +1 -0
  36. package/node_modules/@noodle-borg/compiler/dist/managed-collections.d.ts +25 -0
  37. package/node_modules/@noodle-borg/compiler/dist/managed-collections.js +184 -0
  38. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.d.ts +14 -0
  39. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.js +3 -0
  40. package/node_modules/@noodle-borg/service/dist/business-information/contracts.js +5 -0
  41. package/node_modules/@noodle-borg/service/dist/business-information/in-memory-store.js +402 -0
  42. package/node_modules/@noodle-borg/service/dist/business-information/model.js +292 -0
  43. package/node_modules/@noodle-borg/service/dist/business-information/pagination.js +50 -0
  44. package/node_modules/@noodle-borg/service/dist/business-information/portable.js +6 -0
  45. package/node_modules/@noodle-borg/service/dist/business-information/profiles.js +121 -0
  46. package/node_modules/@noodle-borg/service/dist/business-information/validation.js +200 -0
  47. package/node_modules/@noodle-borg/service/dist/oauth/store.d.ts +2 -2
  48. package/node_modules/@noodle-borg/service/dist/routes/business-information-dispatch.js +48 -0
  49. package/node_modules/@noodle-borg/service/dist/routes/business-information-paths.js +92 -0
  50. package/node_modules/@noodle-borg/service/dist/routes/business-information-wire.js +117 -0
  51. package/node_modules/@noodle-borg/service/dist/routes/business-information.js +551 -0
  52. package/node_modules/@noodle-borg/service/dist/service-resource-cleanup.js +2 -0
  53. package/node_modules/@noodle-borg/service/dist/service.js +25 -0
  54. package/node_modules/@noodle-borg/wire-contracts/dist/business-information.d.ts +583 -0
  55. package/node_modules/@noodle-borg/wire-contracts/dist/business-information.js +205 -0
  56. package/node_modules/@noodle-borg/wire-contracts/dist/index.d.ts +4 -3
  57. package/node_modules/@noodle-borg/wire-contracts/dist/index.js +1 -0
  58. package/node_modules/@noodle-borg/wire-contracts/dist/knowledge.d.ts +3 -3
  59. package/node_modules/@noodle-borg/wire-contracts/dist/managed-assistant-sponsorship.d.ts +8 -8
  60. package/package.json +1 -1
@@ -0,0 +1,205 @@
1
+ import { z } from 'zod';
2
+ /** Public, data-driven solution profiles shipped by the managed-record MVP. */
3
+ export const SOLUTION_PROFILE_IDS = ['travel', 'b2b_saas', 'ecommerce', 'restaurant'];
4
+ export const SolutionProfileIdSchema = z.enum(SOLUTION_PROFILE_IDS);
5
+ export const MANAGED_RECORD_RETENTION_DAYS = [7, 30, 90];
6
+ export const ManagedRecordRetentionDaysSchema = z.union([
7
+ z.literal(7),
8
+ z.literal(30),
9
+ z.literal(90),
10
+ ]);
11
+ export const MANAGED_RECORD_STATUSES = ['new', 'in_progress', 'resolved', 'closed'];
12
+ export const ManagedRecordStatusSchema = z.enum(MANAGED_RECORD_STATUSES);
13
+ export const BUSINESS_GRANT_ROLES = ['administrator', 'manager', 'operator', 'viewer'];
14
+ export const BusinessGrantRoleSchema = z.enum(BUSINESS_GRANT_ROLES);
15
+ export const MANAGED_RECORD_ORIGIN_SURFACES = ['public', 'portal', 'mcp', 'api'];
16
+ export const ManagedRecordOriginSurfaceSchema = z.enum(MANAGED_RECORD_ORIGIN_SURFACES);
17
+ const id = z.string().min(1).max(128);
18
+ const slug = z
19
+ .string()
20
+ .regex(/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/)
21
+ .max(63);
22
+ const collectionKey = z
23
+ .string()
24
+ .regex(/^[a-z][a-z0-9_]*$/)
25
+ .max(64);
26
+ const instant = z.iso.datetime({ offset: true });
27
+ const digest = z.string().regex(/^[a-f0-9]{64}$/);
28
+ const jsonObject = z.record(z.string(), z.unknown());
29
+ export const ManagedCollectionProfileSchema = z.strictObject({
30
+ key: collectionKey,
31
+ title: z.string().min(1).max(120),
32
+ singularTitle: z.string().min(1).max(120),
33
+ schemaVersion: z.number().int().positive(),
34
+ schemaDigest: digest,
35
+ recordSchema: jsonObject,
36
+ summaryFields: z.array(z.string().min(1).max(64)).max(6),
37
+ });
38
+ export const SolutionProfileSchema = z.strictObject({
39
+ id: SolutionProfileIdSchema,
40
+ title: z.string().min(1).max(80),
41
+ description: z.string().min(1).max(240),
42
+ collection: ManagedCollectionProfileSchema,
43
+ });
44
+ export const SolutionCatalogResponseSchema = z.strictObject({
45
+ ok: z.literal(true),
46
+ data: z.strictObject({
47
+ profiles: z.array(SolutionProfileSchema).max(SOLUTION_PROFILE_IDS.length),
48
+ }),
49
+ });
50
+ export const SolutionInstallationCreateRequestSchema = z.strictObject({
51
+ profileId: SolutionProfileIdSchema,
52
+ appSlug: slug,
53
+ environment: z.string().min(1).max(63),
54
+ retentionDays: ManagedRecordRetentionDaysSchema,
55
+ });
56
+ export const SolutionInstallationSchema = z.strictObject({
57
+ id,
58
+ organizationId: id,
59
+ profileId: SolutionProfileIdSchema,
60
+ appSlug: slug,
61
+ environment: z.string().min(1).max(63),
62
+ retentionDays: ManagedRecordRetentionDaysSchema,
63
+ publicId: id,
64
+ active: z.boolean(),
65
+ currentRole: BusinessGrantRoleSchema,
66
+ revision: z.number().int().positive(),
67
+ collection: ManagedCollectionProfileSchema,
68
+ createdAt: instant,
69
+ updatedAt: instant,
70
+ createdBySubject: id,
71
+ });
72
+ export const SolutionInstallationResponseSchema = z.strictObject({
73
+ ok: z.literal(true),
74
+ data: z.strictObject({ installation: SolutionInstallationSchema }),
75
+ });
76
+ export const SolutionInstallationListResponseSchema = z.strictObject({
77
+ ok: z.literal(true),
78
+ data: z.strictObject({ installations: z.array(SolutionInstallationSchema).max(100) }),
79
+ });
80
+ export const BusinessGrantCreateRequestSchema = z.strictObject({
81
+ subject: id,
82
+ email: z.email().max(254),
83
+ role: BusinessGrantRoleSchema,
84
+ expectedRevision: z.number().int().nonnegative().optional(),
85
+ });
86
+ export const BusinessGrantSchema = z.strictObject({
87
+ installationId: id,
88
+ subject: id,
89
+ email: z.email().max(254),
90
+ role: BusinessGrantRoleSchema,
91
+ revision: z.number().int().positive(),
92
+ createdAt: instant,
93
+ createdBySubject: id,
94
+ revokedAt: instant.optional(),
95
+ });
96
+ export const BusinessGrantResponseSchema = z.strictObject({
97
+ ok: z.literal(true),
98
+ data: z.strictObject({ grant: BusinessGrantSchema }),
99
+ });
100
+ export const BusinessGrantListResponseSchema = z.strictObject({
101
+ ok: z.literal(true),
102
+ data: z.strictObject({ grants: z.array(BusinessGrantSchema).max(100) }),
103
+ });
104
+ export const ManagedRecordCreateRequestSchema = z.strictObject({
105
+ payload: jsonObject,
106
+ });
107
+ export const ManagedRecordOriginSchema = z.strictObject({
108
+ surface: ManagedRecordOriginSurfaceSchema,
109
+ subject: id.optional(),
110
+ });
111
+ export const ManagedRecordSchema = z.strictObject({
112
+ id,
113
+ installationId: id,
114
+ collection: collectionKey,
115
+ schemaVersion: z.number().int().positive(),
116
+ schemaDigest: digest,
117
+ payload: jsonObject,
118
+ status: ManagedRecordStatusSchema,
119
+ assigneeSubject: id.optional(),
120
+ revision: z.number().int().positive(),
121
+ origin: ManagedRecordOriginSchema,
122
+ createdAt: instant,
123
+ updatedAt: instant,
124
+ retentionExpiresAt: instant,
125
+ });
126
+ export const ManagedRecordTombstoneSchema = z.strictObject({
127
+ id,
128
+ installationId: id,
129
+ collection: collectionKey,
130
+ status: ManagedRecordStatusSchema,
131
+ revision: z.number().int().positive(),
132
+ deletedAt: instant,
133
+ deletionReason: z.enum(['customer_request', 'retention_expired']),
134
+ });
135
+ export const ManagedRecordResponseSchema = z.strictObject({
136
+ ok: z.literal(true),
137
+ data: z.strictObject({ record: ManagedRecordSchema }),
138
+ });
139
+ export const ManagedRecordListResponseSchema = z.strictObject({
140
+ ok: z.literal(true),
141
+ data: z.strictObject({
142
+ records: z.array(z.union([ManagedRecordSchema, ManagedRecordTombstoneSchema])).max(100),
143
+ nextCursor: z.string().min(1).optional(),
144
+ }),
145
+ });
146
+ const expectedRevision = z.number().int().positive();
147
+ export const ManagedRecordMutationRequestSchema = z.discriminatedUnion('operation', [
148
+ z.strictObject({ operation: z.literal('update'), expectedRevision, patch: jsonObject }),
149
+ z.strictObject({
150
+ operation: z.literal('assign'),
151
+ expectedRevision,
152
+ assigneeSubject: id.nullable(),
153
+ }),
154
+ z.strictObject({
155
+ operation: z.literal('set-status'),
156
+ expectedRevision,
157
+ status: ManagedRecordStatusSchema,
158
+ }),
159
+ z.strictObject({
160
+ operation: z.literal('add-note'),
161
+ expectedRevision,
162
+ note: z.string().min(1).max(4_000),
163
+ }),
164
+ ]);
165
+ export const ManagedRecordActivitySchema = z.strictObject({
166
+ id,
167
+ recordId: id,
168
+ revision: z.number().int().positive(),
169
+ operation: z.enum(['create', 'update', 'assign', 'set-status', 'add-note', 'delete']),
170
+ actorSubject: id.optional(),
171
+ createdAt: instant,
172
+ note: z.string().max(4_000).optional(),
173
+ });
174
+ export const ManagedRecordActivityListResponseSchema = z.strictObject({
175
+ ok: z.literal(true),
176
+ data: z.strictObject({ activities: z.array(ManagedRecordActivitySchema).max(100) }),
177
+ });
178
+ export const ManagedRecordDeleteResponseSchema = z.strictObject({
179
+ ok: z.literal(true),
180
+ data: z.strictObject({ recordId: id, deletedAt: instant }),
181
+ });
182
+ export const ManagedRecordExportResponseSchema = z.strictObject({
183
+ ok: z.literal(true),
184
+ data: z.strictObject({
185
+ records: z.array(z.union([ManagedRecordSchema, ManagedRecordTombstoneSchema])).max(500),
186
+ nextCursor: z.string().min(1).optional(),
187
+ }),
188
+ });
189
+ export const PublicSolutionIntakeResponseSchema = z.strictObject({
190
+ ok: z.literal(true),
191
+ data: z.strictObject({
192
+ publicId: id,
193
+ title: z.string().min(1).max(120),
194
+ description: z.string().min(1).max(240),
195
+ collection: ManagedCollectionProfileSchema,
196
+ }),
197
+ });
198
+ export const PublicSolutionIntakeReceiptResponseSchema = z.strictObject({
199
+ ok: z.literal(true),
200
+ data: z.strictObject({
201
+ recordId: id,
202
+ receivedAt: instant,
203
+ }),
204
+ });
205
+ //# sourceMappingURL=business-information.js.map
@@ -14,6 +14,7 @@ export * from './assistant.js';
14
14
  export * from './billing-operations.js';
15
15
  export * from './billing-org-transfer.js';
16
16
  export * from './billing-read.js';
17
+ export * from './business-information.js';
17
18
  export * from './config.js';
18
19
  export * from './control-plane.js';
19
20
  export * from './deployment-package.js';
@@ -26,10 +27,10 @@ export * from './platform-auth.js';
26
27
  /** Informational origin of a deployment; never an authorization or policy input. */
27
28
  export declare const DEPLOYMENT_SOURCES: readonly ["console-example", "cli", "github", "api"];
28
29
  export declare const deploymentSourceSchema: z.ZodEnum<{
30
+ api: "api";
29
31
  cli: "cli";
30
32
  "console-example": "console-example";
31
33
  github: "github";
32
- api: "api";
33
34
  }>;
34
35
  export type DeploymentSource = z.infer<typeof deploymentSourceSchema>;
35
36
  /** A packaged asset already hosted in object storage, referenced by the manifest being deployed. */
@@ -90,10 +91,10 @@ export declare const deployRequestSchema: z.ZodObject<{
90
91
  }>>>;
91
92
  serverVersion: z.ZodOptional<z.ZodString>;
92
93
  deploymentSource: z.ZodOptional<z.ZodEnum<{
94
+ api: "api";
93
95
  cli: "cli";
94
96
  "console-example": "console-example";
95
97
  github: "github";
96
- api: "api";
97
98
  }>>;
98
99
  }, z.core.$strip>;
99
100
  export type DeployRequest = z.infer<typeof deployRequestSchema>;
@@ -173,10 +174,10 @@ export declare const deployPreflightRequestSchema: z.ZodObject<{
173
174
  }>>>;
174
175
  serverVersion: z.ZodOptional<z.ZodString>;
175
176
  deploymentSource: z.ZodOptional<z.ZodEnum<{
177
+ api: "api";
176
178
  cli: "cli";
177
179
  "console-example": "console-example";
178
180
  github: "github";
179
- api: "api";
180
181
  }>>;
181
182
  }, z.core.$strip>;
182
183
  export type DeployPreflightRequest = z.infer<typeof deployPreflightRequestSchema>;
@@ -16,6 +16,7 @@ export * from './assistant.js';
16
16
  export * from './billing-operations.js';
17
17
  export * from './billing-org-transfer.js';
18
18
  export * from './billing-read.js';
19
+ export * from './business-information.js';
19
20
  export * from './config.js';
20
21
  export * from './control-plane.js';
21
22
  export * from './deployment-package.js';
@@ -87,8 +87,8 @@ export type KnowledgeBudgetState = z.output<typeof knowledgeBudgetStateSchema>;
87
87
  export declare const knowledgeCrawlStateSchema: z.ZodObject<{
88
88
  status: z.ZodEnum<{
89
89
  not_started: "not_started";
90
- failed: "failed";
91
90
  in_progress: "in_progress";
91
+ failed: "failed";
92
92
  completed: "completed";
93
93
  }>;
94
94
  lastCompletedAt: z.ZodOptional<z.ZodNumber>;
@@ -102,8 +102,8 @@ export declare const knowledgeRefreshResponseSchema: z.ZodObject<{
102
102
  crawl: z.ZodObject<{
103
103
  status: z.ZodEnum<{
104
104
  not_started: "not_started";
105
- failed: "failed";
106
105
  in_progress: "in_progress";
106
+ failed: "failed";
107
107
  completed: "completed";
108
108
  }>;
109
109
  lastCompletedAt: z.ZodOptional<z.ZodNumber>;
@@ -157,8 +157,8 @@ export declare const knowledgeStatusResponseSchema: z.ZodObject<{
157
157
  crawl: z.ZodOptional<z.ZodObject<{
158
158
  status: z.ZodEnum<{
159
159
  not_started: "not_started";
160
- failed: "failed";
161
160
  in_progress: "in_progress";
161
+ failed: "failed";
162
162
  completed: "completed";
163
163
  }>;
164
164
  lastCompletedAt: z.ZodOptional<z.ZodNumber>;
@@ -41,11 +41,11 @@ export declare const ManagedAssistantSponsorshipResponseSchema: z.ZodObject<{
41
41
  totalTurnsPerDay: z.ZodNumber;
42
42
  spend: z.ZodObject<{
43
43
  state: z.ZodEnum<{
44
+ closed: "closed";
44
45
  normal: "normal";
45
46
  approaching: "approaching";
46
47
  near: "near";
47
48
  limited: "limited";
48
- closed: "closed";
49
49
  }>;
50
50
  allowanceUnits: z.ZodNumber;
51
51
  usedUnitsToday: z.ZodNumber;
@@ -73,11 +73,11 @@ export declare const ManagedAssistantSponsorshipResponseSchema: z.ZodObject<{
73
73
  globalTurnsPerDay: z.ZodNumber;
74
74
  spend: z.ZodObject<{
75
75
  state: z.ZodEnum<{
76
+ closed: "closed";
76
77
  normal: "normal";
77
78
  approaching: "approaching";
78
79
  near: "near";
79
80
  limited: "limited";
80
- closed: "closed";
81
81
  }>;
82
82
  allowanceUnits: z.ZodNumber;
83
83
  usedUnitsToday: z.ZodNumber;
@@ -93,11 +93,11 @@ export declare const ManagedAssistantSponsorshipClientResponseSchema: z.ZodObjec
93
93
  data: z.ZodObject<{
94
94
  spend: z.ZodObject<{
95
95
  state: z.ZodEnum<{
96
+ closed: "closed";
96
97
  normal: "normal";
97
98
  approaching: "approaching";
98
99
  near: "near";
99
100
  limited: "limited";
100
- closed: "closed";
101
101
  }>;
102
102
  allowanceUnits: z.ZodNumber;
103
103
  usedUnitsToday: z.ZodNumber;
@@ -124,11 +124,11 @@ export declare const ManagedAssistantSponsorshipClientResponseSchema: z.ZodObjec
124
124
  globalTurnsPerDay: z.ZodNumber;
125
125
  spend: z.ZodObject<{
126
126
  state: z.ZodEnum<{
127
+ closed: "closed";
127
128
  normal: "normal";
128
129
  approaching: "approaching";
129
130
  near: "near";
130
131
  limited: "limited";
131
- closed: "closed";
132
132
  }>;
133
133
  allowanceUnits: z.ZodNumber;
134
134
  usedUnitsToday: z.ZodNumber;
@@ -172,11 +172,11 @@ export declare const ManagedAssistantSponsorshipGrantMutationResponseSchema: z.Z
172
172
  totalTurnsPerDay: z.ZodNumber;
173
173
  spend: z.ZodObject<{
174
174
  state: z.ZodEnum<{
175
+ closed: "closed";
175
176
  normal: "normal";
176
177
  approaching: "approaching";
177
178
  near: "near";
178
179
  limited: "limited";
179
- closed: "closed";
180
180
  }>;
181
181
  allowanceUnits: z.ZodNumber;
182
182
  usedUnitsToday: z.ZodNumber;
@@ -204,11 +204,11 @@ export declare const ManagedAssistantSponsorshipGrantMutationResponseSchema: z.Z
204
204
  globalTurnsPerDay: z.ZodNumber;
205
205
  spend: z.ZodObject<{
206
206
  state: z.ZodEnum<{
207
+ closed: "closed";
207
208
  normal: "normal";
208
209
  approaching: "approaching";
209
210
  near: "near";
210
211
  limited: "limited";
211
- closed: "closed";
212
212
  }>;
213
213
  allowanceUnits: z.ZodNumber;
214
214
  usedUnitsToday: z.ZodNumber;
@@ -243,11 +243,11 @@ export declare const ManagedAssistantSponsorshipGrantMutationClientResponseSchem
243
243
  sponsorship: z.ZodObject<{
244
244
  spend: z.ZodObject<{
245
245
  state: z.ZodEnum<{
246
+ closed: "closed";
246
247
  normal: "normal";
247
248
  approaching: "approaching";
248
249
  near: "near";
249
250
  limited: "limited";
250
- closed: "closed";
251
251
  }>;
252
252
  allowanceUnits: z.ZodNumber;
253
253
  usedUnitsToday: z.ZodNumber;
@@ -274,11 +274,11 @@ export declare const ManagedAssistantSponsorshipGrantMutationClientResponseSchem
274
274
  globalTurnsPerDay: z.ZodNumber;
275
275
  spend: z.ZodObject<{
276
276
  state: z.ZodEnum<{
277
+ closed: "closed";
277
278
  normal: "normal";
278
279
  approaching: "approaching";
279
280
  near: "near";
280
281
  limited: "limited";
281
- closed: "closed";
282
282
  }>;
283
283
  allowanceUnits: z.ZodNumber;
284
284
  usedUnitsToday: z.ZodNumber;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noodleseed/one",
3
- "version": "0.161.2",
3
+ "version": "0.162.0",
4
4
  "private": false,
5
5
  "description": "Noodle CLI by Noodle Seed — author, run, and deploy declarative MCP servers. Embedding the assistant in your own web app is @noodleseed/assistant.",
6
6
  "license": "Apache-2.0",