@techis/ai-runtime 0.0.0-stage → 0.3.0-rc.16

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 (109) hide show
  1. package/LICENSE +122 -0
  2. package/README.md +56 -3
  3. package/THIRD_PARTY_NOTICES +34 -0
  4. package/dist/adapters/gemini.d.ts +3 -0
  5. package/dist/adapters/gemini.d.ts.map +1 -0
  6. package/dist/adapters/gemini.js +85 -0
  7. package/dist/adapters/gemini.js.map +1 -0
  8. package/dist/adapters/http.d.ts +21 -0
  9. package/dist/adapters/http.d.ts.map +1 -0
  10. package/dist/adapters/http.js +86 -0
  11. package/dist/adapters/http.js.map +1 -0
  12. package/dist/adapters/mock.d.ts +40 -0
  13. package/dist/adapters/mock.d.ts.map +1 -0
  14. package/dist/adapters/mock.js +48 -0
  15. package/dist/adapters/mock.js.map +1 -0
  16. package/dist/adapters/moonshot.d.ts +3 -0
  17. package/dist/adapters/moonshot.d.ts.map +1 -0
  18. package/dist/adapters/moonshot.js +46 -0
  19. package/dist/adapters/moonshot.js.map +1 -0
  20. package/dist/adapters/openai.d.ts +4 -0
  21. package/dist/adapters/openai.d.ts.map +1 -0
  22. package/dist/adapters/openai.js +110 -0
  23. package/dist/adapters/openai.js.map +1 -0
  24. package/dist/adapters/registry.d.ts +6 -0
  25. package/dist/adapters/registry.d.ts.map +1 -0
  26. package/dist/adapters/registry.js +39 -0
  27. package/dist/adapters/registry.js.map +1 -0
  28. package/dist/adapters/types.d.ts +60 -0
  29. package/dist/adapters/types.d.ts.map +1 -0
  30. package/dist/adapters/types.js +2 -0
  31. package/dist/adapters/types.js.map +1 -0
  32. package/dist/adapters/zai.d.ts +27 -0
  33. package/dist/adapters/zai.d.ts.map +1 -0
  34. package/dist/adapters/zai.js +111 -0
  35. package/dist/adapters/zai.js.map +1 -0
  36. package/dist/bundle-source-factory.d.ts +4 -0
  37. package/dist/bundle-source-factory.d.ts.map +1 -0
  38. package/dist/bundle-source-factory.js +5 -0
  39. package/dist/bundle-source-factory.js.map +1 -0
  40. package/dist/bundle-source.d.ts +40 -0
  41. package/dist/bundle-source.d.ts.map +1 -0
  42. package/dist/bundle-source.js +167 -0
  43. package/dist/bundle-source.js.map +1 -0
  44. package/dist/catalog-delivery.d.ts +53 -0
  45. package/dist/catalog-delivery.d.ts.map +1 -0
  46. package/dist/catalog-delivery.js +148 -0
  47. package/dist/catalog-delivery.js.map +1 -0
  48. package/dist/client.d.ts +33 -0
  49. package/dist/client.d.ts.map +1 -0
  50. package/dist/client.js +238 -0
  51. package/dist/client.js.map +1 -0
  52. package/dist/cost.d.ts +28 -0
  53. package/dist/cost.d.ts.map +1 -0
  54. package/dist/cost.js +92 -0
  55. package/dist/cost.js.map +1 -0
  56. package/dist/deadline.d.ts +3 -0
  57. package/dist/deadline.d.ts.map +1 -0
  58. package/dist/deadline.js +37 -0
  59. package/dist/deadline.js.map +1 -0
  60. package/dist/errors.d.ts +64 -0
  61. package/dist/errors.d.ts.map +1 -0
  62. package/dist/errors.js +116 -0
  63. package/dist/errors.js.map +1 -0
  64. package/dist/index.d.ts +24 -0
  65. package/dist/index.d.ts.map +1 -0
  66. package/dist/index.js +22 -0
  67. package/dist/index.js.map +1 -0
  68. package/dist/package-updates.d.ts +24 -0
  69. package/dist/package-updates.d.ts.map +1 -0
  70. package/dist/package-updates.js +56 -0
  71. package/dist/package-updates.js.map +1 -0
  72. package/dist/reasoning-resolution.d.ts +33 -0
  73. package/dist/reasoning-resolution.d.ts.map +1 -0
  74. package/dist/reasoning-resolution.js +89 -0
  75. package/dist/reasoning-resolution.js.map +1 -0
  76. package/dist/resolution.d.ts +17 -0
  77. package/dist/resolution.d.ts.map +1 -0
  78. package/dist/resolution.js +94 -0
  79. package/dist/resolution.js.map +1 -0
  80. package/dist/run.d.ts +45 -0
  81. package/dist/run.d.ts.map +1 -0
  82. package/dist/run.js +803 -0
  83. package/dist/run.js.map +1 -0
  84. package/dist/scoped-source.d.ts +20 -0
  85. package/dist/scoped-source.d.ts.map +1 -0
  86. package/dist/scoped-source.js +112 -0
  87. package/dist/scoped-source.js.map +1 -0
  88. package/dist/snapshot.d.ts +40 -0
  89. package/dist/snapshot.d.ts.map +1 -0
  90. package/dist/snapshot.js +234 -0
  91. package/dist/snapshot.js.map +1 -0
  92. package/dist/types.d.ts +244 -0
  93. package/dist/types.d.ts.map +1 -0
  94. package/dist/types.js +15 -0
  95. package/dist/types.js.map +1 -0
  96. package/dist/version.d.ts +9 -0
  97. package/dist/version.d.ts.map +1 -0
  98. package/dist/version.js +9 -0
  99. package/dist/version.js.map +1 -0
  100. package/package.json +24 -4
  101. package/third-party-licenses/ajv-formats@3.0.1/LICENSE +21 -0
  102. package/third-party-licenses/ajv@8.20.0/LICENSE +22 -0
  103. package/third-party-licenses/fast-deep-equal@3.1.3/LICENSE +21 -0
  104. package/third-party-licenses/fast-uri@3.1.7/LICENSE +30 -0
  105. package/third-party-licenses/json-schema-traverse@1.0.0/LICENSE +21 -0
  106. package/third-party-licenses/require-from-string@2.0.2/license +21 -0
  107. package/third-party-licenses/typescript@5.9.3/LICENSE.txt +55 -0
  108. package/third-party-licenses/typescript@5.9.3/ThirdPartyNoticeText.txt +193 -0
  109. package/third-party-licenses.json +102 -0
