@lazehq/cli 0.1.98 → 0.1.99
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/laze.mjs +373 -111
- package/package.json +1 -1
package/dist/laze.mjs
CHANGED
|
@@ -21645,12 +21645,12 @@ var require_date = __commonJS({
|
|
|
21645
21645
|
return parseRfc850Date(date5);
|
|
21646
21646
|
}
|
|
21647
21647
|
}
|
|
21648
|
-
function makeDate(year, monthIdx,
|
|
21649
|
-
const result2 = new Date(Date.UTC(year, monthIdx,
|
|
21648
|
+
function makeDate(year, monthIdx, day2, hour, minute, second, weekday) {
|
|
21649
|
+
const result2 = new Date(Date.UTC(year, monthIdx, day2, hour, minute, second));
|
|
21650
21650
|
if (year >= 0 && year <= 99) {
|
|
21651
21651
|
result2.setUTCFullYear(year);
|
|
21652
21652
|
}
|
|
21653
|
-
return result2.getUTCFullYear() === year && result2.getUTCMonth() === monthIdx && result2.getUTCDate() ===
|
|
21653
|
+
return result2.getUTCFullYear() === year && result2.getUTCMonth() === monthIdx && result2.getUTCDate() === day2 && result2.getUTCHours() === hour && result2.getUTCMinutes() === minute && result2.getUTCSeconds() === second && result2.getUTCDay() === weekday ? result2 : void 0;
|
|
21654
21654
|
}
|
|
21655
21655
|
function parseImfDate(date5) {
|
|
21656
21656
|
if (date5.length !== 29 || date5[4] !== " " || date5[7] !== " " || date5[11] !== " " || date5[16] !== " " || date5[19] !== ":" || date5[22] !== ":" || date5[25] !== " " || date5[26] !== "G" || date5[27] !== "M" || date5[28] !== "T") {
|
|
@@ -21674,13 +21674,13 @@ var require_date = __commonJS({
|
|
|
21674
21674
|
} else {
|
|
21675
21675
|
return void 0;
|
|
21676
21676
|
}
|
|
21677
|
-
let
|
|
21677
|
+
let day2 = 0;
|
|
21678
21678
|
if (date5[5] === "0") {
|
|
21679
21679
|
const code = date5.charCodeAt(6);
|
|
21680
21680
|
if (code < 49 || code > 57) {
|
|
21681
21681
|
return void 0;
|
|
21682
21682
|
}
|
|
21683
|
-
|
|
21683
|
+
day2 = code - 48;
|
|
21684
21684
|
} else {
|
|
21685
21685
|
const code1 = date5.charCodeAt(5);
|
|
21686
21686
|
if (code1 < 49 || code1 > 51) {
|
|
@@ -21690,7 +21690,7 @@ var require_date = __commonJS({
|
|
|
21690
21690
|
if (code2 < 48 || code2 > 57) {
|
|
21691
21691
|
return void 0;
|
|
21692
21692
|
}
|
|
21693
|
-
|
|
21693
|
+
day2 = (code1 - 48) * 10 + (code2 - 48);
|
|
21694
21694
|
}
|
|
21695
21695
|
let monthIdx = -1;
|
|
21696
21696
|
if (date5[8] === "J" && date5[9] === "a" && date5[10] === "n") {
|
|
@@ -21812,7 +21812,7 @@ var require_date = __commonJS({
|
|
|
21812
21812
|
}
|
|
21813
21813
|
second = (code1 - 48) * 10 + (code2 - 48);
|
|
21814
21814
|
}
|
|
21815
|
-
return makeDate(year, monthIdx,
|
|
21815
|
+
return makeDate(year, monthIdx, day2, hour, minute, second, weekday);
|
|
21816
21816
|
}
|
|
21817
21817
|
function parseAscTimeDate(date5) {
|
|
21818
21818
|
if (date5.length !== 24 || date5[7] !== " " || date5[10] !== " " || date5[19] !== " ") {
|
|
@@ -21882,13 +21882,13 @@ var require_date = __commonJS({
|
|
|
21882
21882
|
} else {
|
|
21883
21883
|
return void 0;
|
|
21884
21884
|
}
|
|
21885
|
-
let
|
|
21885
|
+
let day2 = 0;
|
|
21886
21886
|
if (date5[8] === " ") {
|
|
21887
21887
|
const code = date5.charCodeAt(9);
|
|
21888
21888
|
if (code < 49 || code > 57) {
|
|
21889
21889
|
return void 0;
|
|
21890
21890
|
}
|
|
21891
|
-
|
|
21891
|
+
day2 = code - 48;
|
|
21892
21892
|
} else {
|
|
21893
21893
|
const code1 = date5.charCodeAt(8);
|
|
21894
21894
|
if (code1 < 49 || code1 > 51) {
|
|
@@ -21898,7 +21898,7 @@ var require_date = __commonJS({
|
|
|
21898
21898
|
if (code2 < 48 || code2 > 57) {
|
|
21899
21899
|
return void 0;
|
|
21900
21900
|
}
|
|
21901
|
-
|
|
21901
|
+
day2 = (code1 - 48) * 10 + (code2 - 48);
|
|
21902
21902
|
}
|
|
21903
21903
|
let hour = 0;
|
|
21904
21904
|
if (date5[11] === "0") {
|
|
@@ -21974,7 +21974,7 @@ var require_date = __commonJS({
|
|
|
21974
21974
|
return void 0;
|
|
21975
21975
|
}
|
|
21976
21976
|
const year = (yearDigit1 - 48) * 1e3 + (yearDigit2 - 48) * 100 + (yearDigit3 - 48) * 10 + (yearDigit4 - 48);
|
|
21977
|
-
return makeDate(year, monthIdx,
|
|
21977
|
+
return makeDate(year, monthIdx, day2, hour, minute, second, weekday);
|
|
21978
21978
|
}
|
|
21979
21979
|
function parseRfc850Date(date5) {
|
|
21980
21980
|
let commaIndex = -1;
|
|
@@ -22010,13 +22010,13 @@ var require_date = __commonJS({
|
|
|
22010
22010
|
if (date5[commaIndex] !== "," || date5.length - commaIndex - 1 !== 23 || date5[commaIndex + 1] !== " " || date5[commaIndex + 4] !== "-" || date5[commaIndex + 8] !== "-" || date5[commaIndex + 11] !== " " || date5[commaIndex + 14] !== ":" || date5[commaIndex + 17] !== ":" || date5[commaIndex + 20] !== " " || date5[commaIndex + 21] !== "G" || date5[commaIndex + 22] !== "M" || date5[commaIndex + 23] !== "T") {
|
|
22011
22011
|
return void 0;
|
|
22012
22012
|
}
|
|
22013
|
-
let
|
|
22013
|
+
let day2 = 0;
|
|
22014
22014
|
if (date5[commaIndex + 2] === "0") {
|
|
22015
22015
|
const code = date5.charCodeAt(commaIndex + 3);
|
|
22016
22016
|
if (code < 49 || code > 57) {
|
|
22017
22017
|
return void 0;
|
|
22018
22018
|
}
|
|
22019
|
-
|
|
22019
|
+
day2 = code - 48;
|
|
22020
22020
|
} else {
|
|
22021
22021
|
const code1 = date5.charCodeAt(commaIndex + 2);
|
|
22022
22022
|
if (code1 < 49 || code1 > 51) {
|
|
@@ -22026,7 +22026,7 @@ var require_date = __commonJS({
|
|
|
22026
22026
|
if (code2 < 48 || code2 > 57) {
|
|
22027
22027
|
return void 0;
|
|
22028
22028
|
}
|
|
22029
|
-
|
|
22029
|
+
day2 = (code1 - 48) * 10 + (code2 - 48);
|
|
22030
22030
|
}
|
|
22031
22031
|
let monthIdx = -1;
|
|
22032
22032
|
if (date5[commaIndex + 5] === "J" && date5[commaIndex + 6] === "a" && date5[commaIndex + 7] === "n") {
|
|
@@ -22123,7 +22123,7 @@ var require_date = __commonJS({
|
|
|
22123
22123
|
}
|
|
22124
22124
|
second = (code1 - 48) * 10 + (code2 - 48);
|
|
22125
22125
|
}
|
|
22126
|
-
return makeDate(year, monthIdx,
|
|
22126
|
+
return makeDate(year, monthIdx, day2, hour, minute, second, weekday);
|
|
22127
22127
|
}
|
|
22128
22128
|
module.exports = {
|
|
22129
22129
|
parseHttpDate
|
|
@@ -33140,11 +33140,11 @@ function computeIsoYearMonthFieldsForMonthDay(monthCodeNumber, isLeapMonth) {
|
|
|
33140
33140
|
};
|
|
33141
33141
|
}
|
|
33142
33142
|
}
|
|
33143
|
-
function computeIsoFieldsFromParts(year, month,
|
|
33143
|
+
function computeIsoFieldsFromParts(year, month, day2) {
|
|
33144
33144
|
return {
|
|
33145
33145
|
year,
|
|
33146
33146
|
month,
|
|
33147
|
-
day
|
|
33147
|
+
day: day2
|
|
33148
33148
|
};
|
|
33149
33149
|
}
|
|
33150
33150
|
function computeIsoDaysInMonth(year, month) {
|
|
@@ -33234,8 +33234,8 @@ function computeCalendarMonthCodeParts(calendar, year, month) {
|
|
|
33234
33234
|
function computeCalendarEraFields(calendar, isoDate) {
|
|
33235
33235
|
return 0 === calendar ? computeGregoryEraFields(isoDate) : calendar && calendar.h?.(isoDate) || {};
|
|
33236
33236
|
}
|
|
33237
|
-
function computeCalendarIsoFieldsFromParts(calendar, year, month,
|
|
33238
|
-
return calendar ? calendar.de(year, month,
|
|
33237
|
+
function computeCalendarIsoFieldsFromParts(calendar, year, month, day2) {
|
|
33238
|
+
return calendar ? calendar.de(year, month, day2) : computeIsoFieldsFromParts(year, month, day2);
|
|
33239
33239
|
}
|
|
33240
33240
|
function computeCalendarMonthsInYearForYear(calendar, year) {
|
|
33241
33241
|
return calendar ? calendar.j(year) : 12;
|
|
@@ -33667,8 +33667,8 @@ function roundBigNanoToInc(bigNano, bigNanoInc, roundingMode) {
|
|
|
33667
33667
|
return roundBigNanoToIncWithTail(bigNano, bigNanoInc, roundingMode, bigNano / bigNanoInc % 2n);
|
|
33668
33668
|
}
|
|
33669
33669
|
function roundBigNanoToDayOriginInc(bigNano, bigNanoInc, roundingMode) {
|
|
33670
|
-
const [
|
|
33671
|
-
const dayOriginNano =
|
|
33670
|
+
const [day2, timeNano] = divModFloorBigInt(bigNano, bigNanoInUtcDay);
|
|
33671
|
+
const dayOriginNano = day2 * bigNanoInUtcDay;
|
|
33672
33672
|
return dayOriginNano + roundBigNanoToIncWithTail(timeNano, bigNanoInc, roundingMode, (dayOriginNano / bigNanoInc + timeNano / bigNanoInc) % 2n);
|
|
33673
33673
|
}
|
|
33674
33674
|
function roundBigNanoToIncWithTail(bigNano, bigNanoInc, roundingMode, quotientTail) {
|
|
@@ -33870,7 +33870,7 @@ function dateAddWithOverflow(calendar, isoDateFields, durationFields, overflow)
|
|
|
33870
33870
|
}
|
|
33871
33871
|
function addDateMonths(calendar, isoDateFields, years, months, overflow) {
|
|
33872
33872
|
const dateParts = computeCalendarDateFields(calendar, isoDateFields);
|
|
33873
|
-
let { year, month, day } = dateParts;
|
|
33873
|
+
let { year, month, day: day2 } = dateParts;
|
|
33874
33874
|
if (years) {
|
|
33875
33875
|
const [monthCodeNumber, isLeapMonth] = computeCalendarMonthCodeParts(calendar, year, month);
|
|
33876
33876
|
year += years, month = computeYearMovedMonth(calendar, monthCodeNumber, isLeapMonth, calendar ? calendar.p(year) : void 0, overflow), month = clampEntity("month", month, 1, computeCalendarMonthsInYearForYear(calendar, year), overflow);
|
|
@@ -33879,7 +33879,7 @@ function addDateMonths(calendar, isoDateFields, years, months, overflow) {
|
|
|
33879
33879
|
const yearMonthParts = calendar ? calendar.K(year, month, months) : addIsoMonths(year, month, months);
|
|
33880
33880
|
({ year, month } = yearMonthParts);
|
|
33881
33881
|
}
|
|
33882
|
-
return
|
|
33882
|
+
return day2 = clampEntity("day", day2, 1, computeCalendarDaysInMonthForYearMonth(calendar, year, month), overflow), computeCalendarIsoFieldsFromParts(calendar, year, month, day2);
|
|
33883
33883
|
}
|
|
33884
33884
|
function computeYearMovedMonth(calendar, monthCodeNumber, isLeapMonth, targetLeapMonth, overflow) {
|
|
33885
33885
|
if (isLeapMonth) {
|
|
@@ -34454,31 +34454,31 @@ function createPlainMonthDayFromFields(calendar, fields, options) {
|
|
|
34454
34454
|
const monthCodeParts = parseMonthCodeField(fields);
|
|
34455
34455
|
let yearMaybe = void 0 !== fields.eraYear || void 0 !== fields.year ? resolveCalendarYear(calendar, fields) : void 0;
|
|
34456
34456
|
const overflow = refineOverflowOptions(options);
|
|
34457
|
-
let
|
|
34457
|
+
let day2;
|
|
34458
34458
|
let monthCodeNumber;
|
|
34459
34459
|
let isLeapMonth;
|
|
34460
34460
|
if (void 0 === yearMaybe && isIso && (yearMaybe = 1972), void 0 !== yearMaybe) {
|
|
34461
34461
|
isIso || checkIsoDateInBounds(computeCalendarIsoFieldsFromParts(calendar, yearMaybe, 1, 1));
|
|
34462
34462
|
const month = resolveCalendarMonth(calendar, fields, yearMaybe, overflow, monthCodeParts);
|
|
34463
|
-
|
|
34463
|
+
day2 = resolveCalendarDay(calendar, fields, month, yearMaybe, overflow), [monthCodeNumber, isLeapMonth] = computeCalendarMonthCodeParts(calendar, yearMaybe, month);
|
|
34464
34464
|
} else {
|
|
34465
34465
|
void 0 === fields.monthCode && throwTypeError("Missing month/monthCode"), [monthCodeNumber, isLeapMonth] = monthCodeParts;
|
|
34466
34466
|
const referenceYear = calendar ? calendar.ne : 1972;
|
|
34467
34467
|
if (void 0 !== referenceYear) {
|
|
34468
|
-
|
|
34468
|
+
day2 = resolveCalendarDay(calendar, fields, resolveCalendarMonth(calendar, fields, referenceYear, overflow, monthCodeParts), referenceYear, overflow);
|
|
34469
34469
|
} else {
|
|
34470
34470
|
const constrainedDay = 0 === overflow && calendar ? calendar.fe?.(monthCodeNumber, isLeapMonth, fields.day) : void 0;
|
|
34471
|
-
|
|
34471
|
+
day2 = void 0 !== constrainedDay ? constrainedDay : fields.day;
|
|
34472
34472
|
}
|
|
34473
34473
|
}
|
|
34474
|
-
isLeapMonth && ((calendar && calendar.U?.[monthCodeNumber]) ?? 1 / 0) < fields.day && (1 === overflow && throwRangeError(invalidLeapMonth), isLeapMonth = 0,
|
|
34475
|
-
let res = calendar ? calendar.u(monthCodeNumber, Boolean(isLeapMonth),
|
|
34476
|
-
for (; !res && 0 === overflow &&
|
|
34477
|
-
|
|
34474
|
+
isLeapMonth && ((calendar && calendar.U?.[monthCodeNumber]) ?? 1 / 0) < fields.day && (1 === overflow && throwRangeError(invalidLeapMonth), isLeapMonth = 0, day2 = constrainToRange2(fields.day, 1, (calendar && calendar.R) ?? 1 / 0));
|
|
34475
|
+
let res = calendar ? calendar.u(monthCodeNumber, Boolean(isLeapMonth), day2) : computeIsoYearMonthFieldsForMonthDay(monthCodeNumber, Boolean(isLeapMonth));
|
|
34476
|
+
for (; !res && 0 === overflow && day2 > 1; ) {
|
|
34477
|
+
day2--, res = calendar ? calendar.u(monthCodeNumber, Boolean(isLeapMonth), day2) : computeIsoYearMonthFieldsForMonthDay(monthCodeNumber, Boolean(isLeapMonth));
|
|
34478
34478
|
}
|
|
34479
34479
|
res || throwRangeError("Cannot guess year");
|
|
34480
34480
|
const { year: finalYear, month: finalMonth } = res;
|
|
34481
|
-
return createDateSlots(checkIsoDateInBounds(computeCalendarIsoFieldsFromParts(calendar, finalYear, finalMonth,
|
|
34481
|
+
return createDateSlots(checkIsoDateInBounds(computeCalendarIsoFieldsFromParts(calendar, finalYear, finalMonth, day2)), calendar);
|
|
34482
34482
|
}
|
|
34483
34483
|
var RawDateTimeFormat = Intl.DateTimeFormat;
|
|
34484
34484
|
function formatEpochMilliToPartsRecord(intlFormat, epochMilli) {
|
|
@@ -34940,13 +34940,13 @@ function parsePlainMonthDay(s, resolveCalendar) {
|
|
|
34940
34940
|
}
|
|
34941
34941
|
const dateSlots = finalizeDateLike(parsePlainDateLike(s), projectIsoMonthDayDate, resolveCalendar);
|
|
34942
34942
|
const { calendar } = dateSlots;
|
|
34943
|
-
const { year: origYear, month: origMonth, day } = computeCalendarDateFields(calendar, dateSlots);
|
|
34943
|
+
const { year: origYear, month: origMonth, day: day2 } = computeCalendarDateFields(calendar, dateSlots);
|
|
34944
34944
|
const [monthCodeNumber, isLeapMonth] = computeCalendarMonthCodeParts(calendar, origYear, origMonth);
|
|
34945
|
-
const { year, month } = ((calendar2, monthCodeNumber2, isLeapMonth2,
|
|
34946
|
-
const yearMonthFields = calendar2 ? calendar2.u(monthCodeNumber2, isLeapMonth2,
|
|
34945
|
+
const { year, month } = ((calendar2, monthCodeNumber2, isLeapMonth2, day3) => {
|
|
34946
|
+
const yearMonthFields = calendar2 ? calendar2.u(monthCodeNumber2, isLeapMonth2, day3) : computeIsoYearMonthFieldsForMonthDay(monthCodeNumber2, isLeapMonth2);
|
|
34947
34947
|
return yearMonthFields || throwRangeError("Cannot guess year"), yearMonthFields;
|
|
34948
|
-
})(calendar, monthCodeNumber, isLeapMonth,
|
|
34949
|
-
return createDateSlots(checkIsoDateInBounds(computeCalendarIsoFieldsFromParts(calendar, year, month,
|
|
34948
|
+
})(calendar, monthCodeNumber, isLeapMonth, day2);
|
|
34949
|
+
return createDateSlots(checkIsoDateInBounds(computeCalendarIsoFieldsFromParts(calendar, year, month, day2)), calendar);
|
|
34950
34950
|
}
|
|
34951
34951
|
function parsePlainTime(s) {
|
|
34952
34952
|
let organized = ((s2) => {
|
|
@@ -35007,10 +35007,10 @@ function finalizeDateLike(organized, isoDateProjector, resolveCalendar) {
|
|
|
35007
35007
|
return isoDateProjector && "iso8601" === organized.calendarId ? (validateIsoDateFields(organized), organized.re && validateTimeFields(organized), finalizeDate(isoDateProjector(organized), resolveCalendar)) : organized.re ? finalizeDateTime(organized, resolveCalendar) : finalizeDate(organized, resolveCalendar);
|
|
35008
35008
|
}
|
|
35009
35009
|
function projectIsoYearMonthDate(organized) {
|
|
35010
|
-
const
|
|
35010
|
+
const day2 = 12 * organized.year + organized.month === isoYearMonthIndexMin ? 20 : 1;
|
|
35011
35011
|
return {
|
|
35012
35012
|
...organized,
|
|
35013
|
-
day
|
|
35013
|
+
day: day2
|
|
35014
35014
|
};
|
|
35015
35015
|
}
|
|
35016
35016
|
function projectIsoMonthDayDate(organized) {
|
|
@@ -35146,11 +35146,11 @@ function mergeZonedDateTimeFields(zonedDateTimeSlots, modFields, options) {
|
|
|
35146
35146
|
const { calendar, timeZone } = zonedDateTimeSlots;
|
|
35147
35147
|
const validFieldNames = getCalendarFieldNames(calendar, dateTimeAndOffsetFieldNamesAlpha, dateTimeAndOffsetFieldNamesWithEraAlpha);
|
|
35148
35148
|
const zonedSlots = zonedEpochSlotsToIso(zonedDateTimeSlots);
|
|
35149
|
-
const { year, month, day } = computeCalendarDateFields(calendar, zonedSlots);
|
|
35149
|
+
const { year, month, day: day2 } = computeCalendarDateFields(calendar, zonedSlots);
|
|
35150
35150
|
const origFields = {
|
|
35151
35151
|
year,
|
|
35152
35152
|
monthCode: computeMonthCode(calendar, year, month),
|
|
35153
|
-
day,
|
|
35153
|
+
day: day2,
|
|
35154
35154
|
hour: zonedSlots.hour,
|
|
35155
35155
|
minute: zonedSlots.minute,
|
|
35156
35156
|
second: zonedSlots.second,
|
|
@@ -35171,11 +35171,11 @@ function mergeZonedDateTimeFields(zonedDateTimeSlots, modFields, options) {
|
|
|
35171
35171
|
function mergePlainDateTimeFields(plainDateTimeSlots, modFields, options) {
|
|
35172
35172
|
const { calendar } = plainDateTimeSlots;
|
|
35173
35173
|
const validFieldNames = getCalendarFieldNames(calendar, dateTimeFieldNamesAlpha, dateTimeFieldNamesWithEraAlpha);
|
|
35174
|
-
const { year, month, day } = computeCalendarDateFields(calendar, plainDateTimeSlots);
|
|
35174
|
+
const { year, month, day: day2 } = computeCalendarDateFields(calendar, plainDateTimeSlots);
|
|
35175
35175
|
const origFields = {
|
|
35176
35176
|
year,
|
|
35177
35177
|
monthCode: computeMonthCode(calendar, year, month),
|
|
35178
|
-
day,
|
|
35178
|
+
day: day2,
|
|
35179
35179
|
hour: plainDateTimeSlots.hour,
|
|
35180
35180
|
minute: plainDateTimeSlots.minute,
|
|
35181
35181
|
second: plainDateTimeSlots.second,
|
|
@@ -35195,11 +35195,11 @@ function mergePlainDateTimeFields(plainDateTimeSlots, modFields, options) {
|
|
|
35195
35195
|
function mergePlainDateFields(plainDateSlots, modFields, options) {
|
|
35196
35196
|
const { calendar } = plainDateSlots;
|
|
35197
35197
|
const validFieldNames = getCalendarFieldNames(calendar, dateFieldNamesAlpha, dateFieldNamesWithEraAlpha);
|
|
35198
|
-
const { year, month, day } = computeCalendarDateFields(calendar, plainDateSlots);
|
|
35198
|
+
const { year, month, day: day2 } = computeCalendarDateFields(calendar, plainDateSlots);
|
|
35199
35199
|
return createPlainDateFromFields(calendar, mergeCalendarFields(calendar, {
|
|
35200
35200
|
year,
|
|
35201
35201
|
monthCode: computeMonthCode(calendar, year, month),
|
|
35202
|
-
day
|
|
35202
|
+
day: day2
|
|
35203
35203
|
}, readAndRefineBagFields(modFields, validFieldNames, dateFieldRefiners)), options);
|
|
35204
35204
|
}
|
|
35205
35205
|
function mergePlainYearMonthFields(plainYearMonthSlots, modFields, options) {
|
|
@@ -35214,10 +35214,10 @@ function mergePlainYearMonthFields(plainYearMonthSlots, modFields, options) {
|
|
|
35214
35214
|
function mergePlainMonthDayFields(plainMonthDaySlots, modFields, options) {
|
|
35215
35215
|
const { calendar } = plainMonthDaySlots;
|
|
35216
35216
|
const validFieldNames = getCalendarFieldNames(calendar, dateFieldNamesAlpha, dateFieldNamesWithEraAlpha);
|
|
35217
|
-
const { year, month, day } = computeCalendarDateFields(calendar, plainMonthDaySlots);
|
|
35217
|
+
const { year, month, day: day2 } = computeCalendarDateFields(calendar, plainMonthDaySlots);
|
|
35218
35218
|
return createPlainMonthDayFromFields(calendar, mergeCalendarFields(calendar, {
|
|
35219
35219
|
monthCode: computeMonthCode(calendar, year, month),
|
|
35220
|
-
day
|
|
35220
|
+
day: day2
|
|
35221
35221
|
}, readAndRefineBagFields(modFields, validFieldNames, dateFieldRefiners)), options);
|
|
35222
35222
|
}
|
|
35223
35223
|
function mergePlainTimeFields(initialFields, mod, options) {
|
|
@@ -36960,7 +36960,7 @@ function shadowedLinkLineOf({ shadow }) {
|
|
|
36960
36960
|
}
|
|
36961
36961
|
|
|
36962
36962
|
// src/rules/cli-version.rules.ts
|
|
36963
|
-
var STAMPED = "0.1.
|
|
36963
|
+
var STAMPED = "0.1.99";
|
|
36964
36964
|
function cliVersionOf({ stamped = STAMPED } = {}) {
|
|
36965
36965
|
return stamped.startsWith("__") ? "dev" : stamped;
|
|
36966
36966
|
}
|
|
@@ -37391,6 +37391,7 @@ var SWITCHES = /* @__PURE__ */ new Set([
|
|
|
37391
37391
|
"as-is",
|
|
37392
37392
|
"save",
|
|
37393
37393
|
"private",
|
|
37394
|
+
"public",
|
|
37394
37395
|
"mentions",
|
|
37395
37396
|
"threads",
|
|
37396
37397
|
"reactions",
|
|
@@ -37449,6 +37450,29 @@ function flagText({
|
|
|
37449
37450
|
return typeof value === "string" ? value : fallback;
|
|
37450
37451
|
}
|
|
37451
37452
|
|
|
37453
|
+
// src/rules/linked-profile.rules.ts
|
|
37454
|
+
function slugOf(name3) {
|
|
37455
|
+
return name3.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || "agent";
|
|
37456
|
+
}
|
|
37457
|
+
function linkedProfileNameOf({
|
|
37458
|
+
args,
|
|
37459
|
+
linked,
|
|
37460
|
+
profiles: profiles2
|
|
37461
|
+
}) {
|
|
37462
|
+
const wanted = flagText({ args, name: "profile" }) || `agent-${slugOf(linked.agent.name)}`;
|
|
37463
|
+
const free = (name3) => {
|
|
37464
|
+
const held = profiles2[name3];
|
|
37465
|
+
return !held || held.kind === "agent" && held.agentId === linked.agent.id;
|
|
37466
|
+
};
|
|
37467
|
+
if (free(wanted)) return wanted;
|
|
37468
|
+
for (let number4 = 2; ; number4 += 1) {
|
|
37469
|
+
if (free(`${wanted}-${number4}`)) return `${wanted}-${number4}`;
|
|
37470
|
+
}
|
|
37471
|
+
}
|
|
37472
|
+
function revokedKeyLineOf({ profile }) {
|
|
37473
|
+
return `${profile}: this agent's key was revoked: run \`laze agent link\` again or remove it with \`laze logout --profile ${profile}\``;
|
|
37474
|
+
}
|
|
37475
|
+
|
|
37452
37476
|
// src/rules/refusal-format.rules.ts
|
|
37453
37477
|
function refusalText({ code, message: message2 }) {
|
|
37454
37478
|
const sentence = message2.trim().replace(/[.!]*$/, ".");
|
|
@@ -61876,6 +61900,37 @@ var vaultAppUseAnswerSchemaDefinition = external_exports.discriminatedUnion("dec
|
|
|
61876
61900
|
var count = external_exports.number().nonnegative().max(1e15);
|
|
61877
61901
|
var countMap = external_exports.record(external_exports.string().max(128), count).nullish().transform((value) => value ?? {});
|
|
61878
61902
|
var lines = external_exports.array(external_exports.string().max(2e3)).max(200).nullish().transform((value) => value ?? []);
|
|
61903
|
+
var RFC3339 = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?(?:Z|[+-]\d{2}:\d{2})$/;
|
|
61904
|
+
var DAY = /^\d{4}-\d{2}-\d{2}$/;
|
|
61905
|
+
var day = external_exports.string().regex(DAY, "a YYYY-MM-DD day");
|
|
61906
|
+
var workspaceIdText = external_exports.string().max(128);
|
|
61907
|
+
var vaultWatchContentReconcileSchemaDefinition = external_exports.object({
|
|
61908
|
+
day,
|
|
61909
|
+
state: external_exports.enum(["matched", "mismatch", "learning", "failed"]),
|
|
61910
|
+
armed: external_exports.boolean(),
|
|
61911
|
+
tolerance: count,
|
|
61912
|
+
gateUnwraps: count.nullable(),
|
|
61913
|
+
vaultdUnwraps: count.nullable(),
|
|
61914
|
+
vaultdTracked: external_exports.boolean(),
|
|
61915
|
+
/** Unwraps content-gate logged that vaultd did not count: the key used outside Laze. */
|
|
61916
|
+
unaccounted: count,
|
|
61917
|
+
/** Unwraps vaultd counted that content-gate did not log. */
|
|
61918
|
+
missingFromGate: count,
|
|
61919
|
+
workspaces: external_exports.array(external_exports.object({ workspaceId: workspaceIdText, gate: count, vaultd: count })).max(50).nullish().transform((value) => value ?? []),
|
|
61920
|
+
reasons: lines,
|
|
61921
|
+
attempts: external_exports.number().int().min(0),
|
|
61922
|
+
failure: external_exports.string().max(2e3).optional(),
|
|
61923
|
+
checkedAt: external_exports.iso.datetime({ offset: true })
|
|
61924
|
+
});
|
|
61925
|
+
var vaultWatchContentUnwrapsQuerySchemaDefinition = external_exports.object({ day });
|
|
61926
|
+
var vaultWatchContentUnwrapsSchemaDefinition = external_exports.object({
|
|
61927
|
+
day,
|
|
61928
|
+
/** False when vaultd did not count the whole day, so a missing count is not a zero. */
|
|
61929
|
+
tracked: external_exports.boolean(),
|
|
61930
|
+
countingSince: external_exports.string().regex(RFC3339, "an RFC 3339 time").nullable(),
|
|
61931
|
+
total: count,
|
|
61932
|
+
workspaces: external_exports.record(workspaceIdText, count)
|
|
61933
|
+
});
|
|
61879
61934
|
var vaultWatchThresholdsSchemaDefinition = external_exports.object({
|
|
61880
61935
|
per10m: count,
|
|
61881
61936
|
perHour: count,
|
|
@@ -61910,7 +61965,8 @@ var vaultWatchReportSchemaDefinition = external_exports.object({
|
|
|
61910
61965
|
failures: lines,
|
|
61911
61966
|
operatorChainLength: external_exports.number().int().min(0).optional(),
|
|
61912
61967
|
operatorChainHead: external_exports.string().max(128).optional(),
|
|
61913
|
-
operatorChainProblem: external_exports.string().max(2e3).optional()
|
|
61968
|
+
operatorChainProblem: external_exports.string().max(2e3).optional(),
|
|
61969
|
+
contentReconcile: vaultWatchContentReconcileSchemaDefinition.nullish().transform((value) => value ?? null)
|
|
61914
61970
|
});
|
|
61915
61971
|
var vaultWatchReportReceiptSchemaDefinition = external_exports.object({
|
|
61916
61972
|
stored: external_exports.boolean(),
|
|
@@ -61926,7 +61982,6 @@ var vaultPasskeyAssertionSchemaDefinition = external_exports.object({
|
|
|
61926
61982
|
signature: b64url2
|
|
61927
61983
|
});
|
|
61928
61984
|
var vaultPasskeyAssertionSchema = vaultPasskeyAssertionSchemaDefinition;
|
|
61929
|
-
var RFC3339 = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?(?:Z|[+-]\d{2}:\d{2})$/;
|
|
61930
61985
|
var vaultWatchOverrideSchemaDefinition = external_exports.object({
|
|
61931
61986
|
ceilingPerHour: external_exports.number().int().positive().max(1e12),
|
|
61932
61987
|
/** Kept exactly as signed: the challenge covers these characters. */
|
|
@@ -62207,6 +62262,30 @@ function fillCommandReferences({
|
|
|
62207
62262
|
};
|
|
62208
62263
|
}
|
|
62209
62264
|
|
|
62265
|
+
// ../../modules/chat/contract/src/chat.close.ts
|
|
62266
|
+
var conversationOpenDaysSchemaDefinition = external_exports.union([external_exports.literal(7), external_exports.literal(14), external_exports.literal(30), external_exports.literal(90)]).nullable();
|
|
62267
|
+
var conversationOpenDaysSchema = conversationOpenDaysSchemaDefinition;
|
|
62268
|
+
var conversationClosedSchemaDefinition = external_exports.object({
|
|
62269
|
+
at: external_exports.iso.datetime(),
|
|
62270
|
+
/** The person who closed it; null when it closed on its own after `afterDays` days. */
|
|
62271
|
+
byId: external_exports.string().nullable(),
|
|
62272
|
+
afterDays: external_exports.number().int().positive().nullable()
|
|
62273
|
+
});
|
|
62274
|
+
var conversationClosedSchema = conversationClosedSchemaDefinition;
|
|
62275
|
+
var conversationPolicySchemaDefinition = external_exports.object({
|
|
62276
|
+
workspaceId: external_exports.string().min(1),
|
|
62277
|
+
/** Days without a message before a conversation closes; null keeps them open. */
|
|
62278
|
+
openDays: conversationOpenDaysSchema
|
|
62279
|
+
});
|
|
62280
|
+
var conversationPolicySchema = conversationPolicySchemaDefinition;
|
|
62281
|
+
var promoteChatInputSchemaDefinition = external_exports.object({
|
|
62282
|
+
workspaceId: external_exports.string().min(1),
|
|
62283
|
+
channelId: external_exports.string().min(1),
|
|
62284
|
+
name: external_exports.string().trim().min(1).max(80),
|
|
62285
|
+
visibility: external_exports.enum(["private", "public"]).default("private")
|
|
62286
|
+
});
|
|
62287
|
+
var chatConversationPolicyTrpc = defineTrpcContract("chat").query("conversationPolicy").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(conversationPolicySchema).mutation("setConversationPolicy").withInput(conversationPolicySchema).withOutput(conversationPolicySchema).build();
|
|
62288
|
+
|
|
62210
62289
|
// ../../modules/chat/contract/src/chat.display.ts
|
|
62211
62290
|
var linkPreviewsSchema = external_exports.enum(["closed", "open"]);
|
|
62212
62291
|
var readerPreferencesDefinition = external_exports.object({ linkPreviews: linkPreviewsSchema });
|
|
@@ -63267,7 +63346,9 @@ var conversationSchemaDefinition = external_exports.object({
|
|
|
63267
63346
|
* Direct messages only: the people who left the workspace while in it, no longer members.
|
|
63268
63347
|
* Spec: modules/chat/specs/departed-person-direct.feature. Absent means no one.
|
|
63269
63348
|
*/
|
|
63270
|
-
departed: external_exports.array(departedPersonSchemaDefinition).optional()
|
|
63349
|
+
departed: external_exports.array(departedPersonSchemaDefinition).optional(),
|
|
63350
|
+
/** A conversation with an agent that closed: readable, no new messages. Absent while open. */
|
|
63351
|
+
closed: conversationClosedSchema.nullable().optional()
|
|
63271
63352
|
});
|
|
63272
63353
|
var conversationSchema = conversationSchemaDefinition;
|
|
63273
63354
|
var reachableConversationSchemaDefinition = external_exports.object({
|
|
@@ -63401,9 +63482,12 @@ var messageInputSchemaDefinition = external_exports.object({
|
|
|
63401
63482
|
messageId: idSchema4
|
|
63402
63483
|
});
|
|
63403
63484
|
var messageInputSchema = messageInputSchemaDefinition;
|
|
63485
|
+
var joiningAgentLevelSchema = external_exports.enum(["everything", "mentions"]);
|
|
63404
63486
|
var addMentionedInputSchemaDefinition = external_exports.object({
|
|
63405
63487
|
...messageInputSchemaDefinition.shape,
|
|
63406
|
-
agentNames: external_exports.array(external_exports.object({ id: idSchema4, name: external_exports.string().min(1) })).default([])
|
|
63488
|
+
agentNames: external_exports.array(external_exports.object({ id: idSchema4, name: external_exports.string().min(1) })).default([]),
|
|
63489
|
+
/** The joining agents' setting in the channel; Everything when absent. */
|
|
63490
|
+
agentLevel: joiningAgentLevelSchema.optional()
|
|
63407
63491
|
});
|
|
63408
63492
|
var addMentionedInputSchema = addMentionedInputSchemaDefinition;
|
|
63409
63493
|
var createChannelInputSchemaDefinition = external_exports.object({
|
|
@@ -63460,7 +63544,9 @@ var newMemberSchemaDefinition = external_exports.object({
|
|
|
63460
63544
|
runsOutside: external_exports.boolean().optional(),
|
|
63461
63545
|
/** An agent's owner and whether it is theirs alone or the team's, for its join line. */
|
|
63462
63546
|
ownerUserId: idSchema4.optional(),
|
|
63463
|
-
agentKind: external_exports.enum(["personal", "team"]).optional()
|
|
63547
|
+
agentKind: external_exports.enum(["personal", "team"]).optional(),
|
|
63548
|
+
/** A joining agent's setting in the channel; Everything when absent. */
|
|
63549
|
+
level: joiningAgentLevelSchema.optional()
|
|
63464
63550
|
});
|
|
63465
63551
|
var channelGroupInputSchemaDefinition = external_exports.object({
|
|
63466
63552
|
workspaceId: external_exports.string().min(1),
|
|
@@ -63541,7 +63627,9 @@ var chatSummarySchemaDefinition = external_exports.object({
|
|
|
63541
63627
|
peopleNames: external_exports.array(external_exports.string()),
|
|
63542
63628
|
joined: external_exports.boolean(),
|
|
63543
63629
|
lastMessageAt: external_exports.iso.datetime().nullable(),
|
|
63544
|
-
createdAt: external_exports.iso.datetime()
|
|
63630
|
+
createdAt: external_exports.iso.datetime(),
|
|
63631
|
+
/** When it closed; absent while it is open. */
|
|
63632
|
+
closedAt: external_exports.iso.datetime().optional()
|
|
63545
63633
|
});
|
|
63546
63634
|
var chatSummarySchema = chatSummarySchemaDefinition;
|
|
63547
63635
|
var openAgentDirectInputSchemaDefinition = external_exports.object({
|
|
@@ -64450,6 +64538,7 @@ var chatPresenceTrpc = defineTrpcContract("chat").mutation("heartbeat").withInpu
|
|
|
64450
64538
|
var chatTrpc = joinTrpcContracts(
|
|
64451
64539
|
"chat",
|
|
64452
64540
|
chatEmojiTrpc,
|
|
64541
|
+
chatConversationPolicyTrpc,
|
|
64453
64542
|
chatConversationsTrpc,
|
|
64454
64543
|
chatChannelRolesTrpc,
|
|
64455
64544
|
chatMessagesTrpc,
|
|
@@ -67416,6 +67505,20 @@ var renameConversationAsCallerInputSchemaDefinition = external_exports.object({
|
|
|
67416
67505
|
title: chatTitleSchema
|
|
67417
67506
|
});
|
|
67418
67507
|
var conversationAsCallerInputSchemaDefinition = external_exports.object({ channel: idSchema7 });
|
|
67508
|
+
var convertConversationInputSchemaDefinition = external_exports.object({
|
|
67509
|
+
workspaceId: workspaceIdSchema4,
|
|
67510
|
+
channelId: idSchema7,
|
|
67511
|
+
name: external_exports.string().trim().min(1).max(80),
|
|
67512
|
+
visibility: external_exports.enum(["private", "public"]).default("private")
|
|
67513
|
+
});
|
|
67514
|
+
var convertConversationInputSchema = convertConversationInputSchemaDefinition;
|
|
67515
|
+
var convertConversationAsCallerInputSchemaDefinition = external_exports.object({
|
|
67516
|
+
channel: idSchema7,
|
|
67517
|
+
name: external_exports.string().trim().min(1).max(80),
|
|
67518
|
+
visibility: external_exports.enum(["private", "public"]).default("private")
|
|
67519
|
+
});
|
|
67520
|
+
var convertedConversationSchemaDefinition = external_exports.object({ channelId: idSchema7 });
|
|
67521
|
+
var convertedConversationSchema = convertedConversationSchemaDefinition;
|
|
67419
67522
|
var NAMING_FREE_CLI_COMMANDS = [
|
|
67420
67523
|
"conversation rename",
|
|
67421
67524
|
"conversation list",
|
|
@@ -69637,7 +69740,9 @@ var inboxMessageSchemaDefinition = external_exports.object({
|
|
|
69637
69740
|
});
|
|
69638
69741
|
var receiveInboxInputSchemaDefinition = external_exports.object({
|
|
69639
69742
|
waitSeconds: external_exports.coerce.number().int().min(0).max(INBOX_WAIT_MAX_SECONDS).default(0),
|
|
69640
|
-
limit: external_exports.coerce.number().int().min(1).max(50).default(20)
|
|
69743
|
+
limit: external_exports.coerce.number().int().min(1).max(50).default(20),
|
|
69744
|
+
/** A one-off take by hand (`laze inbox`): nothing keeps listening, so it never shows online. */
|
|
69745
|
+
byHand: external_exports.boolean().optional()
|
|
69641
69746
|
});
|
|
69642
69747
|
var inboxWaitingSchemaDefinition = external_exports.object({
|
|
69643
69748
|
count: external_exports.number().int().min(0),
|
|
@@ -69889,6 +69994,7 @@ var agentRunsOnTrpc = defineTrpcContract("agents").mutation("setRunsOn").withInp
|
|
|
69889
69994
|
var agentWelcomeTrpc = defineTrpcContract("agents").mutation("pressWelcome").withInput(pressWelcomeInputSchema).withOutput(pressedWelcomeSchema).mutation("pressCollab").withInput(pressCollabInputSchema).withOutput(pressedCollabSchema).build();
|
|
69890
69995
|
var agentPoolGroupTrpc = defineTrpcContract("agents").mutation("addPoolGroup").withInput(poolGroupInputSchema).withOutput(loginPoolsSchema).mutation("removePoolGroup").withInput(poolGroupInputSchema).withOutput(loginPoolsSchema).build();
|
|
69891
69996
|
var agentOpenConversationTrpc = defineTrpcContract("agents").mutation("openConversation").withInput(openConversationInputSchema).withOutput(external_exports.object({ channelId: idSchema17 })).build();
|
|
69997
|
+
var agentConversationCloseTrpc = defineTrpcContract("agents").mutation("closeConversation").withInput(conversationInputSchema).withOutput(conversationSummarySchema2).mutation("reopenConversation").withInput(conversationInputSchema).withOutput(conversationSummarySchema2).mutation("convertConversation").withInput(convertConversationInputSchema).withOutput(convertedConversationSchema).build();
|
|
69892
69998
|
var agentReconnectTrpc = defineTrpcContract("agents").query("reconnect").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema17 })).withOutput(agentReconnectSchema).build();
|
|
69893
69999
|
var agentTrpc = joinTrpcContracts(
|
|
69894
70000
|
"agents",
|
|
@@ -69896,6 +70002,7 @@ var agentTrpc = joinTrpcContracts(
|
|
|
69896
70002
|
agentPoolGroupTrpc,
|
|
69897
70003
|
agentReconnectTrpc,
|
|
69898
70004
|
agentOpenConversationTrpc,
|
|
70005
|
+
agentConversationCloseTrpc,
|
|
69899
70006
|
agentTurnTrpc,
|
|
69900
70007
|
agentChannelSettingsTrpc,
|
|
69901
70008
|
agentJoinTrpc,
|
|
@@ -70789,27 +70896,22 @@ var agentProfileUi = uiTokens("agent");
|
|
|
70789
70896
|
var AgentProfileSlot = agentProfileUi.component("profile");
|
|
70790
70897
|
var AgentOwnedListSlot = agentProfileUi.component("ownedList");
|
|
70791
70898
|
|
|
70792
|
-
// src/rules/
|
|
70793
|
-
|
|
70794
|
-
|
|
70795
|
-
|
|
70796
|
-
|
|
70797
|
-
|
|
70798
|
-
|
|
70799
|
-
|
|
70800
|
-
|
|
70801
|
-
|
|
70802
|
-
|
|
70803
|
-
|
|
70804
|
-
|
|
70805
|
-
};
|
|
70806
|
-
if (free(wanted)) return wanted;
|
|
70807
|
-
for (let number4 = 2; ; number4 += 1) {
|
|
70808
|
-
if (free(`${wanted}-${number4}`)) return `${wanted}-${number4}`;
|
|
70809
|
-
}
|
|
70899
|
+
// src/rules/key-refusal.rules.ts
|
|
70900
|
+
var KEY_REFUSAL_CODES = /* @__PURE__ */ new Set([
|
|
70901
|
+
"unauthorized",
|
|
70902
|
+
"invalid_credentials",
|
|
70903
|
+
"machine_key_burst_revoked"
|
|
70904
|
+
]);
|
|
70905
|
+
var KEY_REFUSAL_MESSAGES = /* @__PURE__ */ new Set([
|
|
70906
|
+
"This API key is not valid",
|
|
70907
|
+
"Invalid credentials.",
|
|
70908
|
+
"This CLI key read too much in a minute, so Laze revoked it; sign in again with laze login"
|
|
70909
|
+
]);
|
|
70910
|
+
function refusesTheKey({ status: status11, code }) {
|
|
70911
|
+
return status11 === 401 && KEY_REFUSAL_CODES.has(code);
|
|
70810
70912
|
}
|
|
70811
|
-
function
|
|
70812
|
-
return
|
|
70913
|
+
function markRefusesTheKey({ mark }) {
|
|
70914
|
+
return mark.code ? KEY_REFUSAL_CODES.has(mark.code) : KEY_REFUSAL_MESSAGES.has(mark.message);
|
|
70813
70915
|
}
|
|
70814
70916
|
|
|
70815
70917
|
// src/rules/session-headers.rules.ts
|
|
@@ -70871,7 +70973,8 @@ var LazeClient = class _LazeClient {
|
|
|
70871
70973
|
token: token2,
|
|
70872
70974
|
fetcher,
|
|
70873
70975
|
onMigrated,
|
|
70874
|
-
onRefused
|
|
70976
|
+
onRefused,
|
|
70977
|
+
onAnswered
|
|
70875
70978
|
}) {
|
|
70876
70979
|
return new _LazeClient({
|
|
70877
70980
|
baseUrl: baseUrl.replace(/\/+$/, ""),
|
|
@@ -70879,7 +70982,8 @@ var LazeClient = class _LazeClient {
|
|
|
70879
70982
|
fetcher,
|
|
70880
70983
|
headers: {},
|
|
70881
70984
|
onMigrated,
|
|
70882
|
-
onRefused
|
|
70985
|
+
onRefused,
|
|
70986
|
+
onAnswered
|
|
70883
70987
|
});
|
|
70884
70988
|
}
|
|
70885
70989
|
/** The same client, sending these headers too on every call. */
|
|
@@ -70921,7 +71025,7 @@ var LazeClient = class _LazeClient {
|
|
|
70921
71025
|
const found = migratedNoticeOf(error63);
|
|
70922
71026
|
if (found && this.options.onMigrated)
|
|
70923
71027
|
await this.options.onMigrated(found).catch(() => void 0);
|
|
70924
|
-
else if (!found && error63
|
|
71028
|
+
else if (!found && refusesTheKey(error63) && this.options.onRefused)
|
|
70925
71029
|
await this.options.onRefused(error63).catch(() => void 0);
|
|
70926
71030
|
}
|
|
70927
71031
|
async send({
|
|
@@ -70949,6 +71053,7 @@ var LazeClient = class _LazeClient {
|
|
|
70949
71053
|
await this.toldMigrated(error63);
|
|
70950
71054
|
throw error63;
|
|
70951
71055
|
}
|
|
71056
|
+
if (this.options.onAnswered) await this.options.onAnswered().catch(() => void 0);
|
|
70952
71057
|
return text3 ? JSON.parse(text3) : void 0;
|
|
70953
71058
|
}
|
|
70954
71059
|
};
|
|
@@ -71086,14 +71191,28 @@ function markRefusedOn({
|
|
|
71086
71191
|
token: token2
|
|
71087
71192
|
}) {
|
|
71088
71193
|
return async (error63) => {
|
|
71089
|
-
const refused = { at: context.nowMs(), message: error63.message };
|
|
71194
|
+
const refused = { at: context.nowMs(), code: error63.code, message: error63.message };
|
|
71090
71195
|
const marked = await context.store.markRefused({ name: profile, token: token2, refused });
|
|
71091
71196
|
if (marked) context.err(`${revokedKeyLineOf({ profile })}
|
|
71092
71197
|
`);
|
|
71093
71198
|
};
|
|
71094
71199
|
}
|
|
71095
71200
|
function refusedRecently({ profile, nowMs: nowMs2 }) {
|
|
71096
|
-
|
|
71201
|
+
const mark = profile.refused;
|
|
71202
|
+
if (!mark || !markRefusesTheKey({ mark })) return false;
|
|
71203
|
+
return nowMs2 - mark.at < REFUSED_RECHECK_MS;
|
|
71204
|
+
}
|
|
71205
|
+
function clearRefusedOn({
|
|
71206
|
+
context,
|
|
71207
|
+
profile,
|
|
71208
|
+
token: token2
|
|
71209
|
+
}) {
|
|
71210
|
+
let cleared = false;
|
|
71211
|
+
return async () => {
|
|
71212
|
+
if (cleared) return;
|
|
71213
|
+
cleared = true;
|
|
71214
|
+
await context.store.markRefused({ name: profile, token: token2, refused: void 0 });
|
|
71215
|
+
};
|
|
71097
71216
|
}
|
|
71098
71217
|
function quietWhenMigrated({ args }) {
|
|
71099
71218
|
const [first = "", second = ""] = args.words;
|
|
@@ -71149,7 +71268,8 @@ async function signedIn({
|
|
|
71149
71268
|
token: token2,
|
|
71150
71269
|
fetcher: context.fetcher,
|
|
71151
71270
|
onMigrated: markMigratedOn({ context, profile: chosen.name }),
|
|
71152
|
-
|
|
71271
|
+
onRefused: markRefusedOn({ context, profile: chosen.name, token: token2 }),
|
|
71272
|
+
...chosen.profile.refused ? { onAnswered: clearRefusedOn({ context, profile: chosen.name, token: token2 }) } : {}
|
|
71153
71273
|
});
|
|
71154
71274
|
if (quiet && chosen.profile.refused) await askedAgain({ context, name: chosen.name, client });
|
|
71155
71275
|
if (chosen.profile.kind !== "agent")
|
|
@@ -71174,7 +71294,7 @@ async function askedAgain({
|
|
|
71174
71294
|
try {
|
|
71175
71295
|
await client.get("/api/agents/me");
|
|
71176
71296
|
} catch (error63) {
|
|
71177
|
-
if (error63
|
|
71297
|
+
if (refusesTheKey(error63)) throw new ProfileRefusedError(name3);
|
|
71178
71298
|
return;
|
|
71179
71299
|
}
|
|
71180
71300
|
if (profile) await context.store.markRefused({ name: name3, token: profile.token, refused: void 0 });
|
|
@@ -72745,8 +72865,7 @@ function rushSessionOf({
|
|
|
72745
72865
|
}) {
|
|
72746
72866
|
if (!parentArgs) return void 0;
|
|
72747
72867
|
const [program = "", verb, action, id4] = parentArgs;
|
|
72748
|
-
|
|
72749
|
-
if (!isRush || verb !== "host" || action !== "run" || !id4) return void 0;
|
|
72868
|
+
if (!program || verb !== "host" || action !== "run" || !id4) return void 0;
|
|
72750
72869
|
return { id: id4, program };
|
|
72751
72870
|
}
|
|
72752
72871
|
function rushSendCommand({ program, id: id4 }) {
|
|
@@ -73271,6 +73390,11 @@ async function preToolHook({ context, args }) {
|
|
|
73271
73390
|
})
|
|
73272
73391
|
);
|
|
73273
73392
|
} catch (error63) {
|
|
73393
|
+
if (error63 instanceof ProfileRefusedError) {
|
|
73394
|
+
context.err(`${revokedKeyLineOf({ profile: error63.profile })}
|
|
73395
|
+
`);
|
|
73396
|
+
return;
|
|
73397
|
+
}
|
|
73274
73398
|
if (error63 instanceof ProfileMigratedError) return;
|
|
73275
73399
|
const migrated = migratedNoticeOf(error63);
|
|
73276
73400
|
context.err(
|
|
@@ -73911,14 +74035,16 @@ async function reply({
|
|
|
73911
74035
|
async function receiveMessages({
|
|
73912
74036
|
context,
|
|
73913
74037
|
client,
|
|
73914
|
-
waitSeconds
|
|
74038
|
+
waitSeconds,
|
|
74039
|
+
byHand = false
|
|
73915
74040
|
}) {
|
|
73916
74041
|
const deadline = context.nowMs() + waitSeconds * 1e3;
|
|
73917
74042
|
let remaining = waitSeconds;
|
|
73918
74043
|
for (let round = 0; round === 0 || remaining > 0; round += 1) {
|
|
73919
74044
|
const wait = Math.max(0, Math.min(REQUEST_WAIT_SECONDS, Math.ceil(remaining)));
|
|
73920
74045
|
const messages = await client.post("/api/agents/me/inbox", {
|
|
73921
|
-
waitSeconds: wait
|
|
74046
|
+
waitSeconds: wait,
|
|
74047
|
+
...byHand ? { byHand: true } : {}
|
|
73922
74048
|
});
|
|
73923
74049
|
if (messages.length > 0) return messages;
|
|
73924
74050
|
remaining = Number.isFinite(waitSeconds) ? (deadline - context.nowMs()) / 1e3 : Infinity;
|
|
@@ -73952,7 +74078,8 @@ async function inbox({ context, args }) {
|
|
|
73952
74078
|
const { client, name: name3, profile } = await signedIn({ context, args });
|
|
73953
74079
|
if (profile.kind === "agent") await refuseOtherSessionsInbox({ context, args, name: name3, client });
|
|
73954
74080
|
const waitSeconds = waitSecondsOf({ args });
|
|
73955
|
-
const
|
|
74081
|
+
const byHand = !args.flags.wait;
|
|
74082
|
+
const messages = await receiveMessages({ context, client, waitSeconds, byHand });
|
|
73956
74083
|
if (profile.kind === "agent" && context.environment.harness === "claude-code") {
|
|
73957
74084
|
await turnStarted({ context, client, agent: name3, messages }).catch(() => void 0);
|
|
73958
74085
|
}
|
|
@@ -76191,9 +76318,7 @@ async function waitForMessages({ context, args }) {
|
|
|
76191
76318
|
const named = await sessionProfileArgs({ context, args: asked, session });
|
|
76192
76319
|
const { client, name: name3 } = await signedIn({ context, args: named });
|
|
76193
76320
|
await rememberSession({ context, claudePid, session });
|
|
76194
|
-
const rush =
|
|
76195
|
-
parentArgs: await context.processes.argsOf(await context.processes.parentOf(claudePid) ?? 0)
|
|
76196
|
-
});
|
|
76321
|
+
const rush = claudePid ? await rushAboveOf({ context, from: claudePid }) : void 0;
|
|
76197
76322
|
if (rush) await startRushGuard({ context, profile: name3, claudePid, rush });
|
|
76198
76323
|
if (rush) await healRushDelivery({ context });
|
|
76199
76324
|
const lock = statePathOf({ context, kind: "waiters", profile: name3 });
|
|
@@ -76247,13 +76372,17 @@ async function refusedOnce({
|
|
|
76247
76372
|
args,
|
|
76248
76373
|
error: error63
|
|
76249
76374
|
}) {
|
|
76250
|
-
const profile = String(args.flags.profile ?? "default");
|
|
76375
|
+
const profile = error63 instanceof ProfileRefusedError ? error63.profile : String(args.flags.profile ?? "default");
|
|
76251
76376
|
const path = statePathOf({ context, kind: "told", profile: `refused-${profile}` });
|
|
76252
76377
|
const told = await readFile9(path, "utf8").then(
|
|
76253
76378
|
() => true,
|
|
76254
76379
|
() => false
|
|
76255
76380
|
);
|
|
76256
|
-
if (told)
|
|
76381
|
+
if (told) {
|
|
76382
|
+
context.err(`${revokedKeyLineOf({ profile })}
|
|
76383
|
+
`);
|
|
76384
|
+
return 0;
|
|
76385
|
+
}
|
|
76257
76386
|
await writeStateText({ path, text: String(context.nowMs()) });
|
|
76258
76387
|
context.err(
|
|
76259
76388
|
`Laze: Laze refused this agent's key (${String(error63)}), so messages no longer reach this session. Link it again: laze agent link.
|
|
@@ -76281,6 +76410,7 @@ async function waitHook({ context, args }) {
|
|
|
76281
76410
|
try {
|
|
76282
76411
|
return await waitForMessages({ context, args });
|
|
76283
76412
|
} catch (error63) {
|
|
76413
|
+
if (error63 instanceof ProfileRefusedError) return refusedOnce({ context, args, error: error63 });
|
|
76284
76414
|
if (error63 instanceof ProfileMigratedError) return 0;
|
|
76285
76415
|
const migrated = migratedNoticeOf(error63);
|
|
76286
76416
|
if (migrated) {
|
|
@@ -77172,17 +77302,29 @@ async function listenAfterLink({
|
|
|
77172
77302
|
profile,
|
|
77173
77303
|
claudePid
|
|
77174
77304
|
}) {
|
|
77175
|
-
if (!claudePid) return;
|
|
77176
|
-
const parent = await context.processes.parentOf(claudePid) ?? 0;
|
|
77177
|
-
const rush = rushSessionOf({ parentArgs: await context.processes.argsOf(parent) });
|
|
77178
|
-
if (!rush) return;
|
|
77305
|
+
if (!claudePid) return await liveListenerOf({ context, profile }) ? "listening" : "none";
|
|
77179
77306
|
const session = await currentSessionOf({ context, args });
|
|
77180
77307
|
await rememberSession({ context, claudePid, session });
|
|
77308
|
+
const rush = await rushAboveOf({ context, from: claudePid });
|
|
77309
|
+
if (!rush) return await liveListenerOf({ context, profile }) ? "listening" : "none";
|
|
77181
77310
|
await startRushGuard({ context, profile, claudePid, rush });
|
|
77182
77311
|
await ensureConnectService({ context }).catch((error63) => {
|
|
77183
77312
|
context.err(`laze: could not start the connect service: ${String(error63)}
|
|
77184
77313
|
`);
|
|
77185
77314
|
});
|
|
77315
|
+
return "host";
|
|
77316
|
+
}
|
|
77317
|
+
async function liveListenerOf({ context, profile }) {
|
|
77318
|
+
const holder = await holderOf({ path: statePathOf({ context, kind: "waiters", profile }) });
|
|
77319
|
+
return holder !== void 0 && context.processes.alive(holder.pid);
|
|
77320
|
+
}
|
|
77321
|
+
function noListenerLinesOf({ laze, profile }) {
|
|
77322
|
+
return [
|
|
77323
|
+
"No listener runs in this session yet, so messages wait in Laze until one does.",
|
|
77324
|
+
"Start one in this session now: run this with the Monitor tool, persistent, so each message reaches you as it comes:",
|
|
77325
|
+
` ${laze} hook monitor --profile ${profile}`,
|
|
77326
|
+
"Or resume this session (claude --resume), which starts the Laze hooks."
|
|
77327
|
+
];
|
|
77186
77328
|
}
|
|
77187
77329
|
|
|
77188
77330
|
// src/services/mcp-channel.service.ts
|
|
@@ -77411,8 +77553,23 @@ async function listAgents({ context, args }) {
|
|
|
77411
77553
|
if (wanted && shown2.length === 0) throw new CliUsageError(`No agent named ${wanted}.`);
|
|
77412
77554
|
if (args.flags.json) return context.out(`${JSON.stringify(shown2, null, 2)}
|
|
77413
77555
|
`);
|
|
77414
|
-
|
|
77556
|
+
const refused = await refusedHereOf({ context });
|
|
77557
|
+
for (const agent3 of shown2) {
|
|
77558
|
+
const here = refused.get(agent3.id);
|
|
77559
|
+
const note = here ? ` key refused on this machine (profile ${here}): its hooks deliver nothing` : "";
|
|
77560
|
+
context.out(`${lineOf(agent3)}${note}
|
|
77415
77561
|
`);
|
|
77562
|
+
}
|
|
77563
|
+
}
|
|
77564
|
+
async function refusedHereOf({ context }) {
|
|
77565
|
+
const { profiles: profiles2 } = await context.store.read();
|
|
77566
|
+
const refused = /* @__PURE__ */ new Map();
|
|
77567
|
+
for (const [name3, profile] of Object.entries(profiles2)) {
|
|
77568
|
+
const mark = profile.refused;
|
|
77569
|
+
if (!profile.agentId || !mark || !markRefusesTheKey({ mark })) continue;
|
|
77570
|
+
refused.set(profile.agentId, name3);
|
|
77571
|
+
}
|
|
77572
|
+
return refused;
|
|
77416
77573
|
}
|
|
77417
77574
|
async function showAgent({ context, args }) {
|
|
77418
77575
|
const wanted = args.words[2];
|
|
@@ -77612,7 +77769,7 @@ async function settleLinked({
|
|
|
77612
77769
|
}
|
|
77613
77770
|
const hooked = claude && !args.flags["no-hook"];
|
|
77614
77771
|
const hookPath = hooked ? await installHooks({ context, directory, profile: name3 }) : void 0;
|
|
77615
|
-
|
|
77772
|
+
const listener = hooked ? await listenAfterLink({ context, args, profile: name3, claudePid: pid }) : void 0;
|
|
77616
77773
|
const { command: laze, shadow } = await rerunCommandOf({ context });
|
|
77617
77774
|
const steps = await nextStepsFor({
|
|
77618
77775
|
context,
|
|
@@ -77631,6 +77788,7 @@ async function settleLinked({
|
|
|
77631
77788
|
...shadowedLinkLineOf({ shadow }),
|
|
77632
77789
|
"",
|
|
77633
77790
|
steps,
|
|
77791
|
+
...listener === "none" ? ["", ...noListenerLinesOf({ laze, profile: name3 })] : [],
|
|
77634
77792
|
""
|
|
77635
77793
|
].join("\n")
|
|
77636
77794
|
);
|
|
@@ -77783,6 +77941,11 @@ async function stopHook({ context, args }) {
|
|
|
77783
77941
|
try {
|
|
77784
77942
|
await handOver({ context, args });
|
|
77785
77943
|
} catch (error63) {
|
|
77944
|
+
if (error63 instanceof ProfileRefusedError) {
|
|
77945
|
+
context.err(`${revokedKeyLineOf({ profile: error63.profile })}
|
|
77946
|
+
`);
|
|
77947
|
+
return;
|
|
77948
|
+
}
|
|
77786
77949
|
if (error63 instanceof ProfileMigratedError) return;
|
|
77787
77950
|
const migrated = migratedNoticeOf(error63);
|
|
77788
77951
|
if (migrated) return stopContext({ context, text: migrated.notice });
|
|
@@ -79027,8 +79190,30 @@ async function bindAgentSession({
|
|
|
79027
79190
|
await context.store.bindSession({ session: key, profile: name3 });
|
|
79028
79191
|
const where = `profile ${name3}, config ${context.environment.configPath}`;
|
|
79029
79192
|
const from = own2 && own2 !== name3 ? ` It moved from "${config2.profiles[own2]?.name}".` : "";
|
|
79030
|
-
|
|
79193
|
+
const listener = await listenerOfBound({ context, args, name: name3, harness: session.harness });
|
|
79194
|
+
if (listener !== "none") {
|
|
79195
|
+
context.out(`"${profile.name}" now listens in this session (${where}).${from}
|
|
79031
79196
|
`);
|
|
79197
|
+
return;
|
|
79198
|
+
}
|
|
79199
|
+
const { command: laze } = await rerunCommandOf({ context });
|
|
79200
|
+
const lines2 = noListenerLinesOf({ laze, profile: name3 });
|
|
79201
|
+
context.out(
|
|
79202
|
+
`"${profile.name}" is bound to this session (${where}).${from}
|
|
79203
|
+
${lines2.join("\n")}
|
|
79204
|
+
`
|
|
79205
|
+
);
|
|
79206
|
+
}
|
|
79207
|
+
async function listenerOfBound({
|
|
79208
|
+
context,
|
|
79209
|
+
args,
|
|
79210
|
+
name: name3,
|
|
79211
|
+
harness
|
|
79212
|
+
}) {
|
|
79213
|
+
if (harness !== "claude-code") return "host";
|
|
79214
|
+
const claude = await nearestHarnessOf({ context });
|
|
79215
|
+
const claudePid = claude?.harness === "claude-code" ? claude.pid : void 0;
|
|
79216
|
+
return listenAfterLink({ context, args, profile: name3, claudePid });
|
|
79032
79217
|
}
|
|
79033
79218
|
async function mintedRequestProfile({
|
|
79034
79219
|
context,
|
|
@@ -80058,12 +80243,28 @@ var appDoorSchemaDefinition = external_exports.object({
|
|
|
80058
80243
|
requestedAt: external_exports.iso.datetime().nullable()
|
|
80059
80244
|
});
|
|
80060
80245
|
var appDoorSchema = appDoorSchemaDefinition;
|
|
80246
|
+
var appOpenChoiceSchemaDefinition = external_exports.object({
|
|
80247
|
+
workspaceId: external_exports.string().min(1),
|
|
80248
|
+
workspaceName: external_exports.string(),
|
|
80249
|
+
name: external_exports.string()
|
|
80250
|
+
});
|
|
80251
|
+
var appOpenChoicesSchemaDefinition = external_exports.object({
|
|
80252
|
+
viewer: external_exports.object({ name: external_exports.string(), email: external_exports.string() }),
|
|
80253
|
+
choices: external_exports.array(appOpenChoiceSchemaDefinition),
|
|
80254
|
+
/** Set once they asked and no one answered yet. */
|
|
80255
|
+
requestedAt: external_exports.iso.datetime().nullable()
|
|
80256
|
+
});
|
|
80257
|
+
var appOpenChoicesSchema = appOpenChoicesSchemaDefinition;
|
|
80258
|
+
var appAskedSchemaDefinition = external_exports.object({ asked: external_exports.literal(true) });
|
|
80259
|
+
var appAskedSchema = appAskedSchemaDefinition;
|
|
80061
80260
|
var pendingAppAccessSchemaDefinition = external_exports.object({
|
|
80062
80261
|
...appAccessRequestSchemaDefinition.shape,
|
|
80063
80262
|
workspaceId: external_exports.string().min(1),
|
|
80064
80263
|
appName: external_exports.string(),
|
|
80065
80264
|
/** The role a grant from the feed card gives. */
|
|
80066
80265
|
memberRole: appRoleSchema,
|
|
80266
|
+
/** Set when the person is not in the workspace: approving adds them as a Guest. */
|
|
80267
|
+
outsider: external_exports.boolean().optional(),
|
|
80067
80268
|
/** The Builders who answer it; for an agent's request, the agent's owner only. */
|
|
80068
80269
|
builderUserIds: external_exports.array(external_exports.string()),
|
|
80069
80270
|
/** Set for an agent's request: whose it is and how approving adds it. */
|
|
@@ -80812,7 +81013,7 @@ var appsCopy = {
|
|
|
80812
81013
|
paintOnly: true,
|
|
80813
81014
|
storable: appsForDisk
|
|
80814
81015
|
};
|
|
80815
|
-
var appMainTrpc = defineTrpcContract("app").query("list", { mirrored: appsCopy }).withInput(listAppsInputSchema).withOutput(external_exports.array(appSchema)).query("get").withInput(appRefSchema).withOutput(appSchema).mutation("create").withInput(createAppInputSchema).withOutput(appSchema).mutation("rename").withInput(renameAppInputSchema).withOutput(appSchema).mutation("archive").withInput(appRefSchema).withOutput(appSchema).mutation("unarchive").withInput(appRefSchema).withOutput(appSchema).mutation("delete").withInput(deleteAppInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).query("versions").withInput(appRefSchema).withOutput(external_exports.array(appVersionSchema)).mutation("revert").withInput(revertInputSchema).withOutput(appPushSchema).mutation("publish").withInput(publishInputSchema).withOutput(publishOutcomeSchema).query("collections").withInput(appDataRefSchema).withOutput(external_exports.array(collectionSchema)).query("records").withInput(listRecordsInputSchema).withOutput(recordPageSchema).mutation("writeRecord").withInput(writeRecordInputSchema).withOutput(appRecordSchema).mutation("deleteRecord").withInput(deleteRecordInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).query("views").withInput(appDataRefSchema).withOutput(external_exports.array(appViewSchema)).mutation("saveView").withInput(saveViewInputSchema).withOutput(appViewSchema).mutation("deleteView").withInput(deleteViewInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).mutation("chooseCardRows").withInput(chooseCardRowsInputSchema).withOutput(appCardChoiceSchema).query("exportRecords").withInput(exportRecordsInputSchema).withOutput(recordExportSchema).mutation("importRecords").withInput(importRecordsInputSchema).withOutput(recordImportSchema).mutation("decidePublish").withInput(decidePublishInputSchema).withOutput(publishOutcomeSchema).mutation("nameVersion").withInput(nameVersionInputSchema).withOutput(appVersionSchema).mutation("makeInternal").withInput(appRefSchema).withOutput(appSchema).mutation("revokePublishLease").withInput(appRefSchema).withOutput(appSchema).mutation("signInHandoff").withInput(signInHandoffInputSchema).withOutput(signInHandoffSchema).query("functionLogs").withInput(listFunctionLogsInputSchema).withOutput(external_exports.array(appFunctionLogEntrySchema)).query("access").withInput(appRefSchema).withOutput(appAccessSchema).query("members").withInput(appRefSchema).withOutput(appMembersSchema).mutation("grantAccess").withInput(grantAppAccessInputSchema).withOutput(appAccessSchema).mutation("revokeAccess").withInput(revokeAppAccessInputSchema).withOutput(appAccessSchema).mutation("setVisibility").withInput(setAppVisibilityInputSchema).withOutput(visibilityOutcomeSchema).mutation("setMemberRole").withInput(setMemberRoleInputSchema).withOutput(appAccessSchema).mutation("unpublish").withInput(appRefSchema).withOutput(appSchema).query("door").withInput(appRefSchema).withOutput(appDoorSchema).mutation("requestAccess").withInput(appRefSchema).withOutput(appDoorSchema).mutation("decideAccess").withInput(decideAppAccessInputSchema).withOutput(appAccessRequestSchema).query("users").withInput(appRefSchema).withOutput(appUsersSchema).mutation("blockUser").withInput(blockAppUserInputSchema).withOutput(appUsersSchema).mutation("deleteUser").withInput(deleteAppUserInputSchema).withOutput(deletedAppUserSchema).query("backups").withInput(appRefSchema).withOutput(appBackupStatusSchema).mutation("restoreData").withInput(restoreAppDataInputSchema).withOutput(appRestoreSchema).query("cost").withInput(appRefSchema).withOutput(appCostSchema).mutation("setBudget").withInput(setAppBudgetInputSchema).withOutput(appCostSchema).query("triggers").withInput(appRefSchema).withOutput(appTriggersSchema).mutation("setTriggerPaused").withInput(setAppTriggerPausedInputSchema).withOutput(appTriggerSchema).mutation("removeTrigger").withInput(appTriggerRefSchema).withOutput(external_exports.object({ removed: external_exports.literal(true) })).build();
|
|
81016
|
+
var appMainTrpc = defineTrpcContract("app").query("list", { mirrored: appsCopy }).withInput(listAppsInputSchema).withOutput(external_exports.array(appSchema)).query("get").withInput(appRefSchema).withOutput(appSchema).mutation("create").withInput(createAppInputSchema).withOutput(appSchema).mutation("rename").withInput(renameAppInputSchema).withOutput(appSchema).mutation("archive").withInput(appRefSchema).withOutput(appSchema).mutation("unarchive").withInput(appRefSchema).withOutput(appSchema).mutation("delete").withInput(deleteAppInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).query("versions").withInput(appRefSchema).withOutput(external_exports.array(appVersionSchema)).mutation("revert").withInput(revertInputSchema).withOutput(appPushSchema).mutation("publish").withInput(publishInputSchema).withOutput(publishOutcomeSchema).query("collections").withInput(appDataRefSchema).withOutput(external_exports.array(collectionSchema)).query("records").withInput(listRecordsInputSchema).withOutput(recordPageSchema).mutation("writeRecord").withInput(writeRecordInputSchema).withOutput(appRecordSchema).mutation("deleteRecord").withInput(deleteRecordInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).query("views").withInput(appDataRefSchema).withOutput(external_exports.array(appViewSchema)).mutation("saveView").withInput(saveViewInputSchema).withOutput(appViewSchema).mutation("deleteView").withInput(deleteViewInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).mutation("chooseCardRows").withInput(chooseCardRowsInputSchema).withOutput(appCardChoiceSchema).query("exportRecords").withInput(exportRecordsInputSchema).withOutput(recordExportSchema).mutation("importRecords").withInput(importRecordsInputSchema).withOutput(recordImportSchema).mutation("decidePublish").withInput(decidePublishInputSchema).withOutput(publishOutcomeSchema).mutation("nameVersion").withInput(nameVersionInputSchema).withOutput(appVersionSchema).mutation("makeInternal").withInput(appRefSchema).withOutput(appSchema).mutation("revokePublishLease").withInput(appRefSchema).withOutput(appSchema).mutation("signInHandoff").withInput(signInHandoffInputSchema).withOutput(signInHandoffSchema).query("functionLogs").withInput(listFunctionLogsInputSchema).withOutput(external_exports.array(appFunctionLogEntrySchema)).query("access").withInput(appRefSchema).withOutput(appAccessSchema).query("members").withInput(appRefSchema).withOutput(appMembersSchema).mutation("grantAccess").withInput(grantAppAccessInputSchema).withOutput(appAccessSchema).mutation("revokeAccess").withInput(revokeAppAccessInputSchema).withOutput(appAccessSchema).mutation("setVisibility").withInput(setAppVisibilityInputSchema).withOutput(visibilityOutcomeSchema).mutation("setMemberRole").withInput(setMemberRoleInputSchema).withOutput(appAccessSchema).mutation("unpublish").withInput(appRefSchema).withOutput(appSchema).query("door").withInput(appRefSchema).withOutput(appDoorSchema).mutation("requestAccess").withInput(appRefSchema).withOutput(appDoorSchema).query("openChoices").withInput(appRefSchema).withOutput(appOpenChoicesSchema).mutation("askToOpen").withInput(appRefSchema).withOutput(appAskedSchema).mutation("decideAccess").withInput(decideAppAccessInputSchema).withOutput(appAccessRequestSchema).query("users").withInput(appRefSchema).withOutput(appUsersSchema).mutation("blockUser").withInput(blockAppUserInputSchema).withOutput(appUsersSchema).mutation("deleteUser").withInput(deleteAppUserInputSchema).withOutput(deletedAppUserSchema).query("backups").withInput(appRefSchema).withOutput(appBackupStatusSchema).mutation("restoreData").withInput(restoreAppDataInputSchema).withOutput(appRestoreSchema).query("cost").withInput(appRefSchema).withOutput(appCostSchema).mutation("setBudget").withInput(setAppBudgetInputSchema).withOutput(appCostSchema).query("triggers").withInput(appRefSchema).withOutput(appTriggersSchema).mutation("setTriggerPaused").withInput(setAppTriggerPausedInputSchema).withOutput(appTriggerSchema).mutation("removeTrigger").withInput(appTriggerRefSchema).withOutput(external_exports.object({ removed: external_exports.literal(true) })).build();
|
|
80816
81017
|
var appConnectionsTrpc = defineTrpcContract("app").query("connections").withInput(appRefSchema).withOutput(appConnectionsSchema).mutation("allowConnection").withInput(appConnectionRefSchema).withOutput(appConnectionsSchema).mutation("revokeConnection").withInput(appConnectionRefSchema).withOutput(appConnectionsSchema).build();
|
|
80817
81018
|
var appPinsTrpc = defineTrpcContract("app").query("pins").withInput(channelPinsInputSchema).withOutput(channelAppPinsSchema).mutation("pin").withInput(pinAppInputSchema).withOutput(channelAppPinsSchema).mutation("unpin").withInput(pinAppInputSchema).withOutput(channelAppPinsSchema).mutation("setPinView").withInput(setPinViewInputSchema).withOutput(channelAppPinsSchema).mutation("reorderPins").withInput(reorderPinsInputSchema).withOutput(channelAppPinsSchema).mutation("setPinRole").withInput(setPinRoleInputSchema).withOutput(appAccessSchema).build();
|
|
80818
81019
|
var appSettingsTrpc = defineTrpcContract("app").query("workspaceSettings").withInput(appWorkspaceRefSchema).withOutput(appWorkspaceSettingsSchema).query("functionSettings").withInput(appWorkspaceRefSchema).withOutput(appFunctionSettingsSchema).mutation("setFunctionsEnabled").withInput(setFunctionsEnabledInputSchema).withOutput(appFunctionSettingsSchema).mutation("setPublicAppsAllowed").withInput(setPublicAppsAllowedInputSchema).withOutput(appFunctionSettingsSchema).query("workspaceApps").withInput(listWorkspaceAppsInputSchema).withOutput(external_exports.array(workspaceAppSchema)).mutation("setOwner").withInput(setAppOwnerInputSchema).withOutput(workspaceAppSchema).mutation("unpublishAsAdmin").withInput(appRefSchema).withOutput(external_exports.object({ unpublished: external_exports.literal(true) })).query("templates").withInput(appWorkspaceRefSchema).withOutput(external_exports.array(appTemplateSchema)).mutation("upgradeTemplate").withInput(appRefSchema).withOutput(appTemplateUpgradeSchema).build();
|
|
@@ -89983,8 +90184,11 @@ function conversationLineOf(chat) {
|
|
|
89983
90184
|
const title = chat.title || "New chat";
|
|
89984
90185
|
const names = chat.peopleNames.length > 0 ? chat.peopleNames : chat.people;
|
|
89985
90186
|
const people2 = names.length > 0 ? ` with ${names.join(", ")}` : "";
|
|
89986
|
-
|
|
89987
|
-
|
|
90187
|
+
return `${chat.id} ${title}${people2}${stateOf2(chat)}`;
|
|
90188
|
+
}
|
|
90189
|
+
function stateOf2(chat) {
|
|
90190
|
+
if (chat.closedAt) return " (closed, whoever started it can reopen it)";
|
|
90191
|
+
return chat.joined ? "" : " (left)";
|
|
89988
90192
|
}
|
|
89989
90193
|
|
|
89990
90194
|
// src/services/conversation-commands.service.ts
|
|
@@ -89994,7 +90198,10 @@ var CONVERSATION_USAGE = `Usage:
|
|
|
89994
90198
|
laze conversation list [--agent <agent>] yours (an agent: its own; --unnamed for untitled)
|
|
89995
90199
|
laze conversation rename <id> <title> name it (its agent, or a person in it)
|
|
89996
90200
|
laze conversation join <id> open one of an agent shared with you
|
|
89997
|
-
laze conversation close <id>
|
|
90201
|
+
laze conversation close <id> close it for everyone (who started it, or an admin)
|
|
90202
|
+
laze conversation reopen <id> open a closed one again (who started it, or an admin)
|
|
90203
|
+
laze conversation convert <id> --name <n> turn it into a channel, history kept
|
|
90204
|
+
[--public] anyone in the workspace finds it (private otherwise)
|
|
89998
90205
|
laze conversation leave <id> leave it and take it out of your lists
|
|
89999
90206
|
laze conversation delete <id> delete it for everyone (who started it, or an admin)
|
|
90000
90207
|
`;
|
|
@@ -90065,8 +90272,41 @@ async function conversationClose({ context, args }) {
|
|
|
90065
90272
|
const channel = args.words[2];
|
|
90066
90273
|
if (!channel) throw new CliUsageError(CONVERSATION_USAGE);
|
|
90067
90274
|
const { client } = await signedIn({ context, args });
|
|
90068
|
-
await client.post("/api/agents/me/
|
|
90069
|
-
|
|
90275
|
+
const closed = await client.post("/api/agents/me/conversations/close", {
|
|
90276
|
+
channel
|
|
90277
|
+
});
|
|
90278
|
+
if (args.flags.json) return context.out(`${JSON.stringify(closed, null, 2)}
|
|
90279
|
+
`);
|
|
90280
|
+
context.out(
|
|
90281
|
+
`Closed ${channel} for everyone. laze conversation reopen ${channel} opens it again.
|
|
90282
|
+
`
|
|
90283
|
+
);
|
|
90284
|
+
}
|
|
90285
|
+
async function conversationReopen({ context, args }) {
|
|
90286
|
+
const channel = args.words[2];
|
|
90287
|
+
if (!channel) throw new CliUsageError(CONVERSATION_USAGE);
|
|
90288
|
+
const { client } = await signedIn({ context, args });
|
|
90289
|
+
const reopened = await client.post("/api/agents/me/conversations/reopen", {
|
|
90290
|
+
channel
|
|
90291
|
+
});
|
|
90292
|
+
if (args.flags.json) return context.out(`${JSON.stringify(reopened, null, 2)}
|
|
90293
|
+
`);
|
|
90294
|
+
context.out(`Reopened ${conversationLineOf(reopened)}
|
|
90295
|
+
`);
|
|
90296
|
+
}
|
|
90297
|
+
async function conversationConvert({ context, args }) {
|
|
90298
|
+
const channel = args.words[2];
|
|
90299
|
+
const name3 = flagText({ args, name: "name" });
|
|
90300
|
+
if (!channel || !name3) throw new CliUsageError(CONVERSATION_USAGE);
|
|
90301
|
+
const { client } = await signedIn({ context, args });
|
|
90302
|
+
const visibility = args.flags.public ? "public" : "private";
|
|
90303
|
+
const converted = await client.post(
|
|
90304
|
+
"/api/agents/me/conversations/convert",
|
|
90305
|
+
{ channel, name: name3, visibility }
|
|
90306
|
+
);
|
|
90307
|
+
if (args.flags.json) return context.out(`${JSON.stringify(converted, null, 2)}
|
|
90308
|
+
`);
|
|
90309
|
+
context.out(`Turned ${channel} into the ${visibility} channel #${name3}.
|
|
90070
90310
|
`);
|
|
90071
90311
|
}
|
|
90072
90312
|
async function conversationLeave({ context, args }) {
|
|
@@ -92588,9 +92828,19 @@ var feedSharePersonSchema = feedSharePersonSchemaDefinition;
|
|
|
92588
92828
|
var feedCommentReachSchemaDefinition = external_exports.object({
|
|
92589
92829
|
hears: external_exports.boolean(),
|
|
92590
92830
|
agentName: external_exports.string(),
|
|
92591
|
-
ownerName: external_exports.string().nullable()
|
|
92831
|
+
ownerName: external_exports.string().nullable(),
|
|
92832
|
+
/** The reader's own personal agents the card can move to; empty when the agent hears them. */
|
|
92833
|
+
myAgents: external_exports.array(feedAgentSchema).default([])
|
|
92592
92834
|
});
|
|
92593
92835
|
var feedCommentReachSchema = feedCommentReachSchemaDefinition;
|
|
92836
|
+
var moveFeedItemToAgentInputSchemaDefinition = external_exports.object({
|
|
92837
|
+
workspaceId: external_exports.string().min(1),
|
|
92838
|
+
itemId: external_exports.string().min(1),
|
|
92839
|
+
agentId: external_exports.string().min(1),
|
|
92840
|
+
/** The mover's first comment on the new card; left out it asks the agent to take it over. */
|
|
92841
|
+
note: external_exports.string().trim().max(4e3).optional()
|
|
92842
|
+
});
|
|
92843
|
+
var moveFeedItemToAgentInputSchema = moveFeedItemToAgentInputSchemaDefinition;
|
|
92594
92844
|
var feedShareAnswerSchemaDefinition = external_exports.object({
|
|
92595
92845
|
itemIds: external_exports.array(external_exports.string()),
|
|
92596
92846
|
people: external_exports.array(feedSharePersonSchemaDefinition),
|
|
@@ -92641,7 +92891,7 @@ var feedPageMirror = {
|
|
|
92641
92891
|
},
|
|
92642
92892
|
storable: feedPageForDisk
|
|
92643
92893
|
};
|
|
92644
|
-
var feedTrpc = defineTrpcContract("feed").query("channelItems").withInput(external_exports.object({ workspaceId: external_exports.string().min(1), channelId: external_exports.string().min(1) })).withOutput(external_exports.array(feedAgentItemSchema)).query("list").withInput(listFeedInputSchema).withOutput(feedViewSchema).query("page", { mirrored: feedPageMirror }).withInput(pageFeedInputSchema).withOutput(feedPageSchema).query("card").withInput(itemRef).withOutput(feedCardViewSchema).query("fileLink").withInput(feedFileLinkInputSchema).withOutput(feedFileLinkSchema).query("count").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(external_exports.object({ count: external_exports.number().int().nonnegative() })).query("decisions").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(feedDecisionsSchema).mutation("act").withInput(actFeedItemInputSchema).withOutput(feedItemSchema).mutation("comment").withInput(commentFeedItemInputSchema).withOutput(feedItemSchema).mutation("commentPlace").withInput(itemRef).withOutput(feedCommentPlaceSchema).query("commentDrafts").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(commentDraftListSchema).mutation("saveCommentDraft").withInput(saveCommentDraftInputSchema).withOutput(commentDraftSavedSchema).mutation("deleteCommentDraft").withInput(itemRef).withOutput(commentDraftSavedSchema).mutation("done").withInput(itemRef).withOutput(feedItemSchema).mutation("stopAutoSend").withInput(itemRef).withOutput(feedItemSchema).mutation("putBack").withInput(putBackFeedItemInputSchema).withOutput(feedItemSchema).mutation("snooze").withInput(snoozeFeedItemInputSchema).withOutput(feedItemSchema).mutation("unsnooze").withInput(itemRef).withOutput(feedItemSchema).mutation("saveDraft").withInput(saveFeedDraftInputSchema).withOutput(feedItemSchema).mutation("editItem").withInput(editFeedItemInputSchema).withOutput(feedItemSchema).mutation("saveMessage").withInput(saveFeedMessageInputSchema).withOutput(feedItemSchema).mutation("share").withInput(shareFeedItemInputSchema).withOutput(feedShareAnswerSchema).mutation("unshare").withInput(unshareFeedItemInputSchema).withOutput(feedShareAnswerSchema).query("shareCandidates").withInput(itemRef).withOutput(external_exports.array(feedSharePersonSchema)).query("commentReach").withInput(itemRef).withOutput(feedCommentReachSchema).mutation("answerApproval").withInput(answerFeedApprovalInputSchema).withOutput(feedItemSchema).mutation("decidePublish").withInput(decideFeedPublishInputSchema).withOutput(feedItemSchema).mutation("decideAccess").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideServer").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideAppAccess").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideComputer").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideAgentJoin").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideAgentTransfer").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("pin").withInput(pinFeedItemInputSchema).withOutput(feedItemSchema).mutation("markRead").withInput(itemRef).withOutput(feedItemSchema).mutation("markUnread").withInput(itemRef).withOutput(feedItemSchema).mutation("markAllRead").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(external_exports.object({ workspaceId: external_exports.string() })).query("delegates").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(external_exports.array(feedDelegateSchema)).mutation("setDelegate").withInput(setFeedDelegateInputSchema).withOutput(external_exports.array(feedDelegateSchema)).build();
|
|
92894
|
+
var feedTrpc = defineTrpcContract("feed").query("channelItems").withInput(external_exports.object({ workspaceId: external_exports.string().min(1), channelId: external_exports.string().min(1) })).withOutput(external_exports.array(feedAgentItemSchema)).query("list").withInput(listFeedInputSchema).withOutput(feedViewSchema).query("page", { mirrored: feedPageMirror }).withInput(pageFeedInputSchema).withOutput(feedPageSchema).query("card").withInput(itemRef).withOutput(feedCardViewSchema).query("fileLink").withInput(feedFileLinkInputSchema).withOutput(feedFileLinkSchema).query("count").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(external_exports.object({ count: external_exports.number().int().nonnegative() })).query("decisions").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(feedDecisionsSchema).mutation("act").withInput(actFeedItemInputSchema).withOutput(feedItemSchema).mutation("comment").withInput(commentFeedItemInputSchema).withOutput(feedItemSchema).mutation("commentPlace").withInput(itemRef).withOutput(feedCommentPlaceSchema).query("commentDrafts").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(commentDraftListSchema).mutation("saveCommentDraft").withInput(saveCommentDraftInputSchema).withOutput(commentDraftSavedSchema).mutation("deleteCommentDraft").withInput(itemRef).withOutput(commentDraftSavedSchema).mutation("done").withInput(itemRef).withOutput(feedItemSchema).mutation("stopAutoSend").withInput(itemRef).withOutput(feedItemSchema).mutation("putBack").withInput(putBackFeedItemInputSchema).withOutput(feedItemSchema).mutation("snooze").withInput(snoozeFeedItemInputSchema).withOutput(feedItemSchema).mutation("unsnooze").withInput(itemRef).withOutput(feedItemSchema).mutation("saveDraft").withInput(saveFeedDraftInputSchema).withOutput(feedItemSchema).mutation("editItem").withInput(editFeedItemInputSchema).withOutput(feedItemSchema).mutation("saveMessage").withInput(saveFeedMessageInputSchema).withOutput(feedItemSchema).mutation("share").withInput(shareFeedItemInputSchema).withOutput(feedShareAnswerSchema).mutation("unshare").withInput(unshareFeedItemInputSchema).withOutput(feedShareAnswerSchema).query("shareCandidates").withInput(itemRef).withOutput(external_exports.array(feedSharePersonSchema)).query("commentReach").withInput(itemRef).withOutput(feedCommentReachSchema).mutation("moveToAgent").withInput(moveFeedItemToAgentInputSchema).withOutput(feedItemSchema).mutation("answerApproval").withInput(answerFeedApprovalInputSchema).withOutput(feedItemSchema).mutation("decidePublish").withInput(decideFeedPublishInputSchema).withOutput(feedItemSchema).mutation("decideAccess").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideServer").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideAppAccess").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideComputer").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideAgentJoin").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideAgentTransfer").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("pin").withInput(pinFeedItemInputSchema).withOutput(feedItemSchema).mutation("markRead").withInput(itemRef).withOutput(feedItemSchema).mutation("markUnread").withInput(itemRef).withOutput(feedItemSchema).mutation("markAllRead").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(external_exports.object({ workspaceId: external_exports.string() })).query("delegates").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(external_exports.array(feedDelegateSchema)).mutation("setDelegate").withInput(setFeedDelegateInputSchema).withOutput(external_exports.array(feedDelegateSchema)).build();
|
|
92645
92895
|
var feedUi = uiTokens("feed");
|
|
92646
92896
|
var FeedNavSlot = feedUi.component("nav");
|
|
92647
92897
|
var FeedDecisionsSlot = feedUi.component("decisions");
|
|
@@ -96895,6 +97145,7 @@ var ChatDisplaySettingsSlot = workspaceUi.extension("settings.chatDisplay");
|
|
|
96895
97145
|
var CliKeysSettingsSlot = workspaceUi.extension("settings.cliKeys");
|
|
96896
97146
|
var SignInSettingsSlot = workspaceUi.extension("settings.signIn");
|
|
96897
97147
|
var AppsSettingsSlot = workspaceUi.extension("settings.apps");
|
|
97148
|
+
var ConversationSettingsSlot = workspaceUi.extension("settings.conversations");
|
|
96898
97149
|
var BillingSettingsSlot = workspaceUi.extension("settings.billing");
|
|
96899
97150
|
var ModelSettingsSlot = workspaceUi.extension("settings.models");
|
|
96900
97151
|
var AgentLoginsSettingsSlot = workspaceUi.extension("settings.agentLogins");
|
|
@@ -98677,13 +98928,13 @@ var SCIM_USAGE = `Usage:
|
|
|
98677
98928
|
laze scim revoke-token <id> the directory is refused at once`;
|
|
98678
98929
|
var printJson10 = (context, data) => context.out(`${JSON.stringify(data, null, 2)}
|
|
98679
98930
|
`);
|
|
98680
|
-
function
|
|
98931
|
+
function stateOf3(claim3) {
|
|
98681
98932
|
if (!claim3.verified) return "not verified";
|
|
98682
98933
|
if (!claim3.connected) return "verified";
|
|
98683
98934
|
return `connected (${claim3.provider === "google" ? "Google Workspace" : "OIDC"})`;
|
|
98684
98935
|
}
|
|
98685
98936
|
function printClaim(context, claim3) {
|
|
98686
|
-
const state =
|
|
98937
|
+
const state = stateOf3(claim3);
|
|
98687
98938
|
context.out(`${claim3.domain} ${state}${claim3.enforced ? " enforced" : ""}
|
|
98688
98939
|
`);
|
|
98689
98940
|
if (!claim3.verified) {
|
|
@@ -101123,6 +101374,8 @@ var COMMANDS4 = {
|
|
|
101123
101374
|
"conversation rename": conversationRename,
|
|
101124
101375
|
"conversation join": conversationJoin,
|
|
101125
101376
|
"conversation close": conversationClose,
|
|
101377
|
+
"conversation reopen": conversationReopen,
|
|
101378
|
+
"conversation convert": conversationConvert,
|
|
101126
101379
|
"conversation leave": conversationLeave,
|
|
101127
101380
|
"conversation delete": conversationDelete,
|
|
101128
101381
|
conversation: conversationUsage,
|
|
@@ -101314,10 +101567,19 @@ async function runCli({
|
|
|
101314
101567
|
const quiet = args.words[0] === "hook";
|
|
101315
101568
|
return await command({ context: watchingRelease({ context, quiet }), args }) ?? 0;
|
|
101316
101569
|
} catch (error63) {
|
|
101317
|
-
return exitCodeOf({ context, error: error63 });
|
|
101570
|
+
return exitCodeOf({ context, error: error63, hook: args.words[0] === "hook" });
|
|
101318
101571
|
}
|
|
101319
101572
|
}
|
|
101320
|
-
function exitCodeOf({
|
|
101573
|
+
function exitCodeOf({
|
|
101574
|
+
context,
|
|
101575
|
+
error: error63,
|
|
101576
|
+
hook
|
|
101577
|
+
}) {
|
|
101578
|
+
if (error63 instanceof ProfileRefusedError) {
|
|
101579
|
+
context.err(`${revokedKeyLineOf({ profile: error63.profile })}
|
|
101580
|
+
`);
|
|
101581
|
+
return hook ? 0 : 1;
|
|
101582
|
+
}
|
|
101321
101583
|
if (error63 instanceof ProfileMigratedError) return 0;
|
|
101322
101584
|
const migrated = migratedNoticeOf(error63);
|
|
101323
101585
|
if (migrated) context.err(`${migrated.notice}
|
package/package.json
CHANGED