@voxgig/sdkgen 4.2.6 → 4.2.8

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 (64) hide show
  1. package/bin/voxgig-sdkgen +1 -1
  2. package/dist/helpers/naming.js +5 -4
  3. package/dist/helpers/naming.js.map +1 -1
  4. package/dist/tsconfig.tsbuildinfo +1 -1
  5. package/package.json +1 -1
  6. package/project/.sdk/model/feature/cost.aon +43 -0
  7. package/project/.sdk/model/feature/feature-index.aon +1 -0
  8. package/project/.sdk/src/cmp/js/fragment/EntityCreateOp.fragment.js +2 -1
  9. package/project/.sdk/src/cmp/js/fragment/EntityListOp.fragment.js +2 -1
  10. package/project/.sdk/src/cmp/js/fragment/EntityLoadOp.fragment.js +2 -1
  11. package/project/.sdk/src/cmp/js/fragment/EntityRemoveOp.fragment.js +2 -1
  12. package/project/.sdk/src/cmp/js/fragment/EntityUpdateOp.fragment.js +2 -1
  13. package/project/.sdk/src/cmp/py/ReadmeExamplesTest_py.ts +15 -5
  14. package/project/.sdk/src/cmp/ts/fragment/EntityCreateOp.fragment.ts +2 -1
  15. package/project/.sdk/src/cmp/ts/fragment/EntityListOp.fragment.ts +2 -1
  16. package/project/.sdk/src/cmp/ts/fragment/EntityLoadOp.fragment.ts +2 -1
  17. package/project/.sdk/src/cmp/ts/fragment/EntityRemoveOp.fragment.ts +2 -1
  18. package/project/.sdk/src/cmp/ts/fragment/EntityUpdateOp.fragment.ts +2 -1
  19. package/project/.sdk/tm/c/core/sdk.h +1 -0
  20. package/project/.sdk/tm/c/feature/cost.c +549 -0
  21. package/project/.sdk/tm/c/src/feature/cost/.gitkeep +0 -0
  22. package/project/.sdk/tm/clojure/src/feature/cost/.gitkeep +0 -0
  23. package/project/.sdk/tm/cpp/feature/cost.hpp +419 -0
  24. package/project/.sdk/tm/cpp/src/feature/cost/.gitkeep +0 -0
  25. package/project/.sdk/tm/csharp/feature/CostFeature.cs +518 -0
  26. package/project/.sdk/tm/csharp/src/feature/cost/.gitkeep +0 -0
  27. package/project/.sdk/tm/dart/lib/feature/cost/CostFeature.dart +446 -0
  28. package/project/.sdk/tm/dart/src/feature/cost/.gitkeep +0 -0
  29. package/project/.sdk/tm/elixir/lib/projectname/feature/cost.ex +442 -0
  30. package/project/.sdk/tm/elixir/src/feature/cost/.gitkeep +0 -0
  31. package/project/.sdk/tm/go/feature/cost_feature.go +424 -0
  32. package/project/.sdk/tm/go/src/feature/cost/.gitkeep +0 -0
  33. package/project/.sdk/tm/go-cli/src/feature/cost/.gitkeep +0 -0
  34. package/project/.sdk/tm/go-mcp/src/feature/cost/.gitkeep +0 -0
  35. package/project/.sdk/tm/java/feature/CostFeature.java +431 -0
  36. package/project/.sdk/tm/java/src/feature/cost/.gitkeep +0 -0
  37. package/project/.sdk/tm/js/src/feature/cost/CostFeature.js +413 -0
  38. package/project/.sdk/tm/kotlin/feature/CostFeature.kt +430 -0
  39. package/project/.sdk/tm/kotlin/src/feature/cost/.gitkeep +0 -0
  40. package/project/.sdk/tm/lean/src/feature/cost/.gitkeep +0 -0
  41. package/project/.sdk/tm/lua/feature/cost_feature.lua +457 -0
  42. package/project/.sdk/tm/lua/src/feature/cost/.gitkeep +0 -0
  43. package/project/.sdk/tm/ocaml/src/feature/cost/.gitkeep +0 -0
  44. package/project/.sdk/tm/perl/feature/cost_feature.pm +446 -0
  45. package/project/.sdk/tm/perl/src/feature/cost/.gitkeep +0 -0
  46. package/project/.sdk/tm/php/feature/CostFeature.php +439 -0
  47. package/project/.sdk/tm/php/feature/TestFeature.php +31 -1
  48. package/project/.sdk/tm/php/src/feature/cost/.gitkeep +0 -0
  49. package/project/.sdk/tm/py/pkg/feature/cost_feature.py +381 -0
  50. package/project/.sdk/tm/py/src/feature/cost/.gitkeep +0 -0
  51. package/project/.sdk/tm/py-data/src/feature/cost/.gitkeep +0 -0
  52. package/project/.sdk/tm/rb/feature/cost_feature.rb +386 -0
  53. package/project/.sdk/tm/rb/src/feature/cost/.gitkeep +0 -0
  54. package/project/.sdk/tm/rust/feature/cost.rs +467 -0
  55. package/project/.sdk/tm/rust/src/feature/cost/.gitkeep +0 -0
  56. package/project/.sdk/tm/scala/feature/CostFeature.scala +388 -0
  57. package/project/.sdk/tm/scala/src/feature/cost/.gitkeep +0 -0
  58. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/CostFeature.swift +425 -0
  59. package/project/.sdk/tm/swift/src/feature/cost/.gitkeep +0 -0
  60. package/project/.sdk/tm/ts/src/feature/cost/CostFeature.ts +415 -0
  61. package/project/.sdk/tm/zig/feature/cost.zig +457 -0
  62. package/project/.sdk/tm/zig/src/feature/cost/.gitkeep +0 -0
  63. package/project/sdkgen-package.json +2 -1
  64. package/src/helpers/naming.ts +5 -4
