@almadar/sdk 0.2.5 → 0.3.1
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/README.md +1 -5
- package/dist/{AlmadarApp-DgwtnIRy.d.ts → AlmadarApp-mS7H6kiA.d.ts} +1 -1
- package/dist/client/index.d.ts +20 -4
- package/dist/client/index.js +118 -53
- package/dist/client/index.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +120 -55
- package/dist/index.js.map +1 -1
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +2 -2
- package/dist/react/index.js.map +1 -1
- package/dist/server/express.js +113 -52
- package/dist/server/express.js.map +1 -1
- package/dist/server/hono.js +113 -52
- package/dist/server/hono.js.map +1 -1
- package/dist/server/index.js +113 -52
- package/dist/server/index.js.map +1 -1
- package/dist/types-CVGXdQRM.d.ts +193 -0
- package/package.json +4 -4
- package/dist/types-C6RJADoY.d.ts +0 -125
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@almadar/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Almadar SDK — embed agent-generated orbital schemas in your React app. AlmadarApp component + AlmadarClient HTTP client.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"LICENSE"
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@almadar/core": "^10.
|
|
42
|
-
"@almadar/runtime": "^6.
|
|
43
|
-
"@almadar/ui": "^5.
|
|
41
|
+
"@almadar/core": "^10.70.0",
|
|
42
|
+
"@almadar/runtime": "^6.61.0",
|
|
43
|
+
"@almadar/ui": "^5.159.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"react": ">=18.0.0",
|
package/dist/types-C6RJADoY.d.ts
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import { SSEEvent, OrbitalSchema, EventPayload, EntityData } from '@almadar/core';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Public SDK types. Canonical schema / payload types come from `@almadar/core`;
|
|
5
|
-
* the SDK adds the HTTP-layer option shapes and re-exports the canonical SSE
|
|
6
|
-
* event union.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Server-emitted error envelope. `code` maps to the SDK error subclasses:
|
|
11
|
-
* 4001 → ApiKeyError, 4029 → RateLimitedError, 4040 → CatalogOutOfScopeError.
|
|
12
|
-
*/
|
|
13
|
-
interface ApiErrorBody {
|
|
14
|
-
code: number;
|
|
15
|
-
message: string;
|
|
16
|
-
details?: EventPayload;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Async-mode (`generate({ async: true })`) server response. The client polls
|
|
20
|
-
* `statusUrl` until the job resolves.
|
|
21
|
-
*/
|
|
22
|
-
interface AsyncJobHandle {
|
|
23
|
-
jobId: string;
|
|
24
|
-
statusUrl: string;
|
|
25
|
-
}
|
|
26
|
-
interface GenerateOptions {
|
|
27
|
-
prompt: string;
|
|
28
|
-
endUserId?: string;
|
|
29
|
-
appId?: string;
|
|
30
|
-
/** Streaming callback for canonical SSE events. */
|
|
31
|
-
onEvent?: (event: SSEEvent) => void;
|
|
32
|
-
/**
|
|
33
|
-
* When true, server responds with an `AsyncJobHandle` immediately and the
|
|
34
|
-
* client polls. Useful for generations expected to exceed proxy SSE timeouts.
|
|
35
|
-
*/
|
|
36
|
-
async?: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Agent provider override (e.g. 'deepseek', 'openai').
|
|
39
|
-
* Omit to use the server's default.
|
|
40
|
-
*/
|
|
41
|
-
provider?: string;
|
|
42
|
-
/**
|
|
43
|
-
* Agent model override (e.g. 'deepseek-chat').
|
|
44
|
-
* Omit to use the server's default.
|
|
45
|
-
*/
|
|
46
|
-
model?: string;
|
|
47
|
-
/**
|
|
48
|
-
* Behavior catalog mode — 'subset' narrows generation to stdAllowList.
|
|
49
|
-
* Server-specific; omit if the agent does not support it.
|
|
50
|
-
*/
|
|
51
|
-
catalogMode?: string;
|
|
52
|
-
/**
|
|
53
|
-
* Allow-list of std behavior names. Requires a server that supports catalog
|
|
54
|
-
* narrowing (e.g. the builder Rabit/Studio agent).
|
|
55
|
-
*/
|
|
56
|
-
stdAllowList?: string[];
|
|
57
|
-
}
|
|
58
|
-
interface GenerateResult {
|
|
59
|
-
schema: OrbitalSchema;
|
|
60
|
-
appId?: string;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Body of a `PUT /api/v1/agent/edit-schema`. Strictly structural; the SDK
|
|
64
|
-
* does not deep-type the patch — that's the server's job. Field types are
|
|
65
|
-
* `EventPayload`-compatible so callers can't sneak in arbitrary objects.
|
|
66
|
-
*/
|
|
67
|
-
interface EditSchemaPatch {
|
|
68
|
-
orbital?: string;
|
|
69
|
-
traitOverrides?: EventPayload;
|
|
70
|
-
config?: EventPayload;
|
|
71
|
-
}
|
|
72
|
-
interface CompileOptions {
|
|
73
|
-
target?: 'express' | 'hono';
|
|
74
|
-
shell?: 'typescript' | 'python' | 'mobile';
|
|
75
|
-
}
|
|
76
|
-
interface CompileResult {
|
|
77
|
-
downloadUrl: string;
|
|
78
|
-
expiresAt: string;
|
|
79
|
-
}
|
|
80
|
-
interface AlmadarClientOptions {
|
|
81
|
-
apiKey: string;
|
|
82
|
-
baseUrl?: string;
|
|
83
|
-
fetch?: typeof fetch;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Props for `<AlmadarApp />` — renders an orbital schema. The runtime mode
|
|
87
|
-
* decides whether effects (persist/fetch/call-service) hit a backend or stay
|
|
88
|
-
* mocked in-browser.
|
|
89
|
-
*/
|
|
90
|
-
interface AlmadarAppProps {
|
|
91
|
-
schema: OrbitalSchema;
|
|
92
|
-
/**
|
|
93
|
-
* - `static`: pure client-side, no server effects. Use with `data`.
|
|
94
|
-
* - `mock` (default): in-browser fake server, faker-seeded if `data` is undefined.
|
|
95
|
-
* - `server`: real backend at `serverUrl`.
|
|
96
|
-
*/
|
|
97
|
-
mode?: 'static' | 'mock' | 'server';
|
|
98
|
-
/** Seed data keyed by entity name (canonical `EntityData` shape). */
|
|
99
|
-
data?: EntityData;
|
|
100
|
-
/** Required when `mode === 'server'`. */
|
|
101
|
-
serverUrl?: string;
|
|
102
|
-
initialPagePath?: string;
|
|
103
|
-
height?: string;
|
|
104
|
-
className?: string;
|
|
105
|
-
/**
|
|
106
|
-
* Tiers of config knobs to surface as auto-derived controls. When provided,
|
|
107
|
-
* a control rail is rendered next to the app. Omit to hide controls.
|
|
108
|
-
* Common values: `['presentation']`, `['presentation', 'domain']`.
|
|
109
|
-
*/
|
|
110
|
-
exposedTiers?: string[];
|
|
111
|
-
/** Where to render the auto-derived controls rail. Default: 'right'. */
|
|
112
|
-
controlsPosition?: 'right' | 'bottom';
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Props for `<OrbitalConfigPanel />` — low-level control rail used by
|
|
116
|
-
* `<AlmadarApp />` when `exposedTiers` is set.
|
|
117
|
-
*/
|
|
118
|
-
interface OrbitalConfigPanelProps {
|
|
119
|
-
schema: string | OrbitalSchema;
|
|
120
|
-
exposedTiers?: string[];
|
|
121
|
-
position?: 'right' | 'bottom';
|
|
122
|
-
onSchemaChange?: (schema: OrbitalSchema) => void;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export type { AlmadarAppProps as A, CompileOptions as C, EditSchemaPatch as E, GenerateOptions as G, OrbitalConfigPanelProps as O, AlmadarClientOptions as a, ApiErrorBody as b, AsyncJobHandle as c, CompileResult as d, GenerateResult as e };
|