@proveanything/smartlinks 1.17.0 → 1.17.4

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.
package/dist/openapi.yaml CHANGED
@@ -9,6 +9,8 @@ servers:
9
9
  tags:
10
10
  - name: responses
11
11
  - name: completions
12
+ - name: agent
13
+ - name: skills
12
14
  - name: models
13
15
  - name: rag
14
16
  - name: sessions
@@ -50,6 +52,7 @@ tags:
50
52
  - name: proof
51
53
  - name: qr
52
54
  - name: realtime
55
+ - name: research
53
56
  - name: segments
54
57
  - name: tags
55
58
  - name: template
@@ -619,6 +622,108 @@ paths:
619
622
  description: Unauthorized
620
623
  404:
621
624
  description: Not found
625
+ /admin/collection/{collectionId}/ai/agent/run:
626
+ post:
627
+ tags:
628
+ - agent
629
+ summary: "Run the server-side AI agent loop once: assembles the tool set, runs the model, executes tool calls, and returns the final text + the tool trace."
630
+ operationId: agent_run
631
+ security:
632
+ - bearerAuth: []
633
+ parameters:
634
+ - name: collectionId
635
+ in: path
636
+ required: true
637
+ schema:
638
+ type: string
639
+ responses:
640
+ 200:
641
+ description: Success
642
+ content:
643
+ application/json:
644
+ schema:
645
+ $ref: "#/components/schemas/AgentRunResult"
646
+ 400:
647
+ description: Bad request
648
+ 401:
649
+ description: Unauthorized
650
+ 404:
651
+ description: Not found
652
+ requestBody:
653
+ required: true
654
+ content:
655
+ application/json:
656
+ schema:
657
+ $ref: "#/components/schemas/AgentRunRequest"
658
+ /admin/collection/{collectionId}/ai/agent/tools:
659
+ get:
660
+ tags:
661
+ - agent
662
+ summary: List the tools the agent can use (optionally scoped by capability / name).
663
+ operationId: agent_listTools
664
+ security:
665
+ - bearerAuth: []
666
+ parameters:
667
+ - name: collectionId
668
+ in: path
669
+ required: true
670
+ schema:
671
+ type: string
672
+ - name: allowCapabilities
673
+ in: query
674
+ required: false
675
+ schema:
676
+ type: string
677
+ - name: only
678
+ in: query
679
+ required: false
680
+ schema:
681
+ type: string
682
+ - name: exclude
683
+ in: query
684
+ required: false
685
+ schema:
686
+ type: string
687
+ responses:
688
+ 200:
689
+ description: Success
690
+ content:
691
+ application/json:
692
+ schema:
693
+ $ref: "#/components/schemas/AgentToolsResponse"
694
+ 400:
695
+ description: Bad request
696
+ 401:
697
+ description: Unauthorized
698
+ 404:
699
+ description: Not found
700
+ /admin/collection/{collectionId}/ai/catalog:
701
+ get:
702
+ tags:
703
+ - skills
704
+ summary: The full self-describing catalog (tools + skills).
705
+ operationId: skills_catalog
706
+ security:
707
+ - bearerAuth: []
708
+ parameters:
709
+ - name: collectionId
710
+ in: path
711
+ required: true
712
+ schema:
713
+ type: string
714
+ responses:
715
+ 200:
716
+ description: Success
717
+ content:
718
+ application/json:
719
+ schema:
720
+ $ref: "#/components/schemas/CatalogResponse"
721
+ 400:
722
+ description: Bad request
723
+ 401:
724
+ description: Unauthorized
725
+ 404:
726
+ description: Not found
622
727
  /admin/collection/{collectionId}/ai/configureAssistant:
623
728
  post:
624
729
  tags:
@@ -947,6 +1052,33 @@ paths:
947
1052
  description: Unauthorized
948
1053
  404:
949
1054
  description: Not found
