@owlmeans/viable-sdk 0.1.19-rc.0 → 0.1.19

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 (165) hide show
  1. package/README.md +1 -1
  2. package/agent-meta/manifest.json +2 -2
  3. package/agent-meta/skills/viable-sdk/SKILL.md +123 -13
  4. package/build/api/collect/types.d.ts +12 -1
  5. package/build/api/collect/types.d.ts.map +1 -1
  6. package/build/api/collect.d.ts.map +1 -1
  7. package/build/api/collect.js +18 -1
  8. package/build/api/collect.js.map +1 -1
  9. package/build/api/consts.local.d.ts +2 -0
  10. package/build/api/consts.local.d.ts.map +1 -1
  11. package/build/api/consts.local.js +2 -0
  12. package/build/api/consts.local.js.map +1 -1
  13. package/build/api/remote.d.ts.map +1 -1
  14. package/build/api/remote.js +13 -0
  15. package/build/api/remote.js.map +1 -1
  16. package/build/context/index.d.ts.map +1 -1
  17. package/build/context/index.js +7 -3
  18. package/build/context/index.js.map +1 -1
  19. package/build/context/types.d.ts +7 -1
  20. package/build/context/types.d.ts.map +1 -1
  21. package/build/session/consts.local.d.ts +2 -0
  22. package/build/session/consts.local.d.ts.map +1 -1
  23. package/build/session/consts.local.js +2 -0
  24. package/build/session/consts.local.js.map +1 -1
  25. package/build/session/index.d.ts.map +1 -1
  26. package/build/session/index.js +18 -1
  27. package/build/session/index.js.map +1 -1
  28. package/build/session/types.d.ts +7 -0
  29. package/build/session/types.d.ts.map +1 -1
  30. package/build/tools/catalogue.d.ts.map +1 -1
  31. package/build/tools/catalogue.js +13 -2
  32. package/build/tools/catalogue.js.map +1 -1
  33. package/build/tools/consts.d.ts +9 -1
  34. package/build/tools/consts.d.ts.map +1 -1
  35. package/build/tools/consts.js +16 -0
  36. package/build/tools/consts.js.map +1 -1
  37. package/build/tools/consts.local.d.ts +1 -9
  38. package/build/tools/consts.local.d.ts.map +1 -1
  39. package/build/tools/consts.local.js +2 -16
  40. package/build/tools/consts.local.js.map +1 -1
  41. package/build/tools/index.d.ts +6 -0
  42. package/build/tools/index.d.ts.map +1 -1
  43. package/build/tools/index.js +4 -0
  44. package/build/tools/index.js.map +1 -1
  45. package/build/tools/instructions/types.d.ts +21 -0
  46. package/build/tools/instructions/types.d.ts.map +1 -0
  47. package/build/tools/instructions/types.js +2 -0
  48. package/build/tools/instructions/types.js.map +1 -0
  49. package/build/tools/instructions.d.ts +4 -0
  50. package/build/tools/instructions.d.ts.map +1 -0
  51. package/build/tools/instructions.js +143 -0
  52. package/build/tools/instructions.js.map +1 -0
  53. package/build/tools/mcp.d.ts +2 -6
  54. package/build/tools/mcp.d.ts.map +1 -1
  55. package/build/tools/mcp.js +36 -122
  56. package/build/tools/mcp.js.map +1 -1
  57. package/build/tools/platform.d.ts.map +1 -1
  58. package/build/tools/platform.js +13 -4
  59. package/build/tools/platform.js.map +1 -1
  60. package/build/tools/profile/consts.d.ts +8 -0
  61. package/build/tools/profile/consts.d.ts.map +1 -0
  62. package/build/tools/profile/consts.js +10 -0
  63. package/build/tools/profile/consts.js.map +1 -0
  64. package/build/tools/profile/listing/consts.local.d.ts +44 -0
  65. package/build/tools/profile/listing/consts.local.d.ts.map +1 -0
  66. package/build/tools/profile/listing/consts.local.js +612 -0
  67. package/build/tools/profile/listing/consts.local.js.map +1 -0
  68. package/build/tools/profile/listing/presentation.d.ts +12 -0
  69. package/build/tools/profile/listing/presentation.d.ts.map +1 -0
  70. package/build/tools/profile/listing/presentation.js +38 -0
  71. package/build/tools/profile/listing/presentation.js.map +1 -0
  72. package/build/tools/profile/listing/text.d.ts +13 -0
  73. package/build/tools/profile/listing/text.d.ts.map +1 -0
  74. package/build/tools/profile/listing/text.js +51 -0
  75. package/build/tools/profile/listing/text.js.map +1 -0
  76. package/build/tools/profile/listing/types.d.ts +18 -0
  77. package/build/tools/profile/listing/types.d.ts.map +1 -0
  78. package/build/tools/profile/listing/types.js +2 -0
  79. package/build/tools/profile/listing/types.js.map +1 -0
  80. package/build/tools/profile/listing.d.ts +18 -0
  81. package/build/tools/profile/listing.d.ts.map +1 -0
  82. package/build/tools/profile/listing.js +66 -0
  83. package/build/tools/profile/listing.js.map +1 -0
  84. package/build/tools/profile/presentation/platform/account.d.ts +4 -0
  85. package/build/tools/profile/presentation/platform/account.d.ts.map +1 -0
  86. package/build/tools/profile/presentation/platform/account.js +46 -0
  87. package/build/tools/profile/presentation/platform/account.js.map +1 -0
  88. package/build/tools/profile/presentation/platform/consts.d.ts +541 -0
  89. package/build/tools/profile/presentation/platform/consts.d.ts.map +1 -0
  90. package/build/tools/profile/presentation/platform/consts.js +335 -0
  91. package/build/tools/profile/presentation/platform/consts.js.map +1 -0
  92. package/build/tools/profile/presentation/platform/git.d.ts +4 -0
  93. package/build/tools/profile/presentation/platform/git.d.ts.map +1 -0
  94. package/build/tools/profile/presentation/platform/git.js +123 -0
  95. package/build/tools/profile/presentation/platform/git.js.map +1 -0
  96. package/build/tools/profile/presentation/platform/iam.d.ts +4 -0
  97. package/build/tools/profile/presentation/platform/iam.d.ts.map +1 -0
  98. package/build/tools/profile/presentation/platform/iam.js +202 -0
  99. package/build/tools/profile/presentation/platform/iam.js.map +1 -0
  100. package/build/tools/profile/presentation/platform/production.d.ts +4 -0
  101. package/build/tools/profile/presentation/platform/production.d.ts.map +1 -0
  102. package/build/tools/profile/presentation/platform/production.js +73 -0
  103. package/build/tools/profile/presentation/platform/production.js.map +1 -0
  104. package/build/tools/profile/presentation/platform/read.d.ts +4 -0
  105. package/build/tools/profile/presentation/platform/read.d.ts.map +1 -0
  106. package/build/tools/profile/presentation/platform/read.js +68 -0
  107. package/build/tools/profile/presentation/platform/read.js.map +1 -0
  108. package/build/tools/profile/presentation/platform/settings.d.ts +4 -0
  109. package/build/tools/profile/presentation/platform/settings.d.ts.map +1 -0
  110. package/build/tools/profile/presentation/platform/settings.js +48 -0
  111. package/build/tools/profile/presentation/platform/settings.js.map +1 -0
  112. package/build/tools/profile/presentation/platform/types.d.ts +174 -0
  113. package/build/tools/profile/presentation/platform/types.d.ts.map +1 -0
  114. package/build/tools/profile/presentation/platform/types.js +2 -0
  115. package/build/tools/profile/presentation/platform/types.js.map +1 -0
  116. package/build/tools/profile/presentation/platform/workspace.d.ts +4 -0
  117. package/build/tools/profile/presentation/platform/workspace.d.ts.map +1 -0
  118. package/build/tools/profile/presentation/platform/workspace.js +37 -0
  119. package/build/tools/profile/presentation/platform/workspace.js.map +1 -0
  120. package/build/tools/profile/presentation/platform.d.ts +11 -0
  121. package/build/tools/profile/presentation/platform.d.ts.map +1 -0
  122. package/build/tools/profile/presentation/platform.js +64 -0
  123. package/build/tools/profile/presentation/platform.js.map +1 -0
  124. package/build/tools/profile/presentation/work/consts.d.ts +22 -0
  125. package/build/tools/profile/presentation/work/consts.d.ts.map +1 -0
  126. package/build/tools/profile/presentation/work/consts.js +22 -0
  127. package/build/tools/profile/presentation/work/consts.js.map +1 -0
  128. package/build/tools/profile/presentation/work/presenters.d.ts +4 -0
  129. package/build/tools/profile/presentation/work/presenters.d.ts.map +1 -0
  130. package/build/tools/profile/presentation/work/presenters.js +502 -0
  131. package/build/tools/profile/presentation/work/presenters.js.map +1 -0
  132. package/build/tools/profile/presentation/work/schemas.d.ts +496 -0
  133. package/build/tools/profile/presentation/work/schemas.d.ts.map +1 -0
  134. package/build/tools/profile/presentation/work/schemas.js +358 -0
  135. package/build/tools/profile/presentation/work/schemas.js.map +1 -0
  136. package/build/tools/profile/presentation/work/shape.d.ts +4 -0
  137. package/build/tools/profile/presentation/work/shape.d.ts.map +1 -0
  138. package/build/tools/profile/presentation/work/shape.js +35 -0
  139. package/build/tools/profile/presentation/work/shape.js.map +1 -0
  140. package/build/tools/profile/presentation/work/types.d.ts +109 -0
  141. package/build/tools/profile/presentation/work/types.d.ts.map +1 -0
  142. package/build/tools/profile/presentation/work/types.js +2 -0
  143. package/build/tools/profile/presentation/work/types.js.map +1 -0
  144. package/build/tools/profile/presentation/work.d.ts +13 -0
  145. package/build/tools/profile/presentation/work.d.ts.map +1 -0
  146. package/build/tools/profile/presentation/work.js +66 -0
  147. package/build/tools/profile/presentation/work.js.map +1 -0
  148. package/build/tools/profile/types.d.ts +125 -0
  149. package/build/tools/profile/types.d.ts.map +1 -0
  150. package/build/tools/profile/types.js +2 -0
  151. package/build/tools/profile/types.js.map +1 -0
  152. package/build/tools/profile.d.ts +9 -0
  153. package/build/tools/profile.d.ts.map +1 -0
  154. package/build/tools/profile.js +114 -0
  155. package/build/tools/profile.js.map +1 -0
  156. package/build/tools/status/types.d.ts +7 -1
  157. package/build/tools/status/types.d.ts.map +1 -1
  158. package/build/tools/status.d.ts.map +1 -1
  159. package/build/tools/status.js +5 -1
  160. package/build/tools/status.js.map +1 -1
  161. package/build/tools/types.d.ts +12 -1
  162. package/build/tools/types.d.ts.map +1 -1
  163. package/build/types.d.ts +7 -1
  164. package/build/types.d.ts.map +1 -1
  165. package/package.json +25 -25
