k9o 1.2.0-aarch64-linux → 1.5.0-aarch64-linux

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 (62) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +115 -1
  3. data/README.md +1575 -180
  4. data/k9o.gemspec +2 -2
  5. data/lib/k9o/_ffi/kibo_kms_rest_ffi.rb +928 -25
  6. data/lib/k9o/_ffi/libkibo_kms_rest_ffi.so +0 -0
  7. data/lib/k9o/ai.rb +15 -0
  8. data/lib/k9o/analytics.rb +403 -0
  9. data/lib/k9o/approvals.rb +253 -0
  10. data/lib/k9o/audit.rb +162 -14
  11. data/lib/k9o/client.rb +28 -9
  12. data/lib/k9o/compute.rb +32 -15
  13. data/lib/k9o/crypto.rb +471 -0
  14. data/lib/k9o/custody.rb +28 -0
  15. data/lib/k9o/data.rb +125 -5
  16. data/lib/k9o/ed25519.rb +182 -0
  17. data/lib/k9o/end_users.rb +93 -0
  18. data/lib/k9o/envelope.rb +20 -5
  19. data/lib/k9o/functions.rb +127 -9
  20. data/lib/k9o/gate.rb +52 -22
  21. data/lib/k9o/http_transport.rb +78 -16
  22. data/lib/k9o/jcs.rb +117 -0
  23. data/lib/k9o/kerror.rb +57 -5
  24. data/lib/k9o/keys.rb +131 -0
  25. data/lib/k9o/kibo.rb +3 -3
  26. data/lib/k9o/kibo_client_core.rb +385 -0
  27. data/lib/k9o/kibo_ffi_core.rb +178 -0
  28. data/lib/k9o/locate.rb +118 -0
  29. data/lib/k9o/me.rb +27 -87
  30. data/lib/k9o/metadata.rb +342 -0
  31. data/lib/k9o/moat.rb +443 -0
  32. data/lib/k9o/org.rb +81 -68
  33. data/lib/k9o/orgs.rb +1 -0
  34. data/lib/k9o/policies.rb +25 -6
  35. data/lib/k9o/projects.rb +43 -8
  36. data/lib/k9o/query.rb +174 -0
  37. data/lib/k9o/rampart.rb +273 -0
  38. data/lib/k9o/realtime.rb +261 -32
  39. data/lib/k9o/region.rb +20 -18
  40. data/lib/k9o/schedules.rb +109 -0
  41. data/lib/k9o/schema.rb +35 -0
  42. data/lib/k9o/streams.rb +94 -0
  43. data/lib/k9o/studio.rb +21 -11
  44. data/lib/k9o/url_grammar.rb +46 -20
  45. data/lib/k9o/vault.rb +79 -84
  46. data/lib/k9o/vectors.rb +124 -0
  47. data/lib/k9o/version.rb +1 -1
  48. data/lib/k9o.rb +17 -0
  49. data/sig/k9o/ai.rbs +4 -0
  50. data/sig/k9o/approvals.rbs +71 -0
  51. data/sig/k9o/datasets.rbs +125 -0
  52. data/sig/k9o/gate.rbs +9 -6
  53. data/sig/k9o/kerror.rbs +24 -0
  54. data/sig/k9o/kibo_client_core.rbs +25 -0
  55. data/sig/k9o/metadata.rbs +54 -0
  56. data/sig/k9o/moat.rbs +29 -0
  57. data/sig/k9o/query.rbs +26 -0
  58. data/sig/k9o/rampart.rbs +59 -0
  59. data/sig/k9o/realtime.rbs +34 -0
  60. data/sig/k9o/region.rbs +14 -3
  61. data/sig/k9o/workload.rbs +64 -0
  62. metadata +33 -4
