@wawjs/ai-ngx 0.0.0-stage → 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 +21 -0
- package/README.md +53 -2
- package/fesm2022/wawjs-ai-ngx.mjs +1093 -0
- package/fesm2022/wawjs-ai-ngx.mjs.map +1 -0
- package/package.json +47 -4
- package/types/wawjs-ai-ngx.d.ts +266 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 IT Kamianets
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,54 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @wawjs/ai-ngx
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Angular components of the [IT Kamianets AI Framework](https://ai.itkamianets.com) (AI ITKP) on
|
|
4
|
+
[`@wawjs/ai-client`](https://github.com/IT-Kamianets/ai-client): connect to an agent, browse its projects and
|
|
5
|
+
sessions, and chat with it (streamed replies, tool calls, approvals, stop). The agent holds the data and the
|
|
6
|
+
logic; these components only show it.
|
|
7
|
+
|
|
8
|
+
> Status: **0.1.0**, for `ai-api-schema` 0.2 and Angular 22. Built for apps on
|
|
9
|
+
> [ngx-default](https://github.com/IT-Kamianets/ngx-default) (`@wawjs/ngx-ui`, `@wawjs/ngx-translate`, theme
|
|
10
|
+
> tokens, the Material Symbols icon font).
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @wawjs/ai-ngx @wawjs/ai-client
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Use
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
// app.config.ts
|
|
22
|
+
import { provideAiAgent, AI_NGX_UA } from '@wawjs/ai-ngx';
|
|
23
|
+
|
|
24
|
+
providers: [
|
|
25
|
+
provideAiAgent({ storageKey: 'my-app', defaultUrl: 'http://127.0.0.1:53011' }),
|
|
26
|
+
provideTranslate({ translations: { ua: { ...AI_NGX_UA, ...ua }, en: {} } }),
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
// routes: guard the pages that talk to the agent
|
|
30
|
+
{ path: 'projects', canActivate: [aiConnectedGuard], loadComponent: ... }
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
```html
|
|
34
|
+
<ai-connect (connected)="router.navigate(['/projects'])" (continue)="router.navigate(['/projects'])">
|
|
35
|
+
Start the agent with <code>my-agent --serve</code>.
|
|
36
|
+
</ai-connect>
|
|
37
|
+
|
|
38
|
+
<ai-projects [client]="agent.client()!" [agentName]="agent.info()?.agent?.name ?? ''" (open)="router.navigate(['/session', $event])" />
|
|
39
|
+
|
|
40
|
+
<ai-chat [client]="agent.client()!" [sessionId]="id()" [agentName]="name" (loaded)="title.set($event.title ?? '')" />
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
| Piece | What it does |
|
|
44
|
+
|---|---|
|
|
45
|
+
| `provideAiAgent({ storageKey, defaultUrl?, connectPath? })`, `AiAgentStore` | The saved connection (this device's storage only), `client()`, `info()`, `connect()`, `resume()`, `disconnect()`, `forget()`. |
|
|
46
|
+
| `aiConnectedGuard` | Lets a page open once the agent answered; a reload resumes the saved connection, otherwise it goes to `connectPath?next=...`. |
|
|
47
|
+
| `<ai-connect>` | Address (http(s) or a site path such as `/agents/my-agent`) and token, then the agent card with model and tools. Inputs: `tokenRequired`. Outputs: `connected`, `continue`. Content: a hint on how to start the agent. |
|
|
48
|
+
| `<ai-projects>` | Projects and sessions from the agent: create, rename, delete (sessions stay), new session, move, delete a session. Inputs: `client`, `agentName`, `sessionPath`. Output: `open` (session id). Method: `reload()`. |
|
|
49
|
+
| `<ai-chat>` | One session: transcript, streaming, tool calls, approvals (Deny, Always for this session, Approve), Stop or Esc, queued message. Inputs: `client`, `sessionId`, `agentName`. Outputs: `loaded` (the session), `turnEnded`. |
|
|
50
|
+
| `AI_NGX_UA` | Ukrainian for every string the components show. |
|
|
51
|
+
|
|
52
|
+
## License
|
|
53
|
+
|
|
54
|
+
MIT
|