@layernorm/overlay-agent-host 0.8.0 → 0.10.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/Dockerfile +0 -1
- package/LICENSE +176 -0
- package/README.md +7 -7
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/host-capabilities.d.ts +1 -1
- package/dist/host-capabilities.d.ts.map +1 -1
- package/dist/host-capabilities.js +1 -1
- package/dist/host-capabilities.js.map +1 -1
- package/dist/keyed-lock.d.ts +2 -0
- package/dist/keyed-lock.d.ts.map +1 -0
- package/dist/keyed-lock.js +18 -0
- package/dist/keyed-lock.js.map +1 -0
- package/dist/local-tools-exec.d.ts +14 -1
- package/dist/local-tools-exec.d.ts.map +1 -1
- package/dist/local-tools-exec.js +71 -12
- package/dist/local-tools-exec.js.map +1 -1
- package/dist/local-tools-paths.d.ts +8 -0
- package/dist/local-tools-paths.d.ts.map +1 -1
- package/dist/local-tools-paths.js +6 -2
- package/dist/local-tools-paths.js.map +1 -1
- package/dist/local-tools-terminal.d.ts +12 -3
- package/dist/local-tools-terminal.d.ts.map +1 -1
- package/dist/local-tools-terminal.js +113 -8
- package/dist/local-tools-terminal.js.map +1 -1
- package/dist/local-tools.d.ts.map +1 -1
- package/dist/local-tools.js +10 -4
- package/dist/local-tools.js.map +1 -1
- package/dist/private-threads-access.d.ts +62 -0
- package/dist/private-threads-access.d.ts.map +1 -0
- package/dist/private-threads-access.js +141 -0
- package/dist/private-threads-access.js.map +1 -0
- package/dist/private-threads-context.d.ts +44 -9
- package/dist/private-threads-context.d.ts.map +1 -1
- package/dist/private-threads-context.js +115 -31
- package/dist/private-threads-context.js.map +1 -1
- package/dist/private-threads-images.d.ts +15 -0
- package/dist/private-threads-images.d.ts.map +1 -0
- package/dist/private-threads-images.js +38 -0
- package/dist/private-threads-images.js.map +1 -0
- package/dist/private-threads-ipc.d.ts +16 -0
- package/dist/private-threads-ipc.d.ts.map +1 -1
- package/dist/private-threads-ipc.js +72 -12
- package/dist/private-threads-ipc.js.map +1 -1
- package/dist/private-threads-limits.d.ts +51 -0
- package/dist/private-threads-limits.d.ts.map +1 -0
- package/dist/private-threads-limits.js +51 -0
- package/dist/private-threads-limits.js.map +1 -0
- package/dist/private-threads-messages.d.ts +62 -0
- package/dist/private-threads-messages.d.ts.map +1 -0
- package/dist/private-threads-messages.js +156 -0
- package/dist/private-threads-messages.js.map +1 -0
- package/dist/private-threads-models.d.ts +5 -7
- package/dist/private-threads-models.d.ts.map +1 -1
- package/dist/private-threads-models.js +40 -17
- package/dist/private-threads-models.js.map +1 -1
- package/dist/private-threads-overlay-model.d.ts +1 -0
- package/dist/private-threads-overlay-model.d.ts.map +1 -1
- package/dist/private-threads-overlay-tools.d.ts +2 -0
- package/dist/private-threads-overlay-tools.d.ts.map +1 -1
- package/dist/private-threads-overlay-tools.js +2 -1
- package/dist/private-threads-overlay-tools.js.map +1 -1
- package/dist/private-threads-pieces.d.ts +14 -0
- package/dist/private-threads-pieces.d.ts.map +1 -0
- package/dist/private-threads-pieces.js +85 -0
- package/dist/private-threads-pieces.js.map +1 -0
- package/dist/private-threads-progress.d.ts +35 -0
- package/dist/private-threads-progress.d.ts.map +1 -0
- package/dist/private-threads-progress.js +77 -0
- package/dist/private-threads-progress.js.map +1 -0
- package/dist/private-threads-protocol.d.ts +233 -38
- package/dist/private-threads-protocol.d.ts.map +1 -1
- package/dist/private-threads-protocol.js +73 -27
- package/dist/private-threads-protocol.js.map +1 -1
- package/dist/private-threads-recall.d.ts +10 -0
- package/dist/private-threads-recall.d.ts.map +1 -0
- package/dist/private-threads-recall.js +40 -0
- package/dist/private-threads-recall.js.map +1 -0
- package/dist/private-threads-schema.d.ts +8 -0
- package/dist/private-threads-schema.d.ts.map +1 -0
- package/dist/private-threads-schema.js +186 -0
- package/dist/private-threads-schema.js.map +1 -0
- package/dist/private-threads-store.d.ts +112 -10
- package/dist/private-threads-store.d.ts.map +1 -1
- package/dist/private-threads-store.js +468 -62
- package/dist/private-threads-store.js.map +1 -1
- package/dist/private-threads-title.d.ts +12 -0
- package/dist/private-threads-title.d.ts.map +1 -0
- package/dist/private-threads-title.js +47 -0
- package/dist/private-threads-title.js.map +1 -0
- package/dist/private-threads-tools.d.ts +3 -0
- package/dist/private-threads-tools.d.ts.map +1 -1
- package/dist/private-threads-tools.js +73 -8
- package/dist/private-threads-tools.js.map +1 -1
- package/dist/private-threads-turn-model.d.ts +7 -0
- package/dist/private-threads-turn-model.d.ts.map +1 -0
- package/dist/private-threads-turn-model.js +31 -0
- package/dist/private-threads-turn-model.js.map +1 -0
- package/dist/private-threads.d.ts +54 -21
- package/dist/private-threads.d.ts.map +1 -1
- package/dist/private-threads.js +378 -200
- package/dist/private-threads.js.map +1 -1
- package/package.json +3 -3
package/Dockerfile
CHANGED
|
@@ -12,7 +12,6 @@ COPY packages ./packages
|
|
|
12
12
|
# bun.lock covers every workspace; their manifests must be present to install from it.
|
|
13
13
|
COPY apps/admin/package.json ./apps/admin/
|
|
14
14
|
COPY apps/chrome/package.json ./apps/chrome/
|
|
15
|
-
COPY apps/chrome/packages ./apps/chrome/packages
|
|
16
15
|
COPY apps/desktop/package.json ./apps/desktop/
|
|
17
16
|
COPY apps/mobile/package.json ./apps/mobile/
|
|
18
17
|
RUN bun install --frozen-lockfile --production --filter @layernorm/overlay-agent-host \
|
package/LICENSE
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
Business Source License 1.1
|
|
2
|
+
|
|
3
|
+
Parameters
|
|
4
|
+
|
|
5
|
+
Licensor: LayerNorm Inc.
|
|
6
|
+
|
|
7
|
+
Licensed Work: Overlay, meaning each version of the first-party
|
|
8
|
+
material in the Overlay repository
|
|
9
|
+
(https://github.com/LayerNorm/overlay) that LayerNorm
|
|
10
|
+
Inc. makes available under this License, including its
|
|
11
|
+
web app, backend, desktop, mobile and Chrome apps, Agent
|
|
12
|
+
Host and packages. Third-party material keeps its own
|
|
13
|
+
license.
|
|
14
|
+
The Licensed Work is (c) 2026 LayerNorm Inc.
|
|
15
|
+
|
|
16
|
+
Additional Use Grant: You may also make production use of the Licensed Work in
|
|
17
|
+
any of the five ways below. None of them includes a
|
|
18
|
+
Commercial Offering. This grant only adds to your rights
|
|
19
|
+
under this License. It does not limit non-production use.
|
|
20
|
+
|
|
21
|
+
1. Personal use. You may use the Licensed Work as an
|
|
22
|
+
individual for your own personal purposes. Use for an
|
|
23
|
+
employer, a client or your own business is not
|
|
24
|
+
personal use.
|
|
25
|
+
|
|
26
|
+
2. Small organizations. A Small Organization may use the
|
|
27
|
+
Licensed Work for its own internal operations.
|
|
28
|
+
|
|
29
|
+
3. Growing past a limit. An organization that was using
|
|
30
|
+
the Licensed Work under section 2 and stops being a
|
|
31
|
+
Small Organization may continue that use for 60 days
|
|
32
|
+
from the date it stopped qualifying.
|
|
33
|
+
|
|
34
|
+
4. Trial. Any organization may use the Licensed Work for
|
|
35
|
+
its own internal operations for one period of 30 days
|
|
36
|
+
in a row, starting on its first production use under
|
|
37
|
+
this section. An organization and its Affiliates share
|
|
38
|
+
one trial.
|
|
39
|
+
|
|
40
|
+
5. Apps that connect to Overlay. Any individual or
|
|
41
|
+
organization may use the official Overlay desktop,
|
|
42
|
+
mobile and Chrome apps and Agent Host, as LayerNorm
|
|
43
|
+
Inc. distributes them, (a) with the Overlay service
|
|
44
|
+
that LayerNorm Inc. operates, under the terms of that
|
|
45
|
+
service, including for features of those apps that
|
|
46
|
+
run on the user's own device, or (b) with a
|
|
47
|
+
deployment whose use is allowed by this License or by
|
|
48
|
+
a commercial license from LayerNorm Inc. This section
|
|
49
|
+
does not allow anyone to run the Overlay web app or
|
|
50
|
+
backend.
|
|
51
|
+
|
|
52
|
+
An organization may have contractors install and run the
|
|
53
|
+
Licensed Work for it, and may run it on rented
|
|
54
|
+
infrastructure, if the contractor or provider uses it
|
|
55
|
+
only for that organization. That use counts as the
|
|
56
|
+
organization's use. An organization may also let guests
|
|
57
|
+
use its deployment to work with that organization.
|
|
58
|
+
Neither may be used to make a Commercial Offering.
|
|
59
|
+
|
|
60
|
+
Definitions for this grant:
|
|
61
|
+
|
|
62
|
+
"Affiliate" means any entity that controls, is controlled
|
|
63
|
+
by, or is under common control with an organization.
|
|
64
|
+
"Control" means owning more than half of an entity, or
|
|
65
|
+
the power to direct its management and policies.
|
|
66
|
+
|
|
67
|
+
"Commercial Offering" means selling, renting or
|
|
68
|
+
sublicensing the Licensed Work, or making its
|
|
69
|
+
functionality available to third parties as a hosted,
|
|
70
|
+
managed or embedded product or service, whether or not
|
|
71
|
+
there is a charge. Letting guests work with an
|
|
72
|
+
organization in its own deployment, as described above,
|
|
73
|
+
is not a Commercial Offering on its own.
|
|
74
|
+
|
|
75
|
+
"Organization" means any company, nonprofit, school,
|
|
76
|
+
government body or other entity, and any individual using
|
|
77
|
+
the Licensed Work for their own business, including as a
|
|
78
|
+
sole proprietor or freelancer.
|
|
79
|
+
|
|
80
|
+
"People" means everyone who works for an organization,
|
|
81
|
+
full time or part time, as an employee, a working owner
|
|
82
|
+
or an individual contractor, whether or not they use the
|
|
83
|
+
Licensed Work. Software agents are not People.
|
|
84
|
+
|
|
85
|
+
"Small Organization" means an organization that, together
|
|
86
|
+
with all its Affiliates, has both (a) fewer than 10
|
|
87
|
+
People and (b) less than US$100,000 in Total Revenue
|
|
88
|
+
during the previous 12 months.
|
|
89
|
+
|
|
90
|
+
"Total Revenue" means gross income from all sources
|
|
91
|
+
before expenses, including sales, grants, donations and
|
|
92
|
+
public funding. It does not include loans or money
|
|
93
|
+
raised by selling an ownership interest. Amounts in
|
|
94
|
+
other currencies are converted to US dollars.
|
|
95
|
+
|
|
96
|
+
Change Date: For each version of the Licensed Work, four years from
|
|
97
|
+
the date that version is first made publicly available
|
|
98
|
+
under this License.
|
|
99
|
+
|
|
100
|
+
Change License: GNU General Public License, version 3 or any later
|
|
101
|
+
version (GPL-3.0-or-later)
|
|
102
|
+
|
|
103
|
+
For production use that this License does not allow, contact
|
|
104
|
+
divyansh@layernorm.co to buy an Overlay self-host license.
|
|
105
|
+
|
|
106
|
+
-----------------------------------------------------------------------------
|
|
107
|
+
|
|
108
|
+
License text copyright © 2017 MariaDB Corporation Ab, All Rights Reserved.
|
|
109
|
+
"Business Source License" is a trademark of MariaDB Corporation Ab.
|
|
110
|
+
|
|
111
|
+
Terms
|
|
112
|
+
|
|
113
|
+
The Licensor hereby grants you the right to copy, modify, create derivative
|
|
114
|
+
works, redistribute, and make non-production use of the Licensed Work. The
|
|
115
|
+
Licensor may make an Additional Use Grant, above, permitting limited
|
|
116
|
+
production use.
|
|
117
|
+
|
|
118
|
+
Effective on the Change Date, or the fourth anniversary of the first publicly
|
|
119
|
+
available distribution of a specific version of the Licensed Work under this
|
|
120
|
+
License, whichever comes first, the Licensor hereby grants you rights under
|
|
121
|
+
the terms of the Change License, and the rights granted in the paragraph
|
|
122
|
+
above terminate.
|
|
123
|
+
|
|
124
|
+
If your use of the Licensed Work does not comply with the requirements
|
|
125
|
+
currently in effect as described in this License, you must purchase a
|
|
126
|
+
commercial license from the Licensor, its affiliated entities, or authorized
|
|
127
|
+
resellers, or you must refrain from using the Licensed Work.
|
|
128
|
+
|
|
129
|
+
All copies of the original and modified Licensed Work, and derivative works
|
|
130
|
+
of the Licensed Work, are subject to this License. This License applies
|
|
131
|
+
separately for each version of the Licensed Work and the Change Date may vary
|
|
132
|
+
for each version of the Licensed Work released by Licensor.
|
|
133
|
+
|
|
134
|
+
You must conspicuously display this License on each original or modified copy
|
|
135
|
+
of the Licensed Work. If you receive the Licensed Work in original or
|
|
136
|
+
modified form from a third party, the terms and conditions set forth in this
|
|
137
|
+
License apply to your use of that work.
|
|
138
|
+
|
|
139
|
+
Any use of the Licensed Work in violation of this License will automatically
|
|
140
|
+
terminate your rights under this License for the current and all other
|
|
141
|
+
versions of the Licensed Work.
|
|
142
|
+
|
|
143
|
+
This License does not grant you any right in any trademark or logo of
|
|
144
|
+
Licensor or its affiliates (provided that you may use a trademark or logo of
|
|
145
|
+
Licensor as expressly required by this License).
|
|
146
|
+
|
|
147
|
+
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
|
|
148
|
+
AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
|
|
149
|
+
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
|
|
150
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
|
|
151
|
+
TITLE.
|
|
152
|
+
|
|
153
|
+
MariaDB hereby grants you permission to use this License’s text to license
|
|
154
|
+
your works, and to refer to it using the trademark “Business Source License”,
|
|
155
|
+
as long as you comply with the Covenants of Licensor below.
|
|
156
|
+
|
|
157
|
+
Covenants of Licensor
|
|
158
|
+
|
|
159
|
+
In consideration of the right to use this License’s text and the “Business
|
|
160
|
+
Source License” name and trademark, Licensor covenants to MariaDB, and to all
|
|
161
|
+
other recipients of the licensed work to be provided by Licensor:
|
|
162
|
+
|
|
163
|
+
1. To specify as the Change License the GPL Version 2.0 or any later version,
|
|
164
|
+
or a license that is compatible with GPL Version 2.0 or a later version,
|
|
165
|
+
where “compatible” means that software provided under the Change License can
|
|
166
|
+
be included in a program with software provided under GPL Version 2.0 or a
|
|
167
|
+
later version. Licensor may specify additional Change Licenses without
|
|
168
|
+
limitation.
|
|
169
|
+
|
|
170
|
+
2. To either: (a) specify an additional grant of rights to use that does not
|
|
171
|
+
impose any additional restriction on the right granted in this License, as
|
|
172
|
+
the Additional Use Grant; or (b) insert the text “None”.
|
|
173
|
+
|
|
174
|
+
3. To specify a Change Date.
|
|
175
|
+
|
|
176
|
+
4. Not to modify this License in any other way.
|
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ Node.js 24 or newer is required. Overlay's one-copy command supplies a pinned No
|
|
|
8
8
|
when the machine's default `node` is older:
|
|
9
9
|
|
|
10
10
|
```sh
|
|
11
|
-
npx --yes --package node@24 --package @layernorm/overlay-agent-host@0.
|
|
11
|
+
npx --yes --package node@24 --package @layernorm/overlay-agent-host@0.10.0 \
|
|
12
12
|
overlay-agent-host connect <enrollment-code> \
|
|
13
13
|
--server https://overlay.works \
|
|
14
14
|
--kind vps \
|
|
@@ -78,7 +78,7 @@ network URL:
|
|
|
78
78
|
The equivalent enrollment form is:
|
|
79
79
|
|
|
80
80
|
```sh
|
|
81
|
-
npx --yes --package node@24 --package @layernorm/overlay-agent-host@0.
|
|
81
|
+
npx --yes --package node@24 --package @layernorm/overlay-agent-host@0.10.0 \
|
|
82
82
|
overlay-agent-host connect <enrollment-code> \
|
|
83
83
|
--server https://overlay.works \
|
|
84
84
|
--kind vps \
|
|
@@ -102,9 +102,9 @@ Terminal closes and returns after login or process failure. Use the exact config
|
|
|
102
102
|
`connect`:
|
|
103
103
|
|
|
104
104
|
```sh
|
|
105
|
-
npx --yes --package node@24 --package @layernorm/overlay-agent-host@0.
|
|
105
|
+
npx --yes --package node@24 --package @layernorm/overlay-agent-host@0.10.0 \
|
|
106
106
|
overlay-agent-host service install --config "$HOME/.overlay/agent-host/config.json"
|
|
107
|
-
npx --yes --package node@24 --package @layernorm/overlay-agent-host@0.
|
|
107
|
+
npx --yes --package node@24 --package @layernorm/overlay-agent-host@0.10.0 \
|
|
108
108
|
overlay-agent-host service status --config "$HOME/.overlay/agent-host/config.json"
|
|
109
109
|
```
|
|
110
110
|
|
|
@@ -182,8 +182,8 @@ enrollment remains rejected.
|
|
|
182
182
|
|
|
183
183
|
`overlay-agent-host private --state-dir <dir>` runs threads whose Cloud sync is off. Overlay Desktop starts it with a
|
|
184
184
|
Node.js IPC channel; it opens no port, runs one AI SDK `ToolLoopAgent` per turn with this computer's tools, and calls
|
|
185
|
-
the model the desktop names for that turn: a provider with the person's own key,
|
|
186
|
-
|
|
187
|
-
`<dir>/private-threads.sqlite
|
|
185
|
+
the model the desktop names for that turn: a provider with the person's own key, or Overlay's model relay (Overlay's models or
|
|
186
|
+
the agent's provider connection) with a short-lived token. It keeps transcripts in
|
|
187
|
+
`<dir>/private-threads.sqlite`, and asks the same model for a short title after a thread's first message. It
|
|
188
188
|
also starts the person's local (stdio) MCP servers when a turn's agent may use them, and stops them when idle or on
|
|
189
189
|
exit. It is not meant to be started by hand. See `internal/develop/private-threads.md` in the Overlay repository.
|
package/dist/cli.js
CHANGED
|
@@ -13,7 +13,7 @@ import { AgentHostRuntime } from './runtime.js';
|
|
|
13
13
|
import { assertSupportedNodeVersion } from './runtime-version.js';
|
|
14
14
|
import { HttpAgentControlPlaneClient } from './transport.js';
|
|
15
15
|
import { servePrivateThreads } from './private-threads-ipc.js';
|
|
16
|
-
const PACKAGE_SPEC = '@layernorm/overlay-agent-host@0.
|
|
16
|
+
const PACKAGE_SPEC = '@layernorm/overlay-agent-host@0.10.0';
|
|
17
17
|
assertSupportedNodeVersion();
|
|
18
18
|
const [command, ...args] = process.argv.slice(2);
|
|
19
19
|
const configPath = option(args, '--config');
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEjC,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAwB,MAAM,aAAa,CAAA;AAC5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAC5E,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAC1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAA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KAAK,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;IACrE,MAAM,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,aAAa,EAAE,MAAM,CAAC,aAAa,EAAE,CAAC,CAAA;IAC1E,MAAM,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAA;AACtC,CAAC;AAED,SAAS,MAAM,CAAC,IAAc,EAAE,IAAY;IAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IAChC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;AACjD,CAAC;AAED,SAAS,KAAK;IACZ,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,mdAAmd,CAAC,CAAA;IACze,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC;AAED,SAAS,UAAU,CAAC,KAAa;IAC/B,OAAO,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAA;AAC9C,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type FilesystemGrant, type HostCapabilities, type LocalToolsCapability } from '@layernorm/overlay-agent-bridge-protocol';
|
|
2
|
-
export declare const AGENT_HOST_VERSION = "0.
|
|
2
|
+
export declare const AGENT_HOST_VERSION = "0.10.0";
|
|
3
3
|
/** A host advertises only its local tools; it runs no agent harness. */
|
|
4
4
|
export declare function buildHostCapabilities(options: {
|
|
5
5
|
filesystem: FilesystemGrant;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-capabilities.d.ts","sourceRoot":"","sources":["../src/host-capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAE,KAAK,oBAAoB,EAAE,MAAM,0CAA0C,CAAA;AAGjK,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"host-capabilities.d.ts","sourceRoot":"","sources":["../src/host-capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAE,KAAK,oBAAoB,EAAE,MAAM,0CAA0C,CAAA;AAGjK,eAAO,MAAM,kBAAkB,WAAW,CAAA;AAE1C,wEAAwE;AACxE,wBAAgB,qBAAqB,CAAC,OAAO,EAAE;IAAE,UAAU,EAAE,eAAe,CAAC;IAAC,UAAU,EAAE,oBAAoB,CAAA;CAAE,GAAG,gBAAgB,CAQlI"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OVERLAY_AGENT_PROTOCOL_VERSION } from '@layernorm/overlay-agent-bridge-protocol';
|
|
2
2
|
import { platform, release } from 'node:os';
|
|
3
|
-
export const AGENT_HOST_VERSION = '0.
|
|
3
|
+
export const AGENT_HOST_VERSION = '0.10.0';
|
|
4
4
|
/** A host advertises only its local tools; it runs no agent harness. */
|
|
5
5
|
export function buildHostCapabilities(options) {
|
|
6
6
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-capabilities.js","sourceRoot":"","sources":["../src/host-capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAA0E,MAAM,0CAA0C,CAAA;AACjK,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAE3C,MAAM,CAAC,MAAM,kBAAkB,GAAG,
|
|
1
|
+
{"version":3,"file":"host-capabilities.js","sourceRoot":"","sources":["../src/host-capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAA0E,MAAM,0CAA0C,CAAA;AACjK,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAE3C,MAAM,CAAC,MAAM,kBAAkB,GAAG,QAAQ,CAAA;AAE1C,wEAAwE;AACxE,MAAM,UAAU,qBAAqB,CAAC,OAA0E;IAC9G,OAAO;QACL,eAAe,EAAE,8BAA8B;QAC/C,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,WAAW,EAAE,kBAAkB;QAC/B,QAAQ,EAAE,GAAG,QAAQ,EAAE,IAAI,OAAO,EAAE,EAAE;QACtC,UAAU,EAAE,OAAO,CAAC,UAAU;KAC/B,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyed-lock.d.ts","sourceRoot":"","sources":["../src/keyed-lock.ts"],"names":[],"mappings":"AAMA,wBAAsB,aAAa,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAKtF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runs work for the same key one at a time, in call order. Locks are shared by everything in this process, because
|
|
3
|
+
* synced threads and each private turn have their own LocalToolExecutor on the same files and sessions.
|
|
4
|
+
*/
|
|
5
|
+
const tails = new Map();
|
|
6
|
+
export async function withKeyedLock(key, work) {
|
|
7
|
+
const result = (tails.get(key) ?? Promise.resolve()).then(work);
|
|
8
|
+
const tail = result.catch(() => undefined);
|
|
9
|
+
tails.set(key, tail);
|
|
10
|
+
try {
|
|
11
|
+
return await result;
|
|
12
|
+
}
|
|
13
|
+
finally {
|
|
14
|
+
if (tails.get(key) === tail)
|
|
15
|
+
tails.delete(key);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=keyed-lock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyed-lock.js","sourceRoot":"","sources":["../src/keyed-lock.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,KAAK,GAAG,IAAI,GAAG,EAA4B,CAAA;AAEjD,MAAM,CAAC,KAAK,UAAU,aAAa,CAAI,GAAW,EAAE,IAAsB;IACxE,MAAM,MAAM,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC/D,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAA;IAC1C,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IACpB,IAAI,CAAC;QAAC,OAAO,MAAM,MAAM,CAAA;IAAC,CAAC;YAAS,CAAC;QAAC,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,IAAI;YAAE,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAAC,CAAC;AACxF,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type FilesystemGrant, type LocalExecResult, type LocalListFilesResult, type LocalReadFileResult } from '@layernorm/overlay-agent-bridge-protocol';
|
|
2
2
|
export declare const LOCAL_EXEC_MAX_OUTPUT_BYTES: number;
|
|
3
3
|
/** The user's login shell, so commands see the same PATH (Homebrew, nvm, …) as their terminal. */
|
|
4
4
|
export declare function localShell(): {
|
|
@@ -14,6 +14,7 @@ export declare function readLocalFile(grant: FilesystemGrant, input: {
|
|
|
14
14
|
path: string;
|
|
15
15
|
maxBytes: number;
|
|
16
16
|
}): Promise<LocalReadFileResult>;
|
|
17
|
+
export declare function sha256(bytes: Uint8Array): string;
|
|
17
18
|
export declare function writeLocalFile(grant: FilesystemGrant, input: {
|
|
18
19
|
path: string;
|
|
19
20
|
contentsBase64: string;
|
|
@@ -21,6 +22,18 @@ export declare function writeLocalFile(grant: FilesystemGrant, input: {
|
|
|
21
22
|
path: string;
|
|
22
23
|
bytes: number;
|
|
23
24
|
}>;
|
|
25
|
+
/**
|
|
26
|
+
* Saves a file only if it still has the revision the caller read. The lock covers Overlay's own file tools; another
|
|
27
|
+
* program can still save in the moment between the last check and the rename.
|
|
28
|
+
*/
|
|
29
|
+
export declare function replaceLocalFile(grant: FilesystemGrant, input: {
|
|
30
|
+
path: string;
|
|
31
|
+
contentsBase64: string;
|
|
32
|
+
expectedRevision: string;
|
|
33
|
+
}): Promise<{
|
|
34
|
+
path: string;
|
|
35
|
+
bytes: number;
|
|
36
|
+
}>;
|
|
24
37
|
export declare function listLocalFiles(grant: FilesystemGrant, input: {
|
|
25
38
|
path: string;
|
|
26
39
|
}): Promise<LocalListFilesResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-tools-exec.d.ts","sourceRoot":"","sources":["../src/local-tools-exec.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"local-tools-exec.d.ts","sourceRoot":"","sources":["../src/local-tools-exec.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACzB,MAAM,0CAA0C,CAAA;AAKjD,eAAO,MAAM,2BAA2B,QAAa,CAAA;AAGrD,kGAAkG;AAClG,wBAAgB,UAAU,IAAI;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,EAAE,CAAA;CAAE,CAIpF;AAmBD,wBAAsB,YAAY,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,eAAe,CAAC,CAuCtK;AAMD,wBAAsB,aAAa,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAWnI;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAEhD;AAqBD,wBAAsB,cAAc,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAUtJ;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,eAAe,EACtB,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAA;CAAE,GACxE,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAoB1C;AAED,wBAAsB,cAAc,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAanH"}
|
package/dist/local-tools-exec.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { spawn } from 'node:child_process';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
3
|
+
import { mkdir, readdir, readFile, lstat, open, rename, rm } from 'node:fs/promises';
|
|
4
|
+
import { dirname, join } from 'node:path';
|
|
5
|
+
import { COMPUTER_TEXT_MAX_BYTES, } from '@layernorm/overlay-agent-bridge-protocol';
|
|
6
|
+
import { withKeyedLock } from './keyed-lock.js';
|
|
4
7
|
import { LocalToolFailure } from './local-tools-errors.js';
|
|
5
|
-
import { resolveLocalToolPath, resolveLocalWorkingDirectory } from './local-tools-paths.js';
|
|
8
|
+
import { realLocation, resolveLocalToolPath, resolveLocalWorkingDirectory, unresolvedLocalToolPath } from './local-tools-paths.js';
|
|
6
9
|
export const LOCAL_EXEC_MAX_OUTPUT_BYTES = 256 * 1024;
|
|
7
10
|
const LIST_LIMIT = 500;
|
|
8
11
|
/** The user's login shell, so commands see the same PATH (Homebrew, nvm, …) as their terminal. */
|
|
@@ -53,6 +56,9 @@ export async function runLocalExec(grant, input, signal) {
|
|
|
53
56
|
};
|
|
54
57
|
const timer = setTimeout(kill, input.timeoutMs);
|
|
55
58
|
signal?.addEventListener('abort', kill, { once: true });
|
|
59
|
+
// Stopped while the folder was being checked: the event has already passed.
|
|
60
|
+
if (signal?.aborted)
|
|
61
|
+
kill();
|
|
56
62
|
try {
|
|
57
63
|
const exitCode = await new Promise((resolvePromise, reject) => {
|
|
58
64
|
child.once('error', reject);
|
|
@@ -96,18 +102,71 @@ export async function readLocalFile(grant, input) {
|
|
|
96
102
|
await handle.close();
|
|
97
103
|
}
|
|
98
104
|
}
|
|
105
|
+
export function sha256(bytes) {
|
|
106
|
+
return createHash('sha256').update(bytes).digest('hex');
|
|
107
|
+
}
|
|
108
|
+
/** One lock per real file, so two spellings of a path (or a linked folder) cannot be saved at the same time. */
|
|
109
|
+
async function withFileLock(path, work) {
|
|
110
|
+
return await withKeyedLock(`file:${await realLocation(path)}`, work);
|
|
111
|
+
}
|
|
112
|
+
/** Writes beside the target and renames, so a failed write never leaves a half-written file. */
|
|
113
|
+
async function saveFile(path, bytes, mode, beforeRename) {
|
|
114
|
+
const temporary = join(dirname(path), `.overlay-${randomUUID()}.tmp`);
|
|
115
|
+
try {
|
|
116
|
+
const handle = await open(temporary, 'wx', 0o600);
|
|
117
|
+
try {
|
|
118
|
+
await handle.writeFile(bytes);
|
|
119
|
+
await handle.chmod(mode);
|
|
120
|
+
}
|
|
121
|
+
finally {
|
|
122
|
+
await handle.close();
|
|
123
|
+
}
|
|
124
|
+
await beforeRename?.();
|
|
125
|
+
await rename(temporary, path);
|
|
126
|
+
}
|
|
127
|
+
finally {
|
|
128
|
+
await rm(temporary, { force: true });
|
|
129
|
+
}
|
|
130
|
+
}
|
|
99
131
|
export async function writeLocalFile(grant, input) {
|
|
100
132
|
const path = await resolveLocalToolPath(grant, input.path, 'write');
|
|
101
|
-
const existing = await lstat(path).catch(() => null);
|
|
102
|
-
if (existing && !existing.isFile())
|
|
103
|
-
throw new LocalToolFailure('invalid_input', `${input.path} is not a file.`);
|
|
104
133
|
const bytes = Buffer.from(input.contentsBase64, 'base64');
|
|
105
|
-
await
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
134
|
+
return await withFileLock(path, async () => {
|
|
135
|
+
const existing = await lstat(path).catch(() => null);
|
|
136
|
+
if (existing && !existing.isFile())
|
|
137
|
+
throw new LocalToolFailure('invalid_input', `${input.path} is not a file.`);
|
|
138
|
+
await mkdir(dirname(path), { recursive: true });
|
|
139
|
+
await saveFile(path, bytes, existing ? existing.mode & 0o777 : 0o644);
|
|
140
|
+
return { path, bytes: bytes.length };
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Saves a file only if it still has the revision the caller read. The lock covers Overlay's own file tools; another
|
|
145
|
+
* program can still save in the moment between the last check and the rename.
|
|
146
|
+
*/
|
|
147
|
+
export async function replaceLocalFile(grant, input) {
|
|
148
|
+
const bytes = Buffer.from(input.contentsBase64, 'base64');
|
|
149
|
+
const resolved = await resolveLocalToolPath(grant, input.path, 'write');
|
|
150
|
+
return await withFileLock(resolved, async () => {
|
|
151
|
+
// Resolved again under the lock: a folder may have become a link to somewhere that isn't approved.
|
|
152
|
+
const path = await resolveLocalToolPath(grant, input.path, 'write');
|
|
153
|
+
if (path !== resolved)
|
|
154
|
+
throw new LocalToolFailure('stale_revision', `${input.path} changed since it was read.`);
|
|
155
|
+
const named = await lstat(unresolvedLocalToolPath(grant, input.path)).catch(() => null);
|
|
156
|
+
const existing = await lstat(path).catch(() => null);
|
|
157
|
+
if (!named || !existing)
|
|
158
|
+
throw new LocalToolFailure('not_found', `No file at ${input.path}.`);
|
|
159
|
+
if (!named.isFile() || !existing.isFile())
|
|
160
|
+
throw new LocalToolFailure('invalid_input', `${input.path} is a link or is not a regular file. Edit the real file instead.`);
|
|
161
|
+
await saveFile(path, bytes, existing.mode & 0o777, async () => {
|
|
162
|
+
const current = await lstat(path).catch(() => null);
|
|
163
|
+
if (!current?.isFile() || current.size > COMPUTER_TEXT_MAX_BYTES
|
|
164
|
+
|| sha256(await readFile(path)) !== input.expectedRevision) {
|
|
165
|
+
throw new LocalToolFailure('stale_revision', `${input.path} changed since it was read.`);
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
return { path, bytes: bytes.length };
|
|
169
|
+
});
|
|
111
170
|
}
|
|
112
171
|
export async function listLocalFiles(grant, input) {
|
|
113
172
|
const path = await resolveLocalToolPath(grant, input.path, 'read');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-tools-exec.js","sourceRoot":"","sources":["../src/local-tools-exec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"local-tools-exec.js","sourceRoot":"","sources":["../src/local-tools-exec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAA;AACpF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EACL,uBAAuB,GAKxB,MAAM,0CAA0C,CAAA;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;A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IAAI,mBAAmB,CAAC,CAAA;IACvG,MAAM,KAAK,GAAG,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,CAAA;IAC/D,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QACzD,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;QAC9B,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAA;QAClD,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,OAAgB,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,WAAoB,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,MAAe,CAAC,CAAC,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,SAAkB,CAAC,CAAC,CAAC,OAAgB,CAAA;QACvL,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAA;IAChF,CAAC,CAAC,CAAC,CAAA;IACH,OAAO,EAAE,OAAO,EAAE,CAAA;AACpB,CAAC"}
|
|
@@ -2,6 +2,14 @@ import type { FilesystemGrant } from '@layernorm/overlay-agent-bridge-protocol';
|
|
|
2
2
|
/** The directory relative paths resolve against: the first approved root, or home for an all-files grant. */
|
|
3
3
|
export declare function localToolsBaseDirectory(grant: FilesystemGrant): string;
|
|
4
4
|
export declare function expandHome(path: string): string;
|
|
5
|
+
/**
|
|
6
|
+
* Real location of a path that may not exist yet: the nearest existing
|
|
7
|
+
* ancestor is resolved through symlinks and the missing tail is appended, so a
|
|
8
|
+
* write into a new folder is checked against where it will actually land.
|
|
9
|
+
*/
|
|
10
|
+
export declare function realLocation(path: string): Promise<string>;
|
|
11
|
+
/** The path as it was named, before links are followed. Not checked against the grant. */
|
|
12
|
+
export declare function unresolvedLocalToolPath(grant: FilesystemGrant, input: string): string;
|
|
5
13
|
/**
|
|
6
14
|
* Resolves a model-supplied path and enforces the approved roots. Symlinks are
|
|
7
15
|
* followed before the check, so a link inside a root cannot reach outside it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-tools-paths.d.ts","sourceRoot":"","sources":["../src/local-tools-paths.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAA;AAG/E,6GAA6G;AAC7G,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CAEtE;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAI/C;
|
|
1
|
+
{"version":3,"file":"local-tools-paths.d.ts","sourceRoot":"","sources":["../src/local-tools-paths.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAA;AAG/E,6GAA6G;AAC7G,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CAEtE;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAI/C;AAeD;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAShE;AAED,0FAA0F;AAC1F,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAErF;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAQzH;AAOD,0EAA0E;AAC1E,wBAAsB,4BAA4B,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAKrH"}
|
|
@@ -32,7 +32,7 @@ async function realRoots(grant) {
|
|
|
32
32
|
* ancestor is resolved through symlinks and the missing tail is appended, so a
|
|
33
33
|
* write into a new folder is checked against where it will actually land.
|
|
34
34
|
*/
|
|
35
|
-
async function realLocation(path) {
|
|
35
|
+
export async function realLocation(path) {
|
|
36
36
|
let current = path;
|
|
37
37
|
for (;;) {
|
|
38
38
|
try {
|
|
@@ -46,13 +46,17 @@ async function realLocation(path) {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
+
/** The path as it was named, before links are followed. Not checked against the grant. */
|
|
50
|
+
export function unresolvedLocalToolPath(grant, input) {
|
|
51
|
+
return resolve(localToolsBaseDirectory(grant), expandHome(input));
|
|
52
|
+
}
|
|
49
53
|
/**
|
|
50
54
|
* Resolves a model-supplied path and enforces the approved roots. Symlinks are
|
|
51
55
|
* followed before the check, so a link inside a root cannot reach outside it.
|
|
52
56
|
* Approved roots are a scope, not an operating-system sandbox.
|
|
53
57
|
*/
|
|
54
58
|
export async function resolveLocalToolPath(grant, input, mode) {
|
|
55
|
-
const absolute =
|
|
59
|
+
const absolute = unresolvedLocalToolPath(grant, input);
|
|
56
60
|
if (grant.mode === 'all_user_files')
|
|
57
61
|
return absolute;
|
|
58
62
|
const roots = await realRoots(grant);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-tools-paths.js","sourceRoot":"","sources":["../src/local-tools-paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,OAAO,E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K,gBAAgB;QAAE,OAAO,QAAQ,CAAA;IACpD,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,KAAK,CAAC,CAAA;IACpC,KAAK,IAAI,CAAA;IACT,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,QAAQ,CAAC,CAAA;IACzC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAAE,MAAM,OAAO,CAAC,KAAK,CAAC,CAAA;IACrE,OAAO,IAAI,CAAA;AACb,CAAC;AAED,SAAS,OAAO,CAAC,IAAY;IAC3B,OAAO,IAAI,gBAAgB,CAAC,0BAA0B,EACpD,GAAG,IAAI,gKAAgK,CAAC,CAAA;AAC5K,CAAC;AAED,0EAA0E;AAC1E,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAAC,KAAsB,EAAE,KAAyB;IAClG,MAAM,IAAI,GAAG,MAAM,oBAAoB,CAAC,KAAK,EAAE,KAAK,IAAI,uBAAuB,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAA;IAC/F,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAA;IACjD,IAAI,CAAC,KAAK,EAAE,WAAW,EAAE;QAAE,MAAM,IAAI,gBAAgB,CAAC,eAAe,EAAE,GAAG,KAAK,IAAI,IAAI,oCAAoC,CAAC,CAAA;IAC5H,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type FilesystemGrant } from '@layernorm/overlay-agent-bridge-protocol';
|
|
2
|
+
export declare function localTerminalsRoot(stateDirectory: string): string;
|
|
2
3
|
export declare class LocalTerminals {
|
|
3
4
|
private readonly root;
|
|
4
5
|
private starting;
|
|
@@ -11,9 +12,17 @@ export declare class LocalTerminals {
|
|
|
11
12
|
private ids;
|
|
12
13
|
start(grant: FilesystemGrant, request: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
13
14
|
read(request: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
15
|
+
/** Bytes of input this session has accepted, or null when it doesn't take input. */
|
|
16
|
+
private inputOffset;
|
|
17
|
+
private saveInputOffset;
|
|
18
|
+
/**
|
|
19
|
+
* Types into an interactive session, at most once. The new offset is saved before the text is sent, so after a crash
|
|
20
|
+
* the text may be lost but a repeated call is refused. It is put back only when nothing can have been sent.
|
|
21
|
+
*/
|
|
22
|
+
write(request: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
14
23
|
cancel(request: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
15
24
|
list(): Promise<Record<string, unknown>>;
|
|
16
|
-
/** Stop
|
|
17
|
-
stopAll(): Promise<void>;
|
|
25
|
+
/** Stop the given sessions, or every one for host shutdown and sign-out. */
|
|
26
|
+
stopAll(ids?: Iterable<string>): Promise<void>;
|
|
18
27
|
}
|
|
19
28
|
//# sourceMappingURL=local-tools-terminal.d.ts.map
|