@sylphx/sdk 0.32.1 → 0.32.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.
Files changed (120) hide show
  1. package/README.md +105 -0
  2. package/dist/access.d.ts +16 -1
  3. package/dist/access.js +1 -1
  4. package/dist/access.js.map +1 -1
  5. package/dist/agents.d.ts +463 -25
  6. package/dist/agents.js +276 -5
  7. package/dist/agents.js.map +1 -1
  8. package/dist/ai.js +1 -1
  9. package/dist/ai.js.map +1 -1
  10. package/dist/analytics.d.ts +232 -0
  11. package/dist/analytics.js +126 -0
  12. package/dist/analytics.js.map +1 -0
  13. package/dist/artifacts.d.ts +47 -1
  14. package/dist/artifacts.js +30 -2
  15. package/dist/artifacts.js.map +1 -1
  16. package/dist/assets.js +1 -1
  17. package/dist/assets.js.map +1 -1
  18. package/dist/auth/client.d.ts +34 -3
  19. package/dist/auth/client.js +42 -5
  20. package/dist/auth/client.js.map +1 -1
  21. package/dist/auth/continue-mock.d.ts +21 -0
  22. package/dist/auth/continue-mock.js +75 -0
  23. package/dist/auth/continue-mock.js.map +1 -0
  24. package/dist/auth/end-user-keys-mock.js +1 -1
  25. package/dist/auth/end-user-keys-mock.js.map +1 -1
  26. package/dist/auth/end-user-keys.js +1 -1
  27. package/dist/auth/end-user-keys.js.map +1 -1
  28. package/dist/auth/verify.js +1 -1
  29. package/dist/auth/verify.js.map +1 -1
  30. package/dist/auth.d.ts +169 -0
  31. package/dist/auth.js +135 -1
  32. package/dist/auth.js.map +1 -1
  33. package/dist/billing.d.ts +13 -6
  34. package/dist/billing.js +3 -1
  35. package/dist/billing.js.map +1 -1
  36. package/dist/broker.d.ts +165 -33
  37. package/dist/broker.js +103 -7
  38. package/dist/broker.js.map +1 -1
  39. package/dist/browser-upload.d.ts +101 -0
  40. package/dist/browser-upload.js +130 -0
  41. package/dist/browser-upload.js.map +1 -0
  42. package/dist/build.js +1 -1
  43. package/dist/build.js.map +1 -1
  44. package/dist/common.d.ts +1 -1
  45. package/dist/common.js +1 -1
  46. package/dist/common.js.map +1 -1
  47. package/dist/config/flags.d.ts +12 -2
  48. package/dist/config/flags.js +54 -6
  49. package/dist/config/flags.js.map +1 -1
  50. package/dist/config.d.ts +24 -0
  51. package/dist/config.js +22 -1
  52. package/dist/config.js.map +1 -1
  53. package/dist/connections.d.ts +128 -25
  54. package/dist/connections.js +72 -25
  55. package/dist/connections.js.map +1 -1
  56. package/dist/data.d.ts +306 -13
  57. package/dist/data.js +110 -9
  58. package/dist/data.js.map +1 -1
  59. package/dist/entitlement.js +1 -1
  60. package/dist/entitlement.js.map +1 -1
  61. package/dist/events/realtime.js +1 -1
  62. package/dist/events/realtime.js.map +1 -1
  63. package/dist/events/webhooks.js +1 -1
  64. package/dist/events/webhooks.js.map +1 -1
  65. package/dist/events.d.ts +36 -0
  66. package/dist/events.js +29 -1
  67. package/dist/events.js.map +1 -1
  68. package/dist/flags.d.ts +2 -0
  69. package/dist/flags.js +5 -1
  70. package/dist/flags.js.map +1 -1
  71. package/dist/hosting.js +1 -1
  72. package/dist/hosting.js.map +1 -1
  73. package/dist/ids.d.ts +40 -0
  74. package/dist/ids.js +9 -1
  75. package/dist/ids.js.map +1 -1
  76. package/dist/index.d.ts +5 -1
  77. package/dist/index.js +14 -2
  78. package/dist/index.js.map +1 -1
  79. package/dist/keys.js +1 -1
  80. package/dist/keys.js.map +1 -1
  81. package/dist/knowledge.d.ts +32 -9
  82. package/dist/knowledge.js +21 -11
  83. package/dist/knowledge.js.map +1 -1
  84. package/dist/localization.js +1 -1
  85. package/dist/localization.js.map +1 -1
  86. package/dist/methods.js +408 -8
  87. package/dist/methods.js.map +1 -1
  88. package/dist/money.d.ts +263 -7
  89. package/dist/money.js +121 -7
  90. package/dist/money.js.map +1 -1
  91. package/dist/network.js +1 -1
  92. package/dist/network.js.map +1 -1
  93. package/dist/notify.d.ts +340 -0
  94. package/dist/notify.js +304 -1
  95. package/dist/notify.js.map +1 -1
  96. package/dist/observability.js +1 -1
  97. package/dist/observability.js.map +1 -1
  98. package/dist/realtime.js +1 -1
  99. package/dist/realtime.js.map +1 -1
  100. package/dist/release.js +1 -1
  101. package/dist/release.js.map +1 -1
  102. package/dist/runners.js +1 -1
  103. package/dist/runners.js.map +1 -1
  104. package/dist/runtime.d.ts +3 -0
  105. package/dist/runtime.js +54 -1
  106. package/dist/runtime.js.map +1 -1
  107. package/dist/sandboxes/stream-mock.d.ts +124 -0
  108. package/dist/sandboxes/stream-mock.js +476 -0
  109. package/dist/sandboxes/stream-mock.js.map +1 -0
  110. package/dist/sandboxes/stream.d.ts +407 -0
  111. package/dist/sandboxes/stream.js +335 -0
  112. package/dist/sandboxes/stream.js.map +1 -0
  113. package/dist/sandboxes.d.ts +94 -17
  114. package/dist/sandboxes.js +33 -4
  115. package/dist/sandboxes.js.map +1 -1
  116. package/dist/secrets.js +1 -1
  117. package/dist/secrets.js.map +1 -1
  118. package/dist/workflows.js +1 -1
  119. package/dist/workflows.js.map +1 -1
  120. package/package.json +1 -1