@@ -0,0 +1,43 @@
1
+
2
+ main: kit: feature: cost: {
3
+
4
+ name: key()
5
+ title: "Cost tracking and spend budget for API calls"
6
+ version: '0.0.1'
7
+ active: true
8
+ base: 'BASE'
9
+
10
+ # Both seams. The wrap prices every HTTP ATTEMPT (a retry is charged
11
+ # again, as the upstream API charges it); the hooks gate on budget before
12
+ # anything is sent, and attribute the total to the operation afterwards.
13
+ transport: 'wrap'
14
+
15
+ config: {
16
+ options: {
17
+ active: false
18
+ currency: 'USD'
19
+ # flat cost per attempt, when no rate or reported figure applies
20
+ unit: 0
21
+ # cost per attempt keyed '<entity>.<op>', '<op>', or '*'
22
+ rates: {}
23
+ # response header carrying a reported usage figure (per attempt)
24
+ header: ''
25
+ # response body path carrying a reported usage figure (per operation),
26
+ # e.g. 'usage.total_tokens'
27
+ path: ''
28
+ # price per reported unit; multiplies a header or body figure
29
+ perUnit: 0
30
+ # spend ceiling, in `currency`. 0 = no budget
31
+ budget: 0
32
+ # once the budget is spent: 'warn' records it, 'deny' refuses the call
33
+ onBudget: 'warn'
34
+ }
35
+ }
36
+
37
+ hook: {
38
+ PrePoint: active: true
39
+ PreDone: active: true
40
+ # A failed operation still spent the money, so it is committed here too.
41
+ PreUnexpected: active: true
42
+ }
43
+ }
@@ -9,6 +9,7 @@
9
9
  @"timeout.aon"
10
10
  @"ratelimit.aon"
11
11
  @"cache.aon"
12
+ @"cost.aon"
12
13
  @"idempotency.aon"
13
14
  @"paging.aon"
14
15
  @"streaming.aon"