1055
+ /admin/collection/{collectionId}/ai/skills:
1056
+ get:
1057
+ tags:
1058
+ - skills
1059
+ summary: List the skills apps can invoke (name, description, input/output schema).
1060
+ operationId: skills_list
1061
+ security:
1062
+ - bearerAuth: []
1063
+ parameters:
1064
+ - name: collectionId
1065
+ in: path
1066
+ required: true
1067
+ schema:
1068
+ type: string
1069
+ responses:
1070
+ 200:
1071
+ description: Success
1072
+ content:
1073
+ application/json:
1074
+ schema:
1075
+ $ref: "#/components/schemas/SkillsListResponse"
1076
+ 400:
1077
+ description: Bad request
1078
+ 401:
1079
+ description: Unauthorized
1080
+ 404:
1081
+ description: Not found
950
1082
  /admin/collection/{collectionId}/ai/tts:
951
1083
  post:
952
1084
  tags:
@@ -7404,6 +7536,39 @@ paths:
7404
7536
  description: Unauthorized
7405
7537
  404:
7406
7538
  description: Not found
7539
+ /admin/collection/{collectionId}/research/fetch:
7540
+ post:
7541
+ tags:
7542
+ - research
7543
+ summary: "Fetch + extract a web page: clean markdown, page metadata, and any schema.org JSON-LD (filtered by `type` when given)."
7544
+ operationId: research_fetch
7545
+ security:
7546
+ - bearerAuth: []
7547
+ parameters:
7548
+ - name: collectionId
7549
+ in: path
7550
+ required: true
7551
+ schema:
7552
+ type: string
7553
+ responses:
7554
+ 200:
7555
+ description: Success
7556
+ content:
7557
+ application/json:
7558
+ schema:
7559
+ $ref: "#/components/schemas/ResearchFetchResult"
7560
+ 400:
7561
+ description: Bad request
7562
+ 401:
7563
+ description: Unauthorized
7564
+ 404:
7565
+ description: Not found
7566
+ requestBody:
7567
+ required: true
7568
+ content:
7569
+ application/json:
7570
+ schema:
7571
+ $ref: "#/components/schemas/ResearchFetchRequest"
7407
7572
  /admin/collection/{collectionId}/segments:
7408
7573
  get:
7409
7574
  tags:
@@ -15814,6 +15979,143 @@ components:
15814
15979
  type: string
15815
15980
  required:
15816
15981
  - url
15982
+ AgentRunRequest:
15983
+ type: object
15984
+ properties:
15985
+ input:
15986
+ type: string
15987
+ prompt:
15988
+ type: string
15989
+ instructions:
15990
+ type: string
15991
+ model:
15992
+ type: string
15993
+ maxSteps:
15994
+ type: number
15995
+ allowCapabilities:
15996
+ type: array
15997
+ items:
15998
+ type: string
15999
+ only:
16000
+ type: array
16001
+ items:
16002
+ type: string
16003
+ exclude:
16004
+ type: array
16005
+ items:
16006
+ type: string
16007
+ AgentToolResult:
16008
+ type: object
16009
+ properties:
16010
+ name:
16011
+ type: string
16012
+ isError:
16013
+ type: boolean
16014
+ result: {}
16015
+ required:
16016
+ - name
16017
+ - isError
16018
+ - result
16019
+ AgentRunResult:
16020
+ type: object
16021
+ properties:
16022
+ finalText:
16023
+ type: string
16024
+ steps:
16025
+ type: number
16026
+ maxStepsReached:
16027
+ type: boolean
16028
+ toolResults:
16029
+ type: array
16030
+ items:
16031
+ $ref: "#/components/schemas/AgentToolResult"
16032
+ availableTools:
16033
+ type: array
16034
+ items:
16035
+ type: string
16036
+ required:
16037
+ - finalText
16038
+ - steps
16039
+ - maxStepsReached
16040
+ - toolResults
16041
+ - availableTools
16042
+ AgentToolDefinition:
16043
+ type: object
16044
+ properties:
16045
+ name:
16046
+ type: string
16047
+ description:
16048
+ type: string
16049
+ capabilities:
16050
+ type: array
16051
+ items:
16052
+ type: string
16053
+ parameters: {}
16054
+ required:
16055
+ - name
16056
+ - description
16057
+ - capabilities
16058
+ - parameters
16059
+ AgentToolsResponse:
16060
+ type: object
16061
+ properties:
16062
+ tools:
16063
+ type: array
16064
+ items:
16065
+ $ref: "#/components/schemas/AgentToolDefinition"
16066
+ required:
16067
+ - tools
16068
+ AgentToolsQuery:
16069
+ type: object
16070
+ properties:
16071
+ allowCapabilities:
16072
+ type: string
16073
+ only:
16074
+ type: string
16075
+ exclude:
16076
+ type: string
16077
+ SkillDescriptor:
16078
+ type: object
16079
+ properties:
16080
+ name:
16081
+ type: string
16082
+ description:
16083
+ type: string
16084
+ inputSchema: {}
16085
+ outputSchema: {}
16086
+ capabilities:
16087
+ type: array
16088
+ items:
16089
+ type: string
16090
+ required:
16091
+ - name
16092
+ - description
16093
+ - inputSchema
16094
+ - outputSchema
16095
+ - capabilities
16096
+ SkillsListResponse:
16097
+ type: object
16098
+ properties:
16099
+ skills:
16100
+ type: array
16101
+ items:
16102
+ $ref: "#/components/schemas/SkillDescriptor"
16103
+ required:
16104
+ - skills
16105
+ CatalogResponse:
16106
+ type: object
16107
+ properties:
16108
+ tools:
16109
+ type: array
16110
+ items:
16111
+ $ref: "#/components/schemas/AgentToolDefinition"
16112
+ skills:
16113
+ type: array
16114
+ items:
16115
+ $ref: "#/components/schemas/SkillDescriptor"
16116
+ required:
16117
+ - tools
16118
+ - skills
15817
16119
  AnalyticsLocation:
15818
16120
  type: object
15819
16121
  properties:
@@ -26399,6 +26701,51 @@ components:
26399
26701
  - nonce
26400
26702
  - mac
26401
26703
  - clientId
26704
+ ResearchFetchRequest:
26705
+ type: object
26706
+ properties:
26707
+ url:
26708
+ type: string
26709
+ type:
26710
+ type: string
26711
+ schemaType:
26712
+ type: string
26713
+ forceRefresh:
26714
+ type: boolean
26715
+ required:
26716
+ - url
26717
+ ResearchFetchResult:
26718
+ type: object
26719
+ properties:
26720
+ provider:
26721
+ type: string
26722
+ enum:
26723
+ - firecrawl
26724
+ - web
26725
+ status:
26726
+ type: number
26727
+ markdown:
26728
+ type: string
26729
+ html:
26730
+ type: string
26731
+ metadata:
26732
+ type: object
26733
+ additionalProperties: true
26734
+ schemas:
26735
+ type: array
26736
+ items: {}
26737
+ url:
26738
+ type: string
26739
+ cached:
26740
+ type: boolean
26741
+ fetchedAt:
26742
+ type: string
26743
+ required:
26744
+ - provider
26745
+ - status
26746
+ - schemas
26747
+ - url
26748
+ - cached
26402
26749
  InteractionFilterValue:
26403
26750
  type: object
26404
26751
  properties:
@@ -479,3 +479,60 @@ export interface AISearchPhotosPhoto {
479
479
  /** Allow extra fields */
480
480
  [key: string]: any;
481
481
  }