@@ -0,0 +1,125 @@
1
+ # RBS signatures for `client.analytics` (datasets), `client.rollups` and `client.keys`.
2
+
3
+ module K9o
4
+ class Download
5
+ attr_reader body: String
6
+ attr_reader content_type: String?
7
+ def initialize: (body: String, ?content_type: String?) -> void
8
+ end
9
+
10
+ class AnalyticsRollups
11
+ def initialize: (untyped config) -> void
12
+ def create: (String dataset_slug, slug: String, source: String, measures: Array[Hash[Symbol | String, untyped]], window_seconds: Integer,
13
+ ?dimensions: Array[String]?, ?subject_field: String?, ?non_personal: bool?, ?reattest_interval_days: Integer?) -> Envelope
14
+ def list: (String dataset_slug) -> Envelope
15
+ def delete: (String dataset_slug, String rollup_id) -> Envelope
16
+ # People only: a service, workload or extension token gets 403 K9O_RBAC_DENY (reason human_only).
17
+ def reattest: (String dataset_slug, String rollup_id, ?reattest_interval_days: Integer?) -> Envelope
18
+ end
19
+
20
+ class AnalyticsSchedules
21
+ def initialize: (untyped config) -> void
22
+ def create: (String dataset_slug, from_collection: String, interval_seconds: Integer, ?reattest_interval_days: Integer?) -> Envelope
23
+ def list: (String dataset_slug) -> Envelope
24
+ def delete: (String dataset_slug, String schedule_id) -> Envelope
25
+ def reattest: (String dataset_slug, String schedule_id, ?reattest_interval_days: Integer?) -> Envelope
26
+ end
27
+
28
+ class Analytics
29
+ attr_reader rollups: AnalyticsRollups
30
+ attr_reader schedules: AnalyticsSchedules
31
+ def initialize: (untyped config) -> void
32
+ def list: () -> Envelope
33
+ def query: (String sql, Array[String] datasets) -> Envelope
34
+ def create: (String slug, display_name: String, columns: Array[Hash[Symbol | String, untyped]], residency_class: (String | Symbol),
35
+ ?partition_by: Array[String]?, ?storage_target: Hash[Symbol | String, untyped]?) -> Envelope
36
+ def get: (String slug) -> Envelope
37
+ def delete: (String slug) -> Envelope
38
+ def materialize: (String slug, ?from_collection: String?, ?from_query: String?) -> Envelope
39
+ def read: (String slug, ?partition_filter: Hash[Symbol | String, untyped]?, ?cursor: String?, ?limit: Integer?) -> Envelope
40
+ def write: (String slug, (Array[Hash[Symbol | String, untyped]] | String) rows, ?on_error: (String | Symbol)?) -> Envelope
41
+ def upload: (String slug, (String | IO) data, format: (String | Symbol), ?filename: String, ?manifest: Hash[Symbol | String, untyped]?,
42
+ ?dry_run: bool?, ?on_error: (String | Symbol)?, ?delimiter: String?, ?encoding: String?, ?has_header: bool?) -> Envelope
43
+ def download_original: (String slug) -> Download
44
+ end
45
+
46
+ class Rollups
47
+ def initialize: (untyped config) -> void
48
+ def list: () -> Envelope
49
+ def read: (String rollup_slug, ?from: (String | Time)?, ?to: (String | Time)?, ?dims: (Array[String] | String)?) -> Envelope
50
+ def subscribe: (String rollup_slug, ?from_sequence: Integer?, ?on_resync: (^(Hash[String, untyped]) -> untyped)?) -> Enumerator[Hash[String, untyped], untyped]
51
+ end
52
+
53
+ class Keys
54
+ STATUSES: Array[String]
55
+ def initialize: (untyped config) -> void
56
+ # data: { "items" => [key] } (not paged)
57
+ def list: (?status: (String | Symbol)?) -> Envelope
58
+ def get: (String key_id) -> Envelope
59
+ # data: { "keyId", "previousVersion", "newVersion", "status" => "rotated" }
60
+ # step_up: ^(StepUpChallenge, String, String) -> { method: String, proof: String }
61
+ def rotate: (String key_id, ?step_up: untyped, ?headers: Hash[String, String]?) -> Envelope
62
+
63
+ class StepUpChallenge < Struct[untyped]
64
+ attr_reader scope_set_root: String
65
+ attr_reader nonce: String
66
+ attr_reader min_tier: String?
67
+ attr_reader methods: Array[String]
68
+ attr_reader max_age_sec: Integer?
69
+ attr_reader single_use: bool?
70
+ attr_reader rp_id: String?
71
+ end
72
+ end
73
+
74
+ class Crypto
75
+ def initialize: (untyped config) -> void
76
+ def encrypt: (String crypt, Array[Hash[Symbol | String, untyped] | String] items) -> Envelope
77
+ def decrypt: (String crypt, Array[Hash[Symbol | String, untyped] | String] items) -> Envelope
78
+ def rewrap: (String crypt, Array[Hash[Symbol | String, untyped] | String] items) -> Envelope
79
+ def self.text: (Hash[String, untyped] item) -> String?
80
+ # Reads the project's custody mode; every encrypt does this first, with no cache.
81
+ def mode: () -> Mode
82
+ # Registers the Kibo client core (an object with encrypt, decrypt and rewrap); nil removes it.
83
+ def use_client_core: (untyped core) -> untyped
84
+ def self.check_expected_key_refs: (Array[String]? refs) -> Array[String]?
85
+ def self.key_ref_matches?: (String key_ref, Array[String] expected, provider: (:aws | :gcp | :azure | :vault)) -> bool
86
+
87
+ # Ask for a short-lived federated token for +op+ ("encrypt", "decrypt" or "rewrap") on +crypt+.
88
+ def federated_token: (String crypt, String op) -> FederatedToken
89
+
90
+ # Crypts: data is { "crypts" => [...] } (list) or one { "name", "status", "createdAt", "retiredAt" } Hash.
91
+ def crypts_list: () -> Envelope
92
+ def crypts_create: (String name) -> Envelope
93
+ def crypts_retire: (String name) -> Envelope
94
+
95
+ class Mode < Struct[untyped]
96
+ def custody_mode: () -> String?
97
+ def epoch: () -> String?
98
+ end
99
+
100
+ # +provider+ and +project_id+ are nil unless the gateway names them; they are only checked against configuration.
101
+ class FederatedToken < Struct[untyped]
102
+ attr_reader token: String
103
+ attr_reader expires_at: String
104
+ attr_reader issuer: String
105
+ attr_reader subject: String
106
+ attr_reader audience: String
107
+ attr_reader kid: String
108
+ attr_reader provider: String?
109
+ attr_reader project_id: String?
110
+ end
111
+ end
112
+
113
+ class Audit
114
+ # Yields { "auditEventId", "type", "actorType", "occurredAt", "outcome", "eventId" }.
115
+ def tail: (?types: (Array[String | Symbol] | String | Symbol)?, ?on_resync: (^(Hash[String, untyped]) -> untyped)?) -> Enumerator[Hash[String, untyped], untyped]
116
+ def replay: (?topic: String, ?after_audit_event_id: String?, ?from_sequence: Integer?, ?until_sequence: Integer?, ?limit: Integer?) -> Envelope
117
+ end
118
+
119
+ class K9oClient
120
+ attr_reader analytics: Analytics
121
+ attr_reader rollups: Rollups
122
+ attr_reader keys: Keys
123
+ attr_reader crypto: Crypto
124
+ end
125
+ end
data/sig/k9o/gate.rbs CHANGED
@@ -1,11 +1,14 @@
1
- # RBS signatures for the `client.gate` namespace (additions).
1
+ # RBS signatures for the `client.gate` namespace.
2
2
 
