aegis-platform-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/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0 — 2026-07-08
4
+
5
+ First cut of the TypeScript SDK, mirroring `aegis-platform-sdk` (Python) v0.10.0.
6
+
7
+ - `AegisClient` — fetch-based transport, zero runtime dependencies, ESM + CJS.
8
+ - Auth: `login` (JWT attach), `me`, `enableDevMode`; env fallbacks `AEGIS_API_URL` / `AEGIS_TOKEN`.
9
+ - Error hierarchy: `AegisAPIError`, `AuthError` (401), `PermissionDeniedError` (403), `NotFoundError` (404).
10
+ - Resources: `iam` (users/roles/groups/permissions/nav), `osdk` (token lifecycle), `operator.tasks`, `ontology` (objects, graph, explorer, object-types, link-types, OSDK manifest/codegen), `aip` (flows, agents, models, budget), `functions` + `codeRepositories` (Code Functions v26), `datasets` (branches, transactions, classification, markings).
11
+ - Generic `client.request(method, path, opts)` escape hatch for unwrapped endpoints.
package/LICENSE ADDED
@@ -0,0 +1,14 @@
1
+ Proprietary — Safe-Core Technologies
2
+
3
+ Copyright (c) 2026 Safe-Core Technologies. All rights reserved.
4
+
5
+ This software is proprietary to Safe-Core Technologies. Use of this
6
+ package is permitted only for building applications that integrate with
7
+ a licensed AEGIS platform deployment. Redistribution, sublicensing,
8
+ resale, or use of this software to build competing products is
9
+ prohibited without prior written authorization from Safe-Core
10
+ Technologies.
11
+
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
13
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
14
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
package/README.md ADDED
@@ -0,0 +1,105 @@
1
+ # AEGIS SDK — TypeScript (`aegis-platform-sdk`)
2
+
3
+ Typed TypeScript client for the AEGIS HTTPS API (Safe-Core Technologies).
4
+ Mirrors the Python SDK ([`aegis-platform-sdk` on PyPI](https://pypi.org/project/aegis-platform-sdk/))
5
+ — same resource layout, same error hierarchy, same auth model.
6
+
7
+ - **Zero runtime dependencies** — platform `fetch` (Node ≥ 18, browsers, edge runtimes).
8
+ - **ESM + CJS** with full `.d.ts` types.
9
+ - **Same surface as Python**: `client.iam.users.list()` ⇄ `client.iam.users.list()`.
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ npm install aegis-platform-sdk
15
+ ```
16
+
17
+ ## Programmatic auth (OSDK Application)
18
+
19
+ Issue a token in the AEGIS UI: **Governance → OSDK Applications**. The
20
+ plaintext appears once; stash it like any other secret.
21
+
22
+ ```ts
23
+ import { AegisClient } from "aegis-platform-sdk";
24
+
25
+ const client = new AegisClient({
26
+ baseUrl: "https://aegis.example.com",
27
+ token: "osdk_xK9pQzR2L8mYvN4w...",
28
+ });
29
+
30
+ const me = await client.auth.me();
31
+ console.log(me.username, me.permissions);
32
+ ```
33
+
34
+ Env fallbacks (`AEGIS_API_URL`, `AEGIS_TOKEN`) let you construct
35
+ `new AegisClient()` with no arguments in server-side code.
36
+
37
+ ## Human auth (login)
38
+
39
+ ```ts
40
+ const client = new AegisClient({ baseUrl: "https://aegis.example.com" });
41
+ await client.auth.login("operador", "senha", { totpCode: "123456" }); // JWT attaches automatically
42
+ const tree = await client.iam.nav.tree();
43
+ ```
44
+
45
+ ## Error handling
46
+
47
+ ```ts
48
+ import { AegisAPIError, PermissionDeniedError } from "aegis-platform-sdk";
49
+
50
+ try {
51
+ await client.iam.users.list();
52
+ } catch (err) {
53
+ if (err instanceof PermissionDeniedError) console.error("missing perm:", err.detail);
54
+ else if (err instanceof AegisAPIError) console.error(err.statusCode, err.detail, err.payload);
55
+ }
56
+ ```
57
+
58
+ 401 → `AuthError` · 403 → `PermissionDeniedError` · 404 → `NotFoundError` · everything else → `AegisAPIError`.
59
+
60
+ ## Resources
61
+
62
+ | Resource | Surface |
63
+ |----------|---------|
64
+ | `client.auth` | `login`, `me`, `enableDevMode` |
65
+ | `client.iam` | `users`, `roles`, `groups` (CRUD + members), `permissions`, `nav.tree` |
66
+ | `client.osdk` | OSDK token lifecycle: `list/get/create/rotate/revoke` |
67
+ | `client.operator.tasks` | NL task queue: `list/get/create/cancel/retry/reprioritize` |
68
+ | `client.ontology` | `objects` (CRUD, bulk, links, history, timeseries), `graph.expand`, `explorer` (histogram/timeline), `objectTypes`, `linkTypes`, `osdkManifest/osdkFunctions/osdkGenerate` |
69
+ | `client.aip` | `flows`, `agents`, `models` (catalog/defaults), `budget` |
70
+ | `client.functions` | Code Functions: CRUD, `invoke`, tests, publish, versions, pull requests + CI |
71
+ | `client.codeRepositories` | repos, branches, CI, merge |
72
+ | `client.datasets` | datasets, branches, transactions (begin/commit/abort), merges, classification, markings |
73
+
74
+ Anything not wrapped yet is reachable via the escape hatch:
75
+
76
+ ```ts
77
+ const rows = await client.request("GET", "/entities/aggregate", {
78
+ params: { property: "kind" },
79
+ });
80
+ ```
81
+
82
+ ## Claude Code skill
83
+
84
+ The npm package ships a Claude Code skill under `skills/aegis-sdk/`. In an
85
+ external project that consumes this SDK, copy it into the project's
86
+ `.claude/skills/` so Claude Code knows the SDK surface and conventions:
87
+
88
+ ```bash
89
+ mkdir -p .claude/skills
90
+ cp -r node_modules/aegis-platform-sdk/skills/aegis-sdk .claude/skills/aegis-sdk
91
+ ```
92
+
93
+ ## Development
94
+
95
+ ```bash
96
+ npm install
97
+ npm run typecheck && npm test && npm run build
98
+ ```
99
+
100
+ Releases: see [`PUBLISHING.md`](./PUBLISHING.md). Roadmap and extension
101
+ plan: [`docs/PLAN.md`](./docs/PLAN.md).
102
+
103
+ ## License
104
+
105
+ Proprietary — Safe-Core Technologies. See [LICENSE](./LICENSE).