@@ -0,0 +1,244 @@
1
+ import type { ApplicationId, CatalogRelease, ConfigurationManifest, Connection, EnvironmentId, ExecutionCaps, ExecutionProfileRevision, PersonaId, PersonaSpecification, PersonaAssignments } from "@techis/ai-contracts";
2
+ export type FetchImpl = (input: string, init?: RequestInit) => Promise<Response>;
3
+ export type Credential = {
4
+ kind: "bearer";
5
+ token: string;
6
+ } | {
7
+ kind: "api-key";
8
+ key: string;
9
+ headerName: string;
10
+ } | {
11
+ kind: "query-param";
12
+ name: string;
13
+ value: string;
14
+ };
15
+ /** Supplied by application infrastructure; must never be implemented in renderer code. */
16
+ export interface CredentialResolver {
17
+ resolve(credentialReference: string, context: {
18
+ applicationId: string;
19
+ environmentId: string;
20
+ provider: string;
21
+ }): Promise<Credential>;
22
+ }
23
+ /** Environment-variable credential resolver for local development and trusted backends. */
24
+ export declare function envCredentialResolver(reference: string): Promise<Credential>;
25
+ export interface StoredDocument {
26
+ data: unknown;
27
+ etag: string;
28
+ }
29
+ /**
30
+ * Read access to the versioned configuration store. The management package and the
31
+ * management API both implement it; the runtime never writes configuration.
32
+ */
33
+ export interface ConfigurationDocumentStore {
34
+ readDocument(key: string): Promise<StoredDocument | null>;
35
+ /** Optional enumeration, used for manifest-history fallback when the store supports it. */
36
+ listKeys?(prefix: string): Promise<string[]>;
37
+ }
38
+ export interface ManagementApiSource {
39
+ kind: "management-api";
40
+ url: string;
41
+ /** Static token (local development). Prefer tokenResolver for renewing credentials. */
42
+ token?: string;
43
+ /**
44
+ * Stable-identity async credential access: resolved per request so renewal never
45
+ * changes the cache identity (plan section 8: never key by access-token bytes).
46
+ */
47
+ tokenResolver?: () => Promise<string>;
48
+ /** Total configuration fetch deadline, including response body. Default 5 seconds. */
49
+ timeoutMs?: number;
50
+ }
51
+ export interface StoreSource {
52
+ kind: "store";
53
+ store: ConfigurationDocumentStore;
54
+ }
55
+ export interface InlineSource {
56
+ kind: "inline";
57
+ snapshot: unknown;
58
+ }
59
+ /**
60
+ * A first-class configuration bundle on disk (loading is verifying). The consumer's only
61
+ * subsystem dependencies are @techis/ai-runtime + @techis/ai-contracts.
62
+ */
63
+ export interface BundleSource {
64
+ kind: "bundle";
65
+ /** Directory containing manifest.json and the declared documents. */
66
+ directory: string;
67
+ /** Trusted host-supplied connections (credential references only, never secrets). */
68
+ connections?: Connection[];
69
+ /** Injected file read for tests; defaults to node:fs/promises. */
70
+ readFile?: (path: string) => Promise<string>;
71
+ }
72
+ export type ConfigurationSource = ManagementApiSource | StoreSource | InlineSource | ScopedSnapshotSourceV2 | BundleSource;
73
+ /** v2 exact scoped snapshot supplied by a host-owned loader (local repository or scoped management read). */
74
+ export interface ScopedSnapshotSourceV2 {
75
+ kind: "scoped-v2";
76
+ /** Returns a fully validated v2 snapshot for the configured scope. */
77
+ load(): Promise<import("@techis/ai-contracts").ScopedConfigurationSnapshotV2>;
78
+ }
79
+ export interface CachePolicy {
80
+ /** Age at which a validated snapshot becomes eligible for refresh. Default 5 minutes. */
81
+ maxAgeMs?: number;
82
+ /** Whether the last valid snapshot may serve requests when the management source is unreachable. Default true. */
83
+ allowWhenUnavailable?: boolean;
84
+ /** Absolute maximum time since online validation. null means no age cutoff. Default 24 hours. */
85
+ maxStaleMs?: number | null;
86
+ /** Serve eligible cached snapshots immediately while refreshing. Default false. */
87
+ backgroundRefresh?: boolean;
88
+ /** Minimum delay before another failed refresh attempt during active use. Default 30 seconds. */
89
+ retryDelayMs?: number;
90
+ }
91
+ /** Host-owned trusted storage. Writes must be atomic and durable; values contain configuration, never provider keys. */
92
+ export interface SnapshotCache {
93
+ /** Distinguishes deployments/stores and user identities within one host. */
94
+ namespace: string;
95
+ read(key: string): Promise<unknown>;
96
+ write(key: string, value: unknown): Promise<void>;
97
+ }
98
+ /** A complete, validated, internally consistent set of configuration documents. */
99
+ export interface ConfigurationSnapshot {
100
+ manifest: ConfigurationManifest;
101
+ catalog: CatalogRelease;
102
+ profiles: Record<string, ExecutionProfileRevision>;
103
+ personas: Record<string, PersonaSpecification>;
104
+ assignments: PersonaAssignments;
105
+ loadedAt: string;
106
+ sourceDescription: string;
107
+ }
108
+ export interface ConnectionIndex {
109
+ [provider: string]: Connection | undefined;
110
+ }
111
+ /** The pinned resolution for one workflow run; profile updates mid-run cannot affect it. */
112
+ export interface ResolutionToken {
113
+ applicationId: ApplicationId;
114
+ environmentId: EnvironmentId;
115
+ personaId: PersonaId;
116
+ persona: PersonaSpecification;
117
+ profile: ExecutionProfileRevision;
118
+ manifestRevision: string;
119
+ catalogRevision: string;
120
+ connections: ConnectionIndex;
121
+ instructionProjection?: InstructionProjection;
122
+ /** Scoped-v2 identity recorded on receipts, when configuration came from a scoped source. */
123
+ scope?: {
124
+ desktopConfigurationId: string;
125
+ workspaceId: string;
126
+ };
127
+ }
128
+ export interface ImagePart {
129
+ mimeType: string;
130
+ dataBase64: string;
131
+ /** OpenAI image detail; unsupported adapters reject explicit detail. */
132
+ detail?: "auto" | "low" | "high" | "original";
133
+ }
134
+ export type GenerateInput = string | {
135
+ text?: string;
136
+ images?: ImagePart[];
137
+ };
138
+ export interface OperationSettings {
139
+ webSearch?: boolean;
140
+ /** Native OpenAI controls apply only to OpenAI slots. */
141
+ openai?: {
142
+ strictSchema?: boolean;
143
+ schemaName?: string;
144
+ store?: boolean;
145
+ verbosity?: "low" | "medium" | "high";
146
+ maxToolCalls?: number;
147
+ searchContextSize?: "low" | "medium" | "high";
148
+ };
149
+ /** Result count is not a bound on the number of searches. */
150
+ zai?: {
151
+ searchResultCount?: number;
152
+ searchContentSize?: "medium" | "high";
153
+ };
154
+ }
155
+ /**
156
+ * One invocation of a generation. The operation ID is required stable identity: it names
157
+ * the business operation this generation serves and appears on the execution receipt.
158
+ * Effort and output values supplied here are caller-directed requests — they replace
159
+ * profile defaults upward or downward and are bounded only by explicit caps and model
160
+ * capability.
161
+ */
162
+ export interface GenerateOptions {
163
+ /** Bounded, storage-safe logical operation identifier (see OPERATION_ID_PATTERN). */
164
+ operationId: string;
165
+ input: GenerateInput;
166
+ /** JSON Schema the structured output must conform to; overrides the persona's schema when supplied. */
167
+ outputSchema?: Record<string, unknown>;
168
+ operation?: OperationSettings;
169
+ /** General workload effort hint; translated per model by the profile's effort policy. */
170
+ effortHint?: string;
171
+ /** Exact native effort levels keyed by catalog ID; each remains bounded by the profile's effort policy. */
172
+ effortByModel?: Record<string, string>;
173
+ /** Replaces the profile/slot output-token default upward or downward. */
174
+ maxOutputTokens?: number;
175
+ /** Invocation-level non-overridable bounds (workflow or budget policy). */
176
+ caps?: ExecutionCaps;
177
+ /** Legacy timing tightens profile ceilings. Opt in to caller-owned timers with timingPolicy: "caller". */
178
+ execution?: {
179
+ /** Omitted/"profile": legacy ceilings/defaults. "caller": ignore profile timing; omitted timers are unbounded. */
180
+ timingPolicy?: "profile" | "caller";
181
+ /** Caller mode: measured after queue admission, including credentials and HTTP; no hidden 60-second ceiling. */
182
+ attemptTimeoutMs?: number;
183
+ /** Caller mode: measured from generate() admission, including queueing, all attempts and backoff. */
184
+ deadlineMs?: number;
185
+ /** Still tightens profile attempt counts in either timing policy. */
186
+ maxAttempts?: number;
187
+ };
188
+ signal?: AbortSignal;
189
+ /** Optional caller identity for idempotent receipt correlation; must be storage-safe when supplied. */
190
+ requestId?: string;
191
+ }
192
+ export declare const OPERATION_ID_PATTERN: RegExp;
193
+ export declare const REQUEST_ID_PATTERN: RegExp;
194
+ export type NormalizedOutput = {
195
+ kind: "text";
196
+ text: string;
197
+ } | {
198
+ kind: "structured";
199
+ value: unknown;
200
+ };
201
+ export interface GenerateResult {
202
+ output: NormalizedOutput;
203
+ /** The same canonical receipt that was emitted to the sink for this terminal outcome. */
204
+ executionReceipt: import("@techis/ai-contracts").ExecutionReceipt;
205
+ }
206
+ export interface AIRun {
207
+ readonly resolution: ResolutionToken;
208
+ generate(options: GenerateOptions): Promise<GenerateResult>;
209
+ }
210
+ export interface AIWorkflow {
211
+ readonly manifestRevision: string;
212
+ startRun(options: StartRunOptions): Promise<AIRun>;
213
+ }
214
+ export interface AIClient {
215
+ /** Reports freshness without fetching or extending the cache lifetime. */
216
+ configurationStatus(): {
217
+ state: "not-loaded" | "fresh" | "stale" | "denied";
218
+ loadedAt?: string;
219
+ ageMs?: number;
220
+ maxStaleMs: number | null;
221
+ refreshing: boolean;
222
+ refreshFailed: boolean;
223
+ };
224
+ /** Captures one configuration for all personas participating in a workflow. */
225
+ captureWorkflow(): Promise<AIWorkflow>;
226
+ /** Loads (or returns cached) a validated configuration snapshot for the client's scope. */
227
+ loadSnapshot(force?: boolean): Promise<ConfigurationSnapshot>;
228
+ startRun(options: StartRunOptions): Promise<AIRun>;
229
+ readonly applicationId: ApplicationId;
230
+ readonly environmentId: EnvironmentId;
231
+ }
232
+ /** Trusted host prompt composition; never accepted from untrusted renderer input. */
233
+ export interface InstructionProjection {
234
+ systemInstructions: string;
235
+ projectionId: string;
236
+ projectionVersion: string;
237
+ }
238
+ export interface StartRunOptions {
239
+ instructionProjection?: InstructionProjection;
240
+ personaId: PersonaId;
241
+ /** Optional locally supplied instructions; must hash-match the registered revision. */
242
+ localInstructions?: string;
243
+ }
244
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,qBAAqB,EACrB,UAAU,EACV,aAAa,EACb,aAAa,EACb,wBAAwB,EACxB,SAAS,EACT,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEjF,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GACpD;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzD,0FAA0F;AAC1F,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,mBAAmB,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,aAAa,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CACxI;AAED,2FAA2F;AAC3F,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG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ted backends. */
2
+ export function envCredentialResolver(reference) {
3
+ const match = /^env:([A-Za-z_][A-Za-z0-9_]*)$/.exec(reference);
4
+ if (!match) {
5
+ return Promise.reject(new Error(`Unsupported credential reference "${reference}"; expected env:VAR_NAME`));
6
+ }
7
+ const value = process.env[match[1]];
8
+ if (!value) {
9
+ return Promise.reject(new Error(`Environment variable ${match[1]} is not set (credential reference ${reference})`));
10
+ }
11
+ return Promise.resolve({ kind: "bearer", token: value });
12
+ }
13
+ export const OPERATION_ID_PATTERN = /^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$/;
14
+ export const REQUEST_ID_PATTERN = /^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$/;
15
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAyBA,2FAA2F;AAC3F,MAAM,UAAU,qBAAqB,CAAC,SAAiB;IACrD,MAAM,KAAK,GAAG,gCAAgC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC/D,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,qCAAqC,SAAS,0BAA0B,CAAC,CAAC,CAAC;IAC7G,CAAC;IACD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACpC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,wBAAwB,KAAK,CAAC,CAAC,CAAC,qCAAqC,SAAS,GAAG,CAAC,CAAC,CAAC;IACtH,CAAC;IACD,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;AAC3D,CAAC;AA4KD,MAAM,CAAC,MAAM,oBAAoB,GAAG,oCAAoC,CAAC;AACzE,MAAM,CAAC,MAAM,kBAAkB,GAAG,oCAAoC,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Version of this @techis/ai-runtime build. The bundle loader validates every bundle's
3
+ * compatibleRuntime declaration against this value (loading is verifying). Kept in sync
4
+ * with packages/runtime/package.json — a repository test asserts they match, and a
5
+ * version number is never reused across a breaking contract change (D1, see
6
+ * docs/compatibility-matrix.md).
7
+ */
8
+ export declare const RUNTIME_VERSION = "0.3.0-rc.16";
9
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Version of this @techis/ai-runtime build. The bundle loader validates every bundle's
3
+ * compatibleRuntime declaration against this value (loading is verifying). Kept in sync
4
+ * with packages/runtime/package.json — a repository test asserts they match, and a
5
+ * version number is never reused across a breaking contract change (D1, see
6
+ * docs/compatibility-matrix.md).
7
+ */
8
+ export const RUNTIME_VERSION = "0.3.0-rc.16";
9
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,26 @@
1
1
  {
2
2
  "name": "@techis/ai-runtime",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.3.0-rc.16",
4
+ "type": "module",
5
+ "description": "Provider-neutral AI execution runtime: persona-based generation, native reasoning translation, bounded fallback, execution receipts.",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "default": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "LICENSE",
17
+ "README.md",
18
+ "THIRD_PARTY_NOTICES",
19
+ "third-party-licenses",
20
+ "third-party-licenses.json"
21
+ ],
22
+ "dependencies": {
23
+ "@techis/ai-contracts": "0.3.0-rc.16"
24
+ },
25
+ "license": "SEE LICENSE IN LICENSE"
26
+ }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Evgeny Poberezkin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015-2021 Evgeny Poberezkin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2017 Evgeny Poberezkin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,30 @@
1
+ Copyright (c) 2011-2021, Gary Court until https://github.com/garycourt/uri-js/commit/a1acf730b4bba3f1097c9f52e7d9d3aba8cdcaae
2
+ Copyright (c) 2021-present The Fastify team <https://github.com/fastify/fastify#team>
3
+ All rights reserved.
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+ * Redistributions of source code must retain the above copyright
8
+ notice, this list of conditions and the following disclaimer.
9
+ * Redistributions in binary form must reproduce the above copyright
10
+ notice, this list of conditions and the following disclaimer in the
11
+ documentation and/or other materials provided with the distribution.
12
+ * The names of any contributors may not be used to endorse or promote
13
+ products derived from this software without specific prior written
14
+ permission.
15
+
16
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY
20
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
+
27
+ * * *
28
+
29
+ The complete list of contributors can be found at:
30
+ - https://github.com/garycourt/uri-js/graphs/contributors
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2017 Evgeny Poberezkin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) Vsevolod Strukchinsky <floatdrop@gmail.com> (github.com/floatdrop)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,55 @@
1
+ Apache License
2
+
3
+ Version 2.0, January 2004
4
+
5
+ http://www.apache.org/licenses/
6
+
7
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
+
9
+ 1. Definitions.
10
+
11
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
16
+
17
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
18
+
19
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
20
+
21
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
22
+
23
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
24
+
25
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
26
+
27
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
28
+
29
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
30
+
31
+ 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
32
+
33
+ 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
34
+
35
+ 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
36
+
37
+ You must give any other recipients of the Work or Derivative Works a copy of this License; and
38
+
39
+ You must cause any modified files to carry prominent notices stating that You changed the files; and
40
+
41
+ You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
42
+
43
+ If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
44
+
45
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
46
+
47
+ 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
48
+
49
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
50
+
51
+ 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
52
+
53
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
54
+
55
+ END OF TERMS AND CONDITIONS