@testany/hephos 0.3.17 → 0.4.0-dev.3

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 (82) hide show
  1. package/README.md +29 -0
  2. package/out/auth/AuthConfig.d.ts +54 -0
  3. package/out/auth/AuthConfig.d.ts.map +1 -0
  4. package/out/auth/AuthConfig.js +70 -0
  5. package/out/auth/AuthConfig.js.map +1 -0
  6. package/out/auth/AuthService.d.ts +74 -0
  7. package/out/auth/AuthService.d.ts.map +1 -0
  8. package/out/auth/AuthService.js +275 -0
  9. package/out/auth/AuthService.js.map +1 -0
  10. package/out/auth/CallbackServer.d.ts +15 -0
  11. package/out/auth/CallbackServer.d.ts.map +1 -0
  12. package/out/auth/CallbackServer.js +277 -0
  13. package/out/auth/CallbackServer.js.map +1 -0
  14. package/out/auth/TokenCache.d.ts +81 -0
  15. package/out/auth/TokenCache.d.ts.map +1 -0
  16. package/out/auth/TokenCache.js +191 -0
  17. package/out/auth/TokenCache.js.map +1 -0
  18. package/out/auth/index.d.ts +11 -0
  19. package/out/auth/index.d.ts.map +1 -0
  20. package/out/auth/index.js +13 -0
  21. package/out/auth/index.js.map +1 -0
  22. package/out/auth/types.d.ts +75 -0
  23. package/out/auth/types.d.ts.map +1 -0
  24. package/out/auth/types.js +15 -0
  25. package/out/auth/types.js.map +1 -0
  26. package/out/cli.d.ts.map +1 -1
  27. package/out/cli.js +223 -33
  28. package/out/cli.js.map +1 -1
  29. package/out/repl/ReplModeInk.d.ts +1 -0
  30. package/out/repl/ReplModeInk.d.ts.map +1 -1
  31. package/out/repl/ReplModeInk.js +124 -5
  32. package/out/repl/ReplModeInk.js.map +1 -1
  33. package/out/secure-config/BaseDirResolver.d.ts +5 -0
  34. package/out/secure-config/BaseDirResolver.d.ts.map +1 -0
  35. package/out/secure-config/BaseDirResolver.js +20 -0
  36. package/out/secure-config/BaseDirResolver.js.map +1 -0
  37. package/out/secure-config/DeviceKeyService.d.ts +13 -0
  38. package/out/secure-config/DeviceKeyService.d.ts.map +1 -0
  39. package/out/secure-config/DeviceKeyService.js +51 -0
  40. package/out/secure-config/DeviceKeyService.js.map +1 -0
  41. package/out/secure-config/DeviceStore.d.ts +13 -0
  42. package/out/secure-config/DeviceStore.d.ts.map +1 -0
  43. package/out/secure-config/DeviceStore.js +39 -0
  44. package/out/secure-config/DeviceStore.js.map +1 -0
  45. package/out/secure-config/InstructionNormalizer.d.ts +5 -0
  46. package/out/secure-config/InstructionNormalizer.d.ts.map +1 -0
  47. package/out/secure-config/InstructionNormalizer.js +20 -0
  48. package/out/secure-config/InstructionNormalizer.js.map +1 -0
  49. package/out/secure-config/KeysetService.d.ts +15 -0
  50. package/out/secure-config/KeysetService.d.ts.map +1 -0
  51. package/out/secure-config/KeysetService.js +88 -0
  52. package/out/secure-config/KeysetService.js.map +1 -0
  53. package/out/secure-config/SCPService.d.ts +14 -0
  54. package/out/secure-config/SCPService.d.ts.map +1 -0
  55. package/out/secure-config/SCPService.js +79 -0
  56. package/out/secure-config/SCPService.js.map +1 -0
  57. package/out/secure-config/SecureConfigClient.d.ts +30 -0
  58. package/out/secure-config/SecureConfigClient.d.ts.map +1 -0
  59. package/out/secure-config/SecureConfigClient.js +81 -0
  60. package/out/secure-config/SecureConfigClient.js.map +1 -0
  61. package/out/secure-config/errors.d.ts +8 -0
  62. package/out/secure-config/errors.d.ts.map +1 -0
  63. package/out/secure-config/errors.js +20 -0
  64. package/out/secure-config/errors.js.map +1 -0
  65. package/out/secure-config/index.d.ts +11 -0
  66. package/out/secure-config/index.d.ts.map +1 -0
  67. package/out/secure-config/index.js +11 -0
  68. package/out/secure-config/index.js.map +1 -0
  69. package/out/secure-config/rootKey.d.ts +3 -0
  70. package/out/secure-config/rootKey.d.ts.map +1 -0
  71. package/out/secure-config/rootKey.js +57 -0
  72. package/out/secure-config/rootKey.js.map +1 -0
  73. package/out/secure-config/signatureUtils.d.ts +3 -0
  74. package/out/secure-config/signatureUtils.d.ts.map +1 -0
  75. package/out/secure-config/signatureUtils.js +23 -0
  76. package/out/secure-config/signatureUtils.js.map +1 -0
  77. package/out/secure-config/types.d.ts +79 -0
  78. package/out/secure-config/types.d.ts.map +1 -0
  79. package/out/secure-config/types.js +2 -0
  80. package/out/secure-config/types.js.map +1 -0
  81. package/package.json +2 -2
  82. package/patches/ink-text-input+6.0.0.patch +176 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/secure-config/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,SAAS,CAAC;AAE3C,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,WAAW,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,IAAI,GAAG,IAAI,CAAC;IACpB,IAAI,EAAE,KAAK,CAAC;QACV,GAAG,EAAE,MAAM,CAAC;QACZ,cAAc,EAAE,MAAM,CAAC;QACvB,SAAS,EAAE,2BAA2B,CAAC;QACvC,MAAM,EAAE,QAAQ,GAAG,YAAY,CAAC;QAChC,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC,CAAC;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,IAAI,CAAC;IACd,IAAI,EAAE,kBAAkB,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC,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,CAAC;CACrB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/secure-config/types.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testany/hephos",
