@proveanything/smartlinks 2.0.17 → 2.0.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.
@@ -1,12 +1,17 @@
1
1
  # SmartLinks Theme Tokens — host theming contract
2
2
 
3
- Status: **v1 (draft) — FORTHCOMING, not yet live host-side.**
4
- > ⚠️ **Do not build apps against this yet.** The host (Hub/Portal) does not yet set `--sl-*` tokens
5
- > or send `smartlinks:root-state`. Until it does, apps follow the **current** theming — see
6
- > [`theme.system.md`](./theme.system.md) (`useSmartLinksTheme()` + shadcn vars `--primary`/`--background`,
7
- > the `?theme=` base64 payload). This document is the target model that will supersede it once the host
8
- > serves it; it exists so the SDK preset (`theme.css`), the iframe bootstrap (`theme-boot.js`) and the
9
- > Hub theme engine can be built against a fixed contract.
3
+ Status: **v1 — live. This is the theming contract to build against.**
4
+ > ✅ **Adopt this.** The R5 host (Hub/Portal) sets the `--sl-*` tokens on your mount root and sends
5
+ > `smartlinks:root-state` for live viewer-preference changes; the SDK preset (`theme.css`), the iframe
6
+ > bootstrap (`theme-boot.js`) and the Hub theme engine all speak this contract. Bind your app to these
7
+ > tokens (via `theme.css`) and it is themed by every host, forever, with no per-app theme code.
8
+ >
9
+ > **It degrades gracefully, so adoption is safe.** `theme.css` ships sensible fallback values for every
10
+ > token, so on a host that hasn't enabled token theming yet the app simply renders with neutral
11
+ > defaults rather than breaking. The legacy path (`useSmartLinksTheme()` + shadcn `--primary`/`--background`
12
+ > via the `?theme=` payload, see [`theme.system.md`](./theme.system.md)) still works during the
13
+ > transition, and [step 17] shows how to bridge shadcn variables to these tokens so both paths stay live.
14
+ > New work should bind to the tokens here.
10
15
 
11
16
  Applies to: `@proveanything/smartlinks` ^2.0 (R5), container + widget embeds
12
17
  Companion to: [`css-baseline.md`](./css-baseline.md) (mechanics, live) — this doc is **brand** (colour, shape, type)
package/openapi.yaml CHANGED
@@ -1081,6 +1081,39 @@ paths:
1081
1081
  application/json:
1082
1082
  schema:
1083
1083
  $ref: "#/components/schemas/AISearchPhotosRequest"
1084
+ /admin/collection/{collectionId}/ai/sessions:
1085
+ post:
1086
+ tags:
1087
+ - sessions
1088
+ summary: Persisted AI assistant sessions (admin scope) — durable conversation history for admin/host assistants.
1089
+ operationId: sessions_create
1090
+ security:
1091
+ - bearerAuth: []
1092
+ parameters:
1093
+ - name: collectionId
1094
+ in: path
1095
+ required: true
1096
+ schema:
1097
+ type: string
1098
+ responses:
1099
+ 200:
1100
+ description: Success
1101
+ content:
1102
+ application/json:
1103
+ schema:
1104
+ $ref: "#/components/schemas/AiSession"
1105
+ 400:
1106
+ description: Bad request
1107
+ 401:
1108
+ description: Unauthorized
1109
+ 404:
1110
+ description: Not found
1111
+ requestBody:
1112
+ required: true
1113
+ content:
1114
+ application/json:
1115
+ schema:
1116
+ $ref: "#/components/schemas/AiSessionCreate"
1084
1117
  /admin/collection/{collectionId}/ai/sessions/stats:
1085
1118
  get:
1086
1119
  tags:
@@ -1108,6 +1141,77 @@ paths:
1108
1141
  description: Unauthorized
1109
1142
  404:
1110
1143
  description: Not found
1144
+ /admin/collection/{collectionId}/ai/sessions/{id}:
1145
+ get:
1146
+ tags:
1147
+ - sessions
1148
+ summary: Get one session, including its full transcript.
1149
+ operationId: sessions_get
1150
+ security:
1151
+ - bearerAuth: []
1152
+ parameters:
1153
+ - name: collectionId
1154
+ in: path
1155
+ required: true
1156
+ schema:
1157
+ type: string
1158
+ - name: id
1159
+ in: path
1160
+ required: true
1161
+ schema:
1162
+ type: string
1163
+ responses:
1164
+ 200:
1165
+ description: Success
1166
+ content:
1167
+ application/json:
1168
+ schema:
1169
+ $ref: "#/components/schemas/AiSession"
1170
+ 400:
1171
+ description: Bad request
1172
+ 401:
1173
+ description: Unauthorized
1174
+ 404:
1175
+ description: Not found
1176
+ /admin/collection/{collectionId}/ai/sessions/{id}/append:
1177
+ post:
1178
+ tags:
1179
+ - sessions
1180
+ summary: Append Responses items (input/output/tool) to a session — the manual-persistence path.
1181
+ operationId: sessions_append
1182
+ security:
1183
+ - bearerAuth: []
1184
+ parameters:
1185
+ - name: collectionId
1186
+ in: path
1187
+ required: true
1188
+ schema:
1189
+ type: string
1190
+ - name: id
1191
+ in: path
1192
+ required: true
1193
+ schema:
1194
+ type: string
1195
+ responses:
1196
+ 200:
1197
+ description: Success
1198
+ content:
1199
+ application/json:
1200
+ schema:
1201
+ $ref: "#/components/schemas/AiSession"
1202
+ 400:
1203
+ description: Bad request
1204
+ 401:
1205
+ description: Unauthorized
1206
+ 404:
1207
+ description: Not found
1208
+ requestBody:
1209
+ required: true
1210
+ content:
1211
+ application/json:
1212
+ schema:
1213
+ type: object
1214
+ additionalProperties: true
1111
1215
  /admin/collection/{collectionId}/ai/skills:
1112
1216
  get:
1113
1217
  tags:
@@ -1196,6 +1300,33 @@ paths:
1196
1300
  description: Unauthorized
1197
1301
  404:
1198
1302
  description: Not found
1303
+ /admin/collection/{collectionId}/ai/usage:
1304
+ get:
1305
+ tags:
1306
+ - sessions
1307
+ summary: AI usage / cost report for a collection, grouped by any of model/serviceTier/appId/feature/mode over an optional date window.
1308
+ operationId: sessions_usage
1309
+ security:
1310
+ - bearerAuth: []
1311
+ parameters:
1312
+ - name: collectionId
1313
+ in: path
1314
+ required: true
1315
+ schema:
1316
+ type: string
1317
+ responses:
1318
+ 200:
1319
+ description: Success
1320
+ content:
1321
+ application/json:
1322
+ schema:
1323
+ $ref: "#/components/schemas/AiUsageReport"
1324
+ 400:
1325
+ description: Bad request
1326
+ 401:
1327
+ description: Unauthorized
1328
+ 404:
1329
+ description: Not found
1199
1330
  /admin/collection/{collectionId}/ai/v1/chat/completions:
1200
1331
  post:
1201
1332
  tags:
@@ -10294,9 +10425,9 @@ paths:
10294
10425
  /public/collection/{collectionId}/ai/rate-limit/{userId}:
10295
10426
  get:
10296
10427
  tags:
10297
- - publicClient
10428
+ - sessions
10298
10429
  summary: Check rate limit status
10299
- operationId: publicClient_getRateLimit
10430
+ operationId: sessions_getRateLimit
10300
10431
  security: []
10301
10432
  parameters:
10302
10433
  - name: collectionId
@@ -10353,12 +10484,113 @@ paths:
10353
10484
  description: Unauthorized
10354
10485
  404:
10355
10486
  description: Not found
10487
+ /public/collection/{collectionId}/ai/sessions:
10488
+ post:
10489
+ tags:
10490
+ - sessions
10491
+ summary: sessions.create
10492
+ operationId: sessions_create
10493
+ security: []
10494
+ parameters:
10495
+ - name: collectionId
10496
+ in: path
10497
+ required: true
10498
+ schema:
10499
+ type: string
10500
+ responses:
10501
+ 200:
10502
+ description: Success
10503
+ content:
10504
+ application/json:
10505
+ schema:
10506
+ $ref: "#/components/schemas/AiSession"
10507
+ 400:
10508
+ description: Bad request
10509
+ 401:
10510
+ description: Unauthorized
10511
+ 404:
10512
+ description: Not found
10513
+ requestBody:
10514
+ required: true
10515
+ content:
10516
+ application/json:
10517
+ schema:
10518
+ $ref: "#/components/schemas/AiSessionCreate"
10519
+ /public/collection/{collectionId}/ai/sessions/{id}:
10520
+ get:
10521
+ tags:
10522
+ - sessions
10523
+ summary: sessions.get
10524
+ operationId: sessions_get
10525
+ security: []
10526
+ parameters:
10527
+ - name: collectionId
10528
+ in: path
10529
+ required: true
10530
+ schema:
10531
+ type: string
10532
+ - name: id
10533
+ in: path
10534
+ required: true
10535
+ schema:
10536
+ type: string
10537
+ responses:
10538
+ 200:
10539
+ description: Success
10540
+ content:
10541
+ application/json:
10542
+ schema:
10543
+ $ref: "#/components/schemas/AiSession"
10544
+ 400:
10545
+ description: Bad request
10546
+ 401:
10547
+ description: Unauthorized
10548
+ 404:
10549
+ description: Not found
10550
+ /public/collection/{collectionId}/ai/sessions/{id}/append:
10551
+ post:
10552
+ tags:
10553
+ - sessions
10554
+ summary: sessions.append
10555
+ operationId: sessions_append
10556
+ security: []
10557
+ parameters:
10558
+ - name: collectionId
10559
+ in: path
10560
+ required: true
10561
+ schema:
10562
+ type: string
10563
+ - name: id
10564
+ in: path
10565
+ required: true
10566
+ schema:
10567
+ type: string
10568
+ responses:
10569
+ 200:
10570
+ description: Success
10571
+ content:
10572
+ application/json:
10573
+ schema:
10574
+ $ref: "#/components/schemas/AiSession"
10575
+ 400:
10576
+ description: Bad request
10577
+ 401:
10578
+ description: Unauthorized
10579
+ 404:
10580
+ description: Not found
10581
+ requestBody:
10582
+ required: true
10583
+ content:
10584
+ application/json:
10585
+ schema:
10586
+ type: object
10587
+ additionalProperties: true
10356
10588
  /public/collection/{collectionId}/ai/token:
10357
10589
  post:
10358
10590
  tags:
10359
- - publicClient
10591
+ - sessions
10360
10592
  summary: Generate ephemeral token for Gemini Live
10361
- operationId: publicClient_getToken
10593
+ operationId: sessions_getToken
10362
10594
  security: []
10363
10595
  parameters:
10364
10596
  - name: collectionId
@@ -15244,6 +15476,10 @@ components:
15244
15476
  - standard
15245
15477
  - flex
15246
15478
  - priority
15479
+ feature:
15480
+ type: string
15481
+ session_id:
15482
+ type: string
15247
15483
  server_tools:
15248
15484
  type: array
15249
15485
  items:
@@ -15799,6 +16035,102 @@ components:
15799
16035
  - activeSessions
15800
16036
  - totalMessages
15801
16037
  - rateLimitedUsers
16038
+ AiSession:
16039
+ type: object
16040
+ properties:
16041
+ id:
16042
+ type: string
16043
+ collectionId:
16044
+ type: string
16045
+ appId:
16046
+ type: string
16047
+ scope:
16048
+ $ref: "#/components/schemas/AiSessionScope"
16049
+ title:
16050
+ type: string
16051
+ status:
16052
+ type: string
16053
+ ownerId:
16054
+ type: string
16055
+ authorId:
16056
+ type: string
16057
+ productId:
16058
+ type: string
16059
+ proofId:
16060
+ type: string
16061
+ feature:
16062
+ type: string
16063
+ items:
16064
+ type: array
16065
+ items:
16066
+ $ref: "#/components/schemas/ResponseInputItem"
16067
+ summary:
16068
+ type: object
16069
+ additionalProperties: true
16070
+ usage:
16071
+ type: object
16072
+ additionalProperties: true
16073
+ itemCount:
16074
+ type: number
16075
+ lastTurnAt:
16076
+ type: string
16077
+ createdAt:
16078
+ type: string
16079
+ updatedAt:
16080
+ type: string
16081
+ expiresAt:
16082
+ type: string
16083
+ required:
16084
+ - id
16085
+ - collectionId
16086
+ - scope
16087
+ - status
16088
+ - items
16089
+ - itemCount
16090
+ - createdAt
16091
+ - updatedAt
16092
+ AiSessionCreate:
16093
+ type: object
16094
+ properties:
16095
+ appId:
16096
+ type: string
16097
+ title:
16098
+ type: string
16099
+ productId:
16100
+ type: string
16101
+ proofId:
16102
+ type: string
16103
+ feature:
16104
+ type: string
16105
+ ttlMs:
16106
+ type: number
16107
+ items:
16108
+ type: array
16109
+ items:
16110
+ $ref: "#/components/schemas/ResponseInputItem"
16111
+ AiUsageReport:
16112
+ type: object
16113
+ properties:
16114
+ groupBy:
16115
+ type: array
16116
+ items:
16117
+ type: string
16118
+ from:
16119
+ type: string
16120
+ to:
16121
+ type: string
16122
+ totals:
16123
+ type: object
16124
+ additionalProperties: true
16125
+ groups:
16126
+ type: array
16127
+ items:
16128
+ type: object
16129
+ additionalProperties: true
16130
+ required:
16131
+ - groupBy
16132
+ - totals
16133
+ - groups
15802
16134
  VoiceSessionRequest:
15803
16135
  type: object
15804
16136
  properties:
@@ -16656,6 +16988,12 @@ components:
16656
16988
  additionalProperties: true
16657
16989
  required:
16658
16990
  - type
16991
+ AiSessionScope:
16992
+ type: string
16993
+ enum:
16994
+ - admin
16995
+ - owner
16996
+ - public
16659
16997
  AiToolCapability:
16660
16998
  type: string
16661
16999
  enum:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proveanything/smartlinks",
3
- "version": "2.0.17",
3
+ "version": "2.0.19",
4
4
  "description": "Official JavaScript/TypeScript SDK for the Smartlinks API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",