package/dist/agents.d.ts CHANGED
@@ -34,6 +34,19 @@ export interface AgentBudget {
34
34
  */
35
35
  maxSessionSpendMicros?: string;
36
36
  }
37
+ /** The owner's pinned model and the cheap inference-only tool/compaction model. */
38
+ export interface AgentModels {
39
+ /**
40
+ * The exact Sylphx AI catalog id (`ai_models`) of the owner model, pinned
41
+ * for the life of a session; the runtime never remaps it.
42
+ */
43
+ primary?: string;
44
+ /**
45
+ * The exact catalog id of the cheap model used only for owner-briefed
46
+ * `subcall.*` tools and in-loop compaction; never an owner.
47
+ */
48
+ light?: string;
49
+ }
37
50
  /**
38
51
  * An AgentSession is a durable conversation with one pinned AgentVersion.
39
52
  * Its conversation is its SessionEvent log. Each turn runs as one Sylphx
@@ -94,18 +107,32 @@ export interface AgentSession {
94
107
  * resource name and mode. The runtime never puts profile values in events.
95
108
  */
96
109
  profiles?: ProfileMount[];
110
+ /**
111
+ * The maker sessions this session verifies, as its `:run` named them;
112
+ * empty for any other session.
113
+ */
114
+ readonly verifies?: string[];
115
+ /** When the session was archived; unset while it is not archived. */
116
+ readonly archiveTime?: string;
117
+ /**
118
+ * The pinned organization layer: its sha256 digest, instructions and skill
119
+ * names and descriptions. Skill bodies are never returned.
120
+ */
121
+ readonly organizationContext?: Record<string, unknown>;
122
+ /**
123
+ * The organization layer the caller binds at assignment, read from its own
124
+ * versioned store. Admission pins it for the session's life: its
125
+ * instructions and skill index are injected at every activation, and a
126
+ * skill body is read from the pin only when the agent loads it. Never
127
+ * returned; organization_context shows the pin.
128
+ */
129
+ organizationLayer?: OrganizationLayer;
97
130
  }
98
131
  /**
99
132
  * AgentSpec is the caller-writable definition of an Agent. An AgentVersion
100
133
  * holds a frozen copy of it.
101
134
  */