3
3
  module K9o
4
4
  class Gate
5
- # GET /@<slug>/gate/hosted. Unauthenticated (no credential sent).
6
- # Returns an Envelope whose `data` is { "signInUrl" => String, "rpId" => String }.
7
- # Raises KError (K9O_MISSING_PROJECT_CONTEXT) without a project slug; the
8
- # uniform 404 K9O_PROJECT_NOT_FOUND for unknown org / deleted / non-Gate project.
9
- def hosted: () -> Envelope
5
+ def sign_up: (email: String, password: String, ?display_name: String?) -> Envelope
6
+ def sign_in: (email: String, password: String) -> Envelope
7
+ # The refresh token is required: the gateway answers 400 without it.
8
+ def sign_out: (refresh_token: String) -> Envelope
9
+ def whoami: () -> Envelope
10
+ def revoke_all_sessions: () -> Envelope
11
+ # `data` is `{ accessToken, refreshToken, expiresAt }`; the refresh token sent stops working, so store the new one.
12
+ def refresh_token: (refresh_token: String) -> Envelope
10
13
  end
11
14
  end
@@ -0,0 +1,24 @@
1
+ # RBS signatures for the error type raised by every call.
2
+
3
+ module K9o
4
+ class KError < StandardError
5
+ attr_reader code: String
6
+ attr_reader context: Hash[untyped, untyped]
7
+ # Suggested next step as text, or nil.
8
+ attr_reader recommendation: String?
9
+ attr_reader status: Integer?
10
+ attr_reader request_id: String?
11
+ # Seconds the gateway asks the caller to wait before retrying, or nil.
12
+ attr_reader retry_after_sec: Numeric?
13
+ # The step-up challenge of a 401 K9O_STEP_UP_REQUIRED, or nil.
14
+ def step_up: () -> Keys::StepUpChallenge?
15
+
16
+ def initialize: (code: String, message: String, ?context: Hash[untyped, untyped], ?recommendation: String?, ?status: Integer?, ?request_id: String?, ?retry_after_sec: Numeric?) -> void
17
+ def with_recommendation: (String? rec) -> KError
18
+ def message: () -> String
19
+ def to_s: () -> String
20
+ def self.from_wire: (Hash[String, untyped] wire, Integer? status) -> KError
21
+ def self.recommendation_text: (untyped raw) -> String?
22
+ def self.retry_after: (untyped raw) -> Numeric?
23
+ end
24
+ end
@@ -0,0 +1,25 @@
1
+ # RBS signatures for the Kibo client core of client.crypto (BYOK and HYOK projects).
2
+
3
+ module K9o
4
+ class KiboClientCore
5
+ EXCHANGE_TIMEOUT: String
6
+ CORE_FUNCTIONS: Array[Symbol]
7
+ PROVIDER_WIRE: Hash[Symbol, String]
8
+ SKEW_SECS: Integer
9
+ DEFAULT_DEADLINE_SECS: Integer
10
+
11
+ # +core+ responds to app_crypto_seal_blocking, app_crypto_open_blocking, acquire_kms_credential_blocking and
12
+ # core_capabilities (the generated KiboKmsRestFfi module does). +federated_token+ answers call(crypt, op) with a
13
+ # Crypto::FederatedToken.
14
+ def initialize: (provider: (:aws | :gcp | :azure | :vault), posture: (:byok | :hyok), key_ref: Hash[Symbol, untyped],
15
+ federation: Hash[Symbol | String, untyped], expected_key_refs: Array[String], federated_token: untyped, core: untyped,
16
+ ?project_id: String?, ?provider_config: Hash[Symbol | String, String?], ?exchange_deadline: Numeric,
17
+ ?now: ^() -> Integer) -> void
18
+ def enforces_expected_key_refs?: () -> true
19
+ def encrypt: (String crypt, Array[Hash[Symbol, untyped]] items, **untyped options) -> Hash[String, Array[Hash[String, untyped]]]
20
+ def decrypt: (String crypt, Array[Hash[Symbol, untyped]] items, **untyped options) -> Hash[String, Array[Hash[String, untyped]]]
21
+ def rewrap: (String crypt, Array[Hash[Symbol, untyped]] items, **untyped options) -> Hash[String, Array[Hash[String, untyped]]]
22
+ def inspect: () -> String
23
+ def to_s: () -> String
24
+ end
25
+ end
@@ -0,0 +1,54 @@
1
+ # RBS signatures for `client.metadata`.
2
+
3
+ module K9o
4
+ class Metadata
5
+ # An Envelope whose data is the Array of rows; `cursor` is the next page's cursor, or nil on the last page.
6
+ # A row is { "surface", "scope", "recordId" (collection) or "eventId" (telemetry), "metadata" => { column => value } }.
7
+ class Page < Envelope
8
+ def cursor: () -> String?
9
+ end
10
+
11
+ OPS: Array[String]
12
+ METRICS: Array[String]
13
+ SLICES: Array[String]
14
+ PREFIX: String
15
+ MAX_COLUMNS: Integer
16
+ MAX_LIMIT: Integer
17
+ TELEMETRY_FIELDS: Array[String]
18
+
19
+ attr_reader vectors: MetadataVectors
20
+ attr_reader index: MetadataIndex
21
+
22
+ def initialize: (untyped config) -> void
23
+ # surfaces: ["collection:posts"]; where: [{ field:, op:, value: }]; limit 1..1000; cursor only with one surface.
24
+ # Options may be keyword arguments or one Hash.
25
+ def filter: (?Hash[String | Symbol, untyped]? input, ?surfaces: Array[String], ?where: Array[Hash[String | Symbol, untyped]]?, ?limit: Integer?, ?cursor: String?) -> Page
26
+ # data is the whole updated record. Columns may be keyword arguments or one Hash.
27
+ def set: (String | Symbol collection, String id, ?Hash[String | Symbol, untyped]? columns, **untyped extra) -> Envelope
28
+ def search: (?Hash[String | Symbol, untyped]? input, ?surface: String, ?field: String | Symbol, ?q: String, ?limit: Integer?) -> Page
29
+ # Yields { "topic", "eventType", "payload" => { "collection", "id" }, "occurredAt", "eventId"? }.
30
+ def subscribe: (String surface, ?Hash[String | Symbol, untyped]? input, ?from_sequence: Integer?, ?fromSequence: Integer?, ?on_resync: (^(Hash[String, untyped]) -> untyped)?) -> Enumerator[Hash[String, untyped], untyped]
31
+ end
32
+
33
+ class MetadataVectors
34
+ def initialize: (untyped config) -> void
35
+ # Rows carry no score; at most 50 rows come back whatever k is.
36
+ def nearest: (?Hash[String | Symbol, untyped]? input, ?surface: String, ?column: String | Symbol, ?embedding: Array[Numeric], ?k: Integer?, ?metric: (String | Symbol)?, ?where: Array[Hash[String | Symbol, untyped]]?) -> Metadata::Page
37
+ end
38
+
39
+ class MetadataIndex
40
+ def initialize: (untyped config) -> void
41
+ # data is { "collection" => String, "columns" => [{ "column" => String, "indexed" => bool }] }.
42
+ def get: (String | Symbol collection) -> Envelope
43
+ def declare: (String | Symbol collection, Array[Hash[String | Symbol, untyped]] columns) -> Envelope
44
+ end
45
+
46
+ class Realtime
47
+ # The reconnecting reader behind subscribe; initial_query applies to the first connection only.
48
+ def feed: (String route, Hash[String, untyped] q, Hash[String, untyped]? initial_query, (^(Hash[String, untyped]) -> untyped)? on_resync) -> Enumerator[Hash[String, untyped], untyped]
49
+ end
50
+
51
+ class K9oClient
52
+ attr_reader metadata: Metadata
53
+ end
54
+ end
data/sig/k9o/moat.rbs ADDED
@@ -0,0 +1,29 @@
1
+ # RBS signatures for Moat, the local guard around a model call.
2
+
3
+ module K9o
4
+ module Moat
5
+ REASONS: Array[Symbol]
6
+
7
+ # Raised when Moat refuses input or output. `reason` is :role_marker, :input_schema, :output_schema or :pii.
8
+ class Refusal < StandardError
9
+ attr_reader reason: Symbol
10
+ attr_reader detail: String
11
+ def initialize: (Symbol reason, String detail) -> void
12
+ end
13
+
14
+ class ConfigError < ArgumentError
15
+ end
16
+
17
+ class SchemaError < ConfigError
18
+ end
19
+
20
+ def self.new: (prompt: String, ?input_schema: Hash[String | Symbol, untyped]?, ?output_schema: Hash[String | Symbol, untyped]?, ?filters: Hash[Symbol | String, ^(String) -> untyped]?) -> Guard
21
+
22
+ class Guard
23
+ def initialize: (prompt: String, ?input_schema: Hash[String | Symbol, untyped]?, ?output_schema: Hash[String | Symbol, untyped]?, ?filters: Hash[Symbol | String, ^(String) -> untyped]?) -> void
24
+ def messages: (untyped untrusted_input) -> Array[{ role: String, content: String }]
25
+ def check_output: (untyped model_output) -> untyped
26
+ def prompt_sha256: () -> String
27
+ end
28
+ end
29
+ end
data/sig/k9o/query.rbs ADDED
@@ -0,0 +1,26 @@
1
+ # RBS signatures for `client.query`, `client.search` and the select builder's search methods.
2
+
3
+ module K9o
4
+ module Query
5
+ type value = String | Integer | Float | bool | nil
6
+
7
+ # Rewrites :name placeholders to $n; returns [sql, positional values].
8
+ def self.translate_named_params: (String sql, Hash[(String | Symbol), untyped] named) -> [String, Array[value]]
9
+ end
10
+
11
+ module QueryMethods
12
+ # An Array binds positionally to $1, $2, ...; a Hash binds :name placeholders. `data` is the array of rows.
13
+ def query: (String sql, ?(Array[untyped] | Hash[(String | Symbol), untyped])? params) -> Envelope
14
+
15
+ def search: (String collection, column: String, q: String, ?language: String?, ?type: String?, ?limit: Integer?, ?cursor: String?) -> Envelope
16
+ end
17
+
18
+ class K9oClient
19
+ include QueryMethods
20
+ end
21
+
22
+ class SelectBuilder
23
+ def text_search: (String column, String query, ?language: String, ?type: (String | Symbol)) -> self
24
+ def vector_search: (String column, Array[Numeric] embedding, ?metric: (String | Symbol), ?limit: Integer?) -> self
25
+ end
26
+ end
@@ -0,0 +1,59 @@
1
+ # RBS signatures for Rampart classification and receipt verification.
2
+
3
+ module K9o
4
+ module Jcs
5
+ class Error < ArgumentError
6
+ attr_reader kind: Symbol
7
+ def initialize: (String message, ?Symbol kind) -> void
8
+ end
9
+
10
+ def self.canonicalize: (untyped value) -> String
11
+ def self.canonical_bytes: (untyped value) -> String
12
+ end
13
+
14
+ module Ed25519
15
+ def self.verify: (String public_key, String message, String signature) -> bool
16
+ def self.native?: () -> bool
17
+ end
18
+
19
+ class Rampart
20
+ RECEIPT_TYP: String
21
+ CLASSIFICATIONS: Array[String]
22
+ DEFAULT_CLOCK_SKEW: Integer
23
+ REASONS: Array[Symbol]
24
+
25
+ # Raised by verify_receipt. `reason` is one of REASONS: :malformed, :key_unknown, :alg, :typ, :signature,
26
+ # :issuer, :project_unknown, :project, :expired, :not_yet_valid, :input_hash.
27
+ class ReceiptRefusal < KError
28
+ attr_reader reason: Symbol
29
+ def initialize: (Symbol reason, String detail) -> void
30
+ end
31
+
32
+ class Verdict < Struct[untyped]
33
+ attr_accessor classification: String
34
+ attr_accessor risk_bp: Integer
35
+ attr_accessor confidence_bp: Integer
36
+ attr_accessor categories: Array[String]
37
+ attr_accessor project_id: String
38
+ attr_accessor calibration_version: String
39
+ attr_accessor input_sha256: String
40
+ attr_accessor issued_at: Time
41
+ attr_accessor expires_at: Time
42
+ attr_accessor kid: String
43
+ attr_accessor windows: Integer?
44
+ end
45
+
46
+ def initialize: (untyped config) -> void
47
+ # data: { "classification", "riskScore", "confidence", "categories", "calibrationVersion", "classificationReceipt", "projectId" }.
48
+ def classify: (Hash[String | Symbol, untyped] input, ?label: String?) -> Envelope
49
+ # data: { "keys" => [ { "kid", "kty", "crv", "x", ... } ], "issuer" => "<issuer>/rampart" }. Public: no credential is sent.
50
+ def jwks: () -> Envelope
51
+ # `receipt` is the Envelope classify returned (it carries the receipt and its projectId) or the bare receipt String.
52
+ def verify_receipt: ((Envelope | String) receipt, Hash[String | Symbol, untyped] input, ?key_set: (Hash[untyped, untyped] | Array[Hash[untyped, untyped]])?, ?issuer: String?, ?project_id: String?, ?clock_skew: Numeric, ?clock: (Time | Numeric | ^() -> (Time | Numeric))?) -> Verdict
53
+ def input_digest: (Hash[String | Symbol, untyped] input) -> String
54
+ end
55
+
56
+ class K9oClient
57
+ attr_reader rampart: Rampart
58
+ end
59
+ end
@@ -0,0 +1,34 @@
1
+ # RBS signatures for `client.realtime`.
2
+
3
+ module K9o
4
+ class Realtime
5
+ DEFAULT_RETRY_MS: Integer
6
+ SEEN_LIMIT: Integer
7
+
8
+ # Seconds without any bytes after which a connection is abandoned (default 45).
9
+ def self.idle_timeout: () -> Numeric
10
+ def self.idle_timeout=: (Numeric) -> Numeric
11
+ # Longest reconnect delay in seconds (default 30).
12
+ def self.max_backoff: () -> Numeric
13
+ def self.max_backoff=: (Numeric) -> Numeric
14
+ def self.sleeper: () -> ^(Numeric) -> void
15
+ def self.sleeper=: (^(Numeric) -> void) -> ^(Numeric) -> void
16
+
17
+ def initialize: (untyped config) -> void
18
+ # Yields { "topic", "eventType", "payload", "occurredAt", "eventId" }. Reconnects with `Last-Event-ID`, drops
19
+ # events already delivered, and calls `on_resync` with { "reason", "action" } when the position is lost.
20
+ def subscribe: (String topic, ?filter: Hash[untyped, untyped]?, ?on_resync: (^(Hash[String, untyped]) -> untyped)?) -> Enumerator[Hash[String, untyped], untyped]
21
+
22
+ # POST /@<slug>/realtime/replay: data is { "events", "nextCursor", "hasMore" } plus "resync" when the topic has no stored history.
23
+ def replay: (String topic, ?from_sequence: Integer?, ?until_sequence: Integer?, ?limit: Integer?) -> Envelope
24
+
25
+ module Topic
26
+ def self.collection: (String collection) -> String
27
+ def self.workflow_runs: () -> String
28
+ def self.query_executed: (String query_id) -> String
29
+ def self.dashboard_refresh: (String dashboard_id) -> String
30
+ def self.function_invocations: (String function_id) -> String
31
+ def self.audit_org: (String event_family) -> String
32
+ end
33
+ end
34
+ end
data/sig/k9o/region.rbs CHANGED
@@ -2,9 +2,6 @@
2
2
 
