n2-soul 7.0.2 → 7.0.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.
package/LICENSE CHANGED
@@ -1,190 +1,53 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
1
+ # Dual License
4
2
 
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
3
+ Copyright 2026 N2 (Hyunsoo Choi)
6
4
 
7
- 1. Definitions.
5
+ This software is licensed under a **dual license** model:
8
6
 
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
7
+ ## 1. Open Source License Apache License 2.0
11
8
 
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
9
+ For **non-commercial**, **personal**, **educational**, and **open-source** use,
10
+ this software is licensed under the Apache License, Version 2.0.
14
11
 
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
12
+ You may obtain a copy of the Apache License at:
13
+ http://www.apache.org/licenses/LICENSE-2.0
22
14
 
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
15
+ The full text of the Apache License 2.0 is available in [LICENSE-APACHE](./LICENSE-APACHE).
25
16
 
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
17
+ ### What you CAN do under Apache 2.0:
18
+ - Use in personal and educational projects
19
+ - Use in open-source projects (non-commercial)
20
+ - Modify and distribute (with attribution)
21
+ - Study and learn from the code
29
22
 
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
23
+ ## 2. Commercial License
34
24
 
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
25
+ For **commercial use** including but not limited to:
26
+ - Incorporating this software into commercial products or services
27
+ - Using this software to generate revenue (directly or indirectly)
28
+ - Deploying this software in a commercial/enterprise environment
29
+ - Offering this software as part of a paid service (SaaS, PaaS, etc.)
39
30
 
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
31
+ You **must** obtain a separate commercial license.
47
32
 
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to the Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
33
+ ### Contact for Commercial Licensing:
34
+ - Email: lagi0730@gmail.com
35
+ - GitHub: https://github.com/choihyunsus
61
36
 
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by the Licensor and
64
- subsequently incorporated within the Work.
37
+ ## Summary
65
38
 
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
39
+ | Use Case | License | Cost |
40
+ |----------|---------|------|
41
+ | Personal / Educational | Apache 2.0 | Free |
42
+ | Open-source (non-commercial) | Apache 2.0 | Free |
43
+ | Commercial / Enterprise | Commercial License | Contact us |
72
44
 
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
45
+ ## Disclaimer
88
46
 
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding any notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- Copyright 2026 N2
179
-
180
- Licensed under the Apache License, Version 2.0 (the "License");
181
- you may not use this file except in compliance with the License.
182
- You may obtain a copy of the License at
183
-
184
- http://www.apache.org/licenses/LICENSE-2.0
185
-
186
- Unless required by applicable law or agreed to in writing, software
187
- distributed under the License is distributed on an "AS IS" BASIS,
188
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
- See the License for the specific language governing permissions and
190
- limitations under the License.
47
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
48
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
49
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
50
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
51
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
52
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
53
+ SOFTWARE.
package/LICENSE-APACHE ADDED
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to the Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by the Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding any notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2026 N2
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
package/README.ko.md CHANGED
@@ -458,6 +458,24 @@ soul/
458
458
 
459
459
  Apache-2.0
460
460
 
