ac-storage 0.16.2 → 0.16.4
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/afron/.vscode/launch.json +43 -0
- package/afron/.vscode/tasks.json +56 -0
- package/afron/LICENSE +674 -0
- package/afron/README.md +23 -0
- package/afron/_img/01.png +0 -0
- package/afron/_img/02.png +0 -0
- package/afron/package.json +40 -0
- package/afron/packages/chatai-models/package.json +34 -0
- package/afron/packages/core/package.json +65 -0
- package/afron/packages/core/vite.config.ts +17 -0
- package/afron/packages/electron/build/entitlements.mac.plist +33 -0
- package/afron/packages/electron/forge.config.js +66 -0
- package/afron/packages/electron/import-static.ps1 +14 -0
- package/afron/packages/electron/package.json +147 -0
- package/afron/packages/electron/rebuild.bat +1 -0
- package/afron/packages/front/.env.development +1 -0
- package/afron/packages/front/.github/copilot-instructions.md +88 -0
- package/afron/packages/front/eslint.config.js +33 -0
- package/afron/packages/front/index.html +13 -0
- package/afron/packages/front/package.json +74 -0
- package/afron/packages/front/public/favicon.icns +0 -0
- package/afron/packages/front/public/favicon.ico +0 -0
- package/afron/packages/front/public/favicon.png +0 -0
- package/afron/packages/front/public/robots.txt +3 -0
- package/afron/packages/front/public/vite.svg +1 -0
- package/afron/packages/front/tsconfig.app.json +44 -0
- package/afron/packages/front/tsconfig.node.json +24 -0
- package/afron/packages/front/vite.config.ts +53 -0
- package/afron/packages/locale/package.json +65 -0
- package/afron/packages/locale/vite.config.ts +17 -0
- package/afron/packages/types/index.js +3 -0
- package/afron/packages/types/package.json +6 -0
- package/afron/packages/types/types/chatai/chatai-model.d.ts +73 -0
- package/afron/packages/types/types/chatai/gemini-safety-setting.d.ts +15 -0
- package/afron/packages/types/types/chatai/index.d.ts +3 -0
- package/afron/packages/types/types/chatai/thinking-efforts.d.ts +4 -0
- package/afron/packages/types/types/event-pipe/global-event.d.ts +43 -0
- package/afron/packages/types/types/event-pipe/index.d.ts +1 -0
- package/afron/packages/types/types/index.d.ts +8 -0
- package/afron/packages/types/types/ipc/data.ts +114 -0
- package/afron/packages/types/types/ipc/declared.d.ts +1 -0
- package/afron/packages/types/types/ipc/index.ts +6 -0
- package/afron/packages/types/types/ipc/interface.d.ts +46 -0
- package/afron/packages/types/types/ipc/invokers.d.ts +181 -0
- package/afron/packages/types/types/ipc/listeners.d.ts +7 -0
- package/afron/packages/types/types/ipc/result.d.ts +3 -0
- package/afron/packages/types/types/ipc-invokers.d.ts +111 -0
- package/afron/packages/types/types/ipc-listeners.d.ts +6 -0
- package/afron/packages/types/types/prompt-form.d.ts +65 -0
- package/afron/packages/types/types/rt/event.d.ts +71 -0
- package/afron/packages/types/types/rt/flow.d.ts +63 -0
- package/afron/packages/types/types/rt/form.d.ts +41 -0
- package/afron/packages/types/types/rt/index.d.ts +4 -0
- package/afron/packages/types/types/rt/rt.d.ts +61 -0
- package/afron/packages/types/types/rt-var/index.ts +5 -0
- package/afron/packages/types/types/rt-var/rt-var-create.ts +39 -0
- package/afron/packages/types/types/rt-var/rt-var-stored.ts +30 -0
- package/afron/packages/types/types/rt-var/rt-var-update.ts +45 -0
- package/afron/packages/types/types/rt-var/rt-var.ts +36 -0
- package/afron/packages/types/types/rt-var/var-data.d.ts +108 -0
- package/afron/packages/types/types/storage-schema/ProfileStorageSchema.d.ts +2 -0
- package/afron/packages/types/types/storage-schema/RT/Flow.d.ts +20 -0
- package/afron/packages/types/types/storage-schema/RT/Metadata.d.ts +16 -0
- package/afron/packages/types/types/storage-schema/RT/Prompts.d.ts +39 -0
- package/afron/packages/types/types/storage-schema/RT/RT.d.ts +4 -0
- package/afron/packages/types/types/storage-schema/RT/index.d.ts +1 -0
- package/afron/packages/types/types/storage-schema/Session/Cache.d.ts +18 -0
- package/afron/packages/types/types/storage-schema/Session/Config.d.ts +7 -0
- package/afron/packages/types/types/storage-schema/Session/Data.d.ts +19 -0
- package/afron/packages/types/types/storage-schema/Session/Session.d.ts +3 -0
- package/afron/packages/types/types/storage-schema/Session/index.d.ts +1 -0
- package/afron/packages/types/types/storage-schema/index.d.ts +116 -0
- package/afron/packages/types/types/utils/index.ts +1 -0
- package/afron/packages/types/types.d.ts +3 -0
- package/afron/scripts/remove-dist.ps1 +10 -0
- package/afron/scripts/remove-install.ps1 +9 -0
- package/afron/scripts/win-vscode.ps1 +17 -0
- package/dist/bundle.cjs +43 -2
- package/dist/bundle.cjs.map +1 -1
- package/dist/bundle.mjs +43 -2
- package/dist/bundle.mjs.map +1 -1
- package/package.json +2 -2
package/dist/bundle.mjs
CHANGED
|
@@ -91,6 +91,18 @@ class StructJSONTypeLeaf extends BaseJSONTypeLeaf {
|
|
|
91
91
|
return this;
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
+
class ReplaceJSONTypeLeaf extends BaseJSONTypeLeaf {
|
|
95
|
+
__brand = 'replace';
|
|
96
|
+
constructor(tree) {
|
|
97
|
+
super('replace');
|
|
98
|
+
this.value['replace'] = tree;
|
|
99
|
+
this.value['strict'] = false;
|
|
100
|
+
}
|
|
101
|
+
strict() {
|
|
102
|
+
this.value['strict'] = true;
|
|
103
|
+
return this;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
94
106
|
|
|
95
107
|
class ArrayJSONTypeLeaf extends BaseJSONTypeLeaf {
|
|
96
108
|
__brand = 'array';
|
|
@@ -143,6 +155,7 @@ const JSONType = {
|
|
|
143
155
|
Number: () => new NumberJSONTypeLeaf(),
|
|
144
156
|
Bool: () => new BooleanJSONTypeLeaf(),
|
|
145
157
|
Struct: (tree) => new StructJSONTypeLeaf(tree),
|
|
158
|
+
Replace: (tree) => new ReplaceJSONTypeLeaf(tree),
|
|
146
159
|
Array: (jsonTree) => new ArrayJSONTypeLeaf(jsonTree),
|
|
147
160
|
Any: () => new BaseJSONTypeLeaf('any'),
|
|
148
161
|
};
|
|
@@ -267,8 +280,8 @@ class Flattener {
|
|
|
267
280
|
const { tracePath } = traceResult;
|
|
268
281
|
const reached = tracePath.join(DELIMITER);
|
|
269
282
|
const node = this.navigate.get(reached);
|
|
270
|
-
// 닿을 수 있는 마지막 노드의 타입이 struct, any 라면 허용됨
|
|
271
|
-
if (!node || (node.type !== 'struct' && node.type !== 'any')) {
|
|
283
|
+
// 닿을 수 있는 마지막 노드의 타입이 struct, replace, any 라면 허용됨
|
|
284
|
+
if (!node || (node.type !== 'struct' && node.type !== 'replace' && node.type !== 'any')) {
|
|
272
285
|
throw new JSONAccessorError(`Field '${key}' is not allowed`);
|
|
273
286
|
}
|
|
274
287
|
return [[key, value]];
|
|
@@ -306,6 +319,10 @@ class Flattener {
|
|
|
306
319
|
structData: node,
|
|
307
320
|
});
|
|
308
321
|
}
|
|
322
|
+
else if (node.type === 'replace') {
|
|
323
|
+
// replace 타입은 평탄화 없이 전체 값 반환 → 항상 덮어쓰기
|
|
324
|
+
return [[newKey, value]];
|
|
325
|
+
}
|
|
309
326
|
else if (node.type === 'array') {
|
|
310
327
|
// @TODO : 배열 타입에 대한 세부 처리 필요
|
|
311
328
|
// 현재는 배열 경로까지만 flat이 이루어지므로
|
|
@@ -429,6 +446,10 @@ class CompatibilityChecker {
|
|
|
429
446
|
return true;
|
|
430
447
|
}
|
|
431
448
|
}
|
|
449
|
+
// replace 타입은 실제 값이 struct(객체)로 들어옴
|
|
450
|
+
else if (jsonTypeData.type === 'replace' && targetType === 'struct') {
|
|
451
|
+
return this.isReplaceCompatible(target, jsonTypeData);
|
|
452
|
+
}
|
|
432
453
|
else {
|
|
433
454
|
return false;
|
|
434
455
|
}
|
|
@@ -459,6 +480,21 @@ class CompatibilityChecker {
|
|
|
459
480
|
return false;
|
|
460
481
|
}
|
|
461
482
|
}
|
|
483
|
+
isReplaceCompatible(struct, replaceTypeData) {
|
|
484
|
+
if (!replaceTypeData.strict)
|
|
485
|
+
return true;
|
|
486
|
+
if (!replaceTypeData.replace)
|
|
487
|
+
return true;
|
|
488
|
+
const navigate = r$1.from(replaceTypeData.replace);
|
|
489
|
+
const flattener = new Flattener(navigate, this);
|
|
490
|
+
try {
|
|
491
|
+
flattener.flat({ target: struct, prefix: '' });
|
|
492
|
+
return true;
|
|
493
|
+
}
|
|
494
|
+
catch (e) {
|
|
495
|
+
return false;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
462
498
|
getUnionTypeNames(union) {
|
|
463
499
|
return union.candidates.map((c) => {
|
|
464
500
|
if (typeof c === 'object') {
|
|
@@ -733,6 +769,11 @@ class JSONAccessor {
|
|
|
733
769
|
this.#changed = true;
|
|
734
770
|
this.#removeData(key);
|
|
735
771
|
}
|
|
772
|
+
replaceOne(key, value) {
|
|
773
|
+
this.#ensureNotDropped();
|
|
774
|
+
this.#removeData(key);
|
|
775
|
+
this.set([[key, value]]);
|
|
776
|
+
}
|
|
736
777
|
remove(keys) {
|
|
737
778
|
this.#ensureNotDropped();
|
|
738
779
|
this.#changed = true;
|