@withgateway/sdk 0.2.2 → 0.2.3
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/cli.js +129 -22
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +130 -23
- package/dist/cli.mjs.map +1 -1
- package/dist/files/index.js +9 -5
- package/dist/files/index.js.map +1 -1
- package/dist/files/index.mjs +9 -5
- package/dist/files/index.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +14 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -8
- package/dist/index.mjs.map +1 -1
- package/dist/traces/index.js +9 -5
- package/dist/traces/index.js.map +1 -1
- package/dist/traces/index.mjs +9 -5
- package/dist/traces/index.mjs.map +1 -1
- package/dist/tracing/index.js +1 -1
- package/dist/tracing/index.js.map +1 -1
- package/dist/tracing/index.mjs +1 -1
- package/dist/tracing/index.mjs.map +1 -1
- package/dist/worlds/index.d.mts +7 -1
- package/dist/worlds/index.d.ts +7 -1
- package/dist/worlds/index.js +12 -7
- package/dist/worlds/index.js.map +1 -1
- package/dist/worlds/index.mjs +12 -7
- package/dist/worlds/index.mjs.map +1 -1
- package/package.json +1 -1
- package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/SKILL.md +5 -5
- package/skills/worlds-getting-started/SKILL.md +5 -5
package/dist/worlds/index.d.mts
CHANGED
|
@@ -1746,6 +1746,12 @@ type DispatchedRun = {
|
|
|
1746
1746
|
ok: boolean;
|
|
1747
1747
|
error?: string;
|
|
1748
1748
|
};
|
|
1749
|
+
/** A platform answer outside 2xx, its status kept so a caller can act on one
|
|
1750
|
+
* code (a 409 on a name already taken) instead of parsing the message. */
|
|
1751
|
+
declare class ApiError extends Error {
|
|
1752
|
+
readonly status: number;
|
|
1753
|
+
constructor(status: number, method: string, path: string, body: string);
|
|
1754
|
+
}
|
|
1749
1755
|
/** Authenticated JSON request against the platform API — the primitive the
|
|
1750
1756
|
* worlds helpers and the TS CLI share. */
|
|
1751
1757
|
declare function apiRequest<T>(options: WorldsClientOptions, method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", path: string, body?: unknown): Promise<T>;
|
|
@@ -1904,4 +1910,4 @@ declare class WorldSet {
|
|
|
1904
1910
|
*/
|
|
1905
1911
|
declare function openWorld(slugRef: string, options?: WorldsClientOptions): Promise<WorldSet>;
|
|
1906
1912
|
|
|
1907
|
-
export { type BrowserActionEvent, BrowserActionRecorder, type BrowserMode, type BrowserPage, COMPUTER_USE_SPECS, DEFAULT_BRANCH, DEFAULT_VIEWPORT, type DispatchedRun, EVENT_BATCH_SIZE, EVENT_FLUSH_INTERVAL_MS, EVENT_MAX_RETRIES, type GradeResult, type IngestExplode, type IngestFieldSpec, type IngestMapping, type IngestMode, type IngestOptions, type IngestRefusal, type IngestReport, type IngestSource, type IngestSourceReport, type IngestToolCallsOptions, type IngestToolCallsReport, type LocalMeta, type MigrateWorldOptions, type ObservationConversion, type ObservationLike, type OpenSessionOptions, type ParsedToolCall, type Plaintext, type PlaywrightBrowserLike, type PlaywrightLike, type RedactMode, type RedactPolicy, type Redaction, type ResolvedWorldVersion, type RunConfigInput, type RunConfigSummary, type RunProvenance, type RunReport, STRIP_PREFIX, SURFACE_KINDS, type SeedResult, type SessionRunReport, type SessionRunResult, type SessionSurfaces, TRANSFORMS, type ToolCallRecord, type ToolCallSink, type ToolFunctions, type Transform, type ValidateReport, type ValidatedRun, WHITESPACE, WorldBrowser, type WorldDependency, type WorldDeprecation, type WorldDescription, type WorldEntity, type WorldEntityMapping, type WorldField, type WorldMigrationRefusal, type WorldMigrationReport, type WorldQueryAcrossOptions, type WorldQueryAcrossResult, type WorldQueryCompare, type WorldQueryCompareStatus, type WorldQueryGroup, type WorldQueryOptions, type WorldQueryResult, type WorldQuerySnapshot, type WorldQueryWhere, type WorldRelationship, WorldSession, type WorldSessionCall, WorldSessionCallError, type WorldSessionState, type WorldSessionTask, WorldSessionTimeout, WorldSet, type WorldSurfaceKind, WorldSurfaceUnavailable, WorldTask, type WorldTaskCheck, type WorldTaskDetail, type WorldTaskFieldOp, type WorldTaskGrader, type WorldTaskIdRef, type WorldTaskInfo, type WorldTaskPage, type WorldTaskRef, type WorldTaskRubricCriterion, type WorldTaskRubricGrader, type WorldTaskScalar, type WorldTaskSeed, type WorldTaskSpec, type WorldTaskSummary, type WorldTaskValidation, type WorldTaskVersionSummary, type WorldToolSpec, type WorldToolkit, type WorldsClientOptions, apiRequest, applyTransforms, attachSession, buildSourceTarball, captureToolCalls, collectArchiveRelPaths, computeContentHash, computerUseToolkit, createRef, createTask, deleteEnvSecret, deleteTask, describeWorld, detectProvenance, getRun, getTask, hashForm, ingest, ingestToolCalls, isIncludedInContentHash, isTaskIdRef, isTaskSpec, listEnvSecretKeys, listRunConfigs, listTasks, localTreeState, migrateProjectWorlds, migrateWorld, openBrowser, openSession, openWorld, parseToolCallRecord, parseTransform, parseWorldTaskRefs, preserveForm, propose, pull, push, pyText, queryRows, queryRowsSearch, readLocalMeta, readToolCallRecords, redactActionArgs, redactionOf, resolveBrowserMode, roundForm, runSessions, schemaFromSignature, sessionToolObservations, setEnvSecret, shapeText, snapshotTreeHashes, storedForms, surfaceKinds, taskLabel, toolCallRecordsIn, toolCallsFromObservations, uiEntryUrl, uiUrl, updateTask, upsertRunConfig, validateTask, validateWorld, waitForRun, withoutUiToken, writeLocalMeta };
|
|
1913
|
+
export { ApiError, type BrowserActionEvent, BrowserActionRecorder, type BrowserMode, type BrowserPage, COMPUTER_USE_SPECS, DEFAULT_BRANCH, DEFAULT_VIEWPORT, type DispatchedRun, EVENT_BATCH_SIZE, EVENT_FLUSH_INTERVAL_MS, EVENT_MAX_RETRIES, type GradeResult, type IngestExplode, type IngestFieldSpec, type IngestMapping, type IngestMode, type IngestOptions, type IngestRefusal, type IngestReport, type IngestSource, type IngestSourceReport, type IngestToolCallsOptions, type IngestToolCallsReport, type LocalMeta, type MigrateWorldOptions, type ObservationConversion, type ObservationLike, type OpenSessionOptions, type ParsedToolCall, type Plaintext, type PlaywrightBrowserLike, type PlaywrightLike, type RedactMode, type RedactPolicy, type Redaction, type ResolvedWorldVersion, type RunConfigInput, type RunConfigSummary, type RunProvenance, type RunReport, STRIP_PREFIX, SURFACE_KINDS, type SeedResult, type SessionRunReport, type SessionRunResult, type SessionSurfaces, TRANSFORMS, type ToolCallRecord, type ToolCallSink, type ToolFunctions, type Transform, type ValidateReport, type ValidatedRun, WHITESPACE, WorldBrowser, type WorldDependency, type WorldDeprecation, type WorldDescription, type WorldEntity, type WorldEntityMapping, type WorldField, type WorldMigrationRefusal, type WorldMigrationReport, type WorldQueryAcrossOptions, type WorldQueryAcrossResult, type WorldQueryCompare, type WorldQueryCompareStatus, type WorldQueryGroup, type WorldQueryOptions, type WorldQueryResult, type WorldQuerySnapshot, type WorldQueryWhere, type WorldRelationship, WorldSession, type WorldSessionCall, WorldSessionCallError, type WorldSessionState, type WorldSessionTask, WorldSessionTimeout, WorldSet, type WorldSurfaceKind, WorldSurfaceUnavailable, WorldTask, type WorldTaskCheck, type WorldTaskDetail, type WorldTaskFieldOp, type WorldTaskGrader, type WorldTaskIdRef, type WorldTaskInfo, type WorldTaskPage, type WorldTaskRef, type WorldTaskRubricCriterion, type WorldTaskRubricGrader, type WorldTaskScalar, type WorldTaskSeed, type WorldTaskSpec, type WorldTaskSummary, type WorldTaskValidation, type WorldTaskVersionSummary, type WorldToolSpec, type WorldToolkit, type WorldsClientOptions, apiRequest, applyTransforms, attachSession, buildSourceTarball, captureToolCalls, collectArchiveRelPaths, computeContentHash, computerUseToolkit, createRef, createTask, deleteEnvSecret, deleteTask, describeWorld, detectProvenance, getRun, getTask, hashForm, ingest, ingestToolCalls, isIncludedInContentHash, isTaskIdRef, isTaskSpec, listEnvSecretKeys, listRunConfigs, listTasks, localTreeState, migrateProjectWorlds, migrateWorld, openBrowser, openSession, openWorld, parseToolCallRecord, parseTransform, parseWorldTaskRefs, preserveForm, propose, pull, push, pyText, queryRows, queryRowsSearch, readLocalMeta, readToolCallRecords, redactActionArgs, redactionOf, resolveBrowserMode, roundForm, runSessions, schemaFromSignature, sessionToolObservations, setEnvSecret, shapeText, snapshotTreeHashes, storedForms, surfaceKinds, taskLabel, toolCallRecordsIn, toolCallsFromObservations, uiEntryUrl, uiUrl, updateTask, upsertRunConfig, validateTask, validateWorld, waitForRun, withoutUiToken, writeLocalMeta };
|
package/dist/worlds/index.d.ts
CHANGED
|
@@ -1746,6 +1746,12 @@ type DispatchedRun = {
|
|
|
1746
1746
|
ok: boolean;
|
|
1747
1747
|
error?: string;
|
|
1748
1748
|
};
|
|
1749
|
+
/** A platform answer outside 2xx, its status kept so a caller can act on one
|
|
1750
|
+
* code (a 409 on a name already taken) instead of parsing the message. */
|
|
1751
|
+
declare class ApiError extends Error {
|
|
1752
|
+
readonly status: number;
|
|
1753
|
+
constructor(status: number, method: string, path: string, body: string);
|
|
1754
|
+
}
|
|
1749
1755
|
/** Authenticated JSON request against the platform API — the primitive the
|
|
1750
1756
|
* worlds helpers and the TS CLI share. */
|
|
1751
1757
|
declare function apiRequest<T>(options: WorldsClientOptions, method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", path: string, body?: unknown): Promise<T>;
|
|
@@ -1904,4 +1910,4 @@ declare class WorldSet {
|
|
|
1904
1910
|
*/
|
|
1905
1911
|
declare function openWorld(slugRef: string, options?: WorldsClientOptions): Promise<WorldSet>;
|
|
1906
1912
|
|
|
1907
|
-
export { type BrowserActionEvent, BrowserActionRecorder, type BrowserMode, type BrowserPage, COMPUTER_USE_SPECS, DEFAULT_BRANCH, DEFAULT_VIEWPORT, type DispatchedRun, EVENT_BATCH_SIZE, EVENT_FLUSH_INTERVAL_MS, EVENT_MAX_RETRIES, type GradeResult, type IngestExplode, type IngestFieldSpec, type IngestMapping, type IngestMode, type IngestOptions, type IngestRefusal, type IngestReport, type IngestSource, type IngestSourceReport, type IngestToolCallsOptions, type IngestToolCallsReport, type LocalMeta, type MigrateWorldOptions, type ObservationConversion, type ObservationLike, type OpenSessionOptions, type ParsedToolCall, type Plaintext, type PlaywrightBrowserLike, type PlaywrightLike, type RedactMode, type RedactPolicy, type Redaction, type ResolvedWorldVersion, type RunConfigInput, type RunConfigSummary, type RunProvenance, type RunReport, STRIP_PREFIX, SURFACE_KINDS, type SeedResult, type SessionRunReport, type SessionRunResult, type SessionSurfaces, TRANSFORMS, type ToolCallRecord, type ToolCallSink, type ToolFunctions, type Transform, type ValidateReport, type ValidatedRun, WHITESPACE, WorldBrowser, type WorldDependency, type WorldDeprecation, type WorldDescription, type WorldEntity, type WorldEntityMapping, type WorldField, type WorldMigrationRefusal, type WorldMigrationReport, type WorldQueryAcrossOptions, type WorldQueryAcrossResult, type WorldQueryCompare, type WorldQueryCompareStatus, type WorldQueryGroup, type WorldQueryOptions, type WorldQueryResult, type WorldQuerySnapshot, type WorldQueryWhere, type WorldRelationship, WorldSession, type WorldSessionCall, WorldSessionCallError, type WorldSessionState, type WorldSessionTask, WorldSessionTimeout, WorldSet, type WorldSurfaceKind, WorldSurfaceUnavailable, WorldTask, type WorldTaskCheck, type WorldTaskDetail, type WorldTaskFieldOp, type WorldTaskGrader, type WorldTaskIdRef, type WorldTaskInfo, type WorldTaskPage, type WorldTaskRef, type WorldTaskRubricCriterion, type WorldTaskRubricGrader, type WorldTaskScalar, type WorldTaskSeed, type WorldTaskSpec, type WorldTaskSummary, type WorldTaskValidation, type WorldTaskVersionSummary, type WorldToolSpec, type WorldToolkit, type WorldsClientOptions, apiRequest, applyTransforms, attachSession, buildSourceTarball, captureToolCalls, collectArchiveRelPaths, computeContentHash, computerUseToolkit, createRef, createTask, deleteEnvSecret, deleteTask, describeWorld, detectProvenance, getRun, getTask, hashForm, ingest, ingestToolCalls, isIncludedInContentHash, isTaskIdRef, isTaskSpec, listEnvSecretKeys, listRunConfigs, listTasks, localTreeState, migrateProjectWorlds, migrateWorld, openBrowser, openSession, openWorld, parseToolCallRecord, parseTransform, parseWorldTaskRefs, preserveForm, propose, pull, push, pyText, queryRows, queryRowsSearch, readLocalMeta, readToolCallRecords, redactActionArgs, redactionOf, resolveBrowserMode, roundForm, runSessions, schemaFromSignature, sessionToolObservations, setEnvSecret, shapeText, snapshotTreeHashes, storedForms, surfaceKinds, taskLabel, toolCallRecordsIn, toolCallsFromObservations, uiEntryUrl, uiUrl, updateTask, upsertRunConfig, validateTask, validateWorld, waitForRun, withoutUiToken, writeLocalMeta };
|
|
1913
|
+
export { ApiError, type BrowserActionEvent, BrowserActionRecorder, type BrowserMode, type BrowserPage, COMPUTER_USE_SPECS, DEFAULT_BRANCH, DEFAULT_VIEWPORT, type DispatchedRun, EVENT_BATCH_SIZE, EVENT_FLUSH_INTERVAL_MS, EVENT_MAX_RETRIES, type GradeResult, type IngestExplode, type IngestFieldSpec, type IngestMapping, type IngestMode, type IngestOptions, type IngestRefusal, type IngestReport, type IngestSource, type IngestSourceReport, type IngestToolCallsOptions, type IngestToolCallsReport, type LocalMeta, type MigrateWorldOptions, type ObservationConversion, type ObservationLike, type OpenSessionOptions, type ParsedToolCall, type Plaintext, type PlaywrightBrowserLike, type PlaywrightLike, type RedactMode, type RedactPolicy, type Redaction, type ResolvedWorldVersion, type RunConfigInput, type RunConfigSummary, type RunProvenance, type RunReport, STRIP_PREFIX, SURFACE_KINDS, type SeedResult, type SessionRunReport, type SessionRunResult, type SessionSurfaces, TRANSFORMS, type ToolCallRecord, type ToolCallSink, type ToolFunctions, type Transform, type ValidateReport, type ValidatedRun, WHITESPACE, WorldBrowser, type WorldDependency, type WorldDeprecation, type WorldDescription, type WorldEntity, type WorldEntityMapping, type WorldField, type WorldMigrationRefusal, type WorldMigrationReport, type WorldQueryAcrossOptions, type WorldQueryAcrossResult, type WorldQueryCompare, type WorldQueryCompareStatus, type WorldQueryGroup, type WorldQueryOptions, type WorldQueryResult, type WorldQuerySnapshot, type WorldQueryWhere, type WorldRelationship, WorldSession, type WorldSessionCall, WorldSessionCallError, type WorldSessionState, type WorldSessionTask, WorldSessionTimeout, WorldSet, type WorldSurfaceKind, WorldSurfaceUnavailable, WorldTask, type WorldTaskCheck, type WorldTaskDetail, type WorldTaskFieldOp, type WorldTaskGrader, type WorldTaskIdRef, type WorldTaskInfo, type WorldTaskPage, type WorldTaskRef, type WorldTaskRubricCriterion, type WorldTaskRubricGrader, type WorldTaskScalar, type WorldTaskSeed, type WorldTaskSpec, type WorldTaskSummary, type WorldTaskValidation, type WorldTaskVersionSummary, type WorldToolSpec, type WorldToolkit, type WorldsClientOptions, apiRequest, applyTransforms, attachSession, buildSourceTarball, captureToolCalls, collectArchiveRelPaths, computeContentHash, computerUseToolkit, createRef, createTask, deleteEnvSecret, deleteTask, describeWorld, detectProvenance, getRun, getTask, hashForm, ingest, ingestToolCalls, isIncludedInContentHash, isTaskIdRef, isTaskSpec, listEnvSecretKeys, listRunConfigs, listTasks, localTreeState, migrateProjectWorlds, migrateWorld, openBrowser, openSession, openWorld, parseToolCallRecord, parseTransform, parseWorldTaskRefs, preserveForm, propose, pull, push, pyText, queryRows, queryRowsSearch, readLocalMeta, readToolCallRecords, redactActionArgs, redactionOf, resolveBrowserMode, roundForm, runSessions, schemaFromSignature, sessionToolObservations, setEnvSecret, shapeText, snapshotTreeHashes, storedForms, surfaceKinds, taskLabel, toolCallRecordsIn, toolCallsFromObservations, uiEntryUrl, uiUrl, updateTask, upsertRunConfig, validateTask, validateWorld, waitForRun, withoutUiToken, writeLocalMeta };
|
package/dist/worlds/index.js
CHANGED
|
@@ -1351,7 +1351,7 @@ async function push(dir, opts = {}) {
|
|
|
1351
1351
|
const pyproject = readPyproject(dir);
|
|
1352
1352
|
const contractVersion = pyproject.version ? void 0 : readWorldContractVersion(dir).version;
|
|
1353
1353
|
if (contractVersion) pyproject.version = contractVersion;
|
|
1354
|
-
const slug = opts.slug ?? pyproject.name ?? path.basename(path.resolve(dir));
|
|
1354
|
+
const slug = opts.slug ?? localMeta.slug ?? pyproject.name ?? path.basename(path.resolve(dir));
|
|
1355
1355
|
const resolve6 = await apiRequest(
|
|
1356
1356
|
options,
|
|
1357
1357
|
"POST",
|
|
@@ -3485,6 +3485,7 @@ var init_ingest = __esm({
|
|
|
3485
3485
|
// src/worlds/index.ts
|
|
3486
3486
|
var worlds_exports = {};
|
|
3487
3487
|
__export(worlds_exports, {
|
|
3488
|
+
ApiError: () => ApiError2,
|
|
3488
3489
|
BrowserActionRecorder: () => BrowserActionRecorder,
|
|
3489
3490
|
COMPUTER_USE_SPECS: () => COMPUTER_USE_SPECS,
|
|
3490
3491
|
DEFAULT_BRANCH: () => DEFAULT_BRANCH,
|
|
@@ -3594,11 +3595,7 @@ async function apiRequest(options, method, path8, body) {
|
|
|
3594
3595
|
...body === void 0 ? {} : { body: JSON.stringify(body) }
|
|
3595
3596
|
});
|
|
3596
3597
|
const text2 = await res.text();
|
|
3597
|
-
if (!res.ok)
|
|
3598
|
-
throw new Error(
|
|
3599
|
-
`${method} ${path8} -> ${res.status}: ${text2.slice(0, 400)}`
|
|
3600
|
-
);
|
|
3601
|
-
}
|
|
3598
|
+
if (!res.ok) throw new ApiError2(res.status, method, path8, text2.slice(0, 400));
|
|
3602
3599
|
return JSON.parse(text2);
|
|
3603
3600
|
}
|
|
3604
3601
|
async function setEnvSecret(slug, key, value, options = {}) {
|
|
@@ -3750,7 +3747,7 @@ async function openWorld(slugRef, options = {}) {
|
|
|
3750
3747
|
}
|
|
3751
3748
|
return world;
|
|
3752
3749
|
}
|
|
3753
|
-
var WorldTask, WorldSet;
|
|
3750
|
+
var ApiError2, WorldTask, WorldSet;
|
|
3754
3751
|
var init_worlds = __esm({
|
|
3755
3752
|
"src/worlds/index.ts"() {
|
|
3756
3753
|
init_session();
|
|
@@ -3764,6 +3761,13 @@ var init_worlds = __esm({
|
|
|
3764
3761
|
init_query();
|
|
3765
3762
|
init_migrate();
|
|
3766
3763
|
init_ingest();
|
|
3764
|
+
ApiError2 = class extends Error {
|
|
3765
|
+
constructor(status, method, path8, body) {
|
|
3766
|
+
super(`${method} ${path8} -> ${status}: ${body}`);
|
|
3767
|
+
this.status = status;
|
|
3768
|
+
this.name = "ApiError";
|
|
3769
|
+
}
|
|
3770
|
+
};
|
|
3767
3771
|
WorldTask = class {
|
|
3768
3772
|
constructor(world, name, variant) {
|
|
3769
3773
|
this.world = world;
|
|
@@ -3831,6 +3835,7 @@ var init_worlds = __esm({
|
|
|
3831
3835
|
init_worlds();
|
|
3832
3836
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3833
3837
|
0 && (module.exports = {
|
|
3838
|
+
ApiError,
|
|
3834
3839
|
BrowserActionRecorder,
|
|
3835
3840
|
COMPUTER_USE_SPECS,
|
|
3836
3841
|
DEFAULT_BRANCH,
|