3
3
  module K9o
4
4
  module Region
5
- REGION_FREE_ORG_HOST: Regexp
6
- REGION_CODE: Regexp
7
-
8
5
  # The regional origin `location` may name for `host`, or nil.
9
6
  def self.origin_from_location: (String host, String location, String base) -> String?
10
7
  # The origin requests go to: cached regional origin, else the configured base URL. Never raises.
@@ -17,3 +14,17 @@ module K9o
17
14
  attr_accessor regional_origin: String?
18
15
  end
19
16
  end
17
+
18
+ module K9o
19
+ module UrlGrammar
20
+ # The org, family, region and apex of a gateway host (`acme.api-de01.corp.internal`), or nil for any other shape.
21
+ class ApiHost < Struct[untyped]
22
+ attr_reader org_slug: String?
23
+ attr_reader family: String
24
+ attr_reader region: String?
25
+ attr_reader apex: String
26
+ end
27
+
28
+ def self.parse_api_host: (String host) -> ApiHost?
29
+ end
30
+ end
@@ -0,0 +1,64 @@
1
+ # RBS signatures for write approval, event triggers, schedules, vectors and end users.
2
+
3
+ module K9o
4
+ # True when a single-record write sent with `require_approval` was queued (HTTP 202) instead of applied.
5
+ def self.queued_write?: (untyped result) -> bool
6
+
7
+ class FunctionTriggers
8
+ def initialize: (untyped config) -> void
9
+ def list: (String name) -> Envelope
10
+ def create: (String name, collection: String, events: Array[String | Symbol], ?filter: Hash[untyped, untyped]?, ?enabled: bool?, ?log_ok_invocations: bool?) -> Envelope
11
+ # Fields: events, filter (nil clears it), enabled, log_ok_invocations. At least one.
12
+ def update: (String name, String trigger_id, **untyped fields) -> Envelope
13
+ # data is nil (HTTP 204).
14
+ def delete: (String name, String trigger_id) -> Envelope
15
+ end
16
+
17
+ # Key custody (read-only). `data` holds mode, attached, provider, lastJob and hsm (nil when absent).
18
+ class Custody
19
+ def initialize: (untyped config) -> void
20
+ def status: () -> Envelope
21
+ end
22
+
23
+ class Schedules
24
+ def initialize: (untyped config) -> void
25
+ def list: (?status: (String | Symbol)?, ?function_name: String?, ?limit: Integer?, ?cursor: String?) -> Envelope
26
+ def get: (String id) -> Envelope
27
+ def create: (function_name: String, schedule_expression: String, ?schedule_timezone: String?, ?catchup_policy: (String | Symbol)?, ?collection: String?, ?enabled: bool?, ?log_ok_invocations: bool?) -> Envelope
28
+ # Fields: schedule_expression, schedule_timezone, catchup_policy, status, enabled, log_ok_invocations. At least one.
29
+ def update: (String id, **untyped fields) -> Envelope
30
+ # data is nil (HTTP 204).
31
+ def delete: (String id) -> Envelope
32
+ def runs: (String id, ?limit: Integer?, ?cursor: String?) -> Envelope
33
+ def run_now: (String id) -> Envelope
34
+ end
35
+
36
+ class Vectors
37
+ def initialize: (untyped config) -> void
38
+ # data is { "results" => [...], "collection" => String }; each result has id, score, _source, contentHash, text (nil when absent), metadata, model (nil) and chunk (nil).
39
+ def nearest: (String collection, Array[Numeric] query_vector, ?top_k: Integer?, ?min_score: Numeric?, ?metric: (String | Symbol)?, ?filters: Hash[String | Symbol, String | Numeric | bool]?) -> Envelope
40
+ # rows: Hashes with vector and _source; optional id, contentHash, text, metadata, subjectIds. A single row Hash is accepted. data is { "upserted" => Integer, "collection" => String }.
41
+ def upsert: (String collection, ?(Array[Hash[String | Symbol, untyped]] | Hash[String | Symbol, untyped])? rows, **untyped row) -> Envelope
42
+ end
43
+
44
+ class EndUsers
45
+ def initialize: (untyped config) -> void
46
+ attr_reader role_grants: EndUserRoleGrants
47
+ def list: (?status: (String | Symbol)?, ?q: String?, ?limit: Integer?, ?cursor: String?) -> Envelope
48
+ def get: (String id) -> Envelope
49
+ end
50
+
51
+ class EndUserRoleGrants
52
+ def initialize: (untyped config) -> void
53
+ # data is the Array of grants.
54
+ def list: (?end_user_id: String?) -> Envelope
55
+ # data is the grant.
56
+ def grant: (end_user_id: String, role: String) -> Envelope
57
+ # data is { "revoked" => bool, "revokedAt" => String? }.
58
+ def revoke: (String grant_id) -> Envelope
59
+ end
60
+
61
+ class K9oClient
62
+ attr_reader vectors: Vectors
63
+ end
64
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: k9o
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.5.0
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - Kilimanjaro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-10-25 00:00:00.000000000 Z
11
+ date: 2026-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -41,44 +41,73 @@ files:
41
41
  - lib/k9o/_ffi/kibo_kms_rest_ffi.rb