482
+ export interface AgentRunRequest {
483
+ /** User prompt (either input or prompt). */
484
+ input?: string;
485
+ prompt?: string;
486
+ /** System instructions. */
487
+ instructions?: string;
488
+ /** Model id, e.g. 'openai/gpt-5.6-terra'. */
489
+ model?: string;
490
+ /** Safety cap on model round-trips. */
491
+ maxSteps?: number;
492
+ /** Cap blast radius: only tools whose capabilities are all granted. */
493
+ allowCapabilities?: string[];
494
+ /** Restrict to these tool names. */
495
+ only?: string[];
496
+ /** Drop these tool names. */
497
+ exclude?: string[];
498
+ }
499
+ export interface AgentToolResult {
500
+ name: string;
501
+ isError: boolean;
502
+ result: any;
503
+ }
504
+ export interface AgentRunResult {
505
+ finalText: string | null;
506
+ steps: number;
507
+ maxStepsReached: boolean;
508
+ toolResults: AgentToolResult[];
509
+ availableTools: string[];
510
+ }
511
+ export interface AgentToolDefinition {
512
+ name: string;
513
+ description: string;
514
+ capabilities: string[];
515
+ parameters: any;
516
+ }
517
+ export interface AgentToolsResponse {
518
+ tools: AgentToolDefinition[];
519
+ }
520
+ export interface AgentToolsQuery {
521
+ allowCapabilities?: string;
522
+ only?: string;
523
+ exclude?: string;
524
+ }
525
+ export interface SkillDescriptor {
526
+ name: string;
527
+ description: string;
528
+ inputSchema: any;
529
+ outputSchema: any;
530
+ capabilities: string[];
531
+ }
532
+ export interface SkillsListResponse {
533
+ skills: SkillDescriptor[];
534
+ }
535
+ export interface CatalogResponse {
536
+ tools: AgentToolDefinition[];
537
+ skills: SkillDescriptor[];
538
+ }
@@ -39,5 +39,6 @@ export * from "./appObjects";
39
39
  export * from "./loyalty";
40
40
  export * from "./translations";
41
41
  export * from "./integrations";
42
+ export * from "./research";
42
43
  export * from "./config";
43
44
  export * from "./widgets";
@@ -41,5 +41,6 @@ export * from "./appObjects";
41
41
  export * from "./loyalty";
42
42
  export * from "./translations";
43
43
  export * from "./integrations";
44
+ export * from "./research";
44
45
  export * from "./config";
45
46
  export * from "./widgets";
@@ -0,0 +1,22 @@
1
+ export interface ResearchFetchRequest {
2
+ /** Absolute URL to fetch (https). */
3
+ url: string;
4
+ /** schema.org @type filter for the returned JSON-LD, e.g. "Recipe" or "Product". */
5
+ type?: string;
6
+ /** Alias for `type`. */
7
+ schemaType?: string;
8
+ /** Bypass the cache and re-fetch. */
9
+ forceRefresh?: boolean;
10
+ }
11
+ export interface ResearchFetchResult {
12
+ provider: 'firecrawl' | 'web';
13
+ status: number | null;
14
+ markdown?: string | null;
15
+ html?: string | null;
16
+ metadata?: Record<string, any> | null;
17
+ /** schema.org JSON-LD objects (filtered by `type` when provided). */
18
+ schemas: any[];
19
+ url: string;
20
+ cached: boolean;
21
+ fetchedAt?: string;
22
+ }
@@ -0,0 +1,6 @@
1
+ // src/types/research.ts
2
+ //
3
+ // Web research: fetch + extract a page server-side (Firecrawl-primary, puppeteer
4
+ // fallback), returning clean markdown, page metadata, and deterministic schema.org
5
+ // JSON-LD. The structured-data path (e.g. a recipe/product page) needs no AI.
6
+ export {};
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 1.17.0 | Generated: 2026-09-13T07:38:31.861Z
3
+ Version: 1.17.4 | Generated: 2026-09-13T17:10:55.335Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -57,6 +57,8 @@ For detailed guides on specific features:
57
57
  - **[Analytics](analytics.md)** - Web analytics, link-click tracking, QR/tag scan telemetry, and event reporting
58
58
  - **[Analytics Metadata Conventions](analytics-metadata-conventions.md)** - Standard recommended keys and conventions for analytics metadata fields
59
59
  - **[Loyalty: Points, Members & Earning Rules](loyalty.md)** - Loyalty schemes, automatic point earning via interaction rules, member balances, transaction history, and manual adjustments
60
+ - **[Integrations](integrations.md)** - Inbound/outbound integration flows + the sealed-secret store; triggers (manual/event/schedule), field mappings, and the Syndigo/Event Hub outbound path
61
+ - **[AI Tools & Skills](ai-tools-and-skills.md)** - The AI capability catalog: skills apps invoke by name (e.g. research.brand), the tools the AI reaches for (web fetch/screenshot/brand assets/image gen), the agent loop, and how apps discover them
60
62
  - **[Deep Link Discovery](deep-link-discovery.md)** - Registering and discovering navigable app states for portal menus and AI orchestration