@@ -15,7 +15,8 @@ class EntityOperation {
15
15
  const {
16
16
  makeContext,
17
17
  done,
18
- error,
18
+ // The registry name is `makeError`; `error` is the local alias.
19
+ makeError: error,
19
20
  featureHook,
20
21
  makePoint,
21
22
  makeRequest,
@@ -16,7 +16,8 @@ class EntityOperation {
16
16
  const {
17
17
  makeContext,
18
18
  done,
19
- error,
19
+ // The registry name is `makeError`; `error` is the local alias.
20
+ makeError: error,
20
21
  featureHook,
21
22
  makePoint,
22
23
  makeRequest,
@@ -16,7 +16,8 @@ class EntityOperation {
16
16
  const {
17
17
  makeContext,
18
18
  done,
19
- error,
19
+ // The registry name is `makeError`; `error` is the local alias.
20
+ makeError: error,
20
21
  featureHook,
21
22
  makePoint,
22
23
  makeRequest,
@@ -16,7 +16,8 @@ class EntityOperation {
16
16
  const {
17
17
  makeContext,
18
18
  done,
19
- error,
19
+ // The registry name is `makeError`; `error` is the local alias.
20
+ makeError: error,
20
21
  featureHook,
21
22
  makePoint,
22
23
  makeRequest,
@@ -16,7 +16,8 @@ class EntityOperation {
16
16
  const {
17
17
  makeContext,
18
18
  done,
19
- error,
19
+ // The registry name is `makeError`; `error` is the local alias.
20
+ makeError: error,
20
21
  featureHook,
21
22
  makePoint,
22
23
  makeRequest,
@@ -514,11 +514,21 @@ def _run_batch(items, label):
514
514
  env = dict(os.environ)
515
515
  env["PYTHONDONTWRITEBYTECODE"] = "1"
516
516
  env["PYTHONPATH"] = _PY_ROOT + os.pathsep + env.get("PYTHONPATH", "")
517
- proc = subprocess.run(
518
- [sys.executable, "-c", driver],
519
- cwd=_PY_ROOT, env=env, capture_output=True, text=True,
520
- )
521
- return (proc.stdout or "") + (proc.stderr or "")
517
+
518
+ # A FILE, not "python -c". The driver embeds every runnable snippet's
519
+ # source, and a large SDK documents hundreds of them: passing that on the
520
+ # command line exceeded ARG_MAX and the whole gate died with
521
+ # "OSError: [Errno 7] Argument list too long" on gitlab and github, while
522
+ # every small repo passed. The batch has no size limit through a file.
523
+ with tempfile.TemporaryDirectory() as td:
524
+ driver_path = os.path.join(td, "readme_batch_driver.py")
525
+ with open(driver_path, "w", encoding="utf-8") as fh:
526
+ fh.write(driver)
527
+ proc = subprocess.run(
528
+ [sys.executable, driver_path],
529
+ cwd=_PY_ROOT, env=env, capture_output=True, text=True,
530
+ )
531
+ return (proc.stdout or "") + (proc.stderr or "")
522
532
 
523
533
 
524
534
  def _batch_segment(text, index):
@@ -16,7 +16,8 @@ class EntityOperation {
16
16
  const {
17
17
  makeContext,
18
18
  done,
19
- error,
19
+ // The registry name is `makeError`; `error` is the local alias.
20
+ makeError: error,
20
21
  featureHook,
21
22
  makePoint,
22
23
  makeRequest,
@@ -17,7 +17,8 @@ class EntityOperation {
17
17
  const {
18
18
  makeContext,
19
19
  done,
20
- error,
20
+ // The registry name is `makeError`; `error` is the local alias.
21
+ makeError: error,
21
22
  featureHook,
22
23
  makePoint,
23
24
  makeRequest,
@@ -17,7 +17,8 @@ class EntityOperation {
17
17
  const {
18
18
  makeContext,
19
19
  done,
20
- error,
20
+ // The registry name is `makeError`; `error` is the local alias.
21
+ makeError: error,
21
22
  featureHook,
22
23
  makePoint,
23
24
  makeRequest,
@@ -27,7 +27,8 @@ class EntityOperation {
27
27
  const {
28
28
  makeContext,
29
29
  done,
30
- error,
30
+ // The registry name is `makeError`; `error` is the local alias.
31
+ makeError: error,
31
32
  featureHook,
32
33
  makePoint,
33
34
  makeRequest,
@@ -17,7 +17,8 @@ class EntityOperation {
17
17
  const {
18
18
  makeContext,
19
19
  done,
20
- error,
20
+ // The registry name is `makeError`; `error` is the local alias.
21
+ makeError: error,
21
22
  featureHook,
22
23
  makePoint,
23
24
  makeRequest,
@@ -519,6 +519,7 @@ Feature* feature_retry_new(void);
519
519
  Feature* feature_timeout_new(void);
520
520
  Feature* feature_ratelimit_new(void);
521
521
  Feature* feature_cache_new(void);
522
+ Feature* feature_cost_new(void);
522
523
  Feature* feature_idempotency_new(void);
523
524
  Feature* feature_paging_new(void);
524
525
  Feature* feature_streaming_new(void);