@agentage/extension 0.4.2 → 0.4.3

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.
@@ -59,7 +59,7 @@ const webRequest = (req, body) => {
59
59
  };
60
60
  const send = async (response, res, auth) => {
61
61
  res.status(response.status);
62
- response.headers.forEach((value, key) => void res.setHeader(key, value));
62
+ response.headers.forEach((value, key) => void (key !== 'set-cookie' && res.setHeader(key, value)));
63
63
  // After the SDK headers: its SSE answer sets no-cache, which a token-checked answer overrides.
64
64
  if (auth)
65
65
  res.setHeader('Cache-Control', 'no-store');
@@ -19,6 +19,11 @@ export const PUBLIC_CORS = {
19
19
  allowedHeaders: ['Authorization', 'Content-Type', 'agcid', 'traceparent', 'If-Match'],
20
20
  exposedHeaders: ['agcid', 'ETag', 'Retry-After', 'RateLimit', 'WWW-Authenticate'],
21
21
  };
22
+ // api-standards section 5: parts take bearer tokens only, so no handler or log ever sees a cookie.
23
+ const dropCookie = (req, _res, next) => {
24
+ delete req.headers.cookie;
25
+ next();
26
+ };
22
27
  export const BODY_LIMIT = '1mb';
23
28
  const requestOrigin = (req) => `${req.protocol}://${req.get('host') ?? ''}`;
24
29
  const discoveryHandler = (options) => {
@@ -40,7 +45,7 @@ export const createPartApp = (options) => {
40
45
  const app = express();
41
46
  // The gateway calls parts over a private network; its X-Forwarded-Proto then sets req.protocol.
42
47
  app.set('trust proxy', 'loopback, linklocal, uniquelocal');
43
- app.use(agcidMiddleware, helmet(options.helmet));
48
+ app.use(dropCookie, agcidMiddleware, helmet(options.helmet));
44
49
  app.get('/health', healthHandler(options));
45
50
  if (options.part !== 'worker') {
46
51
  app.use('/.well-known', cors(PUBLIC_CORS));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentage/extension",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "The agentage extension kit: create(ctx) per part (pages, ui, api, mcp, worker, cli), the store, /health, discovery, the envelope, and the build tool with up and token",
5
5
  "type": "module",
6
6
  "license": "MIT",