experimental-ash 0.43.0 → 0.45.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.
Files changed (54) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/bin/ash.js +1 -0
  3. package/dist/docs/internals/mechanical-invariants.md +16 -0
  4. package/dist/docs/public/advanced/instrumentation.md +71 -21
  5. package/dist/docs/public/advanced/typescript-api.md +1 -1
  6. package/dist/docs/public/sandbox.md +38 -0
  7. package/dist/src/channel/compiled-channel.d.ts +4 -1
  8. package/dist/src/channel/compiled-channel.js +1 -1
  9. package/dist/src/channel/routes.d.ts +8 -10
  10. package/dist/src/compiled/.vendor-stamp.json +2 -2
  11. package/dist/src/compiled/@vercel/sandbox/index.d.ts +24 -19
  12. package/dist/src/compiled/@vercel/sandbox/index.js +5 -5
  13. package/dist/src/compiled/@vercel/sandbox/network-policy.d.ts +161 -0
  14. package/dist/src/compiled/@vercel/sandbox/package.json +1 -1
  15. package/dist/src/compiled/@workflow/core/runtime.js +13 -13
  16. package/dist/src/compiled/_chunks/node/{auth-CVVvWjaK.js → auth-BsyzphzW.js} +1 -1
  17. package/dist/src/compiled/_chunks/node/{version-nR4RSpFw.js → version-BGue04qw.js} +1 -1
  18. package/dist/src/compiled/just-bash/index.d.ts +23 -2
  19. package/dist/src/compiled/just-bash/network/types.d.ts +155 -0
  20. package/dist/src/compiler/artifacts.d.ts +1 -0
  21. package/dist/src/compiler/artifacts.js +1 -1
  22. package/dist/src/compiler/channel-instrumentation-types.d.ts +8 -0
  23. package/dist/src/compiler/channel-instrumentation-types.js +2 -0
  24. package/dist/src/context/dynamic-skill-lifecycle.d.ts +4 -3
  25. package/dist/src/context/dynamic-skill-lifecycle.js +1 -1
  26. package/dist/src/context/keys.d.ts +11 -4
  27. package/dist/src/execution/sandbox/bindings/local.js +1 -1
  28. package/dist/src/execution/sandbox/bindings/vercel.js +1 -1
  29. package/dist/src/execution/sandbox/session.d.ts +6 -1
  30. package/dist/src/execution/sandbox/session.js +1 -1
  31. package/dist/src/harness/tool-loop.js +1 -1
  32. package/dist/src/internal/application/package.js +1 -1
  33. package/dist/src/packages/ash-scaffold/src/channels.js +1 -1
  34. package/dist/src/packages/ash-scaffold/src/web-template.js +1 -0
  35. package/dist/src/public/channels/discord/discordChannel.d.ts +5 -2
  36. package/dist/src/public/channels/index.d.ts +1 -1
  37. package/dist/src/public/channels/slack/slackChannel.d.ts +6 -8
  38. package/dist/src/public/channels/teams/teamsChannel.d.ts +5 -2
  39. package/dist/src/public/channels/telegram/telegramChannel.d.ts +5 -2
  40. package/dist/src/public/channels/twilio/twilioChannel.d.ts +6 -3
  41. package/dist/src/public/definitions/defineChannel.d.ts +6 -3
  42. package/dist/src/public/definitions/instrumentation.d.ts +1 -152
  43. package/dist/src/public/definitions/instrumentation.js +1 -1
  44. package/dist/src/public/definitions/sandbox.d.ts +1 -1
  45. package/dist/src/public/instrumentation/index.d.ts +178 -1
  46. package/dist/src/public/instrumentation/index.js +1 -1
  47. package/dist/src/public/sandbox/index.d.ts +1 -0
  48. package/dist/src/runtime/resolve-channel.js +1 -1
  49. package/dist/src/shared/sandbox-network-policy.d.ts +23 -0
  50. package/dist/src/shared/sandbox-network-policy.js +1 -0
  51. package/dist/src/shared/sandbox-session.d.ts +36 -0
  52. package/dist/src/shared/skill-package.d.ts +7 -0
  53. package/dist/src/shared/skill-package.js +1 -1
  54. package/package.json +2 -2