42
42
  - lib/k9o/_ffi/libkibo_kms_rest_ffi.so
43
43
  - lib/k9o/ai.rb
44
+ - lib/k9o/analytics.rb
45
+ - lib/k9o/approvals.rb
44
46
  - lib/k9o/audit.rb
45
47
  - lib/k9o/barbican.rb
46
48
  - lib/k9o/client.rb
47
49
  - lib/k9o/compute.rb
50
+ - lib/k9o/crypto.rb
51
+ - lib/k9o/custody.rb
48
52
  - lib/k9o/data.rb
53
+ - lib/k9o/ed25519.rb
54
+ - lib/k9o/end_users.rb
49
55
  - lib/k9o/envelope.rb
50
56
  - lib/k9o/functions.rb
51
57
  - lib/k9o/gate.rb
52
58
  - lib/k9o/http_transport.rb
59
+ - lib/k9o/jcs.rb
53
60
  - lib/k9o/kerror.rb
61
+ - lib/k9o/keys.rb
54
62
  - lib/k9o/kibo.rb
63
+ - lib/k9o/kibo_client_core.rb
64
+ - lib/k9o/kibo_ffi_core.rb
65
+ - lib/k9o/locate.rb
55
66
  - lib/k9o/me.rb
67
+ - lib/k9o/metadata.rb
56
68
  - lib/k9o/migrations.rb
