@lunora/angular 1.0.0-alpha.1 → 1.0.0-alpha.100
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.md +6 -0
- package/README.md +44 -0
- package/dist/index.d.mts +1479 -113
- package/dist/index.d.ts +1479 -113
- package/dist/index.mjs +1 -5
- package/dist/packem_shared/LUNORA_CLIENT-B0toApHY.mjs +1 -0
- package/dist/packem_shared/agent-BCt1D_wQ.mjs +1 -0
- package/dist/packem_shared/agentChat-DMMjTLnF.mjs +1 -0
- package/dist/packem_shared/agentState-Cdyss0S4.mjs +1 -0
- package/dist/packem_shared/agentToolEvents-BOp6-TK8.mjs +1 -0
- package/dist/packem_shared/auth-C3dB8sYS.mjs +1 -0
- package/dist/packem_shared/connectionStatus-UhmuwzMa.mjs +1 -0
- package/dist/packem_shared/flag-BJxkgJR2.mjs +1 -0
- package/dist/packem_shared/hydratePreloaded-gUUl_6tS.mjs +1 -0
- package/dist/packem_shared/infiniteQuery-yZS4F7PI.mjs +1 -0
- package/dist/packem_shared/liveQuery-ZIgKq4et.mjs +1 -0
- package/dist/packem_shared/mutate-BZvLQLyu.mjs +1 -0
- package/dist/packem_shared/mutator-DjG1yGk8.mjs +1 -0
- package/dist/packem_shared/platform-DNlq-CRU.mjs +1 -0
- package/dist/packem_shared/presence-DUkZtSSL.mjs +1 -0
- package/dist/packem_shared/rateLimit-B3h9qzh-.mjs +1 -0
- package/dist/packem_shared/runAction-BfiPq4Xz.mjs +1 -0
- package/dist/packem_shared/stream-CVSnLbC2.mjs +1 -0
- package/dist/packem_shared/subscription-B_Xj8Ezd.mjs +1 -0
- package/dist/packem_shared/voiceAgent-CyPFWGUt.mjs +1 -0
- package/dist/server.d.mts +1 -0
- package/dist/server.d.ts +1 -0
- package/dist/server.mjs +1 -0
- package/dist/upload.d.mts +57 -0
- package/dist/upload.d.ts +57 -0
- package/dist/upload.mjs +1 -0
- package/package.json +13 -3
- package/dist/packem_shared/LUNORA_CLIENT-DHUfNu9x.mjs +0 -23
- package/dist/packem_shared/connectionStatus-BlLodleK.mjs +0 -15
- package/dist/packem_shared/liveQuery-D5VQBOgf.mjs +0 -28
- package/dist/packem_shared/mutate-D3rEHwbb.mjs +0 -8
package/LICENSE.md
CHANGED
|
@@ -103,3 +103,9 @@ Unless required by applicable law or agreed to in writing, software distributed
|
|
|
103
103
|
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
104
104
|
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
105
105
|
specific language governing permissions and limitations under the License.
|
|
106
|
+
|
|
107
|
+
<!-- DEPENDENCIES -->
|
|
108
|
+
<!-- /DEPENDENCIES -->
|
|
109
|
+
|
|
110
|
+
<!-- TYPE_DEPENDENCIES -->
|
|
111
|
+
<!-- /TYPE_DEPENDENCIES -->
|
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# @lunora/angular
|
|
2
2
|
|
|
3
|
+
> **Experimental** — this package is outside the Lunora 1.0 stability promise: its API may change in any release, without a major version bump.
|
|
4
|
+
|
|
3
5
|
Angular reactive adapter for Lunora — signal-based live queries and mutations.
|
|
4
6
|
|
|
5
7
|
Thin, idiomatic glue over the framework-neutral `@lunora/client`. Angular signals
|
|
@@ -55,6 +57,31 @@ export class MessagesComponent {
|
|
|
55
57
|
|
|
56
58
|
Pass `"skip"` as the args to short-circuit (no network call, no socket).
|
|
57
59
|
|
|
60
|
+
Pass a function/`Signal` instead of a plain object to make the args reactive —
|
|
61
|
+
each change tears the old subscription down, resets the signal to `undefined`,
|
|
62
|
+
and opens a fresh one for the new args:
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
export class MessagesComponent {
|
|
66
|
+
private readonly channelId = input.required<string>();
|
|
67
|
+
|
|
68
|
+
readonly messages = liveQuery(api.messages.list, () => ({ channelId: this.channelId() }));
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
`subscription` and `paginatedQuery`/`infiniteQuery` accept the same reactive
|
|
73
|
+
args form. Calling from outside an injection context (e.g. `ngOnInit`) needs an
|
|
74
|
+
explicit `injector` alongside `client`/`destroyRef` for the reactive form —
|
|
75
|
+
`effect()` can't resolve one on its own there:
|
|
76
|
+
|
|
77
|
+
```ts
|
|
78
|
+
liveQuery(api.messages.list, () => ({ channelId: this.channelId() }), {
|
|
79
|
+
client: this.client,
|
|
80
|
+
destroyRef: this.destroyRef,
|
|
81
|
+
injector: this.injector,
|
|
82
|
+
});
|
|
83
|
+
```
|
|
84
|
+
|
|
58
85
|
## Mutations
|
|
59
86
|
|
|
60
87
|
```ts
|
|
@@ -83,4 +110,21 @@ import { connectionStatus } from "@lunora/angular";
|
|
|
83
110
|
readonly status = connectionStatus(); // Signal<"idle" | "connecting" | "connected" | "offline">
|
|
84
111
|
```
|
|
85
112
|
|
|
113
|
+
## Agents
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
import { agentToolEvents, voiceAgent } from "@lunora/angular";
|
|
117
|
+
|
|
118
|
+
// One thread's tool lifecycle: call / result / awaiting-approval / progress.
|
|
119
|
+
readonly events = agentToolEvents({ api, threadKey: "t1", stream: api.chat.liveEvents }).events;
|
|
120
|
+
|
|
121
|
+
// A full-duplex voice call against api.agents.<name>Voice.
|
|
122
|
+
readonly call = voiceAgent({ threadKey: "t1", voice: api.agents.supportVoice });
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
`voiceAgent` opens nothing until `call.startCall()` — that call is what requests
|
|
126
|
+
the microphone, so it must run from a user gesture. `call.endCall()` releases the
|
|
127
|
+
socket, the mic tracks and the Web Audio graph, and the owning `DestroyRef` runs
|
|
128
|
+
it on destroy.
|
|
129
|
+
|
|
86
130
|
Part of the [Lunora](https://github.com/anolilab/lunora) framework.
|