@proveanything/smartlinks 2.0.10 → 2.0.12
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/ai-tools.d.ts +35 -0
- package/dist/ai-tools.js +69 -0
- package/dist/api/ai.d.ts +7 -12
- package/dist/api/ai.js +2 -10
- package/dist/docs/API_SUMMARY.md +343 -1
- package/dist/docs/ai.md +79 -0
- package/dist/docs/app-manifest.md +702 -702
- package/dist/docs/host-dependency-contract.md +21 -6
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/openapi.yaml +484 -6
- package/dist/shared-dependencies.d.ts +3 -3
- package/dist/shared-dependencies.js +16 -6
- package/dist/types/ai.d.ts +323 -0
- package/dist/types/appManifest.d.ts +1 -1
- package/docs/API_SUMMARY.md +343 -1
- package/docs/ai.md +79 -0
- package/docs/app-manifest.md +702 -702
- package/docs/host-dependency-contract.md +21 -6
- package/openapi.yaml +484 -6
- package/package.json +3 -2
- package/scripts/doctor.mjs +4 -19
package/dist/types/ai.d.ts
CHANGED
|
@@ -109,6 +109,24 @@ export interface ResponsesRequest {
|
|
|
109
109
|
};
|
|
110
110
|
/** `'flex'` is ~50% cheaper at Batch-API rates but slower; reserve for non-interactive/background work. */
|
|
111
111
|
service_tier?: 'auto' | 'standard' | 'flex' | 'priority';
|
|
112
|
+
/**
|
|
113
|
+
* Run through the server-side agent loop: the platform executes built-in tools
|
|
114
|
+
* (see BUILTIN_AI_TOOLS / AiToolName) and feeds results back automatically, so the
|
|
115
|
+
* app never has to relay tool calls itself. `true` enables all built-ins; an array
|
|
116
|
+
* restricts to those tool names. When streaming, tool progress arrives as
|
|
117
|
+
* `agent.tool_call` / `agent.tool_result` events (see AgentStreamEvent), ending with
|
|
118
|
+
* `response.completed`. Not combinable with `previous_response_id`/`conversation`
|
|
119
|
+
* yet — pass prior turns in `input`.
|
|
120
|
+
*/
|
|
121
|
+
server_tools?: boolean | AiToolName[];
|
|
122
|
+
/** With `server_tools`: only run tools whose capabilities are all granted. */
|
|
123
|
+
allowCapabilities?: AiToolCapability[];
|
|
124
|
+
/** With `server_tools`: restrict to these tool names (alias of the array form). */
|
|
125
|
+
only?: AiToolName[];
|
|
126
|
+
/** With `server_tools`: drop these tool names. */
|
|
127
|
+
exclude?: AiToolName[];
|
|
128
|
+
/** With `server_tools`: cap model round-trips (1–12, default 8). */
|
|
129
|
+
maxSteps?: number;
|
|
112
130
|
}
|
|
113
131
|
/** Response from the Responses API. */
|
|
114
132
|
export interface ResponsesResult {
|
|
@@ -132,6 +150,8 @@ export interface ResponsesResult {
|
|
|
132
150
|
conversation?: unknown;
|
|
133
151
|
provider: 'openai';
|
|
134
152
|
responseTime: number;
|
|
153
|
+
/** Present when the request used `server_tools`: the server-side tool-use trace. */
|
|
154
|
+
_agent?: ResponsesAgentTrace;
|
|
135
155
|
}
|
|
136
156
|
/** Generic SSE event emitted by the Responses API. */
|
|
137
157
|
export interface ResponsesStreamEvent {
|
|
@@ -468,10 +488,17 @@ export interface AISearchPhotosRequest {
|
|
|
468
488
|
}
|
|
469
489
|
/** Single photo item returned by searchPhotos */
|
|
470
490
|
export interface AISearchPhotosPhoto {
|
|
491
|
+
/** Provider photo id */
|
|
492
|
+
id?: string;
|
|
471
493
|
/** Direct image URL */
|
|
472
494
|
url: string;
|
|
495
|
+
/** Thumbnail URL */
|
|
496
|
+
thumb?: string;
|
|
473
497
|
/** Alt text/description for accessibility */
|
|
474
498
|
alt?: string;
|
|
499
|
+
/** Pixel dimensions */
|
|
500
|
+
width?: number;
|
|
501
|
+
height?: number;
|
|
475
502
|
/** Photographer display name */
|
|
476
503
|
photographer?: string;
|
|
477
504
|
/** Link to the photographer profile */
|
|
@@ -479,6 +506,94 @@ export interface AISearchPhotosPhoto {
|
|
|
479
506
|
/** Allow extra fields */
|
|
480
507
|
[key: string]: any;
|
|
481
508
|
}
|
|
509
|
+
/**
|
|
510
|
+
* Response from `searchPhotos`. The API returns an **envelope** — the photos are in
|
|
511
|
+
* `results`, not the top-level array. (`searchPhotos` returns this object, not `Photo[]`.)
|
|
512
|
+
*/
|
|
513
|
+
export interface AISearchPhotosResponse {
|
|
514
|
+
/** Source provider, e.g. `'unsplash'`. */
|
|
515
|
+
provider: string;
|
|
516
|
+
/** The matched photos. */
|
|
517
|
+
results: AISearchPhotosPhoto[];
|
|
518
|
+
/** Total matches available. */
|
|
519
|
+
total?: number;
|
|
520
|
+
/** Total pages available. */
|
|
521
|
+
total_pages?: number;
|
|
522
|
+
[key: string]: any;
|
|
523
|
+
}
|
|
524
|
+
/** A single generated image from `generateImage`. */
|
|
525
|
+
export interface AIGeneratedImage {
|
|
526
|
+
/** Image URL, or a `data:` URI when the provider returns base64; `null` if neither. */
|
|
527
|
+
url: string | null;
|
|
528
|
+
/** Base64 image payload when the model returns it, else `null`. */
|
|
529
|
+
b64_json: string | null;
|
|
530
|
+
/** The provider's revised prompt, when returned. */
|
|
531
|
+
revised_prompt?: string;
|
|
532
|
+
[key: string]: any;
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* Response from `generateImage`. The API returns an **envelope** — the image(s) are in
|
|
536
|
+
* `images`, with `provider`/`model` metadata. (Not a bare URL or a bare array.)
|
|
537
|
+
*/
|
|
538
|
+
export interface AIGenerateImageResponse {
|
|
539
|
+
/** Provider used, e.g. `'openai'` | `'gemini'`. */
|
|
540
|
+
provider: string;
|
|
541
|
+
/** Model used, when reported. */
|
|
542
|
+
model?: string;
|
|
543
|
+
/** The generated image(s). */
|
|
544
|
+
images: AIGeneratedImage[];
|
|
545
|
+
[key: string]: any;
|
|
546
|
+
}
|
|
547
|
+
/** One candidate in a `generateContent` response (Gemini-normalised shape). */
|
|
548
|
+
export interface AIGenerateContentCandidate {
|
|
549
|
+
content?: {
|
|
550
|
+
parts?: Array<{
|
|
551
|
+
text?: string;
|
|
552
|
+
[k: string]: any;
|
|
553
|
+
}>;
|
|
554
|
+
role?: string;
|
|
555
|
+
[k: string]: any;
|
|
556
|
+
};
|
|
557
|
+
finishReason?: string;
|
|
558
|
+
[key: string]: any;
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* Response from `generateContent`. The API returns a **normalised envelope** (both providers
|
|
562
|
+
* are mapped to this shape) — text lives at `candidates[0].content.parts[0].text`.
|
|
563
|
+
*/
|
|
564
|
+
export interface AIGenerateContentResponse {
|
|
565
|
+
provider?: string;
|
|
566
|
+
model?: string;
|
|
567
|
+
candidates?: AIGenerateContentCandidate[];
|
|
568
|
+
usageMetadata?: {
|
|
569
|
+
promptTokenCount?: number;
|
|
570
|
+
candidatesTokenCount?: number;
|
|
571
|
+
totalTokenCount?: number;
|
|
572
|
+
[k: string]: any;
|
|
573
|
+
};
|
|
574
|
+
responseTime?: number;
|
|
575
|
+
[key: string]: any;
|
|
576
|
+
}
|
|
577
|
+
/** A file uploaded for AI use (`uploadFile`) — a provider file reference. */
|
|
578
|
+
export interface AIUploadedFile {
|
|
579
|
+
/** Provider file id / resource name. */
|
|
580
|
+
name?: string;
|
|
581
|
+
/** URI to reference the file in later calls. */
|
|
582
|
+
uri?: string;
|
|
583
|
+
url?: string;
|
|
584
|
+
mimeType?: string;
|
|
585
|
+
sizeBytes?: number | string;
|
|
586
|
+
state?: string;
|
|
587
|
+
[key: string]: any;
|
|
588
|
+
}
|
|
589
|
+
/** A cache reference returned by `createCache` — a provider cache resource. */
|
|
590
|
+
export interface AICacheRef {
|
|
591
|
+
/** Cache resource name / id. */
|
|
592
|
+
name?: string;
|
|
593
|
+
model?: string;
|
|
594
|
+
expireTime?: string;
|
|
595
|
+
[key: string]: any;
|
|
596
|
+
}
|
|
482
597
|
export interface AgentRunRequest {
|
|
483
598
|
/** User prompt (either input or prompt). */
|
|
484
599
|
input?: string;
|
|
@@ -536,3 +651,211 @@ export interface CatalogResponse {
|
|
|
536
651
|
tools: AgentToolDefinition[];
|
|
537
652
|
skills: SkillDescriptor[];
|
|
538
653
|
}
|
|
654
|
+
/** Capability tags a tool requires; scope a run with `allowCapabilities`. */
|
|
655
|
+
export type AiToolCapability = 'web:read' | 'ai:vision' | 'ai:image' | 'ai:text' | 'media:image' | 'media:pdf' | 'net:http';
|
|
656
|
+
/** The names of the built-in server-side agent tools (run via `server_tools`). */
|
|
657
|
+
export type AiToolName = 'web.fetchPage' | 'web.extractSchema' | 'web.screenshot' | 'web.search' | 'brand.assets' | 'document.read' | 'data.extract' | 'image.describe' | 'image.generate' | 'image.fromReference' | 'image.searchStock' | 'image.transform' | 'pdf.create' | 'pdf.fill' | 'pdf.merge' | 'http.request' | 'translate';
|
|
658
|
+
export interface WebFetchPageArgs {
|
|
659
|
+
url: string;
|
|
660
|
+
type?: string;
|
|
661
|
+
forceRefresh?: boolean;
|
|
662
|
+
}
|
|
663
|
+
export interface WebExtractSchemaArgs {
|
|
664
|
+
url: string;
|
|
665
|
+
schemaType?: string;
|
|
666
|
+
forceRefresh?: boolean;
|
|
667
|
+
}
|
|
668
|
+
export interface WebScreenshotArgs {
|
|
669
|
+
url: string;
|
|
670
|
+
}
|
|
671
|
+
export interface WebSearchArgs {
|
|
672
|
+
query: string;
|
|
673
|
+
limit?: number;
|
|
674
|
+
scrapeContent?: boolean;
|
|
675
|
+
}
|
|
676
|
+
export interface BrandAssetsArgs {
|
|
677
|
+
url: string;
|
|
678
|
+
}
|
|
679
|
+
export interface DocumentReadArgs {
|
|
680
|
+
url: string;
|
|
681
|
+
forceRefresh?: boolean;
|
|
682
|
+
}
|
|
683
|
+
export interface DataExtractArgs {
|
|
684
|
+
url: string;
|
|
685
|
+
schema?: Record<string, any>;
|
|
686
|
+
prompt?: string;
|
|
687
|
+
}
|
|
688
|
+
export interface ImageDescribeArgs {
|
|
689
|
+
imageUrl: string;
|
|
690
|
+
prompt?: string;
|
|
691
|
+
}
|
|
692
|
+
export interface ImageGenerateArgs {
|
|
693
|
+
prompt: string;
|
|
694
|
+
size?: string;
|
|
695
|
+
provider?: 'openai' | 'gemini';
|
|
696
|
+
}
|
|
697
|
+
export interface ImageFromReferenceArgs {
|
|
698
|
+
prompt: string;
|
|
699
|
+
imageUrls: string[];
|
|
700
|
+
size?: string;
|
|
701
|
+
model?: string;
|
|
702
|
+
}
|
|
703
|
+
export interface ImageSearchStockArgs {
|
|
704
|
+
query: string;
|
|
705
|
+
per_page?: number;
|
|
706
|
+
orientation?: 'landscape' | 'portrait' | 'squarish';
|
|
707
|
+
}
|
|
708
|
+
export interface ImageTransformArgs {
|
|
709
|
+
imageUrl: string;
|
|
710
|
+
resize?: {
|
|
711
|
+
width?: number;
|
|
712
|
+
height?: number;
|
|
713
|
+
fit?: 'cover' | 'contain' | 'fill' | 'inside' | 'outside';
|
|
714
|
+
allowUpscale?: boolean;
|
|
715
|
+
};
|
|
716
|
+
crop?: {
|
|
717
|
+
left: number;
|
|
718
|
+
top: number;
|
|
719
|
+
width: number;
|
|
720
|
+
height: number;
|
|
721
|
+
};
|
|
722
|
+
rotate?: number;
|
|
723
|
+
flip?: boolean;
|
|
724
|
+
flop?: boolean;
|
|
725
|
+
grayscale?: boolean;
|
|
726
|
+
tint?: string;
|
|
727
|
+
modulate?: {
|
|
728
|
+
brightness?: number;
|
|
729
|
+
saturation?: number;
|
|
730
|
+
hue?: number;
|
|
731
|
+
lightness?: number;
|
|
732
|
+
};
|
|
733
|
+
format?: 'jpeg' | 'png' | 'webp' | 'avif';
|
|
734
|
+
quality?: number;
|
|
735
|
+
}
|
|
736
|
+
export interface PdfCreateArgs {
|
|
737
|
+
html: string;
|
|
738
|
+
format?: string;
|
|
739
|
+
landscape?: boolean;
|
|
740
|
+
}
|
|
741
|
+
export interface PdfFillArgs {
|
|
742
|
+
url: string;
|
|
743
|
+
fields: Record<string, string | number | boolean>;
|
|
744
|
+
flatten?: boolean;
|
|
745
|
+
}
|
|
746
|
+
export interface PdfMergeArgs {
|
|
747
|
+
urls: string[];
|
|
748
|
+
}
|
|
749
|
+
export interface HttpRequestArgs {
|
|
750
|
+
url: string;
|
|
751
|
+
method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD';
|
|
752
|
+
headers?: Record<string, string>;
|
|
753
|
+
body?: any;
|
|
754
|
+
}
|
|
755
|
+
export interface TranslateArgs {
|
|
756
|
+
text: string;
|
|
757
|
+
targetLanguages: string[];
|
|
758
|
+
sourceLanguage?: string;
|
|
759
|
+
}
|
|
760
|
+
/** Map of tool name → its argument type, for typed construction. */
|
|
761
|
+
export interface AiToolArgsMap {
|
|
762
|
+
'web.fetchPage': WebFetchPageArgs;
|
|
763
|
+
'web.extractSchema': WebExtractSchemaArgs;
|
|
764
|
+
'web.screenshot': WebScreenshotArgs;
|
|
765
|
+
'web.search': WebSearchArgs;
|
|
766
|
+
'brand.assets': BrandAssetsArgs;
|
|
767
|
+
'document.read': DocumentReadArgs;
|
|
768
|
+
'data.extract': DataExtractArgs;
|
|
769
|
+
'image.describe': ImageDescribeArgs;
|
|
770
|
+
'image.generate': ImageGenerateArgs;
|
|
771
|
+
'image.fromReference': ImageFromReferenceArgs;
|
|
772
|
+
'image.searchStock': ImageSearchStockArgs;
|
|
773
|
+
'image.transform': ImageTransformArgs;
|
|
774
|
+
'pdf.create': PdfCreateArgs;
|
|
775
|
+
'pdf.fill': PdfFillArgs;
|
|
776
|
+
'pdf.merge': PdfMergeArgs;
|
|
777
|
+
'http.request': HttpRequestArgs;
|
|
778
|
+
'translate': TranslateArgs;
|
|
779
|
+
}
|
|
780
|
+
export interface WebSearchResultItem {
|
|
781
|
+
url: string | null;
|
|
782
|
+
title: string | null;
|
|
783
|
+
description: string | null;
|
|
784
|
+
markdown?: string;
|
|
785
|
+
}
|
|
786
|
+
export interface WebSearchResult {
|
|
787
|
+
query: string;
|
|
788
|
+
results: WebSearchResultItem[];
|
|
789
|
+
}
|
|
790
|
+
export interface DocumentReadResult {
|
|
791
|
+
url: string;
|
|
792
|
+
text: string | null;
|
|
793
|
+
metadata?: any;
|
|
794
|
+
provider?: string;
|
|
795
|
+
cached?: boolean;
|
|
796
|
+
}
|
|
797
|
+
export interface DataExtractResult {
|
|
798
|
+
url: string;
|
|
799
|
+
data: Record<string, any>;
|
|
800
|
+
}
|
|
801
|
+
export interface WebFetchPageResult {
|
|
802
|
+
url: string;
|
|
803
|
+
markdown?: string | null;
|
|
804
|
+
html?: string | null;
|
|
805
|
+
metadata?: any;
|
|
806
|
+
schemas?: any[];
|
|
807
|
+
provider?: string;
|
|
808
|
+
cached?: boolean;
|
|
809
|
+
status?: number | null;
|
|
810
|
+
}
|
|
811
|
+
export interface ImageDescribeResult {
|
|
812
|
+
imageUrl: string;
|
|
813
|
+
text: string | null;
|
|
814
|
+
}
|
|
815
|
+
/** Result of a tool that produces a hosted binary (image.transform, pdf.*). */
|
|
816
|
+
export interface HostedAssetResult {
|
|
817
|
+
hostedUrl: string | null;
|
|
818
|
+
contentType?: string;
|
|
819
|
+
info?: {
|
|
820
|
+
width?: number;
|
|
821
|
+
height?: number;
|
|
822
|
+
format?: string;
|
|
823
|
+
size?: number;
|
|
824
|
+
};
|
|
825
|
+
}
|
|
826
|
+
export interface HttpRequestResult {
|
|
827
|
+
status: number;
|
|
828
|
+
headers: Record<string, any>;
|
|
829
|
+
body: any;
|
|
830
|
+
truncated: boolean;
|
|
831
|
+
finalUrl: string;
|
|
832
|
+
}
|
|
833
|
+
export interface TranslateResult {
|
|
834
|
+
translations: Record<string, string>;
|
|
835
|
+
sourceLanguage: string;
|
|
836
|
+
}
|
|
837
|
+
/** The `_agent` trace attached to an agentic Responses result. */
|
|
838
|
+
export interface ResponsesAgentTrace {
|
|
839
|
+
steps: number;
|
|
840
|
+
maxStepsReached: boolean;
|
|
841
|
+
toolResults: AgentToolResult[];
|
|
842
|
+
availableTools: string[];
|
|
843
|
+
}
|
|
844
|
+
export interface AgentToolCallEvent {
|
|
845
|
+
type: 'agent.tool_call';
|
|
846
|
+
name: string;
|
|
847
|
+
args: Record<string, any>;
|
|
848
|
+
}
|
|
849
|
+
export interface AgentToolResultEvent {
|
|
850
|
+
type: 'agent.tool_result';
|
|
851
|
+
name: string;
|
|
852
|
+
isError: boolean;
|
|
853
|
+
result: any;
|
|
854
|
+
}
|
|
855
|
+
export interface AgentResponseCompletedEvent {
|
|
856
|
+
type: 'response.completed';
|
|
857
|
+
response: ResponsesResult;
|
|
858
|
+
_agent: ResponsesAgentTrace;
|
|
859
|
+
}
|
|
860
|
+
/** Union of events emitted when streaming an agentic Responses request. */
|
|
861
|
+
export type AgentStreamEvent = AgentToolCallEvent | AgentToolResultEvent | AgentResponseCompletedEvent | ResponsesStreamEvent;
|
|
@@ -417,7 +417,7 @@ export interface AppManifest {
|
|
|
417
417
|
*/
|
|
418
418
|
moduleFormat?: 'umd' | 'esm' | 'dual';
|
|
419
419
|
/**
|
|
420
|
-
* Shared-dependency contract version this bundle was built against, e.g. `"
|
|
420
|
+
* Shared-dependency contract version this bundle was built against, e.g. `"v7"`
|
|
421
421
|
* (see `SHARED_DEPENDENCY_CONTRACT_VERSION`). The host uses it to select a
|
|
422
422
|
* compatible import map for the ESM load path.
|
|
423
423
|
*/
|