69
+ - lib/k9o/moat.rb
57
70
  - lib/k9o/multipart.rb
58
71
  - lib/k9o/org.rb
59
72
  - lib/k9o/orgs.rb
60
73
  - lib/k9o/policies.rb
61
74
  - lib/k9o/projects.rb
75
+ - lib/k9o/query.rb
76
+ - lib/k9o/rampart.rb
62
77
  - lib/k9o/realtime.rb
63
78
  - lib/k9o/region.rb
79
+ - lib/k9o/schedules.rb
80
+ - lib/k9o/schema.rb
64
81
  - lib/k9o/storage.rb
82
+ - lib/k9o/streams.rb
65
83
  - lib/k9o/studio.rb
66
84
  - lib/k9o/url_grammar.rb
67
85
  - lib/k9o/vault.rb
86
+ - lib/k9o/vectors.rb
68
87
  - lib/k9o/version.rb
69
88
  - sig/k9o/ai.rbs
89
+ - sig/k9o/approvals.rbs
90
+ - sig/k9o/datasets.rbs
70
91
  - sig/k9o/gate.rbs
92
+ - sig/k9o/kerror.rbs
93
+ - sig/k9o/kibo_client_core.rbs
94
+ - sig/k9o/metadata.rbs
71
95
  - sig/k9o/migrations.rbs
96
+ - sig/k9o/moat.rbs
97
+ - sig/k9o/query.rbs
98
+ - sig/k9o/rampart.rbs
99
+ - sig/k9o/realtime.rbs
72
100
  - sig/k9o/region.rbs
73
101
  - sig/k9o/storage.rbs
102
+ - sig/k9o/workload.rbs
74
103
  homepage: https://kilimanjaro.dev
75
104
  licenses:
76
105
  - Apache-2.0
77
106
  metadata:
78
107
  homepage_uri: https://kilimanjaro.dev
79
108
  documentation_uri: https://docs.kilimanjaro.dev
80
- source_code_uri: https://github.com/k9o-dev/sdk-ruby
81
- changelog_uri: https://github.com/k9o-dev/sdk-ruby/blob/main/CHANGELOG.md
109
+ source_code_uri: https://github.com/k9o-platform/sdk-ruby
110
+ changelog_uri: https://github.com/k9o-platform/sdk-ruby/blob/main/CHANGELOG.md
82
111
  post_install_message:
83
112
  rdoc_options: []
84
113
  require_paths: