@pinecall/agents 0.9.20
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 +202 -0
- package/README.md +121 -0
- package/dist/agent/accepts.d.ts +31 -0
- package/dist/agent/accepts.d.ts.map +1 -0
- package/dist/agent/accepts.js +27 -0
- package/dist/agent/accepts.js.map +1 -0
- package/dist/agent/agent.d.ts +151 -0
- package/dist/agent/agent.d.ts.map +1 -0
- package/dist/agent/agent.js +240 -0
- package/dist/agent/agent.js.map +1 -0
- package/dist/agent/authors.d.ts +12 -0
- package/dist/agent/authors.d.ts.map +1 -0
- package/dist/agent/authors.js +26 -0
- package/dist/agent/authors.js.map +1 -0
- package/dist/agent/decorators.d.ts +16 -0
- package/dist/agent/decorators.d.ts.map +1 -0
- package/dist/agent/decorators.js +43 -0
- package/dist/agent/decorators.js.map +1 -0
- package/dist/agent/docstrings.d.ts +35 -0
- package/dist/agent/docstrings.d.ts.map +1 -0
- package/dist/agent/docstrings.js +301 -0
- package/dist/agent/docstrings.js.map +1 -0
- package/dist/agent/knowledge.d.ts +9 -0
- package/dist/agent/knowledge.d.ts.map +1 -0
- package/dist/agent/knowledge.js +3 -0
- package/dist/agent/knowledge.js.map +1 -0
- package/dist/agent/lifecycle.d.ts +29 -0
- package/dist/agent/lifecycle.d.ts.map +1 -0
- package/dist/agent/lifecycle.js +9 -0
- package/dist/agent/lifecycle.js.map +1 -0
- package/dist/agent/searching.d.ts +7 -0
- package/dist/agent/searching.d.ts.map +1 -0
- package/dist/agent/searching.js +35 -0
- package/dist/agent/searching.js.map +1 -0
- package/dist/agent/stages.d.ts +23 -0
- package/dist/agent/stages.d.ts.map +1 -0
- package/dist/agent/stages.js +29 -0
- package/dist/agent/stages.js.map +1 -0
- package/dist/agent/state.d.ts +36 -0
- package/dist/agent/state.d.ts.map +1 -0
- package/dist/agent/state.js +93 -0
- package/dist/agent/state.js.map +1 -0
- package/dist/agent/tools.d.ts +61 -0
- package/dist/agent/tools.d.ts.map +1 -0
- package/dist/agent/tools.js +145 -0
- package/dist/agent/tools.js.map +1 -0
- package/dist/agent/view.d.ts +29 -0
- package/dist/agent/view.d.ts.map +1 -0
- package/dist/agent/view.js +29 -0
- package/dist/agent/view.js.map +1 -0
- package/dist/agent/visibility.d.ts +32 -0
- package/dist/agent/visibility.d.ts.map +1 -0
- package/dist/agent/visibility.js +77 -0
- package/dist/agent/visibility.js.map +1 -0
- package/dist/call/call.d.ts +137 -0
- package/dist/call/call.d.ts.map +1 -0
- package/dist/call/call.js +228 -0
- package/dist/call/call.js.map +1 -0
- package/dist/call/history.d.ts +28 -0
- package/dist/call/history.d.ts.map +1 -0
- package/dist/call/history.js +32 -0
- package/dist/call/history.js.map +1 -0
- package/dist/call/room.d.ts +56 -0
- package/dist/call/room.d.ts.map +1 -0
- package/dist/call/room.js +66 -0
- package/dist/call/room.js.map +1 -0
- package/dist/client/agent.d.ts +93 -0
- package/dist/client/agent.d.ts.map +1 -0
- package/dist/client/agent.js +230 -0
- package/dist/client/agent.js.map +1 -0
- package/dist/client/calls.d.ts +87 -0
- package/dist/client/calls.d.ts.map +1 -0
- package/dist/client/calls.js +180 -0
- package/dist/client/calls.js.map +1 -0
- package/dist/client/client.d.ts +112 -0
- package/dist/client/client.d.ts.map +1 -0
- package/dist/client/client.js +284 -0
- package/dist/client/client.js.map +1 -0
- package/dist/client/connection.d.ts +52 -0
- package/dist/client/connection.d.ts.map +1 -0
- package/dist/client/connection.js +157 -0
- package/dist/client/connection.js.map +1 -0
- package/dist/client/endpoints.d.ts +9 -0
- package/dist/client/endpoints.d.ts.map +1 -0
- package/dist/client/endpoints.js +25 -0
- package/dist/client/endpoints.js.map +1 -0
- package/dist/client/frames.d.ts +29 -0
- package/dist/client/frames.d.ts.map +1 -0
- package/dist/client/frames.js +51 -0
- package/dist/client/frames.js.map +1 -0
- package/dist/client/index.d.ts +18 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +13 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/listeners.d.ts +35 -0
- package/dist/client/listeners.d.ts.map +1 -0
- package/dist/client/listeners.js +60 -0
- package/dist/client/listeners.js.map +1 -0
- package/dist/client/lost.d.ts +4 -0
- package/dist/client/lost.d.ts.map +1 -0
- package/dist/client/lost.js +8 -0
- package/dist/client/lost.js.map +1 -0
- package/dist/client/observe.d.ts +50 -0
- package/dist/client/observe.d.ts.map +1 -0
- package/dist/client/observe.js +125 -0
- package/dist/client/observe.js.map +1 -0
- package/dist/client/signed.d.ts +14 -0
- package/dist/client/signed.d.ts.map +1 -0
- package/dist/client/signed.js +18 -0
- package/dist/client/signed.js.map +1 -0
- package/dist/client/testing/gateway.d.ts +58 -0
- package/dist/client/testing/gateway.d.ts.map +1 -0
- package/dist/client/testing/gateway.js +175 -0
- package/dist/client/testing/gateway.js.map +1 -0
- package/dist/client/testing/index.d.ts +4 -0
- package/dist/client/testing/index.d.ts.map +1 -0
- package/dist/client/testing/index.js +4 -0
- package/dist/client/testing/index.js.map +1 -0
- package/dist/client/testing/log.d.ts +24 -0
- package/dist/client/testing/log.d.ts.map +1 -0
- package/dist/client/testing/log.js +106 -0
- package/dist/client/testing/log.js.map +1 -0
- package/dist/client/testing/loopback.d.ts +3 -0
- package/dist/client/testing/loopback.d.ts.map +1 -0
- package/dist/client/testing/loopback.js +3 -0
- package/dist/client/testing/loopback.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/runtime/connect.d.ts +42 -0
- package/dist/runtime/connect.d.ts.map +1 -0
- package/dist/runtime/connect.js +234 -0
- package/dist/runtime/connect.js.map +1 -0
- package/dist/runtime/dispatch.d.ts +32 -0
- package/dist/runtime/dispatch.d.ts.map +1 -0
- package/dist/runtime/dispatch.js +46 -0
- package/dist/runtime/dispatch.js.map +1 -0
- package/dist/runtime/environment.d.ts +7 -0
- package/dist/runtime/environment.d.ts.map +1 -0
- package/dist/runtime/environment.js +30 -0
- package/dist/runtime/environment.js.map +1 -0
- package/dist/runtime/recall.d.ts +9 -0
- package/dist/runtime/recall.d.ts.map +1 -0
- package/dist/runtime/recall.js +13 -0
- package/dist/runtime/recall.js.map +1 -0
- package/dist/runtime/run-tool.d.ts +18 -0
- package/dist/runtime/run-tool.d.ts.map +1 -0
- package/dist/runtime/run-tool.js +70 -0
- package/dist/runtime/run-tool.js.map +1 -0
- package/dist/serve/index.d.ts +5 -0
- package/dist/serve/index.d.ts.map +1 -0
- package/dist/serve/index.js +50 -0
- package/dist/serve/index.js.map +1 -0
- package/dist/serve/io.d.ts +14 -0
- package/dist/serve/io.d.ts.map +1 -0
- package/dist/serve/io.js +6 -0
- package/dist/serve/io.js.map +1 -0
- package/dist/serve/leaving.d.ts +12 -0
- package/dist/serve/leaving.d.ts.map +1 -0
- package/dist/serve/leaving.js +61 -0
- package/dist/serve/leaving.js.map +1 -0
- package/dist/serve/lines.d.ts +7 -0
- package/dist/serve/lines.d.ts.map +1 -0
- package/dist/serve/lines.js +25 -0
- package/dist/serve/lines.js.map +1 -0
- package/dist/serve/load.d.ts +26 -0
- package/dist/serve/load.d.ts.map +1 -0
- package/dist/serve/load.js +61 -0
- package/dist/serve/load.js.map +1 -0
- package/dist/serve/machine.d.ts +4 -0
- package/dist/serve/machine.d.ts.map +1 -0
- package/dist/serve/machine.js +33 -0
- package/dist/serve/machine.js.map +1 -0
- package/dist/serve/prompt.d.ts +7 -0
- package/dist/serve/prompt.d.ts.map +1 -0
- package/dist/serve/prompt.js +51 -0
- package/dist/serve/prompt.js.map +1 -0
- package/dist/serve/start.d.ts +7 -0
- package/dist/serve/start.d.ts.map +1 -0
- package/dist/serve/start.js +95 -0
- package/dist/serve/start.js.map +1 -0
- package/dist/serve/viewing.d.ts +17 -0
- package/dist/serve/viewing.d.ts.map +1 -0
- package/dist/serve/viewing.js +42 -0
- package/dist/serve/viewing.js.map +1 -0
- package/dist/views/built-in-rules.d.ts +9 -0
- package/dist/views/built-in-rules.d.ts.map +1 -0
- package/dist/views/built-in-rules.js +28 -0
- package/dist/views/built-in-rules.js.map +1 -0
- package/dist/views/components.d.ts +17 -0
- package/dist/views/components.d.ts.map +1 -0
- package/dist/views/components.js +33 -0
- package/dist/views/components.js.map +1 -0
- package/dist/views/jsx-dev-runtime.d.ts +3 -0
- package/dist/views/jsx-dev-runtime.d.ts.map +1 -0
- package/dist/views/jsx-dev-runtime.js +4 -0
- package/dist/views/jsx-dev-runtime.js.map +1 -0
- package/dist/views/jsx-runtime.d.ts +46 -0
- package/dist/views/jsx-runtime.d.ts.map +1 -0
- package/dist/views/jsx-runtime.js +63 -0
- package/dist/views/jsx-runtime.js.map +1 -0
- package/dist/views/layout.d.ts +19 -0
- package/dist/views/layout.d.ts.map +1 -0
- package/dist/views/layout.js +58 -0
- package/dist/views/layout.js.map +1 -0
- package/dist/views/nodes.d.ts +48 -0
- package/dist/views/nodes.d.ts.map +1 -0
- package/dist/views/nodes.js +45 -0
- package/dist/views/nodes.js.map +1 -0
- package/dist/views/panels.d.ts +17 -0
- package/dist/views/panels.d.ts.map +1 -0
- package/dist/views/panels.js +62 -0
- package/dist/views/panels.js.map +1 -0
- package/dist/views/render.d.ts +11 -0
- package/dist/views/render.d.ts.map +1 -0
- package/dist/views/render.js +19 -0
- package/dist/views/render.js.map +1 -0
- package/dist/wire/agent-config.d.ts +213 -0
- package/dist/wire/agent-config.d.ts.map +1 -0
- package/dist/wire/agent-config.js +126 -0
- package/dist/wire/agent-config.js.map +1 -0
- package/dist/wire/codec.d.ts +43 -0
- package/dist/wire/codec.d.ts.map +1 -0
- package/dist/wire/codec.js +51 -0
- package/dist/wire/codec.js.map +1 -0
- package/dist/wire/commands.d.ts +443 -0
- package/dist/wire/commands.d.ts.map +1 -0
- package/dist/wire/commands.js +203 -0
- package/dist/wire/commands.js.map +1 -0
- package/dist/wire/defs.d.ts +373 -0
- package/dist/wire/defs.d.ts.map +1 -0
- package/dist/wire/defs.js +212 -0
- package/dist/wire/defs.js.map +1 -0
- package/dist/wire/envelope.d.ts +29 -0
- package/dist/wire/envelope.d.ts.map +1 -0
- package/dist/wire/envelope.js +27 -0
- package/dist/wire/envelope.js.map +1 -0
- package/dist/wire/events-call.d.ts +446 -0
- package/dist/wire/events-call.d.ts.map +1 -0
- package/dist/wire/events-call.js +196 -0
- package/dist/wire/events-call.js.map +1 -0
- package/dist/wire/events.d.ts +946 -0
- package/dist/wire/events.d.ts.map +1 -0
- package/dist/wire/events.js +309 -0
- package/dist/wire/events.js.map +1 -0
- package/dist/wire/index.d.ts +19 -0
- package/dist/wire/index.d.ts.map +1 -0
- package/dist/wire/index.js +19 -0
- package/dist/wire/index.js.map +1 -0
- package/dist/wire/metrics.d.ts +366 -0
- package/dist/wire/metrics.d.ts.map +1 -0
- package/dist/wire/metrics.js +269 -0
- package/dist/wire/metrics.js.map +1 -0
- package/dist/wire/reduce.d.ts +10 -0
- package/dist/wire/reduce.d.ts.map +1 -0
- package/dist/wire/reduce.js +367 -0
- package/dist/wire/reduce.js.map +1 -0
- package/dist/wire/registry.d.ts +1789 -0
- package/dist/wire/registry.d.ts.map +1 -0
- package/dist/wire/registry.js +118 -0
- package/dist/wire/registry.js.map +1 -0
- package/dist/wire/rest-data.d.ts +170 -0
- package/dist/wire/rest-data.d.ts.map +1 -0
- package/dist/wire/rest-data.js +78 -0
- package/dist/wire/rest-data.js.map +1 -0
- package/dist/wire/rest-hosting.d.ts +74 -0
- package/dist/wire/rest-hosting.d.ts.map +1 -0
- package/dist/wire/rest-hosting.js +38 -0
- package/dist/wire/rest-hosting.js.map +1 -0
- package/dist/wire/rest-retrieval.d.ts +214 -0
- package/dist/wire/rest-retrieval.d.ts.map +1 -0
- package/dist/wire/rest-retrieval.js +161 -0
- package/dist/wire/rest-retrieval.js.map +1 -0
- package/dist/wire/rest.d.ts +786 -0
- package/dist/wire/rest.d.ts.map +1 -0
- package/dist/wire/rest.js +238 -0
- package/dist/wire/rest.js.map +1 -0
- package/dist/wire/room.d.ts +106 -0
- package/dist/wire/room.d.ts.map +1 -0
- package/dist/wire/room.js +73 -0
- package/dist/wire/room.js.map +1 -0
- package/dist/wire/state.d.ts +915 -0
- package/dist/wire/state.d.ts.map +1 -0
- package/dist/wire/state.js +189 -0
- package/dist/wire/state.js.map +1 -0
- package/dist/wire/verbs.d.ts +73 -0
- package/dist/wire/verbs.d.ts.map +1 -0
- package/dist/wire/verbs.js +50 -0
- package/dist/wire/verbs.js.map +1 -0
- package/package.json +74 -0
- package/tsconfig.tenant.json +24 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright 2026 Pinecall
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# @pinecall/agents
|
|
2
|
+
|
|
3
|
+
Build voice and chat agents as TypeScript classes. Fields are the agent's state, `@tool`
|
|
4
|
+
methods are what the model can call, docstrings are the prompt, and `render()` describes the
|
|
5
|
+
current turn.
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
export default class ClinicaNorte extends Agent {
|
|
9
|
+
stage: Stages<"identify" | "choose" | "book"> = "identify";
|
|
10
|
+
patient?: Patient | undefined;
|
|
11
|
+
slot?: Slot | undefined;
|
|
12
|
+
|
|
13
|
+
/** Busca al paciente por nombre y teléfono. Pide los dos antes de llamarla. */
|
|
14
|
+
@tool({ stage: "identify", pii: ["name", "phone"] })
|
|
15
|
+
async findPatient(name: string, phone: string): Promise<Patient | null> {
|
|
16
|
+
this.patient = await this.agenda().find(name, phone);
|
|
17
|
+
if (this.patient) this.stage = "choose";
|
|
18
|
+
return this.patient ?? null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** The prompt as a function of state: the only part that changes between turns. */
|
|
22
|
+
override render() {
|
|
23
|
+
return (
|
|
24
|
+
<>
|
|
25
|
+
{this.stage === "identify" && <p>Saluda y pide nombre y teléfono.</p>}
|
|
26
|
+
{this.patient && <p>Hablas con {this.patient.name}, ya en la ficha.</p>}
|
|
27
|
+
</>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The same agent answers the web, WhatsApp and the phone, and remembers a customer across them.
|
|
34
|
+
Audio, rooms, the call log and tenants are handled by the
|
|
35
|
+
[Pinecall runtime](https://github.com/pinecall/runtime), which this package talks to over a
|
|
36
|
+
WebSocket.
|
|
37
|
+
|
|
38
|
+
## Install
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npm i @pinecall/agents pinecall # the framework, and the CLI that runs what you write in it
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The CLI is its own package, [`pinecall`](https://github.com/pinecall/cli): it never loads this
|
|
45
|
+
one, it starts the agents of your project through `@pinecall/agents/serve`, which is why both are
|
|
46
|
+
dependencies of the project. It needs a gateway: use Pinecall's hosted one, or run your own with
|
|
47
|
+
[`pip install pinecall`](https://github.com/pinecall/runtime) (see
|
|
48
|
+
[from-zero](https://github.com/pinecall/runtime/blob/main/docs/from-zero.md)).
|
|
49
|
+
|
|
50
|
+
## Quick start
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pnpm install
|
|
54
|
+
npm i -g pinecall # the CLI; the example takes the framework from this checkout
|
|
55
|
+
cd examples/clinica-norte
|
|
56
|
+
pinecall link # sign in through the browser; writes your key to ./.env
|
|
57
|
+
pinecall chat # talk to the agent in this terminal
|
|
58
|
+
pinecall start # run the agent (this is the process you deploy)
|
|
59
|
+
pinecall console # open the sandbox console
|
|
60
|
+
pinecall test # run the goldens
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Other useful verbs: `pinecall prompt --state <file>` prints the exact prompt a state produces
|
|
64
|
+
(`--channel web --medium text` for the one a written chat gets);
|
|
65
|
+
`pinecall docs push` uploads a knowledge base and `pinecall docs attach <base>` gives it to the
|
|
66
|
+
agent; `pinecall deploy` runs the project on the box instead of your own server, with
|
|
67
|
+
`pinecall secrets` for what it is started with ([docs/deploying.md](https://github.com/pinecall/cli/blob/main/docs/deploying.md)). Every verb runs against the sandbox unless `--prod` is given. The CLI reads `PINECALL_KEY`
|
|
68
|
+
and `PINECALL_URL` from the environment or the project's `.env`. Full reference:
|
|
69
|
+
[docs/the-cli.md](https://github.com/pinecall/cli/blob/main/docs/the-cli.md).
|
|
70
|
+
|
|
71
|
+
A project holds one or more agents: `agents/<name>/agent.tsx` and their tests in
|
|
72
|
+
`test/<name>/`. Voice, model, language, greeting, knowledge and the documents an agent searches
|
|
73
|
+
are per-world settings, not class fields or files in the repository: `pinecall agent set
|
|
74
|
+
--language es` is how the agent's calls come to be in Spanish. Running in production on your own server:
|
|
75
|
+
[docs/production.md](docs/production.md).
|
|
76
|
+
|
|
77
|
+
## Development
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
pnpm test # the framework, from sources
|
|
81
|
+
pnpm lint # tsc over src and test
|
|
82
|
+
scripts/build # the published build (dist/)
|
|
83
|
+
scripts/check # build, lint, test — what CI runs
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
`package.json` exports point at `src/` and `publishConfig` switches them to `dist/` on publish,
|
|
87
|
+
so tests and the example run from sources with no build step.
|
|
88
|
+
|
|
89
|
+
| `src/` | |
|
|
90
|
+
|---|---|
|
|
91
|
+
| `agent/` | the `Agent` class, `@tool`, `@render`, `@state`, stages, hooks |
|
|
92
|
+
| `views/` | JSX-to-text rendering and the prompt's named blocks |
|
|
93
|
+
| `call/` | the live call as a value, reduced from log entries |
|
|
94
|
+
| `client/` | `@pinecall/agents/client`: the WebSocket client and the wire, nothing else |
|
|
95
|
+
| `runtime/` | the bridge between the class and the wire |
|
|
96
|
+
| `serve/` | `@pinecall/agents/serve`: the entry the CLI starts an agent with, `start` and `prompt` |
|
|
97
|
+
|
|
98
|
+
`test/the-imports.test.ts` enforces which directory may import which. The public exports are
|
|
99
|
+
`@pinecall/agents`, `@pinecall/agents/client`, `@pinecall/agents/serve`, `@pinecall/agents/wire` and
|
|
100
|
+
`@pinecall/agents/tsconfig.tenant.json`, pinned by
|
|
101
|
+
`test/index.test.ts` and `test/client/index.test.ts`.
|
|
102
|
+
|
|
103
|
+
The wire is the runtime's, kept in `src/wire/`; the runtime's golden call log, in
|
|
104
|
+
`test/wire/golden/`, is how this package and the runtime are checked to fold a log identically.
|
|
105
|
+
|
|
106
|
+
## Documentation
|
|
107
|
+
|
|
108
|
+
| | |
|
|
109
|
+
|---|---|
|
|
110
|
+
| [docs/tutorial.md](docs/tutorial.md) | from an empty directory to an agent with knowledge and memory |
|
|
111
|
+
| [docs/writing-an-agent.md](docs/writing-an-agent.md) | state, tools, stages, channels, knowledge, memory, hooks |
|
|
112
|
+
| [docs/the-prompt.md](docs/the-prompt.md) | how the prompt is built and cached |
|
|
113
|
+
| [docs/testing-an-agent.md](docs/testing-an-agent.md) | unit tests, goldens, personas, replays, scores |
|
|
114
|
+
| [the CLI](https://github.com/pinecall/cli/blob/main/docs/the-cli.md) | every verb, in the `pinecall` repo |
|
|
115
|
+
| [docs/worlds-and-teams.md](docs/worlds-and-teams.md) | keys, sandbox and production, teams |
|
|
116
|
+
| [docs/production.md](docs/production.md) | running an agent on your own server |
|
|
117
|
+
| [ARCHITECTURE.md](ARCHITECTURE.md) | the package file by file |
|
|
118
|
+
|
|
119
|
+
## License
|
|
120
|
+
|
|
121
|
+
[Apache-2.0](LICENSE), including its patent grant. No CLA.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** `static events`: the external events a class accepts, and from which senders. */
|
|
2
|
+
/** Event sender: the tenant's backend (`app`) or a participant's browser. */
|
|
3
|
+
export type EventSource = "app" | "participant";
|
|
4
|
+
/** One accepted event. Only senders listed in `from` reach the hook. */
|
|
5
|
+
export interface EventDecl {
|
|
6
|
+
from: EventSource[];
|
|
7
|
+
}
|
|
8
|
+
/** A class's event declarations, e.g. `{ "cart.changed": { from: ["app"] } }`. */
|
|
9
|
+
export type EventDeclarations = Record<string, EventDecl>;
|
|
10
|
+
/** One declaration as carried in `AgentConfig.events`. */
|
|
11
|
+
export interface EventSpec {
|
|
12
|
+
name: string;
|
|
13
|
+
from: EventSource[];
|
|
14
|
+
}
|
|
15
|
+
/** Event metadata: sender, participant identity if any, and log sequence number. */
|
|
16
|
+
export interface EventMeta {
|
|
17
|
+
source: EventSource;
|
|
18
|
+
identity?: string;
|
|
19
|
+
seq: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Every event the class declares, parents first. A subclass redeclaring a name replaces its
|
|
23
|
+
* senders instead of merging them.
|
|
24
|
+
*/
|
|
25
|
+
export declare function eventsOf(ctor: Function): EventSpec[];
|
|
26
|
+
/**
|
|
27
|
+
* Whether the class accepts `name` from `source`. The gateway checks this too; the runtime
|
|
28
|
+
* rechecks because a replayed log must not run a hook on an undeclared event.
|
|
29
|
+
*/
|
|
30
|
+
export declare function accepts(ctor: Function, name: string, source: EventSource): boolean;
|
|
31
|
+
//# sourceMappingURL=accepts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accepts.d.ts","sourceRoot":"","sources":["../../src/agent/accepts.ts"],"names":[],"mappings":"AAAA,oFAAoF;AAEpF,6EAA6E;AAC7E,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,aAAa,CAAC;AAEhD,wEAAwE;AACxE,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,WAAW,EAAE,CAAC;CACrB;AAED,kFAAkF;AAClF,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAE1D,0DAA0D;AAC1D,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,WAAW,EAAE,CAAC;CACrB;AAED,oFAAoF;AACpF,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,EAAE,CAWpD;AAED;;;GAGG;AAEH,wBAAgB,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAGlF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** `static events`: the external events a class accepts, and from which senders. */
|
|
2
|
+
/**
|
|
3
|
+
* Every event the class declares, parents first. A subclass redeclaring a name replaces its
|
|
4
|
+
* senders instead of merging them.
|
|
5
|
+
*/
|
|
6
|
+
export function eventsOf(ctor) {
|
|
7
|
+
const merged = new Map();
|
|
8
|
+
const chain = [];
|
|
9
|
+
for (let step = ctor; typeof step === "function"; step = Object.getPrototypeOf(step)) {
|
|
10
|
+
chain.unshift(step);
|
|
11
|
+
}
|
|
12
|
+
for (const step of chain) {
|
|
13
|
+
const own = Object.getOwnPropertyDescriptor(step, "events")?.value;
|
|
14
|
+
for (const [name, decl] of Object.entries(own ?? {}))
|
|
15
|
+
merged.set(name, [...decl.from]);
|
|
16
|
+
}
|
|
17
|
+
return [...merged].map(([name, from]) => ({ name, from }));
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Whether the class accepts `name` from `source`. The gateway checks this too; the runtime
|
|
21
|
+
* rechecks because a replayed log must not run a hook on an undeclared event.
|
|
22
|
+
*/
|
|
23
|
+
export function accepts(ctor, name, source) {
|
|
24
|
+
const declared = eventsOf(ctor).find((spec) => spec.name === name);
|
|
25
|
+
return declared !== undefined && declared.from.includes(source);
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=accepts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accepts.js","sourceRoot":"","sources":["../../src/agent/accepts.ts"],"names":[],"mappings":"AAAA,oFAAoF;AA0BpF;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAc;IACrC,MAAM,MAAM,GAAG,IAAI,GAAG,EAAyB,CAAC;IAChD,MAAM,KAAK,GAAe,EAAE,CAAC;IAC7B,KAAK,IAAI,IAAI,GAAoB,IAAI,EAAE,OAAO,IAAI,KAAK,UAAU,EAAE,IAAI,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAoB,EAAE,CAAC;QACzH,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,GAAG,GAAG,MAAM,CAAC,wBAAwB,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,KAAsC,CAAC;QACpG,KAAK,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI,EAAE,CAAC;YAAE,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACzF,CAAC;IACD,OAAO,CAAC,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC7D,CAAC;AAED;;;GAGG;AAEH,MAAM,UAAU,OAAO,CAAC,IAAc,EAAE,IAAY,EAAE,MAAmB;IACvE,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;IACnE,OAAO,QAAQ,KAAK,SAAS,IAAI,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/** The Agent base class: its fields are the state, and every assignment is a change with an author. */
|
|
2
|
+
import { type ToolSpec } from "./tools.js";
|
|
3
|
+
import type { Child } from "../views/jsx-runtime.js";
|
|
4
|
+
import type { CallWorld } from "../call/call.js";
|
|
5
|
+
import type { Knowledge } from "./knowledge.js";
|
|
6
|
+
import type { EventDeclarations, EventMeta } from "./accepts.js";
|
|
7
|
+
import { type Visibility } from "./visibility.js";
|
|
8
|
+
import type { Call, MemoryOp } from "./lifecycle.js";
|
|
9
|
+
import { type LastCall, type Snapshot } from "./state.js";
|
|
10
|
+
export declare const CONFIG_FIELDS: readonly ["phone", "whatsapp", "web", "channelRules"];
|
|
11
|
+
/** One field assignment, as the log and the console read it. */
|
|
12
|
+
export interface Change {
|
|
13
|
+
seq: number;
|
|
14
|
+
field: string;
|
|
15
|
+
prev: unknown;
|
|
16
|
+
next: unknown;
|
|
17
|
+
author: string;
|
|
18
|
+
at: number;
|
|
19
|
+
}
|
|
20
|
+
export type ChangeListener = (change: Change) => void;
|
|
21
|
+
/** A named entry the agent wrote to the call's log. */
|
|
22
|
+
export interface LogEntry {
|
|
23
|
+
seq: number;
|
|
24
|
+
name: string;
|
|
25
|
+
data?: unknown;
|
|
26
|
+
at: number;
|
|
27
|
+
}
|
|
28
|
+
export type LogListener = (entry: LogEntry) => void;
|
|
29
|
+
/** An external event, as in-process observers receive it after the hook. */
|
|
30
|
+
export interface EventHeard {
|
|
31
|
+
name: string;
|
|
32
|
+
data: Record<string, unknown>;
|
|
33
|
+
meta: EventMeta;
|
|
34
|
+
}
|
|
35
|
+
export type EventListener = (heard: EventHeard) => void;
|
|
36
|
+
/** Per-agent framework state, kept off the instance's own fields. */
|
|
37
|
+
export interface Internals {
|
|
38
|
+
changes: Change[];
|
|
39
|
+
log: LogEntry[];
|
|
40
|
+
logListeners: Set<LogListener>;
|
|
41
|
+
listeners: Set<ChangeListener>;
|
|
42
|
+
eventListeners: Set<EventListener>;
|
|
43
|
+
seq: number;
|
|
44
|
+
sealed: boolean;
|
|
45
|
+
target: object;
|
|
46
|
+
/** Set by the bridge at start(), never by the app. */
|
|
47
|
+
call: CallWorld | null;
|
|
48
|
+
/** Source for `last(contact)`, from `mount({ last })`. */
|
|
49
|
+
last: LastCall | null;
|
|
50
|
+
/** Facts memory recalled for this call, read by `remembers(text)`. */
|
|
51
|
+
recalled: string[];
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Base class for every agent. The constructor returns a Proxy, so `this.patient = row` records
|
|
55
|
+
* a change with its author and sequence number.
|
|
56
|
+
*/
|
|
57
|
+
export declare class Agent {
|
|
58
|
+
constructor();
|
|
59
|
+
/** The class description, as an alternative to a JSDoc comment. */
|
|
60
|
+
static doc?: string;
|
|
61
|
+
/**
|
|
62
|
+
* `false` leaves the `<channel>` block out of the prompt: how to write for a voice, a website's
|
|
63
|
+
* chat or WhatsApp. A config field, never state.
|
|
64
|
+
*/
|
|
65
|
+
channelRules?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Knowledge bases attached to this agent (`pinecall docs attach`), searched from a tool:
|
|
68
|
+
* `await this.knowledge.search("horarios", { k: 3 })`. The gateway runs and logs the search.
|
|
69
|
+
*/
|
|
70
|
+
get knowledge(): Knowledge;
|
|
71
|
+
/** External events this class accepts, and from whom. */
|
|
72
|
+
static events?: EventDeclarations;
|
|
73
|
+
/** Field visibility as a map, as an alternative to `@state`. */
|
|
74
|
+
static visibility?: Record<string, Visibility>;
|
|
75
|
+
/** The class docstring, as the model reads it. */
|
|
76
|
+
doc(): string | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* The per-turn part of the prompt, rendered from the current state. It is the dynamic block and
|
|
79
|
+
* the last thing the model reads. Renders nothing by default.
|
|
80
|
+
*/
|
|
81
|
+
render(): Child;
|
|
82
|
+
/**
|
|
83
|
+
* Whether memory recalled a fact for this call containing `text` (the fact or its key word).
|
|
84
|
+
* Returns false until the runtime has recalled anything.
|
|
85
|
+
*/
|
|
86
|
+
remembers(text: string): boolean;
|
|
87
|
+
/** Every tool this agent declares, whether or not the current state shows it. */
|
|
88
|
+
tools(): ToolSpec[];
|
|
89
|
+
/** The tools a model may call right now: the ones whose `when(state)` holds. */
|
|
90
|
+
visibleTools(): ToolSpec[];
|
|
91
|
+
/** Replace the change log with a one-sentence summary; the state is kept. */
|
|
92
|
+
collapse(summary: string): void;
|
|
93
|
+
/** Restore the whole state from a snapshot, e.g. in `onCall` for a returning caller. */
|
|
94
|
+
restore(state: Snapshot): void;
|
|
95
|
+
/**
|
|
96
|
+
* Overwrite only the fields `state` names, keeping the rest. Unlike `restore`, which replaces the
|
|
97
|
+
* whole state and clears fields the snapshot omits.
|
|
98
|
+
*/
|
|
99
|
+
startIn(state: Snapshot): void;
|
|
100
|
+
/** The snapshot this contact's last call left. Requires `mount(Class, { pc, last })`. */
|
|
101
|
+
last(contact: string): Promise<Snapshot | null>;
|
|
102
|
+
/** Append a named entry to the call's log. */
|
|
103
|
+
log(name: string, data?: unknown): void;
|
|
104
|
+
/**
|
|
105
|
+
* The call being served. A getter, not a field, so it never enters a snapshot; a subclass field
|
|
106
|
+
* named `call` is refused at its first write. Throws when no call is being served.
|
|
107
|
+
*/
|
|
108
|
+
get call(): CallWorld;
|
|
109
|
+
/** Speak `text` verbatim now. Resolves true once the turn is delivered. */
|
|
110
|
+
say(text: string, options?: {
|
|
111
|
+
allowInterruptions?: boolean;
|
|
112
|
+
}): Promise<boolean>;
|
|
113
|
+
/** Make the model speak now, guided by instructions the caller does not hear. Resolves like `say`. */
|
|
114
|
+
reply(instructions: string, options?: {
|
|
115
|
+
allowInterruptions?: boolean;
|
|
116
|
+
}): Promise<boolean>;
|
|
117
|
+
/** Subscribe in-process to state changes or events. Returns an unsubscribe function. */
|
|
118
|
+
on(type: "state", listener: ChangeListener): () => void;
|
|
119
|
+
on(type: "event", listener: EventListener): () => void;
|
|
120
|
+
/** Called when a declared external event arrives. State writes here are authored by the event. */
|
|
121
|
+
onEvent(_name: string, _data: Record<string, unknown>, _meta: EventMeta): unknown;
|
|
122
|
+
/** Called when a call starts. State writes here are authored by the hook. */
|
|
123
|
+
onCall(_call: Call): unknown;
|
|
124
|
+
/** Called when the call ends. */
|
|
125
|
+
onEnd(_call: Call): unknown;
|
|
126
|
+
/** Called when memory is written; override to persist the ops. */
|
|
127
|
+
onMemory(_ops: MemoryOp[], _call: Call): unknown;
|
|
128
|
+
}
|
|
129
|
+
/** The framework's bookkeeping for an agent; throws if `agent` is not one. */
|
|
130
|
+
export declare function internalsOf(agent: object): Internals;
|
|
131
|
+
/** Start recording changes. Assignments before this (field initializers) are the baseline. */
|
|
132
|
+
export declare function seal<T extends object>(agent: T): T;
|
|
133
|
+
/** Every change this agent has recorded, oldest first. */
|
|
134
|
+
export declare function changes(agent: object): readonly Change[];
|
|
135
|
+
/** Listen to field assignments. Returns an unsubscribe function. */
|
|
136
|
+
export declare function onChange(agent: object, listener: ChangeListener): () => void;
|
|
137
|
+
/** Everything this agent logged, oldest first. */
|
|
138
|
+
export declare function logOf(agent: object): readonly LogEntry[];
|
|
139
|
+
/** Listen to log entries. Returns an unsubscribe function. */
|
|
140
|
+
export declare function onLog(agent: object, listener: LogListener): () => void;
|
|
141
|
+
/** Whether a name is one of CONFIG_FIELDS rather than a piece of state. */
|
|
142
|
+
export declare function isConfigField(name: string): boolean;
|
|
143
|
+
/** Set the store `last(contact)` reads. Called by the bridge at start(). */
|
|
144
|
+
export declare function setLast(agent: object, source: LastCall | null): void;
|
|
145
|
+
/** Set the call being served. Called by the bridge at start(). */
|
|
146
|
+
export declare function setCall(agent: object, call: CallWorld | null): void;
|
|
147
|
+
/** Record recalled facts and their key words, from the call's `memory.ops` entries. */
|
|
148
|
+
export declare function recalled(agent: object, words: readonly string[]): void;
|
|
149
|
+
/** Notify in-process observers of an event after its hook ran. */
|
|
150
|
+
export declare function emitEvent(agent: object, heard: EventHeard): void;
|
|
151
|
+
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/agent/agent.ts"],"names":[],"mappings":"AAAA,uGAAuG;AAIvG,OAAO,EAAkC,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAA+B,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAKvF,eAAO,MAAM,aAAa,YAAI,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,cAAc,CAAU,CAAC;AAKnF,gEAAgE;AAChE,MAAM,WAAW,MAAM;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;AAEtD,uDAAuD;AACvD,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI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