102
135
  export interface AgentSpec {
103
- /**
104
- * The exact Sylphx AI catalog id (`ai_models`), set per Agent through the
105
- * API as runtime state, never code or a deployed file. Agents in the same
106
- * environment may use different models; the harness never remaps this id.
107
- */
108
- model?: string;
109
136
  /** The system instructions, at most 256 KiB. */
110
137
  instructions?: string;
111
138
  /** The tools the agent may call, at most 128, each `name` once. */
@@ -135,12 +162,27 @@ export interface AgentSpec {
135
162
  * fields on that pinned default and requires a valid fresh finite lease.
136
163
  */
137
164
  environment?: EnvironmentSpec;
138
- /**
139
- * The execution harness, independent of `model`: `runtime` (default),
140
- * `claude_code` or `codex`. It is part of the immutable version, not an
141
- * environment-wide setting. An omitted or empty value means `runtime`.
142
- */
143
- harness?: string;
165
+ /** Exact owner and cheap-tool model ids. Neither is silently substituted. */
166
+ models?: AgentModels;
167
+ /**
168
+ * Read-only: the version holds no write grant, so it may verify another
169
+ * agent's work but never own it. Create and update refuse memory stores,
170
+ * MCP servers, `app_function` and `client` tools, the `memory`, `browser`
171
+ * and `computer` built-ins, and an HTTP tool whose pinned operation is not
172
+ * GET or HEAD unless it is `runtime_only`. The `shell` and `files`
173
+ * built-ins, and a `claude_code` or `codex` harness (which bring their own),
174
+ * need `environment.egress` that denies by default: `DENY`, or `ALLOWLIST`
175
+ * of the configured Sylphx API and inference gateways and the
176
+ * version's GET or HEAD tool hosts, with no CIDRs. Session create, `:send`
177
+ * and `:run` check the version and the session's effective environment
178
+ * again, and refuse any model-facing credential that is not a captured
179
+ * Access key holding only `<service>:read` and `ai:inference` scopes; a
180
+ * renewal's `credential_updates` value for a model-facing binding is held to
181
+ * the same rule. A run's `completion.result_fields` never map into the
182
+ * completion tool's path or query parameters. An OwnerPool never qualifies
183
+ * the version.
184
+ */
185
+ readOnly?: boolean;
144
186
  }
145
187
  /** AgentStatus is the observed state of an Agent. */
146
188
  export interface AgentStatus {
@@ -190,6 +232,11 @@ export interface Approval {
190
232
  /** The reason given, if any. */
191
233
  readonly reason?: string;
192
234
  }
235
+ /** The request of ArchiveAgentSession. */
236
+ export interface ArchiveAgentSessionRequest {
237
+ /** The name of the session to archive. */
238
+ name: string;
239
+ }
193
240
  /** A BuiltinTool is a tool the platform provides. */
194
241
  export interface BuiltinTool {
195
242
  /** The built-in tool's id. */
@@ -306,6 +353,15 @@ export interface CreateMemoryStoreRequest {
306
353
  /** Validate and return the result without writing anything. */
307
354
  validateOnly?: boolean;
308
355
  }
356
+ /** The request of CreateOwnerPool. */
357
+ export interface CreateOwnerPoolRequest {
358
+ /** The parent to create in. */
359
+ parent: string;
360
+ /** The owner pool id, the final name segment. */
361
+ ownerPoolId: string;
362
+ /** The owner pool to create; only caller-writable fields are read. */
363
+ ownerPool: OwnerPool;
364
+ }
309
365
  /**
310
366
  * A CredentialBinding names where the gateway takes a credential from. The
311
367
  * value is resolved at egress only; the model, the event log and traces see
@@ -416,6 +472,11 @@ export interface DeleteMemoryStoreRequest {
416
472
  */
417
473
  force?: boolean;
418
474
  }
475
+ /** The request of DeleteOwnerPool. */
476
+ export interface DeleteOwnerPoolRequest {
477
+ /** The name of the owner pool to delete. */
478
+ name: string;
479
+ }
419
480
  /**
420
481
  * EnvironmentSpec describes a session's Sandboxes environment. The pinned
421
482
  * AgentVersion may provide a default. RunAgent overlays selected fields using
@@ -513,6 +574,11 @@ export interface GetMemoryStoreRequest {
513
574
  /** The name of the memory store to get. */
514
575
  name: string;
515
576
  }
577
+ /** The request of GetOwnerPool. */
578
+ export interface GetOwnerPoolRequest {
579
+ /** The name of the owner pool to get. */
580
+ name: string;
581
+ }
516
582
  /** The request of GetSessionEvent. */
517
583
  export interface GetSessionEventRequest {
518
584
  /** The name of the session event to get. */
@@ -646,6 +712,22 @@ export interface ListMemoryStoresResponse {
646
712
  /** The token of the next page; empty on the last page. */
647
713
  nextPageToken?: string;
648
714
  }
715
+ /** The request of ListOwnerPools. */
716
+ export interface ListOwnerPoolsRequest {
717
+ /** The parent to list in. */
718
+ parent: string;
719
+ /** At most this many; default 50, clamped to 1000. */
720
+ pageSize?: number;
721
+ /** `next_page_token` of the previous page. */
722
+ pageToken?: string;
723
+ }
724
+ /** The response of ListOwnerPools. */
725
+ export interface ListOwnerPoolsResponse {
726
+ /** The page. */
727
+ ownerPools?: OwnerPool[];
728
+ /** The token of the next page; empty on the last page. */
729
+ nextPageToken?: string;
730
+ }
649
731
  /** The request of ListSessionEvents. */
650
732
  export interface ListSessionEventsRequest {
651
733
  /** The session to list in. */
@@ -724,8 +806,9 @@ export interface MemoryProvenance {
724
806
  }
725
807
  /**
726
808
  * A MemoryStore holds long-term memory records with provenance, recalled by
727
- * hybrid full-text and vector search. Agents name the stores they use; a
728
- * store may be shared by many agents.
809
+ * hybrid full-text and vector search. The records are Sylphx Knowledge
810
+ * episodes in the store's Knowledge spaces, read and written as the caller.
811
+ * Agents name the stores they use; a store may be shared by many agents.
729
812
  */
730
813
  export interface MemoryStore {
731
814
  /** `orgs/{org}/projects/{project}/envs/{env}/memory_stores/{memory_store}`. */
@@ -747,12 +830,15 @@ export interface MemoryStoreSpec {
747
830
  scope?: MemoryScope;
748
831
  /**
749
832
  * Memories older than this since their last update are deleted, 1d to
750
- * 3650d; unset keeps them until deleted.
833
+ * 3650d; unset keeps them until deleted. Not accepted yet: memories are
834
+ * Knowledge episodes and Knowledge has no time-based deletion, so a set
835
+ * value is refused with `INVALID_FIELD`.
751
836
  */
752
837
  retention?: string;
753
838
  /**
754
839
  * Whether agents write memories themselves after each turn; otherwise
755
- * only callers write them.
840
+ * only callers write them. Not accepted yet: the turn runtime has no
841
+ * after-turn memory hook, so `true` is refused with `INVALID_FIELD`.
756
842
  */
757
843
  agentWrites?: boolean;
758
844
  }
@@ -764,7 +850,7 @@ export interface MemoryStoreStatus {
764
850
  readonly conditions?: common.Condition[];
765
851
  /** The number of memories. */
766
852
  readonly memoryCount?: string;
767
- /** Bytes stored, content and index together; the billed quantity. */
853
+ /** Bytes of the memories' current content. Knowledge meters their storage. */
768
854
  readonly storedBytes?: string;
769
855
  }
770
856
  /** A Message is text and files from a user or the agent. */
@@ -772,6 +858,154 @@ export interface Message {
772
858
  /** The content, in order; 1 to 64 parts. */
773
859
  parts?: ContentPart[];
774
860
  }
861
+ /** The request of ObserveOwnerPoolMember. */
862
+ export interface ObserveOwnerPoolMemberRequest {
863
+ /** The owner pool. */
864
+ name: string;
865
+ /** The member version. */
866
+ agentVersion: string;
867
+ /**
868
+ * The observed value per metric over the caller's window, lower is better;
869
+ * 1 to 64. A demotion rule's metric is never negative.
870
+ */
871
+ metrics: Record<string, number>;
872
+ /** The number of outcomes the values summarize. */
873
+ samples: string;
874
+ }
875
+ /**
876
+ * The organization layer of an agent's context: always-on instructions and a
877
+ * skill index whose bodies load only on use (Agent Skills progressive
878
+ * disclosure). Its versioned store and authoring belong to the caller (such
879
+ * as a work layer); the engine keeps only the immutable pin a session
880
+ * was admitted with. Per-kind roles add their own instructions and skills
881
+ * above this layer; the Agent version's instructions remain additive.
882
+ */
883
+ export interface OrganizationLayer {
884
+ /** Always loaded organization instructions, at most 256 KiB. */
885
+ instructions?: string;
886
+ /** Up to 256 skills with unique names; the layer is at most 1 MiB in total. */
887
+ skills?: OrganizationSkill[];
888
+ }
889
+ /** A discoverable organization instruction pack. */
890
+ export interface OrganizationSkill {
891
+ /** The model-facing name, [a-z0-9][a-z0-9_-]{0,62}. */
892
+ name?: string;
893
+ /** Discovery description, nonempty and at most 4 KiB. */
894
+ description?: string;
895
+ /** Instructions loaded by organization.skill.get, nonempty and at most 256 KiB. */
896
+ body?: string;
897
+ }
898
+ /**
899
+ * An OwnerPool is the set of Agent versions qualified to own work. A version
900
+ * joins only by passing the pool's admission suite (`:qualify`) and leaves
901
+ * automatically when a live metric regresses past a demotion rule
902
+ * (`:observe`). `:run` with `owner_pool` admits only a qualified member. The
903
+ * suite, the metrics and their thresholds are the caller's own; the pool
904
+ * stores no method of its own.
905
+ */
906
+ export interface OwnerPool {
907
+ /** `orgs/{org}/projects/{project}/envs/{env}/owner_pools/{owner_pool}`. */
908
+ name?: string;
909
+ /** `aop_<cell><ulid>`; never reused. */
910
+ readonly uid?: string;
911
+ /** Resource metadata. */
912
+ meta?: common.ResourceMeta;
913
+ /** Desired state. */
914
+ spec?: OwnerPoolSpec;
915
+ /** Observed state: the members. */
916
+ readonly status?: OwnerPoolStatus;
917
+ }
918
+ /** OwnerPoolAdmission is a fixed benchmark suite with minimum scores. */
919
+ export interface OwnerPoolAdmission {
920
+ /** The suite's id, matched exactly by `:qualify`; at most 200 characters. */
921
+ suite?: string;
922
+ /**
923
+ * Minimum score per suite metric, higher is better; 1 to 64 metrics. A
924
+ * member qualifies only when every metric is reported at or above its
925
+ * minimum.
926
+ */
927
+ minScores?: Record<string, number>;
928
+ /**
929
+ * The suite's version, matched exactly by `:qualify`; at most 200
930
+ * characters.
931
+ */
932
+ suiteVersion?: string;
933
+ }
934
+ /**
935
+ * OwnerPoolDemotionRule demotes a member whose live metric, lower is better
936
+ * and never negative, regresses past its baseline. The platform computes the
937
+ * baseline; no caller sets it.
938
+ */
939
+ export interface OwnerPoolDemotionRule {
940
+ /** The live metric's name, as `:observe` reports it. */
941
+ metric?: string;
942
+ /**
943
+ * The tolerated regression as a fraction of the baseline: a member is
944
+ * demoted when the observed value exceeds `baseline * (1 + max_regression)`.
945
+ */
946
+ maxRegression?: number;
947
+ /**
948
+ * Observations over fewer samples than this are recorded but never count
949
+ * toward the baseline or demote; default 1.
950
+ */
951
+ minSamples?: string;
952
+ /**
953
+ * The baseline is the median of the member's first this many counted
954
+ * observations of the metric, set once it is finite and positive (while
955
+ * the median is zero the window moves on). 1 to 100; default 5.
956
+ */
957
+ baselineObservations?: string;
958
+ }
959
+ /** An OwnerPoolMember is one Agent version's standing in a pool. */
960
+ export interface OwnerPoolMember {
961
+ /** The member version. */
962
+ readonly agentVersion?: string;
963
+ /** The model the version pins. */
964
+ readonly model?: string;
965
+ /** Qualified, refused or demoted. */
966
+ readonly state?: OwnerPoolMemberState;
967
+ /** The suite of the latest `:qualify`. */
968
+ readonly suite?: string;
969
+ /** The scores of the latest `:qualify`. */
970
+ readonly scores?: Record<string, number>;
971
+ /**
972
+ * The baseline per demotion metric, computed by the platform from counted
973
+ * observations; a re-qualify keeps it.
974
+ */
975
+ readonly baseline?: Record<string, number>;
976
+ /** The latest observation per metric. */
977
+ readonly observed?: Record<string, number>;
978
+ /** When it last qualified. */
979
+ readonly qualifyTime?: string;
980
+ /** When it was last demoted. */
981
+ readonly demoteTime?: string;
982
+ /** Why it was refused or demoted. */
983
+ readonly reason?: string;
984
+ /** When the state last changed. */
985
+ readonly updateTime?: string;
986
+ /** The suite version of the latest `:qualify`. */
987
+ readonly suiteVersion?: string;
988
+ /** The suite result of the latest `:qualify`. */
989
+ readonly result?: string;
990
+ /** The principal that recorded the latest `:qualify`. */
991
+ readonly qualifier?: string;
992
+ }
993
+ /** OwnerPoolSpec is the caller-writable state of an OwnerPool. */
994
+ export interface OwnerPoolSpec {
995
+ /** The admission test every member passes. */
996
+ admission?: OwnerPoolAdmission;
997
+ /** Live-metric rules that demote a member; at most 16, each metric once. */
998
+ demotion?: OwnerPoolDemotionRule[];
999
+ }
1000
+ /** OwnerPoolStatus is the observed state of an OwnerPool. */
1001
+ export interface OwnerPoolStatus {
1002
+ /** The generation this status was computed from. */
1003
+ readonly observedGeneration?: string;
1004
+ /** Ready. */
1005
+ readonly conditions?: common.Condition[];
1006
+ /** Every version ever submitted to `:qualify`, most recently changed first. */
1007
+ readonly members?: OwnerPoolMember[];
1008
+ }
775
1009
  /** ProfileMount attaches a platform Profile by name, never its sign-in values. */
776
1010
  export interface ProfileMount {
777
1011
  /** `orgs/{org}/projects/{project}/envs/{env}/profiles/{profile}`. */
@@ -782,6 +1016,27 @@ export interface ProfileMount {
782
1016
  */
783
1017
  mode?: string;
784
1018
  }
1019
+ /** The request of QualifyOwnerPoolMember. */
1020
+ export interface QualifyOwnerPoolMemberRequest {
1021
+ /** The owner pool. */
1022
+ name: string;
1023
+ /** The Agent version that ran the suite, in the pool's environment. */
1024
+ agentVersion: string;
1025
+ /** The suite that ran; must equal the pool's `admission.suite`. */
1026
+ suite: string;
1027
+ /** The score per suite metric; at most 64. */
1028
+ scores: Record<string, number>;
1029
+ /**
1030
+ * The suite version that ran; must equal the pool's
1031
+ * `admission.suite_version`.
1032
+ */
1033
+ suiteVersion: string;
1034
+ /**
1035
+ * The grader's id of this suite run, for example its evidence record; 1 to
1036
+ * 200 characters. Each result is recorded once per member.
1037
+ */
1038
+ result: string;
1039
+ }
785
1040
  /** A pinned tool called periodically while the accepted task owns its grant. */
786
1041
  export interface RenewalCall {
787
1042
  /** The authorized renewal tool name in the pinned agent version. */
@@ -881,6 +1136,32 @@ export interface RunAgentRequest {
881
1136
  * explicit resets and whole-environment replacement.
882
1137
  */
883
1138
  environmentMask?: string;
1139
+ /**
1140
+ * The caller's stable identity of the work item, not interpreted otherwise.
1141
+ * Every session and attempt with the same item key works on one repository
1142
+ * branch derived from it, so a new attempt continues the pushed work.
1143
+ * Omitted, the session is the item.
1144
+ */
1145
+ itemKey?: string;
1146
+ /**
1147
+ * The OwnerPool this run owns work for. Admission refuses with
1148
+ * `INVALID_STATE` unless `agent_version` is a `QUALIFIED` member at that
1149
+ * moment; later turns of the session are not re-checked.
1150
+ */
1151
+ ownerPool?: string;
1152
+ /**
1153
+ * The maker sessions this run verifies, 1 to 16; empty for an ordinary
1154
+ * run. Admission refuses with `PERMISSION_DENIED` unless `agent_version` is
1155
+ * read-only and its Agent differs from every maker session's Agent. The
1156
+ * verifier session never receives a maker transcript. Set at most one of
1157
+ * `owner_pool` and `verifies`.
1158
+ */
1159
+ verifies?: string[];
1160
+ /**
1161
+ * The organization layer the caller binds at assignment, read from its own
1162
+ * versioned store. The session pins it; see AgentSession.organization_layer.
1163
+ */
1164
+ organizationLayer?: OrganizationLayer;
884
1165
  }
885
1166
  /** Durable acceptance, not task completion or sandbox readiness. */
886
1167
  export interface RunAgentResponse {
@@ -893,6 +1174,15 @@ export interface RunAgentResponse {
893
1174
  /** Lease-cleanup progress; released requires terminal lease evidence. */
894
1175
  readonly cleanup?: string;
895
1176
  }
1177
+ /** A public lease fact recorded at allocation and confirmed physical release. */
1178
+ export interface SandboxActivity {
1179
+ /** The lease's resource name. */
1180
+ readonly lease?: string;
1181
+ /** `allocated` or `released` (the release was read back as ENDED). */
1182
+ readonly state?: string;
1183
+ /** On `released`: exact decimal seconds from allocation to release. */
1184
+ readonly sandboxSeconds?: string;
1185
+ }
896
1186
  /** The request of SearchMemories. */
897
1187
  export interface SearchMemoriesRequest {
898
1188
  /** The memory store to search. */
@@ -947,6 +1237,10 @@ export interface SessionEvent {
947
1237
  readonly step?: string;
948
1238
  /** When it was appended. */
949
1239
  readonly createTime?: string;
1240
+ /** Observed accounting for this step; absent values are unknown, never zero. */
1241
+ readonly usage?: StepUsage;
1242
+ /** Stable runtime-assigned effect key, independent of invocation attempts. */
1243
+ readonly stepKey?: string;
950
1244
  /** For USER_MESSAGE, STEER and AGENT_MESSAGE. */
951
1245
  message?: Message;
952
1246
  /** For TOOL_CALL. */
@@ -965,6 +1259,8 @@ export interface SessionEvent {
965
1259
  response?: TurnResult;
966
1260
  /** For ERROR. */
967
1261
  error?: ErrorEvent;
1262
+ /** For SANDBOX: authoritative allocation/release history, including replacements. */
1263
+ sandbox?: SandboxActivity;
968
1264
  }
969
1265
  /**
970
1266
  * SessionUsage is what a session has used. Model tokens are on the Sylphx AI
@@ -1004,6 +1300,27 @@ export interface SteerAgentSessionRequest {
1004
1300
  /** The message, 1 to 64 parts. */
1005
1301
  message: Message;
1006
1302
  }
1303
+ /** Observed per-step accounting. Exact decimal USD avoids binary rounding. */
1304
+ export interface StepUsage {
1305
+ /** Uncached input tokens the step was charged for; absent when unknown. */
1306
+ readonly inputTokens?: string;
1307
+ /** Input tokens served from the provider cache; absent when unknown. */
1308
+ readonly cachedTokens?: string;
1309
+ /** Output tokens; absent when unknown. */
1310
+ readonly outputTokens?: string;
1311
+ /** The exact decimal USD charge the gateway reported; absent when unknown. */
1312
+ readonly costUsd?: string;
1313
+ /** The catalog id the step ran on; empty for a step with no inference. */
1314
+ readonly model?: string;
1315
+ /** `model`, `tool`, `compaction` or `subcall`. */
1316
+ readonly kind?: string;
1317
+ /**
1318
+ * For a model step: when the runtime received the stream's first non-empty
1319
+ * assistant text or tool-call delta (not a role-only or empty chunk), on
1320
+ * the runtime's clock, from the attempt that produced the recorded step.
1321
+ */
1322
+ readonly firstDeltaTime?: string;
1323
+ }
1007
1324
  /** The request of SubmitAgentSessionToolResult. */
1008
1325
  export interface SubmitAgentSessionToolResultRequest {
1009
1326
  /** The name of the session. */
@@ -1030,7 +1347,7 @@ export interface Tool {
1030
1347
  inputSchema?: Record<string, unknown>;
1031
1348
  /**
1032
1349
  * A platform tool: `shell`, `files`, `browser`, `computer`, `web_fetch`,
1033
- * `web_search` or `memory`.
1350
+ * `web_search`, `remember`, `recall`, `knowledge_search` or `skill_load`.
1034
1351
  */
1035
1352
  builtin?: BuiltinTool;
1036
1353
  /** An HTTP API described by OpenAPI. */
@@ -1045,6 +1362,11 @@ export interface Tool {
1045
1362
  * event (`:submitToolResult`).
1046
1363
  */
1047
1364
  client?: ClientTool;
1365
+ /**
1366
+ * Called only by the runtime, as a run's `completion` or `renewal` tool:
1367
+ * never offered to the model, which cannot call it.
1368
+ */
1369
+ runtimeOnly?: boolean;
1048
1370
  }
1049
1371
  /**
1050
1372
  * A ToolCall is the agent asking to call a tool. `id` is assigned by the
@@ -1134,6 +1456,11 @@ export interface TurnResult {
1134
1456
  readonly costMicros?: string;
1135
1457
  /** How long the turn ran. */
1136
1458
  readonly duration?: string;
1459
+ /**
1460
+ * The first non-empty assistant text or tool-call delta of the turn: the
1461
+ * earliest `first_delta_time` of its recorded model steps.
1462
+ */
1463
+ readonly firstDeltaTime?: string;
1137
1464
  }
1138
1465
  /** TurnTokenUsage is the model token usage reported for a completed turn. */
1139
1466
  export interface TurnTokenUsage {
@@ -1177,20 +1504,29 @@ export interface UpdateMemoryStoreRequest {
1177
1504
  /** Validate and return the result without writing anything. */
1178
1505
  validateOnly?: boolean;
1179
1506
  }
1507
+ /** The request of UpdateOwnerPool. */
1508
+ export interface UpdateOwnerPoolRequest {
1509
+ /** The owner pool to update; `name` identifies it. */
1510
+ ownerPool: OwnerPool;
1511
+ /** The fields to write: `spec`, `meta` or both; unset writes both. */
1512
+ updateMask?: string;
1513
+ }
1180
1514
  /** ApprovalDecision is a person's answer to an approval. */
1181
1515
  export type ApprovalDecision = 'approve' | 'reject' | (string & {});
1182
1516
  /** MemoryScope is whose memories a store keeps apart. */
1183
1517
  export type MemoryScope = 'project' | 'agent' | 'end_user' | (string & {});
1184
1518
  /** MemorySource is who wrote a memory. */
1185
1519
  export type MemorySource = 'agent' | 'api' | 'import' | (string & {});
1520
+ /** The standing of an OwnerPool member. */
1521
+ export type OwnerPoolMemberState = 'qualified' | 'refused' | 'demoted' | (string & {});
1186
1522
  /** PolicyDecision is what the tool policy does with a call. */
1187
1523
  export type PolicyDecision = 'allow' | 'deny' | 'ask' | (string & {});
1188
1524
  /** Runtime-produced fields mapped into an authorized completion tool call. */
1189
- export type ResultField = 'text' | 'done' | 'next' | 'where' | 'outcome' | (string & {});
1525
+ export type ResultField = 'text' | 'done' | 'next' | 'where' | 'outcome' | 'awaits' | 'checkpoint' | 'counted' | 'retry_at' | (string & {});
1190
1526
  /** SessionEventType is what a session event records. */
1191
- export type SessionEventType = 'user_message' | 'steer' | 'agent_message' | 'tool_call' | 'tool_result' | 'approval_requested' | 'approval_decided' | 'status' | 'compaction' | 'thought' | 'file_change' | 'response' | 'error' | (string & {});
1527
+ export type SessionEventType = 'user_message' | 'steer' | 'agent_message' | 'tool_call' | 'tool_result' | 'approval_requested' | 'approval_decided' | 'status' | 'compaction' | 'thought' | 'file_change' | 'response' | 'error' | 'usage' | 'sandbox' | (string & {});
1192
1528
  /** SessionState is where a session is. */
1193
- export type SessionState = 'idle' | 'running' | 'awaiting_approval' | 'awaiting_client' | 'failed' | (string & {});
1529
+ export type SessionState = 'idle' | 'running' | 'awaiting_approval' | 'awaiting_client' | 'failed' | 'archived' | (string & {});
1194
1530
  /**
1195
1531
  * AgentsService is Sylphx Agents, the platform's hosted agent runtime
1196
1532
  * (ADR-01M495TCCBZGSQ68A4P4G428H2). Apps call it instead of building their
@@ -1198,9 +1534,14 @@ export type SessionState = 'idle' | 'running' | 'awaiting_approval' | 'awaiting_
1198
1534
  *
1199
1535
  * Scopes: `agents:read` and `agents:write` manage agents, versions and
1200
1536
  * memory stores with a secret key. `agents:sessions` runs sessions and reads
1201
- * and deletes session and memory records. All methods currently require a
1202
- * secret key. Publishable-key access is deferred until the backend enforces
1203
- * end-user ownership of sessions and memories and `end_user_access` on Agents.
1537
+ * and deletes session and memory records. `agents:admin` governs owner pools
1538
+ * (their admission minimums and demotion rules); no wildcard reaches it.
1539
+ * `agents:qualify` records admission-suite results and live metrics for
1540
+ * owner pool members: a grader's grant, held only by name, and refused to the
1541
+ * principal whose create or update minted the version. All methods
1542
+ * currently require a secret key. Publishable-key access is deferred until
1543
+ * the backend enforces end-user ownership of sessions and memories and
1544
+ * `end_user_access` on Agents.
1204
1545
  * Credential actions capture existing grants; handles are not CRUD resources.
1205
1546
  *
1206
1547
  * Namespace of Sylphx Agents on `Sylphx`.
@@ -1218,6 +1559,8 @@ export declare class AgentsApi {
1218
1559
  readonly memoryStores: MemoryStoresCollection;
1219
1560
  /** The `memories` collection. */
1220
1561
  readonly memories: MemoriesCollection;
1562
+ /** The `owner_pools` collection. */
1563
+ readonly ownerPools: OwnerPoolsCollection;
1221
1564
  constructor(client: runtime.Client);
1222
1565
  }
1223
1566
  /** `agents` of Sylphx Agents: Resource type `agents.sylphx.com/Agent`. */
@@ -1297,7 +1640,7 @@ export declare class AgentsCollection {
1297
1640
  *
1298
1641
  * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/agents/*}:run` · permission `agents:sessions` · effect `write`
1299
1642
  *
1300
- * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`, `SPEND_LIMIT_REACHED`.
1643
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`, `SPEND_LIMIT_REACHED`, `INVALID_STATE`.
1301
1644
  */
1302
1645
  run(request: RunAgentRequest): Promise<RunAgentResponse>;
1303
1646
  }
@@ -1385,6 +1728,18 @@ export declare class AgentSessionsCollection {
1385
1728
  * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1386
1729
  */
1387
1730
  delete(request: DeleteAgentSessionRequest): Promise<Record<string, never>>;
1731
+ /**
1732
+ * Archives a session: the session and its event log stay readable, but no
1733
+ * new turn may start and the session's captured credential handles are
1734
+ * revoked. An idle or failed session archives at once; a running turn is
1735
+ * refused with `INVALID_STATE` (interrupt it first). Repeating the call
1736
+ * with the same `Idempotency-Key` returns the same session.
1737
+ *
1738
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/agent_sessions/*}:archive` · permission `agents:sessions` · effect `write`
1739
+ *
1740
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1741
+ */
1742
+ archive(request: ArchiveAgentSessionRequest): Promise<AgentSession>;
1388
1743
  /**
1389
1744
  * Sends a user message. On an idle or failed session it starts a new turn;
1390
1745
  * while a turn runs it is refused with `INVALID_STATE` (use `:steer`).
@@ -1562,3 +1917,86 @@ export declare class MemoriesCollection {
1562
1917
  */
1563
1918
  search(request: SearchMemoriesRequest): Promise<SearchMemoriesResponse>;
1564
1919
  }
1920
+ /** `owner_pools` of Sylphx Agents: Resource type `agents.sylphx.com/OwnerPool`. */
1921
+ export declare class OwnerPoolsCollection {
1922
+ private readonly client;
1923
+ constructor(client: runtime.Client);
1924
+ /**
1925
+ * Gets an owner pool with its members.
1926
+ *
1927
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/owner_pools/*}` · permission `agents:read` · effect `read`
1928
+ *
1929
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
1930
+ */
1931
+ get(request: GetOwnerPoolRequest): Promise<OwnerPool>;
1932
+ /**
1933
+ * Lists owner pools, newest first.
1934
+ *
1935
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/owner_pools` · permission `agents:read` · effect `read`
1936
+ *
1937
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
1938
+ */
1939
+ list(request: ListOwnerPoolsRequest): Promise<ListOwnerPoolsResponse>;
1940
+ /** Every item of every page of `list`. */
1941
+ listAll(request: ListOwnerPoolsRequest): AsyncGenerator<OwnerPool>;
1942
+ /**
1943
+ * Creates an owner pool with no members. Its minimums and demotion rules
1944
+ * are governance, so the caller needs `agents:admin`.
1945
+ *
1946
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/owner_pools` · permission `agents:admin` · effect `write`
1947
+ *
1948
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1949
+ */
1950
+ create(request: CreateOwnerPoolRequest): Promise<OwnerPool>;
1951
+ /**
1952
+ * Replaces an owner pool's spec (`agents:admin`). Members keep their
1953
+ * standing; a changed suite or minimum applies from the next `:qualify`.
1954
+ *
1955
+ * `PATCH /v1/{owner_pool.name=orgs/*\/projects/*\/envs/*\/owner_pools/*}` · permission `agents:admin` · effect `write`
1956
+ *
1957
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1958
+ */
1959
+ update(request: UpdateOwnerPoolRequest): Promise<OwnerPool>;
1960
+ /**
1961
+ * Deletes an owner pool and its members (`agents:admin`). Sessions already
1962
+ * admitted keep running.
1963
+ *
1964
+ * `DELETE /v1/{name=orgs/*\/projects/*\/envs/*\/owner_pools/*}` · permission `agents:admin` · effect `destructive`
1965
+ *
1966
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1967
+ */
1968
+ delete(request: DeleteOwnerPoolRequest): Promise<Record<string, never>>;
1969
+ /**
1970
+ * Records an admission suite result for an Agent version. The caller holds
1971
+ * `agents:qualify` and is not the principal whose create or update minted
1972
+ * the version (`PERMISSION_DENIED`). Every minimum
1973
+ * met: the member is `QUALIFIED`. Any score missing or below its minimum:
1974
+ * the member is recorded `REFUSED` with the reason. Each qualification is
1975
+ * recorded with its suite, suite version, result and caller; a `result`
1976
+ * already recorded for the member is refused with `INVALID_FIELD`, so a
1977
+ * demoted member returns only with a new suite result. A read-only version
1978
+ * is refused with `PERMISSION_DENIED`; a suite or suite version other than
1979
+ * the pool's with `INVALID_FIELD`. Re-qualifying keeps the member's
1980
+ * baseline: the baseline belongs to the version and its pinned model.
1981
+ *
1982
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/owner_pools/*}:qualify` · permission `agents:qualify` · effect `write`
1983
+ *
1984
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1985
+ */
1986
+ qualify(request: QualifyOwnerPoolMemberRequest): Promise<OwnerPoolMember>;
1987
+ /**
1988
+ * Records a live-metric observation for a member and applies the pool's
1989
+ * demotion rules (`agents:qualify`, refused to the version's authors as in
1990
+ * `:qualify`). The platform computes each rule's baseline: the median of
1991
+ * the member's first `baseline_observations` counted observations of the
1992
+ * metric, set only when it is finite and positive. Values of a rule metric
1993
+ * are lower-is-better and must not be negative. Once the baseline is set, a
1994
+ * metric past `baseline * (1 + max_regression)` demotes a qualified member.
1995
+ * Only `:qualify` brings a demoted member back.
1996
+ *
1997
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/owner_pools/*}:observe` · permission `agents:qualify` · effect `write`
1998
+ *
1999
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
2000
+ */
2001
+ observe(request: ObserveOwnerPoolMemberRequest): Promise<OwnerPoolMember>;
2002
+ }