@@ -0,0 +1,161 @@
1
+ //#region src/network-policy.d.ts
2
+ /**
3
+ * A transform applied to network requests matching a domain rule.
4
+ *
5
+ * @example
6
+ * {
7
+ * headers: { authorization: "Bearer sk-..." }
8
+ * }
9
+ */
10
+ type NetworkTransformer = {
11
+ /** Headers to set on the outgoing request. */
12
+ headers?: Record<string, string>;
13
+ };
14
+ /**
15
+ * Defines how a request value is matched.
16
+ */
17
+ type NetworkPolicyMatcher = {
18
+ /** Match the value exactly. */
19
+ exact?: string;
20
+ } | {
21
+ /** Match values that start with the provided prefix. */
22
+ startsWith?: string;
23
+ } | {
24
+ /** Match values against an RE2 regular expression. */
25
+ regex?: string;
26
+ };
27
+ /**
28
+ * Matcher for key/value request entries such as headers and query parameters.
29
+ */
30
+ type NetworkPolicyKeyValueMatcher = {
31
+ /** Matcher for the entry key. */
32
+ key?: NetworkPolicyMatcher;
33
+ /** Matcher for the entry value. */
34
+ value?: NetworkPolicyMatcher;
35
+ };
36
+ /**
37
+ * Request matcher for a network policy rule.
38
+ *
39
+ * All specified dimensions must match. Multiple methods are ORed; multiple
40
+ * header and query-string matchers are ANDed.
41
+ */
42
+ type NetworkPolicyMatch = {
43
+ /** Match on the request path. */
44
+ path?: NetworkPolicyMatcher;
45
+ /** Match on the HTTP method. */
46
+ method?: string[];
47
+ /** Match on query-string entries. */
48
+ queryString?: NetworkPolicyKeyValueMatcher[];
49
+ /** Match on request headers. */
50
+ headers?: NetworkPolicyKeyValueMatcher[];
51
+ };
52
+ /**
53
+ * A rule applied to requests matching a domain in the network policy.
54
+ */
55
+ type NetworkPolicyRule = {
56
+ /**
57
+ * Optional request matcher. When provided, transforms only apply to requests
58
+ * that match every specified dimension.
59
+ */
60
+ match?: NetworkPolicyMatch;
61
+ /**
62
+ * Transforms to apply to matching requests.
63
+ */
64
+ transform?: NetworkTransformer[];
65
+ /**
66
+ * HTTPS proxy URL to forward matching requests to. Must not include query string or fragment.
67
+ *
68
+ * You can use the `defineSandboxProxy` helper from `@vercel/sandbox/proxy` to implement the proxy handler
69
+ * automatically, which handles authorization and extracts metadata about the request and sandbox.
70
+ *
71
+ * @see https://vercel.com/docs/vercel-sandbox/concepts/firewall#requests-proxying
72
+ */
73
+ forwardURL?: string;
74
+ };
75
+ /**
76
+ * Network policy to define network restrictions for the sandbox.
77
+ *
78
+ * - `"allow-all"`: Full internet access (default). All traffic is allowed.
79
+ * - `"deny-all"`: No internet access. All traffic is denied.
80
+ * - Object: Custom access with explicit allow/deny lists.
81
+ *
82
+ * @example
83
+ * // Full internet access (default)
84
+ * "allow-all"
85
+ *
86
+ * @example
87
+ * // No external access
88
+ * "deny-all"
89
+ *
90
+ * @example
91
+ * // Custom access with specific domains (simple list)
92
+ * // All traffic not explicitly allowed is denied.
93
+ * {
94
+ * allow: ["*.npmjs.org", "github.com"],
95
+ * subnets: {
96
+ * allow: ["10.0.0.0/8"],
97
+ * deny: ["10.1.0.0/16"]
98
+ * }
99
+ * }
100
+ *
101
+ * @example
102
+ * // Custom access with specific domains (record form)
103
+ * {
104
+ * allow: {
105
+ * "*.npmjs.org": [],
106
+ * "github.com": [],
107
+ * }
108
+ * }
109
+ *
110
+ * @example
111
+ * // Custom access with request transformers
112
+ * {
113
+ * allow: {
114
+ * "ai-gateway.vercel.sh": [
115
+ * {
116
+ * match: {
117
+ * method: ["POST"],
118
+ * path: { startsWith: "/v1/" },
119
+ * headers: [
120
+ * { key: { exact: "x-api-key" }, value: { exact: "placeholder" } }
121
+ * ]
122
+ * },
123
+ * transform: [{
124
+ * headers: { authorization: "Bearer ..." }
125
+ * }]
126
+ * }
127
+ * ],
128
+ * "*": []
129
+ * }
130
+ * }
131
+ */
132
+ type NetworkPolicy = "allow-all" | "deny-all" | {
133
+ /**
134
+ * Domains to allow traffic to.
135
+ * Use "*" prefix for wildcard matching (e.g., "*.npmjs.org").
136
+ *
137
+ * Accepts either:
138
+ * - `string[]`: A simple list of domains to allow.
139
+ * - `Record<string, NetworkPolicyRule[]>`: A map of domains to rules.
140
+ * An empty array allows traffic with no additional rules.
141
+ */
142
+ allow?: string[] | Record<string, NetworkPolicyRule[]>;
143
+ /**
144
+ * Subnet-level access control using CIDR notation.
145
+ */
146
+ subnets?: {
147
+ /**
148
+ * List of CIDRs to allow traffic to.
149
+ * Traffic to these addresses will bypass the domain allowlist.
150
+ */
151
+ allow?: string[];
152
+ /**
153
+ * List of CIDRs to deny traffic to.
154
+ * These take precedence over allowed domains and CIDRs.
155
+ */
156
+ deny?: string[];
157
+ };
158
+ };
159
+ //#endregion
160
+ export { NetworkPolicy, NetworkPolicyKeyValueMatcher, NetworkPolicyMatch, NetworkPolicyMatcher, NetworkPolicyRule, NetworkTransformer };
161
+ //# sourceMappingURL=network-policy.d.ts.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "experimental-ash-compiled-vercel-sandbox",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "license": "Apache-2.0"