wave-agent-sdk 1.1.5 → 1.2.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 (86) hide show
  1. package/dist/agent.d.ts +70 -24
  2. package/dist/agent.js +110 -30
  3. package/dist/builtin/plugins.js +11 -20
  4. package/dist/builtin/skills/settings.js +6 -8
  5. package/dist/core/plugin.d.ts +4 -0
  6. package/dist/core/plugin.js +7 -1
  7. package/dist/index.d.ts +2 -1
  8. package/dist/index.js +2 -1
  9. package/dist/managers/aiManager.d.ts +0 -24
  10. package/dist/managers/aiManager.js +14 -181
  11. package/dist/managers/bashModeManager.d.ts +33 -0
  12. package/dist/managers/bashModeManager.js +110 -0
  13. package/dist/managers/hookManager.d.ts +5 -0
  14. package/dist/managers/hookManager.js +7 -0
  15. package/dist/managers/liveConfigManager.js +3 -3
  16. package/dist/managers/mcpManager.d.ts +23 -0
  17. package/dist/managers/mcpManager.js +162 -14
  18. package/dist/managers/messageManager.d.ts +12 -13
  19. package/dist/managers/messageManager.js +63 -60
  20. package/dist/managers/permissionManager.d.ts +29 -0
  21. package/dist/managers/permissionManager.js +158 -70
  22. package/dist/managers/planManager.d.ts +9 -0
  23. package/dist/managers/planManager.js +19 -1
  24. package/dist/managers/skillManager.d.ts +31 -0
  25. package/dist/managers/skillManager.js +122 -12
  26. package/dist/managers/slashCommandManager.js +9 -28
  27. package/dist/managers/subagentManager.d.ts +7 -0
  28. package/dist/managers/subagentManager.js +61 -9
  29. package/dist/managers/workflowManager.js +6 -0
  30. package/dist/prompts/index.d.ts +0 -1
  31. package/dist/prompts/index.js +0 -4
  32. package/dist/services/MarketplaceService.js +36 -14
  33. package/dist/services/configurationService.d.ts +34 -2
  34. package/dist/services/configurationService.js +123 -16
  35. package/dist/services/initializationService.js +2 -2
  36. package/dist/services/jsonlHandler.d.ts +14 -0
  37. package/dist/services/jsonlHandler.js +44 -1
  38. package/dist/services/memory.d.ts +14 -0
  39. package/dist/services/memory.js +33 -0
  40. package/dist/services/officialMarketplaceMirror.d.ts +85 -0
  41. package/dist/services/officialMarketplaceMirror.js +289 -0
  42. package/dist/services/remoteSettingsService.js +4 -4
  43. package/dist/services/session.js +30 -13
  44. package/dist/services/worktreeHooks.js +6 -1
  45. package/dist/stdio/index.d.ts +10 -0
  46. package/dist/stdio/index.js +10 -0
  47. package/dist/stdio/notificationRouter.d.ts +38 -0
  48. package/dist/stdio/notificationRouter.js +96 -0
  49. package/dist/stdio/rpcClient.d.ts +18 -0
  50. package/dist/stdio/rpcClient.js +10 -0
  51. package/dist/stdio/stdioAgent.d.ts +222 -0
  52. package/dist/stdio/stdioAgent.js +341 -0
  53. package/dist/tools/bashTool.js +2 -0
  54. package/dist/tools/exitPlanMode.js +10 -2
  55. package/dist/types/agent.d.ts +8 -0
  56. package/dist/types/commands.d.ts +7 -0
  57. package/dist/types/configuration.d.ts +6 -1
  58. package/dist/types/hooks.d.ts +1 -0
  59. package/dist/types/hooks.js +19 -0
  60. package/dist/types/mcp.d.ts +3 -0
  61. package/dist/types/messaging.d.ts +1 -8
  62. package/dist/types/skills.d.ts +11 -0
  63. package/dist/utils/bashParser.d.ts +17 -0
  64. package/dist/utils/bashParser.js +72 -0
  65. package/dist/utils/bashStructure/bashLexer.d.ts +96 -0
  66. package/dist/utils/bashStructure/bashLexer.js +676 -0
  67. package/dist/utils/bashStructure/bashParser.d.ts +144 -0
  68. package/dist/utils/bashStructure/bashParser.js +606 -0
  69. package/dist/utils/bashStructure/bashSemantics.d.ts +70 -0
  70. package/dist/utils/bashStructure/bashSemantics.js +477 -0
  71. package/dist/utils/bashStructure/index.d.ts +26 -0
  72. package/dist/utils/bashStructure/index.js +27 -0
  73. package/dist/utils/bashStructure/types.d.ts +62 -0
  74. package/dist/utils/bashStructure/types.js +47 -0
  75. package/dist/utils/containerSetup.js +5 -6
  76. package/dist/utils/fileUtils.d.ts +11 -0
  77. package/dist/utils/fileUtils.js +37 -0
  78. package/dist/utils/messageOperations.d.ts +0 -18
  79. package/dist/utils/messageOperations.js +0 -62
  80. package/dist/utils/subagentParser.js +9 -2
  81. package/dist/utils/tokenCalculation.js +0 -8
  82. package/dist/utils/worktreeUtils.d.ts +2 -1
  83. package/dist/utils/worktreeUtils.js +64 -34
  84. package/package.json +6 -1
  85. package/dist/managers/bangManager.d.ts +0 -26
  86. package/dist/managers/bangManager.js +0 -78
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Tokenizer for the structure-aware bash parser.
3
+ *
4
+ * Unlike `bashParser.ts`'s text-based heuristics, this tokenizer understands
5
+ * bash quoting so that structural tokens (;, &&, ||, |, &, ( ), do/done/fi…)
6
+ * are only recognized OUTSIDE quotes/substitutions, and words keep enough
7
+ * internal structure for the semantic layer to tell quoted `"$f"` from bare
8
+ * `$f`.
9
+ *
10
+ * Words are tokenized into parts:
11
+ * - lit literal text (single-quoted or plain)
12
+ * - var `$name` / `${name}` expansion (name kept raw, unexpanded)
13
+ * - special `$@` `$*` `$?` `$$` `$!` `$#` `$-` `$0`..`$9`
14
+ * - cmdsub `$(...)` or backtick command substitution (text = inner)
15
+ * - arith `$((...))` — unsupported (dynamic), fail closed
16
+ * - brace `{a,b}` brace expansion — unsupported (dynamic)
17
+ * - process `<(cmd)` / `>(cmd)` process substitution — unsupported
18
+ * Each part records whether it appeared inside double quotes (`q: 'double'`)
19
+ * or bare (`q: 'none'`); single-quoted text is fully literal.
20
+ *
21
+ * The tokenizer FAILS (returns null) on any construct it cannot safely delimit
22
+ * (unterminated quotes / $( / backticks / heredocs). Failures are surfaced by
23
+ * the caller as a fail-closed `unsupported` parse result.
24
+ */
25
+ export type QuoteCtx = "none" | "single" | "double";
26
+ export type WordPart = {
27
+ t: "lit";
28
+ v: string;
29
+ q: QuoteCtx;
30
+ } | {
31
+ t: "var";
32
+ name: string;
33
+ q: "none" | "double";
34
+ } | {
35
+ t: "special";
36
+ name: string;
37
+ q: "none" | "double";
38
+ } | {
39
+ t: "cmdsub";
40
+ text: string;
41
+ q: "none" | "double";
42
+ } | {
43
+ t: "arith";
44
+ q: "none" | "double";
45
+ } | {
46
+ t: "brace";
47
+ v: string;
48
+ q: "none" | "double";
49
+ } | {
50
+ t: "process";
51
+ text: string;
52
+ q: "none" | "double";
53
+ };
54
+ export interface WordToken {
55
+ t: "word";
56
+ /** Raw word text as written (quotes and $ references preserved). */
57
+ raw: string;
58
+ /** Inner structure for the semantic layer. */
59
+ parts: WordPart[];
60
+ }
61
+ export type OpToken = "&&" | "||" | "|" | "|&" | ";" | ";;" | ";&" | ";;&" | "&" | "(" | ")" | "newline" | "{" | "}";
62
+ export interface OpTok {
63
+ t: "op";
64
+ op: OpToken;
65
+ }
66
+ export interface NlTok {
67
+ t: "nl";
68
+ }
69
+ export type Token = WordToken | OpTok | NlTok | {
70
+ t: "eof";
71
+ };
72
+ /** Raw tokenizer failure: a construct we cannot model → ask (fail closed). */
73
+ export type LexFailureReason = "heredoc" | "unterminated" | "unexpected-char" | "length-limit";
74
+ export declare function isVariableNameStart(ch: string): boolean;
75
+ /**
76
+ * Classify a redirection operator word emitted by the tokenizer.
77
+ * Returns "plain" when the operator still needs a separate following target
78
+ * word (`>`, `2>`, `>>`, `&>`, `>&` …), "folded" when the target is already
79
+ * part of the operator token (`2>&1`, `>&-`), or null when the word is not a
80
+ * redirection operator.
81
+ *
82
+ * The raw word may carry an optional file-descriptor digit prefix (`2>`) and
83
+ * the dup operators `<&`/`>&` may fold their fd/- target when it directly
84
+ * touches the operator (`2>&1` must stay one token so the reconstructed text
85
+ * remains faithful — legacy `2>& 1` text checks would mis-read the target).
86
+ */
87
+ export declare function redirectOpKind(raw: string): "plain" | "folded" | null;
88
+ /** True when the raw text is a redirection operator (fd prefix allowed). */
89
+ export declare function isRedirectRaw(raw: string): boolean;
90
+ /** Whether a word token is a redirection operator (raw literal, no quoting). */
91
+ export declare function isRedirectWord(w: WordToken): boolean;
92
+ /**
93
+ * Tokenize a bash command string. Returns tokens or null on a lexical
94
+ * construct we deliberately do not support (fail closed).
95
+ */
96
+ export declare function tokenize(input: string): Token[] | null;