@moltos/sdk 0.16.8 → 0.16.9
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/index.d.mts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +15 -3
- package/dist/index.mjs +15 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1065,11 +1065,16 @@ declare class TeamsSDK {
|
|
|
1065
1065
|
clawfs_path?: string;
|
|
1066
1066
|
github_token?: string;
|
|
1067
1067
|
chunk_size?: number;
|
|
1068
|
+
/** Resume from a specific offset (e.g. after a partial failure) */
|
|
1069
|
+
start_offset?: number;
|
|
1068
1070
|
onChunk?: (result: any, chunk: number) => void;
|
|
1069
1071
|
}): Promise<{
|
|
1070
1072
|
total_written: number;
|
|
1071
1073
|
total_chunks: number;
|
|
1072
1074
|
clawfs_base?: string;
|
|
1075
|
+
last_offset?: number;
|
|
1076
|
+
completed: boolean;
|
|
1077
|
+
error?: string;
|
|
1073
1078
|
}>;
|
|
1074
1079
|
/**
|
|
1075
1080
|
* Find agents that would complement your team — ranked by skill overlap + TAP.
|
package/dist/index.d.ts
CHANGED
|
@@ -1065,11 +1065,16 @@ declare class TeamsSDK {
|
|
|
1065
1065
|
clawfs_path?: string;
|
|
1066
1066
|
github_token?: string;
|
|
1067
1067
|
chunk_size?: number;
|
|
1068
|
+
/** Resume from a specific offset (e.g. after a partial failure) */
|
|
1069
|
+
start_offset?: number;
|
|
1068
1070
|
onChunk?: (result: any, chunk: number) => void;
|
|
1069
1071
|
}): Promise<{
|
|
1070
1072
|
total_written: number;
|
|
1071
1073
|
total_chunks: number;
|
|
1072
1074
|
clawfs_base?: string;
|
|
1075
|
+
last_offset?: number;
|
|
1076
|
+
completed: boolean;
|
|
1077
|
+
error?: string;
|
|
1073
1078
|
}>;
|
|
1074
1079
|
/**
|
|
1075
1080
|
* Find agents that would complement your team — ranked by skill overlap + TAP.
|
package/dist/index.js
CHANGED
|
@@ -1227,12 +1227,24 @@ var TeamsSDK = class {
|
|
|
1227
1227
|
* })
|
|
1228
1228
|
*/
|
|
1229
1229
|
async pull_repo_all(teamId, gitUrl, opts = {}) {
|
|
1230
|
-
let offset = 0;
|
|
1230
|
+
let offset = opts.start_offset ?? 0;
|
|
1231
1231
|
let chunk = 0;
|
|
1232
1232
|
let totalWritten = 0;
|
|
1233
1233
|
let clawfsBase;
|
|
1234
1234
|
while (true) {
|
|
1235
|
-
|
|
1235
|
+
let result;
|
|
1236
|
+
try {
|
|
1237
|
+
result = await this.pull_repo(teamId, gitUrl, { ...opts, chunk_offset: offset });
|
|
1238
|
+
} catch (e) {
|
|
1239
|
+
return {
|
|
1240
|
+
total_written: totalWritten,
|
|
1241
|
+
total_chunks: chunk,
|
|
1242
|
+
clawfs_base: clawfsBase,
|
|
1243
|
+
last_offset: offset,
|
|
1244
|
+
completed: false,
|
|
1245
|
+
error: `Failed at chunk ${chunk + 1} (offset ${offset}): ${e?.message ?? String(e)}. Resume with start_offset: ${offset}`
|
|
1246
|
+
};
|
|
1247
|
+
}
|
|
1236
1248
|
chunk++;
|
|
1237
1249
|
totalWritten += result.files_written ?? 0;
|
|
1238
1250
|
clawfsBase = result.clawfs_base;
|
|
@@ -1240,7 +1252,7 @@ var TeamsSDK = class {
|
|
|
1240
1252
|
if (!result.has_more || result.next_chunk_offset == null) break;
|
|
1241
1253
|
offset = result.next_chunk_offset;
|
|
1242
1254
|
}
|
|
1243
|
-
return { total_written: totalWritten, total_chunks: chunk, clawfs_base: clawfsBase };
|
|
1255
|
+
return { total_written: totalWritten, total_chunks: chunk, clawfs_base: clawfsBase, completed: true };
|
|
1244
1256
|
}
|
|
1245
1257
|
/**
|
|
1246
1258
|
* Find agents that would complement your team — ranked by skill overlap + TAP.
|
package/dist/index.mjs
CHANGED
|
@@ -1067,12 +1067,24 @@ var TeamsSDK = class {
|
|
|
1067
1067
|
* })
|
|
1068
1068
|
*/
|
|
1069
1069
|
async pull_repo_all(teamId, gitUrl, opts = {}) {
|
|
1070
|
-
let offset = 0;
|
|
1070
|
+
let offset = opts.start_offset ?? 0;
|
|
1071
1071
|
let chunk = 0;
|
|
1072
1072
|
let totalWritten = 0;
|
|
1073
1073
|
let clawfsBase;
|
|
1074
1074
|
while (true) {
|
|
1075
|
-
|
|
1075
|
+
let result;
|
|
1076
|
+
try {
|
|
1077
|
+
result = await this.pull_repo(teamId, gitUrl, { ...opts, chunk_offset: offset });
|
|
1078
|
+
} catch (e) {
|
|
1079
|
+
return {
|
|
1080
|
+
total_written: totalWritten,
|
|
1081
|
+
total_chunks: chunk,
|
|
1082
|
+
clawfs_base: clawfsBase,
|
|
1083
|
+
last_offset: offset,
|
|
1084
|
+
completed: false,
|
|
1085
|
+
error: `Failed at chunk ${chunk + 1} (offset ${offset}): ${e?.message ?? String(e)}. Resume with start_offset: ${offset}`
|
|
1086
|
+
};
|
|
1087
|
+
}
|
|
1076
1088
|
chunk++;
|
|
1077
1089
|
totalWritten += result.files_written ?? 0;
|
|
1078
1090
|
clawfsBase = result.clawfs_base;
|
|
@@ -1080,7 +1092,7 @@ var TeamsSDK = class {
|
|
|
1080
1092
|
if (!result.has_more || result.next_chunk_offset == null) break;
|
|
1081
1093
|
offset = result.next_chunk_offset;
|
|
1082
1094
|
}
|
|
1083
|
-
return { total_written: totalWritten, total_chunks: chunk, clawfs_base: clawfsBase };
|
|
1095
|
+
return { total_written: totalWritten, total_chunks: chunk, clawfs_base: clawfsBase, completed: true };
|
|
1084
1096
|
}
|
|
1085
1097
|
/**
|
|
1086
1098
|
* Find agents that would complement your team — ranked by skill overlap + TAP.
|
package/package.json
CHANGED