@withgateway/sdk 0.2.1 → 0.2.2
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 +309 -59
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +309 -59
- package/dist/cli.mjs.map +1 -1
- package/dist/index.js +8 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -3
- package/dist/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.js +7 -2
- package/dist/worlds/index.js.map +1 -1
- package/dist/worlds/index.mjs +7 -2
- package/dist/worlds/index.mjs.map +1 -1
- package/package.json +1 -1
- package/runtime/gatewaysdk/environment/schema/api.py +61 -3
- package/runtime/gatewaysdk/environment/schema/batch.py +5 -1
- package/runtime/gatewaysdk/environment/schema/connector.py +11 -0
- package/runtime/gatewaysdk/environment/schema/data.py +76 -2
- package/runtime/gatewaysdk/environment/schema/dependencies.py +11 -1
- package/runtime/gatewaysdk/environment/schema/host.py +8 -17
- package/runtime/gatewaysdk/environment/schema/local.py +105 -19
- package/runtime/gatewaysdk/environment/schema/mapping.py +13 -1
- package/runtime/gatewaysdk/environment/schema/platform.py +32 -5
- package/runtime/gatewaysdk/environment/schema/skills/benchmarks-getting-started/SKILL.md +4 -1
- package/runtime/gatewaysdk/environment/schema/tools_world.py +5 -1
- package/runtime/gatewaysdk/environment/schema/validation.py +4 -3
- package/skills/benchmarks-getting-started/SKILL.md +4 -1
|
@@ -581,7 +581,11 @@ class ToolsWorld:
|
|
|
581
581
|
rows = args.get("rows")
|
|
582
582
|
mode = args.get("mode", "append")
|
|
583
583
|
if not isinstance(rows, dict):
|
|
584
|
-
fail(
|
|
584
|
+
fail(
|
|
585
|
+
"host",
|
|
586
|
+
'seed needs rows as {"rows": {entity: [row, ...]}, "mode": "append"|"replace"}; '
|
|
587
|
+
"a dependency's entity is named alias.entity",
|
|
588
|
+
)
|
|
585
589
|
by_world: dict[int, tuple[World, dict[str, Any], str]] = {}
|
|
586
590
|
for entity, entity_rows in rows.items():
|
|
587
591
|
world, local = self._world_of(entity)
|
|
@@ -233,8 +233,8 @@ def equal(left: Any, right: Any) -> bool:
|
|
|
233
233
|
def validate(schema: dict, value: Any, *, location: str = "", path: str = "") -> None:
|
|
234
234
|
json_value(value, path)
|
|
235
235
|
|
|
236
|
-
def error(code: str, message: str, keyword: str = "") -> NoReturn:
|
|
237
|
-
fail(code, message, f"{location}/{keyword}" if keyword else location, path=path)
|
|
236
|
+
def error(code: str, message: str, keyword: str = "", **context: Any) -> NoReturn:
|
|
237
|
+
fail(code, message, f"{location}/{keyword}" if keyword else location, path=path, **context)
|
|
238
238
|
|
|
239
239
|
expected = schema.get("type")
|
|
240
240
|
types = expected if isinstance(expected, list) else [expected] if expected else []
|
|
@@ -275,7 +275,7 @@ def validate(schema: dict, value: Any, *, location: str = "", path: str = "") ->
|
|
|
275
275
|
properties = schema.get("properties", {})
|
|
276
276
|
for name in schema.get("required", []):
|
|
277
277
|
if name not in value:
|
|
278
|
-
error("required", f"Missing required property {name}", "required")
|
|
278
|
+
error("required", f"Missing required property {name}", "required", property=name)
|
|
279
279
|
for name, item in value.items():
|
|
280
280
|
if name in properties:
|
|
281
281
|
validate(
|
|
@@ -289,6 +289,7 @@ def validate(schema: dict, value: Any, *, location: str = "", path: str = "") ->
|
|
|
289
289
|
"additionalProperties",
|
|
290
290
|
f"Unknown property {name}",
|
|
291
291
|
"additionalProperties",
|
|
292
|
+
property=name,
|
|
292
293
|
)
|
|
293
294
|
elif isinstance(schema.get("additionalProperties"), dict):
|
|
294
295
|
# A schema-valued additionalProperties types a map: every
|
|
@@ -244,12 +244,15 @@ crm-bench/
|
|
|
244
244
|
Entities, tools and routes: `worlds-getting-started` §2 and `connector-schema-authoring`. Tasks:
|
|
245
245
|
|
|
246
246
|
```bash
|
|
247
|
+
gateway worlds schema verifier add ./crm-bench ticket_closed --entity crm_tickets --where "id = 'T-7' AND status = 'closed'"
|
|
247
248
|
gateway worlds schema task add ./crm-bench close_ticket --prompt "Close ticket T-7 and note the reason." --verifier ticket_closed
|
|
248
249
|
gateway worlds schema task add ./crm-bench escalate --prompt "..." --verifier state_present --world slack=state_present
|
|
249
250
|
```
|
|
250
251
|
|
|
251
252
|
- `--prompt` is what the agent is told. `--verifier <name>` names `verifiers/<name>.sql`; it must
|
|
252
|
-
exist
|
|
253
|
+
exist — `schema verifier add <dir> <name> --entity <entity> [--where "<sql condition>"]` scaffolds
|
|
254
|
+
it (without `--where`, the `state_present` placeholder). Each verifier becomes a key in `rewards`;
|
|
255
|
+
`reward` is their mean.
|
|
253
256
|
- A verifier is one SQL statement returning one number in 0..1 over the world's tables (entity
|
|
254
257
|
names from `schema/world.json`): `SELECT CASE WHEN COUNT(*) > 0 THEN 1.0 ELSE 0.0 END FROM
|
|
255
258
|
"crm_tickets" WHERE id = 'T-7' AND status = 'closed';`
|