@stackbone/sdk 0.1.0-alpha.0 → 0.1.0-alpha.1
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/CHANGELOG.md +21 -0
- package/index.cjs +19 -11
- package/index.cjs.map +1 -1
- package/index.d.cts +9 -8
- package/index.d.ts +9 -8
- package/index.js +19 -11
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/stackbone-sdk-0.1.0-alpha.1.tgz +0 -0
- package/stackbone-sdk-0.1.0-alpha.0.tgz +0 -0
package/index.d.cts
CHANGED
|
@@ -19,10 +19,9 @@ interface ClientConfig {
|
|
|
19
19
|
agentId?: string;
|
|
20
20
|
/**
|
|
21
21
|
* Postgres connection string consumed by `client.rag` and the platform
|
|
22
|
-
* observability exporter. Falls back to `
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* `DATABASE_URL` consumers until `feature 30` consolidates them.
|
|
22
|
+
* observability exporter. Falls back to `STACKBONE_POSTGRES_URL` — the same
|
|
23
|
+
* env var `client.database` reads, so a single connection string covers
|
|
24
|
+
* every SDK consumer that talks to the agent's Postgres.
|
|
26
25
|
*/
|
|
27
26
|
databaseUrl?: string;
|
|
28
27
|
openrouterKey?: string;
|
|
@@ -46,14 +45,16 @@ interface ClientConfig {
|
|
|
46
45
|
*/
|
|
47
46
|
installationId?: string;
|
|
48
47
|
s3?: {
|
|
49
|
-
/** Falls back to `
|
|
48
|
+
/** Falls back to `STACKBONE_S3_ACCESS_KEY`. */
|
|
50
49
|
accessKeyId?: string;
|
|
51
|
-
/** Falls back to `
|
|
50
|
+
/** Falls back to `STACKBONE_S3_SECRET_KEY`. */
|
|
52
51
|
secretAccessKey?: string;
|
|
53
|
-
/** Falls back to `
|
|
52
|
+
/** Falls back to `STACKBONE_S3_ENDPOINT`. */
|
|
54
53
|
endpoint?: string;
|
|
55
|
-
/** Physical R2/S3 bucket scoped to the agent. Falls back to `
|
|
54
|
+
/** Physical R2/S3 bucket scoped to the agent. Falls back to `STACKBONE_S3_BUCKET`. */
|
|
56
55
|
bucket?: string;
|
|
56
|
+
/** AWS region. Falls back to `STACKBONE_S3_REGION`, defaults to `'auto'` (R2/MinIO). */
|
|
57
|
+
region?: string;
|
|
57
58
|
};
|
|
58
59
|
otel?: {
|
|
59
60
|
exporterOtlpEndpoint?: string;
|
package/index.d.ts
CHANGED
|
@@ -19,10 +19,9 @@ interface ClientConfig {
|
|
|
19
19
|
agentId?: string;
|
|
20
20
|
/**
|
|
21
21
|
* Postgres connection string consumed by `client.rag` and the platform
|
|
22
|
-
* observability exporter. Falls back to `
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* `DATABASE_URL` consumers until `feature 30` consolidates them.
|
|
22
|
+
* observability exporter. Falls back to `STACKBONE_POSTGRES_URL` — the same
|
|
23
|
+
* env var `client.database` reads, so a single connection string covers
|
|
24
|
+
* every SDK consumer that talks to the agent's Postgres.
|
|
26
25
|
*/
|
|
27
26
|
databaseUrl?: string;
|
|
28
27
|
openrouterKey?: string;
|
|
@@ -46,14 +45,16 @@ interface ClientConfig {
|
|
|
46
45
|
*/
|
|
47
46
|
installationId?: string;
|
|
48
47
|
s3?: {
|
|
49
|
-
/** Falls back to `
|
|
48
|
+
/** Falls back to `STACKBONE_S3_ACCESS_KEY`. */
|
|
50
49
|
accessKeyId?: string;
|
|
51
|
-
/** Falls back to `
|
|
50
|
+
/** Falls back to `STACKBONE_S3_SECRET_KEY`. */
|
|
52
51
|
secretAccessKey?: string;
|
|
53
|
-
/** Falls back to `
|
|
52
|
+
/** Falls back to `STACKBONE_S3_ENDPOINT`. */
|
|
54
53
|
endpoint?: string;
|
|
55
|
-
/** Physical R2/S3 bucket scoped to the agent. Falls back to `
|
|
54
|
+
/** Physical R2/S3 bucket scoped to the agent. Falls back to `STACKBONE_S3_BUCKET`. */
|
|
56
55
|
bucket?: string;
|
|
56
|
+
/** AWS region. Falls back to `STACKBONE_S3_REGION`, defaults to `'auto'` (R2/MinIO). */
|
|
57
|
+
region?: string;
|
|
57
58
|
};
|
|
58
59
|
otel?: {
|
|
59
60
|
exporterOtlpEndpoint?: string;
|
package/index.js
CHANGED
|
@@ -15553,6 +15553,13 @@ external_exports.object({
|
|
|
15553
15553
|
nextCursor: external_exports.string().nullable(),
|
|
15554
15554
|
prevCursor: external_exports.string().nullable()
|
|
15555
15555
|
});
|
|
15556
|
+
external_exports.object({
|
|
15557
|
+
fxtId: external_exports.uuid()
|
|
15558
|
+
});
|
|
15559
|
+
external_exports.object({
|
|
15560
|
+
input: jsonObject().nullable(),
|
|
15561
|
+
output: jsonObject().nullable()
|
|
15562
|
+
});
|
|
15556
15563
|
|
|
15557
15564
|
// ../validators/src/lib/auth/session.ts
|
|
15558
15565
|
var sessionUserSchema = external_exports.object({
|
|
@@ -18113,7 +18120,7 @@ var RunStepsSpanProcessor = class {
|
|
|
18113
18120
|
this.intervalMs = options.flushIntervalMs ?? DEFAULT_INTERVAL_MS2;
|
|
18114
18121
|
this.resolveStepType = options.resolveStepType ?? defaultStepTypeResolver;
|
|
18115
18122
|
this.newId = options.newId ?? randomUUID;
|
|
18116
|
-
this.connectionString = options.connectionString ?? process.env["
|
|
18123
|
+
this.connectionString = options.connectionString ?? process.env["STACKBONE_POSTGRES_URL"];
|
|
18117
18124
|
if (options.sql) {
|
|
18118
18125
|
this.sql = options.sql;
|
|
18119
18126
|
this.ownsSql = false;
|
|
@@ -18297,7 +18304,7 @@ var ObservabilityModule = class {
|
|
|
18297
18304
|
if (!this._processor) {
|
|
18298
18305
|
const merged = {
|
|
18299
18306
|
...options,
|
|
18300
|
-
connectionString: options.connectionString ?? this._resolved.config.databaseUrl ?? this._resolved.env["
|
|
18307
|
+
connectionString: options.connectionString ?? this._resolved.config.databaseUrl ?? this._resolved.env["STACKBONE_POSTGRES_URL"]
|
|
18301
18308
|
};
|
|
18302
18309
|
this._processor = new RunStepsSpanProcessor(merged);
|
|
18303
18310
|
}
|
|
@@ -18356,7 +18363,7 @@ var ObservabilityModule = class {
|
|
|
18356
18363
|
if (!sql) {
|
|
18357
18364
|
return err({
|
|
18358
18365
|
code: "database_url_missing",
|
|
18359
|
-
message: "Cannot reach the agent Postgres \u2014 set `
|
|
18366
|
+
message: "Cannot reach the agent Postgres \u2014 set `STACKBONE_POSTGRES_URL` in the container or pass `databaseUrl` to `createClient({...})`."
|
|
18360
18367
|
});
|
|
18361
18368
|
}
|
|
18362
18369
|
try {
|
|
@@ -18377,7 +18384,7 @@ var ObservabilityModule = class {
|
|
|
18377
18384
|
// don't pay the dep cost.
|
|
18378
18385
|
async resolveSql() {
|
|
18379
18386
|
if (this._sqlResolved) return this._sql;
|
|
18380
|
-
const connectionString = this._resolved.config.databaseUrl ?? this._resolved.env["
|
|
18387
|
+
const connectionString = this._resolved.config.databaseUrl ?? this._resolved.env["STACKBONE_POSTGRES_URL"];
|
|
18381
18388
|
if (!connectionString) {
|
|
18382
18389
|
this._sqlResolved = true;
|
|
18383
18390
|
return null;
|
|
@@ -19573,11 +19580,12 @@ var StorageModule = class {
|
|
|
19573
19580
|
return new StorageBucket(bucket, () => this.settings(), this._gate);
|
|
19574
19581
|
}
|
|
19575
19582
|
settings() {
|
|
19576
|
-
const accessKeyId = this._resolved.config.s3?.accessKeyId ?? this._resolved.env["
|
|
19577
|
-
const secretAccessKey = this._resolved.config.s3?.secretAccessKey ?? this._resolved.env["
|
|
19578
|
-
const endpoint = this._resolved.config.s3?.endpoint ?? this._resolved.env["
|
|
19579
|
-
const bucket = this._resolved.config.s3?.bucket ?? this._resolved.env["
|
|
19583
|
+
const accessKeyId = this._resolved.config.s3?.accessKeyId ?? this._resolved.env["STACKBONE_S3_ACCESS_KEY"];
|
|
19584
|
+
const secretAccessKey = this._resolved.config.s3?.secretAccessKey ?? this._resolved.env["STACKBONE_S3_SECRET_KEY"];
|
|
19585
|
+
const endpoint = this._resolved.config.s3?.endpoint ?? this._resolved.env["STACKBONE_S3_ENDPOINT"];
|
|
19586
|
+
const bucket = this._resolved.config.s3?.bucket ?? this._resolved.env["STACKBONE_S3_BUCKET"];
|
|
19580
19587
|
const agentId = this._resolved.config.agentId ?? this._resolved.env["STACKBONE_AGENT_ID"];
|
|
19588
|
+
const region = this._resolved.config.s3?.region ?? this._resolved.env["STACKBONE_S3_REGION"] ?? "auto";
|
|
19581
19589
|
if (!accessKeyId || !secretAccessKey || !endpoint) {
|
|
19582
19590
|
return err({
|
|
19583
19591
|
code: "s3_credentials_missing",
|
|
@@ -19598,7 +19606,7 @@ var StorageModule = class {
|
|
|
19598
19606
|
}
|
|
19599
19607
|
this._s3 ??= new S3Client({
|
|
19600
19608
|
endpoint,
|
|
19601
|
-
region
|
|
19609
|
+
region,
|
|
19602
19610
|
forcePathStyle: true,
|
|
19603
19611
|
credentials: {
|
|
19604
19612
|
accessKeyId,
|
|
@@ -19824,8 +19832,8 @@ var StorageBucket = class {
|
|
|
19824
19832
|
});
|
|
19825
19833
|
}
|
|
19826
19834
|
};
|
|
19827
|
-
var S3_CREDENTIALS_MISSING_MESSAGE = "Cannot reach object storage \u2014 set `
|
|
19828
|
-
var S3_BUCKET_MISSING_MESSAGE = "No storage bucket configured \u2014 set `
|
|
19835
|
+
var S3_CREDENTIALS_MISSING_MESSAGE = "Cannot reach object storage \u2014 set `STACKBONE_S3_ACCESS_KEY`, `STACKBONE_S3_SECRET_KEY`, and `STACKBONE_S3_ENDPOINT` in the container or pass `s3` to `createClient({...})`.";
|
|
19836
|
+
var S3_BUCKET_MISSING_MESSAGE = "No storage bucket configured \u2014 set `STACKBONE_S3_BUCKET` in the container or pass `s3.bucket` to `createClient({...})`.";
|
|
19829
19837
|
var AGENT_ID_MISSING_MESSAGE = "No agent identity configured \u2014 set `STACKBONE_AGENT_ID` in the container or pass `agentId` to `createClient({...})`.";
|
|
19830
19838
|
function stripEtag(etag) {
|
|
19831
19839
|
return etag?.replace(/^"|"$/g, "");
|