@indigoai-us/hq-cli 5.196.0 → 5.198.0
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/CHANGELOG.md +37 -0
- package/dist/command-catalog.generated.d.ts +390 -0
- package/dist/command-catalog.generated.js +506 -0
- package/dist/commands/index-cmd.d.ts +7 -1
- package/dist/commands/index-cmd.js +46 -21
- package/dist/commands/lanes-tracker.d.ts +20 -0
- package/dist/commands/lanes-tracker.js +420 -0
- package/dist/commands/lanes.d.ts +6 -0
- package/dist/commands/lanes.js +18 -0
- package/dist/lib/bot/inflight.d.ts +12 -0
- package/dist/lib/bot/run.js +21 -2
- package/dist/lib/bot/runtime/messages-stream.d.ts +21 -1
- package/dist/lib/bot/runtime/messages-stream.js +54 -2
- package/dist/lib/core-utils/qmd-reindex-after-sync.d.ts +3 -1
- package/dist/lib/core-utils/qmd-reindex-after-sync.js +69 -40
- package/dist/lib/flag-registry-worker.js +12 -1
- package/dist/lib/flag-registry.js +72 -4
- package/dist/lib/lanes/story-ledger.js +52 -11
- package/dist/lib/lanes/tracker-store.d.ts +27 -0
- package/dist/lib/lanes/tracker-store.js +277 -0
- package/dist/lib/search-index/embed-lock.d.ts +5 -4
- package/dist/lib/search-index/embed-lock.js +5 -4
- package/dist/lib/search-index/reindex-single-flight-flag.d.ts +5 -0
- package/dist/lib/search-index/reindex-single-flight-flag.js +8 -0
- package/dist/node-network-compat-flag.d.ts +19 -0
- package/dist/node-network-compat-flag.js +87 -0
- package/dist/node-network-compat.d.ts +13 -16
- package/dist/node-network-compat.js +74 -19
- package/package.json +1 -1
|
@@ -8840,6 +8840,512 @@ export const COMMAND_CATALOG = [
|
|
|
8840
8840
|
"arguments": [],
|
|
8841
8841
|
"options": [],
|
|
8842
8842
|
"subcommands": [
|
|
8843
|
+
{
|
|
8844
|
+
"name": "blocker",
|
|
8845
|
+
"description": "Record and manage project blockers",
|
|
8846
|
+
"aliases": [],
|
|
8847
|
+
"hidden": false,
|
|
8848
|
+
"usage": "[options] [command]",
|
|
8849
|
+
"arguments": [],
|
|
8850
|
+
"options": [],
|
|
8851
|
+
"subcommands": [
|
|
8852
|
+
{
|
|
8853
|
+
"name": "open",
|
|
8854
|
+
"description": "Open a blocker",
|
|
8855
|
+
"aliases": [],
|
|
8856
|
+
"hidden": false,
|
|
8857
|
+
"usage": "[options]",
|
|
8858
|
+
"arguments": [],
|
|
8859
|
+
"options": [
|
|
8860
|
+
{
|
|
8861
|
+
"flags": "--project <slug>",
|
|
8862
|
+
"description": "HQ team project slug"
|
|
8863
|
+
},
|
|
8864
|
+
{
|
|
8865
|
+
"flags": "--company <slug>",
|
|
8866
|
+
"description": "Select the company by slug"
|
|
8867
|
+
},
|
|
8868
|
+
{
|
|
8869
|
+
"flags": "--story <id>",
|
|
8870
|
+
"description": "Blocked story id"
|
|
8871
|
+
},
|
|
8872
|
+
{
|
|
8873
|
+
"flags": "--what <text>",
|
|
8874
|
+
"description": "What is blocked"
|
|
8875
|
+
},
|
|
8876
|
+
{
|
|
8877
|
+
"flags": "--waiting-on <text>",
|
|
8878
|
+
"description": "Who or what is needed"
|
|
8879
|
+
},
|
|
8880
|
+
{
|
|
8881
|
+
"flags": "--next-step <text>",
|
|
8882
|
+
"description": "Next action"
|
|
8883
|
+
},
|
|
8884
|
+
{
|
|
8885
|
+
"flags": "--json",
|
|
8886
|
+
"description": "JSON on stdout (always)"
|
|
8887
|
+
}
|
|
8888
|
+
],
|
|
8889
|
+
"subcommands": []
|
|
8890
|
+
},
|
|
8891
|
+
{
|
|
8892
|
+
"name": "update",
|
|
8893
|
+
"description": "Update a blocker",
|
|
8894
|
+
"aliases": [],
|
|
8895
|
+
"hidden": false,
|
|
8896
|
+
"usage": "[options] <blocker-id>",
|
|
8897
|
+
"arguments": [
|
|
8898
|
+
{
|
|
8899
|
+
"name": "blocker-id",
|
|
8900
|
+
"required": true,
|
|
8901
|
+
"variadic": false
|
|
8902
|
+
}
|
|
8903
|
+
],
|
|
8904
|
+
"options": [
|
|
8905
|
+
{
|
|
8906
|
+
"flags": "--project <slug>",
|
|
8907
|
+
"description": "HQ team project slug"
|
|
8908
|
+
},
|
|
8909
|
+
{
|
|
8910
|
+
"flags": "--company <slug>",
|
|
8911
|
+
"description": "Select the company by slug"
|
|
8912
|
+
},
|
|
8913
|
+
{
|
|
8914
|
+
"flags": "--waiting-on <text>",
|
|
8915
|
+
"description": "Who or what is needed"
|
|
8916
|
+
},
|
|
8917
|
+
{
|
|
8918
|
+
"flags": "--next-step <text>",
|
|
8919
|
+
"description": "Next action"
|
|
8920
|
+
},
|
|
8921
|
+
{
|
|
8922
|
+
"flags": "--json",
|
|
8923
|
+
"description": "JSON on stdout (always)"
|
|
8924
|
+
}
|
|
8925
|
+
],
|
|
8926
|
+
"subcommands": []
|
|
8927
|
+
},
|
|
8928
|
+
{
|
|
8929
|
+
"name": "resolve",
|
|
8930
|
+
"description": "Resolve a blocker",
|
|
8931
|
+
"aliases": [],
|
|
8932
|
+
"hidden": false,
|
|
8933
|
+
"usage": "[options] <blocker-id>",
|
|
8934
|
+
"arguments": [
|
|
8935
|
+
{
|
|
8936
|
+
"name": "blocker-id",
|
|
8937
|
+
"required": true,
|
|
8938
|
+
"variadic": false
|
|
8939
|
+
}
|
|
8940
|
+
],
|
|
8941
|
+
"options": [
|
|
8942
|
+
{
|
|
8943
|
+
"flags": "--project <slug>",
|
|
8944
|
+
"description": "HQ team project slug"
|
|
8945
|
+
},
|
|
8946
|
+
{
|
|
8947
|
+
"flags": "--company <slug>",
|
|
8948
|
+
"description": "Select the company by slug"
|
|
8949
|
+
},
|
|
8950
|
+
{
|
|
8951
|
+
"flags": "--resolution <text>",
|
|
8952
|
+
"description": "Resolution details"
|
|
8953
|
+
},
|
|
8954
|
+
{
|
|
8955
|
+
"flags": "--json",
|
|
8956
|
+
"description": "JSON on stdout (always)"
|
|
8957
|
+
}
|
|
8958
|
+
],
|
|
8959
|
+
"subcommands": []
|
|
8960
|
+
},
|
|
8961
|
+
{
|
|
8962
|
+
"name": "list",
|
|
8963
|
+
"description": "List blockers",
|
|
8964
|
+
"aliases": [],
|
|
8965
|
+
"hidden": false,
|
|
8966
|
+
"usage": "[options]",
|
|
8967
|
+
"arguments": [],
|
|
8968
|
+
"options": [
|
|
8969
|
+
{
|
|
8970
|
+
"flags": "--project <slug>",
|
|
8971
|
+
"description": "HQ team project slug"
|
|
8972
|
+
},
|
|
8973
|
+
{
|
|
8974
|
+
"flags": "--company <slug>",
|
|
8975
|
+
"description": "Select the company by slug"
|
|
8976
|
+
},
|
|
8977
|
+
{
|
|
8978
|
+
"flags": "--all",
|
|
8979
|
+
"description": "Include resolved blockers"
|
|
8980
|
+
},
|
|
8981
|
+
{
|
|
8982
|
+
"flags": "--json",
|
|
8983
|
+
"description": "JSON on stdout (always)"
|
|
8984
|
+
}
|
|
8985
|
+
],
|
|
8986
|
+
"subcommands": []
|
|
8987
|
+
}
|
|
8988
|
+
]
|
|
8989
|
+
},
|
|
8990
|
+
{
|
|
8991
|
+
"name": "kpi",
|
|
8992
|
+
"description": "Define KPIs and record values",
|
|
8993
|
+
"aliases": [],
|
|
8994
|
+
"hidden": false,
|
|
8995
|
+
"usage": "[options] [command]",
|
|
8996
|
+
"arguments": [],
|
|
8997
|
+
"options": [],
|
|
8998
|
+
"subcommands": [
|
|
8999
|
+
{
|
|
9000
|
+
"name": "define",
|
|
9001
|
+
"description": "Define a proposed KPI",
|
|
9002
|
+
"aliases": [],
|
|
9003
|
+
"hidden": false,
|
|
9004
|
+
"usage": "[options]",
|
|
9005
|
+
"arguments": [],
|
|
9006
|
+
"options": [
|
|
9007
|
+
{
|
|
9008
|
+
"flags": "--project <slug>",
|
|
9009
|
+
"description": "HQ team project slug"
|
|
9010
|
+
},
|
|
9011
|
+
{
|
|
9012
|
+
"flags": "--company <slug>",
|
|
9013
|
+
"description": "Select the company by slug"
|
|
9014
|
+
},
|
|
9015
|
+
{
|
|
9016
|
+
"flags": "--name <text>",
|
|
9017
|
+
"description": "KPI name"
|
|
9018
|
+
},
|
|
9019
|
+
{
|
|
9020
|
+
"flags": "--definition <text>",
|
|
9021
|
+
"description": "Definition or query"
|
|
9022
|
+
},
|
|
9023
|
+
{
|
|
9024
|
+
"flags": "--unit <unit>",
|
|
9025
|
+
"description": "Measurement unit"
|
|
9026
|
+
},
|
|
9027
|
+
{
|
|
9028
|
+
"flags": "--target <number>",
|
|
9029
|
+
"description": "Target value"
|
|
9030
|
+
},
|
|
9031
|
+
{
|
|
9032
|
+
"flags": "--direction <direction>",
|
|
9033
|
+
"description": "up | down"
|
|
9034
|
+
},
|
|
9035
|
+
{
|
|
9036
|
+
"flags": "--json",
|
|
9037
|
+
"description": "JSON on stdout (always)"
|
|
9038
|
+
}
|
|
9039
|
+
],
|
|
9040
|
+
"subcommands": []
|
|
9041
|
+
},
|
|
9042
|
+
{
|
|
9043
|
+
"name": "record",
|
|
9044
|
+
"description": "Record a KPI value",
|
|
9045
|
+
"aliases": [],
|
|
9046
|
+
"hidden": false,
|
|
9047
|
+
"usage": "[options] <kpi-id>",
|
|
9048
|
+
"arguments": [
|
|
9049
|
+
{
|
|
9050
|
+
"name": "kpi-id",
|
|
9051
|
+
"required": true,
|
|
9052
|
+
"variadic": false
|
|
9053
|
+
}
|
|
9054
|
+
],
|
|
9055
|
+
"options": [
|
|
9056
|
+
{
|
|
9057
|
+
"flags": "--project <slug>",
|
|
9058
|
+
"description": "HQ team project slug"
|
|
9059
|
+
},
|
|
9060
|
+
{
|
|
9061
|
+
"flags": "--company <slug>",
|
|
9062
|
+
"description": "Select the company by slug"
|
|
9063
|
+
},
|
|
9064
|
+
{
|
|
9065
|
+
"flags": "--value <number>",
|
|
9066
|
+
"description": "Observed value"
|
|
9067
|
+
},
|
|
9068
|
+
{
|
|
9069
|
+
"flags": "--source <text>",
|
|
9070
|
+
"description": "Value source"
|
|
9071
|
+
},
|
|
9072
|
+
{
|
|
9073
|
+
"flags": "--at <iso>",
|
|
9074
|
+
"description": "Observation time"
|
|
9075
|
+
},
|
|
9076
|
+
{
|
|
9077
|
+
"flags": "--json",
|
|
9078
|
+
"description": "JSON on stdout (always)"
|
|
9079
|
+
}
|
|
9080
|
+
],
|
|
9081
|
+
"subcommands": []
|
|
9082
|
+
},
|
|
9083
|
+
{
|
|
9084
|
+
"name": "approve",
|
|
9085
|
+
"description": "Approve a KPI proposal",
|
|
9086
|
+
"aliases": [],
|
|
9087
|
+
"hidden": false,
|
|
9088
|
+
"usage": "[options] <kpi-id>",
|
|
9089
|
+
"arguments": [
|
|
9090
|
+
{
|
|
9091
|
+
"name": "kpi-id",
|
|
9092
|
+
"required": true,
|
|
9093
|
+
"variadic": false
|
|
9094
|
+
}
|
|
9095
|
+
],
|
|
9096
|
+
"options": [
|
|
9097
|
+
{
|
|
9098
|
+
"flags": "--project <slug>",
|
|
9099
|
+
"description": "HQ team project slug"
|
|
9100
|
+
},
|
|
9101
|
+
{
|
|
9102
|
+
"flags": "--company <slug>",
|
|
9103
|
+
"description": "Select the company by slug"
|
|
9104
|
+
},
|
|
9105
|
+
{
|
|
9106
|
+
"flags": "--json",
|
|
9107
|
+
"description": "JSON on stdout (always)"
|
|
9108
|
+
}
|
|
9109
|
+
],
|
|
9110
|
+
"subcommands": []
|
|
9111
|
+
},
|
|
9112
|
+
{
|
|
9113
|
+
"name": "list",
|
|
9114
|
+
"description": "List KPIs",
|
|
9115
|
+
"aliases": [],
|
|
9116
|
+
"hidden": false,
|
|
9117
|
+
"usage": "[options]",
|
|
9118
|
+
"arguments": [],
|
|
9119
|
+
"options": [
|
|
9120
|
+
{
|
|
9121
|
+
"flags": "--project <slug>",
|
|
9122
|
+
"description": "HQ team project slug"
|
|
9123
|
+
},
|
|
9124
|
+
{
|
|
9125
|
+
"flags": "--company <slug>",
|
|
9126
|
+
"description": "Select the company by slug"
|
|
9127
|
+
},
|
|
9128
|
+
{
|
|
9129
|
+
"flags": "--json",
|
|
9130
|
+
"description": "JSON on stdout (always)"
|
|
9131
|
+
}
|
|
9132
|
+
],
|
|
9133
|
+
"subcommands": []
|
|
9134
|
+
}
|
|
9135
|
+
]
|
|
9136
|
+
},
|
|
9137
|
+
{
|
|
9138
|
+
"name": "okr",
|
|
9139
|
+
"description": "Set and approve OKRs",
|
|
9140
|
+
"aliases": [],
|
|
9141
|
+
"hidden": false,
|
|
9142
|
+
"usage": "[options] [command]",
|
|
9143
|
+
"arguments": [],
|
|
9144
|
+
"options": [],
|
|
9145
|
+
"subcommands": [
|
|
9146
|
+
{
|
|
9147
|
+
"name": "set",
|
|
9148
|
+
"description": "Create a proposed OKR",
|
|
9149
|
+
"aliases": [],
|
|
9150
|
+
"hidden": false,
|
|
9151
|
+
"usage": "[options]",
|
|
9152
|
+
"arguments": [],
|
|
9153
|
+
"options": [
|
|
9154
|
+
{
|
|
9155
|
+
"flags": "--project <slug>",
|
|
9156
|
+
"description": "HQ team project slug"
|
|
9157
|
+
},
|
|
9158
|
+
{
|
|
9159
|
+
"flags": "--company <slug>",
|
|
9160
|
+
"description": "Select the company by slug"
|
|
9161
|
+
},
|
|
9162
|
+
{
|
|
9163
|
+
"flags": "--objective <text>",
|
|
9164
|
+
"description": "Objective"
|
|
9165
|
+
},
|
|
9166
|
+
{
|
|
9167
|
+
"flags": "--period <period>",
|
|
9168
|
+
"description": "Planning period"
|
|
9169
|
+
},
|
|
9170
|
+
{
|
|
9171
|
+
"flags": "--key-result <text=kpi-id:target>",
|
|
9172
|
+
"description": "Key result"
|
|
9173
|
+
},
|
|
9174
|
+
{
|
|
9175
|
+
"flags": "--json",
|
|
9176
|
+
"description": "JSON on stdout (always)"
|
|
9177
|
+
}
|
|
9178
|
+
],
|
|
9179
|
+
"subcommands": []
|
|
9180
|
+
},
|
|
9181
|
+
{
|
|
9182
|
+
"name": "approve",
|
|
9183
|
+
"description": "Approve an OKR proposal",
|
|
9184
|
+
"aliases": [],
|
|
9185
|
+
"hidden": false,
|
|
9186
|
+
"usage": "[options] <okr-id>",
|
|
9187
|
+
"arguments": [
|
|
9188
|
+
{
|
|
9189
|
+
"name": "okr-id",
|
|
9190
|
+
"required": true,
|
|
9191
|
+
"variadic": false
|
|
9192
|
+
}
|
|
9193
|
+
],
|
|
9194
|
+
"options": [
|
|
9195
|
+
{
|
|
9196
|
+
"flags": "--project <slug>",
|
|
9197
|
+
"description": "HQ team project slug"
|
|
9198
|
+
},
|
|
9199
|
+
{
|
|
9200
|
+
"flags": "--company <slug>",
|
|
9201
|
+
"description": "Select the company by slug"
|
|
9202
|
+
},
|
|
9203
|
+
{
|
|
9204
|
+
"flags": "--json",
|
|
9205
|
+
"description": "JSON on stdout (always)"
|
|
9206
|
+
}
|
|
9207
|
+
],
|
|
9208
|
+
"subcommands": []
|
|
9209
|
+
},
|
|
9210
|
+
{
|
|
9211
|
+
"name": "list",
|
|
9212
|
+
"description": "List OKRs",
|
|
9213
|
+
"aliases": [],
|
|
9214
|
+
"hidden": false,
|
|
9215
|
+
"usage": "[options]",
|
|
9216
|
+
"arguments": [],
|
|
9217
|
+
"options": [
|
|
9218
|
+
{
|
|
9219
|
+
"flags": "--project <slug>",
|
|
9220
|
+
"description": "HQ team project slug"
|
|
9221
|
+
},
|
|
9222
|
+
{
|
|
9223
|
+
"flags": "--company <slug>",
|
|
9224
|
+
"description": "Select the company by slug"
|
|
9225
|
+
},
|
|
9226
|
+
{
|
|
9227
|
+
"flags": "--json",
|
|
9228
|
+
"description": "JSON on stdout (always)"
|
|
9229
|
+
}
|
|
9230
|
+
],
|
|
9231
|
+
"subcommands": []
|
|
9232
|
+
}
|
|
9233
|
+
]
|
|
9234
|
+
},
|
|
9235
|
+
{
|
|
9236
|
+
"name": "directive",
|
|
9237
|
+
"description": "Record directives and acknowledgements",
|
|
9238
|
+
"aliases": [],
|
|
9239
|
+
"hidden": false,
|
|
9240
|
+
"usage": "[options] [command]",
|
|
9241
|
+
"arguments": [],
|
|
9242
|
+
"options": [],
|
|
9243
|
+
"subcommands": [
|
|
9244
|
+
{
|
|
9245
|
+
"name": "record",
|
|
9246
|
+
"description": "Record a directive",
|
|
9247
|
+
"aliases": [],
|
|
9248
|
+
"hidden": false,
|
|
9249
|
+
"usage": "[options]",
|
|
9250
|
+
"arguments": [],
|
|
9251
|
+
"options": [
|
|
9252
|
+
{
|
|
9253
|
+
"flags": "--project <slug>",
|
|
9254
|
+
"description": "HQ team project slug"
|
|
9255
|
+
},
|
|
9256
|
+
{
|
|
9257
|
+
"flags": "--company <slug>",
|
|
9258
|
+
"description": "Select the company by slug"
|
|
9259
|
+
},
|
|
9260
|
+
{
|
|
9261
|
+
"flags": "--text <text>",
|
|
9262
|
+
"description": "Verbatim directive"
|
|
9263
|
+
},
|
|
9264
|
+
{
|
|
9265
|
+
"flags": "--date <yyyy-mm-dd>",
|
|
9266
|
+
"description": "Directive date"
|
|
9267
|
+
},
|
|
9268
|
+
{
|
|
9269
|
+
"flags": "--source-url <url>",
|
|
9270
|
+
"description": "Source URL"
|
|
9271
|
+
},
|
|
9272
|
+
{
|
|
9273
|
+
"flags": "--team <slug>",
|
|
9274
|
+
"description": "Affected team (repeatable)"
|
|
9275
|
+
},
|
|
9276
|
+
{
|
|
9277
|
+
"flags": "--policy-path <path>",
|
|
9278
|
+
"description": "Related policy path"
|
|
9279
|
+
},
|
|
9280
|
+
{
|
|
9281
|
+
"flags": "--json",
|
|
9282
|
+
"description": "JSON on stdout (always)"
|
|
9283
|
+
}
|
|
9284
|
+
],
|
|
9285
|
+
"subcommands": []
|
|
9286
|
+
},
|
|
9287
|
+
{
|
|
9288
|
+
"name": "ack",
|
|
9289
|
+
"description": "Acknowledge a directive",
|
|
9290
|
+
"aliases": [],
|
|
9291
|
+
"hidden": false,
|
|
9292
|
+
"usage": "[options] <directive-id>",
|
|
9293
|
+
"arguments": [
|
|
9294
|
+
{
|
|
9295
|
+
"name": "directive-id",
|
|
9296
|
+
"required": true,
|
|
9297
|
+
"variadic": false
|
|
9298
|
+
}
|
|
9299
|
+
],
|
|
9300
|
+
"options": [
|
|
9301
|
+
{
|
|
9302
|
+
"flags": "--project <slug>",
|
|
9303
|
+
"description": "HQ team project slug"
|
|
9304
|
+
},
|
|
9305
|
+
{
|
|
9306
|
+
"flags": "--company <slug>",
|
|
9307
|
+
"description": "Select the company by slug"
|
|
9308
|
+
},
|
|
9309
|
+
{
|
|
9310
|
+
"flags": "--team <slug>",
|
|
9311
|
+
"description": "Acknowledging team"
|
|
9312
|
+
},
|
|
9313
|
+
{
|
|
9314
|
+
"flags": "--lane <lane-id>",
|
|
9315
|
+
"description": "Acknowledging lane id"
|
|
9316
|
+
},
|
|
9317
|
+
{
|
|
9318
|
+
"flags": "--json",
|
|
9319
|
+
"description": "JSON on stdout (always)"
|
|
9320
|
+
}
|
|
9321
|
+
],
|
|
9322
|
+
"subcommands": []
|
|
9323
|
+
},
|
|
9324
|
+
{
|
|
9325
|
+
"name": "list",
|
|
9326
|
+
"description": "List directives",
|
|
9327
|
+
"aliases": [],
|
|
9328
|
+
"hidden": false,
|
|
9329
|
+
"usage": "[options]",
|
|
9330
|
+
"arguments": [],
|
|
9331
|
+
"options": [
|
|
9332
|
+
{
|
|
9333
|
+
"flags": "--project <slug>",
|
|
9334
|
+
"description": "HQ team project slug"
|
|
9335
|
+
},
|
|
9336
|
+
{
|
|
9337
|
+
"flags": "--company <slug>",
|
|
9338
|
+
"description": "Select the company by slug"
|
|
9339
|
+
},
|
|
9340
|
+
{
|
|
9341
|
+
"flags": "--json",
|
|
9342
|
+
"description": "JSON on stdout (always)"
|
|
9343
|
+
}
|
|
9344
|
+
],
|
|
9345
|
+
"subcommands": []
|
|
9346
|
+
}
|
|
9347
|
+
]
|
|
9348
|
+
},
|
|
8843
9349
|
{
|
|
8844
9350
|
"name": "outpost-pruner",
|
|
8845
9351
|
"description": "Inspect, install, and run safe outpost worktree pruning",
|
|
@@ -15,14 +15,20 @@ export type SearchIndexDependencies = {
|
|
|
15
15
|
runBackgroundLauncher?: (dependencies: BackgroundDependencies) => BackgroundResult;
|
|
16
16
|
runBackgroundWorker?: (dependencies: BackgroundDependencies) => BackgroundResult | Promise<BackgroundResult>;
|
|
17
17
|
backgroundStatus?: (dependencies: BackgroundDependencies) => BackgroundStatus;
|
|
18
|
-
/** Test seams for the lock shared by every hq-cli
|
|
18
|
+
/** Test seams for the lock shared by every hq-cli QMD writer. */
|
|
19
19
|
embedLockDependencies?: EmbedLockDependencies;
|
|
20
|
+
/** Test seam for the default-off shared lock around the full reindex pass. */
|
|
21
|
+
singleFlightEnabled?: () => boolean;
|
|
20
22
|
/** Test seams for the host load gate consulted while the embed lock is held. */
|
|
21
23
|
loadGateDependencies?: LoadGateDependencies;
|
|
22
24
|
writeStderr?: (text: string) => void;
|
|
23
25
|
};
|
|
24
26
|
export type SyncSearchIndexResult = {
|
|
27
|
+
status: 'updated';
|
|
25
28
|
embedded: boolean;
|
|
29
|
+
} | {
|
|
30
|
+
status: 'skipped';
|
|
31
|
+
reason: 'busy' | 'unavailable';
|
|
26
32
|
};
|
|
27
33
|
/** Incrementally update qmd, embedding only when an operator explicitly asks. */
|
|
28
34
|
export declare function syncSearchIndex(hqRoot: string, embed: boolean, dependencies?: SearchIndexDependencies): SyncSearchIndexResult;
|
|
@@ -4,6 +4,7 @@ import { backgroundStatus, defaultBackgroundDependencies, runBackgroundLauncher,
|
|
|
4
4
|
import { defaultEmbedLockDependencies, runWithEmbedLock, } from '../lib/search-index/embed-lock.js';
|
|
5
5
|
import { checkEmbedLoad, defaultLoadGateDependencies, recordSuccessfulEmbed, } from '../lib/search-index/load-gate.js';
|
|
6
6
|
import { applyIndexSizeLimit } from '../lib/search-index/max-doc-bytes.js';
|
|
7
|
+
import { qmdReindexSingleFlightEnabled } from '../lib/search-index/reindex-single-flight-flag.js';
|
|
7
8
|
import { findHqRoot } from '../utils/manifest.js';
|
|
8
9
|
import { QMD_NATIVE_BINDING_REMEDY, isQmdNativeBindingError, } from '../utils/qmd-native-binding-error.js';
|
|
9
10
|
import { isQmdStoreMissingError, qmdStoreMissingMessage, } from '../utils/qmd-store-missing-error.js';
|
|
@@ -23,27 +24,29 @@ const defaults = {
|
|
|
23
24
|
};
|
|
24
25
|
/** Incrementally update qmd, embedding only when an operator explicitly asks. */
|
|
25
26
|
export function syncSearchIndex(hqRoot, embed, dependencies = defaults) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const lockDependencies = dependencies.embedLockDependencies ?? defaultEmbedLockDependencies();
|
|
27
|
+
const updateIndex = () => {
|
|
28
|
+
dependencies.reconcileCollections(hqRoot);
|
|
29
|
+
// Must precede the update: an oversized file is skipped at glob time or not
|
|
30
|
+
// at all, so capping after the update would still have paid to read it.
|
|
31
|
+
//
|
|
32
|
+
// Best-effort, matching the background worker. The cap writes to qmd's config
|
|
33
|
+
// and to `.hq/`, either of which can be read-only on a locked-down box. An
|
|
34
|
+
// index that is merely uncapped is far better than no `qmd update` at all.
|
|
35
|
+
try {
|
|
36
|
+
dependencies.applyIndexSizeLimit(hqRoot);
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
/* capping is an optimisation; indexing is the job */
|
|
40
|
+
}
|
|
41
|
+
dependencies.runQmd(['update'], { cwd: hqRoot });
|
|
42
|
+
};
|
|
43
43
|
const writeStderr = dependencies.writeStderr ?? ((text) => process.stderr.write(text));
|
|
44
|
+
const singleFlightEnabled = (dependencies.singleFlightEnabled ?? qmdReindexSingleFlightEnabled)();
|
|
45
|
+
const lockDependencies = dependencies.embedLockDependencies ?? defaultEmbedLockDependencies();
|
|
44
46
|
const home = resolveQmdHome(lockDependencies.env);
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
+
let embedded = false;
|
|
48
|
+
const runEmbed = () => {
|
|
49
|
+
const loadGateDependencies = dependencies.loadGateDependencies ?? defaultLoadGateDependencies(lockDependencies.env);
|
|
47
50
|
const decision = checkEmbedLoad(home, loadGateDependencies);
|
|
48
51
|
if (decision.action === 'skip') {
|
|
49
52
|
writeStderr(decision.notice);
|
|
@@ -53,13 +56,33 @@ export function syncSearchIndex(hqRoot, embed, dependencies = defaults) {
|
|
|
53
56
|
writeStderr(decision.notice);
|
|
54
57
|
dependencies.runQmd(['embed'], { cwd: hqRoot });
|
|
55
58
|
recordSuccessfulEmbed(home, loadGateDependencies);
|
|
59
|
+
embedded = true;
|
|
56
60
|
return undefined;
|
|
57
|
-
}
|
|
61
|
+
};
|
|
62
|
+
if (singleFlightEnabled) {
|
|
63
|
+
const outcome = runWithEmbedLock(home, lockDependencies, () => {
|
|
64
|
+
updateIndex();
|
|
65
|
+
return embed ? runEmbed() : undefined;
|
|
66
|
+
});
|
|
67
|
+
if (outcome === 'busy') {
|
|
68
|
+
writeStderr('hq: qmd reindex is already running; skipping this pass.\n');
|
|
69
|
+
return { status: 'skipped', reason: 'busy' };
|
|
70
|
+
}
|
|
71
|
+
if (outcome === 'unavailable') {
|
|
72
|
+
writeStderr('hq: cannot access the qmd reindex lock; skipping this pass.\n');
|
|
73
|
+
return { status: 'skipped', reason: 'unavailable' };
|
|
74
|
+
}
|
|
75
|
+
return { status: 'updated', embedded };
|
|
76
|
+
}
|
|
77
|
+
updateIndex();
|
|
78
|
+
if (!embed)
|
|
79
|
+
return { status: 'updated', embedded: false };
|
|
80
|
+
const outcome = runWithEmbedLock(home, lockDependencies, runEmbed);
|
|
58
81
|
if (outcome === 'busy')
|
|
59
82
|
writeStderr('hq: qmd embed is already running; skipping this pass.\n');
|
|
60
83
|
if (outcome === 'unavailable')
|
|
61
84
|
writeStderr('hq: cannot access the qmd embed lock; skipping this pass.\n');
|
|
62
|
-
return { embedded: outcome === 'ran' };
|
|
85
|
+
return { status: 'updated', embedded: outcome === 'ran' && embedded };
|
|
63
86
|
}
|
|
64
87
|
function resolveRoot(hqRoot) {
|
|
65
88
|
return hqRoot ?? findHqRoot();
|
|
@@ -97,6 +120,8 @@ export function registerIndexCommand(program, dependencies = defaults) {
|
|
|
97
120
|
.action((options) => {
|
|
98
121
|
const hqRoot = resolveRoot(options.hqRoot);
|
|
99
122
|
const result = syncSearchIndex(hqRoot, options.embed === true, dependencies);
|
|
123
|
+
if (result.status === 'skipped')
|
|
124
|
+
return;
|
|
100
125
|
console.log(`Updated search index for ${hqRoot}${result.embedded ? ' (including embeddings)' : ''}.`);
|
|
101
126
|
});
|
|
102
127
|
index
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import { type TrackerStore } from "../lib/lanes/tracker-store.js";
|
|
3
|
+
import type { LaneCompanyRef } from "../lib/lanes/types.js";
|
|
4
|
+
export declare const LANES_TRACKER_FLAG = "lanes.tracker";
|
|
5
|
+
export declare const LANES_TRACKER_MESH_FLAG = "lanes.tracker-mesh";
|
|
6
|
+
export interface LaneTrackerCommandDeps {
|
|
7
|
+
hqRoot: () => string;
|
|
8
|
+
resolveCompany: (company?: string) => Promise<LaneCompanyRef>;
|
|
9
|
+
trackerEnabled: (company: LaneCompanyRef) => boolean | Promise<boolean>;
|
|
10
|
+
trackerMeshEnabled: (company: LaneCompanyRef) => boolean | Promise<boolean>;
|
|
11
|
+
now: () => Date;
|
|
12
|
+
actor: () => string | null;
|
|
13
|
+
/** Test seam; production uses the same local store used by the public commands. */
|
|
14
|
+
store?: (projectDirectory: string) => TrackerStore;
|
|
15
|
+
}
|
|
16
|
+
type WrapHandler = <Args extends unknown[]>(action: (...args: Args) => Promise<void>) => (...args: Args) => Promise<void>;
|
|
17
|
+
export declare function registerLaneTrackerCommands(parent: Command, deps: LaneTrackerCommandDeps, wrap: WrapHandler): void;
|
|
18
|
+
export declare function defaultTrackerActor(): string | null;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=lanes-tracker.d.ts.map
|