3
- "version": "0.3.17",
3
+ "version": "0.4.0-dev.3",
4
4
  "description": "Hephos - full CLI+REPL bundle for multi-agent conversation orchestration (depends on agent-chatter core)",
5
5
  "type": "module",
6
6
  "main": "./out/cli.js",
@@ -25,7 +25,7 @@
25
25
  "node": ">=20.0.0"
26
26
  },
27
27
  "dependencies": {
28
- "@testany/agent-chatter-core": "^1.1.6",
28
+ "@testany/agent-chatter-core": "npm:@testany/agent-chatter-core@staging",
29
29
  "chalk": "^5.6.2",
30
30
  "commander": "^14.0.2",
31
31
  "ink": "npm:@jrichman/ink@6.4.6",
@@ -1,8 +1,163 @@
1
+ diff --git a/node_modules/ink-text-input/build/index.d.ts b/node_modules/ink-text-input/build/index.d.ts
2
+ index 54343bd..9c3be67 100644
3
+ --- a/node_modules/ink-text-input/build/index.d.ts
4
+ +++ b/node_modules/ink-text-input/build/index.d.ts
5
+ @@ -34,8 +34,21 @@ export type Props = {
6
+ * Function to call when `Enter` is pressed, where first argument is a value of the input.
7
+ */
8
+ readonly onSubmit?: (value: string) => void;
9
+ + /**
10
+ + * Function to call when cursor position changes.
11
+ + */
12
+ + readonly onCursorChange?: (offset: number) => void;
13
+ +};
14
+ +export type LineInfo = {
15
+ + currentLine: number;
16
+ + totalLines: number;
17
+ + isFirstLine: boolean;
18
+ + isLastLine: boolean;
19
+ + columnInLine: number;
20
+ + lineStartOffset: number;
21
+ };
22
+ -declare function TextInput({ value: originalValue, placeholder, focus, mask, highlightPastedText, showCursor, onChange, onSubmit, }: Props): React.JSX.Element;
23
+ +export declare function getLineInfo(value: string, cursorOffset: number): LineInfo;
24
+ +declare function TextInput({ value: originalValue, placeholder, focus, mask, highlightPastedText, showCursor, onChange, onSubmit, onCursorChange, }: Props): React.JSX.Element;
25
+ export default TextInput;
26
+ type UncontrolledProps = {
27
+ /**
1
28
  diff --git a/node_modules/ink-text-input/build/index.js b/node_modules/ink-text-input/build/index.js
2
- index ada7cdc..58b0342 100644
29
+ index ada7cdc..64086f6 100644
3
30
  --- a/node_modules/ink-text-input/build/index.js
4
31
  +++ b/node_modules/ink-text-input/build/index.js
5
- @@ -73,11 +73,24 @@ function TextInput({ value: originalValue, placeholder = '', focus = true, mask,
32
+ @@ -1,7 +1,83 @@
33
+ import React, { useState, useEffect } from 'react';
34
+ import { Text, useInput } from 'ink';
35
+ import chalk from 'chalk';
36
+ -function TextInput({ value: originalValue, placeholder = '', focus = true, mask, highlightPastedText = false, showCursor = true, onChange, onSubmit, }) {
37
+ +
38
+ +// Helper function to get cursor line information for multi-line input
39
+ +function getLineInfo(value, cursorOffset) {
40
+ + const lines = value.split('\n');
41
+ + if (lines.length === 1) {
42
+ + return {
43
+ + currentLine: 0,
44
+ + totalLines: 1,
45
+ + isFirstLine: true,
46
+ + isLastLine: true,
47
+ + columnInLine: cursorOffset,
48
+ + lineStartOffset: 0
49
+ + };
50
+ + }
51
+ + // Find which line the cursor is on
52
+ + // Each line's range is [lineStart, lineStart + lineLength] (inclusive of the last char)
53
+ + // The \n character belongs to the current line, so next line starts at lineEnd + 1
54
+ + let lineStart = 0;
55
+ + for (let i = 0; i < lines.length; i++) {
56
+ + const lineLength = lines[i].length;
57
+ + const lineEnd = lineStart + lineLength;
58
+ + // Cursor is on this line if it's within [lineStart, lineEnd]
59
+ + // For the last line, cursor can be at lineEnd (end of input)
60
+ + // For non-last lines, if cursor is at lineEnd, it's at end of this line (before \n)
61
+ + // If cursor is at lineEnd + 1 (after \n), it belongs to next line
62
+ + if (i === lines.length - 1 || cursorOffset <= lineEnd) {
63
+ + return {
64
+ + currentLine: i,
65
+ + totalLines: lines.length,
66
+ + isFirstLine: i === 0,
67
+ + isLastLine: i === lines.length - 1,
68
+ + columnInLine: cursorOffset - lineStart,
69
+ + lineStartOffset: lineStart
70
+ + };
71
+ + }
72
+ + lineStart = lineEnd + 1; // +1 for \n
73
+ + }
74
+ + // Should not reach here, but fallback to last line
75
+ + return {
76
+ + currentLine: lines.length - 1,
77
+ + totalLines: lines.length,
78
+ + isFirstLine: lines.length === 1,
79
+ + isLastLine: true,
80
+ + columnInLine: cursorOffset - lineStart,
81
+ + lineStartOffset: lineStart
82
+ + };
83
+ +}
84
+ +
85
+ +// Calculate cursor offset for previous line
86
+ +function calculatePrevLineOffset(value, lineInfo) {
87
+ + const lines = value.split('\n');
88
+ + const prevLineIndex = lineInfo.currentLine - 1;
89
+ + const prevLineLength = lines[prevLineIndex].length;
90
+ + // Keep same column position, or end of line if previous line is shorter
91
+ + const targetColumn = Math.min(lineInfo.columnInLine, prevLineLength);
92
+ + // Calculate new cursorOffset
93
+ + let newOffset = 0;
94
+ + for (let i = 0; i < prevLineIndex; i++) {
95
+ + newOffset += lines[i].length + 1; // +1 for \n
96
+ + }
97
+ + return newOffset + targetColumn;
98
+ +}
99
+ +
100
+ +// Calculate cursor offset for next line
101
+ +function calculateNextLineOffset(value, lineInfo) {
102
+ + const lines = value.split('\n');
103
+ + const nextLineIndex = lineInfo.currentLine + 1;
104
+ + const nextLineLength = lines[nextLineIndex].length;
105
+ + const targetColumn = Math.min(lineInfo.columnInLine, nextLineLength);
106
+ + let newOffset = 0;
107
+ + for (let i = 0; i < nextLineIndex; i++) {
108
+ + newOffset += lines[i].length + 1; // +1 for \n
109
+ + }
110
+ + return newOffset + targetColumn;
111
+ +}
112
+ +
113
+ +function TextInput({ value: originalValue, placeholder = '', focus = true, mask, highlightPastedText = false, showCursor = true, onChange, onSubmit, onCursorChange, }) {
114
+ const [state, setState] = useState({
115
+ cursorOffset: (originalValue || '').length,
116
+ cursorWidth: 0,
117
+ @@ -46,13 +122,39 @@ function TextInput({ value: originalValue, placeholder = '', focus = true, mask,
118
+ }
119
+ }
120
+ useInput((input, key) => {
121
+ - if (key.upArrow ||
122
+ - key.downArrow ||
123
+ - (key.ctrl && input === 'c') ||
124
+ + // Handle Ctrl+C, Tab - always let parent handle
125
+ + if ((key.ctrl && input === 'c') ||
126
+ key.tab ||
127
+ (key.shift && key.tab)) {
128
+ return;
129
+ }
130
+ + // Handle up/down arrows for multi-line navigation
131
+ + if (key.upArrow) {
132
+ + const lineInfo = getLineInfo(originalValue, cursorOffset);
133
+ + if (lineInfo.isFirstLine) {
134
+ + return; // Let parent handle (e.g., history navigation)
135
+ + }
136
+ + // Move to previous line
137
+ + const nextCursorOffset = calculatePrevLineOffset(originalValue, lineInfo);
138
+ + setState({
139
+ + cursorOffset: nextCursorOffset,
140
+ + cursorWidth: 0,
141
+ + });
142
+ + return;
143
+ + }
144
+ + if (key.downArrow) {
145
+ + const lineInfo = getLineInfo(originalValue, cursorOffset);
146
+ + if (lineInfo.isLastLine) {
147
+ + return; // Let parent handle
148
+ + }
149
+ + // Move to next line
150
+ + const nextCursorOffset = calculateNextLineOffset(originalValue, lineInfo);
151
+ + setState({
152
+ + cursorOffset: nextCursorOffset,
153
+ + cursorWidth: 0,
154
+ + });
155
+ + return;
156
+ + }
157
+ if (key.return) {
158
+ if (onSubmit) {
159
+ onSubmit(originalValue);
160
+ @@ -73,11 +175,24 @@ function TextInput({ value: originalValue, placeholder = '', focus = true, mask,
6
161
  }
7
162
  }
8
163
  else if (key.backspace || key.delete) {
@@ -32,3 +187,22 @@ index ada7cdc..58b0342 100644
32
187
  }
33
188
  }
34
189
  else {
190
+ @@ -100,6 +215,10 @@ function TextInput({ value: originalValue, placeholder = '', focus = true, mask,
191
+ cursorOffset: nextCursorOffset,
192
+ cursorWidth: nextCursorWidth,
193
+ });
194
+ + // Notify parent of cursor position change
195
+ + if (onCursorChange && nextCursorOffset !== cursorOffset) {
196
+ + onCursorChange(nextCursorOffset);
197
+ + }
198
+ if (nextValue !== originalValue) {
199
+ onChange(nextValue);
200
+ }
201
+ @@ -111,6 +230,7 @@ function TextInput({ value: originalValue, placeholder = '', focus = true, mask,
202
+ : renderedValue));
203
+ }
204
+ export default TextInput;
205
+ +export { getLineInfo };
206
+ export function UncontrolledTextInput({ initialValue = '', ...props }) {
207
+ const [value, setValue] = useState(initialValue);
208
+ return React.createElement(TextInput, { ...props, value: value, onChange: setValue });