codeplay-common 4.5.3 → 4.5.5

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.
@@ -1931,27 +1931,24 @@ function getAgentInstructionsZipLayout(zip) {
1931
1931
  const agentFile = normalizedEntries.find(({ name }) =>
1932
1932
  name.toLowerCase() === AGENT_INSTRUCTIONS_FILE.toLowerCase()
1933
1933
  );
1934
- const agentDirectoryPrefix = `${AGENT_INSTRUCTIONS_DIR.toLowerCase()}/`;
1935
- const nestedSupportFiles = normalizedEntries
1936
- .filter(({ name }) => name.toLowerCase().startsWith(agentDirectoryPrefix))
1937
- .map(({ entry, name }) => ({
1938
- entry,
1939
- relativePath: name.slice(name.indexOf("/") + 1)
1940
- }))
1941
- .filter(({ relativePath }) => relativePath && relativePath !== AGENT_INSTRUCTIONS_VERSION_FILE);
1942
- const flatSupportFiles = normalizedEntries
1943
- .filter(({ name }) =>
1944
- !name.includes("/") &&
1945
- name.toLowerCase() !== AGENT_INSTRUCTIONS_FILE.toLowerCase() &&
1946
- name.toLowerCase() !== AGENT_INSTRUCTIONS_VERSION_FILE.toLowerCase() &&
1947
- name.toLowerCase().endsWith(".md")
1948
- )
1949
- .map(({ entry, name }) => ({ entry, relativePath: name }));
1950
- const supportFiles = nestedSupportFiles.length ? nestedSupportFiles : flatSupportFiles;
1934
+ const supportFiles = normalizedEntries
1935
+ .filter(({ name }) => name.toLowerCase() !== AGENT_INSTRUCTIONS_FILE.toLowerCase())
1936
+ .map(({ entry, name }) => {
1937
+ const agentDirectoryPrefix = `${AGENT_INSTRUCTIONS_DIR.toLowerCase()}/`;
1938
+ const relativePath = name.toLowerCase().startsWith(agentDirectoryPrefix)
1939
+ ? name.slice(name.indexOf("/") + 1)
1940
+ : name;
1941
+
1942
+ return { entry, relativePath };
1943
+ })
1944
+ .filter(({ relativePath }) =>
1945
+ relativePath &&
1946
+ path.basename(relativePath).toLowerCase() !== AGENT_INSTRUCTIONS_VERSION_FILE.toLowerCase()
1947
+ );
1951
1948
 
1952
1949
  if (!agentFile || !supportFiles.length) {
1953
1950
  throw new Error(
1954
- `Agent instructions ZIP must contain ${AGENT_INSTRUCTIONS_FILE} (case-insensitive) and either files inside ${AGENT_INSTRUCTIONS_DIR}/ or supporting Markdown files at the archive root.`
1951
+ `Agent instructions ZIP must contain ${AGENT_INSTRUCTIONS_FILE} (case-insensitive) and at least one supporting file.`
1955
1952
  );
1956
1953
  }
1957
1954
 
@@ -1970,11 +1967,6 @@ async function syncAgentInstructions() {
1970
1967
  const projectRoot = process.cwd();
1971
1968
  const targetAgentFile = path.join(projectRoot, AGENT_INSTRUCTIONS_FILE);
1972
1969
  const targetAgentDir = path.join(projectRoot, AGENT_INSTRUCTIONS_DIR);
1973
- const hasAgentDirectoryFiles =
1974
- fs.existsSync(targetAgentDir) &&
1975
- fs.statSync(targetAgentDir).isDirectory() &&
1976
- fs.readdirSync(targetAgentDir).some(name => name !== AGENT_INSTRUCTIONS_VERSION_FILE);
1977
- const requiredFilesExist = fs.existsSync(targetAgentFile) && hasAgentDirectoryFiles;
1978
1970
  const localVersion = readInstalledAgentInstructionsVersion(projectRoot);
1979
1971
 
1980
1972
  const versions = await fetchVersions();
@@ -1985,7 +1977,7 @@ async function syncAgentInstructions() {
1985
1977
  }
1986
1978
 
1987
1979
  const remoteIsNewer = compareVersionStrings(remoteVersion, localVersion) > 0;
1988
- if (requiredFilesExist && !remoteIsNewer) {
1980
+ if (!remoteIsNewer) {
1989
1981
  console.log(`✅ Agent instructions do not need an update (local ${localVersion}, online ${remoteVersion}).`);
1990
1982
  return;
1991
1983
  }
@@ -435,5 +435,11 @@ else if(targetAppId=="image.to.text.document")
435
435
  '<uses-feature android:name="android.hardware.camera" android:required="true" />',
436
436
  ];
437
437
  }
438
-
438
+ else if(targetAppId=="codeplay.love.calculator")
439
+ {
440
+ permissions=[
441
+ '<uses-permission android:name="android.permission.CAMERA" />',
442
+ '<uses-feature android:name="android.hardware.camera" android:required="true" />',
443
+ ];
444
+ }
439
445
  addAndroidPermissions(permissions);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeplay-common",
3
- "version": "4.5.3",
3
+ "version": "4.5.5",
4
4
  "description": "Common build scripts and files",
5
5
  "scripts": {
6
6
  "postinstall": "node scripts/sync-files.js",