@zackbart/connecta 0.29.0 → 0.30.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 (69) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/README.md +123 -134
  3. package/bin/connecta.mjs +13 -2
  4. package/bin/version.mjs +1 -1
  5. package/dist/argument-redaction.js +230 -0
  6. package/dist/auth-elicitation.js +14 -9
  7. package/dist/authorization-handoff.js +111 -0
  8. package/dist/catalog-cache.js +2 -2
  9. package/dist/catalog-service.js +103 -63
  10. package/dist/config.d.ts +2 -0
  11. package/dist/config.js +12 -7
  12. package/dist/connectors/guarded-fetch.js +3 -3
  13. package/dist/connectors/negotiation-cache.js +1 -1
  14. package/dist/downstream-input-context.js +9 -0
  15. package/dist/downstream-input.js +13 -11
  16. package/dist/errors.d.ts +36 -12
  17. package/dist/errors.js +19 -9
  18. package/dist/execute.js +375 -43
  19. package/dist/executor-result.js +11 -9
  20. package/dist/executors/quickjs-child.js +12 -5
  21. package/dist/executors/quickjs-protocol.js +5 -6
  22. package/dist/executors/quickjs-runtime.js +6 -1
  23. package/dist/executors/quickjs.js +20 -4
  24. package/dist/guest-runtime.js +52 -2
  25. package/dist/guest-types.d.ts +47 -5
  26. package/dist/index.d.ts +1 -1
  27. package/dist/invocation.js +40 -14
  28. package/dist/meta-output.js +0 -15
  29. package/dist/meta-tools.js +166 -95
  30. package/dist/oauth-handoff.js +88 -11
  31. package/dist/program-result.js +5 -0
  32. package/dist/program-writes.js +5 -1
  33. package/dist/provider.d.ts +1 -1
  34. package/dist/providers/_shared/google/workspace.d.ts +1 -1
  35. package/dist/providers/_shared/request-token.js +83 -0
  36. package/dist/providers/infisical/index.d.ts +7 -0
  37. package/dist/providers/infisical/index.js +713 -0
  38. package/dist/providers/infisical/skill.generated.js +8 -0
  39. package/dist/registry.d.ts +8 -6
  40. package/dist/registry.js +134 -61
  41. package/dist/resource-read.js +4 -1
  42. package/dist/routes/mcp.js +11 -2
  43. package/dist/sent-secrets.d.ts +54 -13
  44. package/dist/sent-secrets.js +770 -231
  45. package/dist/skills.js +26 -16
  46. package/dist/sqlite.js +21 -6
  47. package/dist/storage/keys.js +20 -5
  48. package/dist/storage/memory.js +9 -4
  49. package/dist/storage/sql.js +18 -9
  50. package/dist/types.d.ts +17 -3
  51. package/dist/usage-guide.js +49 -40
  52. package/dist/version.d.ts +1 -1
  53. package/dist/version.js +1 -1
  54. package/dist/worker.js +2 -1
  55. package/documentation/README.md +63 -0
  56. package/documentation/architecture.md +121 -89
  57. package/documentation/auth.md +138 -5
  58. package/documentation/code-mode.md +224 -107
  59. package/documentation/deploying.md +146 -0
  60. package/documentation/integrating.md +159 -0
  61. package/documentation/meta-tools.md +135 -30
  62. package/documentation/operating.md +135 -0
  63. package/documentation/operator-tests.md +4 -0
  64. package/documentation/operator-ui.md +132 -0
  65. package/documentation/provider-migration-0.29.md +5 -0
  66. package/examples/worker/README.md +7 -0
  67. package/package.json +7 -1
  68. package/templates/node/README.md +7 -0
  69. package/templates/node/package.json +1 -1
package/dist/errors.js CHANGED
@@ -1,5 +1,6 @@
1
1
  // Typed failure contract for connector tool calls. Web-API only — no node:
2
2
  // imports here.
3
+ import { redactCallArguments } from "./argument-redaction.js";
3
4
  const CLASSIFICATION_CODE_TABLE = {
4
5
  timeout: true,
5
6
  auth_required: true,
@@ -116,25 +117,34 @@ export function boundedEchoText(value, maxBytes = MAX_ECHOED_BYTES) {
116
117
  return `${echoDecoder.decode(bytes.slice(0, end))}…`;
117
118
  }
118
119
  /**
119
- * `{ args }` when the caller's arguments fit the shared echo budget,
120
- * `{}` when they do not. All or nothing: a clipped echo would be a *different*
121
- * call than the one that was refused, and the routes this feeds end at a human
122
- * approving one. Unserializable arguments are treated the same way as oversized
123
- * ones — there is nothing honest to put in the field.
120
+ * Snapshot the caller's arguments after bounded schema-aware writeOnly omission,
121
+ * then apply the shared byte budget without clipping. Unresolved sensitivity
122
+ * omits the entire echo. argsRedacted marks partial or withheld arguments as
123
+ * reconciliation context; any retry must use the caller's original arguments.
124
124
  */
125
- export function echoedCallArgs(args) {
125
+ export function echoedCallArgs(args, schema) {
126
126
  if (args === undefined)
127
127
  return {};
128
128
  let text;
129
+ let redacted = false;
129
130
  try {
130
- text = JSON.stringify(args);
131
+ const filtered = schema ? redactCallArguments(args, schema) : { value: args, redacted: false };
132
+ redacted = filtered.redacted;
133
+ if (!("value" in filtered))
134
+ return { argsRedacted: true };
135
+ const safeArgs = filtered.value;
136
+ text = JSON.stringify(safeArgs);
131
137
  }
132
138
  catch {
133
- return {};
139
+ return redacted ? { argsRedacted: true } : {};
134
140
  }
135
141
  if (text === undefined)
136
142
  return {};
137
- return echoEncoder.encode(text).length <= MAX_ECHOED_BYTES ? { args: JSON.parse(text) } : {};
143
+ return echoEncoder.encode(text).length <= MAX_ECHOED_BYTES
144
+ ? { args: JSON.parse(text), ...(redacted ? { argsRedacted: true } : {}) }
145
+ : redacted
146
+ ? { argsRedacted: true }
147
+ : {};
138
148
  }
139
149
  function boundedValidation(details) {
140
150
  if (!details)