@consciousclouds/admin-sdk 0.1.0
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/LICENSE +171 -0
- package/dist/index.d.ts +292 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +127 -0
- package/dist/index.js.map +1 -0
- package/package.json +38 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship made available under
|
|
36
|
+
the License, as indicated by a copyright notice that is included in
|
|
37
|
+
or attached to the work (an example is provided in the Appendix below).
|
|
38
|
+
|
|
39
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
40
|
+
form, that is based on (or derived from) the Work and for which the
|
|
41
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
42
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
43
|
+
of this License, Derivative Works shall not include works that remain
|
|
44
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
45
|
+
the Work and Derivative Works thereof.
|
|
46
|
+
|
|
47
|
+
"Contribution" shall mean, as submitted to the Licensor for inclusion
|
|
48
|
+
in the Work by the copyright owner or by an individual or Legal Entity
|
|
49
|
+
authorized to submit on behalf of the copyright owner. For the purposes
|
|
50
|
+
of this definition, "submitted" means any form of electronic, verbal,
|
|
51
|
+
or written communication sent to the Licensor or its representatives,
|
|
52
|
+
including but not limited to communication on electronic mailing lists,
|
|
53
|
+
source code control systems, and issue tracking systems that are managed
|
|
54
|
+
by, or on behalf of, the Licensor for the purpose of discussing and
|
|
55
|
+
improving the Work, but excluding communication that is conspicuously
|
|
56
|
+
marked or designated in writing by the copyright owner as "Not a
|
|
57
|
+
Contribution."
|
|
58
|
+
|
|
59
|
+
"Contributor" shall mean Licensor and any Legal Entity on behalf of
|
|
60
|
+
whom a Contribution has been received by the Licensor and included
|
|
61
|
+
within the Work.
|
|
62
|
+
|
|
63
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
64
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
65
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
66
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
67
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
68
|
+
Work and such Derivative Works in Source or Object form.
|
|
69
|
+
|
|
70
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
71
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
72
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
73
|
+
(except as stated in this section) patent license to make, have made,
|
|
74
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
75
|
+
where such license applies only to those patent claims licensable
|
|
76
|
+
by such Contributor that are necessarily infringed by their
|
|
77
|
+
Contribution(s) alone or by the combination of their Contribution(s)
|
|
78
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
79
|
+
institute patent litigation against any entity (including a cross-claim
|
|
80
|
+
or counterclaim in a lawsuit) alleging that the Work or any
|
|
81
|
+
Contribution embodied within the Work constitutes direct or contributory
|
|
82
|
+
patent infringement, then any patent licenses granted to You under
|
|
83
|
+
this License for that Work shall terminate as of the date such
|
|
84
|
+
litigation is filed.
|
|
85
|
+
|
|
86
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
87
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
88
|
+
modifications, and in Source or Object form, provided that You
|
|
89
|
+
meet the following conditions:
|
|
90
|
+
|
|
91
|
+
(a) You must give any other recipients of the Work or Derivative Works
|
|
92
|
+
a copy of this License; and
|
|
93
|
+
|
|
94
|
+
(b) You must cause any modified files to carry prominent notices
|
|
95
|
+
stating that You changed the files; and
|
|
96
|
+
|
|
97
|
+
(c) You must retain, in the Source form of any Derivative Works that
|
|
98
|
+
You distribute, all copyright, patent, trademark, and attribution
|
|
99
|
+
notices from the Source form of the Work, excluding those notices
|
|
100
|
+
that do not pertain to any part of the Derivative Works; and
|
|
101
|
+
|
|
102
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
103
|
+
distribution, You must include a readable copy of the attribution
|
|
104
|
+
notices contained within such NOTICE file, in at least one of the
|
|
105
|
+
following places: within a NOTICE text provided as part of the
|
|
106
|
+
Derivative Works; within the Source form or documentation, if
|
|
107
|
+
provided along with the Derivative Works; or, within a display
|
|
108
|
+
generated by the Derivative Works, if and wherever such third-party
|
|
109
|
+
notices normally appear. The contents of the NOTICE file are for
|
|
110
|
+
informational purposes only and do not modify the License. You may
|
|
111
|
+
add Your own attribution notices within Derivative Works that You
|
|
112
|
+
distribute, alongside or in addition to the NOTICE text from the
|
|
113
|
+
Work, provided that such additional attribution notices cannot be
|
|
114
|
+
construed as modifying the License.
|
|
115
|
+
|
|
116
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
117
|
+
any Contribution intentionally submitted for inclusion in the Work by
|
|
118
|
+
You to the Licensor shall be under the terms and conditions of this
|
|
119
|
+
License, without any additional terms or conditions.
|
|
120
|
+
|
|
121
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
122
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
123
|
+
except as required for reasonable and customary use in describing the
|
|
124
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
125
|
+
|
|
126
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
127
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
128
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
129
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
130
|
+
implied, including, without limitation, any conditions of TITLE,
|
|
131
|
+
MERCHANTIBILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely
|
|
132
|
+
responsible for determining the appropriateness of using or
|
|
133
|
+
redistributing the Work and assume any risks associated with Your
|
|
134
|
+
exercise of permissions under this License.
|
|
135
|
+
|
|
136
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
137
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
138
|
+
unless required by applicable law (such as deliberate and grossly
|
|
139
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
140
|
+
liable to You for damages, including any direct, indirect, special,
|
|
141
|
+
incidental, or exemplary damages of any character arising as a result
|
|
142
|
+
of this License or out of the use or inability to use the Work
|
|
143
|
+
(including but not limited to damages for loss of goodwill, work
|
|
144
|
+
stoppage, computer failure or malfunction, or all other commercial
|
|
145
|
+
damages or losses), even if such Contributor has been advised of the
|
|
146
|
+
possibility of such damages.
|
|
147
|
+
|
|
148
|
+
9. Accepting Warranty or Liability. While redistributing the Work or
|
|
149
|
+
Derivative Works thereof, You may choose to offer, and charge a fee
|
|
150
|
+
for, acceptance of support, warranty, indemnity, or other liability
|
|
151
|
+
obligations and/or rights consistent with this License. However, in
|
|
152
|
+
accepting such obligations, You may offer such obligations only on
|
|
153
|
+
Your own behalf and on Your sole responsibility, not on behalf of any
|
|
154
|
+
other Contributor, and only if You agree to indemnify, defend, and
|
|
155
|
+
hold each Contributor harmless for any liability incurred by, or
|
|
156
|
+
claims asserted against, such Contributor by reason of your accepting
|
|
157
|
+
any such warranty or additional liability.
|
|
158
|
+
|
|
159
|
+
Copyright 2024 Conscious Clouds
|
|
160
|
+
|
|
161
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
162
|
+
you may not use this file except in compliance with the License.
|
|
163
|
+
You may obtain a copy of the License at
|
|
164
|
+
|
|
165
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
166
|
+
|
|
167
|
+
Unless required by applicable law or agreed to in writing, software
|
|
168
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
169
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
170
|
+
See the License for the specific language governing permissions and
|
|
171
|
+
limitations under the License.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ConsciousClouds Universal Admin SDK — the governance reads behind a Project's AI organization.
|
|
3
|
+
*
|
|
4
|
+
* THE ADOPTION CHAIN THIS EXISTS TO CLOSE:
|
|
5
|
+
* consumer → this published SDK → Operator Gateway → target-bound Universal projection.
|
|
6
|
+
*
|
|
7
|
+
* It is the same seam every product uses; there is no CCU-Admin-only path and no privileged variant. A consumer
|
|
8
|
+
* that needs a governance read it does not find here extends THIS package for everyone, rather than hand-rolling
|
|
9
|
+
* a fetch — that is the whole point of the package existing.
|
|
10
|
+
*
|
|
11
|
+
* TYPES + THIN HTTP WRAPPERS ONLY. No policy logic lives here. Every authorization decision belongs to the
|
|
12
|
+
* Operator Gateway and the Control Plane behind it: the SDK never mints identity, never caches a decision, and
|
|
13
|
+
* never infers one. A caller supplies its own auth headers and the gateway decides.
|
|
14
|
+
*
|
|
15
|
+
* WHAT THE TYPES REFUSE TO FLATTEN, because the platform's own truth is not flat:
|
|
16
|
+
*
|
|
17
|
+
* - `enforcement` on every Operative Type. The governed record declares more than the runtime consumes, so a
|
|
18
|
+
* type that merged its fields would let a renderer show validated-but-unconsumed configuration as governance
|
|
19
|
+
* in force. `enforced` and `declared` are separate lists, and `serving_envelope_source` names which authority
|
|
20
|
+
* actually supplies the envelope that bounds a run — the record declares one and the enrollment declaration
|
|
21
|
+
* is the one resolved at dispatch. Two truths, both reported.
|
|
22
|
+
* - `operation_breadth` as {declared, effective, enforced}. An undeclared ceiling is stored as 0 and fails
|
|
23
|
+
* closed to 1, so a single number would read as "no Operatives permitted" — the opposite of the truth.
|
|
24
|
+
* - the authority envelope's `scope` and `excluded_terms`. What this reads is the Personality/consent HALF of
|
|
25
|
+
* an Operation's authority; the re-proven initiating actor and the immutable Operation bounds are elsewhere.
|
|
26
|
+
* A type called "the authority envelope" with seven flat arrays would describe an authority no commission
|
|
27
|
+
* actually uses.
|
|
28
|
+
* - `evaluated_at` + `evaluation: 'live_uncached_at_read'`. The envelope is a snapshot of a computation, never
|
|
29
|
+
* stored state, and the type says so rather than trusting a renderer to remember.
|
|
30
|
+
*/
|
|
31
|
+
export interface AdminClientOptions {
|
|
32
|
+
/** The Operator Gateway base URL. The SDK never hard-codes it. */
|
|
33
|
+
baseUrl: string;
|
|
34
|
+
/** Caller-supplied auth headers (typically Authorization). The SDK never mints identity. */
|
|
35
|
+
headers?: () => Record<string, string> | Promise<Record<string, string>>;
|
|
36
|
+
/** Optional fetch override (tests / non-browser runtimes). */
|
|
37
|
+
fetch?: typeof fetch;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* A structured non-2xx error carrying the request coordinates and nothing else.
|
|
41
|
+
*
|
|
42
|
+
* THE RAW UPSTREAM BODY IS NOT RETAINED — not on `.message`, not on any field. An upstream 500 can carry a stack
|
|
43
|
+
* trace, a DSN, or a token, and an error object is the single most widely-serialized value in a program: loggers
|
|
44
|
+
* serialize own properties, crash reporters ship the whole object, `JSON.stringify(err)` is idiomatic. Keeping
|
|
45
|
+
* the body "for a caller that explicitly needs it" makes every one of those paths a leak.
|
|
46
|
+
*/
|
|
47
|
+
export declare class AdminError extends Error {
|
|
48
|
+
readonly status: number;
|
|
49
|
+
readonly method: string;
|
|
50
|
+
readonly path: string;
|
|
51
|
+
constructor(method: string, path: string, status: number);
|
|
52
|
+
}
|
|
53
|
+
export interface StorageBindingRead {
|
|
54
|
+
declared: boolean;
|
|
55
|
+
status?: string;
|
|
56
|
+
}
|
|
57
|
+
export interface ObserveTopicGrant {
|
|
58
|
+
project: string;
|
|
59
|
+
family: string;
|
|
60
|
+
}
|
|
61
|
+
export interface ExecutionEnvelope {
|
|
62
|
+
cpu: number;
|
|
63
|
+
memory_mib: number;
|
|
64
|
+
filesystem_mib: number;
|
|
65
|
+
output_bytes_max: number;
|
|
66
|
+
network_egress_allow: string[];
|
|
67
|
+
timeout_ms: number;
|
|
68
|
+
lease_ttl_ms: number;
|
|
69
|
+
teardown_slack_ms: number;
|
|
70
|
+
}
|
|
71
|
+
export interface DelegationGrant {
|
|
72
|
+
composer_personality: string;
|
|
73
|
+
target_personality: string;
|
|
74
|
+
approver?: string;
|
|
75
|
+
is_execution_grant: boolean;
|
|
76
|
+
execution_provider?: string;
|
|
77
|
+
execution_envelope: ExecutionEnvelope | null;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* An Operative declared in a product's enrollment — the AUTHORING half, which is not the same thing as the
|
|
81
|
+
* governed record's resolution or as what any gate enforces.
|
|
82
|
+
*
|
|
83
|
+
* There is deliberately no `preferences` field: it is opaque, product-authored, schema-free JSON, and the
|
|
84
|
+
* platform-scoped read that feeds this does not serialize it.
|
|
85
|
+
*/
|
|
86
|
+
export interface OperativeDeclaration {
|
|
87
|
+
id: string;
|
|
88
|
+
display_name: string;
|
|
89
|
+
role: string;
|
|
90
|
+
execution_provider?: string;
|
|
91
|
+
execution_envelope: ExecutionEnvelope | null;
|
|
92
|
+
required_capabilities: string[];
|
|
93
|
+
allowed_commissioners: string[];
|
|
94
|
+
sandbox_requirement: string;
|
|
95
|
+
supports_clustering: boolean;
|
|
96
|
+
escalation: string;
|
|
97
|
+
description?: string;
|
|
98
|
+
default_model_policy_ref?: string;
|
|
99
|
+
max_wall_clock_ms: number;
|
|
100
|
+
max_iterations: number;
|
|
101
|
+
artifact_contract: string[];
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* The breadth ceiling, told honestly. `declared` is what the product authored (0 = undeclared), `effective` is
|
|
105
|
+
* what the runtime computes (undeclared fails closed to 1), and `enforced` records that this bound really is
|
|
106
|
+
* applied — atomically, at the run store's admission boundary.
|
|
107
|
+
*/
|
|
108
|
+
export interface OperationBreadth {
|
|
109
|
+
declared: number;
|
|
110
|
+
effective: number;
|
|
111
|
+
enforced: boolean;
|
|
112
|
+
}
|
|
113
|
+
export interface CapabilityRoute {
|
|
114
|
+
capability_id: string;
|
|
115
|
+
route_key: string;
|
|
116
|
+
endpoint_present: boolean;
|
|
117
|
+
}
|
|
118
|
+
/** A Project's enrollment record: its governed AI configuration, references only — never a secret. */
|
|
119
|
+
export interface EnrollmentDetail {
|
|
120
|
+
product_id: string;
|
|
121
|
+
status: string;
|
|
122
|
+
s2s_trust_mode: string;
|
|
123
|
+
issuer?: string;
|
|
124
|
+
jwks_uri?: string;
|
|
125
|
+
audiences: string[];
|
|
126
|
+
personality_grants: string[];
|
|
127
|
+
capability_grants: CapabilityRoute[];
|
|
128
|
+
knowledge_namespace_grants: string[];
|
|
129
|
+
cross_project_grants: string[];
|
|
130
|
+
service_endpoint_keys: string[];
|
|
131
|
+
storage_bindings: Record<string, StorageBindingRead>;
|
|
132
|
+
owner?: string;
|
|
133
|
+
allowed_origins: string[];
|
|
134
|
+
graph_scope_grants: string[];
|
|
135
|
+
memory_scope_grants: string[];
|
|
136
|
+
observe_topic_grants: ObserveTopicGrant[];
|
|
137
|
+
delegation_grants: DelegationGrant[];
|
|
138
|
+
operatives: OperativeDeclaration[];
|
|
139
|
+
/** RETIRED by owner ruling and required to be empty; carried only so a stale record refuses loudly. */
|
|
140
|
+
operative_roles: string[];
|
|
141
|
+
/** Capability id → service_endpoints KEY. Never a URL. */
|
|
142
|
+
capability_routes: Record<string, string>;
|
|
143
|
+
operation_breadth: OperationBreadth;
|
|
144
|
+
}
|
|
145
|
+
export interface PersonalitySummary {
|
|
146
|
+
id: string;
|
|
147
|
+
name?: string;
|
|
148
|
+
classification?: string;
|
|
149
|
+
tier?: string;
|
|
150
|
+
business_package?: string;
|
|
151
|
+
capabilities?: string[];
|
|
152
|
+
allowed_tools?: string[];
|
|
153
|
+
allowed_canvases?: string[];
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* A Personality's EFFECTIVE AUTHORITY, computed at read time.
|
|
157
|
+
*
|
|
158
|
+
* This is not stored state and the type refuses to imply otherwise. `evaluated_at` is a computation timestamp,
|
|
159
|
+
* `evaluation` records that the computation is live and uncached, and `scope` + `excluded_terms` say plainly
|
|
160
|
+
* that this is the Personality/consent half — the re-proven initiating actor and the immutable Operation bounds
|
|
161
|
+
* are separate terms that a commission applies elsewhere.
|
|
162
|
+
*/
|
|
163
|
+
export interface AuthorityEnvelope {
|
|
164
|
+
product_id: string;
|
|
165
|
+
personality_id: string;
|
|
166
|
+
evaluated_at: string;
|
|
167
|
+
evaluation: 'live_uncached_at_read';
|
|
168
|
+
scope: 'personality_consent_half';
|
|
169
|
+
excluded_terms: string[];
|
|
170
|
+
mode: string;
|
|
171
|
+
/** Empty when the envelope resolved; otherwise the reason it refuses, which is an answer, not an error. */
|
|
172
|
+
refusal: string;
|
|
173
|
+
dimensions: {
|
|
174
|
+
capabilities: string[];
|
|
175
|
+
allowed_tools: string[];
|
|
176
|
+
allowed_canvases: string[];
|
|
177
|
+
allowed_adapters: string[];
|
|
178
|
+
knowledge_namespaces: string[];
|
|
179
|
+
graph_scopes: string[];
|
|
180
|
+
memory_scopes: string[];
|
|
181
|
+
};
|
|
182
|
+
/** Which dimensions are effective authority ∩ the owning product's enrollment grants; the rest are authority alone. */
|
|
183
|
+
intersected_with_enrollment: string[];
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Which of a Type's fields actually bind.
|
|
187
|
+
*
|
|
188
|
+
* This is data rather than a rendering convention on purpose: a consumer asked to remember which fields are live
|
|
189
|
+
* will eventually forget, and the failure is silent — an operator reads a bound that does not bind.
|
|
190
|
+
*/
|
|
191
|
+
export interface OperativeTypeEnforcement {
|
|
192
|
+
/** Fields that reach a gate (census admission, typed commission admission, provider-bound sandbox). */
|
|
193
|
+
enforced: string[];
|
|
194
|
+
/** Fields validated at the write boundary, carried in the content digest, and consumed by nothing. */
|
|
195
|
+
declared: string[];
|
|
196
|
+
/** Which authority supplies the envelope that actually bounds a run. */
|
|
197
|
+
serving_envelope_source: string;
|
|
198
|
+
}
|
|
199
|
+
export interface OperativeTypeRecordState {
|
|
200
|
+
exists: boolean;
|
|
201
|
+
active_version: number;
|
|
202
|
+
has_active_version: boolean;
|
|
203
|
+
lifecycle: string;
|
|
204
|
+
state_reason?: string;
|
|
205
|
+
updated_by?: string;
|
|
206
|
+
updated_at?: string | null;
|
|
207
|
+
}
|
|
208
|
+
export interface OperativeTypeGoverned {
|
|
209
|
+
resolvable: boolean;
|
|
210
|
+
refusal_reason?: string;
|
|
211
|
+
version?: number;
|
|
212
|
+
role?: string;
|
|
213
|
+
required_capabilities: string[];
|
|
214
|
+
allowed_commissioners: string[];
|
|
215
|
+
sandbox_requirement?: string;
|
|
216
|
+
supports_clustering: boolean;
|
|
217
|
+
escalation?: string;
|
|
218
|
+
execution_provider?: string;
|
|
219
|
+
}
|
|
220
|
+
export interface OperativeTypeView {
|
|
221
|
+
product_id: string;
|
|
222
|
+
operative_id: string;
|
|
223
|
+
record: OperativeTypeRecordState;
|
|
224
|
+
governed: OperativeTypeGoverned;
|
|
225
|
+
enforcement: OperativeTypeEnforcement;
|
|
226
|
+
}
|
|
227
|
+
export interface OperativeTypeVersion {
|
|
228
|
+
version: number;
|
|
229
|
+
content_digest: string;
|
|
230
|
+
authored_by: string;
|
|
231
|
+
authored_at: string;
|
|
232
|
+
is_active: boolean;
|
|
233
|
+
role: string;
|
|
234
|
+
display_name: string;
|
|
235
|
+
}
|
|
236
|
+
export interface OperativeTypeDetail extends OperativeTypeView {
|
|
237
|
+
history: OperativeTypeVersion[];
|
|
238
|
+
as_of: string;
|
|
239
|
+
}
|
|
240
|
+
export interface OperativeTypeList {
|
|
241
|
+
operative_types: OperativeTypeView[];
|
|
242
|
+
as_of: string;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* AdminClient is a thin wrapper over the Operator Gateway's governance reads. Each method is one request; the
|
|
246
|
+
* gateway authorizes before proxying, and a non-2xx response throws.
|
|
247
|
+
*
|
|
248
|
+
* PRODUCT-OWNED READS CARRY BOTH HALVES OF THEIR IDENTITY on the path. A personality id or an operative id alone
|
|
249
|
+
* is ambiguous across products, and resolving one by picking a match would show a caller another product's
|
|
250
|
+
* governance — so the detail methods take (productId, id) and encode both.
|
|
251
|
+
*/
|
|
252
|
+
export declare class AdminClient {
|
|
253
|
+
private readonly baseUrl;
|
|
254
|
+
private readonly headersFn;
|
|
255
|
+
private readonly fetchImpl;
|
|
256
|
+
constructor(options: AdminClientOptions);
|
|
257
|
+
private request;
|
|
258
|
+
/** Every enrolled Project the operator may see. */
|
|
259
|
+
listEnrollments<T = unknown>(): Promise<T>;
|
|
260
|
+
/** One Project's enrollment record — its governed AI configuration. */
|
|
261
|
+
getEnrollment(productId: string): Promise<EnrollmentDetail>;
|
|
262
|
+
/** The Project portfolio read. */
|
|
263
|
+
listProjects<T = unknown>(): Promise<T>;
|
|
264
|
+
/** The personalities the conductor is actually serving (the file registry). */
|
|
265
|
+
listPersonalities<T = {
|
|
266
|
+
personalities: PersonalitySummary[];
|
|
267
|
+
}>(): Promise<T>;
|
|
268
|
+
/** The governed Personality Records inside the operator's read scope, optionally narrowed to one product. */
|
|
269
|
+
listPersonalityRecords<T = unknown>(productId?: string): Promise<T>;
|
|
270
|
+
/** One governed Personality Record and its version history. */
|
|
271
|
+
getPersonalityRecord<T = unknown>(productId: string, personalityId: string): Promise<T>;
|
|
272
|
+
/**
|
|
273
|
+
* A Personality's effective authority, computed live at read time.
|
|
274
|
+
*
|
|
275
|
+
* The result is a snapshot of a computation, not stored state, and it covers the Personality/consent half of
|
|
276
|
+
* an Operation's authority only — the returned object names both facts about itself.
|
|
277
|
+
*/
|
|
278
|
+
getAuthorityEnvelope(productId: string, personalityId: string): Promise<AuthorityEnvelope>;
|
|
279
|
+
/**
|
|
280
|
+
* A product's Operative Type roster.
|
|
281
|
+
*
|
|
282
|
+
* `productId` NARROWS within the operator's authorized scope and can never widen it. This is deliberately not
|
|
283
|
+
* a platform-wide library view: "this product's Operatives" and "every Operative Type known to Universal" are
|
|
284
|
+
* different reads with different breadth, and only the first is this method.
|
|
285
|
+
*/
|
|
286
|
+
listOperativeTypes(productId: string): Promise<OperativeTypeList>;
|
|
287
|
+
/** One Operative Type with its full version history. */
|
|
288
|
+
getOperativeType(productId: string, operativeId: string): Promise<OperativeTypeDetail>;
|
|
289
|
+
}
|
|
290
|
+
/** Convenience factory, mirroring the other ConsciousClouds SDK clients. */
|
|
291
|
+
export declare function createAdminClient(options: AdminClientOptions): AdminClient;
|
|
292
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6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GAA6G;IAC7G,sBAAsB,CAAC,CAAC,GAAG,OAAO,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAKnE,+DAA+D;IAC/D,oBAAoB,CAAC,CAAC,GAAG,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAOvF;;;;;OAKG;IACH,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAO1F;;;;;;OAMG;IACH,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAOjE,wDAAwD;IACxD,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAMvF;AAED,4EAA4E;AAC5E,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,GAAG,WAAW,CAE1E"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ConsciousClouds Universal Admin SDK — the governance reads behind a Project's AI organization.
|
|
3
|
+
*
|
|
4
|
+
* THE ADOPTION CHAIN THIS EXISTS TO CLOSE:
|
|
5
|
+
* consumer → this published SDK → Operator Gateway → target-bound Universal projection.
|
|
6
|
+
*
|
|
7
|
+
* It is the same seam every product uses; there is no CCU-Admin-only path and no privileged variant. A consumer
|
|
8
|
+
* that needs a governance read it does not find here extends THIS package for everyone, rather than hand-rolling
|
|
9
|
+
* a fetch — that is the whole point of the package existing.
|
|
10
|
+
*
|
|
11
|
+
* TYPES + THIN HTTP WRAPPERS ONLY. No policy logic lives here. Every authorization decision belongs to the
|
|
12
|
+
* Operator Gateway and the Control Plane behind it: the SDK never mints identity, never caches a decision, and
|
|
13
|
+
* never infers one. A caller supplies its own auth headers and the gateway decides.
|
|
14
|
+
*
|
|
15
|
+
* WHAT THE TYPES REFUSE TO FLATTEN, because the platform's own truth is not flat:
|
|
16
|
+
*
|
|
17
|
+
* - `enforcement` on every Operative Type. The governed record declares more than the runtime consumes, so a
|
|
18
|
+
* type that merged its fields would let a renderer show validated-but-unconsumed configuration as governance
|
|
19
|
+
* in force. `enforced` and `declared` are separate lists, and `serving_envelope_source` names which authority
|
|
20
|
+
* actually supplies the envelope that bounds a run — the record declares one and the enrollment declaration
|
|
21
|
+
* is the one resolved at dispatch. Two truths, both reported.
|
|
22
|
+
* - `operation_breadth` as {declared, effective, enforced}. An undeclared ceiling is stored as 0 and fails
|
|
23
|
+
* closed to 1, so a single number would read as "no Operatives permitted" — the opposite of the truth.
|
|
24
|
+
* - the authority envelope's `scope` and `excluded_terms`. What this reads is the Personality/consent HALF of
|
|
25
|
+
* an Operation's authority; the re-proven initiating actor and the immutable Operation bounds are elsewhere.
|
|
26
|
+
* A type called "the authority envelope" with seven flat arrays would describe an authority no commission
|
|
27
|
+
* actually uses.
|
|
28
|
+
* - `evaluated_at` + `evaluation: 'live_uncached_at_read'`. The envelope is a snapshot of a computation, never
|
|
29
|
+
* stored state, and the type says so rather than trusting a renderer to remember.
|
|
30
|
+
*/
|
|
31
|
+
/** Base path of the Operator Gateway's admin surface. The gateway is the only thing this SDK talks to. */
|
|
32
|
+
const BASE = '/api/v1/operator/admin';
|
|
33
|
+
/**
|
|
34
|
+
* A structured non-2xx error carrying the request coordinates and nothing else.
|
|
35
|
+
*
|
|
36
|
+
* THE RAW UPSTREAM BODY IS NOT RETAINED — not on `.message`, not on any field. An upstream 500 can carry a stack
|
|
37
|
+
* trace, a DSN, or a token, and an error object is the single most widely-serialized value in a program: loggers
|
|
38
|
+
* serialize own properties, crash reporters ship the whole object, `JSON.stringify(err)` is idiomatic. Keeping
|
|
39
|
+
* the body "for a caller that explicitly needs it" makes every one of those paths a leak.
|
|
40
|
+
*/
|
|
41
|
+
export class AdminError extends Error {
|
|
42
|
+
constructor(method, path, status) {
|
|
43
|
+
super(`admin-sdk: ${method} ${path} → ${status}`);
|
|
44
|
+
this.name = 'AdminError';
|
|
45
|
+
this.status = status;
|
|
46
|
+
this.method = method;
|
|
47
|
+
this.path = path;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
// ── The client ───────────────────────────────────────────────────────────────────────────────────
|
|
51
|
+
/**
|
|
52
|
+
* AdminClient is a thin wrapper over the Operator Gateway's governance reads. Each method is one request; the
|
|
53
|
+
* gateway authorizes before proxying, and a non-2xx response throws.
|
|
54
|
+
*
|
|
55
|
+
* PRODUCT-OWNED READS CARRY BOTH HALVES OF THEIR IDENTITY on the path. A personality id or an operative id alone
|
|
56
|
+
* is ambiguous across products, and resolving one by picking a match would show a caller another product's
|
|
57
|
+
* governance — so the detail methods take (productId, id) and encode both.
|
|
58
|
+
*/
|
|
59
|
+
export class AdminClient {
|
|
60
|
+
constructor(options) {
|
|
61
|
+
this.baseUrl = options.baseUrl.replace(/\/$/, '');
|
|
62
|
+
this.headersFn = options.headers ?? (() => ({}));
|
|
63
|
+
this.fetchImpl = options.fetch ?? fetch;
|
|
64
|
+
}
|
|
65
|
+
async request(method, path) {
|
|
66
|
+
const headers = { 'Content-Type': 'application/json', ...(await this.headersFn()) };
|
|
67
|
+
const resp = await this.fetchImpl(`${this.baseUrl}${path}`, { method, headers });
|
|
68
|
+
if (!resp.ok) {
|
|
69
|
+
// The body is deliberately not read: see AdminError.
|
|
70
|
+
throw new AdminError(method, path, resp.status);
|
|
71
|
+
}
|
|
72
|
+
return (await resp.json());
|
|
73
|
+
}
|
|
74
|
+
/** Every enrolled Project the operator may see. */
|
|
75
|
+
listEnrollments() {
|
|
76
|
+
return this.request('GET', `${BASE}/enrollments`);
|
|
77
|
+
}
|
|
78
|
+
/** One Project's enrollment record — its governed AI configuration. */
|
|
79
|
+
getEnrollment(productId) {
|
|
80
|
+
return this.request('GET', `${BASE}/enrollments/${encodeURIComponent(productId)}`);
|
|
81
|
+
}
|
|
82
|
+
/** The Project portfolio read. */
|
|
83
|
+
listProjects() {
|
|
84
|
+
return this.request('GET', `${BASE}/projects`);
|
|
85
|
+
}
|
|
86
|
+
/** The personalities the conductor is actually serving (the file registry). */
|
|
87
|
+
listPersonalities() {
|
|
88
|
+
return this.request('GET', `${BASE}/personalities`);
|
|
89
|
+
}
|
|
90
|
+
/** The governed Personality Records inside the operator's read scope, optionally narrowed to one product. */
|
|
91
|
+
listPersonalityRecords(productId) {
|
|
92
|
+
const q = productId ? `?product_id=${encodeURIComponent(productId)}` : '';
|
|
93
|
+
return this.request('GET', `${BASE}/personality-records${q}`);
|
|
94
|
+
}
|
|
95
|
+
/** One governed Personality Record and its version history. */
|
|
96
|
+
getPersonalityRecord(productId, personalityId) {
|
|
97
|
+
return this.request('GET', `${BASE}/personality-record/${encodeURIComponent(productId)}/${encodeURIComponent(personalityId)}`);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* A Personality's effective authority, computed live at read time.
|
|
101
|
+
*
|
|
102
|
+
* The result is a snapshot of a computation, not stored state, and it covers the Personality/consent half of
|
|
103
|
+
* an Operation's authority only — the returned object names both facts about itself.
|
|
104
|
+
*/
|
|
105
|
+
getAuthorityEnvelope(productId, personalityId) {
|
|
106
|
+
return this.request('GET', `${BASE}/personality-envelope/${encodeURIComponent(productId)}/${encodeURIComponent(personalityId)}`);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* A product's Operative Type roster.
|
|
110
|
+
*
|
|
111
|
+
* `productId` NARROWS within the operator's authorized scope and can never widen it. This is deliberately not
|
|
112
|
+
* a platform-wide library view: "this product's Operatives" and "every Operative Type known to Universal" are
|
|
113
|
+
* different reads with different breadth, and only the first is this method.
|
|
114
|
+
*/
|
|
115
|
+
listOperativeTypes(productId) {
|
|
116
|
+
return this.request('GET', `${BASE}/operative-types?product_id=${encodeURIComponent(productId)}`);
|
|
117
|
+
}
|
|
118
|
+
/** One Operative Type with its full version history. */
|
|
119
|
+
getOperativeType(productId, operativeId) {
|
|
120
|
+
return this.request('GET', `${BASE}/operative-type/${encodeURIComponent(productId)}/${encodeURIComponent(operativeId)}`);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
/** Convenience factory, mirroring the other ConsciousClouds SDK clients. */
|
|
124
|
+
export function createAdminClient(options) {
|
|
125
|
+
return new AdminClient(options);
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,0GAA0G;AAC1G,MAAM,IAAI,GAAG,wBAAwB,CAAC;AAWtC;;;;;;;GAOG;AACH,MAAM,OAAO,UAAW,SAAQ,KAAK;IAInC,YAAY,MAAc,EAAE,IAAY,EAAE,MAAc;QACtD,KAAK,CAAC,cAAc,MAAM,IAAI,IAAI,MAAM,MAAM,EAAE,CAAC,CAAC;QAClD,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAwND,oGAAoG;AAEpG;;;;;;;GAOG;AACH,MAAM,OAAO,WAAW;IAKtB,YAAY,OAA2B;QACrC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAClD,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACjD,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC;IAC1C,CAAC;IAEO,KAAK,CAAC,OAAO,CAAI,MAAc,EAAE,IAAY;QACnD,MAA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EAAE,CAAC,CAAC;IACnE,CAAC;IAED,+DAA+D;IAC/D,oBAAoB,CAAc,SAAiB,EAAE,aAAqB;QACxE,OAAO,IAAI,CAAC,OAAO,CACjB,KAAK,EACL,GAAG,IAAI,uBAAuB,kBAAkB,CAAC,SAAS,CAAC,IAAI,kBAAkB,CAAC,aAAa,CAAC,EAAE,CACnG,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,oBAAoB,CAAC,SAAiB,EAAE,aAAqB;QAC3D,OAAO,IAAI,CAAC,OAAO,CACjB,KAAK,EACL,GAAG,IAAI,yBAAyB,kBAAkB,CAAC,SAAS,CAAC,IAAI,kBAAkB,CAAC,aAAa,CAAC,EAAE,CACrG,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACH,kBAAkB,CAAC,SAAiB;QAClC,OAAO,IAAI,CAAC,OAAO,CACjB,KAAK,EACL,GAAG,IAAI,+BAA+B,kBAAkB,CAAC,SAAS,CAAC,EAAE,CACtE,CAAC;IACJ,CAAC;IAED,wDAAwD;IACxD,gBAAgB,CAAC,SAAiB,EAAE,WAAmB;QACrD,OAAO,IAAI,CAAC,OAAO,CACjB,KAAK,EACL,GAAG,IAAI,mBAAmB,kBAAkB,CAAC,SAAS,CAAC,IAAI,kBAAkB,CAAC,WAAW,CAAC,EAAE,CAC7F,CAAC;IACJ,CAAC;CACF;AAED,4EAA4E;AAC5E,MAAM,UAAU,iBAAiB,CAAC,OAA2B;IAC3D,OAAO,IAAI,WAAW,CAAC,OAAO,CAAC,CAAC;AAClC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@consciousclouds/admin-sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "ConsciousClouds Universal Admin SDK \u2014 the thin, policy-free client for the Operator Gateway's governance reads: Projects/enrollment, Personalities and their governed records, effective authority envelopes, and Operative Type rosters. Types + HTTP wrappers only; every authorization decision belongs to the Operator Gateway and the Control Plane.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md",
|
|
18
|
+
"LICENSE"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc -p tsconfig.build.json",
|
|
22
|
+
"clean": "rm -rf dist",
|
|
23
|
+
"type-check": "tsc --noEmit",
|
|
24
|
+
"test": "bun test",
|
|
25
|
+
"prepublishOnly": "bun run clean && bun run build && bun run type-check"
|
|
26
|
+
},
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
},
|
|
30
|
+
"engines": {
|
|
31
|
+
"bun": ">=1.0.0",
|
|
32
|
+
"node": ">=18.0.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@types/node": "^22.10.5",
|
|
36
|
+
"typescript": "^5.7.2"
|
|
37
|
+
}
|
|
38
|
+
}
|