openyida 2026.7.18 → 2026.7.21

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 (200) hide show
  1. package/README.md +37 -2
  2. package/bin/yida.js +113 -18
  3. package/docs/capabilities.md +202 -0
  4. package/lib/agent-center/agent-center.js +2 -3
  5. package/lib/app/app-list.js +3 -4
  6. package/lib/app/build-page.js +13 -6
  7. package/lib/app/check-page.js +16 -6
  8. package/lib/app/compile.js +17 -7
  9. package/lib/app/create-app.js +14 -2
  10. package/lib/app/create-form/api-path.js +25 -0
  11. package/lib/app/create-form/args.js +13 -0
  12. package/lib/app/create-form/commands.js +4 -0
  13. package/lib/app/create-form/definition-reader.js +23 -23
  14. package/lib/app/create-form/field-normalizers.js +26 -7
  15. package/lib/app/create-form/schema-patch.js +4 -1
  16. package/lib/app/create-form.js +155 -68
  17. package/lib/app/create-page.js +47 -10
  18. package/lib/app/generate-page.js +20 -1
  19. package/lib/app/get-form-config.js +2 -1
  20. package/lib/app/get-schema.js +67 -15
  21. package/lib/app/import-app.js +94 -42
  22. package/lib/app/list-forms.js +4 -8
  23. package/lib/app/page-ir.js +140 -0
  24. package/lib/app/publish.js +289 -556
  25. package/lib/app/schema-field-resolution.js +370 -0
  26. package/lib/app/services/app-reader.js +85 -0
  27. package/lib/app/services/app-service.js +235 -0
  28. package/lib/app/services/canvas-page-compiler.js +91 -0
  29. package/lib/app/services/canvas-page-schema-builder.js +149 -0
  30. package/lib/app/services/field-bindings.js +68 -0
  31. package/lib/app/services/form-compiler.js +1922 -0
  32. package/lib/app/services/form-mode-service.js +182 -0
  33. package/lib/app/services/form-schema-patcher.js +333 -0
  34. package/lib/app/services/form-schema-reader.js +59 -0
  35. package/lib/app/services/form-service.js +379 -0
  36. package/lib/app/services/form-validation.js +562 -0
  37. package/lib/app/services/native-page-compiler.js +92 -0
  38. package/lib/app/services/native-page-schema-builder.js +428 -0
  39. package/lib/app/services/page-resource-service.js +185 -0
  40. package/lib/app/update-app.js +22 -9
  41. package/lib/app/update-form-config.js +4 -2
  42. package/lib/asset/asset-cmd.js +19 -6
  43. package/lib/auth/oauth-loopback.js +376 -15
  44. package/lib/auth/token-auth.js +34 -3
  45. package/lib/auth/token-store.js +22 -4
  46. package/lib/basic-info/basic-info.js +2 -1
  47. package/lib/bridge/bridge.js +43 -18
  48. package/lib/core/agent-capabilities.js +5 -3
  49. package/lib/core/command-errors.js +38 -0
  50. package/lib/core/command-manifest.js +59 -1
  51. package/lib/core/copy.js +12 -0
  52. package/lib/core/doctor.js +15 -4
  53. package/lib/core/env-cmd.js +1 -1
  54. package/lib/core/env.js +7 -6
  55. package/lib/core/i18n.js +66 -8
  56. package/lib/core/legacy-schema-guard.js +408 -0
  57. package/lib/core/locales/en.js +38 -46
  58. package/lib/core/locales/zh.js +30 -46
  59. package/lib/core/sample.js +12 -2
  60. package/lib/core/utils.js +334 -66
  61. package/lib/core/yida-client.js +108 -5
  62. package/lib/corp-efficiency/corp-efficiency.js +2 -2
  63. package/lib/corp-manager/corp-manager.js +3 -3
  64. package/lib/formula/evaluate.js +11 -68
  65. package/lib/formula/field-refs.js +83 -0
  66. package/lib/i18n-management/i18n-management.js +2 -3
  67. package/lib/process/configure-process.js +44 -1992
  68. package/lib/process/create-process.js +54 -87
  69. package/lib/process/preview-process.js +20 -8
  70. package/lib/process/services/process-compiler.js +2056 -0
  71. package/lib/process/services/process-reader.js +232 -0
  72. package/lib/process/services/process-resource-service.js +571 -0
  73. package/lib/process/services/process-service.js +122 -0
  74. package/lib/process/services/process-stage-checkpoint.js +246 -0
  75. package/lib/report/append.js +7 -26
  76. package/lib/report/http.js +31 -5
  77. package/lib/report/index.js +10 -2
  78. package/lib/samples/yida-canvas-custom-page/business-list.canvas.jsx +63 -14
  79. package/lib/samples/yida-canvas-custom-page/dashboard-overview.canvas.jsx +176 -32
  80. package/lib/samples/yida-canvas-custom-page/dashboard-starter.canvas.jsx +5 -2
  81. package/lib/samples/yida-canvas-custom-page/data-management.canvas.jsx +228 -14
  82. package/lib/samples/yida-canvas-custom-page/portal-shell-home.canvas.jsx +2 -2
  83. package/lib/samples/yida-canvas-custom-page/split-pane-detail.canvas.jsx +206 -10
  84. package/lib/samples/yida-custom-page/data-management.oyd.jsx +14 -3
  85. package/lib/samples/yida-custom-page/design-tokens.js +2 -2
  86. package/lib/samples/yida-custom-page/detail-profile.oyd.jsx +1 -1
  87. package/lib/samples/yida-custom-page/portal-shell-home.oyd.jsx +7 -2
  88. package/lib/samples/yida-custom-page/split-pane-detail.oyd.jsx +2 -1
  89. package/lib/schema/adapters/app-adapter.js +210 -0
  90. package/lib/schema/adapters/form-adapter.js +1362 -0
  91. package/lib/schema/adapters/keys.js +19 -0
  92. package/lib/schema/adapters/page-adapter.js +566 -0
  93. package/lib/schema/adapters/process-adapter.js +519 -0
  94. package/lib/schema/applier.js +1878 -0
  95. package/lib/schema/apply-store.js +1083 -0
  96. package/lib/schema/command.js +645 -0
  97. package/lib/schema/dependency-graph.js +83 -0
  98. package/lib/schema/errors.js +481 -0
  99. package/lib/schema/hash.js +9 -0
  100. package/lib/schema/manifest-limits.js +177 -0
  101. package/lib/schema/manifest-loader.js +309 -0
  102. package/lib/schema/manifest-schema-v1.json +193 -0
  103. package/lib/schema/normalize-manifest.js +281 -0
  104. package/lib/schema/page-canvas-foundation.js +447 -0
  105. package/lib/schema/page-data-source-builder.js +561 -0
  106. package/lib/schema/page-foundation.js +556 -0
  107. package/lib/schema/page-source-loader.js +314 -0
  108. package/lib/schema/planner.js +691 -0
  109. package/lib/schema/remote-dispatch-boundary.js +39 -0
  110. package/lib/schema/remote-missing.js +21 -0
  111. package/lib/schema/remote-reader.js +189 -0
  112. package/lib/schema/resource-registry.js +157 -0
  113. package/lib/schema/server-revision.js +71 -0
  114. package/lib/schema/sort.js +28 -0
  115. package/lib/schema/state-store.js +589 -0
  116. package/package.json +10 -8
  117. package/scripts/check-release-risks.js +254 -0
  118. package/scripts/generate-command-docs.js +6 -1
  119. package/scripts/i18n-baseline.json +11 -11
  120. package/scripts/postinstall.js +8 -12
  121. package/scripts/validate-ci.sh +15 -11
  122. package/scripts/validate-i18n.js +30 -9
  123. package/scripts/validate-package-size.js +5 -2
  124. package/scripts/validate-skills.js +4 -0
  125. package/scripts/validate-structure.js +15 -0
  126. package/yida-skills/SKILL.md +117 -30
  127. package/yida-skills/references/schema-as-code-phase1.md +99 -0
  128. package/yida-skills/references/setup-and-env.md +59 -59
  129. package/yida-skills/references/task-retrospective.md +6 -6
  130. package/yida-skills/skills/yida-app/SKILL.md +78 -17
  131. package/yida-skills/skills/yida-canvas-custom-page/SKILL.md +18 -7
  132. package/yida-skills/skills/yida-canvas-custom-page/references/data-bridge-guide.md +3 -3
  133. package/yida-skills/skills/yida-canvas-custom-page/references/page-generation-guide.md +15 -0
  134. package/yida-skills/skills/yida-create-app/SKILL.md +21 -3
  135. package/yida-skills/skills/yida-create-form-page/SKILL.md +19 -1
  136. package/yida-skills/skills/yida-create-page/SKILL.md +16 -3
  137. package/yida-skills/skills/yida-create-process/SKILL.md +100 -4
  138. package/yida-skills/skills/yida-custom-page/SKILL.md +19 -4
  139. package/yida-skills/skills/yida-dashboard/SKILL.md +1 -1
  140. package/yida-skills/skills/yida-dashboard/references/pitfalls.md +1 -1
  141. package/yida-skills/skills/yida-get-schema/SKILL.md +49 -5
  142. package/yida-skills/skills/yida-i18n/SKILL.md +1 -1
  143. package/yida-skills/skills/yida-integration/SKILL.md +7 -1
  144. package/yida-skills/skills/yida-login/SKILL.md +50 -99
  145. package/yida-skills/skills/yida-page-config/SKILL.md +7 -1
  146. package/yida-skills/skills/yida-page-uiux/references/app/blueprint.md +0 -1
  147. package/yida-skills/skills/yida-page-uiux/references/app/navigation-patterns.md +0 -1
  148. package/yida-skills/skills/yida-page-uiux/references/app/role-journey.md +0 -1
  149. package/yida-skills/skills/yida-page-uiux/references/dashboard/app-blueprint.md +0 -1
  150. package/yida-skills/skills/yida-page-uiux/references/dashboard/chart-contracts.md +0 -1
  151. package/yida-skills/skills/yida-page-uiux/references/dashboard/component-contracts.md +0 -1
  152. package/yida-skills/skills/yida-page-uiux/references/dashboard/layout-patterns.md +0 -1
  153. package/yida-skills/skills/yida-page-uiux/references/dashboard/theme-recipes.md +0 -1
  154. package/yida-skills/skills/yida-page-uiux/references/detail/object-narrative.md +0 -1
  155. package/yida-skills/skills/yida-page-uiux/references/detail/section-patterns.md +0 -1
  156. package/yida-skills/skills/yida-page-uiux/references/detail/timeline-and-related.md +0 -1
  157. package/yida-skills/skills/yida-page-uiux/references/landing/assets-workflow.md +0 -1
  158. package/yida-skills/skills/yida-page-uiux/references/landing/industry-playbooks.md +0 -1
  159. package/yida-skills/skills/yida-page-uiux/references/landing/research-levels.md +0 -1
  160. package/yida-skills/skills/yida-page-uiux/references/landing/section-patterns.md +0 -1
  161. package/yida-skills/skills/yida-page-uiux/references/list/drawer-detail.md +0 -1
  162. package/yida-skills/skills/yida-page-uiux/references/list/empty-loading-error.md +0 -1
  163. package/yida-skills/skills/yida-page-uiux/references/list/filter-patterns.md +0 -1
  164. package/yida-skills/skills/yida-page-uiux/references/list/table-patterns.md +0 -1
  165. package/yida-skills/skills/yida-page-uiux/references/scenes/screen.md +0 -1
  166. package/yida-skills/skills/yida-page-uiux/references/workbench/entry-patterns.md +0 -1
  167. package/yida-skills/skills/yida-page-uiux/references/workbench/portal-layouts.md +0 -1
  168. package/yida-skills/skills/yida-page-uiux/references/workbench/task-feed.md +0 -1
  169. package/yida-skills/skills/yida-page-uiux/workflow/output-decision-block.md +1 -1
  170. package/yida-skills/skills/yida-process-rule/SKILL.md +35 -1
  171. package/yida-skills/skills/yida-publish-page/SKILL.md +46 -4
  172. package/yida-skills/skills/yida-report/SKILL.md +9 -235
  173. package/yida-skills/skills/yida-report/references/schema-builder-details.md +239 -0
  174. package/yida-skills/skills/yida-skill-evaluator/SKILL.md +170 -0
  175. package/yida-skills/skills-index.json +238 -54
  176. package/lib/core/locales/ar.js +0 -834
  177. package/lib/core/locales/de.js +0 -834
  178. package/lib/core/locales/es.js +0 -834
  179. package/lib/core/locales/fr.js +0 -834
  180. package/lib/core/locales/hi.js +0 -834
  181. package/lib/core/locales/ja.js +0 -1227
  182. package/lib/core/locales/ko.js +0 -836
  183. package/lib/core/locales/pt.js +0 -834
  184. package/lib/core/locales/vi.js +0 -834
  185. package/lib/core/locales/zh-HK.js +0 -1263
  186. package/project/pages/src/demo-birthday-game.oyd.jsx +0 -832
  187. package/project/pages/src/demo-chip-insight.oyd.jsx +0 -983
  188. package/project/pages/src/demo-compat-smoke.oyd.jsx +0 -58
  189. package/project/pages/src/demo-crm-batch-entry.oyd.jsx +0 -805
  190. package/project/pages/src/demo-crm-dashboard.oyd.jsx +0 -677
  191. package/project/pages/src/demo-future-vision-2026.oyd.jsx +0 -1102
  192. package/project/pages/src/demo-ppt.oyd.jsx +0 -1192
  193. package/project/pages/src/demo-salary-calculator.oyd.jsx +0 -904
  194. package/project/pages/src/openyida-knowledge-doc.oyd.jsx +0 -1714
  195. package/yida-skills/skills/large-file-write/SKILL.md +0 -93
  196. package/yida-skills/skills/large-file-write/references/write-patterns.md +0 -147
  197. package/yida-skills/skills/large-file-write/scripts/write.js +0 -157
  198. package/yida-skills/skills/sls-log-workbench/SKILL.md +0 -134
  199. package/yida-skills/skills/sls-log-workbench/references/workbench-reference.md +0 -130
  200. package/yida-skills/skills/sls-log-workbench/sls-query.js +0 -295
@@ -0,0 +1,232 @@
1
+ 'use strict';
2
+
3
+ const { getProcessById } = require('./process-service');
4
+ const {
5
+ dispatchRemotePrimitive,
6
+ hasRemoteDispatchBoundary,
7
+ rethrowRemoteDispatchBoundaryFailure,
8
+ } = require('../../schema/remote-dispatch-boundary');
9
+
10
+ const READ_OPERATION = 'SimpleProcess.getProcessById';
11
+
12
+ class ProcessReaderError extends Error {
13
+ constructor(code, message, details) {
14
+ super(message);
15
+ this.name = 'ProcessReaderError';
16
+ this.code = code;
17
+ this.details = details;
18
+ }
19
+ }
20
+
21
+ function readerError(code, message, details) {
22
+ return new ProcessReaderError(code, message, details);
23
+ }
24
+
25
+ function readFailure() {
26
+ return readerError('PROCESS_READ_FAILED', 'Process definition could not be read.', {
27
+ operation: READ_OPERATION,
28
+ });
29
+ }
30
+
31
+ function isNonEmptyString(value) {
32
+ return typeof value === 'string' && value.trim() !== '';
33
+ }
34
+
35
+ function isNonEmptyIdentifier(value) {
36
+ return isNonEmptyString(value) || (typeof value === 'number' && Number.isFinite(value));
37
+ }
38
+
39
+ function isValidProcessVersion(value) {
40
+ if (typeof value === 'number') {
41
+ return Number.isInteger(value) && value >= 0;
42
+ }
43
+ return typeof value === 'string' && /^\d+$/.test(value.trim());
44
+ }
45
+
46
+ function assertReadBindings(bindings) {
47
+ const checks = {
48
+ appType: isNonEmptyString,
49
+ formUuid: isNonEmptyString,
50
+ processCode: isNonEmptyString,
51
+ processId: isNonEmptyIdentifier,
52
+ processVersion: isValidProcessVersion,
53
+ };
54
+ for (const [property, isValid] of Object.entries(checks)) {
55
+ if (!isValid(bindings && bindings[property])) {
56
+ throw readerError(
57
+ 'PROCESS_READ_BINDING_INVALID',
58
+ 'A required process read binding is missing or invalid.',
59
+ { operation: READ_OPERATION, property }
60
+ );
61
+ }
62
+ }
63
+ }
64
+
65
+ async function readProcessDefinition(context, bindings) {
66
+ assertReadBindings(bindings);
67
+ const authRef = context && context.authRef ? context.authRef : context;
68
+ let result;
69
+ try {
70
+ result = await dispatchRemotePrimitive(context, () => getProcessById(
71
+ authRef,
72
+ bindings || {},
73
+ { oneShot: hasRemoteDispatchBoundary(context) }
74
+ ));
75
+ } catch (error) {
76
+ rethrowRemoteDispatchBoundaryFailure(error);
77
+ throw readFailure();
78
+ }
79
+
80
+ if (!result || result.success !== true) {
81
+ throw readFailure();
82
+ }
83
+ if (typeof result.content !== 'string' || result.content.trim() === '') {
84
+ throw readerError(
85
+ 'PROCESS_READ_CONTENT_INVALID',
86
+ 'Process definition content is invalid.',
87
+ { operation: READ_OPERATION }
88
+ );
89
+ }
90
+
91
+ let definition;
92
+ try {
93
+ definition = JSON.parse(result.content);
94
+ } catch {
95
+ throw readerError(
96
+ 'PROCESS_READ_CONTENT_INVALID',
97
+ 'Process definition content is invalid.',
98
+ { operation: READ_OPERATION }
99
+ );
100
+ }
101
+ if (!definition || typeof definition !== 'object' || Array.isArray(definition)) {
102
+ throw readerError(
103
+ 'PROCESS_READ_CONTENT_INVALID',
104
+ 'Process definition content is invalid.',
105
+ { operation: READ_OPERATION }
106
+ );
107
+ }
108
+
109
+ return { definition };
110
+ }
111
+
112
+ function getBoundNodeId(binding) {
113
+ if (typeof binding === 'string' && binding) {
114
+ return binding;
115
+ }
116
+ if (binding && typeof binding.nodeId === 'string' && binding.nodeId) {
117
+ return binding.nodeId;
118
+ }
119
+ return null;
120
+ }
121
+
122
+ function extractManagedName(value) {
123
+ if (typeof value === 'string') {
124
+ return value;
125
+ }
126
+ if (value && typeof value === 'object') {
127
+ if (typeof value.zh_CN === 'string') {return value.zh_CN;}
128
+ if (typeof value.en_US === 'string') {return value.en_US;}
129
+ if (typeof value.ja_JP === 'string') {return value.ja_JP;}
130
+ }
131
+ return '';
132
+ }
133
+
134
+ function projectNodeType(componentName) {
135
+ if (componentName === 'ApprovalNode') {return 'approval';}
136
+ if (componentName === 'OperatorNode') {return 'operator';}
137
+ if (componentName === 'MultiApprovalNode') {return 'multiApproval';}
138
+ if (componentName === 'CarbonNode') {return 'carbon';}
139
+ return 'unsupported';
140
+ }
141
+
142
+ function projectApprover(node) {
143
+ const ruleType = node && node.props && node.props.approverRules && node.props.approverRules.type;
144
+ return ruleType === 'ext_target_approval_originator'
145
+ ? 'originator'
146
+ : (typeof ruleType === 'string' && ruleType ? ruleType : 'unsupported');
147
+ }
148
+
149
+ function observedStructureError(semanticPath) {
150
+ return readerError(
151
+ 'PROCESS_OBSERVED_STRUCTURE_MISMATCH',
152
+ 'Observed process structure does not match managed node bindings.',
153
+ { semanticPath }
154
+ );
155
+ }
156
+
157
+ function projectProcessManaged(readResult, options) {
158
+ const definition = readResult && readResult.definition;
159
+ const desired = options && options.desired;
160
+ const nodeBindings = options && options.nodeBindings || {};
161
+ const expectedFormUuid = options && options.formUuid;
162
+ const schema = definition && definition.schema;
163
+ const children = schema && Array.isArray(schema.children) ? schema.children : null;
164
+
165
+ if (!desired || !Array.isArray(desired.nodes) || !children) {
166
+ throw observedStructureError('process');
167
+ }
168
+ if (!isNonEmptyString(expectedFormUuid) || definition.bindingForm !== expectedFormUuid) {
169
+ throw observedStructureError('form');
170
+ }
171
+
172
+ const keyByNodeId = new Map();
173
+ desired.nodes.forEach(function (node) {
174
+ const nodeId = getBoundNodeId(nodeBindings[node.key]);
175
+ if (!nodeId) {
176
+ throw readerError(
177
+ 'PROCESS_NODE_BINDING_MISSING',
178
+ 'A managed process node binding is missing.',
179
+ { semanticPath: 'nodes.' + node.key }
180
+ );
181
+ }
182
+ if (keyByNodeId.has(nodeId)) {
183
+ throw observedStructureError('nodes.' + node.key);
184
+ }
185
+ keyByNodeId.set(nodeId, node.key);
186
+ });
187
+
188
+ const desiredByKey = new Map(desired.nodes.map(function (node) {
189
+ return [node.key, node];
190
+ }));
191
+ const managedNodes = [];
192
+
193
+ children.forEach(function (node) {
194
+ if (!node || node.componentName === 'ApplyNode' || node.componentName === 'EndNode') {
195
+ return;
196
+ }
197
+ const semanticKey = keyByNodeId.get(node.id);
198
+ if (!semanticKey) {
199
+ throw observedStructureError('nodes');
200
+ }
201
+ const expected = desiredByKey.get(semanticKey);
202
+ managedNodes.push({
203
+ key: semanticKey,
204
+ type: projectNodeType(node.componentName),
205
+ name: extractManagedName(node.props && node.props.name),
206
+ approver: projectApprover(node),
207
+ _expected: expected,
208
+ });
209
+ });
210
+
211
+ if (managedNodes.length !== desired.nodes.length) {
212
+ throw observedStructureError('nodes');
213
+ }
214
+ managedNodes.forEach(function (node, index) {
215
+ if (!node._expected || node.key !== desired.nodes[index].key) {
216
+ throw observedStructureError('nodes.' + node.key);
217
+ }
218
+ delete node._expected;
219
+ });
220
+
221
+ return {
222
+ form: desired.form,
223
+ nodes: managedNodes,
224
+ };
225
+ }
226
+
227
+ module.exports = {
228
+ ProcessReaderError,
229
+ READ_OPERATION,
230
+ projectProcessManaged,
231
+ readProcessDefinition,
232
+ };