@lanonasis/ai-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/README.md ADDED
@@ -0,0 +1,61 @@
1
+ # @lanonasis/ai-sdk
2
+
3
+ Unified AI SDK facade for browser and Node, backed by `vortexai-l0` orchestrator.
4
+
5
+ ## Installation
6
+ ```bash
7
+ npm install @lanonasis/ai-sdk
8
+ # or
9
+ bun add @lanonasis/ai-sdk
10
+ ```
11
+
12
+ ## Usage (Browser / Frontend)
13
+ The default export is browser-safe (ESM, no Node-only deps).
14
+ ```ts
15
+ import { AiSDK } from '@lanonasis/ai-sdk';
16
+
17
+ const sdk = new AiSDK();
18
+ const res = await sdk.orchestrate('create viral TikTok campaign');
19
+ console.log(res.message);
20
+ ```
21
+
22
+ ## Usage (Node)
23
+ ```ts
24
+ import { AiSDK } from '@lanonasis/ai-sdk';
25
+
26
+ const sdk = new AiSDK();
27
+ const res = await sdk.orchestrate('analyze trending hashtags');
28
+ console.log(res.workflow);
29
+ ```
30
+
31
+ ## Advanced (Plugins)
32
+ ```ts
33
+ import { AiSDK, createPluginManager } from '@lanonasis/ai-sdk';
34
+
35
+ const plugins = createPluginManager();
36
+ plugins.register({
37
+ metadata: { name: 'demo', version: '1.0.0', description: 'Demo plugin' },
38
+ triggers: ['demo'],
39
+ handler: async (ctx) => ({ message: `Hello ${ctx.query}`, type: 'orchestration' })
40
+ });
41
+
42
+ const sdk = new AiSDK({ plugins });
43
+ await sdk.orchestrate('demo request');
44
+ ```
45
+
46
+ ## Smoke test (browser bundling)
47
+ Ensures no Node-only deps leak into browser builds.
48
+ ```bash
49
+ cd packages/ai-sdk
50
+ bun run smoke:web # esbuild bundle → dist-smoke/index.js
51
+ ```
52
+
53
+ ## Build
54
+ ```bash
55
+ cd packages/ai-sdk
56
+ bun run build
57
+ ```
58
+
59
+ ## Notes
60
+ - Backed by `vortexai-l0` browser-safe entry; CLI lives in `vortexai-l0/dist/node/cli.js`.
61
+ - Last validated: 2025-12-15 via `bun run build` and `bun run smoke:web`.
@@ -0,0 +1,20 @@
1
+ import { L0Orchestrator, type L0QueryOptions, type L0Response, pluginManager, createPluginManager, type PluginManager } from 'vortexai-l0';
2
+ export interface AiSDKOptions {
3
+ /** Optional plugin manager for custom workflows */
4
+ plugins?: PluginManager;
5
+ }
6
+ /**
7
+ * Unified AI SDK facade for browser and Node.
8
+ * Wraps the VortexAI L0 orchestrator and exposes a simple API surface.
9
+ */
10
+ export declare class AiSDK {
11
+ private orchestrator;
12
+ constructor(options?: AiSDKOptions);
13
+ /** Run an orchestration query */
14
+ orchestrate(query: string, options?: L0QueryOptions): Promise<L0Response>;
15
+ /** Direct access to underlying orchestrator */
16
+ getOrchestrator(): L0Orchestrator;
17
+ }
18
+ export { L0Orchestrator, pluginManager, createPluginManager };
19
+ export type { L0QueryOptions, L0Response, PluginManager };
20
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,KAAK,UAAU,EAAE,aAAa,EAAE,mBAAmB,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAE3I,MAAM,WAAW,YAAY;IAC3B,mDAAmD;IACnD,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED;;;GAGG;AACH,qBAAa,KAAK;IAChB,OAAO,CAAC,YAAY,CAAiB;gBAEzB,OAAO,CAAC,EAAE,YAAY;IAIlC,iCAAiC;IAC3B,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC;IAI/E,+CAA+C;IAC/C,eAAe,IAAI,cAAc;CAGlC;AAGD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,mBAAmB,EAAE,CAAC;AAC9D,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,22 @@
1
+ import { L0Orchestrator, pluginManager, createPluginManager } from 'vortexai-l0';
2
+ /**
3
+ * Unified AI SDK facade for browser and Node.
4
+ * Wraps the VortexAI L0 orchestrator and exposes a simple API surface.
5
+ */
6
+ export class AiSDK {
7
+ orchestrator;
8
+ constructor(options) {
9
+ this.orchestrator = new L0Orchestrator(options?.plugins);
10
+ }
11
+ /** Run an orchestration query */
12
+ async orchestrate(query, options) {
13
+ return this.orchestrator.query(query, options);
14
+ }
15
+ /** Direct access to underlying orchestrator */
16
+ getOrchestrator() {
17
+ return this.orchestrator;
18
+ }
19
+ }
20
+ // Re-export orchestrator primitives for power users
21
+ export { L0Orchestrator, pluginManager, createPluginManager };
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwC,aAAa,EAAE,mBAAmB,EAAsB,MAAM,aAAa,CAAC;AAO3I;;;GAGG;AACH,MAAM,OAAO,KAAK;IACR,YAAY,CAAiB;IAErC,YAAY,OAAsB;QAChC,IAAI,CAAC,YAAY,GAAG,IAAI,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC;IAED,iCAAiC;IACjC,KAAK,CAAC,WAAW,CAAC,KAAa,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC;IAED,+CAA+C;IAC/C,eAAe;QACb,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;CACF;AAED,oDAAoD;AACpD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,mBAAmB,EAAE,CAAC"}
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@lanonasis/ai-sdk",
3
+ "version": "0.1.0",
4
+ "description": "Unified AI SDK facade for browser and Node, backed by vortexai-l0 orchestrator",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "default": "./dist/index.js"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "scripts": {
20
+ "build": "tsc -p tsconfig.json",
21
+ "smoke:web": "esbuild src/index.ts --bundle --platform=browser --format=esm --outdir=dist-smoke",
22
+ "lint": "echo 'lint not configured'",
23
+ "test": "echo 'tests not configured'"
24
+ },
25
+ "dependencies": {
26
+ "vortexai-l0": "workspace:*"
27
+ },
28
+ "devDependencies": {
29
+ "esbuild": "^0.21.5",
30
+ "typescript": "^5.9.3"
31
+ }
32
+ }