@skrr-ai/cli 0.1.101 → 0.1.103

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 (91) hide show
  1. package/dist/base-command.js +24 -0
  2. package/dist/commands/agent/message/send.js +6 -2
  3. package/dist/commands/agents/triggers/create.js +7 -17
  4. package/dist/commands/agents/triggers/update.js +41 -28
  5. package/dist/commands/commitments/control/apply.d.ts +15 -0
  6. package/dist/commands/commitments/control/apply.js +36 -0
  7. package/dist/commands/commitments/control/preview.d.ts +17 -0
  8. package/dist/commands/commitments/control/preview.js +43 -0
  9. package/dist/commands/commitments/control/show.d.ts +12 -0
  10. package/dist/commands/commitments/control/show.js +29 -0
  11. package/dist/commands/commitments/create.js +5 -2
  12. package/dist/commands/commitments/observation/probe.d.ts +15 -0
  13. package/dist/commands/commitments/observation/probe.js +46 -0
  14. package/dist/commands/commitments/observation/summary.d.ts +9 -0
  15. package/dist/commands/commitments/observation/summary.js +31 -0
  16. package/dist/commands/commitments/preflight.js +18 -1
  17. package/dist/commands/commitments/readiness/show.d.ts +12 -0
  18. package/dist/commands/commitments/readiness/show.js +29 -0
  19. package/dist/commands/commitments/readiness/verify.d.ts +13 -0
  20. package/dist/commands/commitments/readiness/verify.js +33 -0
  21. package/dist/commands/commitments/roster.d.ts +15 -0
  22. package/dist/commands/commitments/roster.js +39 -0
  23. package/dist/commands/commitments/show.js +1 -1
  24. package/dist/commands/commitments/status.d.ts +17 -0
  25. package/dist/commands/commitments/status.js +41 -0
  26. package/dist/commands/commitments/update.js +23 -9
  27. package/dist/commands/commitments/work-plan.d.ts +11 -0
  28. package/dist/commands/commitments/work-plan.js +36 -0
  29. package/dist/commands/compass/effective-policy.d.ts +12 -0
  30. package/dist/commands/compass/effective-policy.js +34 -0
  31. package/dist/commands/compass/update.d.ts +12 -0
  32. package/dist/commands/compass/update.js +27 -0
  33. package/dist/commands/daemon/logs.d.ts +39 -1
  34. package/dist/commands/daemon/logs.js +140 -13
  35. package/dist/commands/followups/checkin.js +46 -3
  36. package/dist/commands/machines/dedicated/exec.js +3 -1
  37. package/dist/commands/proposals/discard.d.ts +4 -0
  38. package/dist/commands/proposals/discard.js +3 -0
  39. package/dist/commands/proposals/keep.d.ts +4 -0
  40. package/dist/commands/proposals/keep.js +3 -0
  41. package/dist/commands/proposals/snooze.d.ts +4 -0
  42. package/dist/commands/proposals/snooze.js +3 -0
  43. package/dist/commands/spaces/workflows/cancel-node.d.ts +16 -0
  44. package/dist/commands/spaces/workflows/cancel-node.js +44 -0
  45. package/dist/commands/spaces/workflows/cancel.d.ts +40 -0
  46. package/dist/commands/spaces/workflows/cancel.js +109 -3
  47. package/dist/commands/spaces/workflows/run.d.ts +9 -0
  48. package/dist/commands/spaces/workflows/run.js +38 -0
  49. package/dist/commands/tasks/approvals/resolve.d.ts +12 -0
  50. package/dist/commands/tasks/approvals/resolve.js +21 -5
  51. package/dist/commands/tasks/schedule.js +1 -1
  52. package/dist/commands/triggers/capabilities.js +7 -0
  53. package/dist/commands/triggers/create.js +12 -18
  54. package/dist/commands/triggers/fire.js +3 -0
  55. package/dist/commands/triggers/update.js +41 -27
  56. package/dist/commands/widgets/check.d.ts +39 -0
  57. package/dist/commands/widgets/check.js +179 -0
  58. package/dist/lib/agent-mailbox.d.ts +0 -1
  59. package/dist/lib/agent-mailbox.js +0 -1
  60. package/dist/lib/commitment-loop-status.d.ts +16 -0
  61. package/dist/lib/commitment-loop-status.js +164 -0
  62. package/dist/lib/commitments.d.ts +47 -1
  63. package/dist/lib/commitments.js +218 -6
  64. package/dist/lib/compasses.d.ts +3 -0
  65. package/dist/lib/compasses.js +1 -0
  66. package/dist/lib/delegated-cli.d.ts +23 -1
  67. package/dist/lib/delegated-cli.js +61 -4
  68. package/dist/lib/first-party-harness.d.ts +1 -1
  69. package/dist/lib/first-party-harness.js +1 -1
  70. package/dist/lib/responsibility-controls.d.ts +11 -0
  71. package/dist/lib/responsibility-controls.js +119 -0
  72. package/dist/lib/session-task-write.d.ts +13 -0
  73. package/dist/lib/session-task-write.js +63 -3
  74. package/dist/lib/stewardship-output.js +13 -2
  75. package/dist/lib/triggers.d.ts +26 -0
  76. package/dist/lib/triggers.js +134 -1
  77. package/dist/lib/widgetCheck.d.ts +123 -0
  78. package/dist/lib/widgetCheck.js +998 -0
  79. package/dist/lib/widgetStaticScan.d.ts +111 -0
  80. package/dist/lib/widgetStaticScan.js +833 -0
  81. package/dist/lib/workflow-node-control.d.ts +10 -0
  82. package/dist/lib/workflow-node-control.js +76 -0
  83. package/dist/lib/workspaces.d.ts +2 -0
  84. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceIdentityBridge.d.ts +9 -1
  85. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceIdentityBridge.js +12 -0
  86. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceIdentityBridge.d.ts +9 -1
  87. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceIdentityBridge.js +12 -0
  88. package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
  89. package/dist/node_modules/@skrr-ai/data-provider/index.js +11924 -8704
  90. package/oclif.manifest.json +1487 -396
  91. package/package.json +11 -2
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Generative UI — a cheap, conservative static scan of a widget's CSS, HTML and
3
+ * JavaScript for things that predict a failure INSIDE the sandboxed frame.
4
+ *
5
+ * WHAT THIS IS NOT. It is not the frame. The frame's Content-Security-Policy and
6
+ * `sandbox="allow-scripts"` (packages/data-provider `generativeUi/csp.ts`) decide
7
+ * what actually runs; this module only reads source text and says what the frame
8
+ * would very likely refuse. Every finding is therefore tagged `heuristic` by the
9
+ * caller, and the wording never claims more than the text shows ("looks like a
10
+ * fetch() call"). A finding can be a false positive (a name inside a string that
11
+ * never runs); the ABSENCE of findings proves nothing, because a script can
12
+ * assemble `fetch` at run time. It exists so a harness can notice the likely
13
+ * mistake before it sends the message, when fixing it is free.
14
+ *
15
+ * Severity: `error` means "the frame's CSP or sandbox blocks this if it runs";
16
+ * `warn` means "this probably does not do what the author meant".
17
+ *
18
+ * It is a lexer-light scanner on purpose. JavaScript is read once into a CODE
19
+ * view (comments, string and template text and regular-expression bodies blanked,
20
+ * same length, line breaks kept) and a list of the string literals: the rules about
21
+ * calls and names run over the code view only, so `"eval( is blocked"` in a label and
22
+ * a comment that says "do not call fetch()" are not findings, and the rules about
23
+ * what a string SAYS (a URL, markup that loads one) run over the literals only. No
24
+ * regular expression here can backtrack on the size the widget limits allow, and
25
+ * HTML is walked with `indexOf`, not with a lazy regex.
26
+ *
27
+ * The eval's static checks (`api/.../eval/generativeUi/staticChecks.js`) ask most
28
+ * of the same questions with a lexer of their own (`sourceLexers.js`), because this
29
+ * package may not import from `api/`. `generativeUiScannerAgreement.spec.js` runs
30
+ * both over one corpus and fails when they disagree about what the frame refuses.
31
+ */
32
+ import { UI_WIDGET_FENCE } from '@skrr-ai/data-provider';
33
+ export type ScanSection = Exclude<(typeof UI_WIDGET_FENCE.sections)[number], 'fallback'>;
34
+ export type StaticSeverity = 'error' | 'warn';
35
+ export type StaticCode = 'external-resource' | 'external-url' | 'external-link' | 'relative-url' | 'network-api' | 'worker' | 'dynamic-code' | 'storage' | 'host-access' | 'popup' | 'navigation' | 'form-action' | 'base-element' | 'nested-frame' | 'plugin-element' | 'element-close' | 'webrtc';
36
+ export interface StaticFinding {
37
+ severity: StaticSeverity;
38
+ code: StaticCode;
39
+ section: ScanSection;
40
+ /** 1-based line within the section's own text. */
41
+ line: number;
42
+ message: string;
43
+ fix?: string;
44
+ }
45
+ /** A classic inline `<script>` found inside the html section. */
46
+ export interface InlineScript {
47
+ content: string;
48
+ /** 1-based line within the html section where the script's text starts. */
49
+ line: number;
50
+ }
51
+ export interface StaticScanResult {
52
+ findings: StaticFinding[];
53
+ /** Classic inline scripts of the html section, for a syntax check by the caller. */
54
+ inlineScripts: InlineScript[];
55
+ }
56
+ export interface WidgetSource {
57
+ css: string;
58
+ html: string;
59
+ js: string;
60
+ }
61
+ /** One string, template chunk or regular expression found in a script. */
62
+ export interface JsLiteral {
63
+ kind: 'string' | 'template' | 'regex';
64
+ /** Offset of the delimiter that opened it (a quote, a backtick, the `}` that resumed a template, a `/`). */
65
+ open: number;
66
+ /** Offset of the first character of its text. */
67
+ start: number;
68
+ /** Its text as written in the source: escapes are NOT interpreted. */
69
+ value: string;
70
+ }
71
+ export interface LexedJs {
72
+ /**
73
+ * The script with comments, string and template text and regular-expression
74
+ * bodies replaced by spaces: the same length, every line break kept, delimiters
75
+ * kept. What is left is what the engine would read as code (template `${ … }`
76
+ * expressions included).
77
+ */
78
+ code: string;
79
+ /** The script with only its comments blanked. */
80
+ commentless: string;
81
+ literals: JsLiteral[];
82
+ }
83
+ /**
84
+ * Read a script once. Total and linear: it never throws, every loop advances, and
85
+ * a misread costs a missed or an extra finding, never a hang. It is a heuristic
86
+ * where JavaScript is ambiguous (a `/` after `)` is read as division; an unclosed
87
+ * quote ends at the line break), and picks the reading that leaves the rest of the
88
+ * text lexable.
89
+ */
90
+ export declare function lexJs(src: string): LexedJs;
91
+ /**
92
+ * Blank the comments of JavaScript, leaving strings, template text and regular
93
+ * expressions untouched (the URLs a script uses live in strings). Strings end at
94
+ * a line break, so one unbalanced quote cannot swallow the rest of the file; the
95
+ * cost of a misread is a missed finding, never a false one.
96
+ */
97
+ export declare function maskJsComments(src: string): string;
98
+ /** Blank the block comments of CSS, stepping over quoted strings. */
99
+ export declare function maskCssComments(src: string): string;
100
+ /** Blank `<!-- … -->` comments of HTML. */
101
+ export declare function maskHtmlComments(src: string): string;
102
+ type UrlKind = 'external' | 'inline' | 'relative' | 'empty';
103
+ /** A URL the frame cannot fetch from, a self-contained one, or one with no base to resolve against. */
104
+ export declare function classifyUrl(raw: string): UrlKind;
105
+ /**
106
+ * Scan one widget's three sections. Pure and total: it never throws and reads
107
+ * only the strings it is given; the cost is linear in their length, which the
108
+ * caller has already bounded by the widget limits.
109
+ */
110
+ export declare function scanWidgetSource(source: WidgetSource): StaticScanResult;
111
+ export {};