@alienplatform/sdk 3.2.0 → 3.3.0
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/dist.js +173 -61
- package/dist/index.d.ts +7 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/native-bindings.d.ts +13 -0
- package/dist/native-bindings.d.ts.map +1 -0
- package/dist/native-bindings.js +18 -0
- package/dist/native.d.ts +19 -20
- package/dist/native.d.ts.map +1 -1
- package/dist/native.js +31 -1
- package/dist/worker-runtime/index.js +1 -1
- package/package.json +8 -3
package/dist/dist.js
CHANGED
|
@@ -4140,6 +4140,144 @@ const AgentStatusSchema = object({
|
|
|
4140
4140
|
* Generated by Kubb (https://kubb.dev/).
|
|
4141
4141
|
* Do not edit manually.
|
|
4142
4142
|
*/
|
|
4143
|
+
const HeartbeatCollectionIssueReasonSchema = _enum([
|
|
4144
|
+
"forbidden",
|
|
4145
|
+
"not-installed",
|
|
4146
|
+
"api-unavailable",
|
|
4147
|
+
"collection-failed",
|
|
4148
|
+
"timed-out"
|
|
4149
|
+
]);
|
|
4150
|
+
/**
|
|
4151
|
+
* Generated by Kubb (https://kubb.dev/).
|
|
4152
|
+
* Do not edit manually.
|
|
4153
|
+
*/
|
|
4154
|
+
const HeartbeatIssueSeveritySchema = _enum([
|
|
4155
|
+
"info",
|
|
4156
|
+
"warning",
|
|
4157
|
+
"error"
|
|
4158
|
+
]);
|
|
4159
|
+
/**
|
|
4160
|
+
* Generated by Kubb (https://kubb.dev/).
|
|
4161
|
+
* Do not edit manually.
|
|
4162
|
+
*/
|
|
4163
|
+
const HeartbeatCollectionIssueSchema = object({
|
|
4164
|
+
"message": string(),
|
|
4165
|
+
get "reason"() {
|
|
4166
|
+
return HeartbeatCollectionIssueReasonSchema;
|
|
4167
|
+
},
|
|
4168
|
+
get "severity"() {
|
|
4169
|
+
return HeartbeatIssueSeveritySchema;
|
|
4170
|
+
},
|
|
4171
|
+
"source": string()
|
|
4172
|
+
});
|
|
4173
|
+
/**
|
|
4174
|
+
* Generated by Kubb (https://kubb.dev/).
|
|
4175
|
+
* Do not edit manually.
|
|
4176
|
+
*/
|
|
4177
|
+
const ObservedHealthSchema = _enum([
|
|
4178
|
+
"unknown",
|
|
4179
|
+
"healthy",
|
|
4180
|
+
"degraded",
|
|
4181
|
+
"unhealthy"
|
|
4182
|
+
]);
|
|
4183
|
+
/**
|
|
4184
|
+
* Generated by Kubb (https://kubb.dev/).
|
|
4185
|
+
* Do not edit manually.
|
|
4186
|
+
*/
|
|
4187
|
+
const ProviderLifecycleStateSchema = _enum([
|
|
4188
|
+
"unknown",
|
|
4189
|
+
"creating",
|
|
4190
|
+
"updating",
|
|
4191
|
+
"running",
|
|
4192
|
+
"scaling",
|
|
4193
|
+
"stopping",
|
|
4194
|
+
"stopped",
|
|
4195
|
+
"deleting",
|
|
4196
|
+
"deleted",
|
|
4197
|
+
"failed"
|
|
4198
|
+
]);
|
|
4199
|
+
/**
|
|
4200
|
+
* Generated by Kubb (https://kubb.dev/).
|
|
4201
|
+
* Do not edit manually.
|
|
4202
|
+
*/
|
|
4203
|
+
const AiHeartbeatStatusSchema = object({
|
|
4204
|
+
get "collectionIssues"() {
|
|
4205
|
+
return array(HeartbeatCollectionIssueSchema);
|
|
4206
|
+
},
|
|
4207
|
+
get "health"() {
|
|
4208
|
+
return ObservedHealthSchema;
|
|
4209
|
+
},
|
|
4210
|
+
get "lifecycle"() {
|
|
4211
|
+
return ProviderLifecycleStateSchema;
|
|
4212
|
+
},
|
|
4213
|
+
"message": string().nullish(),
|
|
4214
|
+
"partial": boolean(),
|
|
4215
|
+
"stale": boolean()
|
|
4216
|
+
});
|
|
4217
|
+
/**
|
|
4218
|
+
* Generated by Kubb (https://kubb.dev/).
|
|
4219
|
+
* Do not edit manually.
|
|
4220
|
+
*/
|
|
4221
|
+
const AwsBedrockAiHeartbeatDataSchema = object({
|
|
4222
|
+
"region": string(),
|
|
4223
|
+
get "status"() {
|
|
4224
|
+
return AiHeartbeatStatusSchema;
|
|
4225
|
+
}
|
|
4226
|
+
});
|
|
4227
|
+
/**
|
|
4228
|
+
* Generated by Kubb (https://kubb.dev/).
|
|
4229
|
+
* Do not edit manually.
|
|
4230
|
+
*/
|
|
4231
|
+
const AzureFoundryAiHeartbeatDataSchema = object({
|
|
4232
|
+
"accountName": string(),
|
|
4233
|
+
"endpoint": string().nullish(),
|
|
4234
|
+
"location": string().nullish(),
|
|
4235
|
+
"resourceGroup": string().nullish(),
|
|
4236
|
+
get "status"() {
|
|
4237
|
+
return AiHeartbeatStatusSchema;
|
|
4238
|
+
}
|
|
4239
|
+
});
|
|
4240
|
+
/**
|
|
4241
|
+
* Generated by Kubb (https://kubb.dev/).
|
|
4242
|
+
* Do not edit manually.
|
|
4243
|
+
*/
|
|
4244
|
+
const ExternalAiHeartbeatDataSchema = object({
|
|
4245
|
+
"provider": string().describe("The BYO-key provider serving this binding (e.g. \"openai\"). Used on the Local\nplatform, where the app brings its own provider key instead of an ambient cloud."),
|
|
4246
|
+
get "status"() {
|
|
4247
|
+
return AiHeartbeatStatusSchema;
|
|
4248
|
+
}
|
|
4249
|
+
});
|
|
4250
|
+
/**
|
|
4251
|
+
* Generated by Kubb (https://kubb.dev/).
|
|
4252
|
+
* Do not edit manually.
|
|
4253
|
+
*/
|
|
4254
|
+
const GcpVertexAiHeartbeatDataSchema = object({
|
|
4255
|
+
"location": string(),
|
|
4256
|
+
"project": string(),
|
|
4257
|
+
get "status"() {
|
|
4258
|
+
return AiHeartbeatStatusSchema;
|
|
4259
|
+
}
|
|
4260
|
+
});
|
|
4261
|
+
/**
|
|
4262
|
+
* Generated by Kubb (https://kubb.dev/).
|
|
4263
|
+
* Do not edit manually.
|
|
4264
|
+
*/
|
|
4265
|
+
const AiHeartbeatDataSchema = union([
|
|
4266
|
+
lazy(() => AwsBedrockAiHeartbeatDataSchema).and(object({ "backend": _enum(["awsBedrock"]) })),
|
|
4267
|
+
lazy(() => GcpVertexAiHeartbeatDataSchema).and(object({ "backend": _enum(["gcpVertex"]) })),
|
|
4268
|
+
lazy(() => AzureFoundryAiHeartbeatDataSchema).and(object({ "backend": _enum(["azureFoundry"]) })),
|
|
4269
|
+
lazy(() => ExternalAiHeartbeatDataSchema).and(object({ "backend": _enum(["external"]) }))
|
|
4270
|
+
]);
|
|
4271
|
+
object({
|
|
4272
|
+
"account": string().describe("The provider account or project identifier, if applicable.").nullish(),
|
|
4273
|
+
"endpoint": string().describe("The provider endpoint URL, if applicable.").nullish(),
|
|
4274
|
+
"provider": string().describe("The AI provider name (e.g., \"bedrock\", \"vertex\", \"foundry\", \"external\").")
|
|
4275
|
+
}).describe("Outputs generated by a successfully provisioned AI Gateway resource.");
|
|
4276
|
+
object({ "id": string().describe("Identifier for the AI resource. Must contain only alphanumeric characters, hyphens, and underscores ([A-Za-z0-9-_]).\nMaximum 64 characters.") }).describe("Represents an AI Gateway resource that provides a unified interface to\nmanaged AI inference services across cloud providers.\n\nBYO-key external providers (OpenAI/Anthropic) are NOT declared here. Like any\nother BYO infrastructure (e.g. external Redis for `kv`), an external AI\nprovider is supplied at deploy time as an `ExternalBinding::Ai` in the\nstack's external-bindings map; the executor then skips the cloud controller.");
|
|
4277
|
+
/**
|
|
4278
|
+
* Generated by Kubb (https://kubb.dev/).
|
|
4279
|
+
* Do not edit manually.
|
|
4280
|
+
*/
|
|
4143
4281
|
/**
|
|
4144
4282
|
* @description Progress information for image push operations
|
|
4145
4283
|
*/
|
|
@@ -4448,66 +4586,6 @@ const ArchitectureSchema = _enum(["arm64", "x86_64"]).describe("CPU architecture
|
|
|
4448
4586
|
* Generated by Kubb (https://kubb.dev/).
|
|
4449
4587
|
* Do not edit manually.
|
|
4450
4588
|
*/
|
|
4451
|
-
const HeartbeatCollectionIssueReasonSchema = _enum([
|
|
4452
|
-
"forbidden",
|
|
4453
|
-
"not-installed",
|
|
4454
|
-
"api-unavailable",
|
|
4455
|
-
"collection-failed",
|
|
4456
|
-
"timed-out"
|
|
4457
|
-
]);
|
|
4458
|
-
/**
|
|
4459
|
-
* Generated by Kubb (https://kubb.dev/).
|
|
4460
|
-
* Do not edit manually.
|
|
4461
|
-
*/
|
|
4462
|
-
const HeartbeatIssueSeveritySchema = _enum([
|
|
4463
|
-
"info",
|
|
4464
|
-
"warning",
|
|
4465
|
-
"error"
|
|
4466
|
-
]);
|
|
4467
|
-
/**
|
|
4468
|
-
* Generated by Kubb (https://kubb.dev/).
|
|
4469
|
-
* Do not edit manually.
|
|
4470
|
-
*/
|
|
4471
|
-
const HeartbeatCollectionIssueSchema = object({
|
|
4472
|
-
"message": string(),
|
|
4473
|
-
get "reason"() {
|
|
4474
|
-
return HeartbeatCollectionIssueReasonSchema;
|
|
4475
|
-
},
|
|
4476
|
-
get "severity"() {
|
|
4477
|
-
return HeartbeatIssueSeveritySchema;
|
|
4478
|
-
},
|
|
4479
|
-
"source": string()
|
|
4480
|
-
});
|
|
4481
|
-
/**
|
|
4482
|
-
* Generated by Kubb (https://kubb.dev/).
|
|
4483
|
-
* Do not edit manually.
|
|
4484
|
-
*/
|
|
4485
|
-
const ObservedHealthSchema = _enum([
|
|
4486
|
-
"unknown",
|
|
4487
|
-
"healthy",
|
|
4488
|
-
"degraded",
|
|
4489
|
-
"unhealthy"
|
|
4490
|
-
]);
|
|
4491
|
-
/**
|
|
4492
|
-
* Generated by Kubb (https://kubb.dev/).
|
|
4493
|
-
* Do not edit manually.
|
|
4494
|
-
*/
|
|
4495
|
-
const ProviderLifecycleStateSchema = _enum([
|
|
4496
|
-
"unknown",
|
|
4497
|
-
"creating",
|
|
4498
|
-
"updating",
|
|
4499
|
-
"running",
|
|
4500
|
-
"scaling",
|
|
4501
|
-
"stopping",
|
|
4502
|
-
"stopped",
|
|
4503
|
-
"deleting",
|
|
4504
|
-
"deleted",
|
|
4505
|
-
"failed"
|
|
4506
|
-
]);
|
|
4507
|
-
/**
|
|
4508
|
-
* Generated by Kubb (https://kubb.dev/).
|
|
4509
|
-
* Do not edit manually.
|
|
4510
|
-
*/
|
|
4511
4589
|
const ArtifactRegistryHeartbeatStatusSchema = object({
|
|
4512
4590
|
get "collectionIssues"() {
|
|
4513
4591
|
return array(HeartbeatCollectionIssueSchema);
|
|
@@ -9209,6 +9287,12 @@ const ResourceHeartbeatDataSchema = union([
|
|
|
9209
9287
|
return AzureServiceBusNamespaceHeartbeatDataSchema;
|
|
9210
9288
|
},
|
|
9211
9289
|
"resourceType": _enum(["azure_service_bus_namespace"])
|
|
9290
|
+
}),
|
|
9291
|
+
object({
|
|
9292
|
+
get "data"() {
|
|
9293
|
+
return AiHeartbeatDataSchema;
|
|
9294
|
+
},
|
|
9295
|
+
"resourceType": _enum(["ai"])
|
|
9212
9296
|
})
|
|
9213
9297
|
]);
|
|
9214
9298
|
object({
|
|
@@ -10182,5 +10266,33 @@ defineError({
|
|
|
10182
10266
|
internal: false,
|
|
10183
10267
|
httpStatusCode: 400
|
|
10184
10268
|
});
|
|
10269
|
+
/**
|
|
10270
|
+
* Error thrown when a binding's projected configuration is invalid.
|
|
10271
|
+
*/
|
|
10272
|
+
const InvalidBindingConfigError = defineError({
|
|
10273
|
+
code: "INVALID_BINDING_CONFIG",
|
|
10274
|
+
context: object({
|
|
10275
|
+
message: string(),
|
|
10276
|
+
suggestion: string().optional()
|
|
10277
|
+
}),
|
|
10278
|
+
message: ({ message, suggestion }) => suggestion ? `${message}. ${suggestion}` : message,
|
|
10279
|
+
retryable: false,
|
|
10280
|
+
internal: false,
|
|
10281
|
+
httpStatusCode: 400
|
|
10282
|
+
});
|
|
10283
|
+
/**
|
|
10284
|
+
* Error thrown when a binding is not found.
|
|
10285
|
+
*/
|
|
10286
|
+
const BindingNotFoundError = defineError({
|
|
10287
|
+
code: "BINDING_NOT_FOUND",
|
|
10288
|
+
context: object({
|
|
10289
|
+
bindingName: string(),
|
|
10290
|
+
bindingType: string()
|
|
10291
|
+
}),
|
|
10292
|
+
message: ({ bindingName, bindingType }) => `${bindingType} binding '${bindingName}' not found`,
|
|
10293
|
+
retryable: false,
|
|
10294
|
+
internal: false,
|
|
10295
|
+
httpStatusCode: 404
|
|
10296
|
+
});
|
|
10185
10297
|
//#endregion
|
|
10186
|
-
export {
|
|
10298
|
+
export { logSystemWarn as _, object as a, getCommands as c, onQueueMessage as d, onStorageEvent as f, logSystemError as g, waitUntil as h, defineError as i, getEventHandlers as l, setOnTaskRegistered as m, BindingNotFoundError as n, string as o, runCommand as p, InvalidBindingConfigError as r, command as s, AlienError as t, onCronEvent as u };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* It provides the Worker handler APIs (`command`, `onStorageEvent`,
|
|
5
5
|
* `onCronEvent`, `onQueueMessage`, `waitUntil`) and re-exports the app-facing
|
|
6
|
-
* binding factories (`storage`, `kv`, `queue`, `vault`) from
|
|
6
|
+
* binding factories (`storage`, `kv`, `queue`, `vault`, `container`, `postgres`) from
|
|
7
7
|
* `@alienplatform/bindings`, so a Worker author installs one package.
|
|
8
8
|
*
|
|
9
9
|
* Worker protocol dependencies (nice-grpc, generated Worker protocol clients)
|
|
@@ -27,8 +27,11 @@
|
|
|
27
27
|
*/
|
|
28
28
|
export { command, onStorageEvent, onCronEvent, onQueueMessage, waitUntil, } from "./worker-runtime/registry.js";
|
|
29
29
|
export type { StorageEvent, StorageEventType, CronEvent, QueueMessage, QueueMessageEvent, ScheduledEvent, StandardSchema, StandardSchemaOutput, WorkerCommandContext, } from "./worker-runtime/registry.js";
|
|
30
|
-
export { storage, kv, queue, vault, container } from "@alienplatform/bindings";
|
|
31
|
-
export type { Storage, Kv, Queue, Vault, Container } from "@alienplatform/bindings";
|
|
30
|
+
export { storage, kv, queue, vault, container, postgres } from "@alienplatform/bindings";
|
|
31
|
+
export type { Storage, Kv, Queue, Vault, Container, Postgres, PostgresConnection, PostgresSslMode, } from "@alienplatform/bindings";
|
|
32
|
+
export { ai, getAiConnection, startAiGateway, Ai, isExternalAiBinding, parseAiBinding, } from "@alienplatform/ai-gateway";
|
|
33
|
+
export type { AiBinding, AmbientAiBinding, ExternalAiBinding, AiConnection, AiModel, ChatCompletionCreateParams, ResponseCreateParams, } from "@alienplatform/ai-gateway";
|
|
32
34
|
export { BindingNotConfiguredError } from "@alienplatform/bindings";
|
|
33
|
-
export {
|
|
35
|
+
export { AiTransportError, AiUpstreamError } from "@alienplatform/ai-gateway";
|
|
36
|
+
export { AlienError, BindingNotFoundError, InvalidBindingConfigError } from "@alienplatform/core";
|
|
34
37
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAOH,OAAO,EACL,OAAO,EACP,cAAc,EACd,WAAW,EACX,cAAc,EACd,SAAS,GACV,MAAM,8BAA8B,CAAA;AAErC,YAAY,EACV,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,8BAA8B,CAAA;AAMrC,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAOH,OAAO,EACL,OAAO,EACP,cAAc,EACd,WAAW,EACX,cAAc,EACd,SAAS,GACV,MAAM,8BAA8B,CAAA;AAErC,YAAY,EACV,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,8BAA8B,CAAA;AAMrC,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AACxF,YAAY,EACV,OAAO,EACP,EAAE,EACF,KAAK,EACL,KAAK,EACL,SAAS,EACT,QAAQ,EACR,kBAAkB,EAClB,eAAe,GAChB,MAAM,yBAAyB,CAAA;AAMhC,OAAO,EACL,EAAE,EACF,eAAe,EACf,cAAc,EACd,EAAE,EACF,mBAAmB,EACnB,cAAc,GACf,MAAM,2BAA2B,CAAA;AAClC,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,OAAO,EACP,0BAA0B,EAC1B,oBAAoB,GACrB,MAAM,2BAA2B,CAAA;AAMlC,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AACnE,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC7E,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { BindingNotConfiguredError, container, kv, queue, storage, vault } from "@alienplatform/bindings";
|
|
3
|
-
|
|
1
|
+
import { d as onQueueMessage, f as onStorageEvent, h as waitUntil, n as BindingNotFoundError, r as InvalidBindingConfigError, s as command, t as AlienError, u as onCronEvent } from "./dist.js";
|
|
2
|
+
import { BindingNotConfiguredError, container, kv, postgres, queue, storage, vault } from "@alienplatform/bindings";
|
|
3
|
+
import { Ai, AiTransportError, AiUpstreamError, ai, getAiConnection, isExternalAiBinding, parseAiBinding, startAiGateway } from "@alienplatform/ai-gateway";
|
|
4
|
+
export { Ai, AiTransportError, AiUpstreamError, AlienError, BindingNotConfiguredError, BindingNotFoundError, InvalidBindingConfigError, ai, command, container, getAiConnection, isExternalAiBinding, kv, onCronEvent, onQueueMessage, onStorageEvent, parseAiBinding, postgres, queue, startAiGateway, storage, vault, waitUntil };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@alienplatform/sdk/native-bindings`: the embedded-bindings bridge for bundled
|
|
3
|
+
* Workers.
|
|
4
|
+
*
|
|
5
|
+
* Same one-hop trick as `./native` — a Worker can resolve the SDK but not the
|
|
6
|
+
* transitive `@alienplatform/bindings` — minus the gateway. A bundled Worker gets
|
|
7
|
+
* its launcher from the versioned base image at `./alien-ai-gateway`, so importing
|
|
8
|
+
* the gateway's `/native` here would both register a `.bin` asset path that no
|
|
9
|
+
* bundle packages and make the build fail wherever that asset was never staged.
|
|
10
|
+
*/
|
|
11
|
+
/** Register the bun-embedded bindings addon with its loader. */
|
|
12
|
+
export declare function installEmbeddedAddon(): void;
|
|
13
|
+
//# sourceMappingURL=native-bindings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native-bindings.d.ts","sourceRoot":"","sources":["../src/native-bindings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,gEAAgE;AAChE,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { installEmbeddedAddon as installEmbeddedAddon$1 } from "@alienplatform/bindings/native";
|
|
2
|
+
//#region src/native-bindings.ts
|
|
3
|
+
/**
|
|
4
|
+
* `@alienplatform/sdk/native-bindings`: the embedded-bindings bridge for bundled
|
|
5
|
+
* Workers.
|
|
6
|
+
*
|
|
7
|
+
* Same one-hop trick as `./native` — a Worker can resolve the SDK but not the
|
|
8
|
+
* transitive `@alienplatform/bindings` — minus the gateway. A bundled Worker gets
|
|
9
|
+
* its launcher from the versioned base image at `./alien-ai-gateway`, so importing
|
|
10
|
+
* the gateway's `/native` here would both register a `.bin` asset path that no
|
|
11
|
+
* bundle packages and make the build fail wherever that asset was never staged.
|
|
12
|
+
*/
|
|
13
|
+
/** Register the bun-embedded bindings addon with its loader. */
|
|
14
|
+
function installEmbeddedAddon() {
|
|
15
|
+
installEmbeddedAddon$1();
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { installEmbeddedAddon };
|
package/dist/native.d.ts
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `@alienplatform/sdk/native
|
|
2
|
+
* `@alienplatform/sdk/native`: the embedded-native bridge for compiled Workers.
|
|
3
3
|
*
|
|
4
|
-
* A Worker depends only on `@alienplatform/sdk`; `@alienplatform/bindings`
|
|
5
|
-
* transitive
|
|
6
|
-
* `node_modules` cannot resolve
|
|
7
|
-
* it can resolve the SDK, and the SDK can resolve
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* package it can't see.
|
|
4
|
+
* A Worker depends only on `@alienplatform/sdk`; `@alienplatform/bindings` and
|
|
5
|
+
* `@alienplatform/ai-gateway` are transitive dependencies reached *through* the
|
|
6
|
+
* SDK, so a Worker's own `node_modules` cannot resolve their `/native` subpaths
|
|
7
|
+
* directly. But it can resolve the SDK, and the SDK can resolve both (each is a
|
|
8
|
+
* direct dependency). This subpath is that one hop: it installs both bun-embedded
|
|
9
|
+
* pieces so a compiled Worker bootstrap can register them without naming packages
|
|
10
|
+
* it can't see.
|
|
12
11
|
*
|
|
13
|
-
* `bun build --compile` follows
|
|
14
|
-
* (`@alienplatform/sdk/native` → `@alienplatform/bindings/native`
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
12
|
+
* `bun build --compile` follows the static re-export chains
|
|
13
|
+
* (`@alienplatform/sdk/native` → `@alienplatform/{bindings,ai-gateway}/native`)
|
|
14
|
+
* and embeds each package's native asset: the `alien-bindings.node` addon
|
|
15
|
+
* (bindings runs in-process) and the `alien-ai-gateway` executable (the gateway
|
|
16
|
+
* runs as a spawned process). The SDK keeps both packages external (see
|
|
17
|
+
* tsdown.config.ts), so the registrations here are visible to the SDK's
|
|
18
|
+
* re-exported `kv`/`storage`/`queue`/`vault` and `ai`/`getAiConnection` factories.
|
|
20
19
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* `@alienplatform/bindings/native` only runs where that addon has been staged.
|
|
20
|
+
* Imported only by a generated compiled entry (never in dev), so the transitive
|
|
21
|
+
* static asset imports inside each `/native` only run where the asset was staged.
|
|
24
22
|
*/
|
|
25
|
-
|
|
23
|
+
/** Register the bun-embedded bindings addon and ai-gateway binary with their loaders. */
|
|
24
|
+
export declare function installEmbeddedAddon(): void;
|
|
26
25
|
//# sourceMappingURL=native.d.ts.map
|
package/dist/native.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../src/native.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../src/native.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH,yFAAyF;AACzF,wBAAgB,oBAAoB,IAAI,IAAI,CAG3C"}
|
package/dist/native.js
CHANGED
|
@@ -1,2 +1,32 @@
|
|
|
1
|
-
import { installEmbeddedAddon } from "@alienplatform/bindings/native";
|
|
1
|
+
import { installEmbeddedAddon as installEmbeddedAddon$1 } from "@alienplatform/bindings/native";
|
|
2
|
+
import { installEmbeddedGateway } from "@alienplatform/ai-gateway/native";
|
|
3
|
+
//#region src/native.ts
|
|
4
|
+
/**
|
|
5
|
+
* `@alienplatform/sdk/native`: the embedded-native bridge for compiled Workers.
|
|
6
|
+
*
|
|
7
|
+
* A Worker depends only on `@alienplatform/sdk`; `@alienplatform/bindings` and
|
|
8
|
+
* `@alienplatform/ai-gateway` are transitive dependencies reached *through* the
|
|
9
|
+
* SDK, so a Worker's own `node_modules` cannot resolve their `/native` subpaths
|
|
10
|
+
* directly. But it can resolve the SDK, and the SDK can resolve both (each is a
|
|
11
|
+
* direct dependency). This subpath is that one hop: it installs both bun-embedded
|
|
12
|
+
* pieces so a compiled Worker bootstrap can register them without naming packages
|
|
13
|
+
* it can't see.
|
|
14
|
+
*
|
|
15
|
+
* `bun build --compile` follows the static re-export chains
|
|
16
|
+
* (`@alienplatform/sdk/native` → `@alienplatform/{bindings,ai-gateway}/native`)
|
|
17
|
+
* and embeds each package's native asset: the `alien-bindings.node` addon
|
|
18
|
+
* (bindings runs in-process) and the `alien-ai-gateway` executable (the gateway
|
|
19
|
+
* runs as a spawned process). The SDK keeps both packages external (see
|
|
20
|
+
* tsdown.config.ts), so the registrations here are visible to the SDK's
|
|
21
|
+
* re-exported `kv`/`storage`/`queue`/`vault` and `ai`/`getAiConnection` factories.
|
|
22
|
+
*
|
|
23
|
+
* Imported only by a generated compiled entry (never in dev), so the transitive
|
|
24
|
+
* static asset imports inside each `/native` only run where the asset was staged.
|
|
25
|
+
*/
|
|
26
|
+
/** Register the bun-embedded bindings addon and ai-gateway binary with their loaders. */
|
|
27
|
+
function installEmbeddedAddon() {
|
|
28
|
+
installEmbeddedAddon$1();
|
|
29
|
+
installEmbeddedGateway();
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
2
32
|
export { installEmbeddedAddon };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _ as logSystemWarn, a as object, c as getCommands, g as logSystemError, i as defineError, l as getEventHandlers, m as setOnTaskRegistered, o as string, p as runCommand, t as AlienError } from "../dist.js";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { formatWithOptions } from "node:util";
|
|
4
4
|
//#region \0rolldown/runtime.js
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alienplatform/sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -17,6 +17,10 @@
|
|
|
17
17
|
"./native": {
|
|
18
18
|
"types": "./dist/native.d.ts",
|
|
19
19
|
"import": "./dist/native.js"
|
|
20
|
+
},
|
|
21
|
+
"./native-bindings": {
|
|
22
|
+
"types": "./dist/native-bindings.d.ts",
|
|
23
|
+
"import": "./dist/native-bindings.js"
|
|
20
24
|
}
|
|
21
25
|
},
|
|
22
26
|
"sideEffects": false,
|
|
@@ -53,8 +57,9 @@
|
|
|
53
57
|
"nice-grpc": "^2.1.11",
|
|
54
58
|
"nice-grpc-common": "^2.0.2",
|
|
55
59
|
"zod": "4.3.2",
|
|
56
|
-
"@alienplatform/
|
|
57
|
-
"@alienplatform/
|
|
60
|
+
"@alienplatform/ai-gateway": "^3.3.0",
|
|
61
|
+
"@alienplatform/bindings": "^3.3.0",
|
|
62
|
+
"@alienplatform/core": "^3.3.0"
|
|
58
63
|
},
|
|
59
64
|
"scripts": {
|
|
60
65
|
"build": "tsdown && tsc --emitDeclarationOnly",
|