create-astram-app 0.14.4 → 0.14.6
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-astram-app",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Scaffolder for a new Astram app — emits a running, framework-enforced NestJS server (deny-by-default, built-in auth/identity to switch on) and, with --with-frontend, a React admin/auth UI, over the immutable @astram/* framework packages.",
|
|
6
6
|
"type": "module",
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# The isolated file analyser for the AI assistant's file reads (@astram/agent, G-037 D2a).
|
|
2
|
+
#
|
|
3
|
+
# Only needed when server/src/app.module.ts imports AgentModule.forRoot({ files: { enabled: true } }).
|
|
4
|
+
# Every attached file (xlsx, csv, pdf, docx) is parsed here, never in the app server: no network,
|
|
5
|
+
# read-only filesystem, no capabilities, fixed limits, one worker process per call. Only the app
|
|
6
|
+
# server talks to it, over a unix socket in a shared volume.
|
|
7
|
+
#
|
|
8
|
+
# Add this to your deployment next to the app server, e.g.
|
|
9
|
+
# docker compose -f docker-compose.yml -f docker-compose.analyser.yml up -d
|
|
10
|
+
# The image is built from the npm package (install it in server/: `npm i @astram/file-analyser`);
|
|
11
|
+
# hosts without a container runtime use the package's systemd unit instead
|
|
12
|
+
# (node_modules/@astram/file-analyser/deploy/astram-file-analyser.service).
|
|
13
|
+
|
|
14
|
+
services:
|
|
15
|
+
astram-file-analyser:
|
|
16
|
+
build:
|
|
17
|
+
context: ./server/node_modules/@astram/file-analyser
|
|
18
|
+
image: astram-file-analyser:0.1.0
|
|
19
|
+
restart: unless-stopped
|
|
20
|
+
# No network at all, and no ports: the app reaches it only through the socket volume.
|
|
21
|
+
network_mode: none
|
|
22
|
+
read_only: true
|
|
23
|
+
cap_drop: [ALL]
|
|
24
|
+
# Docker's default seccomp profile stays on: never add `seccomp:unconfined`.
|
|
25
|
+
security_opt: [no-new-privileges:true]
|
|
26
|
+
mem_limit: 1g
|
|
27
|
+
memswap_limit: 1g
|
|
28
|
+
cpus: 1
|
|
29
|
+
pids_limit: 64
|
|
30
|
+
volumes:
|
|
31
|
+
- astram-analyser-sock:/run/astram-analyser
|
|
32
|
+
|
|
33
|
+
# Add to YOUR app server's service (its name in your compose file), not as a new service:
|
|
34
|
+
#
|
|
35
|
+
# server:
|
|
36
|
+
# # The socket directory is mode 0700, owned by the analyser's uid/gid 10001 (set in its
|
|
37
|
+
# # Dockerfile), so the app container must run as that same uid/gid to open the socket.
|
|
38
|
+
# user: '10001:10001'
|
|
39
|
+
# volumes:
|
|
40
|
+
# - astram-analyser-sock:/run/astram-analyser
|
|
41
|
+
# environment:
|
|
42
|
+
# AGENT_FILE_ANALYSER_SOCKET: /run/astram-analyser/analyser.sock
|
|
43
|
+
# AGENT_FILE_ANALYSER_TIMEOUT_MS: '12000'
|
|
44
|
+
# depends_on: [astram-file-analyser]
|
|
45
|
+
|
|
46
|
+
volumes:
|
|
47
|
+
# Holds only the analyser's socket. A new named volume takes the image directory's owner
|
|
48
|
+
# (10001) and mode (0700); nothing else mounts it.
|
|
49
|
+
astram-analyser-sock:
|
|
@@ -76,6 +76,21 @@ describe('createAgentStreamTransport', () => {
|
|
|
76
76
|
assert.equal(calls[0].init.body, '{"message":"Hi"}');
|
|
77
77
|
});
|
|
78
78
|
|
|
79
|
+
test('an attachments list in the body is sent as given (agent-file-read §3)', async () => {
|
|
80
|
+
const { fetchImpl, calls } = fetchSeq(sseResponse([FRAME]));
|
|
81
|
+
const t = createAgentStreamTransport({ getToken: () => 'tok-1', fetchImpl });
|
|
82
|
+
const attachments = ['0b9f8c7e-1d2a-4b3c-8d4e-5f6a7b8c9d0e'];
|
|
83
|
+
const res = await t.open({
|
|
84
|
+
method: 'POST',
|
|
85
|
+
path: '/agent/tasks/task_x/continue',
|
|
86
|
+
body: { message: 'Profile it', attachments },
|
|
87
|
+
signal: signal(),
|
|
88
|
+
});
|
|
89
|
+
assert.equal(res.status, 200);
|
|
90
|
+
await readAll(res.chunks);
|
|
91
|
+
assert.deepEqual(JSON.parse(calls[0].init.body), { message: 'Profile it', attachments });
|
|
92
|
+
});
|
|
93
|
+
|
|
79
94
|
test('GET replay sends Last-Event-ID and no body', async () => {
|
|
80
95
|
const { fetchImpl, calls } = fetchSeq(sseResponse([]));
|
|
81
96
|
const t = createAgentStreamTransport({ getToken: () => 'tok-1', fetchImpl });
|
|
@@ -182,6 +182,16 @@ NODE_ENV=development
|
|
|
182
182
|
# INVITE_LINK_TTL_HOURS=72
|
|
183
183
|
# INVITE_RATE_PER_ADMIN=30
|
|
184
184
|
|
|
185
|
+
# --- OPTIONAL: AI assistant file reading (@astram/agent, G-037 D2a) ---
|
|
186
|
+
# Read once at boot, and only when the app imports AgentModule.forRoot({ files: { enabled: true } })
|
|
187
|
+
# (this template does not wire AgentModule; files are off by default and nothing below is read).
|
|
188
|
+
# Every attached file is parsed by the isolated analyser (@astram/file-analyser), never by this
|
|
189
|
+
# server: run it as the sidecar in ../docker-compose.analyser.yml or as its systemd unit.
|
|
190
|
+
# Absolute path of the analyser's unix socket (required when files are on).
|
|
191
|
+
# AGENT_FILE_ANALYSER_SOCKET=/run/astram-analyser/analyser.sock
|
|
192
|
+
# Per-call bound in ms (default 12000, 1000-60000); a slower call fails closed.
|
|
193
|
+
# AGENT_FILE_ANALYSER_TIMEOUT_MS=12000
|
|
194
|
+
|
|
185
195
|
# --- OPTIONAL: release name for the permission catalog ---
|
|
186
196
|
# Stamped once on each permission key the catalog first sees (with the date), so admins can tell
|
|
187
197
|
# which release added it. 1-64 characters of letters, digits, . _ + - (a git tag or sha fits);
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
"postinstall": "node scripts/sync-astram-guide.mjs"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@astram/core": "1.
|
|
25
|
-
"@astram/engine": "0.17.
|
|
26
|
-
"@astram/guard": "0.
|
|
24
|
+
"@astram/core": "1.17.0",
|
|
25
|
+
"@astram/engine": "0.17.2",
|
|
26
|
+
"@astram/guard": "0.30.1",
|
|
27
27
|
"@astram/guide": "^0.2.8",
|
|
28
|
-
"@astram/identity": "0.
|
|
29
|
-
"@astram/messaging": "0.1.
|
|
30
|
-
"@astram/migrate": "0.7.
|
|
28
|
+
"@astram/identity": "0.29.0",
|
|
29
|
+
"@astram/messaging": "0.1.18",
|
|
30
|
+
"@astram/migrate": "0.7.7",
|
|
31
31
|
"@astram/sdk": "^0.2.0",
|
|
32
32
|
"@nestjs/common": "^11.2.7",
|
|
33
33
|
"@nestjs/core": "^11.2.7",
|