461
+ ## 💖 스폰서
462
+
463
+ Soul은 무료 오픈소스입니다. 이 멋진 분들이 Soul을 살아있게 해줍니다:
464
+
465
+ <table>
466
+ <tr>
467
+ <td align="center">
468
+ <a href="https://github.com/sunir">
469
+ <img src="https://github.com/sunir.png" width="80" height="80" style="border-radius:50%;" alt="Sunir Shah" /><br />
470
+ <sub><b>Sunir Shah</b></sub>
471
+ </a><br />
472
+ <sub>🥇 첫 번째 스폰서</sub>
473
+ </td>
474
+ </tr>
475
+ </table>
476
+
477
+ > 스폰서가 되어주세요 → [GitHub Sponsors](https://github.com/sponsors/choihyunsus)
478
+
461
479
  ---
462
480
 
463
481
  🌐 [nton2.com](https://nton2.com) · ✉️ lagi0730@gmail.com
package/README.md CHANGED
@@ -48,6 +48,7 @@ Every time you start a new chat with Cursor, VS Code Copilot, or any MCP-compati
48
48
  - [Rust Compiler (n2c)](#rust-compiler-n2c)
49
49
  - [Configuration](#configuration)
50
50
  - [Contributing](#contributing)
51
+ - [Sponsors](#-sponsors)
51
52
  - [Ark — The Last Shield](#ark--the-last-shield)
52
53
  - [Arachne — The Greatest Weaver](#arachne--the-greatest-weaver)
53
54
 
@@ -840,6 +841,24 @@ Contributions are welcome! Here's how to get started:
840
841
 
841
842
  Please see [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.
842
843
 
844
+ ## 💖 Sponsors
845
+
846
+ Soul is free and open-source. These amazing people help keep it alive:
847
+
848
+ <table>
849
+ <tr>
850
+ <td align="center">
851
+ <a href="https://github.com/sunir">
852
+ <img src="https://github.com/sunir.png" width="80" height="80" style="border-radius:50%;" alt="Sunir Shah" /><br />
853
+ <sub><b>Sunir Shah</b></sub>
854
+ </a><br />
855
+ <sub>🥇 First Sponsor</sub>
856
+ </td>
857
+ </tr>
858
+ </table>
859
+
860
+ > Become a sponsor → [GitHub Sponsors](https://github.com/sponsors/choihyunsus)
861
+
843
862
  ## Star History
844
863
 
845
864
  If you find Soul helpful, please consider giving us a star! ⭐
package/index.js CHANGED
@@ -69,7 +69,7 @@ server.tool = (name, ...rest) => {
69
69
  // ═══ End Ark ═══
70
70
 
71
71
  // Register core modules (all tools pass through Ark)
72
- registerBootSequence(server, z, config);
72
+ registerBootSequence(server, z, config, ark.workflows);
73
73
  registerWorkSequence(server, z, config);
74
74
  registerEndSequence(server, z, config);
75
75
  registerBrainTools(server, z, config);
@@ -56,6 +56,13 @@ const CHUNK_PATTERNS = {
56
56
  { type: 'struct', regex: /^type\s+(\w+)\s+struct/m },
57
57
  { type: 'interface', regex: /^type\s+(\w+)\s+interface/m },
58
58
  ],
59
+ java: [
60
+ { type: 'class', regex: /^(?:public\s+|private\s+|protected\s+)?(?:abstract\s+|final\s+)?class\s+(\w+)/m },
61
+ { type: 'interface', regex: /^(?:public\s+|private\s+|protected\s+)?interface\s+(\w+)/m },
62
+ { type: 'enum', regex: /^(?:public\s+|private\s+|protected\s+)?enum\s+(\w+)/m },
63
+ { type: 'method', regex: /^\s+(?:public\s+|private\s+|protected\s+)?(?:static\s+)?(?:synchronized\s+)?(?:final\s+)?(?:abstract\s+)?(?:\w+(?:<[^>]+>)?\s+)(\w+)\s*\(/m },
64
+ { type: 'annotation', regex: /^(?:public\s+)?@interface\s+(\w+)/m },
65
+ ],
59
66
  };
60
67
 
61
68
  // Extension → pattern mapping
@@ -65,6 +72,7 @@ const LANG_MAP = {
65
72
  py: 'py',
66
73
  rs: 'rs',
67
74
  go: 'go',
75
+ java: 'java',
68
76
  };
69
77
 
70
78
  /**
@@ -157,6 +165,22 @@ function chunkCode(content, language) {
157
165
  // Mark used lines
158
166
  for (let j = i; j <= endIdx; j++) usedLines.add(j);
159
167
 
168
+ // For large container types (class/struct/impl), sub-chunk methods
169
+ const containerTypes = new Set(['class', 'struct', 'impl']);
170
+ if (containerTypes.has(pattern.type) && tokenCount > 500) {
171
+ // Sub-scan for methods inside the container
172
+ const methodPatterns = patterns.filter(p =>
173
+ p.type === 'method' || p.type === 'function'
174
+ );
175
+ if (methodPatterns.length > 0) {
176
+ const subChunks = _extractSubChunks(lines, i, endIdx, methodPatterns, lang);
177
+ if (subChunks.length > 0) {
178
+ chunks.push(...subChunks);
179
+ break;
180
+ }
181
+ }
182
+ }
183
+
160
184
  chunks.push({
161
185
  type: pattern.type,
162
186
  name,
@@ -214,6 +238,76 @@ function chunkCode(content, language) {
214
238
  return chunks;
215
239
  }
216
240
 
241
+ /**
242
+ * Extract method-level sub-chunks from a container (class/struct/impl)
243
+ * For large containers (>500 tokens), splits into individual methods + remainder
244
+ */
245
+ function _extractSubChunks(lines, containerStart, containerEnd, methodPatterns, lang) {
246
+ const subChunks = [];
247
+ const subUsed = new Set();
248
+
249
+ for (let i = containerStart + 1; i <= containerEnd; i++) {
250
+ if (subUsed.has(i)) continue;
251
+ const line = lines[i];
252
+
253
+ for (const pattern of methodPatterns) {
254
+ const match = line.match(pattern.regex);
255
+ if (!match) continue;
256
+
257
+ const name = match[1] || null;
258
+ let endIdx;
259
+ if (lang === 'py') {
260
+ endIdx = findIndentEnd(lines, i);
261
+ } else {
262
+ endIdx = findBlockEnd(lines, i);
263
+ }
264
+ // Clamp to container boundary
265
+ endIdx = Math.min(endIdx, containerEnd);
266
+
267
+ if (endIdx - i < 2) continue;
268
+
269
+ for (let j = i; j <= endIdx; j++) subUsed.add(j);
270
+
271
+ const chunkContent = lines.slice(i, endIdx + 1).join('\n');
272
+ subChunks.push({
273
+ type: pattern.type,
274
+ name,
275
+ startLine: i + 1,
276
+ endLine: endIdx + 1,
277
+ content: chunkContent,
278
+ tokenCount: estimateTokens(chunkContent),
279
+ searchText: buildSearchText(name, chunkContent, pattern.type),
280
+ });
281
+ break;
282
+ }
283
+ }
284
+
285
+ // If no methods found, return empty (caller will use whole-class chunk)
286
+ if (subChunks.length === 0) return [];
287
+
288
+ // Add remainder (class declaration, fields, etc.) as module chunk
289
+ const remainderLines = [];
290
+ for (let i = containerStart; i <= containerEnd; i++) {
291
+ if (!subUsed.has(i)) {
292
+ remainderLines.push({ idx: i, text: lines[i] });
293
+ }
294
+ }
295
+ const remainderContent = remainderLines.map(r => r.text).join('\n').trim();
296
+ if (remainderContent.length > 50 && estimateTokens(remainderContent) > 30) {
297
+ subChunks.push({
298
+ type: 'module',
299
+ name: null,
300
+ startLine: containerStart + 1,
301
+ endLine: containerEnd + 1,
302
+ content: remainderContent,
303
+ tokenCount: estimateTokens(remainderContent),
304
+ searchText: buildSearchText(null, remainderContent, 'module'),
305
+ });
306
+ }
307
+
308
+ return subChunks;
309
+ }
310
+
217
311
  /**
218
312
  * Create whole-file chunk (for unsupported languages or match failure)
219
313
  */
@@ -33,6 +33,13 @@ const GO_PATTERNS = [
33
33
  /import\s+(?:\(\s*)?["']([^"']+)["']/g,
34
34
  ];
35
35
 
36
+ const JAVA_PATTERNS = [
37
+ // import com.example.ClassName;
38
+ /import\s+(?:static\s+)?([\w.]+\.[A-Z]\w*)/gm,
39
+ // import com.example.*
40
+ /import\s+(?:static\s+)?([\w.]+)\.\*/gm,
41
+ ];
42
+
36
43
  /**
37
44
  * Extract dependencies from file content
38
45
  * @param {string} content - File content
@@ -83,7 +90,7 @@ function resolveImport(fromFile, importPath, indexedFiles) {
83
90
  }
84
91
 
85
92
  // 2. Try adding extensions
86
- const extensions = ['.js', '.ts', '.jsx', '.tsx', '.mjs', '.cjs'];
93
+ const extensions = ['.js', '.ts', '.jsx', '.tsx', '.mjs', '.cjs', '.java'];
87
94
  for (const ext of extensions) {
88
95
  const withExt = basePath + ext;
89
96
  if (indexedFiles.has(withExt)) {
@@ -159,6 +166,8 @@ function _getPatternsForLanguage(language) {
159
166
  return RUST_PATTERNS;
160
167
  case 'go':
161
168
  return GO_PATTERNS;
169
+ case 'java':
170
+ return JAVA_PATTERNS;
162
171
  default:
163
172
  return null;
164
173
  }
@@ -172,6 +181,7 @@ function _classifyDepType(importPath, language) {
172
181
  if (language === 'py') return 'import';
173
182
  if (language === 'rs') return importPath.startsWith('crate::') ? 'use' : 'mod';
174
183
  if (language === 'go') return 'import';
184
+ if (language === 'java') return 'import';
175
185
 
176
186
  // JS/TS — external package vs relative path
177
187
  if (_isRelativePath(importPath)) return 'import';
package/lib/ark/index.js CHANGED
@@ -39,11 +39,13 @@ function createArk(options = {}) {
39
39
 
40
40
  // Log loaded rules summary
41
41
  const summary = gate.summary();
42
- console.error(`[n2-ark] Loaded: ${summary.contracts} contracts, ${summary.blacklists} blacklists (${summary.patterns} patterns), ${summary.gates} gates`);
42
+ const workflowCount = Object.keys(rules.workflows).length;
43
+ console.error(`[n2-ark] Loaded: ${summary.contracts} contracts, ${summary.blacklists} blacklists (${summary.patterns} patterns), ${summary.gates} gates, ${workflowCount} workflows`);
43
44
 
44
45
  return {
45
46
  gate,
46
47
  audit,
48
+ workflows: rules.workflows,
47
49
 
48
50
  /**
49
51
  * Check an action against all safety rules.
package/lib/ark/parser.js CHANGED
@@ -18,6 +18,7 @@ function parse(source) {
18
18
  contracts: parseContracts(source),
19
19
  blacklists: parseBlacklists(source),
20
20
  gates: parseGates(source),
21
+ workflows: parseWorkflows(source),
21
22
  };
22
23
  }
23
24
 
@@ -249,6 +250,95 @@ function parseGates(source) {
249
250
  return gates;
250
251
  }
251
252
 
253
+ /**
254
+ * Extracts @workflow blocks — step sequences with triggers.
255
+ * Format: @workflow name { trigger: event, step name { action: ..., required: bool } }
256
+ *
257
+ * @param {string} source
258
+ * @returns {Object<string, { name: string, trigger: string|null, steps: Array }>}
259
+ */
260
+ function parseWorkflows(source) {
261
+ const workflows = {};
262
+ const lines = source.split('\n');
263
+
264
+ let inWorkflow = false;
265
+ let workflowName = '';
266
+ let braceDepth = 0;
267
+ let bodyLines = [];
268
+
269
+ for (const line of lines) {
270
+ const trimmed = line.trim();
271
+
272
+ if (!inWorkflow) {
273
+ const m = trimmed.match(/^@workflow\s+(\w+)\s*\{?/);
274
+ if (m) {
275
+ inWorkflow = true;
276
+ workflowName = m[1];
277
+ braceDepth = (trimmed.includes('{')) ? 1 : 0;
278
+ bodyLines = [];
279
+ continue;
280
+ }
281
+ }
282
+
283
+ if (inWorkflow) {
284
+ bodyLines.push(line);
285
+ for (const ch of line) {
286
+ if (ch === '{') braceDepth++;
287
+ if (ch === '}') braceDepth--;
288
+ }
289
+
290
+ if (braceDepth <= 0) {
291
+ const body = bodyLines.join('\n');
292
+
293
+ // Extract trigger
294
+ const triggerMatch = body.match(/trigger\s*:\s*(\w+)/);
295
+ const trigger = triggerMatch ? triggerMatch[1] : null;
296
+
297
+ // Extract enforce
298
+ const enforceMatch = body.match(/enforce\s*:\s*(\w+)/);
299
+ const enforce = enforceMatch ? enforceMatch[1] : 'normal';
300
+
301
+ // Extract steps
302
+ const steps = [];
303
+ const stepRegex = /step\s+(\w+)\s*\{([^}]+)\}/g;
304
+ let stepMatch;
305
+ while ((stepMatch = stepRegex.exec(body)) !== null) {
306
+ const stepName = stepMatch[1];
307
+ const stepBody = stepMatch[2];
308
+
309
+ const actionMatch = stepBody.match(/action\s*:\s*(.+?)(?:\n|$)/);
310
+ const requiredMatch = stepBody.match(/required\s*:\s*(true|false)/);
311
+ const dependsMatch = stepBody.match(/depends_on\s*:\s*(\w+)/);
312
+ const outputMatch = stepBody.match(/output\s*->\s*\$(\w+)/);
313
+
314
+ steps.push({
315
+ name: stepName,
316
+ action: actionMatch ? actionMatch[1].trim() : null,
317
+ required: requiredMatch ? requiredMatch[1] === 'true' : false,
318
+ dependsOn: dependsMatch ? dependsMatch[1] : null,
319
+ output: outputMatch ? outputMatch[1] : null,
320
+ });
321
+ }
322
+
323
+ if (steps.length > 0 || trigger) {
324
+ workflows[workflowName] = {
325
+ name: workflowName,
326
+ trigger,
327
+ enforce,
328
+ steps,
329
+ };
330
+ }
331
+
332
+ inWorkflow = false;
333
+ workflowName = '';
334
+ bodyLines = [];
335
+ }
336
+ }
337
+ }
338
+
339
+ return workflows;
340
+ }
341
+
252
342
  /**
253
343
  * Loads and parses all .n2 files from a directory.
254
344
  *
@@ -256,7 +346,7 @@ function parseGates(source) {
256
346
  * @returns {{ contracts: object, blacklists: object, gates: object }}
257
347
  */
258
348
  function loadRules(rulesDir) {
259
- const merged = { contracts: {}, blacklists: {}, gates: {} };
349
+ const merged = { contracts: {}, blacklists: {}, gates: {}, workflows: {} };
260
350
 
261
351
  if (!fs.existsSync(rulesDir)) return merged;
262
352
 
@@ -268,6 +358,7 @@ function loadRules(rulesDir) {
268
358
  Object.assign(merged.contracts, parsed.contracts);
269
359
  Object.assign(merged.blacklists, parsed.blacklists);
270
360
  Object.assign(merged.gates, parsed.gates);
361
+ Object.assign(merged.workflows, parsed.workflows);
271
362
  } catch (e) {
272
363
  console.error(`[n2-ark] Failed to parse ${file}: ${e.message}`);
273
364
  }
@@ -276,4 +367,4 @@ function loadRules(rulesDir) {
276
367
  return merged;
277
368
  }
278
369
 
279
- module.exports = { parse, parseContracts, parseBlacklists, parseGates, loadRules };
370
+ module.exports = { parse, parseContracts, parseBlacklists, parseGates, parseWorkflows, loadRules };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n2-soul",
3
- "version": "7.0.2",
3
+ "version": "7.0.3",
4
4
  "description": "Multi-agent session orchestrator with KV-Cache, Ark safety, and Arachne code context for MCP",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -21,7 +21,7 @@
21
21
  "safety",
22
22
  "n2-ark"
23
23
  ],
24
- "license": "Apache-2.0",
24
+ "license": "SEE LICENSE IN LICENSE",
25
25
  "homepage": "https://nton2.com",
26
26
  "author": "N2 <lagi0730@gmail.com>",
27
27
  "repository": {
package/sequences/boot.js CHANGED
@@ -9,7 +9,7 @@ const { setAgentName, setKvChainParent } = require('../lib/context');
9
9
  const { EntityMemory } = require('../lib/entity-memory');
10
10
  const { CoreMemory } = require('../lib/core-memory');
11
11
 
12
- function registerBootSequence(server, z, config) {
12
+ function registerBootSequence(server, z, config, workflows = {}) {
13
13
  const engine = new SoulEngine(config.DATA_DIR);
14
14
  const entityMemory = new EntityMemory(config.DATA_DIR);
15
15
  const coreMemory = new CoreMemory(config.DATA_DIR);
@@ -115,6 +115,22 @@ function registerBootSequence(server, z, config) {
115
115
  lines.push(`⚠️ Core Memory: ${e.message}`);
116
116
  }
117
117
 
118
+ // -- Workflow auto-injection: session_start triggers --
119
+ const bootWorkflows = Object.values(workflows).filter(
120
+ w => w.trigger === 'session_start'
121
+ );
122
+ if (bootWorkflows.length > 0) {
123
+ lines.push('\n═══ MANDATORY BOOT STEPS (auto-injected by @workflow) ═══');
124
+ for (const wf of bootWorkflows) {
125
+ const requiredSteps = wf.steps.filter(s => s.required);
126
+ for (const step of requiredSteps) {
127
+ lines.push(`⚠️ REQUIRED: ${step.action || step.name}`);
128
+ }
129
+ }
130
+ lines.push('You MUST execute ALL required steps above before proceeding.');
131
+ lines.push('═════════════════════════════════════════════════════');
132
+ }
133
+
118
134
  lines.push(`\n--- Soul Boot v${pkg.version} complete ---`);
119
135
  return { content: [{ type: 'text', text: lines.join('\n') }] };
120
136
  }
@@ -11,7 +11,7 @@ let pass = 0, fail = 0;
11
11
  // ═══════════════════════════════════════
12
12
  console.log('\n[1] 버전 동적 로드');
13
13
  const pkg = require('../package.json');
14
- assert(pkg.version === '6.1.3', `package.json version: ${pkg.version}`);
14
+ assert(/\d+\.\d+\.\d+/.test(pkg.version), `package.json version: ${pkg.version}`);
15
15
  // boot.js에서 어떻게 사용하는지 검증
16
16
  const bootPkg = require('../package.json');
17
17
  assert(bootPkg.version === pkg.version, `boot.js도 같은 버전 참조: ${bootPkg.version}`);