@@ -0,0 +1,202 @@
1
+ import { presentReadHelper as read } from './read.js';
2
+ export const createIamPresentHelper = () => {
3
+ /*
4
+ * Subjects travel by `profileId`, organizations by `entitySlug` and groups by key — what every
5
+ * manage call names. A grant's `clientId` is the app's own record and is never kept.
6
+ */
7
+ const userOf = (value) => {
8
+ const user = read.record(value);
9
+ return read.compact({
10
+ profileId: read.text(user.profileId),
11
+ email: read.maybeText(user.email),
12
+ name: read.maybeText(user.name),
13
+ role: read.text(user.role),
14
+ disabled: read.flag(user.disabled),
15
+ grantCount: read.maybeCount(user.grantCount),
16
+ home: read.maybeText(user.home),
17
+ memberships: Array.isArray(user.memberships)
18
+ ? read.records(user.memberships).map(membership => read.compact({
19
+ entitySlug: read.text(membership.entitySlug),
20
+ title: read.maybeText(membership.title),
21
+ owner: read.flag(membership.owner),
22
+ groups: read.texts(membership.groups),
23
+ home: read.maybeFlag(membership.home),
24
+ }))
25
+ : undefined,
26
+ });
27
+ };
28
+ const permissionOf = (value) => {
29
+ const definition = read.record(value);
30
+ return read.compact({
31
+ name: read.text(definition.name),
32
+ title: read.maybeText(definition.title),
33
+ area: read.maybeText(definition.area),
34
+ defaultClass: read.maybeText(definition.defaultClass),
35
+ resourceScoped: read.flag(definition.resourceScoped),
36
+ entityScoped: read.flag(definition.entityScoped),
37
+ managed: read.flag(definition.managed),
38
+ });
39
+ };
40
+ const groupRefOf = (value) => {
41
+ const ref = read.recordOrNull(value);
42
+ return ref == null ? undefined : { entitySlug: read.text(ref.entitySlug), key: read.text(ref.key) };
43
+ };
44
+ const grantOf = (value) => {
45
+ const grant = read.record(value);
46
+ return read.compact({
47
+ permission: read.text(grant.permission),
48
+ profileId: read.maybeText(grant.profileId),
49
+ group: groupRefOf(grant.group),
50
+ entitySlug: read.maybeText(grant.entitySlug),
51
+ resources: Array.isArray(grant.resources) ? read.texts(grant.resources) : undefined,
52
+ mode: read.maybeText(grant.mode),
53
+ origin: read.maybeText(grant.origin),
54
+ through: groupRefOf(grant.through),
55
+ restricted: read.maybeFlag(grant.restricted),
56
+ });
57
+ };
58
+ const organizationOf = (value) => {
59
+ const organization = read.record(value);
60
+ return read.compact({
61
+ entitySlug: read.text(organization.entitySlug),
62
+ title: read.maybeText(organization.title),
63
+ members: read.maybeCount(organization.members),
64
+ });
65
+ };
66
+ const memberOf = (value) => {
67
+ const member = read.record(value);
68
+ return read.compact({
69
+ profileId: read.text(member.profileId),
70
+ email: read.maybeText(member.email),
71
+ name: read.maybeText(member.name),
72
+ owner: read.flag(member.owner),
73
+ groups: read.texts(member.groups),
74
+ managed: read.maybeFlag(member.managed),
75
+ });
76
+ };
77
+ const groupOf = (value) => {
78
+ const group = read.record(value);
79
+ return read.compact({
80
+ key: read.text(group.key),
81
+ title: read.maybeText(group.title),
82
+ managed: read.maybeFlag(group.managed),
83
+ members: read.maybeCount(group.members),
84
+ bundles: read.records(group.bundles).map(bundle => {
85
+ const filter = read.recordOrNull(bundle.filter);
86
+ return read.compact({
87
+ permissions: Array.isArray(bundle.permissions) ? read.texts(bundle.permissions) : undefined,
88
+ filter: filter == null
89
+ ? undefined
90
+ : read.compact({
91
+ areas: Array.isArray(filter.areas) ? read.textsOrNulls(filter.areas) : undefined,
92
+ managed: read.maybeFlag(filter.managed),
93
+ resourceScoped: read.maybeFlag(filter.resourceScoped),
94
+ entityScoped: read.maybeFlag(filter.entityScoped),
95
+ }),
96
+ });
97
+ }),
98
+ });
99
+ };
100
+ /** A listing's items, read with one reader, and whether it is kept in a console of its own. */
101
+ const listing = (value, item) => {
102
+ const list = read.record(value);
103
+ return { items: read.records(list.items).map(item), external: read.maybeFlag(list.external) };
104
+ };
105
+ /** The organization a result names — its own, else the call's. */
106
+ const slugOf = (structured, args, fallback) => read.maybeText(structured.entitySlug) ?? read.maybeText(fallback) ?? read.text(args.entitySlug).trim();
107
+ const users = read.total((structured, args) => {
108
+ const list = listing(structured.users, userOf);
109
+ // `all: true` names no project: every application of the organization is listed.
110
+ const projectId = read.maybeText(structured.projectId)
111
+ ?? (args.all === true ? undefined : read.maybeText(args.projectId));
112
+ return read.compact({ projectId, scope: read.maybeText(structured.scope), external: list.external, users: list.items });
113
+ });
114
+ const user = read.total((structured, args) => {
115
+ const view = read.recordOrNull(structured.user);
116
+ return read.compact({
117
+ projectId: read.project(structured, args),
118
+ profileId: read.maybeText(view?.profileId) ?? read.maybeText(structured.profileId) ?? read.text(args.profileId).trim(),
119
+ user: view != null ? userOf(view) : undefined,
120
+ removed: read.maybeFlag(structured.removed),
121
+ });
122
+ });
123
+ const permissions = read.total((structured, args) => {
124
+ const view = read.record(structured.permissions);
125
+ const tenancy = read.record(view.tenancy);
126
+ const list = listing(view, permissionOf);
127
+ return read.compact({
128
+ projectId: read.project(structured, args),
129
+ tenancy: { operators: read.flag(tenancy.operators), users: read.flag(tenancy.users) },
130
+ external: list.external,
131
+ permissions: list.items,
132
+ });
133
+ });
134
+ const permission = read.total((structured, args) => ({
135
+ projectId: read.project(structured, args),
136
+ permission: permissionOf(structured.definition),
137
+ }));
138
+ const grants = read.total((structured, args) => {
139
+ const list = listing(structured.grants, grantOf);
140
+ return read.compact({ projectId: read.project(structured, args), external: list.external, grants: list.items });
141
+ });
142
+ const grant = read.total((structured, args) => read.compact({
143
+ projectId: read.project(structured, args),
144
+ grant: read.recordOrNull(structured.grant) != null ? grantOf(structured.grant) : undefined,
145
+ revoked: read.recordOrNull(structured.revoked) != null ? grantOf(structured.revoked) : undefined,
146
+ }));
147
+ const organizations = read.total((structured, args) => {
148
+ const members = read.recordOrNull(structured.members);
149
+ const listed = read.recordOrNull(structured.organizations);
150
+ const memberList = members != null ? listing(members, memberOf) : null;
151
+ const organizationList = listed != null ? listing(listed, organizationOf) : null;
152
+ return read.compact({
153
+ projectId: read.project(structured, args),
154
+ entitySlug: read.maybeText(structured.entitySlug),
155
+ external: memberList?.external ?? organizationList?.external,
156
+ organizations: organizationList?.items ?? (memberList == null ? [] : undefined),
157
+ members: memberList?.items,
158
+ });
159
+ });
160
+ const organization = read.total((structured, args) => {
161
+ const renamed = read.recordOrNull(structured.organization);
162
+ const member = read.recordOrNull(structured.member);
163
+ return read.compact({
164
+ projectId: read.project(structured, args),
165
+ entitySlug: slugOf(structured, args, renamed?.entitySlug),
166
+ organization: renamed != null ? organizationOf(renamed) : undefined,
167
+ member: member != null ? memberOf(member) : undefined,
168
+ profileId: read.maybeText(structured.profileId),
169
+ removed: read.maybeFlag(structured.removed),
170
+ });
171
+ });
172
+ const groups = read.total((structured, args) => {
173
+ const members = read.recordOrNull(structured.members);
174
+ const memberList = members != null ? listing(members, memberOf) : null;
175
+ const groupList = memberList == null ? listing(structured.groups, groupOf) : null;
176
+ return read.compact({
177
+ projectId: read.project(structured, args),
178
+ entitySlug: slugOf(structured, args),
179
+ group: memberList != null ? read.maybeText(structured.group) : undefined,
180
+ external: memberList?.external ?? groupList?.external,
181
+ groups: groupList?.items,
182
+ members: memberList?.items,
183
+ });
184
+ });
185
+ const group = read.total((structured, args) => {
186
+ // create and update answer the group itself; delete and the member changes name it by key.
187
+ const view = read.recordOrNull(structured.group);
188
+ const action = read.maybeText(args.action);
189
+ return read.compact({
190
+ projectId: read.project(structured, args),
191
+ entitySlug: slugOf(structured, args, view?.entitySlug),
192
+ key: read.maybeText(view?.key) ?? read.maybeText(structured.group) ?? read.text(args.group).trim(),
193
+ group: view != null ? groupOf(view) : undefined,
194
+ deleted: read.maybeFlag(structured.deleted),
195
+ action: Array.isArray(structured.profileIds) ? action : undefined,
196
+ profileIds: Array.isArray(structured.profileIds) ? read.texts(structured.profileIds) : undefined,
197
+ });
198
+ });
199
+ return { users, user, permissions, permission, grants, grant, organizations, organization, groups, group };
200
+ };
201
+ export const iamPresentHelper = createIamPresentHelper();
202
+ //# sourceMappingURL=iam.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iam.js","sourceRoot":"","sources":["../../../../../src/tools/profile/presentation/platform/iam.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,IAAI,IAAI,EAAE,MAAM,WAAW,CAAA;AAGrD,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAqB,EAAE;IAC3D;;;OAGG;IAEH,MAAM,MAAM,GAAG,CAAC,KAAc,EAA2B,EAAE;QACzD,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QAE/B,OAAO,IAAI,CAAC,OAAO,CAAC;YAClB,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC;YACpC,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC;YACjC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;YAC/B,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;YAC1B,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;YAClC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC;YAC5C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAA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AE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,CAAA;AAC5G,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,sBAAsB,EAAE,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { ProductionPresentHelper } from './types.js';
2
+ export declare const createProductionPresentHelper: () => ProductionPresentHelper;
3
+ export declare const productionPresentHelper: ProductionPresentHelper;
4
+ //# sourceMappingURL=production.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"production.d.ts","sourceRoot":"","sources":["../../../../../src/tools/profile/presentation/platform/production.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAA;AAEzD,eAAO,MAAM,6BAA6B,QAAO,uBA6EhD,CAAA;AAED,eAAO,MAAM,uBAAuB,yBAAkC,CAAA"}
@@ -0,0 +1,73 @@
1
+ import { presentReadHelper as read } from './read.js';
2
+ export const createProductionPresentHelper = () => {
3
+ /**
4
+ * The custom domain with the DNS records the person creates — until it is linked, exactly as the
5
+ * text lists them: the traffic CNAME and the certificate's delegation, each with the provider's word.
6
+ */
7
+ const domainOf = (value) => {
8
+ const domain = read.recordOrNull(value);
9
+ if (domain == null)
10
+ return null;
11
+ const customDomain = read.maybeText(domain.customDomain);
12
+ const status = read.text(domain.status, 'none');
13
+ const records = [];
14
+ if (customDomain != null && status !== 'linked') {
15
+ const target = read.maybeText(domain.cnameTarget);
16
+ if (target != null) {
17
+ records.push(read.compact({
18
+ type: 'CNAME', name: customDomain, value: target, purpose: 'traffic',
19
+ providerStatus: read.maybeText(domain.hostnameStatus),
20
+ }));
21
+ }
22
+ const dcvName = read.maybeText(domain.dcvName);
23
+ const dcvValue = read.maybeText(domain.dcvValue);
24
+ if (dcvName != null && dcvValue != null) {
25
+ records.push(read.compact({
26
+ type: 'CNAME', name: dcvName, value: dcvValue, purpose: 'certificate',
27
+ providerStatus: read.maybeText(domain.sslStatus),
28
+ }));
29
+ }
30
+ }
31
+ return read.compact({
32
+ generatedHost: read.text(domain.generatedHost),
33
+ customDomain,
34
+ status,
35
+ verified: read.day(domain.verifiedAt),
36
+ records,
37
+ message: read.warning(domain.message),
38
+ });
39
+ };
40
+ /** The address the site answers on: the custom domain once linked, else its generated host. */
41
+ const siteUrl = (domain) => domain?.customDomain != null && domain.status === 'linked'
42
+ ? read.url(domain.customDomain)
43
+ : read.url(domain?.generatedHost);
44
+ const status = read.total((structured, args) => {
45
+ const domain = domainOf(structured.domain);
46
+ const site = read.workload(structured.workload);
47
+ return {
48
+ projectId: read.project(structured, args),
49
+ site: site != null ? read.compact({ ...site, url: siteUrl(domain) ?? site.url }) : null,
50
+ domain,
51
+ };
52
+ });
53
+ const domain = read.total((structured, args) => ({
54
+ projectId: read.project(structured, args),
55
+ domain: domainOf(structured.domain),
56
+ }));
57
+ const auth = read.total((structured, args) => read.compact({
58
+ projectId: read.project(structured, args),
59
+ issuerUrl: read.text(structured.issuerUrl),
60
+ // A public OIDC client id the person configures a self-hosted copy with; the secret is only `secretSet`.
61
+ clientId: read.text(structured.clientId),
62
+ secretSet: read.flag(structured.secretSet),
63
+ redirectUris: read.texts(structured.redirectUris),
64
+ siteUrl: read.url(read.maybeText(structured.customDomain) ?? structured.generatedHost),
65
+ }));
66
+ const redirects = read.total((structured, args) => ({
67
+ projectId: read.project(structured, args),
68
+ redirectUris: read.texts(structured.redirectUris),
69
+ }));
70
+ return { status, domain, auth, redirects };
71
+ };
72
+ export const productionPresentHelper = createProductionPresentHelper();
73
+ //# sourceMappingURL=production.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"production.js","sourceRoot":"","sources":["../../../../../src/tools/profile/presentation/platform/production.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,IAAI,IAAI,EAAE,MAAM,WAAW,CAAA;AAGrD,MAAM,CAAC,MAAM,6B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ED,MAAM,CAAC,MAAM,uBAAuB,GAAG,6BAA6B,EAAE,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { PresentReadHelper } from './types.js';
2
+ export declare const createPresentReadHelper: () => PresentReadHelper;
3
+ export declare const presentReadHelper: PresentReadHelper;
4
+ //# sourceMappingURL=read.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../../../../src/tools/profile/presentation/platform/read.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAqB,MAAM,YAAY,CAAA;AAEtE,eAAO,MAAM,uBAAuB,QAAO,iBAyF1C,CAAA;AAED,eAAO,MAAM,iBAAiB,mBAA4B,CAAA"}
@@ -0,0 +1,68 @@
1
+ import { refusalHelper } from '../../../refusal.js';
2
+ import { HAS_SCHEME, ISO_DAY, SANDBOX_ROOT, STACK_LINE } from './consts.js';
3
+ export const createPresentReadHelper = () => {
4
+ const recordOrNull = value => value != null && typeof value === 'object' && !Array.isArray(value) ? value : null;
5
+ const record = value => recordOrNull(value) ?? {};
6
+ const records = value => Array.isArray(value)
7
+ ? value.map(recordOrNull).filter((item) => item != null)
8
+ : [];
9
+ const text = (value, fallback = '') => typeof value === 'string' ? value : fallback;
10
+ const maybeText = value => typeof value === 'string' && value !== '' ? value : undefined;
11
+ const textOrNull = value => maybeText(value) ?? null;
12
+ const texts = value => Array.isArray(value)
13
+ ? value.filter((item) => typeof item === 'string')
14
+ : [];
15
+ const textsOrNulls = value => Array.isArray(value)
16
+ ? value.filter((item) => item === null || typeof item === 'string')
17
+ : [];
18
+ const maybeCount = value => typeof value === 'number' && Number.isFinite(value) ? value : undefined;
19
+ const count = (value, fallback = 0) => maybeCount(value) ?? fallback;
20
+ const countOrNull = value => maybeCount(value) ?? null;
21
+ const maybeFlag = value => typeof value === 'boolean' ? value : undefined;
22
+ const flag = (value, fallback = false) => maybeFlag(value) ?? fallback;
23
+ const day = value => typeof value === 'string'
24
+ ? ISO_DAY.exec(value)?.[0]
25
+ : undefined;
26
+ const clean = value => {
27
+ if (typeof value !== 'string')
28
+ return undefined;
29
+ const said = value.split('\n').filter(line => !STACK_LINE.test(line)).join('\n').replace(SANDBOX_ROOT, '').trim();
30
+ return said !== '' ? said : undefined;
31
+ };
32
+ const warning = value => typeof value === 'string' && value.trim() !== '' ? clean(refusalHelper.refusalPhrase(value)) : undefined;
33
+ const url = host => {
34
+ const address = maybeText(host)?.trim();
35
+ if (address == null || address === '')
36
+ return undefined;
37
+ return HAS_SCHEME.test(address) ? address : `https://${address}`;
38
+ };
39
+ const project = (structured, args) => maybeText(structured.projectId) ?? maybeText(args.projectId) ?? '';
40
+ const compact = value => Object.fromEntries(Object.entries(value).filter(([, member]) => member !== undefined));
41
+ const workload = value => {
42
+ const slot = recordOrNull(value);
43
+ if (slot == null)
44
+ return null;
45
+ const warnings = [slot.lastError, slot.buildWarning, slot.backendWarning]
46
+ .map(warning).filter((item) => item != null);
47
+ return compact({
48
+ status: text(slot.status, 'unknown'),
49
+ url: url(slot.host),
50
+ initialized: maybeFlag(slot.initialized),
51
+ warnings,
52
+ });
53
+ };
54
+ const total = present => (structured, args) => {
55
+ try {
56
+ return present(record(structured), record(args));
57
+ }
58
+ catch {
59
+ return present({}, {});
60
+ }
61
+ };
62
+ return {
63
+ record, recordOrNull, records, text, maybeText, textOrNull, texts, textsOrNulls, count, maybeCount, countOrNull,
64
+ flag, maybeFlag, day, warning, clean, url, project, workload, compact, total,
65
+ };
66
+ };
67
+ export const presentReadHelper = createPresentReadHelper();
68
+ //# sourceMappingURL=read.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read.js","sourceRoot":"","sources":["../../../../../src/tools/profile/presentation/platform/read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAG3E,MAAM,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AAA"}
@@ -0,0 +1,4 @@
1
+ import type { SettingsPresentHelper } from './types.js';
2
+ export declare const createSettingsPresentHelper: () => SettingsPresentHelper;
3
+ export declare const settingsPresentHelper: SettingsPresentHelper;
4
+ //# sourceMappingURL=settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../../../src/tools/profile/presentation/platform/settings.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAEvD,eAAO,MAAM,2BAA2B,QAAO,qBAqD9C,CAAA;AAED,eAAO,MAAM,qBAAqB,uBAAgC,CAAA"}
@@ -0,0 +1,48 @@
1
+ import { presentReadHelper as read } from './read.js';
2
+ export const createSettingsPresentHelper = () => {
3
+ const credit = (value) => {
4
+ const view = read.recordOrNull(value);
5
+ return view == null
6
+ ? undefined
7
+ : { hidden: read.flag(view.hidden), requested: read.flag(view.requested), entitled: read.flag(view.entitled) };
8
+ };
9
+ const settings = read.total((structured, args) => {
10
+ const view = read.record(structured.settings);
11
+ return read.compact({
12
+ projectId: read.project(structured, args),
13
+ scope: read.maybeText(structured.scope),
14
+ settings: read.compact({
15
+ copyright: read.text(view.copyright),
16
+ organizationName: read.text(view.organizationName),
17
+ termsUrl: read.text(view.termsUrl),
18
+ privacyUrl: read.text(view.privacyUrl),
19
+ googleTag: read.text(view.googleTag),
20
+ credit: credit(view.credit),
21
+ }),
22
+ });
23
+ });
24
+ const configuration = read.total((structured, args) => {
25
+ const config = read.record(structured.configuration);
26
+ return {
27
+ projectId: read.project(structured, args),
28
+ configuration: {
29
+ scope: read.text(config.scope, read.text(args.scope, 'ephemeral')),
30
+ // Only the name and whether it is set: a backend value is a secret, whatever an answer holds.
31
+ backend: read.records(config.backend).map(variable => ({ name: read.text(variable.name), set: read.flag(variable.set) })),
32
+ frontend: read.records(config.frontend).map(variable => ({
33
+ name: read.text(variable.name), set: read.flag(variable.set), value: read.text(variable.value),
34
+ })),
35
+ },
36
+ };
37
+ });
38
+ const organization = read.total(structured => {
39
+ const branding = read.record(structured.organization);
40
+ return {
41
+ organization: { organizationName: read.text(branding.organizationName), copyright: read.text(branding.copyright) },
42
+ };
43
+ });
44
+ const backfill = read.total(structured => ({ projects: read.count(structured.projects) }));
45
+ return { settings, configuration, organization, backfill };
46
+ };
47
+ export const settingsPresentHelper = createSettingsPresentHelper();
48
+ //# sourceMappingURL=settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../../../src/tools/profile/presentation/platform/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,IAAI,IAAI,EAAE,MAAM,WAAW,CAAA;AAGrD,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAA0B,EAAE;IACrE,MAAM,MAAM,GAAG,CAAC,KAAc,EAAuC,EAAE;QACrE,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;QAErC,OAAO,IAAI,IAAI,IAAI;YACjB,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAA;IAClH,CAAC,CAAA;IAED,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,UAAU,EAAE,IAAI,EAAE,EAAE;QAC/C,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;QAE7C,OAAO,IAAI,CAAC,OAAO,CAAC;YAClB,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC;YACzC,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAA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,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;oBACvD,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;iBAC/F,CAAC,CAAC;aACJ;SACF,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE;QAC3C,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,CAAA;QAErD,OAAO;YACL,YAAY,EAAE,EAAE,gBAAgB,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;SACnH,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAA;IAE1F,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAA;AAC5D,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,2BAA2B,EAAE,CAAA"}
@@ -0,0 +1,174 @@
1
+ /**
2
+ * A presenter: a tool's structured result (and the arguments it was called with) → the shape its
3
+ * declared `output` accepts. Pure and total — whatever arrives, it answers a value that schema
4
+ * accepts, so the MCP host never refuses a result the tool itself produced.
5
+ */
6
+ export interface Presenter {
7
+ (structured: object, args: Record<string, unknown>): object;
8
+ }
9
+ /** A presenter over values already read as records — what {@link PresentReadHelper.total} wraps. */
10
+ export interface RecordPresenter {
11
+ (structured: Record<string, unknown>, args: Record<string, unknown>): Record<string, unknown>;
12
+ }
13
+ /** A workload (`ConnectSlotState`) as a person reads it — never its id, slug, namespace or kind. */
14
+ export interface PresentedWorkload extends Record<string, unknown> {
15
+ status: string;
16
+ /** The address a person opens. */
17
+ url?: string;
18
+ initialized?: boolean;
19
+ /** Every warning it carries, phrased, without a stack trace or a sandbox path. */
20
+ warnings: string[];
21
+ }
22
+ /**
23
+ * How a presenter reads a platform answer it cannot trust the shape of: every reader answers a value
24
+ * of the type it names whatever it is given, so no presenter throws or emits a value its schema
25
+ * refuses.
26
+ */
27
+ export interface PresentReadHelper {
28
+ /** The value as a record — `{}` for anything that is not a plain object. */
29
+ record: (value: unknown) => Record<string, unknown>;
30
+ /** The value as a record, or `null` for anything that is not one. */
31
+ recordOrNull: (value: unknown) => Record<string, unknown> | null;
32
+ /** Every element of an array that is a record; `[]` for anything that is not an array. */
33
+ records: (value: unknown) => Array<Record<string, unknown>>;
34
+ /** A string, or `fallback` (`''`). */
35
+ text: (value: unknown, fallback?: string) => string;
36
+ /** A non-empty string, or `undefined`. */
37
+ maybeText: (value: unknown) => string | undefined;
38
+ /** A non-empty string, or `null`. */
39
+ textOrNull: (value: unknown) => string | null;
40
+ /** Every element of an array that is a string. */
41
+ texts: (value: unknown) => string[];
42
+ /** Every element of an array that is a string or `null` — a filter's areas. */
43
+ textsOrNulls: (value: unknown) => Array<string | null>;
44
+ /** A finite number, or `fallback` (`0`). */
45
+ count: (value: unknown, fallback?: number) => number;
46
+ /** A finite number, or `undefined`. */
47
+ maybeCount: (value: unknown) => number | undefined;
48
+ /** A finite number, or `null`. */
49
+ countOrNull: (value: unknown) => number | null;
50
+ /** A boolean, or `fallback` (`false`). */
51
+ flag: (value: unknown, fallback?: boolean) => boolean;
52
+ /** A boolean, or `undefined`. */
53
+ maybeFlag: (value: unknown) => boolean | undefined;
54
+ /** The calendar day (`YYYY-MM-DD`) of an ISO timestamp — what a person reads — or `undefined`. */
55
+ day: (value: unknown) => string | undefined;
56
+ /**
57
+ * A warning or error the platform stored, phrased like a thrown refusal, then {@link clean}ed;
58
+ * `undefined` when there is none.
59
+ */
60
+ warning: (value: unknown) => string | undefined;
61
+ /**
62
+ * A message a tool relays as it was said (git's, a migration's): its stack-trace lines and the
63
+ * sandbox's root path removed; `undefined` when nothing is left.
64
+ */
65
+ clean: (value: unknown) => string | undefined;
66
+ /** `https://<host>` for a host name (a value that already has a scheme is kept), or `undefined`. */
67
+ url: (host: unknown) => string | undefined;
68
+ /** The project a result names — its own `projectId`, else the call's, else `''`. */
69
+ project: (structured: Record<string, unknown>, args: Record<string, unknown>) => string;
70
+ /** A workload as a person reads it, or `null` when the value is not one. */
71
+ workload: (value: unknown) => PresentedWorkload | null;
72
+ /** The record without its `undefined` members, so an absent optional is absent, not `undefined`. */
73
+ compact: (value: Record<string, unknown>) => Record<string, unknown>;
74
+ /**
75
+ * The presenter made total: both values read as records, and should anything still throw, the
76
+ * presenter's answer for an empty result — which every reader turns into a value its schema accepts.
77
+ */
78
+ total: (present: RecordPresenter) => Presenter;
79
+ }
80
+ /** The project settings, configuration and organization branding tools. */
81
+ export interface SettingsPresentHelper {
82
+ /** project_settings, update_project_settings and set_platform_credit. */
83
+ settings: Presenter;
84
+ /** project_configuration, update_project_configuration and recollect_configuration — no secret value. */
85
+ configuration: Presenter;
86
+ /** organization_branding and update_organization_branding. */
87
+ organization: Presenter;
88
+ /** backfill_project_branding. */
89
+ backfill: Presenter;
90
+ }
91
+ /** The account tools: access tokens, marketing consents and the public site's prompt. */
92
+ export interface AccountPresentHelper {
93
+ /** list_access_tokens — the id kept because revoke_access_token names it; never the secret. */
94
+ tokens: Presenter;
95
+ /** revoke_access_token. */
96
+ revokedToken: Presenter;
97
+ /** privacy_choices. */
98
+ privacy: Presenter;
99
+ /** withdraw_marketing_consent — with nothing to withdraw, or with the choices as they now stand. */
100
+ withdrawn: Presenter;
101
+ /** pickup_intent. */
102
+ intent: Presenter;
103
+ }
104
+ /** The generated files and the preview. */
105
+ export interface WorkspacePresentHelper {
106
+ /** list_files — the sources, or one kind of metadata document. */
107
+ files: Presenter;
108
+ /** read_file — the path and size; the content is the text's. */
109
+ file: Presenter;
110
+ /** write_file and delete_file — whether the preview was rebuilt, or why not. */
111
+ written: Presenter;
112
+ /** preview_control, every action. */
113
+ preview: Presenter;
114
+ }
115
+ /** The git and GitHub tools. */
116
+ export interface GitPresentHelper {
117
+ /** git_status — the connection and the working tree. */
118
+ status: Presenter;
119
+ /** git_history — each commit with the hash git_revert names. */
120
+ history: Presenter;
121
+ /** git_commit. */
122
+ commit: Presenter;
123
+ /** git_discard — the tree after the discard. */
124
+ discard: Presenter;
125
+ /** git_revert — the commit gone back to, the new one, and what the migration said. */
126
+ revert: Presenter;
127
+ /** connect_github — the address the person opens. */
128
+ authorize: Presenter;
129
+ /** publish_to_github. */
130
+ published: Presenter;
131
+ /** github_sync — a refused sync included. */
132
+ sync: Presenter;
133
+ /** disconnect_github. */
134
+ disconnected: Presenter;
135
+ /** github_repositories — a page of repositories, or of one repository's branches. */
136
+ repositories: Presenter;
137
+ /** link_github_origin. */
138
+ linked: Presenter;
139
+ }
140
+ /** The production tools. */
141
+ export interface ProductionPresentHelper {
142
+ /** production_status, publish_production and production_control (every action). */
143
+ status: Presenter;
144
+ /** custom_domain, every action — with the DNS records the person creates. */
145
+ domain: Presenter;
146
+ /** production_auth — whether the client secret is set, never the secret. */
147
+ auth: Presenter;
148
+ /** set_production_redirects. */
149
+ redirects: Presenter;
150
+ }
151
+ /** The tools of the generated application's own sign-in — by profileId, entitySlug and group key. */
152
+ export interface IamPresentHelper {
153
+ /** app_users — one application's, or every application's of the organization. */
154
+ users: Presenter;
155
+ /** manage_app_user, every action. */
156
+ user: Presenter;
157
+ /** app_permissions. */
158
+ permissions: Presenter;
159
+ /** set_app_permission_default. */
160
+ permission: Presenter;
161
+ /** app_grants. */
162
+ grants: Presenter;
163
+ /** manage_app_grant, every action. */
164
+ grant: Presenter;
165
+ /** app_organizations — the organizations, or one organization's members. */
166
+ organizations: Presenter;
167
+ /** manage_app_organization, every action. */
168
+ organization: Presenter;
169
+ /** app_groups — one organization's groups, or one group's members. */
170
+ groups: Presenter;
171
+ /** manage_app_group, every action. */
172
+ group: Presenter;
173
+ }
174
+ //# sourceMappingURL=types.d.ts.map