@sonde/agent 0.2.2 → 0.2.4

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 (50) hide show
  1. package/.turbo/turbo-build.log +6 -4
  2. package/.turbo/turbo-test.log +66 -21
  3. package/.turbo/turbo-typecheck.log +1 -1
  4. package/CHANGELOG.md +16 -0
  5. package/dist/cli/mcp-bridge.d.ts +2 -0
  6. package/dist/cli/mcp-bridge.d.ts.map +1 -0
  7. package/dist/cli/mcp-bridge.js +193 -0
  8. package/dist/cli/mcp-bridge.js.map +1 -0
  9. package/dist/cli/mcp-bridge.test.d.ts +2 -0
  10. package/dist/cli/mcp-bridge.test.d.ts.map +1 -0
  11. package/dist/cli/mcp-bridge.test.js +54 -0
  12. package/dist/cli/mcp-bridge.test.js.map +1 -0
  13. package/dist/cli/update.d.ts +18 -0
  14. package/dist/cli/update.d.ts.map +1 -0
  15. package/dist/cli/update.js +71 -0
  16. package/dist/cli/update.js.map +1 -0
  17. package/dist/cli/update.test.d.ts +2 -0
  18. package/dist/cli/update.test.d.ts.map +1 -0
  19. package/dist/cli/update.test.js +55 -0
  20. package/dist/cli/update.test.js.map +1 -0
  21. package/dist/config.d.ts +1 -0
  22. package/dist/config.d.ts.map +1 -1
  23. package/dist/config.js +16 -2
  24. package/dist/config.js.map +1 -1
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +65 -6
  27. package/dist/index.js.map +1 -1
  28. package/dist/runtime/connection.d.ts +1 -0
  29. package/dist/runtime/connection.d.ts.map +1 -1
  30. package/dist/runtime/connection.js +33 -7
  31. package/dist/runtime/connection.js.map +1 -1
  32. package/dist/runtime/executor.d.ts +6 -0
  33. package/dist/runtime/executor.d.ts.map +1 -1
  34. package/dist/runtime/executor.js +4 -4
  35. package/dist/runtime/executor.js.map +1 -1
  36. package/dist/version.d.ts +2 -0
  37. package/dist/version.d.ts.map +1 -0
  38. package/dist/version.js +7 -0
  39. package/dist/version.js.map +1 -0
  40. package/package.json +1 -1
  41. package/src/cli/mcp-bridge.test.ts +58 -0
  42. package/src/cli/mcp-bridge.ts +217 -0
  43. package/src/cli/update.test.ts +69 -0
  44. package/src/cli/update.ts +78 -0
  45. package/src/config.ts +16 -2
  46. package/src/index.ts +73 -8
  47. package/src/runtime/connection.ts +43 -9
  48. package/src/runtime/executor.ts +17 -5
  49. package/src/version.ts +10 -0
  50. package/tsconfig.tsbuildinfo +1 -1
@@ -1,13 +1,18 @@
1
1
  import { execFile } from 'node:child_process';
2
2
  import { promisify } from 'node:util';
3
- import { type ExecFn, type Pack, packRegistry } from '@sonde/packs';
3
+ import {
4
+ type ExecFn,
5
+ type Pack,
6
+ type PackRegistryOptions,
7
+ createPackRegistry,
8
+ packRegistry,
9
+ } from '@sonde/packs';
4
10
  import type { ProbeRequest, ProbeResponse } from '@sonde/shared';
11
+ import { VERSION } from '../version.js';
5
12
  import { type ScrubPattern, buildPatterns, scrubData } from './scrubber.js';
6
13
 
7
14
  const execFileAsync = promisify(execFile);
8
15
 
9
- const AGENT_VERSION = '0.1.0';
10
-
11
16
  /** Default exec function that shells out to real commands */
12
17
  async function defaultExec(command: string, args: string[]): Promise<string> {
13
18
  const { stdout } = await execFileAsync(command, args, {
@@ -17,6 +22,13 @@ async function defaultExec(command: string, args: string[]): Promise<string> {
17
22
  return stdout;
18
23
  }
19
24
 
25
+ export interface ProbeExecutorOptions {
26
+ packs?: ReadonlyMap<string, Pack>;
27
+ exec?: ExecFn;
28
+ scrubPatterns?: ScrubPattern[];
29
+ allowUnsignedPacks?: boolean;
30
+ }
31
+
20
32
  export class ProbeExecutor {
21
33
  private packs: ReadonlyMap<string, Pack>;
22
34
  private exec: ExecFn;
@@ -73,7 +85,7 @@ export class ProbeExecutor {
73
85
  data,
74
86
  durationMs: Date.now() - start,
75
87
  metadata: {
76
- agentVersion: AGENT_VERSION,
88
+ agentVersion: VERSION,
77
89
  packName: pack.manifest.name,
78
90
  packVersion: pack.manifest.version,
79
91
  capabilityLevel: 'observe',
@@ -97,7 +109,7 @@ export class ProbeExecutor {
97
109
  data: { error: message },
98
110
  durationMs: Date.now() - startMs,
99
111
  metadata: {
100
- agentVersion: AGENT_VERSION,
112
+ agentVersion: VERSION,
101
113
  packName: pack?.manifest.name ?? 'unknown',
102
114
  packVersion: pack?.manifest.version ?? '0.0.0',
103
115
  capabilityLevel: 'observe',
package/src/version.ts ADDED
@@ -0,0 +1,10 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { dirname, resolve } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+
5
+ const __dirname = dirname(fileURLToPath(import.meta.url));
6
+ const pkg = JSON.parse(readFileSync(resolve(__dirname, '..', 'package.json'), 'utf-8')) as {
7
+ version: string;
8
+ };
9
+
10
+ export const VERSION: string = pkg.version;