@batonfx/skills 0.1.0 → 0.2.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/.turbo/turbo-build.log +2 -2
- package/dist/index.js +342 -56
- package/package.json +2 -2
- package/src/skill-loader.ts +8 -4
package/.turbo/turbo-build.log
CHANGED
package/dist/index.js
CHANGED
|
@@ -8203,6 +8203,7 @@ function resolveAt(key) {
|
|
|
8203
8203
|
}
|
|
8204
8204
|
var resolveIdentifier = /* @__PURE__ */ resolveAt("identifier");
|
|
8205
8205
|
var resolveTitle = /* @__PURE__ */ resolveAt("title");
|
|
8206
|
+
var resolveDescription = /* @__PURE__ */ resolveAt("description");
|
|
8206
8207
|
var resolveBrands = /* @__PURE__ */ resolveAt("brands");
|
|
8207
8208
|
var getExpected = /* @__PURE__ */ memoize((ast) => {
|
|
8208
8209
|
const identifier2 = resolveIdentifier(ast);
|
|
@@ -11172,6 +11173,7 @@ function runChecks(checks, s) {
|
|
|
11172
11173
|
var ClassTypeId = "~effect/Schema/Class";
|
|
11173
11174
|
var STRUCTURAL_ANNOTATION_KEY = "~structural";
|
|
11174
11175
|
var resolveIdentifier2 = resolveIdentifier;
|
|
11176
|
+
var resolveDescription2 = resolveDescription;
|
|
11175
11177
|
function isJson(u) {
|
|
11176
11178
|
const onPath = new Set;
|
|
11177
11179
|
const validated = new Set;
|
|
@@ -34373,7 +34375,275 @@ var exports_skill_loader = {};
|
|
|
34373
34375
|
__export(exports_skill_loader, {
|
|
34374
34376
|
layer: () => layer2
|
|
34375
34377
|
});
|
|
34378
|
+
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/unstable/ai/Tool.js
|
|
34379
|
+
var exports_Tool = {};
|
|
34380
|
+
__export(exports_Tool, {
|
|
34381
|
+
unsafeSecureJsonParse: () => unsafeSecureJsonParse,
|
|
34382
|
+
providerDefined: () => providerDefined,
|
|
34383
|
+
make: () => make33,
|
|
34384
|
+
isUserDefined: () => isUserDefined,
|
|
34385
|
+
isProviderDefined: () => isProviderDefined,
|
|
34386
|
+
isEmptyParamsRecord: () => isEmptyParamsRecord,
|
|
34387
|
+
isDynamic: () => isDynamic,
|
|
34388
|
+
getStrictMode: () => getStrictMode,
|
|
34389
|
+
getJsonSchemaFromSchema: () => getJsonSchemaFromSchema,
|
|
34390
|
+
getJsonSchema: () => getJsonSchema,
|
|
34391
|
+
getDescription: () => getDescription,
|
|
34392
|
+
dynamic: () => dynamic,
|
|
34393
|
+
TypeId: () => TypeId37,
|
|
34394
|
+
Title: () => Title,
|
|
34395
|
+
Strict: () => Strict,
|
|
34396
|
+
Readonly: () => Readonly,
|
|
34397
|
+
ProviderDefinedTypeId: () => ProviderDefinedTypeId,
|
|
34398
|
+
OpenWorld: () => OpenWorld,
|
|
34399
|
+
NameMapper: () => NameMapper,
|
|
34400
|
+
Meta: () => Meta,
|
|
34401
|
+
Idempotent: () => Idempotent,
|
|
34402
|
+
EmptyParams: () => EmptyParams,
|
|
34403
|
+
DynamicTypeId: () => DynamicTypeId,
|
|
34404
|
+
Destructive: () => Destructive
|
|
34405
|
+
});
|
|
34406
|
+
var TypeId37 = "~effect/ai/Tool";
|
|
34407
|
+
var ProviderDefinedTypeId = "~effect/ai/Tool/ProviderDefined";
|
|
34408
|
+
var DynamicTypeId = "~effect/ai/Tool/Dynamic";
|
|
34409
|
+
var isUserDefined = (u) => hasProperty(u, TypeId37) && !isProviderDefined(u) && !isDynamic(u);
|
|
34410
|
+
var isProviderDefined = (u) => hasProperty(u, ProviderDefinedTypeId);
|
|
34411
|
+
var isDynamic = (u) => hasProperty(u, DynamicTypeId);
|
|
34412
|
+
var Proto5 = {
|
|
34413
|
+
[TypeId37]: {
|
|
34414
|
+
_Requirements: identity
|
|
34415
|
+
},
|
|
34416
|
+
pipe() {
|
|
34417
|
+
return pipeArguments(this, arguments);
|
|
34418
|
+
},
|
|
34419
|
+
addDependency() {
|
|
34420
|
+
return userDefinedProto({
|
|
34421
|
+
...this
|
|
34422
|
+
});
|
|
34423
|
+
},
|
|
34424
|
+
setParameters(parametersSchema) {
|
|
34425
|
+
return userDefinedProto({
|
|
34426
|
+
...this,
|
|
34427
|
+
parametersSchema
|
|
34428
|
+
});
|
|
34429
|
+
},
|
|
34430
|
+
setSuccess(successSchema) {
|
|
34431
|
+
return userDefinedProto({
|
|
34432
|
+
...this,
|
|
34433
|
+
successSchema
|
|
34434
|
+
});
|
|
34435
|
+
},
|
|
34436
|
+
setFailure(failureSchema) {
|
|
34437
|
+
return userDefinedProto({
|
|
34438
|
+
...this,
|
|
34439
|
+
failureSchema
|
|
34440
|
+
});
|
|
34441
|
+
},
|
|
34442
|
+
annotate(tag2, value3) {
|
|
34443
|
+
return userDefinedProto({
|
|
34444
|
+
...this,
|
|
34445
|
+
annotations: add(this.annotations, tag2, value3)
|
|
34446
|
+
});
|
|
34447
|
+
},
|
|
34448
|
+
annotateMerge(context4) {
|
|
34449
|
+
return userDefinedProto({
|
|
34450
|
+
...this,
|
|
34451
|
+
annotations: merge(this.annotations, context4)
|
|
34452
|
+
});
|
|
34453
|
+
}
|
|
34454
|
+
};
|
|
34455
|
+
var ProviderDefinedProto = {
|
|
34456
|
+
...Proto5,
|
|
34457
|
+
[ProviderDefinedTypeId]: ProviderDefinedTypeId
|
|
34458
|
+
};
|
|
34459
|
+
var DynamicProto = {
|
|
34460
|
+
...Proto5,
|
|
34461
|
+
[DynamicTypeId]: DynamicTypeId
|
|
34462
|
+
};
|
|
34463
|
+
var userDefinedProto = (options) => {
|
|
34464
|
+
const self = Object.assign(Object.create(Proto5), options);
|
|
34465
|
+
self.id = `effect/ai/Tool/${options.name}`;
|
|
34466
|
+
return self;
|
|
34467
|
+
};
|
|
34468
|
+
var providerDefinedProto = (options) => Object.assign(Object.create(ProviderDefinedProto), {
|
|
34469
|
+
...options
|
|
34470
|
+
});
|
|
34471
|
+
var dynamicProto = (options) => {
|
|
34472
|
+
const self = Object.assign(Object.create(DynamicProto), options);
|
|
34473
|
+
self.id = `effect/ai/Tool/${options.name}`;
|
|
34474
|
+
return self;
|
|
34475
|
+
};
|
|
34476
|
+
var make33 = (name, options) => {
|
|
34477
|
+
const successSchema = options?.success ?? Void2;
|
|
34478
|
+
const failureSchema = options?.failure ?? Never2;
|
|
34479
|
+
return userDefinedProto({
|
|
34480
|
+
name,
|
|
34481
|
+
description: options?.description,
|
|
34482
|
+
parametersSchema: options?.parameters ?? EmptyParams,
|
|
34483
|
+
successSchema,
|
|
34484
|
+
failureSchema,
|
|
34485
|
+
failureMode: options?.failureMode ?? "error",
|
|
34486
|
+
annotations: empty(),
|
|
34487
|
+
needsApproval: options?.needsApproval
|
|
34488
|
+
});
|
|
34489
|
+
};
|
|
34490
|
+
var dynamic = (name, options) => {
|
|
34491
|
+
const successSchema = options?.success ?? Unknown2;
|
|
34492
|
+
const failureSchema = options?.failure ?? Never2;
|
|
34493
|
+
const rawParameters = options?.parameters ?? Unknown2;
|
|
34494
|
+
const isEffectSchema = isSchema(rawParameters);
|
|
34495
|
+
const parametersSchema = isEffectSchema ? rawParameters : Unknown2;
|
|
34496
|
+
const jsonSchema = isEffectSchema ? undefined : rawParameters;
|
|
34497
|
+
return dynamicProto({
|
|
34498
|
+
name,
|
|
34499
|
+
description: options?.description,
|
|
34500
|
+
parametersSchema,
|
|
34501
|
+
successSchema,
|
|
34502
|
+
failureSchema,
|
|
34503
|
+
failureMode: options?.failureMode ?? "error",
|
|
34504
|
+
annotations: empty(),
|
|
34505
|
+
needsApproval: options?.needsApproval,
|
|
34506
|
+
jsonSchema
|
|
34507
|
+
});
|
|
34508
|
+
};
|
|
34509
|
+
var providerDefined = (options) => (args2) => {
|
|
34510
|
+
const failureMode = isNotUndefined(args2) && "failureMode" in args2 ? args2.failureMode : undefined;
|
|
34511
|
+
const successSchema = options?.success ?? Void2;
|
|
34512
|
+
const failureSchema = options?.failure ?? Never2;
|
|
34513
|
+
return providerDefinedProto({
|
|
34514
|
+
id: options.id,
|
|
34515
|
+
name: options.customName,
|
|
34516
|
+
providerName: options.providerName,
|
|
34517
|
+
args: args2,
|
|
34518
|
+
argsSchema: options?.args ?? Void2,
|
|
34519
|
+
requiresHandler: options.requiresHandler ?? false,
|
|
34520
|
+
parametersSchema: options?.parameters ?? Void2,
|
|
34521
|
+
successSchema,
|
|
34522
|
+
failureSchema,
|
|
34523
|
+
failureMode: failureMode ?? "error"
|
|
34524
|
+
});
|
|
34525
|
+
};
|
|
34526
|
+
|
|
34527
|
+
class NameMapper {
|
|
34528
|
+
#customToProvider = /* @__PURE__ */ new Map;
|
|
34529
|
+
#providerToCustom = /* @__PURE__ */ new Map;
|
|
34530
|
+
constructor(tools) {
|
|
34531
|
+
for (const tool of tools) {
|
|
34532
|
+
if (isProviderDefined(tool)) {
|
|
34533
|
+
this.#customToProvider.set(tool.name, tool.providerName);
|
|
34534
|
+
this.#providerToCustom.set(tool.providerName, tool.name);
|
|
34535
|
+
}
|
|
34536
|
+
}
|
|
34537
|
+
}
|
|
34538
|
+
get customNames() {
|
|
34539
|
+
return Array.from(this.#customToProvider.keys());
|
|
34540
|
+
}
|
|
34541
|
+
get providerNames() {
|
|
34542
|
+
return Array.from(this.#providerToCustom.keys());
|
|
34543
|
+
}
|
|
34544
|
+
getCustomName(providerName) {
|
|
34545
|
+
return this.#providerToCustom.get(providerName) ?? providerName;
|
|
34546
|
+
}
|
|
34547
|
+
getProviderName(customName) {
|
|
34548
|
+
return this.#customToProvider.get(customName) ?? customName;
|
|
34549
|
+
}
|
|
34550
|
+
}
|
|
34551
|
+
var getDescription = (tool) => {
|
|
34552
|
+
if (tool.description !== undefined) {
|
|
34553
|
+
return tool.description;
|
|
34554
|
+
}
|
|
34555
|
+
if (isSchema(tool.parametersSchema)) {
|
|
34556
|
+
return resolveDescription2(tool.parametersSchema.ast);
|
|
34557
|
+
}
|
|
34558
|
+
return;
|
|
34559
|
+
};
|
|
34560
|
+
var getJsonSchema = (tool, options) => {
|
|
34561
|
+
if (isDynamic(tool) && tool.jsonSchema !== undefined) {
|
|
34562
|
+
return tool.jsonSchema;
|
|
34563
|
+
}
|
|
34564
|
+
return getJsonSchemaFromSchema(tool.parametersSchema, options);
|
|
34565
|
+
};
|
|
34566
|
+
var getJsonSchemaFromSchema = (schema, options) => {
|
|
34567
|
+
if (isNotUndefined(options?.transformer)) {
|
|
34568
|
+
return options.transformer(schema).jsonSchema;
|
|
34569
|
+
}
|
|
34570
|
+
const document = toJsonSchemaDocument2(schema);
|
|
34571
|
+
if (Object.keys(document.definitions).length > 0) {
|
|
34572
|
+
document.schema.$defs = document.definitions;
|
|
34573
|
+
}
|
|
34574
|
+
return document.schema;
|
|
34575
|
+
};
|
|
34576
|
+
|
|
34577
|
+
class Title extends (/* @__PURE__ */ Service()("effect/ai/Tool/Title")) {
|
|
34578
|
+
}
|
|
34376
34579
|
|
|
34580
|
+
class Meta extends (/* @__PURE__ */ Service()("effect/ai/Tool/Meta")) {
|
|
34581
|
+
}
|
|
34582
|
+
var Readonly = /* @__PURE__ */ Reference("effect/ai/Tool/Readonly", {
|
|
34583
|
+
defaultValue: constFalse
|
|
34584
|
+
});
|
|
34585
|
+
var Destructive = /* @__PURE__ */ Reference("effect/ai/Tool/Destructive", {
|
|
34586
|
+
defaultValue: constTrue
|
|
34587
|
+
});
|
|
34588
|
+
var Idempotent = /* @__PURE__ */ Reference("effect/ai/Tool/Idempotent", {
|
|
34589
|
+
defaultValue: constFalse
|
|
34590
|
+
});
|
|
34591
|
+
var OpenWorld = /* @__PURE__ */ Reference("effect/ai/Tool/OpenWorld", {
|
|
34592
|
+
defaultValue: constTrue
|
|
34593
|
+
});
|
|
34594
|
+
var Strict = /* @__PURE__ */ Reference("effect/ai/Tool/Strict", {
|
|
34595
|
+
defaultValue: () => {
|
|
34596
|
+
return;
|
|
34597
|
+
}
|
|
34598
|
+
});
|
|
34599
|
+
var getStrictMode = (tool) => get(tool.annotations, Strict);
|
|
34600
|
+
var suspectProtoRx = /"__proto__"\s*:/;
|
|
34601
|
+
var suspectConstructorRx = /"constructor"\s*:/;
|
|
34602
|
+
function _parse(text) {
|
|
34603
|
+
const obj = JSON.parse(text);
|
|
34604
|
+
if (obj === null || typeof obj !== "object") {
|
|
34605
|
+
return obj;
|
|
34606
|
+
}
|
|
34607
|
+
if (suspectProtoRx.test(text) === false && suspectConstructorRx.test(text) === false) {
|
|
34608
|
+
return obj;
|
|
34609
|
+
}
|
|
34610
|
+
return filter13(obj);
|
|
34611
|
+
}
|
|
34612
|
+
function filter13(obj) {
|
|
34613
|
+
let next2 = [obj];
|
|
34614
|
+
while (next2.length) {
|
|
34615
|
+
const nodes = next2;
|
|
34616
|
+
next2 = [];
|
|
34617
|
+
for (const node of nodes) {
|
|
34618
|
+
if (Object.prototype.hasOwnProperty.call(node, "__proto__")) {
|
|
34619
|
+
throw new SyntaxError("Object contains forbidden prototype property");
|
|
34620
|
+
}
|
|
34621
|
+
if (Object.prototype.hasOwnProperty.call(node, "constructor") && Object.prototype.hasOwnProperty.call(node.constructor, "prototype")) {
|
|
34622
|
+
throw new SyntaxError("Object contains forbidden prototype property");
|
|
34623
|
+
}
|
|
34624
|
+
for (const key in node) {
|
|
34625
|
+
const value3 = node[key];
|
|
34626
|
+
if (value3 && typeof value3 === "object") {
|
|
34627
|
+
next2.push(value3);
|
|
34628
|
+
}
|
|
34629
|
+
}
|
|
34630
|
+
}
|
|
34631
|
+
}
|
|
34632
|
+
return obj;
|
|
34633
|
+
}
|
|
34634
|
+
var unsafeSecureJsonParse = (text) => {
|
|
34635
|
+
const prevLimit = getStackTraceLimit();
|
|
34636
|
+
setStackTraceLimit(0);
|
|
34637
|
+
try {
|
|
34638
|
+
return _parse(text);
|
|
34639
|
+
} finally {
|
|
34640
|
+
setStackTraceLimit(prevLimit);
|
|
34641
|
+
}
|
|
34642
|
+
};
|
|
34643
|
+
var EmptyParams = /* @__PURE__ */ Record(String5, Never2);
|
|
34644
|
+
function isEmptyParamsRecord(indexSignature) {
|
|
34645
|
+
return indexSignature.parameter === string2 && isNever2(indexSignature.type);
|
|
34646
|
+
}
|
|
34377
34647
|
// ../core/src/agent-event.ts
|
|
34378
34648
|
class AgentError extends exports_Schema.TaggedErrorClass()("@batonfx/core/AgentError", {
|
|
34379
34649
|
message: exports_Schema.String,
|
|
@@ -34575,56 +34845,6 @@ var allowAll = exports_Layer.succeed(Permissions, Permissions.of({
|
|
|
34575
34845
|
await: () => exports_Effect.succeed(exports_Option.none())
|
|
34576
34846
|
}));
|
|
34577
34847
|
|
|
34578
|
-
// ../core/src/steering.ts
|
|
34579
|
-
class Steering extends exports_Context.Service()("@batonfx/core/Steering") {
|
|
34580
|
-
}
|
|
34581
|
-
|
|
34582
|
-
// ../core/src/tool-context.ts
|
|
34583
|
-
class ToolContext extends exports_Context.Service()("@batonfx/core/ToolContext") {
|
|
34584
|
-
}
|
|
34585
|
-
var layerDefault = exports_Layer.sync(ToolContext, () => ToolContext.of({
|
|
34586
|
-
signal: new AbortController().signal,
|
|
34587
|
-
emit: () => exports_Effect.void,
|
|
34588
|
-
sessionId: "local"
|
|
34589
|
-
}));
|
|
34590
|
-
|
|
34591
|
-
// ../core/src/tool-executor.ts
|
|
34592
|
-
class ToolExecutor extends exports_Context.Service()("@batonfx/core/ToolExecutor") {
|
|
34593
|
-
}
|
|
34594
|
-
|
|
34595
|
-
// ../core/src/turn-policy.ts
|
|
34596
|
-
var decision = {
|
|
34597
|
-
continue: (overrides) => ({
|
|
34598
|
-
_tag: "Continue",
|
|
34599
|
-
...overrides === undefined ? {} : { overrides }
|
|
34600
|
-
}),
|
|
34601
|
-
stop: { _tag: "Stop" }
|
|
34602
|
-
};
|
|
34603
|
-
var make33 = (decide) => ({ decide });
|
|
34604
|
-
var recurs2 = (n) => make33((info) => exports_Effect.succeed(info.turn < n + 1 ? decision.continue() : decision.stop));
|
|
34605
|
-
var defaultPolicy = recurs2(8);
|
|
34606
|
-
// ../core/src/agent-tool.ts
|
|
34607
|
-
var defaultParameters = exports_Schema.Struct({ prompt: exports_Schema.String });
|
|
34608
|
-
// ../core/src/handoff.ts
|
|
34609
|
-
var defaultTransferParameters = exports_Schema.Struct({ prompt: exports_Schema.String });
|
|
34610
|
-
// ../core/src/model-registry.ts
|
|
34611
|
-
class LanguageModelNotRegistered extends exports_Schema.TaggedErrorClass()("LanguageModelNotRegistered", {
|
|
34612
|
-
provider: exports_Schema.String,
|
|
34613
|
-
model: exports_Schema.String,
|
|
34614
|
-
registration_key: exports_Schema.optionalKey(exports_Schema.String)
|
|
34615
|
-
}) {
|
|
34616
|
-
}
|
|
34617
|
-
|
|
34618
|
-
class Service2 extends exports_Context.Service()("@batonfx/core/ModelRegistry") {
|
|
34619
|
-
}
|
|
34620
|
-
var register = exports_Effect.fn("ModelRegistry.register.call")(function* (input) {
|
|
34621
|
-
const service4 = yield* Service2;
|
|
34622
|
-
return yield* service4.register(input);
|
|
34623
|
-
});
|
|
34624
|
-
var registrations = exports_Effect.fn("ModelRegistry.registrations.call")(function* () {
|
|
34625
|
-
const service4 = yield* Service2;
|
|
34626
|
-
return yield* service4.registrations;
|
|
34627
|
-
});
|
|
34628
34848
|
// ../core/src/skill-source.ts
|
|
34629
34849
|
var exports_skill_source = {};
|
|
34630
34850
|
__export(exports_skill_source, {
|
|
@@ -34680,6 +34900,70 @@ var selectListings = (skills, budgetTokens, recentlyUsed) => {
|
|
|
34680
34900
|
}
|
|
34681
34901
|
return selected;
|
|
34682
34902
|
};
|
|
34903
|
+
|
|
34904
|
+
// ../core/src/steering.ts
|
|
34905
|
+
class Steering extends exports_Context.Service()("@batonfx/core/Steering") {
|
|
34906
|
+
}
|
|
34907
|
+
|
|
34908
|
+
// ../core/src/tool-context.ts
|
|
34909
|
+
class ToolContext extends exports_Context.Service()("@batonfx/core/ToolContext") {
|
|
34910
|
+
}
|
|
34911
|
+
var layerDefault = exports_Layer.sync(ToolContext, () => ToolContext.of({
|
|
34912
|
+
signal: new AbortController().signal,
|
|
34913
|
+
emit: () => exports_Effect.void,
|
|
34914
|
+
sessionId: "local"
|
|
34915
|
+
}));
|
|
34916
|
+
|
|
34917
|
+
// ../core/src/tool-executor.ts
|
|
34918
|
+
class ToolExecutor extends exports_Context.Service()("@batonfx/core/ToolExecutor") {
|
|
34919
|
+
}
|
|
34920
|
+
|
|
34921
|
+
// ../core/src/turn-policy.ts
|
|
34922
|
+
var decision = {
|
|
34923
|
+
continue: (overrides) => ({
|
|
34924
|
+
_tag: "Continue",
|
|
34925
|
+
...overrides === undefined ? {} : { overrides }
|
|
34926
|
+
}),
|
|
34927
|
+
stop: { _tag: "Stop" }
|
|
34928
|
+
};
|
|
34929
|
+
var make34 = (decide) => ({ decide });
|
|
34930
|
+
var recurs2 = (n) => make34((info) => exports_Effect.succeed(info.turn < n + 1 ? decision.continue() : decision.stop));
|
|
34931
|
+
var defaultPolicy = recurs2(8);
|
|
34932
|
+
|
|
34933
|
+
// ../core/src/agent.ts
|
|
34934
|
+
var activateSkillToolName = "activate_skill";
|
|
34935
|
+
var activateSkillParameters = exports_Schema.Struct({ name: exports_Schema.String });
|
|
34936
|
+
var activateSkillTool = exports_Tool.make(activateSkillToolName, {
|
|
34937
|
+
description: "Load the full body for one listed Baton skill by name before applying that skill.",
|
|
34938
|
+
parameters: activateSkillParameters,
|
|
34939
|
+
success: exports_Schema.Struct({
|
|
34940
|
+
name: exports_Schema.String,
|
|
34941
|
+
body: exports_Schema.String,
|
|
34942
|
+
allowedTools: exports_Schema.Array(exports_Schema.String)
|
|
34943
|
+
})
|
|
34944
|
+
});
|
|
34945
|
+
// ../core/src/agent-tool.ts
|
|
34946
|
+
var defaultParameters = exports_Schema.Struct({ prompt: exports_Schema.String });
|
|
34947
|
+
// ../core/src/handoff.ts
|
|
34948
|
+
var defaultTransferParameters = exports_Schema.Struct({ prompt: exports_Schema.String });
|
|
34949
|
+
// ../core/src/model-registry.ts
|
|
34950
|
+
class LanguageModelNotRegistered extends exports_Schema.TaggedErrorClass()("LanguageModelNotRegistered", {
|
|
34951
|
+
provider: exports_Schema.String,
|
|
34952
|
+
model: exports_Schema.String,
|
|
34953
|
+
registration_key: exports_Schema.optionalKey(exports_Schema.String)
|
|
34954
|
+
}) {
|
|
34955
|
+
}
|
|
34956
|
+
|
|
34957
|
+
class Service2 extends exports_Context.Service()("@batonfx/core/ModelRegistry") {
|
|
34958
|
+
}
|
|
34959
|
+
var register = exports_Effect.fn("ModelRegistry.register.call")(function* (input) {
|
|
34960
|
+
const service4 = yield* Service2;
|
|
34961
|
+
return yield* service4.register(input);
|
|
34962
|
+
});
|
|
34963
|
+
var registrations = exports_Effect.fn("ModelRegistry.registrations.call")(function* () {
|
|
34964
|
+
const service4 = yield* Service2;
|
|
34965
|
+
return yield* service4.registrations;
|
|
34966
|
+
});
|
|
34683
34967
|
// src/skill-loader.ts
|
|
34684
34968
|
var DEFAULT_ROOTS = [".agents/skills", ".claude/skills", ".pi/skills"];
|
|
34685
34969
|
var decoder3 = new TextDecoder;
|
|
@@ -34777,20 +35061,22 @@ var parseHeader = (source, block) => exports_Effect.sync(() => {
|
|
|
34777
35061
|
}
|
|
34778
35062
|
return parsed;
|
|
34779
35063
|
}).pipe(exports_Effect.catchCause((cause) => exports_Effect.fail(sourceError(source, "Invalid SKILL.md frontmatter", cause))));
|
|
34780
|
-
var splitDocument = (source, content) => exports_Effect.
|
|
35064
|
+
var splitDocument = (source, content) => exports_Effect.gen(function* () {
|
|
34781
35065
|
const normalized = content.replace(/^\uFEFF/, "").replace(/\r\n/g, `
|
|
34782
35066
|
`);
|
|
34783
35067
|
const lines = normalized.split(`
|
|
34784
35068
|
`);
|
|
34785
|
-
if (lines[0] !== "---")
|
|
34786
|
-
|
|
35069
|
+
if (lines[0] !== "---") {
|
|
35070
|
+
return yield* exports_Effect.fail(sourceError(source, "Invalid SKILL.md document: missing opening frontmatter fence"));
|
|
35071
|
+
}
|
|
34787
35072
|
const close2 = lines.findIndex((line, index2) => index2 > 0 && line === "---");
|
|
34788
|
-
if (close2 === -1)
|
|
34789
|
-
|
|
35073
|
+
if (close2 === -1) {
|
|
35074
|
+
return yield* exports_Effect.fail(sourceError(source, "Invalid SKILL.md document: missing closing frontmatter fence"));
|
|
35075
|
+
}
|
|
34790
35076
|
return [lines.slice(1, close2).join(`
|
|
34791
35077
|
`), lines.slice(close2 + 1).join(`
|
|
34792
35078
|
`)];
|
|
34793
|
-
})
|
|
35079
|
+
});
|
|
34794
35080
|
var namespacedName = (path, relativeFile, explicitName) => {
|
|
34795
35081
|
const directory = path.dirname(relativeFile);
|
|
34796
35082
|
const segments = directory === "." ? [] : directory.split("/").filter((part) => part.length > 0);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@batonfx/skills",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"typecheck": "bun tsc --noEmit"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@batonfx/core": "0.
|
|
17
|
+
"@batonfx/core": "0.2.0",
|
|
18
18
|
"effect": "4.0.0-beta.93"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
package/src/skill-loader.ts
CHANGED
|
@@ -126,14 +126,18 @@ const splitDocument = (
|
|
|
126
126
|
source: string,
|
|
127
127
|
content: string,
|
|
128
128
|
): Effect.Effect<readonly [string, string], SkillSource.SkillSourceError> =>
|
|
129
|
-
Effect.
|
|
129
|
+
Effect.gen(function* () {
|
|
130
130
|
const normalized = content.replace(/^\uFEFF/, "").replace(/\r\n/g, "\n")
|
|
131
131
|
const lines = normalized.split("\n")
|
|
132
|
-
if (lines[0] !== "---")
|
|
132
|
+
if (lines[0] !== "---") {
|
|
133
|
+
return yield* Effect.fail(sourceError(source, "Invalid SKILL.md document: missing opening frontmatter fence"))
|
|
134
|
+
}
|
|
133
135
|
const close = lines.findIndex((line, index) => index > 0 && line === "---")
|
|
134
|
-
if (close === -1)
|
|
136
|
+
if (close === -1) {
|
|
137
|
+
return yield* Effect.fail(sourceError(source, "Invalid SKILL.md document: missing closing frontmatter fence"))
|
|
138
|
+
}
|
|
135
139
|
return [lines.slice(1, close).join("\n"), lines.slice(close + 1).join("\n")] as const
|
|
136
|
-
})
|
|
140
|
+
})
|
|
137
141
|
|
|
138
142
|
const namespacedName = (path: Path.Path, relativeFile: string, explicitName: string | undefined): string => {
|
|
139
143
|
const directory = path.dirname(relativeFile)
|