@unisonlabs/sixminute-admin 0.1.1175-next → 0.1.1178-next
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/sixminute-admin.mjs +86 -36
- package/package.json +1 -1
package/dist/sixminute-admin.mjs
CHANGED
|
@@ -21,7 +21,7 @@ import { homedir } from "node:os";
|
|
|
21
21
|
import { fileURLToPath } from "node:url";
|
|
22
22
|
|
|
23
23
|
// tools/admin/src/build-info.ts
|
|
24
|
-
var BUILT = { version: "0.1.
|
|
24
|
+
var BUILT = { version: "0.1.1178-next", commit: "aa6661cb3f2161016ef4a04f9cca7ee4aafeea08", surface: "f5bb26b597e7d03c" };
|
|
25
25
|
|
|
26
26
|
// tools/admin/src/run.ts
|
|
27
27
|
import { rmSync as rmSync3 } from "node:fs";
|
|
@@ -4285,6 +4285,7 @@ var MatterSchema = exports_external.object({
|
|
|
4285
4285
|
opened_at: TimestampSchema,
|
|
4286
4286
|
closed_at: TimestampSchema.nullable().default(null),
|
|
4287
4287
|
last_activity_at: TimestampSchema.nullable().default(null),
|
|
4288
|
+
firm_internal: exports_external.boolean().default(false),
|
|
4288
4289
|
billing: MatterBillingSchema,
|
|
4289
4290
|
attribute_sets: MatterAttributeSetsSchema.default({}),
|
|
4290
4291
|
attribute_required: MatterAttributeRequiredSchema.default({}),
|
|
@@ -4359,6 +4360,7 @@ var EntryStatusSchema = exports_external.enum(["draft", "released"]);
|
|
|
4359
4360
|
var AssignmentSchema = exports_external.enum(["model", "user", "none"]);
|
|
4360
4361
|
var EntryOwnerSchema = exports_external.enum(["engine", "person"]);
|
|
4361
4362
|
var NARRATIVE_MAX_CHARS = 1024;
|
|
4363
|
+
var NARRATIVE_LIMIT_MAX = NARRATIVE_MAX_CHARS - 1;
|
|
4362
4364
|
var NarrativeSchema = exports_external.string().transform((s) => s.trim()).superRefine((value, ctx) => {
|
|
4363
4365
|
if (value.length > NARRATIVE_MAX_CHARS) {
|
|
4364
4366
|
ctx.addIssue({
|
|
@@ -4794,7 +4796,11 @@ function refineOrdered(spans, ctx, prefix = []) {
|
|
|
4794
4796
|
});
|
|
4795
4797
|
}
|
|
4796
4798
|
var WitnessListSchema = exports_external.array(WitnessSchema).superRefine((witnesses, ctx) => refineOrdered(witnesses, ctx));
|
|
4797
|
-
var ScreenEvidenceSchema = WitnessSchema.extend({
|
|
4799
|
+
var ScreenEvidenceSchema = WitnessSchema.extend({
|
|
4800
|
+
source: exports_external.literal("screen"),
|
|
4801
|
+
microphone: exports_external.boolean().optional(),
|
|
4802
|
+
camera: exports_external.boolean().optional()
|
|
4803
|
+
});
|
|
4798
4804
|
var EvidenceItemSchema = exports_external.discriminatedUnion("source", [ScreenEvidenceSchema]);
|
|
4799
4805
|
function refineInterval(interval, ctx) {
|
|
4800
4806
|
if (interval.t_end <= interval.t_start) {
|
|
@@ -4839,11 +4845,20 @@ var DayIntervalSchema = exports_external.object({
|
|
|
4839
4845
|
}).superRefine(refineInterval);
|
|
4840
4846
|
var IntervalTextItemSchema = exports_external.object({
|
|
4841
4847
|
t_start: TimestampSchema,
|
|
4842
|
-
text: exports_external.string()
|
|
4848
|
+
text: exports_external.string(),
|
|
4849
|
+
summary: exports_external.string().nullable().optional(),
|
|
4850
|
+
t_end: TimestampSchema.optional(),
|
|
4851
|
+
windows: exports_external.array(ScreenEvidenceSchema).optional()
|
|
4852
|
+
});
|
|
4853
|
+
var IntervalTextEntrySchema = exports_external.object({
|
|
4854
|
+
t_start: TimestampSchema,
|
|
4855
|
+
t_end: TimestampSchema,
|
|
4856
|
+
matter_id: exports_external.string().nullable()
|
|
4843
4857
|
});
|
|
4844
4858
|
var IntervalTextSchema = exports_external.object({
|
|
4845
4859
|
text: exports_external.array(IntervalTextItemSchema),
|
|
4846
|
-
activity_type: ActivityTypeKeySchema.nullable()
|
|
4860
|
+
activity_type: ActivityTypeKeySchema.nullable(),
|
|
4861
|
+
entries: exports_external.array(IntervalTextEntrySchema).optional()
|
|
4847
4862
|
});
|
|
4848
4863
|
|
|
4849
4864
|
// packages/contracts/src/grid.ts
|
|
@@ -4881,7 +4896,7 @@ var TenantPolicySchema = exports_external.object({
|
|
|
4881
4896
|
}).default({});
|
|
4882
4897
|
var NARRATIVE_GUIDANCE_MAX_CHARS = 1500;
|
|
4883
4898
|
var GUIDANCE_CONTROL = /[\u0000-\u0009\u000B-\u001F\u007F-\u009F]/;
|
|
4884
|
-
var NarrativeMaxCharsSchema = exports_external.number().int().min(40).max(
|
|
4899
|
+
var NarrativeMaxCharsSchema = exports_external.number().int().min(40).max(NARRATIVE_LIMIT_MAX);
|
|
4885
4900
|
var NarrativeGuidanceSchema = exports_external.string().trim().max(NARRATIVE_GUIDANCE_MAX_CHARS).refine((text) => !GUIDANCE_CONTROL.test(text), { message: "guidance holds no control character but a newline" });
|
|
4886
4901
|
var FirmAlwaysOnSchema = exports_external.enum(["member_choice", "enforced"]);
|
|
4887
4902
|
var FirmSettingsSchema = exports_external.object({
|
|
@@ -5062,7 +5077,8 @@ var MatterInputSchema = MatterSchema.omit({
|
|
|
5062
5077
|
created_at: true,
|
|
5063
5078
|
updated_at: true,
|
|
5064
5079
|
attribute_required: true,
|
|
5065
|
-
narrative_language: true
|
|
5080
|
+
narrative_language: true,
|
|
5081
|
+
firm_internal: true
|
|
5066
5082
|
}).extend({
|
|
5067
5083
|
id: MatterSchema.shape.id.optional(),
|
|
5068
5084
|
opened_at: MatterSchema.shape.opened_at.optional()
|
|
@@ -5071,8 +5087,10 @@ var MatterPatchSchema = MatterSchema.omit({
|
|
|
5071
5087
|
id: true,
|
|
5072
5088
|
created_at: true,
|
|
5073
5089
|
updated_at: true,
|
|
5074
|
-
attribute_required: true
|
|
5090
|
+
attribute_required: true,
|
|
5091
|
+
firm_internal: true
|
|
5075
5092
|
}).partial();
|
|
5093
|
+
var FirmInternalPutSchema = exports_external.object({ firm_internal: exports_external.boolean() });
|
|
5076
5094
|
var AttributeSetPutSchema = AttributeSetSchema.omit({ updated_at: true });
|
|
5077
5095
|
var AttributeSetsQuerySchema = exports_external.object({ attribute: AttributeKeySchema.optional() });
|
|
5078
5096
|
var MatterImportSchema = exports_external.object({
|
|
@@ -5090,7 +5108,8 @@ var MatterImportSchema = exports_external.object({
|
|
|
5090
5108
|
closed_at: true,
|
|
5091
5109
|
last_activity_at: true,
|
|
5092
5110
|
attribute_required: true,
|
|
5093
|
-
narrative_language: true
|
|
5111
|
+
narrative_language: true,
|
|
5112
|
+
firm_internal: true
|
|
5094
5113
|
}).extend({ opened_at: TimestampSchema.optional() })))
|
|
5095
5114
|
})))
|
|
5096
5115
|
});
|
|
@@ -5138,7 +5157,7 @@ var EntryPatchSchema = exports_external.object({
|
|
|
5138
5157
|
});
|
|
5139
5158
|
var ConfirmedNarrativeSchema = EntrySchema.innerType().shape.narrative.refine((narrative) => narrative.length > 0, { message: "a confirmed narrative is not empty: this is the line the person read and approved" });
|
|
5140
5159
|
var EntryHalfSchema = exports_external.object({
|
|
5141
|
-
matter_id: MatterIdSchema.optional(),
|
|
5160
|
+
matter_id: MatterIdSchema.nullable().optional(),
|
|
5142
5161
|
narrative: ConfirmedNarrativeSchema,
|
|
5143
5162
|
attributes: EntryAttributesSchema
|
|
5144
5163
|
});
|
|
@@ -5162,7 +5181,7 @@ var EntrySplitResponseSchema = exports_external.object({ first: EntrySchema, sec
|
|
|
5162
5181
|
var EntryMergeRequestSchema = exports_external.object({
|
|
5163
5182
|
matter_id: MatterIdSchema.nullable().optional(),
|
|
5164
5183
|
with: EntryIdSchema.optional(),
|
|
5165
|
-
with_all: exports_external.array(EntryIdSchema).min(1).
|
|
5184
|
+
with_all: exports_external.array(EntryIdSchema).min(1).optional(),
|
|
5166
5185
|
narrative: ConfirmedNarrativeSchema,
|
|
5167
5186
|
attributes: EntryAttributesSchema
|
|
5168
5187
|
}).superRefine((body, ctx) => {
|
|
@@ -5317,7 +5336,8 @@ var CompletionPurposeSchema = exports_external.enum([
|
|
|
5317
5336
|
"merge",
|
|
5318
5337
|
"merge_prose",
|
|
5319
5338
|
"assign",
|
|
5320
|
-
"judge"
|
|
5339
|
+
"judge",
|
|
5340
|
+
"judge_shortlist"
|
|
5321
5341
|
]);
|
|
5322
5342
|
var CompletionDecisionSchema = exports_external.object({
|
|
5323
5343
|
property: exports_external.string().min(1),
|
|
@@ -5453,6 +5473,20 @@ var TELEMETRY_EVENT_PROPERTIES = {
|
|
|
5453
5473
|
trigger: exports_external.enum(["press", "backstop"]),
|
|
5454
5474
|
step: exports_external.enum(["decide", "join", "narrative", "write"])
|
|
5455
5475
|
}),
|
|
5476
|
+
"entry.proposed": exports_external.object({
|
|
5477
|
+
ranges: Whole,
|
|
5478
|
+
intervals: Whole,
|
|
5479
|
+
how: exports_external.enum(["chosen", "most", "tie", "none"]),
|
|
5480
|
+
tie_called: exports_external.boolean(),
|
|
5481
|
+
attribute_calls: Whole,
|
|
5482
|
+
kept: exports_external.enum(["no_text", "not_signed_in", "refused", "offline"]),
|
|
5483
|
+
profile_ms: Whole,
|
|
5484
|
+
read_ms: Whole,
|
|
5485
|
+
matter_ms: Whole,
|
|
5486
|
+
attributes_ms: Whole,
|
|
5487
|
+
narrative_ms: Whole,
|
|
5488
|
+
total_ms: Whole
|
|
5489
|
+
}),
|
|
5456
5490
|
"application.opened": exports_external.object({
|
|
5457
5491
|
trigger: exports_external.enum(["launch", "login_item", "after_update", "tray"]),
|
|
5458
5492
|
is_first_open: exports_external.boolean()
|
|
@@ -5883,7 +5917,8 @@ var JudgeTunablesSchema = exports_external.object({
|
|
|
5883
5917
|
joinFewer: exports_external.number().min(0).max(1).optional(),
|
|
5884
5918
|
joinDefault: exports_external.enum(["more", "balanced", "fewer"]).optional(),
|
|
5885
5919
|
summaryMaxChars: exports_external.number().int().positive().optional(),
|
|
5886
|
-
summaryStatedChars: exports_external.number().int().positive().optional()
|
|
5920
|
+
summaryStatedChars: exports_external.number().int().positive().optional(),
|
|
5921
|
+
shortlistDepth: exports_external.number().int().positive().optional()
|
|
5887
5922
|
});
|
|
5888
5923
|
var ServedJudgeTunablesSchema = JudgeTunablesSchema.extend({
|
|
5889
5924
|
windowMinutes: exports_external.number(),
|
|
@@ -5916,6 +5951,8 @@ var ConfigPromptsSchema = exports_external.object({
|
|
|
5916
5951
|
summary: SummaryPromptPartsSchema.optional(),
|
|
5917
5952
|
matter: exports_external.string().min(1).optional(),
|
|
5918
5953
|
matter_prior: exports_external.string().min(1).optional(),
|
|
5954
|
+
matter_own: exports_external.string().min(1).optional(),
|
|
5955
|
+
shortlist_judge: exports_external.string().min(1).optional(),
|
|
5919
5956
|
block_boundary: exports_external.string().min(1).optional(),
|
|
5920
5957
|
block_label: exports_external.string().min(1).optional(),
|
|
5921
5958
|
join: exports_external.string().min(1).optional(),
|
|
@@ -6266,35 +6303,30 @@ var LocalTimelineQuerySchema = exports_external.object({
|
|
|
6266
6303
|
zoom: ZoomSchema.default("day")
|
|
6267
6304
|
});
|
|
6268
6305
|
var LocalAcceptedSchema = exports_external.object({ accepted: exports_external.literal(true) });
|
|
6269
|
-
var
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
exports_external.object({ kind: exports_external.literal("merge"), entries: exports_external.array(EntryIdSchema).min(2).max(50) })
|
|
6273
|
-
]).superRefine((ask, ctx) => {
|
|
6274
|
-
if (ask.kind === "merge" && new Set(ask.entries).size !== ask.entries.length) {
|
|
6275
|
-
ctx.addIssue({
|
|
6276
|
-
code: exports_external.ZodIssueCode.custom,
|
|
6277
|
-
path: ["entries"],
|
|
6278
|
-
message: "a merge joins different rows: an id is in `entries` twice"
|
|
6279
|
-
});
|
|
6280
|
-
}
|
|
6306
|
+
var LocalProposeRangeSchema = exports_external.object({ from: TimestampSchema, to: TimestampSchema, matter_id: MatterIdSchema.optional() }).refine((range) => Date.parse(range.from) < Date.parse(range.to), {
|
|
6307
|
+
path: ["to"],
|
|
6308
|
+
message: "a range ends after it starts"
|
|
6281
6309
|
});
|
|
6282
|
-
var
|
|
6283
|
-
|
|
6284
|
-
|
|
6310
|
+
var LocalProposeRangesRequestSchema = exports_external.object({
|
|
6311
|
+
ranges: exports_external.array(LocalProposeRangeSchema).min(1).max(2)
|
|
6312
|
+
});
|
|
6313
|
+
var LocalProposeHowSchema = exports_external.enum(["chosen", "most", "tie", "none"]);
|
|
6314
|
+
var LocalProposeRangesKeptReasonSchema = exports_external.enum(["no_text", "not_signed_in", "refused", "offline"]);
|
|
6315
|
+
var LocalRangeProposalSchema = exports_external.object({
|
|
6316
|
+
matter_id: MatterIdSchema.nullable(),
|
|
6317
|
+
how: LocalProposeHowSchema,
|
|
6318
|
+
narrative: exports_external.string(),
|
|
6319
|
+
attributes: EntryAttributesSchema
|
|
6320
|
+
});
|
|
6321
|
+
var LocalProposeRangesResponseSchema = exports_external.object({
|
|
6322
|
+
proposals: exports_external.array(LocalRangeProposalSchema.nullable()).max(2),
|
|
6323
|
+
kept: LocalProposeRangesKeptReasonSchema.nullable()
|
|
6285
6324
|
}).superRefine((answer, ctx) => {
|
|
6286
|
-
if (answer.
|
|
6287
|
-
ctx.addIssue({
|
|
6288
|
-
code: exports_external.ZodIssueCode.custom,
|
|
6289
|
-
path: ["kept"],
|
|
6290
|
-
message: "words were proposed, so nothing was kept: `kept` is null beside a proposal"
|
|
6291
|
-
});
|
|
6292
|
-
}
|
|
6293
|
-
if (answer.proposals.length === 0 && answer.kept === null) {
|
|
6325
|
+
if (answer.kept === null ? !answer.proposals.some((one) => one !== null) : answer.proposals.length > 0) {
|
|
6294
6326
|
ctx.addIssue({
|
|
6295
6327
|
code: exports_external.ZodIssueCode.custom,
|
|
6296
6328
|
path: ["kept"],
|
|
6297
|
-
message: "
|
|
6329
|
+
message: "an answer carries at least one proposal with `kept` null, or no proposal and one of the four reasons"
|
|
6298
6330
|
});
|
|
6299
6331
|
}
|
|
6300
6332
|
});
|
|
@@ -7176,6 +7208,11 @@ is required; without one every command answers 403.
|
|
|
7176
7208
|
sixminute-admin matter unarchive --env <env> --tenant tenant_... --matter matter_... [--json]
|
|
7177
7209
|
Sets the matter inactive, or active again. A temporary matter with
|
|
7178
7210
|
entries on it is refused: move the entries first.
|
|
7211
|
+
sixminute-admin matter internal --env <env> --tenant tenant_... --matter matter_... --on|--off [--json]
|
|
7212
|
+
Marks one matter as the firm's own (--on), so the matching lists it
|
|
7213
|
+
for every interval, or clears the mark (--off), and prints the matter
|
|
7214
|
+
as it now stands. Works on ANY firm, internal or not: the team sets up
|
|
7215
|
+
a pilot firm's internal matters during onboarding.
|
|
7179
7216
|
sixminute-admin matters import --env <env> --tenant tenant_... --from-file tools/admin/examples/matters-import.json [--json]
|
|
7180
7217
|
Clients with their matters, from a document: the file IS the body of
|
|
7181
7218
|
POST /v1/matters/import, checked against its schema before anything is
|
|
@@ -7289,6 +7326,8 @@ var BOOLEAN_FLAGS = new Set([
|
|
|
7289
7326
|
"password-stdin",
|
|
7290
7327
|
"all",
|
|
7291
7328
|
"timekeeper",
|
|
7329
|
+
"on",
|
|
7330
|
+
"off",
|
|
7292
7331
|
"auto",
|
|
7293
7332
|
"review"
|
|
7294
7333
|
]);
|
|
@@ -8049,6 +8088,17 @@ async function runMatter(run2, subcommand) {
|
|
|
8049
8088
|
const matter = MatterSchema.parse(answer.body);
|
|
8050
8089
|
return render(run2, { matter }, [actingHead(tenant, answer), ...matterLines(matter)]);
|
|
8051
8090
|
}
|
|
8091
|
+
if (subcommand === "internal") {
|
|
8092
|
+
const id = required(flags, "matter", "which matter_... to mark (matter list prints them)");
|
|
8093
|
+
const [on, off] = [switched(flags, "on"), switched(flags, "off")];
|
|
8094
|
+
if (on === off)
|
|
8095
|
+
throw new AdminUsageError("say --on or --off: mark the matter as the firm's own, or clear the mark");
|
|
8096
|
+
const answer = await call(run2.api, "PUT", tenantPath(tenant, `/matters/${enc(id)}/firm-internal`), { firm_internal: on });
|
|
8097
|
+
if (answer.status !== 200)
|
|
8098
|
+
return refused(run2, answer, [actingHead(tenant, answer)]);
|
|
8099
|
+
const matter = MatterSchema.parse(answer.body);
|
|
8100
|
+
return render(run2, { matter }, [actingHead(tenant, answer), ...matterLines(matter), `internal ${matter.firm_internal ? "yes" : "no"}`]);
|
|
8101
|
+
}
|
|
8052
8102
|
throw new AdminUsageError(`unknown command: matter ${subcommand ?? ""}`.trim());
|
|
8053
8103
|
}
|
|
8054
8104
|
async function runMattersImport(run2) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unisonlabs/sixminute-admin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1178-next",
|
|
4
4
|
"description": "Sixminute operator tool: the admin commands of the Sixminute API, run with your own operator sign-in.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|