agent-scenario-loop 0.1.3 → 0.1.5

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 (52) hide show
  1. package/app/profile-session.ts +263 -17
  2. package/dist/core/artifact-contract.d.ts +6 -4
  3. package/dist/core/artifact-contract.js +164 -15
  4. package/dist/core/artifact-layout.d.ts +2 -0
  5. package/dist/core/artifact-layout.js +2 -0
  6. package/dist/core/planner.js +4 -3
  7. package/dist/core/schema-validator.d.ts +1 -0
  8. package/dist/core/schema-validator.js +1 -0
  9. package/dist/runner/android-adb-driver.d.ts +7 -2
  10. package/dist/runner/android-adb-driver.js +7 -1
  11. package/dist/runner/android-adb.d.ts +40 -5
  12. package/dist/runner/android-adb.js +1046 -664
  13. package/dist/runner/ios-simctl.d.ts +1 -0
  14. package/dist/runner/ios-simctl.js +1 -0
  15. package/dist/runner/profile-android.d.ts +11 -1
  16. package/dist/runner/profile-android.js +266 -25
  17. package/dist/runner/profile-ios.d.ts +3 -2
  18. package/dist/runner/profile-ios.js +252 -22
  19. package/dist/runner/profile-mobile.d.ts +63 -4
  20. package/dist/runner/profile-mobile.js +1002 -20
  21. package/dist/runner/validate-project.js +3 -0
  22. package/dist/scripts/consumer-rehearsal.d.ts +127 -0
  23. package/dist/scripts/consumer-rehearsal.js +774 -0
  24. package/dist/scripts/downstream-local-package-gate.d.ts +2 -0
  25. package/dist/scripts/downstream-local-package-gate.js +264 -0
  26. package/dist/scripts/package-smoke.d.ts +104 -0
  27. package/dist/scripts/package-smoke.js +2304 -0
  28. package/dist/scripts/release-check.d.ts +47 -0
  29. package/dist/scripts/release-check.js +117 -0
  30. package/dist/scripts/release-readiness.d.ts +2 -0
  31. package/dist/scripts/release-readiness.js +539 -0
  32. package/docs/adapters.md +3 -1
  33. package/docs/api.md +2 -2
  34. package/docs/authoring.md +34 -2
  35. package/docs/consumer-rehearsal.md +33 -1
  36. package/docs/contracts.md +16 -2
  37. package/docs/live-proofs.md +12 -4
  38. package/examples/mobile-app/runner-manifests/evidence-provider.json +3 -3
  39. package/examples/mobile-app/scripts/asl-capture-profiler-provider.mjs +25 -0
  40. package/examples/runners/README.md +3 -3
  41. package/examples/runners/axe-accessibility-provider.json +2 -2
  42. package/examples/runners/script-accessibility-provider.json +2 -2
  43. package/examples/runners/script-memory-provider.json +2 -2
  44. package/examples/runners/script-network-provider.json +2 -2
  45. package/examples/runners/script-profiler-provider.json +2 -2
  46. package/package.json +12 -4
  47. package/schemas/manifest.schema.json +73 -3
  48. package/schemas/profiler.schema.json +243 -0
  49. package/schemas/runner-capabilities.schema.json +8 -2
  50. package/schemas/scenario.schema.json +18 -2
  51. package/templates/evidence-provider.json +3 -3
  52. package/templates/scripts/asl-capture-profiler-provider.mjs +20 -0