61
63
  - **[AI-Native App Manifests](manifests.md)** - How AI workflows discover, configure, and import apps via structured manifests and prose guides
62
64
  - **[AI Guide Template](ai-guide-template.md)** - A sample for an app on how to build an AI setup guide
@@ -143,6 +145,7 @@ The Smartlinks SDK is organized into the following namespaces:
143
145
  - **order** - Functions for order operations
144
146
  - **products** - Functions for products operations
145
147
  - **realtime** - Functions for realtime operations
148
+ - **research** - Functions for research operations
146
149
  - **secrets** - Functions for secrets operations
147
150
  - **tags** - Functions for tags operations
148
151
  - **template** - Functions for template operations
@@ -1011,6 +1014,92 @@ interface AISearchPhotosPhoto {
1011
1014
  }
1012
1015
  ```
1013
1016
 
1017
+ **AgentRunRequest** (interface)
1018
+ ```typescript
1019
+ interface AgentRunRequest {
1020
+ input?: string
1021
+ prompt?: string
1022
+ instructions?: string
1023
+ model?: string
1024
+ maxSteps?: number
1025
+ allowCapabilities?: string[]
1026
+ only?: string[]
1027
+ exclude?: string[]
1028
+ }
1029
+ ```
1030
+
1031
+ **AgentToolResult** (interface)
1032
+ ```typescript
1033
+ interface AgentToolResult {
1034
+ name: string
1035
+ isError: boolean
1036
+ result: any
1037
+ }
1038
+ ```
1039
+
1040
+ **AgentRunResult** (interface)
1041
+ ```typescript
1042
+ interface AgentRunResult {
1043
+ finalText: string | null
1044
+ steps: number
1045
+ maxStepsReached: boolean
1046
+ toolResults: AgentToolResult[]
1047
+ availableTools: string[]
1048
+ }
1049
+ ```
1050
+
1051
+ **AgentToolDefinition** (interface)
1052
+ ```typescript
1053
+ interface AgentToolDefinition {
1054
+ name: string
1055
+ description: string
1056
+ capabilities: string[]
1057
+ parameters: any
1058
+ }
1059
+ ```
1060
+
1061
+ **AgentToolsResponse** (interface)
1062
+ ```typescript
1063
+ interface AgentToolsResponse {
1064
+ tools: AgentToolDefinition[]
1065
+ }
1066
+ ```
1067
+
1068
+ **AgentToolsQuery** (interface)
1069
+ ```typescript
1070
+ interface AgentToolsQuery {
1071
+ allowCapabilities?: string
1072
+ only?: string
1073
+ exclude?: string
1074
+ }
1075
+ ```
1076
+
1077
+ **SkillDescriptor** (interface)
1078
+ ```typescript
1079
+ interface SkillDescriptor {
1080
+ name: string
1081
+ description: string
1082
+ inputSchema: any
1083
+ outputSchema: any
1084
+ capabilities: string[]
1085
+ }
1086
+ ```
1087
+
1088
+ **SkillsListResponse** (interface)
1089
+ ```typescript
1090
+ interface SkillsListResponse {
1091
+ skills: SkillDescriptor[]
1092
+ }
1093
+ ```
1094
+
1095
+ **CatalogResponse** (interface)
1096
+ ```typescript
1097
+ interface CatalogResponse {
1098
+ tools: AgentToolDefinition[]
1099
+ skills: SkillDescriptor[]
1100
+ }
1101
+ ```
1102
+
1014
1103
  ### analytics
1015
1104
 
1016
1105
  **AnalyticsLocation** (interface)
@@ -7957,6 +8046,33 @@ interface AblyTokenRequest {
7957
8046
 
7958
8047
  **RealtimeChannelPattern** = `string`
7959
8048
 
8049
+ ### research
8050
+
8051
+ **ResearchFetchRequest** (interface)
8052
+ ```typescript
8053
+ interface ResearchFetchRequest {
8054
+ url: string
8055
+ type?: string
8056
+ schemaType?: string
8057
+ forceRefresh?: boolean
8058
+ }
8059
+ ```
8060
+
8061
+ **ResearchFetchResult** (interface)
8062
+ ```typescript
8063
+ interface ResearchFetchResult {
8064
+ provider: 'firecrawl' | 'web'
8065
+ status: number | null
8066
+ markdown?: string | null
8067
+ html?: string | null
8068
+ metadata?: Record<string, any> | null
8069
+ schemas: any[]
8070
+ url: string
8071
+ cached: boolean
8072
+ fetchedAt?: string
8073
+ }
8074
+ ```
8075
+
7960
8076
  ### segments
7961
8077
 
7962
8078
  **InteractionFilterValue** (interface)
@@ -8795,6 +8911,14 @@ interface Gs1DigitalLinkParams {
8795
8911
 
8796
8912
  ## API Functions
8797
8913
 
8914
+ ### agent
8915
+
8916
+ **run**(collectionId: string, body: AgentRunRequest) → `Promise<AgentRunResult>`
8917
+ Run the server-side AI agent loop once: assembles the tool set, runs the model, executes tool calls, and returns the final text + the tool trace. POST /admin/collection/:collectionId/ai/agent/run
8918
+
8919
+ **listTools**(collectionId: string, query: AgentToolsQuery = {}) → `Promise<AgentToolsResponse>`
8920
+ List the tools the agent can use (optionally scoped by capability / name). GET /admin/collection/:collectionId/ai/agent/tools
8921
+
8798
8922
  ### analytics.admin
8799
8923
 
8800
8924
  **summary**(collectionId: string,
@@ -10832,6 +10956,11 @@ Get an Ably token for public (user-scoped) real-time communication. This endpoin
10832
10956
  **getAdminToken**() → `Promise<AblyTokenRequest>`
10833
10957
  Get an Ably token for admin real-time communication. This endpoint returns an Ably TokenRequest that can be used to initialize an Ably client with admin permissions to receive system notifications and alerts. Admin users get subscribe-only (read-only) access to the interaction:{userId} channel pattern. Requires admin authentication (Bearer token). ```ts const tokenRequest = await realtime.getAdminToken() // Use with Ably const ably = new Ably.Realtime.Promise({ authCallback: async (data, callback) => { callback(null, tokenRequest) } }) // Subscribe to admin interaction channel const userId = 'my-user-id' const channel = ably.channels.get(`interaction:${userId}`) await channel.subscribe((message) => { console.log('Admin notification:', message.data) }) ```
10834
10958
 
10959
+ ### research
10960
+
10961
+ **fetch**(collectionId: string, body: ResearchFetchRequest) → `Promise<ResearchFetchResult>`
10962
+ Fetch + extract a web page: clean markdown, page metadata, and any schema.org JSON-LD (filtered by `type` when given). Firecrawl-primary, cached per collection. POST /admin/collection/:collectionId/research/fetch
10963
+
10835
10964
  ### secrets
10836
10965
 
10837
10966
  **list**(collectionId: string, query: ListSecretsQuery = {}) → `Promise<SecretList>`
@@ -10879,6 +11008,14 @@ Soft-delete a secret. DELETE /secrets/:ref
10879
11008
  **stats**(collectionId: string) → `Promise<SessionStatistics>`
10880
11009
  Get session statistics
10881
11010
 
11011
+ ### skills
11012
+
11013
+ **list**(collectionId: string) → `Promise<SkillsListResponse>`
11014
+ List the skills apps can invoke (name, description, input/output schema).
11015
+
11016
+ **run**(collectionId: string, name: string, input: Record<string, any> = {}) → `Promise<T>`
11017
+ Invoke a skill by name with structured input — the app-facing verb; no prompt-shaping. POST /admin/collection/:collectionId/ai/skills/:name/run
11018
+
10882
11019
  ### tags
10883
11020
 
10884
11021
  **create**(collectionId: string,