@agentic-surfaces/core 0.1.0 → 0.1.1

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.
@@ -23,6 +23,23 @@ export const httpHandler = {
23
23
  return { output: { dryRun: true, method, url: url.toString() } };
24
24
  }
25
25
  const headers = resolveObj(cfg.headers);
26
+ if (cfg.auth) {
27
+ const auth = cfg.auth;
28
+ if (auth.type !== "basic") {
29
+ throw new Error(`unsupported auth type: ${auth.type}`);
30
+ }
31
+ const hasAuthHeader = Object.keys(headers).some((k) => k.toLowerCase() === "authorization");
32
+ if (hasAuthHeader) {
33
+ throw new Error("ambiguous auth: both auth block and an authorization header were set");
34
+ }
35
+ const username = resolveSecrets(auth.username);
36
+ const password = resolveSecrets(auth.password);
37
+ if (!username || !password) {
38
+ throw new Error("auth.basic: username and password must resolve to non-empty strings");
39
+ }
40
+ const encoded = Buffer.from(`${username}:${password}`).toString("base64");
41
+ headers["authorization"] = `Basic ${encoded}`;
42
+ }
26
43
  let body;
27
44
  if (cfg.bodyExpression) {
28
45
  const data = await jsonata(cfg.bodyExpression).evaluate(buildJsonataScope(ctx));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentic-surfaces/core",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -23,7 +23,7 @@
23
23
  "jsonata": "^2.2.1",
24
24
  "yaml": "^2.9.0",
25
25
  "zod": "^4.4.3",
26
- "@agentic-surfaces/agent": "0.1.0"
26
+ "@agentic-surfaces/agent": "0.1.1"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/better-sqlite3": "^7.6.13",