@sogni-ai/sogni-intelligence-client 4.7.0 → 4.7.2
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/dist/media/gptImage.d.ts.map +1 -1
- package/dist/media/gptImage.js +37 -2
- package/dist/media/gptImage.js.map +1 -1
- package/dist/media/musicSettings.d.ts +1 -1
- package/dist/public-skill-runtime/index.d.ts +1 -2
- package/dist/public-skill-runtime/index.d.ts.map +1 -1
- package/dist/public-skill-runtime/index.js +3 -71
- package/dist/public-skill-runtime/index.js.map +1 -1
- package/dist/tools/shared/promptSanitizer.d.ts.map +1 -1
- package/dist/tools/shared/promptSanitizer.js +1 -67
- package/dist/tools/shared/promptSanitizer.js.map +1 -1
- package/dist-esm/media/gptImage.js +37 -2
- package/dist-esm/media/gptImage.js.map +1 -1
- package/dist-esm/public-skill-runtime/index.js +1 -69
- package/dist-esm/public-skill-runtime/index.js.map +1 -1
- package/dist-esm/tools/shared/promptSanitizer.js +1 -67
- package/dist-esm/tools/shared/promptSanitizer.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,70 +1,4 @@
|
|
|
1
|
-
const GRID_PATTERNS = [
|
|
2
|
-
/\b(?:different|various|varying|multiple|several|many|diverse|assorted|all|range of|variety of|array of|series of|set of|collection of)\s+(?:facial\s+)?(?:expressions?|poses?|angles?|versions?|variations?|looks?|smiles?|moods?|emotions?|faces?|views?|shots?|styles?|options?|takes?|scenes?|settings?|environments?|worlds?)\b/gi,
|
|
3
|
-
/\b\d+\s+(?:completely\s+|totally\s+|very\s+)?(?:different|unique|distinct|varying|varied|separate|individual)?\s*(?:facial\s+)?(?:expressions?|poses?|angles?|versions?|variations?|looks?|smiles?|moods?|emotions?|faces?|views?|shots?|styles?|options?|takes?|images?|photos?|pictures?|portraits?|copies|duplicates|scenes?|settings?|environments?|worlds?)\b/gi,
|
|
4
|
-
/\b(?:grid|collage|montage|composite|triptych|diptych|side[- ]by[- ]side|side[- ]to[- ]side|split[- ]?screen|photo[- ]?sheet|contact[- ]?sheet|mood[- ]?board|lineup|line[- ]?up|tile[ds]?|tiling|rows?\s+(?:of|and)\s+columns?|columns?\s+(?:of|and)\s+rows?)\b/gi,
|
|
5
|
-
/\beach\s+(?:with|showing|featuring|displaying|having|in)\s+(?:a\s+)?(?:different|unique|distinct|its own)\b/gi,
|
|
6
|
-
/\beach\s+(?:one|version|variation|image|copy)\b/gi,
|
|
7
|
-
/\b(?:show|display|create|generate|make|render|produce)\s+(?:multiple|different|various|several|all)\b/gi,
|
|
8
|
-
/\b(?:switch(?:ing)?|mix(?:ing)?)\s+up\b/gi,
|
|
9
|
-
/\b\d+\s+of\s+(?:them|these|those)\b/gi,
|
|
10
|
-
/\b(?:multiple|several|many)\s+(?:copies|duplicates|instances|repeats)\b/gi,
|
|
11
|
-
/\b\d+\s+(?:versions?|variations?|renditions?|interpretations?|depictions?|iterations?)\b/gi,
|
|
12
|
-
/\b(?:repeated|repeating|repeat)\s+\d*\s*(?:times?)?\b/gi,
|
|
13
|
-
/\b(?:put|place|fit|arrange)\s+(?:them|these|those|it)\s+(?:all\s+)?(?:together|into one|in one)\b/gi,
|
|
14
|
-
/\ball\s+(?:together|in\s+one\s+(?:image|frame|picture|photo))\b/gi,
|
|
15
|
-
];
|
|
16
|
-
const SINGULARIZE_PATTERNS = [
|
|
17
|
-
[
|
|
18
|
-
/\b(create|generate|make|render|produce)\s+\d+\s+(?:completely\s+|totally\s+|very\s+)?(?:different|unique|distinct|varying|varied|separate|individual)?\s*(scenes?|settings?|environments?|worlds?)\s+(featuring|with|of)\b/gi,
|
|
19
|
-
'$1 a single scene $3',
|
|
20
|
-
],
|
|
21
|
-
[
|
|
22
|
-
/\b(create|generate|make|render|produce)\s+\d+\s+(?:completely\s+|totally\s+|very\s+)?(?:different|unique|distinct|varying|varied|separate|individual)?\s*(images?|photos?|pictures?|portraits?)\s+(featuring|with|of)\b/gi,
|
|
23
|
-
'$1 a single image $3',
|
|
24
|
-
],
|
|
25
|
-
[
|
|
26
|
-
/\b(?:in|across)\s+(?:different|various|varying|multiple|several|many|diverse|assorted)\s+(?:scenes?|settings?|environments?|worlds?)\s*:/gi,
|
|
27
|
-
'in this setting:',
|
|
28
|
-
],
|
|
29
|
-
[
|
|
30
|
-
/\bfor\s+all\s+(?:scenes?|settings?|environments?|worlds?|images?|photos?|pictures?|portraits?)\b/gi,
|
|
31
|
-
'for the image',
|
|
32
|
-
],
|
|
33
|
-
];
|
|
34
|
-
function countPatternReplacement(match, ...args) {
|
|
35
|
-
const offset = typeof args[args.length - 2] === 'number' ? args[args.length - 2] : 0;
|
|
36
|
-
const source = typeof args[args.length - 1] === 'string' ? args[args.length - 1] : '';
|
|
37
|
-
const before = source.slice(Math.max(0, offset - 8), offset);
|
|
38
|
-
const after = source.slice(offset + match.length, offset + match.length + 8);
|
|
39
|
-
const touchesAspectOrDimension = /(?:\d\s*[:/x×]\s*|\bby\s*)$/i.test(before)
|
|
40
|
-
|| /^\s*(?::|\/|x|×|\bby\b)\s*\d/i.test(after);
|
|
41
|
-
return touchesAspectOrDimension ? match : '';
|
|
42
|
-
}
|
|
43
1
|
export function sanitizeBatchPrompt(prompt) {
|
|
44
|
-
|
|
45
|
-
const PLACEHOLDER_PREFIX = '\x00DP';
|
|
46
|
-
const placeholder = (i) => `${PLACEHOLDER_PREFIX}${i}\x00`;
|
|
47
|
-
let shielded = prompt.replace(/\{[^{}]+\}/g, (match) => {
|
|
48
|
-
if (match.includes('|')) {
|
|
49
|
-
groups.push(match);
|
|
50
|
-
return placeholder(groups.length - 1);
|
|
51
|
-
}
|
|
52
|
-
return match;
|
|
53
|
-
});
|
|
54
|
-
for (const [pattern, replacement] of SINGULARIZE_PATTERNS) {
|
|
55
|
-
pattern.lastIndex = 0;
|
|
56
|
-
shielded = shielded.replace(pattern, replacement);
|
|
57
|
-
}
|
|
58
|
-
for (const pattern of GRID_PATTERNS) {
|
|
59
|
-
pattern.lastIndex = 0;
|
|
60
|
-
shielded = shielded.replace(pattern, countPatternReplacement);
|
|
61
|
-
}
|
|
62
|
-
shielded = shielded.replace(/\s{2,}/g, ' ').replace(/\s+([.,;!?])/g, '$1').trim();
|
|
63
|
-
shielded = shielded.replace(/^[,.\s]+/, '').replace(/[,.\s]+$/, '').trim();
|
|
64
|
-
let result = shielded;
|
|
65
|
-
for (let i = 0; i < groups.length; i++) {
|
|
66
|
-
result = result.replace(placeholder(i), groups[i]);
|
|
67
|
-
}
|
|
68
|
-
return result;
|
|
2
|
+
return prompt;
|
|
69
3
|
}
|
|
70
4
|
//# sourceMappingURL=promptSanitizer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promptSanitizer.js","sourceRoot":"","sources":["../../../src/tools/shared/promptSanitizer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"promptSanitizer.js","sourceRoot":"","sources":["../../../src/tools/shared/promptSanitizer.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,mBAAmB,CAAC,MAAc;IAChD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sogni-ai/sogni-intelligence-client",
|
|
3
|
-
"version": "4.7.
|
|
3
|
+
"version": "4.7.2",
|
|
4
4
|
"description": "Public Sogni Intelligence client — Node.js convenience wrapper for the Sogni SDK plus the public-safe subset of @sogni/creative-agent contracts (ContractRegistry, AssetManifest, RunRecord, tool envelopes). For agent builders, third-party integrations, and downstream SDKs.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
"dev": "tsc --watch",
|
|
168
168
|
"prepare": "npm run codegen && husky",
|
|
169
169
|
"prepublishOnly": "npm run build",
|
|
170
|
-
"test": "node --import tsx test/basic-tests.ts && node --import tsx --test test/replay-redaction.test.ts test/chat-run-model-media.test.ts test/durable-workflow-content-filter.test.ts test/gpt-image-25.test.ts test/video-estimate-context.test.ts test/video-reference-detail.test.ts test/prompt-limits.test.ts test/reconnect-and-retry.test.ts",
|
|
170
|
+
"test": "node --import tsx test/basic-tests.ts && node --import tsx --test test/replay-redaction.test.ts test/chat-run-model-media.test.ts test/durable-workflow-content-filter.test.ts test/gpt-image-25.test.ts test/video-estimate-context.test.ts test/video-reference-detail.test.ts test/prompt-limits.test.ts test/reconnect-and-retry.test.ts test/batch-prompt-preservation.test.ts",
|
|
171
171
|
"test:e2e": "node --import tsx test/e2e-test.ts",
|
|
172
172
|
"test:e2e:llm": "SOGNI_E2E_SCOPE=llm node --import tsx test/e2e-test.ts",
|
|
173
173
|
"typecheck:examples": "tsc --noEmit -p tsconfig.examples.json",
|
|
@@ -205,7 +205,7 @@
|
|
|
205
205
|
},
|
|
206
206
|
"homepage": "https://github.com/Sogni-AI/sogni-intelligence-client#readme",
|
|
207
207
|
"dependencies": {
|
|
208
|
-
"@sogni-ai/sogni-client": "5.60.
|
|
208
|
+
"@sogni-ai/sogni-client": "5.60.1",
|
|
209
209
|
"@sogni-ai/sogni-protocol": "1.0.0-alpha.46",
|
|
210
210
|
"sharp": "^0.35.3"
|
|
211
211
|
},
|