@@ -541,6 +541,9 @@ function escapeRegExp(value) {
541
541
  * @returns {boolean}
542
542
  */
543
543
  function hasNamedExport(source, exportName) {
544
+ if (/^\s*export\s+\*\s+from\s+['"][^'"]*agent-scenario-loop\/app\/profile-session['"]\s*;?/mu.test(source)) {
545
+ return true;
546
+ }
544
547
  const escapedName = escapeRegExp(exportName);
545
548
  const directExport = new RegExp(`^\\s*export\\s+(?:async\\s+)?(?:function|const|let|var)\\s+${escapedName}\\b`, 'mu');
546
549
  if (directExport.test(source)) {
@@ -0,0 +1,127 @@
1
+ #!/usr/bin/env node
2
+ type RunOptions = {
3
+ cwd: string;
4
+ env: NodeJS.ProcessEnv;
5
+ };
6
+ type FailedRunOutput = {
7
+ status: number | null;
8
+ stderr: string;
9
+ stdout: string;
10
+ };
11
+ /**
12
+ * Creates a clean npm environment for local tarball install rehearsals.
13
+ *
14
+ * @param {string} tempRoot
15
+ * @returns {NodeJS.ProcessEnv}
16
+ */
17
+ declare function createRehearsalEnv(tempRoot: string): NodeJS.ProcessEnv;
18
+ /**
19
+ * Resolves an existing tarball from the environment, when a parent release gate
20
+ * has already packed the current package.
21
+ *
22
+ * @param {NodeJS.ProcessEnv} env
23
+ * @returns {string | null}
24
+ */
25
+ declare function resolveProvidedTarball(env: NodeJS.ProcessEnv): string | null;
26
+ /**
27
+ * Runs a command and returns stdout while preserving child stderr on failure.
28
+ *
29
+ * @param {string} command
30
+ * @param {string[]} args
31
+ * @param {RunOptions} options
32
+ * @returns {string}
33
+ */
34
+ declare function run(command: string, args: string[], options: RunOptions): string;
35
+ /**
36
+ * Runs a command that must fail and returns captured output.
37
+ *
38
+ * @param {string} command
39
+ * @param {string[]} args
40
+ * @param {RunOptions} options
41
+ * @returns {FailedRunOutput}
42
+ */
43
+ declare function runExpectFailure(command: string, args: string[], options: RunOptions): FailedRunOutput;
44
+ /**
45
+ * Reads and parses a JSON file.
46
+ *
47
+ * @param {string} filePath
48
+ * @returns {Record<string, unknown>}
49
+ */
50
+ declare function readJson(filePath: string): Record<string, unknown>;
51
+ /**
52
+ * Writes stable formatted JSON.
53
+ *
54
+ * @param {string} filePath
55
+ * @param {unknown} value
56
+ * @returns {void}
57
+ */
58
+ declare function writeJson(filePath: string, value: unknown): void;
59
+ /**
60
+ * Resolves a package binary path inside a temporary npm app.
61
+ *
62
+ * @param {string} appRoot
63
+ * @param {string} name
64
+ * @returns {string}
65
+ */
66
+ declare function packageBinPath(appRoot: string, name: string): string;
67
+ /**
68
+ * Packs the current repo and returns the tarball path.
69
+ *
70
+ * @param {{env: NodeJS.ProcessEnv, packageRoot: string, packDir: string}} options
71
+ * @returns {string}
72
+ */
73
+ declare function packPackage({ env, packageRoot, packDir, }: {
74
+ env: NodeJS.ProcessEnv;
75
+ packageRoot: string;
76
+ packDir: string;
77
+ }): string;
78
+ /**
79
+ * Creates an existing app layout before Agent Scenario Loop initialization.
80
+ *
81
+ * @param {string} appRoot
82
+ * @returns {void}
83
+ */
84
+ declare function writeExistingAppFixture(appRoot: string): void;
85
+ /**
86
+ * Writes deterministic profile-event logs for the initialized consumer scenario.
87
+ *
88
+ * @param {string} appRoot
89
+ * @returns {{androidEvents: string, iosEvents: string}}
90
+ */
91
+ declare function writeProfileEventFixtures(appRoot: string): {
92
+ androidEvents: string;
93
+ iosEvents: string;
94
+ };
95
+ /**
96
+ * Writes a tiny Argent-compatible command for consumer-script rehearsal.
97
+ *
98
+ * @param {string} filePath
99
+ * @returns {void}
100
+ */
101
+ declare function writeFakeArgent(filePath: string): void;
102
+ /**
103
+ * Merges generated Agent Scenario Loop package-script snippets into the app package.json.
104
+ *
105
+ * @param {string} appRoot
106
+ * @returns {Record<string, string>}
107
+ */
108
+ declare function mergeGeneratedScripts(appRoot: string): Record<string, string>;
109
+ /**
110
+ * Replaces scaffold placeholders with realistic app identifiers before validation.
111
+ *
112
+ * @param {string} appRoot
113
+ * @returns {void}
114
+ */
115
+ declare function replaceConfigPlaceholders(appRoot: string): void;
116
+ /**
117
+ * Asserts that the installed package can initialize and validate an existing app.
118
+ *
119
+ * @param {{appRoot: string, env: NodeJS.ProcessEnv, tarballPath: string}} options
120
+ * @returns {void}
121
+ */
122
+ declare function rehearseConsumerInstall({ appRoot, env, tarballPath, }: {
123
+ appRoot: string;
124
+ env: NodeJS.ProcessEnv;
125
+ tarballPath: string;
126
+ }): void;
127
+ export { createRehearsalEnv, mergeGeneratedScripts, packageBinPath, packPackage, readJson, rehearseConsumerInstall, replaceConfigPlaceholders, resolveProvidedTarball, run, runExpectFailure, writeFakeArgent, writeExistingAppFixture, writeProfileEventFixtures, writeJson, };